diff --git a/.gitattributes b/.gitattributes index 0bd2b456e3207a89d49c27ac4a11085b4d8ec9ce..3b5aa410eeabbd30a3d91162ba6c3544ae2ee832 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2689,3 +2689,37 @@ miniconda3/pkgs/ncurses-6.5-h7934f7d_0/lib/libtinfow.a filter=lfs diff=lfs merge miniconda3/pkgs/ncurses-6.5-h7934f7d_0/lib/libtinfow.so filter=lfs diff=lfs merge=lfs -text miniconda3/pkgs/ncurses-6.5-h7934f7d_0/lib/libtinfow.so.6 filter=lfs diff=lfs merge=lfs -text miniconda3/pkgs/ncurses-6.5-h7934f7d_0/lib/libtinfow.so.6.5 filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/bin/openssl filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libcrypto.so filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libcrypto.so.3 filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libcrypto.a filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libssl.a filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libssl.so filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libssl.so.3 filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/pcre2-10.46-hf426167_0/bin/pcre2grep filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/pcre2-10.46-hf426167_0/bin/pcre2test filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-16.a filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-16.so filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-16.so.0 filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-16.so.0.14.0 filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-32.a filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-32.so filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-32.so.0 filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-32.so.0.14.0 filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-8.a filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-8.so filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-8.so.0.14.0 filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-8.so.0 filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/pip-26.0.1-pyhc872135_0/site-packages/pip/_vendor/distlib/t64-arm.exe filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/pip-26.0.1-pyhc872135_0/site-packages/pip/_vendor/distlib/t64.exe filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/pip-26.0.1-pyhc872135_0/site-packages/pip/_vendor/distlib/w64-arm.exe filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/pip-26.0.1-pyhc872135_0/site-packages/pip/_vendor/distlib/w64.exe filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/pydantic-core-2.41.5-py313h498d7c9_1/lib/python3.13/site-packages/pydantic_core/_pydantic_core.cpython-313-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/python-3.10.20-h741d88c_0/bin/python filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/python-3.10.20-h741d88c_0/bin/python3 filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/python-3.10.20-h741d88c_0/bin/python3.1 filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/python-3.10.20-h741d88c_0/bin/python3.10 filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/libpython3.10.so filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/libpython3.10.so.1.0 filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/python3.10/ensurepip/_bundled/pip-23.0.1-py3-none-any.whl filter=lfs diff=lfs merge=lfs -text +miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/python3.10/ensurepip/_bundled/setuptools-79.0.1-py3-none-any.whl filter=lfs diff=lfs merge=lfs -text diff --git a/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/bin/openssl b/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/bin/openssl new file mode 100644 index 0000000000000000000000000000000000000000..b54b83262b6f8a45665024b512a73f9a5f880228 --- /dev/null +++ b/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/bin/openssl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:09f90ca28cef324a98b56ab8951d093ead0a9b63a93f1052e381bbf2a50fcff0 +size 1239560 diff --git a/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libcrypto.a b/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libcrypto.a new file mode 100644 index 0000000000000000000000000000000000000000..ebe0339e9ec20de68f10d067cf55588d0f22afd2 --- /dev/null +++ b/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libcrypto.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62c6b5421d0641309c19af4a41b093e166357f95d9851ec7850b350194ab6e74 +size 14315674 diff --git a/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libcrypto.so b/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libcrypto.so new file mode 100644 index 0000000000000000000000000000000000000000..aaec18639cbaf65b90c779c0135fbe34f65c055e --- /dev/null +++ b/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libcrypto.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2de5559a6c904e20e3bb99a83ca0640e0e241577a8a807263276be6970db256f +size 7093048 diff --git a/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libcrypto.so.3 b/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libcrypto.so.3 new file mode 100644 index 0000000000000000000000000000000000000000..aaec18639cbaf65b90c779c0135fbe34f65c055e --- /dev/null +++ b/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libcrypto.so.3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2de5559a6c904e20e3bb99a83ca0640e0e241577a8a807263276be6970db256f +size 7093048 diff --git a/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libssl.a b/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libssl.a new file mode 100644 index 0000000000000000000000000000000000000000..4183ac5f339634e4ac3878beb19826f31d346b9f --- /dev/null +++ b/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libssl.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5f7e2480e5a9bc54aaf7bb4bef58e5c1c82eaa69c2ac42751c68c2d7bd695914 +size 2473092 diff --git a/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libssl.so b/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libssl.so new file mode 100644 index 0000000000000000000000000000000000000000..911dc1632c2c0daf2897e74315370002ff8d4d8c --- /dev/null +++ b/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libssl.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:32ab2466919492e728b8cfff3437c2f9f95d9abef17e0b8411aff02fbb55c160 +size 1202056 diff --git a/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libssl.so.3 b/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libssl.so.3 new file mode 100644 index 0000000000000000000000000000000000000000..911dc1632c2c0daf2897e74315370002ff8d4d8c --- /dev/null +++ b/miniconda3/pkgs/openssl-3.5.5-h1b28b03_0/lib/libssl.so.3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:32ab2466919492e728b8cfff3437c2f9f95d9abef17e0b8411aff02fbb55c160 +size 1202056 diff --git a/miniconda3/pkgs/pcre2-10.46-hf426167_0/bin/pcre2grep b/miniconda3/pkgs/pcre2-10.46-hf426167_0/bin/pcre2grep new file mode 100644 index 0000000000000000000000000000000000000000..f6290c953c58f0e759e492369dfe645f6aba5c0c --- /dev/null +++ b/miniconda3/pkgs/pcre2-10.46-hf426167_0/bin/pcre2grep @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3e9f9c10031460fe3aad59ccd66e65846e22f98efbf153c184c6cd9044073c2a +size 697224 diff --git a/miniconda3/pkgs/pcre2-10.46-hf426167_0/bin/pcre2test b/miniconda3/pkgs/pcre2-10.46-hf426167_0/bin/pcre2test new file mode 100644 index 0000000000000000000000000000000000000000..d03d284f68ec37460dd8207efb59c9b228602992 --- /dev/null +++ b/miniconda3/pkgs/pcre2-10.46-hf426167_0/bin/pcre2test @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:330b63235d94d717e048498c99c4744e17e29ee87b9ef083f38fb1e78459b408 +size 2134520 diff --git a/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-16.a b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-16.a new file mode 100644 index 0000000000000000000000000000000000000000..dfe153d58326151c266b1d4af08138af1018469c --- /dev/null +++ b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-16.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:216adf769b76590ea6e0fc74f2fba747b2a13aa6dd08384aa44c40d22643f4c1 +size 961802 diff --git a/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-16.so b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-16.so new file mode 100644 index 0000000000000000000000000000000000000000..25c49da8e81a9f79c14fce766593b720791adeb0 --- /dev/null +++ b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-16.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef74620fddb080073569182e363cc7dad54ff98a26164d6bdc3d605a6096615c +size 669320 diff --git a/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-16.so.0 b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-16.so.0 new file mode 100644 index 0000000000000000000000000000000000000000..25c49da8e81a9f79c14fce766593b720791adeb0 --- /dev/null +++ b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-16.so.0 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef74620fddb080073569182e363cc7dad54ff98a26164d6bdc3d605a6096615c +size 669320 diff --git a/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-16.so.0.14.0 b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-16.so.0.14.0 new file mode 100644 index 0000000000000000000000000000000000000000..25c49da8e81a9f79c14fce766593b720791adeb0 --- /dev/null +++ b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-16.so.0.14.0 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ef74620fddb080073569182e363cc7dad54ff98a26164d6bdc3d605a6096615c +size 669320 diff --git a/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-32.a b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-32.a new file mode 100644 index 0000000000000000000000000000000000000000..5bed08fcb58c1bbd286201829255834ef313b6db --- /dev/null +++ b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-32.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00d9901eba196e1328a71955dc2d8e25bedb36bb8b859ddcde9593e681ba6c43 +size 925474 diff --git a/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-32.so b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-32.so new file mode 100644 index 0000000000000000000000000000000000000000..d17212af0b425f56f6d93dd22b53284827da085a --- /dev/null +++ b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-32.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a5d1dee2aa875bcf2982d1b3604121ed5b077e958e4a33225f48694fb6b1b6d +size 636520 diff --git a/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-32.so.0 b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-32.so.0 new file mode 100644 index 0000000000000000000000000000000000000000..d17212af0b425f56f6d93dd22b53284827da085a --- /dev/null +++ b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-32.so.0 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a5d1dee2aa875bcf2982d1b3604121ed5b077e958e4a33225f48694fb6b1b6d +size 636520 diff --git a/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-32.so.0.14.0 b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-32.so.0.14.0 new file mode 100644 index 0000000000000000000000000000000000000000..d17212af0b425f56f6d93dd22b53284827da085a --- /dev/null +++ b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-32.so.0.14.0 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a5d1dee2aa875bcf2982d1b3604121ed5b077e958e4a33225f48694fb6b1b6d +size 636520 diff --git a/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-8.a b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-8.a new file mode 100644 index 0000000000000000000000000000000000000000..cb52389a998b5eb4055826101064b629b35d40f6 --- /dev/null +++ b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-8.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9946e8d0875080722c597f70cbb5089f75e9ab75c3f848157c31222814cc22ac +size 1028336 diff --git a/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-8.so b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-8.so new file mode 100644 index 0000000000000000000000000000000000000000..f7d1df0e1499dfc212f05b2d7662d8eb85a89333 --- /dev/null +++ b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-8.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3bebef1a08a2a59a3b10e00c928d68bb2d5835819a48ef1e15153b3bf495b5b7 +size 731264 diff --git a/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-8.so.0 b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-8.so.0 new file mode 100644 index 0000000000000000000000000000000000000000..f7d1df0e1499dfc212f05b2d7662d8eb85a89333 --- /dev/null +++ b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-8.so.0 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3bebef1a08a2a59a3b10e00c928d68bb2d5835819a48ef1e15153b3bf495b5b7 +size 731264 diff --git a/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-8.so.0.14.0 b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-8.so.0.14.0 new file mode 100644 index 0000000000000000000000000000000000000000..f7d1df0e1499dfc212f05b2d7662d8eb85a89333 --- /dev/null +++ b/miniconda3/pkgs/pcre2-10.46-hf426167_0/lib/libpcre2-8.so.0.14.0 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3bebef1a08a2a59a3b10e00c928d68bb2d5835819a48ef1e15153b3bf495b5b7 +size 731264 diff --git a/miniconda3/pkgs/pip-26.0.1-pyhc872135_0/site-packages/pip/_vendor/distlib/t64-arm.exe b/miniconda3/pkgs/pip-26.0.1-pyhc872135_0/site-packages/pip/_vendor/distlib/t64-arm.exe new file mode 100644 index 0000000000000000000000000000000000000000..4c236ed0ab8253ceee9276ddc3cf5ed9a7ea6a4c --- /dev/null +++ b/miniconda3/pkgs/pip-26.0.1-pyhc872135_0/site-packages/pip/_vendor/distlib/t64-arm.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ebc4c06b7d95e74e315419ee7e88e1d0f71e9e9477538c00a93a9ff8c66a6cfc +size 182784 diff --git a/miniconda3/pkgs/pip-26.0.1-pyhc872135_0/site-packages/pip/_vendor/distlib/t64.exe b/miniconda3/pkgs/pip-26.0.1-pyhc872135_0/site-packages/pip/_vendor/distlib/t64.exe new file mode 100644 index 0000000000000000000000000000000000000000..3fd3d2df6541617229f21bdbb49fbbfc880b7f50 --- /dev/null +++ b/miniconda3/pkgs/pip-26.0.1-pyhc872135_0/site-packages/pip/_vendor/distlib/t64.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:81a618f21cb87db9076134e70388b6e9cb7c2106739011b6a51772d22cae06b7 +size 108032 diff --git a/miniconda3/pkgs/pip-26.0.1-pyhc872135_0/site-packages/pip/_vendor/distlib/w64-arm.exe b/miniconda3/pkgs/pip-26.0.1-pyhc872135_0/site-packages/pip/_vendor/distlib/w64-arm.exe new file mode 100644 index 0000000000000000000000000000000000000000..bc02472528a32bd70ebfa2b0eca26e34a83fa264 --- /dev/null +++ b/miniconda3/pkgs/pip-26.0.1-pyhc872135_0/site-packages/pip/_vendor/distlib/w64-arm.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c5dc9884a8f458371550e09bd396e5418bf375820a31b9899f6499bf391c7b2e +size 168448 diff --git a/miniconda3/pkgs/pip-26.0.1-pyhc872135_0/site-packages/pip/_vendor/distlib/w64.exe b/miniconda3/pkgs/pip-26.0.1-pyhc872135_0/site-packages/pip/_vendor/distlib/w64.exe new file mode 100644 index 0000000000000000000000000000000000000000..daebd1c30353b2d9b016069da83ad5b4c8ee86bd --- /dev/null +++ b/miniconda3/pkgs/pip-26.0.1-pyhc872135_0/site-packages/pip/_vendor/distlib/w64.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a319ffaba23a017d7b1e18ba726ba6c54c53d6446db55f92af53c279894f8ad +size 101888 diff --git a/miniconda3/pkgs/pydantic-core-2.41.5-py313h498d7c9_1/lib/python3.13/site-packages/pydantic_core/_pydantic_core.cpython-313-x86_64-linux-gnu.so b/miniconda3/pkgs/pydantic-core-2.41.5-py313h498d7c9_1/lib/python3.13/site-packages/pydantic_core/_pydantic_core.cpython-313-x86_64-linux-gnu.so new file mode 100644 index 0000000000000000000000000000000000000000..c53f0a5c537dc9f0190394bb614a380a61d30b92 --- /dev/null +++ b/miniconda3/pkgs/pydantic-core-2.41.5-py313h498d7c9_1/lib/python3.13/site-packages/pydantic_core/_pydantic_core.cpython-313-x86_64-linux-gnu.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e8f9f965cd65f50a7392a7ec6ad98202c24ec96460cf409b3d5013655746f612 +size 5337152 diff --git a/miniconda3/pkgs/python-3.10.20-h741d88c_0/bin/python b/miniconda3/pkgs/python-3.10.20-h741d88c_0/bin/python new file mode 100644 index 0000000000000000000000000000000000000000..a6fcb670e3dd13c95c878167aa4acda21c095e7b --- /dev/null +++ b/miniconda3/pkgs/python-3.10.20-h741d88c_0/bin/python @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc3f1b0946f2d238b4aa14a20ac21f99220ab4871b3953e596b677455f927a0d +size 17460208 diff --git a/miniconda3/pkgs/python-3.10.20-h741d88c_0/bin/python3 b/miniconda3/pkgs/python-3.10.20-h741d88c_0/bin/python3 new file mode 100644 index 0000000000000000000000000000000000000000..a6fcb670e3dd13c95c878167aa4acda21c095e7b --- /dev/null +++ b/miniconda3/pkgs/python-3.10.20-h741d88c_0/bin/python3 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc3f1b0946f2d238b4aa14a20ac21f99220ab4871b3953e596b677455f927a0d +size 17460208 diff --git a/miniconda3/pkgs/python-3.10.20-h741d88c_0/bin/python3.1 b/miniconda3/pkgs/python-3.10.20-h741d88c_0/bin/python3.1 new file mode 100644 index 0000000000000000000000000000000000000000..a6fcb670e3dd13c95c878167aa4acda21c095e7b --- /dev/null +++ b/miniconda3/pkgs/python-3.10.20-h741d88c_0/bin/python3.1 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc3f1b0946f2d238b4aa14a20ac21f99220ab4871b3953e596b677455f927a0d +size 17460208 diff --git a/miniconda3/pkgs/python-3.10.20-h741d88c_0/bin/python3.10 b/miniconda3/pkgs/python-3.10.20-h741d88c_0/bin/python3.10 new file mode 100644 index 0000000000000000000000000000000000000000..a6fcb670e3dd13c95c878167aa4acda21c095e7b --- /dev/null +++ b/miniconda3/pkgs/python-3.10.20-h741d88c_0/bin/python3.10 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc3f1b0946f2d238b4aa14a20ac21f99220ab4871b3953e596b677455f927a0d +size 17460208 diff --git a/miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/libpython3.10.so b/miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/libpython3.10.so new file mode 100644 index 0000000000000000000000000000000000000000..0eff44a816a8d9b3ca14c2b35902eb9809b23317 --- /dev/null +++ b/miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/libpython3.10.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4319d069c2baa7547a9e4957a30691cdc11dc9d064cb67ca6b321f5aa9078365 +size 17416928 diff --git a/miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/libpython3.10.so.1.0 b/miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/libpython3.10.so.1.0 new file mode 100644 index 0000000000000000000000000000000000000000..0eff44a816a8d9b3ca14c2b35902eb9809b23317 --- /dev/null +++ b/miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/libpython3.10.so.1.0 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4319d069c2baa7547a9e4957a30691cdc11dc9d064cb67ca6b321f5aa9078365 +size 17416928 diff --git a/miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/python3.10/ensurepip/_bundled/pip-23.0.1-py3-none-any.whl b/miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/python3.10/ensurepip/_bundled/pip-23.0.1-py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..c7e03d464c9687907f77dc23718365528a05ac0b --- /dev/null +++ b/miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/python3.10/ensurepip/_bundled/pip-23.0.1-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:236bcb61156d76c4b8a05821b988c7b8c35bf0da28a4b614e8d6ab5212c25c6f +size 2055563 diff --git a/miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/python3.10/ensurepip/_bundled/setuptools-79.0.1-py3-none-any.whl b/miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/python3.10/ensurepip/_bundled/setuptools-79.0.1-py3-none-any.whl new file mode 100644 index 0000000000000000000000000000000000000000..5212733b5f175497d40346edd6818b0b61ec37e3 --- /dev/null +++ b/miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/python3.10/ensurepip/_bundled/setuptools-79.0.1-py3-none-any.whl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e147c0549f27767ba362f9da434eab9c5dc0045d5304feb602a0af001089fc51 +size 1256281 diff --git a/miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/python3.10/idlelib/Icons/folder.gif b/miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/python3.10/idlelib/Icons/folder.gif new file mode 100644 index 0000000000000000000000000000000000000000..b8f417629c16e88c45393133a5a2bddadb065dd7 --- /dev/null +++ b/miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/python3.10/idlelib/Icons/folder.gif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c98d566a13fd599d1c11a375f387fef69b6c595c4f18c5d88c188a860be0e55 +size 120 diff --git a/miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/python3.10/idlelib/Icons/idle_16.gif b/miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/python3.10/idlelib/Icons/idle_16.gif new file mode 100644 index 0000000000000000000000000000000000000000..45f0c2ca179d883c56d835a230b64b03b699bc90 --- /dev/null +++ b/miniconda3/pkgs/python-3.10.20-h741d88c_0/lib/python3.10/idlelib/Icons/idle_16.gif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe3af292b38660a8a58b1a8b4fa4240aa190602e7e9a700ea0536b3181fc968e +size 634 diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/gl.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/gl.po new file mode 100644 index 0000000000000000000000000000000000000000..4d82f51e005b9cd60b61b1ac8f57df38595bb725 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/gl.po @@ -0,0 +1,31 @@ +# Galician translation for hello-sh package. +# Copyright (C) 2010 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Leandro Regueiro , 2010-2014. +# +# Proxecto Trasno - Adaptación do software libre á lingua galega: Se desexas +# colaborar connosco, podes atopar máis información en +# +msgid "" +msgstr "" +"Project-Id-Version: hello-sh 0.19-rc1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2014-05-10 16:34+0100\n" +"Last-Translator: Leandro Regueiro \n" +"Language-Team: Galician \n" +"Language: gl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Ola, mundo!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Este programa estase executando como o proceso número $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/hr.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/hr.po new file mode 100644 index 0000000000000000000000000000000000000000..4449201024e07b6cb4249b6bb7cdd7184585c4d6 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/hr.po @@ -0,0 +1,33 @@ +# Translation of hello-sh to Croatian. +# Copyright (C) 2003, 2004, 2014, 2015, 2019 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Permission is granted to freely copy and distribute +# this file and modified versions, provided that this +# header is not removed and modified versions are marked +# as such. +# +# Tomislav Krznar , 2012. +# Božidar Putanec , 2018-2025. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-sh 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 10:15-0700\n" +"Last-Translator: Božidar Putanec \n" +"Language-Team: Croatian \n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Pozdrav, svijete!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Ovaj program se izvršava kao proces broj $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/hu.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/hu.po new file mode 100644 index 0000000000000000000000000000000000000000..6f7ff7bbfb78908ed4fd278b7c3e48937ace1e49 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/hu.po @@ -0,0 +1,29 @@ +# Hungarian translation for hello-sh. +# This file is distributed under the same license as the gettext package. +# Copyright (C) 2014 Yoyodyne, Inc. (msgids) +# +# Tamás Kiss , 2005. +# Balázs Úr , 2014, 2015. +msgid "" +msgstr "" +"Project-Id-Version: hello-sh 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2015-06-23 20:31+0200\n" +"Last-Translator: Balázs Úr \n" +"Language-Team: Hungarian \n" +"Language: hu\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 1.2\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Hello, világ!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Ez a program a(z) $pid folyamatazonosítóval fut." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/id.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/id.po new file mode 100644 index 0000000000000000000000000000000000000000..b7020a7dfa154108f3f868b650ac35fa06f896fd --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/id.po @@ -0,0 +1,27 @@ +# translation of hello-sh-0.15-pre5.po to Indonesian +# Copyright (C) 2006 Yoyodyne, Inc. +# This file is distributed under the same license as the PACKAGE package. +# +# Tedi Heriyanto , 2006. +msgid "" +msgstr "" +"Project-Id-Version: hello-sh-0.15-pre5\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2006-09-27 20:19+0700\n" +"Last-Translator: Tedi Heriyanto \n" +"Language-Team: Indonesian \n" +"Language: id\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: KBabel 1.11.2\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Hello, world!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Program ini berjalan sebagai proses nomor $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/it.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/it.po new file mode 100644 index 0000000000000000000000000000000000000000..caf7df0adc94ae4b0d343b0cc72f8db929777e12 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/it.po @@ -0,0 +1,29 @@ +# Italian messages for hello-sh. +# Copyright (C) 2005, 2006 Yoyodyne, Inc. (msgids) +# Copyright (C) 2024 Free Software Foundation, Inc. +# This file is distributed under the same license as the gettext package. +# Marco Colombo , 2005, 2006, 2015. +# Michele Locati , 2024, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-sh 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-05-04 18:28+0200\n" +"Last-Translator: Michele Locati \n" +"Language-Team: Italian \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Ciao, mondo!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Questo programma è in esecuzione con numero di processo $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/ja.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/ja.po new file mode 100644 index 0000000000000000000000000000000000000000..f608b8a6502539825a7c82a3344c66c5269b13e7 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/ja.po @@ -0,0 +1,26 @@ +# Translation of `hello-sh' messages to Japanese. +# Copyright (C) 2005, 2006, 2014, 2015, 2023, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Masahito Yamaga , 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-sh 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 19:59+0900\n" +"Last-Translator: Masahito Yamaga \n" +"Language-Team: Japanese \n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "世界よ, こんにちは!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "このプログラムはプロセス番号 $pid で動いています." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/ka.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/ka.po new file mode 100644 index 0000000000000000000000000000000000000000..dd3cd6671233af8b7de4242e8ad06dc422df30ac --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/ka.po @@ -0,0 +1,28 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2022 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Temuri Doghonadze , 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-sh 0.20.2\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2022-05-22 05:04+0200\n" +"Last-Translator: Temuri Doghonadze \n" +"Language-Team: Georgian <(nothing)>\n" +"Language: ka\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.0.1\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "გამარჯობა სამყაროვ!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "პროგრამა გაშვებულია პროცესის ნომრით $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/ky.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/ky.po new file mode 100644 index 0000000000000000000000000000000000000000..559a0b0c293f05e42403354446f556aa32ef2e51 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/ky.po @@ -0,0 +1,28 @@ +# Translation of 'hello-sh' messages to Kirghiz. +# Copyright (C) 2004 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Ilyas Bakirov , 2007. +# Ilyas Bakirov , 2018. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-sh 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2018-02-15 18:26+0600\n" +"Last-Translator: Ilyas Bakirov \n" +"Language-Team: Kirghiz \n" +"Language: ky\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 2.0.6\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Салам дүйнө!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Бул программа $pid процесс номери катары иштеп жатат." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/lv.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/lv.po new file mode 100644 index 0000000000000000000000000000000000000000..0de20998e3ed3797feb66833437e1239c1a3034d --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/lv.po @@ -0,0 +1,30 @@ +# Latvian translation of hello-sh +# Copyright (C) 2009 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Arvis Lācis , 2009. +# Rihards Priedītis , 2023, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-sh-0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-03-09 11:44+0000\n" +"Last-Translator: Rihards Priedītis \n" +"Language-Team: Latvian \n" +"Language: lv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : " +"2);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Sveika, pasaule!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Šī programma darbojas ar procesa numuru $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/ms.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/ms.po new file mode 100644 index 0000000000000000000000000000000000000000..8756226560021e0d3d772951d588851450ba2183 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/ms.po @@ -0,0 +1,28 @@ +# hello-sh Bahasa Melayu (Malay) (ms). +# Copyright (C) 2006, 2015, 2023, 2025 Yoyodyne, Inc. (msgids) +# Copyright (C) 2006, 2015, 2023, 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the gettext package. +# Sharuzzaman Ahmat Raslan , 2006, 2015, 2023, 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: hello-sh 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-05-03 21:10+0800\n" +"Last-Translator: Sharuzzaman Ahmat Raslan \n" +"Language-Team: Malay \n" +"Language: ms\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Hello, dunia!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Program ini dilaksanakan sebagai proses bernombor $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/mt.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/mt.po new file mode 100644 index 0000000000000000000000000000000000000000..1c5b7f373d4165fad268918c22ac39066e8ac4d7 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/mt.po @@ -0,0 +1,27 @@ +# hello-sh-0.16.2-pre5. +# Copyright (C) 2008 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Clyde Meli , 2001-2008. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: hello-sh 0.16.2-pre5\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2008-11-18 17:27+0100\n" +"Last-Translator: Clyde Meli \n" +"Language-Team: Maltese \n" +"Language: mt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Hello, lil kulħadd!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Dal-programm qed jaħdem taħt il-proċess numru $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/nb.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/nb.po new file mode 100644 index 0000000000000000000000000000000000000000..b649c67dfa6d7329fb2273a898b9ad9625fc7209 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/nb.po @@ -0,0 +1,29 @@ +# Norwegian Bokmal translations for hello-sh package. +# Copyright (C) 2012 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Johnny A. Solbu , 2012-2024 +# +msgid "" +msgstr "" +"Project-Id-Version: hello-sh 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2024-01-06 16:33+0100\n" +"Last-Translator: Johnny A. Solbu \n" +"Language-Team: Norwegian Bokmaal \n" +"Language: nb\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 2.4.2\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Hallo verden!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Dette programmet kjører som prosess nummer $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/nl.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/nl.po new file mode 100644 index 0000000000000000000000000000000000000000..e7c26775c65680879334451c7599c5933849cd6c --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/nl.po @@ -0,0 +1,31 @@ +# Dutch translations for GNU hello-sh. +# Copyright (C) 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# "There are three basic rules for writing a novel. +# Unfortunately nobody knows what they are." +# +# Benno Schulenberg , 2007, 2014, 2015, 2019, 2025. +# Elros Cyriatan , 2004. +msgid "" +msgstr "" +"Project-Id-Version: hello-sh-0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-03-01 14:51+0100\n" +"Last-Translator: Benno Schulenberg \n" +"Language-Team: Dutch \n" +"Language: nl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Hallo, wereld!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Dit programma draait als proces nummer $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/nn.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/nn.po new file mode 100644 index 0000000000000000000000000000000000000000..7967af37cfdca2190db31da7f5fb5888db8ee910 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/nn.po @@ -0,0 +1,28 @@ +# Norwegian Nynorsk translation of GNU hello-sh +# Copyright (C) 2020 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Karl Ove Hufthammer , 2020. +msgid "" +msgstr "" +"Project-Id-Version: hello-sh-0.20.2\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2020-05-04 18:58+0200\n" +"Last-Translator: Karl Ove Hufthammer \n" +"Language-Team: Norwegian Nynorsk \n" +"Language: nn\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 20.04.0\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Hei, verda!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Dette programmet køyrer som prosess nummer $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/pl.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/pl.po new file mode 100644 index 0000000000000000000000000000000000000000..99804dd8177da4888372c4d1b8b3aa3151a45ed5 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/pl.po @@ -0,0 +1,27 @@ +# Polish translations for the GNU gettext messages, hello-sh domain +# Copyright (C) 2010, 2014, 2015, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Rafał Maszkowski , 2003, 2010, 2014, 2015, 2025 +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-sh 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-25 17:16+0200\n" +"Last-Translator: Rafał Maszkowski \n" +"Language-Team: Polish \n" +"Language: pl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8-bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " +"|| n%100>=20) ? 1 : 2);\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Cześć, świecie!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Ten program działa jako proces o numerze $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/pt.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/pt.po new file mode 100644 index 0000000000000000000000000000000000000000..3ed4b98a400bbe2884231fd6b0e6a0b8ba07ac1c --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/pt.po @@ -0,0 +1,28 @@ +# Portuguese (Portugal) translation of 'hello-sh' package. +# Copyright (C) 2018 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Pedro Albuquerque , 2019, 2020, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-sh 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 11:24+0100\n" +"Last-Translator: Pedro Albuquerque \n" +"Language-Team: Portuguese \n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\\n;\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.6\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Olá mundo!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Este programa está em execução como processo nº $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/pt_BR.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/pt_BR.po new file mode 100644 index 0000000000000000000000000000000000000000..a2da71533bd66b0c4598f74563ed9906c2433e0b --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/pt_BR.po @@ -0,0 +1,31 @@ +# Brazilian Portuguese translations for gettext-example +# Traduções em português brasileiro para gettext-example +# Copyright (C) 2025 Yoyodyne, Inc. (msgids) +# Copyright (C) 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the gettext package. +# Rafael Fontenelle , 2013-2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-sh 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 10:24-0300\n" +"Last-Translator: Rafael Fontenelle \n" +"Language-Team: Brazilian Portuguese \n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Gtranslator 48.0\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Olá, mundo!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Este programa está sendo executado com número de processo $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/ro.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/ro.po new file mode 100644 index 0000000000000000000000000000000000000000..2f4c67f8a2260605dceccfdbda87775abaedebbf --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/ro.po @@ -0,0 +1,50 @@ +# Translation of "hello-sh" messages to Romanian. +# Mesajele în limba română pentru pachetul hello-sh. +# Copyright © 2015, 2019, 2022, 2023, 2024, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Eugen Hoancă , 2003. +# Mihai Cristescu , 2015 - 2019. +# Remus-Gabriel Chelu , 2022 - 2025. +# +# Cronologia traducerii fișierului „hello-sh”: +# Traducerea inițială, făcută de EH, pentru versiunea hello-sh 0.12.1, 2003. +# Actualizare a traducerii pentru versiunea hello-sh 0.19.4-rc1, făcută de MC, mar-2015. +# Actualizare a traducerii pentru versiunea hello-sh 0.19.4.73, făcută de MC, iun-2015. +# Actualizare a traducerii pentru versiunea hello-sh 0.20-rc1, făcută de MC, apr-2019. +# Actualizare a mesajelor, de la fișierul „hello-sh-0.20.2.pot”. +# Actualizare a algoritmului formelor de plural (de la „trei-vechi” la „trei-actual”). +# NU și a mesajelor traduse (acestea au rămas neschimbate). +# Eliminare a mesajelor ce-au dispărut în ultima versiune. +# Actualizări realizate de Remus-Gabriel Chelu , 15.01.2022. +# Actualizare a traducerii pentru versiunea 0.20.2 făcută de R-GC, ian-2022. +# Actualizare a traducerii pentru versiunea 0.22 făcută de R-GC, iun-2023. +# Revizuire și corectare a traducerii pentru versiunea 0.23-pre1 făcută de R-GC, oct-2024. +# Actualizare a traducerii pentru versiunea 0.24-pre1 făcută de R-GC, feb-2025. +# Actualizare a traducerii pentru versiunea 0.25-pre1 făcută de R-GC, apr-2025. +# Actualizare a traducerii pentru versiunea Y, făcută de X, Z(luna-anul). +# +msgid "" +msgstr "" +"Project-Id-Version: hello-sh 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-29 00:25+0200\n" +"Last-Translator: Remus-Gabriel Chelu \n" +"Language-Team: Romanian \n" +"Language: ro\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < " +"20)) ? 1 : 2);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Salutare, lume!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Acest program rulează ca procesul numărul $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/ru.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/ru.po new file mode 100644 index 0000000000000000000000000000000000000000..c3d35611176d3e78cc090f1bb708a8ab6bef1ccb --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/ru.po @@ -0,0 +1,30 @@ +# Translation of hello-sh-0.14.1.po to Russian +# Copyright (C) 2004 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Pavel Maryanov , 2004. +# SPDX-FileCopyrightText: 2014, 2015, 2023, 2025 Yuri Kozlov +msgid "" +msgstr "" +"Project-Id-Version: hello-sh 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-05-02 09:17+0300\n" +"Last-Translator: Yuri Kozlov \n" +"Language-Team: Russian \n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Lokalize 24.12.0\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Здравствуй, мир!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Эта программа выполняется как процесс под номером $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/sk.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/sk.po new file mode 100644 index 0000000000000000000000000000000000000000..a577e78d16c01a034b0422eeda55601e1d61f612 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/sk.po @@ -0,0 +1,26 @@ +# Slovak translations GNU for hello-sh package. +# Copyright (C) 2003, 2004, 2014, 2023, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Marcel Telka , 2003, 2004, 2014, 2023, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-sh 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 13:53+0200\n" +"Last-Translator: Marcel Telka \n" +"Language-Team: Slovak \n" +"Language: sk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Ahoj svet!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Tento program beží ako proces s číslom $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/sl.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/sl.po new file mode 100644 index 0000000000000000000000000000000000000000..e1111c9326bd598c3cf699daa9ed6e279308f835 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/sl.po @@ -0,0 +1,29 @@ +# -*- mode: po; coding: utf-8; -*- Slovenian message catalog for GNU gettext-example +# Copyright (C) 2005 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Primož Peterlin , 2005, 2014, 2015, 2024. +# $Id: hello-sh-0.22.sl.po,v 1.1 2024/03/28 17:02:19 peterlin Exp $ +msgid "" +msgstr "" +"Project-Id-Version: hello-sh 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2024-03-28 18:02+0100\n" +"Last-Translator: Primož Peterlin \n" +"Language-Team: Slovenian \n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8-bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || " +"n%100==4 ? 3 : 0);\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Pozdravljen, svet!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Ta program teče kot proces številka $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/sq.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/sq.po new file mode 100644 index 0000000000000000000000000000000000000000..0a557c079a8a98ec6a3775f7c7d0eb868a946847 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/sq.po @@ -0,0 +1,28 @@ +# Albanian translation of gettext-example. +# Copyright (C) 2020 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Besnik Bleta , 2020,2023,2024,2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-sh-0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 19:56+0300\n" +"Last-Translator: Besnik Bleta \n" +"Language-Team: Albanian \n" +"Language: sq\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.2.2\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Tungjatjeta, botë!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Ky program po xhiron si procesi numër $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/sr.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/sr.po new file mode 100644 index 0000000000000000000000000000000000000000..431bccaa2271b7b3eb0faddc3546ecf05da0b14a --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/sr.po @@ -0,0 +1,30 @@ +# Serbian translation of hello-sh. +# Copyright (C) 2014 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Aleksandar Jelenak , 2004. +# Мирослав Николић , 2014-2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-sh-0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-03-02 16:51+0100\n" +"Last-Translator: Мирослав Николић \n" +"Language-Team: Serbian <(nothing)>\n" +"Language: sr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Здраво, свима!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Овај програм се извршава као процес број $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/sv.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/sv.po new file mode 100644 index 0000000000000000000000000000000000000000..f67be7083b3c1291afc9f85d5bb0c8b603f84743 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/sv.po @@ -0,0 +1,30 @@ +# Swedish messages for hello-sh. +# Copyright © 2006, 2014, 2016, 2019, 2020, 2023, 2024, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Jan Djärv , 2003, 2006, 2014. +# Göran Uddeborg , 2016, 2019, 2020, 2023, 2024, 2025. +# Luna Jernberg , 2025. +# $Revision: 1.12 $ +msgid "" +msgstr "" +"Project-Id-Version: hello-sh 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 12:18+0200\n" +"Last-Translator: Luna Jernberg \n" +"Language-Team: Swedish \n" +"Language: sv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Hej världen!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Detta program kör som process nummer $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/ta.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/ta.po new file mode 100644 index 0000000000000000000000000000000000000000..a53eabf1f69803eef100891f5d32d381f1c5df8c --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/ta.po @@ -0,0 +1,28 @@ +# Tamil messages for GNU gettext. +# Copyright (C) 2018 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# List of contributors follow: +# Poorajith , 2018. +# Arun Isaac , 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-sh 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-06-19 00:06+0100\n" +"Last-Translator: Arun Isaac \n" +"Language-Team: Tamil \n" +"Language: ta\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "வணக்கம், உலகு!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "இந்நிரல் செயலாக்க எண் $pid ஆக இயங்கிக்கொண்டிருக்கிறது." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/tr.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/tr.po new file mode 100644 index 0000000000000000000000000000000000000000..64ecf084156a9b4578814638021a78fd3a17c541 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/tr.po @@ -0,0 +1,29 @@ +# Turkish translation for hello-sh. +# This file is distributed under the same license as the gettext package. +# Copyright (C) 2017 Yoyodyne, Inc. (msgids) +# Copyright (C) 2004 Free Software Foundation, Inc. +# Nilgün Belma Bugüner , 2003,2004 +# Mehmet Kececi , 2017, 2019, 2020. +msgid "" +msgstr "" +"Project-Id-Version: hello-sh 0.20.2\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2020-04-17 13:10+0300\n" +"Last-Translator: Mehmet Kececi \n" +"Language-Team: Turkish \n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 2.3\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Merhaba, dünya!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Bu yazılım $pid süreç numarası ile çalışıyor." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/uk.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/uk.po new file mode 100644 index 0000000000000000000000000000000000000000..2e1d25180848ebc1c7023d08f863a042e9026281 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/uk.po @@ -0,0 +1,30 @@ +# Ukrainian translation to hello-sh +# Copyright (C) 2014 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Maxim V. Dziumanenko , 2004-2007. +# Yuri Chornoivan , 2014, 2015, 2023, 2025. +msgid "" +msgstr "" +"Project-Id-Version: hello-sh 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 13:56+0300\n" +"Last-Translator: Yuri Chornoivan \n" +"Language-Team: Ukrainian \n" +"Language: uk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Lokalize 23.04.3\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Привіт, світе!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Ця програма виконується як процес з номером $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/vi.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/vi.po new file mode 100644 index 0000000000000000000000000000000000000000..1b12934253e7da604576554f36ef7f290d45daed --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/vi.po @@ -0,0 +1,30 @@ +# Vietnamese Translation for Gettext Examples. +# Bản dịch tiếng Việt dành cho các ví dụ của gói gettext. +# Copyright © 2015 Yoyodyne, Inc. (msgids) +# Copyright © 2015 Free Software Foundation, Inc. +# This file is distributed under the same license as the gettext package. +# Clytie Siddall , 2005-2010. +# Trần Ngọc Quân , 2012-2015, 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-sh 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-06-24 09:10+0700\n" +"Last-Translator: Trần Ngọc Quân \n" +"Language-Team: Vietnamese \n" +"Language: vi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "Chào thế giới!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "Chương trình này đang chạy với mã số tiến trình $pid." diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/zh_CN.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/zh_CN.po new file mode 100644 index 0000000000000000000000000000000000000000..6a87d7702e695a1cbcc19990b415d9865905b151 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/zh_CN.po @@ -0,0 +1,29 @@ +# zh_CN translation for hello-sh. +# Copyright (C) 2015 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Funda Wang , 2003. +# Ji ZhengYu , 2015. +# Boyuan Yang <073plan@gmail.com>, 2019, 2023, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-sh 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-29 15:56-0400\n" +"Last-Translator: Boyuan Yang <073plan@gmail.com>\n" +"Language-Team: Chinese (simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.6\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "你好,世界!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "此程序正以进程号 $pid 运行。" diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/zh_HK.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/zh_HK.po new file mode 100644 index 0000000000000000000000000000000000000000..5b8c66ecc4c2096f9a58622d83616a179b1428ac --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/zh_HK.po @@ -0,0 +1,25 @@ +# Chinese (Hong Kong) translation of hello-sh. +# Copyright (C) 2006 Yoyodyne, Inc. +# Abel Cheung , 2006. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-sh 0.15-pre5\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2006-07-05 15:40+0800\n" +"Last-Translator: Abel Cheung \n" +"Language-Team: Chinese (Hong Kong) \n" +"Language: zh_HK\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "你好!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "本程式正在執行中,進程編號為 $pid。" diff --git a/miniconda3/share/doc/gettext/examples/hello-sh/po/zh_TW.po b/miniconda3/share/doc/gettext/examples/hello-sh/po/zh_TW.po new file mode 100644 index 0000000000000000000000000000000000000000..ebac4b7b3c2b73286c5eee9446b3d02fe56ebb4d --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-sh/po/zh_TW.po @@ -0,0 +1,29 @@ +# Traditional Chinese translation of hello-sh. +# Copyright (C) 2009 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Abel Cheung , 2005. +# Wei-Lun Chao , 2013, 2015. +# Yi-Jyun Pan , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-sh 0.23-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2024-11-30 14:14+0800\n" +"Last-Translator: Yi-Jyun Pan \n" +"Language-Team: Chinese (traditional) \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.sh:14 +msgid "Hello, world!" +msgstr "哈囉,大家好!" + +#: hello.sh:17 +#, sh-format +msgid "This program is running as process number $pid." +msgstr "本程式正在執行,行程編號為 $pid。" diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/INSTALL b/miniconda3/share/doc/gettext/examples/hello-smalltalk/INSTALL new file mode 100644 index 0000000000000000000000000000000000000000..4a6b9f87eb7b5df280f2f4699762752e0590f565 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/INSTALL @@ -0,0 +1,10 @@ +This example relies on gst (GNU Smalltalk). + +Installation: + ./autogen.sh + ./configure --prefix=/some/prefix + make + make install +Cleanup: + make distclean + ./autoclean.sh diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/Makefile.am b/miniconda3/share/doc/gettext/examples/hello-smalltalk/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..9796d9a884ca884df9e874f36c42df83f54f71ea --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/Makefile.am @@ -0,0 +1,26 @@ +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_SCRIPTS = hello +all-local: hello +CLEANFILES = hello + +# The Smalltalk program is installed as data and invoked through a shell script. +pkgdata_DATA = hello.st +hello: + { echo '#!/bin/sh'; \ + echo "exec '@GST@' -Q '$(pkgdatadir)/hello.st' \"\$$@\""; \ + } > $@ + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/autoclean.sh b/miniconda3/share/doc/gettext/examples/hello-smalltalk/autoclean.sh new file mode 100644 index 0000000000000000000000000000000000000000..8655a871726b2a31a935332f3e7cbba7b36928e8 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/autoclean.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean +rm -rf autom4te.cache + +# Brought in by explicit copy. +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f m4/progtest.m4 +rm -f po/remove-potcdate.sed + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f po/Makefile.in +rm -f install-sh +rm -f missing +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.gmo diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/autogen.sh b/miniconda3/share/doc/gettext/examples/hello-smalltalk/autogen.sh new file mode 100644 index 0000000000000000000000000000000000000000..a972da8041799c1ddf0a23303c0660eb9fb827bc --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/autogen.sh @@ -0,0 +1,44 @@ +#!/bin/sh +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +if test -r ../Makefile.am; then + # Inside the gettext source directory. + GETTEXT_TOPSRCDIR=../../.. +else + if test -r ../Makefile; then + # Inside a gettext build directory. + GETTEXT_TOOLS_SRCDIR=`sed -n -e 's,^top_srcdir *= *\(.*\)$,\1,p' ../Makefile` + # Adjust a relative top_srcdir. + case $GETTEXT_TOOLS_SRCDIR in + /*) ;; + *) GETTEXT_TOOLS_SRCDIR=../$GETTEXT_TOOLS_SRCDIR ;; + esac + GETTEXT_TOPSRCDIR=$GETTEXT_TOOLS_SRCDIR/../.. + else + # Installed under ${prefix}/share/doc/gettext/examples. + . ../installpaths + fi +fi + +cp -p ${ACLOCALDIR-$GETTEXT_TOPSRCDIR/gettext-runtime/m4}/nls.m4 m4/nls.m4 +cp -p ${ACLOCALDIR-$GETTEXT_TOPSRCDIR/gettext-runtime/m4}/po.m4 m4/po.m4 +cp -p ${ACLOCALDIR-$GETTEXT_TOPSRCDIR/gettext-runtime/m4}/progtest.m4 m4/progtest.m4 +cp -p ${GETTEXTSRCPODIR-$GETTEXT_TOPSRCDIR/gettext-runtime/po}/remove-potcdate.sed po/remove-potcdate.sed + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c -o $lang.gmo $lang.po + fi +done +cd .. diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/configure.ac b/miniconda3/share/doc/gettext/examples/hello-smalltalk/configure.ac new file mode 100644 index 0000000000000000000000000000000000000000..58428b7203fe5e6ff49ab85e90abca6c9940d14c --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/configure.ac @@ -0,0 +1,38 @@ +dnl Example for use of GNU gettext. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT([hello-smalltalk], [0]) +AC_CONFIG_SRCDIR([hello.st.in]) +AM_INIT_AUTOMAKE([1.11]) + +dnl Check for availability of GNU Smalltalk. +AC_PATH_PROG([GST], [gst]) +if test -z "$GST"; then + echo "*** Essential program gst not found" 1>&2 + exit 1 +fi +AC_SUBST([GST]) + +dnl The installed program must know where to find its message catalogs. +dnl Unfortunately, prefix gets only finally determined at the end of configure. +if test "X$prefix" = "XNONE"; then + final_prefix="$ac_default_prefix" +else + final_prefix="$prefix" +fi +save_prefix="$prefix" +prefix="$final_prefix" +eval "datarootdir=\"${datarootdir}\"" +eval "localedir=\"${datarootdir}/locale\"" +prefix="$save_prefix" +AC_SUBST([localedir]) + +dnl Support for the po directory. +AM_PO_SUBDIRS + +AC_CONFIG_FILES([Makefile hello.st]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) +AC_OUTPUT diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/hello.st.in b/miniconda3/share/doc/gettext/examples/hello-smalltalk/hello.st.in new file mode 100644 index 0000000000000000000000000000000000000000..4ddccad8bb11187e39942afd087c86e8e1d99ab0 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/hello.st.in @@ -0,0 +1,58 @@ +" Example for use of GNU gettext. + This file is in the public domain. + + Source code of the GNU Smalltalk program. +" + +"Unfortunately the PackageLoader method fileInPackage: is extra verbose: + It outputs 'Loading package I18N'. This will be fixed in smalltalk-2.2. + +PackageLoader fileInPackage: 'I18N' ! + +In the meantime, we use this workaround." + +| saved sink | +saved := Transcript message. +sink := WriteStream with: String new. +Transcript message: sink -> #nextPutAll:. +PackageLoader fileInPackage: 'I18N'. +Transcript message: saved. +! + +Object subclass: #Main + instanceVariableNames: '' + classVariableNames: 'NLS' + poolDictionaries: '' + category: 'Program' +! +!Main methodsFor: 'running'! +run + NLS := I18N Locale default messages domain: 'hello-smalltalk' localeDirectory: '@localedir@'. + Transcript showCr: (NLS ? 'Hello, world!'). + Transcript showCr: ((NLS ? 'This program is running as process number %1.') bindWith: self getpid). +! + + +"Unfortunately I cannot define getpid like this - it gives + 'C function getpid not defined'. + +SystemDictionary defineCFunc: 'getpid' + withSelectorArgs: 'getpid' + returning: #int + args: #() +! + +So let's define it through an external process." + +!Main methodsFor: 'auxiliary stuff'! +getpid + | stream pid | + stream := FileDescriptor popen: 'echo $PPID' dir: #read. + pid := stream contents asNumber. + stream close. + ^ pid +! +! + + +Main new run! diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/m4/Makefile.am b/miniconda3/share/doc/gettext/examples/hello-smalltalk/m4/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..8a841b31f12ff3bd59428fbba049f50825d91510 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/m4/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + nls.m4 po.m4 diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/LINGUAS b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/LINGUAS new file mode 100644 index 0000000000000000000000000000000000000000..dc4a82afbad945018082c22f2061a43ef436dd68 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/LINGUAS @@ -0,0 +1,5 @@ +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Set of available languages. +af ast bg ca cs da de el eo es fi fr ga gl hr hu id it ja ka ky lv ms mt nb nl nn pl pt pt_BR ro ru sk sl sq sr sv ta tr uk vi zh_CN zh_HK zh_TW diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/Makefile.am b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..1f38b16fe7d4d12e0adb31830b514140f367f273 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/Makefile.am @@ -0,0 +1,434 @@ +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# List of files which contain translatable strings. +POTFILES = \ + hello.st.in + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgid strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This tells whether or not to prepend "GNU " prefix to the package +# name that gets inserted into the header of the $(DOMAIN).pot file. +# Possible values are "yes", "no", or empty. If it is empty, try to +# detect it automatically by scanning the files in $(top_srcdir) for +# "GNU packagename" string. +PACKAGE_GNU = no + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + +# These options get passed to msgmerge. +# Useful options are in particular: +# --previous to keep previous msgids of translated messages +MSGMERGE_OPTIONS = + +# These options get passed to msginit. +# If you want to disable line wrapping when writing PO files, add +# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and +# MSGINIT_OPTIONS. +MSGINIT_OPTIONS = + +MSGMERGE = @MSGMERGE@ +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done + +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.gmo; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We use the presentlang catalog if desiredlang is +# a. equal to presentlang, or +# b. a variant of presentlang (because in this case, presentlang can be used +# as a fallback for messages which are not translated in the desiredlang +# catalog). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(lang).gmo) +CATALOGS != for lang in $(INST_LINGUAS); do echo $$lang.gmo; done + +SUFFIXES = .po .gmo .nop .po-create .po-update + +# The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs. +# The GNU Coding Standards say in +# : +# "GNU distributions usually contain some files which are not source files +# ... . Since these files normally appear in the source directory, they +# should always appear in the source directory, not in the build directory. +# So Makefile rules to update them should put the updated files in the +# source directory." +# Therefore we put these files in the source directory, not the build directory. + +# During .po -> .gmo conversion, take into account the most recent changes to +# the .pot file. This eliminates the need to update the .po files when the +# .pot file has changed, which would be troublesome if the .po files are put +# under version control. +$(GMOFILES): $(srcdir)/$(DOMAIN).pot +.po.gmo: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \ + cd $(srcdir) && \ + rm -f $${lang}.gmo && \ + $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \ + $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \ + mv t-$${lang}.gmo $${lang}.gmo && \ + rm -f $${lang}.1po + + +all-local: all-local-@USE_NLS@ + +all-local-yes: $(srcdir)/stamp-po +all-local-no: + +# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no +# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because +# we don't want to bother translators with empty POT files). We assume that +# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. +# In this case, $(srcdir)/stamp-po is a nop (i.e. a phony target). + +# $(srcdir)/stamp-po is a timestamp denoting the last time at which the CATALOGS +# have been loosely updated. Its purpose is that when a developer or translator +# checks out the package from a version control system, and the $(DOMAIN).pot +# file is not under version control, "make" will update the $(DOMAIN).pot and +# the $(CATALOGS), but subsequent invocations of "make" will do nothing. This +# timestamp would not be necessary if updating the $(CATALOGS) would always +# touch them; however, the rule for $(POFILES) has been designed to not touch +# files that don't need to be changed. +$(srcdir)/stamp-po: $(srcdir)/$(DOMAIN).pot + test ! -f $(srcdir)/$(DOMAIN).pot || \ + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @test ! -f $(srcdir)/$(DOMAIN).pot || { \ + echo "touch $(srcdir)/stamp-po" && \ + echo timestamp > $(srcdir)/stamp-poT && \ + mv $(srcdir)/stamp-poT $(srcdir)/stamp-po; \ + } + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +# The determination of whether the package xyz is a GNU one is based on the +# heuristic whether some file in the top level directory mentions "GNU xyz". +# If GNU 'find' is available, we avoid grepping through monster files. +$(DOMAIN).pot-update: $(POTFILES_DEPS) + package_gnu="$(PACKAGE_GNU)"; \ + test -n "$$package_gnu" || { \ + if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ + LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep -i 'GNU $(PACKAGE)' /dev/null '{}' ';' 2>/dev/null; \ + else \ + LC_ALL=C grep -i 'GNU $(PACKAGE)' $(top_srcdir)/* 2>/dev/null; \ + fi; \ + } | grep -v 'libtool:' >/dev/null; then \ + package_gnu=yes; \ + else \ + package_gnu=no; \ + fi; \ + }; \ + if test "$$package_gnu" = "yes"; then \ + package_prefix='GNU '; \ + else \ + package_prefix=''; \ + fi; \ + if test -n '$(MSGID_BUGS_ADDRESS)'; then \ + msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ + else \ + msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ + fi; \ + case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + $(POTFILES) \ + ;; \ + *) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --package-name="$${package_prefix}$(PACKAGE)" \ + --package-version='$(VERSION)' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + $(POTFILES) \ + ;; \ + esac + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot-header; then \ + sed -e '1,/^#$$/d' < $(DOMAIN).po > $(DOMAIN).1po && \ + cat $(srcdir)/$(DOMAIN).pot-header $(DOMAIN).1po > $(DOMAIN).po && \ + rm -f $(DOMAIN).1po \ + || exit 1; \ + fi; \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f $(srcdir)/remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f $(srcdir)/remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + if test -f "$(srcdir)/$${lang}.po"; then \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) \ + && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.10 | 0.10.*) \ + $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ + 0.1[1-5] | 0.1[1-5].*) \ + $(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ + 0.1[6-7] | 0.1[6-7].*) \ + $(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) --previous $${lang}.po $(DOMAIN).pot;; \ + *) \ + $(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot;; \ + esac; \ + }; \ + else \ + $(MAKE) $${lang}.po-create; \ + fi + + +install-data-local: install-data-local-@USE_NLS@ +install-data-local-no: all-local +install-data-local-yes: all-local + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(MKDIR_P) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ + fi; \ + done; \ + done + +installdirs-local: installdirs-local-@USE_NLS@ +installdirs-local-no: +installdirs-local-yes: + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(MKDIR_P) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done + +uninstall-local: uninstall-local-@USE_NLS@ +uninstall-local-no: +uninstall-local-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ + done + +html ID: + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* *.stackdump $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po +MOSTLYCLEANFILES += *.o + +MAINTAINERCLEANFILES = $(DOMAIN).pot stamp-po $(GMOFILES) + +EXTRA_DIST = remove-potcdate.sed LINGUAS $(POFILES) $(GMOFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + $(MAKE) $(srcdir)/stamp-po + @if test -f $(srcdir)/$(DOMAIN).pot; then \ + for file in $(DOMAIN).pot stamp-po; do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + cp -p $$d/$$file $(distdir)/$$file || exit 1; \ + done; \ + else \ + case $(XGETTEXT) in \ + :) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because a suitable 'xgettext' program was not found in PATH." 1>&2;; \ + *) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because 'xgettext' found no strings to extract. Check the POTFILES and the XGETTEXT_OPTIONS in the Makefile.am file." 1>&2;; \ + esac; \ + fi + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for creating PO files. + +.nop.po-create: + @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ + echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ + exit 1 + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) --lang=$$lang --previous $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.10 | 0.10.*) \ + $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + 0.1[1-5] | 0.1[1-5].*) \ + $(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + 0.1[6-7] | 0.1[6-7].*) \ + $(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + *) \ + $(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) --lang=$$lang --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + esac; \ + }; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-gmo: Makefile $(GMOFILES) + @: diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/af.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/af.po new file mode 100644 index 0000000000000000000000000000000000000000..ff6657815e150f15d11c647585fe9534d463f40c --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/af.po @@ -0,0 +1,26 @@ +# Afrikaans translation for Silky +# Copyright (C) 2004 Free Software Foundation, Inc. +# This file is distributed under the same license as the silky package. +# Hanlie Pretorius , 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk-0.13.1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2003-12-31 10:30+2\n" +"Last-Translator: Ysbeer \n" +"Language-Team: Afrikaans \n" +"Language: af\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Hallo wêreld!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Hierdie program loop as prosesnommer %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ast.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ast.po new file mode 100644 index 0000000000000000000000000000000000000000..56d0cb8120895f5f6039f28de0914f1f581f19e3 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ast.po @@ -0,0 +1,29 @@ +# Asturian translation for hello-smalltalk +# Copyright (C) 2018 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Marquinos , 2009. +# enolp , 2018. +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2018-07-16 00:28+0100\n" +"Last-Translator: enolp \n" +"Language-Team: Asturian \n" +"Language: ast\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Lokalize 2.0\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "¡Hola, mundu!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Esti programa ta executándose como procesu númberu %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/bg.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/bg.po new file mode 100644 index 0000000000000000000000000000000000000000..e9cebef9b79ced3af1d8893c2985719eee411e4d --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/bg.po @@ -0,0 +1,26 @@ +# Bulgarian translations for hello-smalltalk package. +# Copyright (C) 2010 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Roumen Petrov , 2010,2014,2015,2019,2023,2024.2025. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-smalltalk 0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-03-08 19:09+0200\n" +"Last-Translator: Roumen Petrov \n" +"Language-Team: Bulgarian \n" +"Language: bg\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Здравейте всички!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Програмата е пусната под процес номер %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ca.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ca.po new file mode 100644 index 0000000000000000000000000000000000000000..f2d5b1b9b58e42e302ba4b55910d9f6597aeaba2 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ca.po @@ -0,0 +1,27 @@ +# Catalan messages for GNU hello-smalltalk. +# Copyright (C) 2003, 2014, 2015 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Ivan Vilata i Balaguer , 2003, 2014, 2015, 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-07-07 08:36+0200\n" +"Last-Translator: Ivan Vilata i Balaguer \n" +"Language-Team: Catalan \n" +"Language: ca\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Hola, món!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Aquest programa està corrent amb el número de procés %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/cs.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/cs.po new file mode 100644 index 0000000000000000000000000000000000000000..7341e3bc733cff7fb516d3ac29b995fd192af630 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/cs.po @@ -0,0 +1,29 @@ +# The Czech translation for the gettext package. +# Copyright (C) 2011 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Marek Černocký , 2011. +# Petr Písař , 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 20:05+02:00\n" +"Last-Translator: Petr Pisar \n" +"Language-Team: Czech \n" +"Language: cs\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Ahoj světe!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Tento program běží jako proces číslo %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/da.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/da.po new file mode 100644 index 0000000000000000000000000000000000000000..d1f336b1b201f405522c39c000bdcdacd6ce9a8f --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/da.po @@ -0,0 +1,28 @@ +# Danish messages for hello-smalltalk. +# Copyright (C) 2015 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Jan Djærv , 2003, 2006. +# Keld Simonsen , 2011. +# Joe Hansen , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2015-06-27 12:39+0100\n" +"Last-Translator: Joe Hansen \n" +"Language-Team: Danish \n" +"Language: da\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Hej verden!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Dette program kører som proces nummer %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/de.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/de.po new file mode 100644 index 0000000000000000000000000000000000000000..b013b40120bb9a9d90b9c10d31283300c003122b --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/de.po @@ -0,0 +1,32 @@ +# German messages for hello-smalltalk. +# Copyright © 2003, 2013 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Bruno Haible , 2003. +# Karl Eichwalder , 2003. +# Jakob Kramer , 2013. +# Mario Blättermann , 2014, 2023, 2025. +# Philipp Thomas , 2015. +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 17:15+0200\n" +"Last-Translator: Mario Blättermann \n" +"Language-Team: German \n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 25.04.0\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/el.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/el.po new file mode 100644 index 0000000000000000000000000000000000000000..f2ad6ca1e28039eacbf7417069e52e03497778ce --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/el.po @@ -0,0 +1,26 @@ +# Greek translation of hello-smalltalk +# Copyright (C) 2005 Free Software Foundation, Inc. +# Simos Xenitellis , 2005. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.14.1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2005-01-06 18:50+0000\n" +"Last-Translator: Simos Xenitellis \n" +"Language-Team: Greek \n" +"Language: el\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: KBabel 1.3.1\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Γεια σου, κόσμε!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Αυτό το πρόγραμμα εκτελείται με αριθμό διεργασίας %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/eo.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/eo.po new file mode 100644 index 0000000000000000000000000000000000000000..c242c7caae46ecf96bc1dc2cc5161f8526294d25 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/eo.po @@ -0,0 +1,28 @@ +# La teksto por la mesaĝoj de la programo "gettext". +# Copyright (C) 2006, 2016 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Edmund GRIMLEY EVANS , 2006. +# Felipe CASTRO , 2016, 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-06-23 19:00-0300\n" +"Last-Translator: Felipe Castro \n" +"Language-Team: Esperanto \n" +"Language: eo\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 2.4.2\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Saluton, mondo!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Ĉi tiu programo rulas kiel procez-numero %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/es.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/es.po new file mode 100644 index 0000000000000000000000000000000000000000..8ca30e895dcf28bd5f9bb36947bbade599f4d115 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/es.po @@ -0,0 +1,30 @@ +# Mensajes en español para GNU gettext. +# Copyright (C) 2014 Yoyodyne, Inc. (msgids) +# +# This file is distributed under the same license as the gettext package. +# +# Max de Mendizábal , 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004. +# Antonio Ceballos , 2014, 2015, 2023, 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk-0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-02-23 17:01+0100\n" +"Last-Translator: Antonio Ceballos \n" +"Language-Team: Spanish \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "¡Hola, mundo!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Este programa está corriendo como el proceso número %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/fi.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/fi.po new file mode 100644 index 0000000000000000000000000000000000000000..f1601461fdf8e7dcdcac5e8e83f84e936b13d2ab --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/fi.po @@ -0,0 +1,29 @@ +# Finnish messages for GNU Gettext examples. +# This file is distributed under the same license as the gettext package. +# Copyright © 2007, 2014, 2015 Yoyodyne, Inc. (msgids) +# Lauri Nurmi , 2007. +# Jorma Karvonen , 2014-2015. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2015-09-01 16:59+0300\n" +"Last-Translator: Jorma Karvonen \n" +"Language-Team: Finnish \n" +"Language: fi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 1.5.4\n" + +# Tämä nimenomainen käännös valittu GNU Hellon mukaisesti. +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Terve maailma!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Tämän ohjelman prosessinumero on %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/fr.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/fr.po new file mode 100644 index 0000000000000000000000000000000000000000..1ed288f6b4fd48a29d80f32dfc901a6174f0907a --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/fr.po @@ -0,0 +1,32 @@ +# Messages français pour GNU gettext. +# Copyright (C) 2006 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Michel Robitaille , 2006. +# Christophe Combelles , 2006 +# Stéphane Aulery , 2015 +# Christian Wiatr , 2023 +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-06-28 16:25+0200\n" +"Last-Translator: Christian Wiatr \n" +"Language-Team: French \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 2.4.2\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Bonjour, le monde !" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Ce programme est exécuté en tant que processus numéro %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ga.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ga.po new file mode 100644 index 0000000000000000000000000000000000000000..4c2410e320f68e642e959b822aef110eb210dd95 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ga.po @@ -0,0 +1,26 @@ +# Irish translations for hello-smalltalk. +# Copyright (C) 2015 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Kevin Patrick Scannell , 2004, 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2017-01-10 12:09-0500\n" +"Last-Translator: Kevin Patrick Scannell \n" +"Language-Team: Irish \n" +"Language: ga\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Dia duit, a dhomhain!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Tá an clár seo ag rith mar phróiseas %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/gl.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/gl.po new file mode 100644 index 0000000000000000000000000000000000000000..2c68c40e7f64f519cd8ac3dfbcc6a5f2420ce3f6 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/gl.po @@ -0,0 +1,31 @@ +# Galician translation for hello-smalltalk package. +# Copyright (C) 2010 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Leandro Regueiro , 2010-2014. +# +# Proxecto Trasno - Adaptación do software libre á lingua galega: Se desexas +# colaborar connosco, podes atopar máis información en +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.19-rc1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2014-05-10 16:34+0100\n" +"Last-Translator: Leandro Regueiro \n" +"Language-Team: Galician \n" +"Language: gl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Ola, mundo!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Este programa estase executando como o proceso número %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/hr.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/hr.po new file mode 100644 index 0000000000000000000000000000000000000000..d6525f0ed4395e19260440133a9fbf5d33322a35 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/hr.po @@ -0,0 +1,33 @@ +# Translation of hello-smalltalk to Croatian. +# Copyright (C) 2003, 2004, 2014, 2015, 2019 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Permission is granted to freely copy and distribute +# this file and modified versions, provided that this +# header is not removed and modified versions are marked +# as such. +# +# Tomislav Krznar , 2012. +# Božidar Putanec , 2018-2025. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-smalltalk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 10:15-0700\n" +"Last-Translator: Božidar Putanec \n" +"Language-Team: Croatian \n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Pozdrav, svijete!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Ovaj program se izvršava kao proces broj %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/hu.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/hu.po new file mode 100644 index 0000000000000000000000000000000000000000..9b3ddf30f8d9874f69f93ea2d6ce6d4dbc9d40df --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/hu.po @@ -0,0 +1,29 @@ +# Hungarian translation for hello-smalltalk. +# This file is distributed under the same license as the gettext package. +# Copyright (C) 2014 Yoyodyne, Inc. (msgids) +# +# Tamás Kiss , 2005. +# Balázs Úr , 2014, 2015. +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2015-06-23 20:31+0200\n" +"Last-Translator: Balázs Úr \n" +"Language-Team: Hungarian \n" +"Language: hu\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 1.2\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Hello, világ!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Ez a program a(z) %1 folyamatazonosítóval fut." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/id.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/id.po new file mode 100644 index 0000000000000000000000000000000000000000..6b7b581b3bd0f970ba69f8214a9b42b594402fd1 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/id.po @@ -0,0 +1,27 @@ +# translation of hello-smalltalk-0.15-pre5.po to Indonesian +# Copyright (C) 2006 Yoyodyne, Inc. +# This file is distributed under the same license as the PACKAGE package. +# +# Tedi Heriyanto , 2006. +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk-0.15-pre5\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2006-09-27 20:19+0700\n" +"Last-Translator: Tedi Heriyanto \n" +"Language-Team: Indonesian \n" +"Language: id\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: KBabel 1.11.2\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Hello, world!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Program ini berjalan sebagai proses nomor %1" diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/it.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/it.po new file mode 100644 index 0000000000000000000000000000000000000000..8bd137b7266376d984f4ed00bee943c6cb1772e4 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/it.po @@ -0,0 +1,29 @@ +# Italian messages for hello-smalltalk. +# Copyright (C) 2005, 2006 Yoyodyne, Inc. (msgids) +# Copyright (C) 2024 Free Software Foundation, Inc. +# This file is distributed under the same license as the gettext package. +# Marco Colombo , 2005, 2006, 2015. +# Michele Locati , 2024, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-smalltalk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-05-04 18:28+0200\n" +"Last-Translator: Michele Locati \n" +"Language-Team: Italian \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Ciao, mondo!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Questo programma è in esecuzione con numero di processo %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ja.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ja.po new file mode 100644 index 0000000000000000000000000000000000000000..f879f1c5f7dbf259e60a3ffcc95d7f82843ddad4 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ja.po @@ -0,0 +1,26 @@ +# Translation of `hello-smalltalk' messages to Japanese. +# Copyright (C) 2005, 2006, 2014, 2015, 2023, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Masahito Yamaga , 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-smalltalk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 19:59+0900\n" +"Last-Translator: Masahito Yamaga \n" +"Language-Team: Japanese \n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "世界よ, こんにちは!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "このプログラムはプロセス番号 %1 で動いています." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ka.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ka.po new file mode 100644 index 0000000000000000000000000000000000000000..a9a157b4848ca14dd8d7ea4c303a3c79eb9a62e1 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ka.po @@ -0,0 +1,28 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2022 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Temuri Doghonadze , 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.20.2\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2022-05-22 05:04+0200\n" +"Last-Translator: Temuri Doghonadze \n" +"Language-Team: Georgian <(nothing)>\n" +"Language: ka\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.0.1\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "გამარჯობა სამყაროვ!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "პროგრამა გაშვებულია პროცესის ნომრით %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ky.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ky.po new file mode 100644 index 0000000000000000000000000000000000000000..dac50f8b438d4ce7dc05a21bc035359d85f4a40d --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ky.po @@ -0,0 +1,28 @@ +# Translation of 'hello-smalltalk' messages to Kirghiz. +# Copyright (C) 2004 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Ilyas Bakirov , 2007. +# Ilyas Bakirov , 2018. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2018-02-15 18:26+0600\n" +"Last-Translator: Ilyas Bakirov \n" +"Language-Team: Kirghiz \n" +"Language: ky\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 2.0.6\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Салам дүйнө!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Бул программа %1 процесс номери катары иштеп жатат." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/lv.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/lv.po new file mode 100644 index 0000000000000000000000000000000000000000..285f380ad8fc580658dc1e5d1522bfc04f1e97e1 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/lv.po @@ -0,0 +1,30 @@ +# Latvian translation of hello-smalltalk +# Copyright (C) 2009 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Arvis Lācis , 2009. +# Rihards Priedītis , 2023, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk-0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-03-09 11:44+0000\n" +"Last-Translator: Rihards Priedītis \n" +"Language-Team: Latvian \n" +"Language: lv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : " +"2);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Sveika, pasaule!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Šī programma darbojas ar procesa numuru %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ms.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ms.po new file mode 100644 index 0000000000000000000000000000000000000000..f2b1567da328b4e55ff80a63218f5df078e96d21 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ms.po @@ -0,0 +1,28 @@ +# hello-smalltalk Bahasa Melayu (Malay) (ms). +# Copyright (C) 2006, 2015, 2023, 2025 Yoyodyne, Inc. (msgids) +# Copyright (C) 2006, 2015, 2023, 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the gettext package. +# Sharuzzaman Ahmat Raslan , 2006, 2015, 2023, 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-05-03 21:10+0800\n" +"Last-Translator: Sharuzzaman Ahmat Raslan \n" +"Language-Team: Malay \n" +"Language: ms\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Hello, dunia!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Program ini dilaksanakan sebagai proses bernombor %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/mt.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/mt.po new file mode 100644 index 0000000000000000000000000000000000000000..8926c94dcb3edf6b2c16c0b0ee8cd6706ef8a87c --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/mt.po @@ -0,0 +1,27 @@ +# hello-smalltalk-0.16.2-pre5. +# Copyright (C) 2008 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Clyde Meli , 2001-2008. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.16.2-pre5\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2008-11-18 17:27+0100\n" +"Last-Translator: Clyde Meli \n" +"Language-Team: Maltese \n" +"Language: mt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Hello, lil kulħadd!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Dal-programm qed jaħdem taħt il-proċess numru %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/nb.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/nb.po new file mode 100644 index 0000000000000000000000000000000000000000..779e8cf39314af2306e369e396163f2dfc45b974 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/nb.po @@ -0,0 +1,29 @@ +# Norwegian Bokmal translations for hello-smalltalk package. +# Copyright (C) 2012 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Johnny A. Solbu , 2012-2024 +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2024-01-06 16:33+0100\n" +"Last-Translator: Johnny A. Solbu \n" +"Language-Team: Norwegian Bokmaal \n" +"Language: nb\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 2.4.2\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Hallo verden!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Dette programmet kjører som prosess nummer %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/nl.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/nl.po new file mode 100644 index 0000000000000000000000000000000000000000..9b5253d9e35df48e331d5d4c68d5988256e6023c --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/nl.po @@ -0,0 +1,31 @@ +# Dutch translations for GNU hello-smalltalk. +# Copyright (C) 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# "There are three basic rules for writing a novel. +# Unfortunately nobody knows what they are." +# +# Benno Schulenberg , 2007, 2014, 2015, 2019, 2025. +# Elros Cyriatan , 2004. +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk-0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-03-01 14:51+0100\n" +"Last-Translator: Benno Schulenberg \n" +"Language-Team: Dutch \n" +"Language: nl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Hallo, wereld!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Dit programma draait als proces nummer %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/nn.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/nn.po new file mode 100644 index 0000000000000000000000000000000000000000..2c00ade0b814626c538d0b427375c9f86cc565c5 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/nn.po @@ -0,0 +1,28 @@ +# Norwegian Nynorsk translation of GNU hello-smalltalk +# Copyright (C) 2020 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Karl Ove Hufthammer , 2020. +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk-0.20.2\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2020-05-04 18:58+0200\n" +"Last-Translator: Karl Ove Hufthammer \n" +"Language-Team: Norwegian Nynorsk \n" +"Language: nn\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 20.04.0\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Hei, verda!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Dette programmet køyrer som prosess nummer %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/pl.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/pl.po new file mode 100644 index 0000000000000000000000000000000000000000..b61d06aa9e75720adbc6886fe067ddcde1e86a64 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/pl.po @@ -0,0 +1,27 @@ +# Polish translations for the GNU gettext messages, hello-smalltalk domain +# Copyright (C) 2010, 2014, 2015, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Rafał Maszkowski , 2003, 2010, 2014, 2015, 2025 +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-smalltalk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-25 17:16+0200\n" +"Last-Translator: Rafał Maszkowski \n" +"Language-Team: Polish \n" +"Language: pl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8-bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " +"|| n%100>=20) ? 1 : 2);\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Cześć, świecie!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Ten program działa jako proces o numerze %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/pt.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/pt.po new file mode 100644 index 0000000000000000000000000000000000000000..9ba88de012da3bdad629223d300125d860d88758 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/pt.po @@ -0,0 +1,28 @@ +# Portuguese (Portugal) translation of 'hello-smalltalk' package. +# Copyright (C) 2018 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Pedro Albuquerque , 2019, 2020, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 11:24+0100\n" +"Last-Translator: Pedro Albuquerque \n" +"Language-Team: Portuguese \n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\\n;\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.6\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Olá mundo!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Este programa está em execução como processo nº %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/pt_BR.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/pt_BR.po new file mode 100644 index 0000000000000000000000000000000000000000..fb971843e78ffeb1dfee67f3b99eb3da42e0206e --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/pt_BR.po @@ -0,0 +1,31 @@ +# Brazilian Portuguese translations for gettext-example +# Traduções em português brasileiro para gettext-example +# Copyright (C) 2025 Yoyodyne, Inc. (msgids) +# Copyright (C) 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the gettext package. +# Rafael Fontenelle , 2013-2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 10:24-0300\n" +"Last-Translator: Rafael Fontenelle \n" +"Language-Team: Brazilian Portuguese \n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Gtranslator 48.0\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Olá, mundo!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Este programa está executando com número de processo %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ro.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ro.po new file mode 100644 index 0000000000000000000000000000000000000000..1f50cf8d3646bb070e047e5d7fa56ed0d8da5e1d --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ro.po @@ -0,0 +1,50 @@ +# Translation of "hello-smalltalk" messages to Romanian. +# Mesajele în limba română pentru pachetul hello-smalltalk. +# Copyright © 2015, 2019, 2022, 2023, 2024, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Eugen Hoancă , 2003. +# Mihai Cristescu , 2015 - 2019. +# Remus-Gabriel Chelu , 2022 - 2025. +# +# Cronologia traducerii fișierului „hello-smalltalk”: +# Traducerea inițială, făcută de EH, pentru versiunea hello-smalltalk 0.12.1, 2003. +# Actualizare a traducerii pentru versiunea hello-smalltalk 0.19.4-rc1, făcută de MC, mar-2015. +# Actualizare a traducerii pentru versiunea hello-smalltalk 0.19.4.73, făcută de MC, iun-2015. +# Actualizare a traducerii pentru versiunea hello-smalltalk 0.20-rc1, făcută de MC, apr-2019. +# Actualizare a mesajelor, de la fișierul „hello-smalltalk-0.20.2.pot”. +# Actualizare a algoritmului formelor de plural (de la „trei-vechi” la „trei-actual”). +# NU și a mesajelor traduse (acestea au rămas neschimbate). +# Eliminare a mesajelor ce-au dispărut în ultima versiune. +# Actualizări realizate de Remus-Gabriel Chelu , 15.01.2022. +# Actualizare a traducerii pentru versiunea 0.20.2 făcută de R-GC, ian-2022. +# Actualizare a traducerii pentru versiunea 0.22 făcută de R-GC, iun-2023. +# Revizuire și corectare a traducerii pentru versiunea 0.23-pre1 făcută de R-GC, oct-2024. +# Actualizare a traducerii pentru versiunea 0.24-pre1 făcută de R-GC, feb-2025. +# Actualizare a traducerii pentru versiunea 0.25-pre1 făcută de R-GC, apr-2025. +# Actualizare a traducerii pentru versiunea Y, făcută de X, Z(luna-anul). +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-29 00:25+0200\n" +"Last-Translator: Remus-Gabriel Chelu \n" +"Language-Team: Romanian \n" +"Language: ro\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < " +"20)) ? 1 : 2);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Salutare, lume!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Acest program rulează ca procesul numărul %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ru.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ru.po new file mode 100644 index 0000000000000000000000000000000000000000..1e31eda4b62172c3e3f3c9a6f1f972f9b4b6c965 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ru.po @@ -0,0 +1,30 @@ +# Translation of hello-smalltalk-0.14.1.po to Russian +# Copyright (C) 2004 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Pavel Maryanov , 2004. +# SPDX-FileCopyrightText: 2014, 2015, 2023, 2025 Yuri Kozlov +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-05-02 09:17+0300\n" +"Last-Translator: Yuri Kozlov \n" +"Language-Team: Russian \n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Lokalize 24.12.0\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Здравствуй, мир!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Эта программа выполняется как процесс под номером %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/sk.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/sk.po new file mode 100644 index 0000000000000000000000000000000000000000..bf08b0dc6010cdae86f3ef97098e81fec76dce4b --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/sk.po @@ -0,0 +1,26 @@ +# Slovak translations GNU for hello-smalltalk package. +# Copyright (C) 2003, 2004, 2014, 2023, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Marcel Telka , 2003, 2004, 2014, 2023, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-smalltalk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 13:53+0200\n" +"Last-Translator: Marcel Telka \n" +"Language-Team: Slovak \n" +"Language: sk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Ahoj svet!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Tento program beží ako proces s číslom %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/sl.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/sl.po new file mode 100644 index 0000000000000000000000000000000000000000..3a4ce0bd903d71c9588a8b2dad1304f293a9a25b --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/sl.po @@ -0,0 +1,29 @@ +# -*- mode: po; coding: utf-8; -*- Slovenian message catalog for GNU gettext-example +# Copyright (C) 2005 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Primož Peterlin , 2005, 2014, 2015, 2024. +# $Id: hello-smalltalk-0.22.sl.po,v 1.1 2024/03/28 17:02:19 peterlin Exp $ +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2024-03-28 18:02+0100\n" +"Last-Translator: Primož Peterlin \n" +"Language-Team: Slovenian \n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8-bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || " +"n%100==4 ? 3 : 0);\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Pozdravljen, svet!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Ta program teče kot proces številka %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/sq.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/sq.po new file mode 100644 index 0000000000000000000000000000000000000000..4e3fd74cd958ee57f60ae38179415eb096d684e8 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/sq.po @@ -0,0 +1,28 @@ +# Albanian translation of gettext-example. +# Copyright (C) 2020 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Besnik Bleta , 2020,2023,2024,2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk-0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 19:56+0300\n" +"Last-Translator: Besnik Bleta \n" +"Language-Team: Albanian \n" +"Language: sq\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.2.2\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Tungjatjeta, botë!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Ky program po xhiron si procesi numër %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/sr.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/sr.po new file mode 100644 index 0000000000000000000000000000000000000000..d43e6f45ded66c111bcb13e1be4d4f1f58fbe15a --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/sr.po @@ -0,0 +1,30 @@ +# Serbian translation of hello-smalltalk. +# Copyright (C) 2014 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Aleksandar Jelenak , 2004. +# Мирослав Николић , 2014-2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk-0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-03-02 16:51+0100\n" +"Last-Translator: Мирослав Николић \n" +"Language-Team: Serbian <(nothing)>\n" +"Language: sr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Здраво, свима!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Овај програм се извршава као процес број %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/sv.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/sv.po new file mode 100644 index 0000000000000000000000000000000000000000..2c538eaabf6de514e0203c57ac35b613b490c518 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/sv.po @@ -0,0 +1,30 @@ +# Swedish messages for hello-smalltalk. +# Copyright © 2006, 2014, 2016, 2019, 2020, 2023, 2024, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Jan Djärv , 2003, 2006, 2014. +# Göran Uddeborg , 2016, 2019, 2020, 2023, 2024, 2025. +# Luna Jernberg , 2025. +# $Revision: 1.12 $ +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 12:18+0200\n" +"Last-Translator: Luna Jernberg \n" +"Language-Team: Swedish \n" +"Language: sv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Hej världen!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Detta program kör som process nummer %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ta.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ta.po new file mode 100644 index 0000000000000000000000000000000000000000..ec86143ed211e2d47ea16b6db01affc2ee9e0ee4 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/ta.po @@ -0,0 +1,28 @@ +# Tamil messages for GNU gettext. +# Copyright (C) 2018 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# List of contributors follow: +# Poorajith , 2018. +# Arun Isaac , 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-06-19 00:06+0100\n" +"Last-Translator: Arun Isaac \n" +"Language-Team: Tamil \n" +"Language: ta\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "வணக்கம், உலகு!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "இந்நிரல் செயலாக்க எண் %1 ஆக இயங்கிக்கொண்டிருக்கிறது." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/tr.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/tr.po new file mode 100644 index 0000000000000000000000000000000000000000..88c9c95639e79d3f26070d3af442c255433fe37d --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/tr.po @@ -0,0 +1,29 @@ +# Turkish translation for hello-smalltalk. +# This file is distributed under the same license as the gettext package. +# Copyright (C) 2017 Yoyodyne, Inc. (msgids) +# Copyright (C) 2004 Free Software Foundation, Inc. +# Nilgün Belma Bugüner , 2003,2004 +# Mehmet Kececi , 2017, 2019, 2020. +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.20.2\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2020-04-17 13:10+0300\n" +"Last-Translator: Mehmet Kececi \n" +"Language-Team: Turkish \n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 2.3\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Merhaba, dünya!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Bu yazılım %1 süreç numarası ile çalışıyor." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/uk.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/uk.po new file mode 100644 index 0000000000000000000000000000000000000000..86884e3dd4ee8c5c8a58a16050ccb03d40303814 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/uk.po @@ -0,0 +1,30 @@ +# Ukrainian translation to hello-smalltalk +# Copyright (C) 2014 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Maxim V. Dziumanenko , 2004-2007. +# Yuri Chornoivan , 2014, 2015, 2023, 2025. +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 13:56+0300\n" +"Last-Translator: Yuri Chornoivan \n" +"Language-Team: Ukrainian \n" +"Language: uk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Lokalize 23.04.3\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Привіт, світе!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Ця програма виконується як процес з номером %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/vi.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/vi.po new file mode 100644 index 0000000000000000000000000000000000000000..04cd36bb8e57feb7334611fa00e9a1ad73aaccd3 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/vi.po @@ -0,0 +1,30 @@ +# Vietnamese Translation for Gettext Examples. +# Bản dịch tiếng Việt dành cho các ví dụ của gói gettext. +# Copyright © 2015 Yoyodyne, Inc. (msgids) +# Copyright © 2015 Free Software Foundation, Inc. +# This file is distributed under the same license as the gettext package. +# Clytie Siddall , 2005-2010. +# Trần Ngọc Quân , 2012-2015, 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-06-24 09:10+0700\n" +"Last-Translator: Trần Ngọc Quân \n" +"Language-Team: Vietnamese \n" +"Language: vi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "Chào thế giới!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "Chương trình này đang chạy với mã số tiến trình %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/zh_CN.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/zh_CN.po new file mode 100644 index 0000000000000000000000000000000000000000..6a6289bfd58e89992a15f86e9b762bd1885c634b --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/zh_CN.po @@ -0,0 +1,29 @@ +# zh_CN translation for hello-smalltalk. +# Copyright (C) 2015 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Funda Wang , 2003. +# Ji ZhengYu , 2015. +# Boyuan Yang <073plan@gmail.com>, 2019, 2023, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-29 15:56-0400\n" +"Last-Translator: Boyuan Yang <073plan@gmail.com>\n" +"Language-Team: Chinese (simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.6\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "你好,世界!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "此程序正以进程号 %1 运行。" diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/zh_HK.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/zh_HK.po new file mode 100644 index 0000000000000000000000000000000000000000..738a2ab2cedcdba102289e0cd76594a2393d0b26 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/zh_HK.po @@ -0,0 +1,25 @@ +# Chinese (Hong Kong) translation of hello-smalltalk. +# Copyright (C) 2006 Yoyodyne, Inc. +# Abel Cheung , 2006. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.15-pre5\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2006-07-05 15:40+0800\n" +"Last-Translator: Abel Cheung \n" +"Language-Team: Chinese (Hong Kong) \n" +"Language: zh_HK\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "你好!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "本程式正在執行中,進程編號為 %1。" diff --git a/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/zh_TW.po b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/zh_TW.po new file mode 100644 index 0000000000000000000000000000000000000000..72805749772d30c4ff1b4820badc70aaba456b23 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-smalltalk/po/zh_TW.po @@ -0,0 +1,29 @@ +# Traditional Chinese translation of hello-smalltalk. +# Copyright (C) 2009 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Abel Cheung , 2005. +# Wei-Lun Chao , 2013, 2015. +# Yi-Jyun Pan , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-smalltalk 0.23-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2024-11-30 14:14+0800\n" +"Last-Translator: Yi-Jyun Pan \n" +"Language-Team: Chinese (traditional) \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.st.in:31 +msgid "Hello, world!" +msgstr "哈囉,大家好!" + +#: hello.st.in:32 +#, smalltalk-format +msgid "This program is running as process number %1." +msgstr "本程式正在執行,行程編號為 %1。" diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/INSTALL b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/INSTALL new file mode 100644 index 0000000000000000000000000000000000000000..4797fdff83866d880da2b4dc78ffbcb3a18f695d --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/INSTALL @@ -0,0 +1,12 @@ +This example relies on: + - Tk (wish and libtk) + - Tcl (tclsh and libtcl) + +Installation: + ./autogen.sh + ./configure --prefix=/some/prefix + make + make install +Cleanup: + make distclean + ./autoclean.sh diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/Makefile.am b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..b76e71d94a2fe75afa8bf3b55bef12edf344ed34 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/Makefile.am @@ -0,0 +1,17 @@ +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_SCRIPTS = hello + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/autoclean.sh b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/autoclean.sh new file mode 100644 index 0000000000000000000000000000000000000000..6f5fa67d4e91a07146b82aa11acf28ff8ce0e205 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/autoclean.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean +rm -rf autom4te.cache + +# Brought in by explicit copy. +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f m4/progtest.m4 +rm -f po/remove-potcdate.sed + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f po/Makefile.in +rm -f install-sh +rm -f missing +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.msg diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/autogen.sh b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/autogen.sh new file mode 100644 index 0000000000000000000000000000000000000000..98187f3b21038db0c74e6b8ec9e289695adae7b7 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/autogen.sh @@ -0,0 +1,44 @@ +#!/bin/sh +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +if test -r ../Makefile.am; then + # Inside the gettext source directory. + GETTEXT_TOPSRCDIR=../../.. +else + if test -r ../Makefile; then + # Inside a gettext build directory. + GETTEXT_TOOLS_SRCDIR=`sed -n -e 's,^top_srcdir *= *\(.*\)$,\1,p' ../Makefile` + # Adjust a relative top_srcdir. + case $GETTEXT_TOOLS_SRCDIR in + /*) ;; + *) GETTEXT_TOOLS_SRCDIR=../$GETTEXT_TOOLS_SRCDIR ;; + esac + GETTEXT_TOPSRCDIR=$GETTEXT_TOOLS_SRCDIR/../.. + else + # Installed under ${prefix}/share/doc/gettext/examples. + . ../installpaths + fi +fi + +cp -p ${ACLOCALDIR-$GETTEXT_TOPSRCDIR/gettext-runtime/m4}/nls.m4 m4/nls.m4 +cp -p ${ACLOCALDIR-$GETTEXT_TOPSRCDIR/gettext-runtime/m4}/po.m4 m4/po.m4 +cp -p ${ACLOCALDIR-$GETTEXT_TOPSRCDIR/gettext-runtime/m4}/progtest.m4 m4/progtest.m4 +cp -p ${GETTEXTSRCPODIR-$GETTEXT_TOPSRCDIR/gettext-runtime/po}/remove-potcdate.sed po/remove-potcdate.sed + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c --tcl -d . -l $lang $lang.po + fi +done +cd .. diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/configure.ac b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/configure.ac new file mode 100644 index 0000000000000000000000000000000000000000..7d95739dee3b2a1d810b0e58ecbf518f5fef696a --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/configure.ac @@ -0,0 +1,44 @@ +dnl Example for use of GNU gettext. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT([hello-tcl-tk], [0]) +AC_CONFIG_SRCDIR([hello.tcl]) +AM_INIT_AUTOMAKE([1.11]) + +dnl Check for availability of the Tcl/Tk interpreter. +AC_PATH_PROG([WISH], [wish]) +if test -z "$WISH"; then + echo "*** Essential program wish not found" 1>&2 + exit 1 +fi +AC_SUBST([WISH]) + +dnl The installed program must know where to find its message catalogs. +dnl Unfortunately, prefix gets only finally determined at the end of configure. +if test "X$prefix" = "XNONE"; then + final_prefix="$ac_default_prefix" +else + final_prefix="$prefix" +fi +save_prefix="$prefix" +prefix="$final_prefix" +save_datarootdir="$datarootdir" +eval "datarootdir=\"${datarootdir}\"" +save_datadir="$datadir" +eval "datadir=\"${datadir}\"" +pkgdatadir="${datadir}/${PACKAGE}" +datadir="$save_datadir" +datarootdir="$save_datarootdir" +prefix="$save_prefix" +AC_SUBST([pkgdatadir]) + +dnl Support for the po directory. +AM_PO_SUBDIRS + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([hello:hello.tcl], [chmod a+x hello]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) +AC_OUTPUT diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/hello.tcl b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/hello.tcl new file mode 100644 index 0000000000000000000000000000000000000000..4dfee53a084fb0818c2c19e66e4fab031f7d25b3 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/hello.tcl @@ -0,0 +1,19 @@ +#!@WISH@ +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Source code of the Tcl/Tk program. + +package require msgcat +::msgcat::mcload [file join "@pkgdatadir@" "msgs"] +proc _ {s} {return [::msgcat::mc $s]} + +frame .my +button .my.button \ + -text [_ "Hello, world!"] \ + -command exit +label .my.label \ + -text [format [_ "This program is running as process number %d."] [pid]] +pack .my.button -side top +pack .my.label -side bottom +pack .my diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/m4/Makefile.am b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/m4/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..8a841b31f12ff3bd59428fbba049f50825d91510 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/m4/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + nls.m4 po.m4 diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/LINGUAS b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/LINGUAS new file mode 100644 index 0000000000000000000000000000000000000000..dc4a82afbad945018082c22f2061a43ef436dd68 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/LINGUAS @@ -0,0 +1,5 @@ +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Set of available languages. +af ast bg ca cs da de el eo es fi fr ga gl hr hu id it ja ka ky lv ms mt nb nl nn pl pt pt_BR ro ru sk sl sq sr sv ta tr uk vi zh_CN zh_HK zh_TW diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/Makefile.am b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..1f123a933b34025f18c9e2b00be6154f5e66b12f --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/Makefile.am @@ -0,0 +1,367 @@ +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# List of files which contain translatable strings. +POTFILES = \ + hello.tcl + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --flag=_:1:pass-tcl-format + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgid strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This tells whether or not to prepend "GNU " prefix to the package +# name that gets inserted into the header of the $(DOMAIN).pot file. +# Possible values are "yes", "no", or empty. If it is empty, try to +# detect it automatically by scanning the files in $(top_srcdir) for +# "GNU packagename" string. +PACKAGE_GNU = no + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gettext@gnu.org + +# These options get passed to msgmerge. +# Useful options are in particular: +# --previous to keep previous msgids of translated messages +MSGMERGE_OPTIONS = + +# These options get passed to msginit. +# If you want to disable line wrapping when writing PO files, add +# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and +# MSGINIT_OPTIONS. +MSGINIT_OPTIONS = + +MSGMERGE = @MSGMERGE@ +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done + +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg) +# It also creates the .tcl-rules file. +MSGFILES != tab=`printf '\t'`; \ + for lang in $(ALL_LINGUAS); do \ + frobbedlang=`echo $$lang | sed -e 's/\..*$$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`; \ + echo 1>&3 "$$frobbedlang.msg: $$lang.po"; \ + echo 1>&3 "$${tab}@echo \"\$$(MSGFMT) -c --tcl -d \$$(srcdir) -l $$lang \$$(srcdir)/$$lang.po\"; \\"; \ + echo 1>&3 "$${tab}\$$(MSGFMT) -c --tcl -d \"\$$(srcdir)\" -l $$lang \$$(srcdir)/$$lang.po || { rm -f \"\$$(srcdir)/$$frobbedlang.msg\"; exit 1; }"; \ + echo $(srcdir)/$$frobbedlang.msg; \ + done 3> .tcl-rules +# Include the generated rules that cannot be formulated as a simple rule. +-include .tcl-rules + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We use the presentlang catalog if desiredlang is +# a. equal to presentlang, or +# b. a variant of presentlang (because in this case, presentlang can be used +# as a fallback for messages which are not translated in the desiredlang +# catalog). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(frob $(lang)).msg) +CATALOGS != for lang in $(INST_LINGUAS); do \ + frobbedlang=`echo $$lang | sed -e 's/\..*$$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`; \ + echo $$frobbedlang.gmo; \ + done + +SUFFIXES = .nop .po-create .po-update + +# The .pot file, stamp-po, .po files, and .msg files appear in release tarballs. +# The GNU Coding Standards say in +# : +# "GNU distributions usually contain some files which are not source files +# ... . Since these files normally appear in the source directory, they +# should always appear in the source directory, not in the build directory. +# So Makefile rules to update them should put the updated files in the +# source directory." +# Therefore we put these files in the source directory, not the build directory. + + +all-local: all-local-@USE_NLS@ + +all-local-yes: $(srcdir)/stamp-po +all-local-no: + +# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no +# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because +# we don't want to bother translators with empty POT files). We assume that +# LINGUAS is empty in this case, i.e. $(POFILES) and $(MSGFILES) are empty. +# In this case, $(srcdir)/stamp-po is a nop (i.e. a phony target). + +# $(srcdir)/stamp-po is a timestamp denoting the last time at which the CATALOGS +# have been loosely updated. Its purpose is that when a developer or translator +# checks out the package from a version control system, and the $(DOMAIN).pot +# file is not under version control, "make" will update the $(DOMAIN).pot and +# the $(CATALOGS), but subsequent invocations of "make" will do nothing. This +# timestamp would not be necessary if updating the $(CATALOGS) would always +# touch them; however, the rule for $(POFILES) has been designed to not touch +# files that don't need to be changed. +$(srcdir)/stamp-po: $(srcdir)/$(DOMAIN).pot + test ! -f $(srcdir)/$(DOMAIN).pot || \ + test -z "$(MSGFILES)" || $(MAKE) $(MSGFILES) + @test ! -f $(srcdir)/$(DOMAIN).pot || { \ + echo "touch $(srcdir)/stamp-po" && \ + echo timestamp > $(srcdir)/stamp-poT && \ + mv $(srcdir)/stamp-poT $(srcdir)/stamp-po; \ + } + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +# The determination of whether the package xyz is a GNU one is based on the +# heuristic whether some file in the top level directory mentions "GNU xyz". +# If GNU 'find' is available, we avoid grepping through monster files. +$(DOMAIN).pot-update: $(POTFILES_DEPS) + package_gnu="$(PACKAGE_GNU)"; \ + test -n "$$package_gnu" || { \ + if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ + LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep -i 'GNU $(PACKAGE)' /dev/null '{}' ';' 2>/dev/null; \ + else \ + LC_ALL=C grep -i 'GNU $(PACKAGE)' $(top_srcdir)/* 2>/dev/null; \ + fi; \ + } | grep -v 'libtool:' >/dev/null; then \ + package_gnu=yes; \ + else \ + package_gnu=no; \ + fi; \ + }; \ + if test "$$package_gnu" = "yes"; then \ + package_prefix='GNU '; \ + else \ + package_prefix=''; \ + fi; \ + if test -n '$(MSGID_BUGS_ADDRESS)'; then \ + msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ + else \ + msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ + fi; \ + case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + $(POTFILES) \ + ;; \ + *) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --package-name="$${package_prefix}$(PACKAGE)" \ + --package-version='$(VERSION)' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + $(POTFILES) \ + ;; \ + esac + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot-header; then \ + sed -e '1,/^#$$/d' < $(DOMAIN).po > $(DOMAIN).1po && \ + cat $(srcdir)/$(DOMAIN).pot-header $(DOMAIN).1po > $(DOMAIN).po && \ + rm -f $(DOMAIN).1po \ + || exit 1; \ + fi; \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f $(srcdir)/remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f $(srcdir)/remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + if test -f "$(srcdir)/$${lang}.po"; then \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) \ + && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.10 | 0.10.*) \ + $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ + 0.1[1-5] | 0.1[1-5].*) \ + $(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ + 0.1[6-7] | 0.1[6-7].*) \ + $(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) --previous $${lang}.po $(DOMAIN).pot;; \ + *) \ + $(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot;; \ + esac; \ + }; \ + else \ + $(MAKE) $${lang}.po-create; \ + fi + + +install-data-local: install-data-local-@USE_NLS@ +install-data-local-no: all-local +install-data-local-yes: all-local + $(MKDIR_P) $(DESTDIR)$(pkgdatadir)/msgs + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$(pkgdatadir)/msgs/$$cat; \ + echo "installing $$realcat as $(DESTDIR)$(pkgdatadir)/msgs/$$cat"; \ + done + +installdirs-local: installdirs-local-@USE_NLS@ +installdirs-local-no: +installdirs-local-yes: + $(MKDIR_P) $(DESTDIR)$(pkgdatadir)/msgs + +uninstall-local: uninstall-local-@USE_NLS@ +uninstall-local-no: +uninstall-local-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + rm -f $(DESTDIR)$(pkgdatadir)/msgs/$$cat; \ + done + +html ID: + +DISTCLEANFILES = .tcl-rules + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* *.stackdump $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po +MOSTLYCLEANFILES += *.o + +MAINTAINERCLEANFILES = $(DOMAIN).pot stamp-po $(MSGFILES) + +EXTRA_DIST = remove-potcdate.sed LINGUAS $(POFILES) $(MSGFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + $(MAKE) $(srcdir)/stamp-po + @if test -f $(srcdir)/$(DOMAIN).pot; then \ + for file in $(DOMAIN).pot stamp-po; do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + cp -p $$d/$$file $(distdir)/$$file || exit 1; \ + done; \ + else \ + case $(XGETTEXT) in \ + :) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because a suitable 'xgettext' program was not found in PATH." 1>&2;; \ + *) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because 'xgettext' found no strings to extract. Check the POTFILES and the XGETTEXT_OPTIONS in the Makefile.am file." 1>&2;; \ + esac; \ + fi + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-msg + +# General rule for creating PO files. + +.nop.po-create: + @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ + echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ + exit 1 + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) --lang=$$lang --previous $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.10 | 0.10.*) \ + $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + 0.1[1-5] | 0.1[1-5].*) \ + $(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + 0.1[6-7] | 0.1[6-7].*) \ + $(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + *) \ + $(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) --lang=$$lang --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + esac; \ + }; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-msg: Makefile $(MSGFILES) + @: diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/af.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/af.po new file mode 100644 index 0000000000000000000000000000000000000000..54cd61067ff09f169d7113bc70aff21883b09630 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/af.po @@ -0,0 +1,26 @@ +# Afrikaans translation for Silky +# Copyright (C) 2004 Free Software Foundation, Inc. +# This file is distributed under the same license as the silky package. +# Hanlie Pretorius , 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk-0.13.1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2003-12-31 10:30+2\n" +"Last-Translator: Ysbeer \n" +"Language-Team: Afrikaans \n" +"Language: af\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Hallo wêreld!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Hierdie program loop as prosesnommer %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ast.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ast.po new file mode 100644 index 0000000000000000000000000000000000000000..8ae95df3a47811bbe7e35ce22439e1ddc31b46f2 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ast.po @@ -0,0 +1,29 @@ +# Asturian translation for hello-tcl-tk +# Copyright (C) 2018 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Marquinos , 2009. +# enolp , 2018. +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2018-07-16 00:28+0100\n" +"Last-Translator: enolp \n" +"Language-Team: Asturian \n" +"Language: ast\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Lokalize 2.0\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "¡Hola, mundu!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Esti programa ta executándose como procesu númberu %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/bg.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/bg.po new file mode 100644 index 0000000000000000000000000000000000000000..9547624bcd5d2f41ee9e6cad48e4312eecfd09ea --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/bg.po @@ -0,0 +1,26 @@ +# Bulgarian translations for hello-tcl-tk package. +# Copyright (C) 2010 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Roumen Petrov , 2010,2014,2015,2019,2023,2024.2025. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-tcl-tk 0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-03-08 19:09+0200\n" +"Last-Translator: Roumen Petrov \n" +"Language-Team: Bulgarian \n" +"Language: bg\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Здравейте всички!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Програмата е пусната под процес номер %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ca.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ca.po new file mode 100644 index 0000000000000000000000000000000000000000..fd1c16f2653f844cd9acda8750bc28292401516e --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ca.po @@ -0,0 +1,27 @@ +# Catalan messages for GNU hello-tcl-tk. +# Copyright (C) 2003, 2014, 2015 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Ivan Vilata i Balaguer , 2003, 2014, 2015, 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-07-07 08:36+0200\n" +"Last-Translator: Ivan Vilata i Balaguer \n" +"Language-Team: Catalan \n" +"Language: ca\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Hola, món!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Aquest programa està corrent amb el número de procés %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/cs.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/cs.po new file mode 100644 index 0000000000000000000000000000000000000000..79bb1126cdd97ebda7e572a3703a34a5a059d4a3 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/cs.po @@ -0,0 +1,29 @@ +# The Czech translation for the gettext package. +# Copyright (C) 2011 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Marek Černocký , 2011. +# Petr Písař , 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 20:05+02:00\n" +"Last-Translator: Petr Pisar \n" +"Language-Team: Czech \n" +"Language: cs\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Ahoj světe!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Tento program běží jako proces číslo %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/da.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/da.po new file mode 100644 index 0000000000000000000000000000000000000000..d83982f508f8c23070786b162c8a97c73cc26bd1 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/da.po @@ -0,0 +1,28 @@ +# Danish messages for hello-tcl-tk. +# Copyright (C) 2015 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Jan Djærv , 2003, 2006. +# Keld Simonsen , 2011. +# Joe Hansen , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2015-06-27 12:39+0100\n" +"Last-Translator: Joe Hansen \n" +"Language-Team: Danish \n" +"Language: da\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Hej verden!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Dette program kører som proces nummer %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/de.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/de.po new file mode 100644 index 0000000000000000000000000000000000000000..dd8c62e0742090aceacee4cf48e961f3c74cd8ec --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/de.po @@ -0,0 +1,32 @@ +# German messages for hello-tcl-tk. +# Copyright © 2003, 2013 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Bruno Haible , 2003. +# Karl Eichwalder , 2003. +# Jakob Kramer , 2013. +# Mario Blättermann , 2014, 2023, 2025. +# Philipp Thomas , 2015. +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 17:15+0200\n" +"Last-Translator: Mario Blättermann \n" +"Language-Team: German \n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 25.04.0\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/el.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/el.po new file mode 100644 index 0000000000000000000000000000000000000000..bf79fd268419b49b78919c0c6c28e7c6bd15b966 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/el.po @@ -0,0 +1,26 @@ +# Greek translation of hello-tcl-tk +# Copyright (C) 2005 Free Software Foundation, Inc. +# Simos Xenitellis , 2005. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.14.1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2005-01-06 18:50+0000\n" +"Last-Translator: Simos Xenitellis \n" +"Language-Team: Greek \n" +"Language: el\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: KBabel 1.3.1\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Γεια σου, κόσμε!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Αυτό το πρόγραμμα εκτελείται με αριθμό διεργασίας %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/eo.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/eo.po new file mode 100644 index 0000000000000000000000000000000000000000..432ae434af629b2c6ac769f7e72007e71f9fa40c --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/eo.po @@ -0,0 +1,28 @@ +# La teksto por la mesaĝoj de la programo "gettext". +# Copyright (C) 2006, 2016 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Edmund GRIMLEY EVANS , 2006. +# Felipe CASTRO , 2016, 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-06-23 19:00-0300\n" +"Last-Translator: Felipe Castro \n" +"Language-Team: Esperanto \n" +"Language: eo\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 2.4.2\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Saluton, mondo!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Ĉi tiu programo rulas kiel procez-numero %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/es.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/es.po new file mode 100644 index 0000000000000000000000000000000000000000..af3e2b1a197cff7eec68660387dbd0a0324d31aa --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/es.po @@ -0,0 +1,30 @@ +# Mensajes en español para GNU gettext. +# Copyright (C) 2014 Yoyodyne, Inc. (msgids) +# +# This file is distributed under the same license as the gettext package. +# +# Max de Mendizábal , 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004. +# Antonio Ceballos , 2014, 2015, 2023, 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk-0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-02-23 17:01+0100\n" +"Last-Translator: Antonio Ceballos \n" +"Language-Team: Spanish \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "¡Hola, mundo!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Este programa está corriendo como el proceso número %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/fi.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/fi.po new file mode 100644 index 0000000000000000000000000000000000000000..2f03f47ef2219d02a52c8e5c2ee0a34c06960996 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/fi.po @@ -0,0 +1,29 @@ +# Finnish messages for GNU Gettext examples. +# This file is distributed under the same license as the gettext package. +# Copyright © 2007, 2014, 2015 Yoyodyne, Inc. (msgids) +# Lauri Nurmi , 2007. +# Jorma Karvonen , 2014-2015. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2015-09-01 16:59+0300\n" +"Last-Translator: Jorma Karvonen \n" +"Language-Team: Finnish \n" +"Language: fi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 1.5.4\n" + +# Tämä nimenomainen käännös valittu GNU Hellon mukaisesti. +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Terve maailma!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Tämän ohjelman prosessinumero on %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/fr.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/fr.po new file mode 100644 index 0000000000000000000000000000000000000000..a8950698e1d2451744988e69103ce9505f3ba67d --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/fr.po @@ -0,0 +1,32 @@ +# Messages français pour GNU gettext. +# Copyright (C) 2006 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Michel Robitaille , 2006. +# Christophe Combelles , 2006 +# Stéphane Aulery , 2015 +# Christian Wiatr , 2023 +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-06-28 16:25+0200\n" +"Last-Translator: Christian Wiatr \n" +"Language-Team: French \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 2.4.2\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Bonjour, le monde !" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Ce programme est exécuté en tant que processus numéro %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ga.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ga.po new file mode 100644 index 0000000000000000000000000000000000000000..ed36260d9caf6b652023914cb3380e5838cc73b5 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ga.po @@ -0,0 +1,26 @@ +# Irish translations for hello-tcl-tk. +# Copyright (C) 2015 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Kevin Patrick Scannell , 2004, 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2017-01-10 12:09-0500\n" +"Last-Translator: Kevin Patrick Scannell \n" +"Language-Team: Irish \n" +"Language: ga\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Dia duit, a dhomhain!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Tá an clár seo ag rith mar phróiseas %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/gl.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/gl.po new file mode 100644 index 0000000000000000000000000000000000000000..72ff024e0f9e3496ad9b7ea04cee072c1396d48d --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/gl.po @@ -0,0 +1,31 @@ +# Galician translation for hello-tcl-tk package. +# Copyright (C) 2010 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Leandro Regueiro , 2010-2014. +# +# Proxecto Trasno - Adaptación do software libre á lingua galega: Se desexas +# colaborar connosco, podes atopar máis información en +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.19-rc1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2014-05-10 16:34+0100\n" +"Last-Translator: Leandro Regueiro \n" +"Language-Team: Galician \n" +"Language: gl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Ola, mundo!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Este programa estase executando como o proceso número %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/hr.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/hr.po new file mode 100644 index 0000000000000000000000000000000000000000..5de6e85c3eebf7d17e1c358d9d7382b89801663d --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/hr.po @@ -0,0 +1,33 @@ +# Translation of hello-tcl-tk to Croatian. +# Copyright (C) 2003, 2004, 2014, 2015, 2019 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Permission is granted to freely copy and distribute +# this file and modified versions, provided that this +# header is not removed and modified versions are marked +# as such. +# +# Tomislav Krznar , 2012. +# Božidar Putanec , 2018-2025. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-tcl-tk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 10:15-0700\n" +"Last-Translator: Božidar Putanec \n" +"Language-Team: Croatian \n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Pozdrav, svijete!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Ovaj program se izvršava kao proces broj %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/hu.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/hu.po new file mode 100644 index 0000000000000000000000000000000000000000..3ee94c934af8accdb2c7e4558a9da6d41e1e2353 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/hu.po @@ -0,0 +1,29 @@ +# Hungarian translation for hello-tcl-tk. +# This file is distributed under the same license as the gettext package. +# Copyright (C) 2014 Yoyodyne, Inc. (msgids) +# +# Tamás Kiss , 2005. +# Balázs Úr , 2014, 2015. +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2015-06-23 20:31+0200\n" +"Last-Translator: Balázs Úr \n" +"Language-Team: Hungarian \n" +"Language: hu\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 1.2\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Hello, világ!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Ez a program a(z) %d folyamatazonosítóval fut." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/id.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/id.po new file mode 100644 index 0000000000000000000000000000000000000000..63447cccf8336cba066124c18beca3b993566e39 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/id.po @@ -0,0 +1,27 @@ +# translation of hello-tcl-tk-0.15-pre5.po to Indonesian +# Copyright (C) 2006 Yoyodyne, Inc. +# This file is distributed under the same license as the PACKAGE package. +# +# Tedi Heriyanto , 2006. +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk-0.15-pre5\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2006-09-27 20:19+0700\n" +"Last-Translator: Tedi Heriyanto \n" +"Language-Team: Indonesian \n" +"Language: id\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: KBabel 1.11.2\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Hello, world!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Program ini berjalan sebagai proses nomor %d" diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/it.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/it.po new file mode 100644 index 0000000000000000000000000000000000000000..13e2c291cae1d57eb81c6f2ae42d6ccad02fc06b --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/it.po @@ -0,0 +1,29 @@ +# Italian messages for hello-tcl-tk. +# Copyright (C) 2005, 2006 Yoyodyne, Inc. (msgids) +# Copyright (C) 2024 Free Software Foundation, Inc. +# This file is distributed under the same license as the gettext package. +# Marco Colombo , 2005, 2006, 2015. +# Michele Locati , 2024, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-tcl-tk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-05-04 18:28+0200\n" +"Last-Translator: Michele Locati \n" +"Language-Team: Italian \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Ciao, mondo!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Questo programma è in esecuzione con numero di processo %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ja.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ja.po new file mode 100644 index 0000000000000000000000000000000000000000..3dd2fb0cb6e101c39bede3a8cef40971bcb4202d --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ja.po @@ -0,0 +1,26 @@ +# Translation of `hello-tcl-tk' messages to Japanese. +# Copyright (C) 2005, 2006, 2014, 2015, 2023, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Masahito Yamaga , 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-tcl-tk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 19:59+0900\n" +"Last-Translator: Masahito Yamaga \n" +"Language-Team: Japanese \n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "世界よ, こんにちは!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "このプログラムはプロセス番号 %d で動いています." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ka.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ka.po new file mode 100644 index 0000000000000000000000000000000000000000..5c9f73c4e398a9bcb2e887bc1e7811d65a0a7080 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ka.po @@ -0,0 +1,28 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2022 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Temuri Doghonadze , 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.20.2\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2022-05-22 05:04+0200\n" +"Last-Translator: Temuri Doghonadze \n" +"Language-Team: Georgian <(nothing)>\n" +"Language: ka\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.0.1\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "გამარჯობა სამყაროვ!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "პროგრამა გაშვებულია პროცესის ნომრით %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ky.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ky.po new file mode 100644 index 0000000000000000000000000000000000000000..e382bf94643765d23c455094caf4b2ada356b59a --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ky.po @@ -0,0 +1,28 @@ +# Translation of 'hello-tcl-tk' messages to Kirghiz. +# Copyright (C) 2004 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Ilyas Bakirov , 2007. +# Ilyas Bakirov , 2018. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2018-02-15 18:26+0600\n" +"Last-Translator: Ilyas Bakirov \n" +"Language-Team: Kirghiz \n" +"Language: ky\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 2.0.6\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Салам дүйнө!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Бул программа %d процесс номери катары иштеп жатат." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/lv.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/lv.po new file mode 100644 index 0000000000000000000000000000000000000000..fa60566299bae4efbc1fe54edf6122878f63da40 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/lv.po @@ -0,0 +1,30 @@ +# Latvian translation of hello-tcl-tk +# Copyright (C) 2009 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Arvis Lācis , 2009. +# Rihards Priedītis , 2023, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk-0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-03-09 11:44+0000\n" +"Last-Translator: Rihards Priedītis \n" +"Language-Team: Latvian \n" +"Language: lv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : " +"2);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Sveika, pasaule!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Šī programma darbojas ar procesa numuru %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ms.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ms.po new file mode 100644 index 0000000000000000000000000000000000000000..6cba564af4cc1f3206f8db4b508b7897e7312a85 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ms.po @@ -0,0 +1,28 @@ +# hello-tcl-tk Bahasa Melayu (Malay) (ms). +# Copyright (C) 2006, 2015, 2023, 2025 Yoyodyne, Inc. (msgids) +# Copyright (C) 2006, 2015, 2023, 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the gettext package. +# Sharuzzaman Ahmat Raslan , 2006, 2015, 2023, 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-05-03 21:10+0800\n" +"Last-Translator: Sharuzzaman Ahmat Raslan \n" +"Language-Team: Malay \n" +"Language: ms\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Hello, dunia!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Program ini dilaksanakan sebagai proses bernombor %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/mt.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/mt.po new file mode 100644 index 0000000000000000000000000000000000000000..2fb6fc54551cf2c8fceef46200b9a2e99512bc2d --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/mt.po @@ -0,0 +1,27 @@ +# hello-tcl-tk-0.16.2-pre5. +# Copyright (C) 2008 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Clyde Meli , 2001-2008. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.16.2-pre5\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2008-11-18 17:27+0100\n" +"Last-Translator: Clyde Meli \n" +"Language-Team: Maltese \n" +"Language: mt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Hello, lil kulħadd!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Dal-programm qed jaħdem taħt il-proċess numru %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/nb.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/nb.po new file mode 100644 index 0000000000000000000000000000000000000000..58616853bdece6458f9f40b876b8dec9bafb444e --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/nb.po @@ -0,0 +1,29 @@ +# Norwegian Bokmal translations for hello-tcl-tk package. +# Copyright (C) 2012 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Johnny A. Solbu , 2012-2024 +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2024-01-06 16:33+0100\n" +"Last-Translator: Johnny A. Solbu \n" +"Language-Team: Norwegian Bokmaal \n" +"Language: nb\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 2.4.2\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Hallo verden!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Dette programmet kjører som prosess nummer %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/nl.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/nl.po new file mode 100644 index 0000000000000000000000000000000000000000..c279d19dc31e283823917248c915e81ba4e06819 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/nl.po @@ -0,0 +1,31 @@ +# Dutch translations for GNU hello-tcl-tk. +# Copyright (C) 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# "There are three basic rules for writing a novel. +# Unfortunately nobody knows what they are." +# +# Benno Schulenberg , 2007, 2014, 2015, 2019, 2025. +# Elros Cyriatan , 2004. +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk-0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-03-01 14:51+0100\n" +"Last-Translator: Benno Schulenberg \n" +"Language-Team: Dutch \n" +"Language: nl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Hallo, wereld!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Dit programma draait als proces nummer %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/nn.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/nn.po new file mode 100644 index 0000000000000000000000000000000000000000..1fa402694401e791b3f4b99120aef0e033137a2e --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/nn.po @@ -0,0 +1,28 @@ +# Norwegian Nynorsk translation of GNU hello-tcl-tk +# Copyright (C) 2020 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Karl Ove Hufthammer , 2020. +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk-0.20.2\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2020-05-04 18:58+0200\n" +"Last-Translator: Karl Ove Hufthammer \n" +"Language-Team: Norwegian Nynorsk \n" +"Language: nn\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 20.04.0\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Hei, verda!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Dette programmet køyrer som prosess nummer %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/pl.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/pl.po new file mode 100644 index 0000000000000000000000000000000000000000..6615f16b4577af0a366760c6bf94dc3e6c7daff0 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/pl.po @@ -0,0 +1,27 @@ +# Polish translations for the GNU gettext messages, hello-tcl-tk domain +# Copyright (C) 2010, 2014, 2015, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Rafał Maszkowski , 2003, 2010, 2014, 2015, 2025 +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-tcl-tk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-25 17:16+0200\n" +"Last-Translator: Rafał Maszkowski \n" +"Language-Team: Polish \n" +"Language: pl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8-bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " +"|| n%100>=20) ? 1 : 2);\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Cześć, świecie!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Ten program działa jako proces o numerze %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/pt.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/pt.po new file mode 100644 index 0000000000000000000000000000000000000000..7a3c85e5908ab11f8c004e4285bc9057754fa5c8 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/pt.po @@ -0,0 +1,28 @@ +# Portuguese (Portugal) translation of 'hello-tcl-tk' package. +# Copyright (C) 2018 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Pedro Albuquerque , 2019, 2020, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 11:24+0100\n" +"Last-Translator: Pedro Albuquerque \n" +"Language-Team: Portuguese \n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\\n;\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.6\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Olá mundo!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Este programa está em execução como processo nº %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/pt_BR.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/pt_BR.po new file mode 100644 index 0000000000000000000000000000000000000000..18f4ff78dbe98cf7a35a9f638ccfaace75d4fdec --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/pt_BR.po @@ -0,0 +1,31 @@ +# Brazilian Portuguese translations for gettext-example +# Traduções em português brasileiro para gettext-example +# Copyright (C) 2025 Yoyodyne, Inc. (msgids) +# Copyright (C) 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the gettext package. +# Rafael Fontenelle , 2013-2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 10:24-0300\n" +"Last-Translator: Rafael Fontenelle \n" +"Language-Team: Brazilian Portuguese \n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Gtranslator 48.0\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Olá, mundo!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Este programa está sendo executado com número de processo %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ro.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ro.po new file mode 100644 index 0000000000000000000000000000000000000000..3e35df3e90e4f5f1c2a9d6a30d715ab0407ad9d6 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ro.po @@ -0,0 +1,50 @@ +# Translation of "hello-tcl-tk" messages to Romanian. +# Mesajele în limba română pentru pachetul hello-tcl-tk. +# Copyright © 2015, 2019, 2022, 2023, 2024, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Eugen Hoancă , 2003. +# Mihai Cristescu , 2015 - 2019. +# Remus-Gabriel Chelu , 2022 - 2025. +# +# Cronologia traducerii fișierului „hello-tcl-tk”: +# Traducerea inițială, făcută de EH, pentru versiunea hello-tcl-tk 0.12.1, 2003. +# Actualizare a traducerii pentru versiunea hello-tcl-tk 0.19.4-rc1, făcută de MC, mar-2015. +# Actualizare a traducerii pentru versiunea hello-tcl-tk 0.19.4.73, făcută de MC, iun-2015. +# Actualizare a traducerii pentru versiunea hello-tcl-tk 0.20-rc1, făcută de MC, apr-2019. +# Actualizare a mesajelor, de la fișierul „hello-tcl-tk-0.20.2.pot”. +# Actualizare a algoritmului formelor de plural (de la „trei-vechi” la „trei-actual”). +# NU și a mesajelor traduse (acestea au rămas neschimbate). +# Eliminare a mesajelor ce-au dispărut în ultima versiune. +# Actualizări realizate de Remus-Gabriel Chelu , 15.01.2022. +# Actualizare a traducerii pentru versiunea 0.20.2 făcută de R-GC, ian-2022. +# Actualizare a traducerii pentru versiunea 0.22 făcută de R-GC, iun-2023. +# Revizuire și corectare a traducerii pentru versiunea 0.23-pre1 făcută de R-GC, oct-2024. +# Actualizare a traducerii pentru versiunea 0.24-pre1 făcută de R-GC, feb-2025. +# Actualizare a traducerii pentru versiunea 0.25-pre1 făcută de R-GC, apr-2025. +# Actualizare a traducerii pentru versiunea Y, făcută de X, Z(luna-anul). +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-29 00:25+0200\n" +"Last-Translator: Remus-Gabriel Chelu \n" +"Language-Team: Romanian \n" +"Language: ro\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < " +"20)) ? 1 : 2);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Salutare, lume!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Acest program rulează ca procesul numărul %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ru.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ru.po new file mode 100644 index 0000000000000000000000000000000000000000..c4a8e9dab2de6cd0358e386056a29fa887dd4415 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ru.po @@ -0,0 +1,30 @@ +# Translation of hello-tcl-tk-0.14.1.po to Russian +# Copyright (C) 2004 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Pavel Maryanov , 2004. +# SPDX-FileCopyrightText: 2014, 2015, 2023, 2025 Yuri Kozlov +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-05-02 09:17+0300\n" +"Last-Translator: Yuri Kozlov \n" +"Language-Team: Russian \n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Lokalize 24.12.0\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Здравствуй, мир!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Эта программа выполняется как процесс под номером %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/sk.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/sk.po new file mode 100644 index 0000000000000000000000000000000000000000..143163efed72ce1b1780e66d93adaf79fc6cf060 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/sk.po @@ -0,0 +1,26 @@ +# Slovak translations GNU for hello-tcl-tk package. +# Copyright (C) 2003, 2004, 2014, 2023, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Marcel Telka , 2003, 2004, 2014, 2023, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-tcl-tk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 13:53+0200\n" +"Last-Translator: Marcel Telka \n" +"Language-Team: Slovak \n" +"Language: sk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Ahoj svet!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Tento program beží ako proces s číslom %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/sl.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/sl.po new file mode 100644 index 0000000000000000000000000000000000000000..3f45598290ccfdc3460ee2fcc853e198625bf761 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/sl.po @@ -0,0 +1,29 @@ +# -*- mode: po; coding: utf-8; -*- Slovenian message catalog for GNU gettext-example +# Copyright (C) 2005 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Primož Peterlin , 2005, 2014, 2015, 2024. +# $Id: hello-tcl-tk-0.22.sl.po,v 1.1 2024/03/28 17:02:19 peterlin Exp $ +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2024-03-28 18:02+0100\n" +"Last-Translator: Primož Peterlin \n" +"Language-Team: Slovenian \n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8-bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || " +"n%100==4 ? 3 : 0);\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Pozdravljen, svet!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Ta program teče kot proces številka %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/sq.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/sq.po new file mode 100644 index 0000000000000000000000000000000000000000..3dc32f27cf988aa6278ae25b6625ad68b850f831 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/sq.po @@ -0,0 +1,28 @@ +# Albanian translation of gettext-example. +# Copyright (C) 2020 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Besnik Bleta , 2020,2023,2024,2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk-0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 19:56+0300\n" +"Last-Translator: Besnik Bleta \n" +"Language-Team: Albanian \n" +"Language: sq\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.2.2\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Tungjatjeta, botë!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Ky program po xhiron si procesi numër %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/sr.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/sr.po new file mode 100644 index 0000000000000000000000000000000000000000..6bf4701bdf0ddad42629c8284f15bc5ecb923162 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/sr.po @@ -0,0 +1,30 @@ +# Serbian translation of hello-tcl-tk. +# Copyright (C) 2014 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Aleksandar Jelenak , 2004. +# Мирослав Николић , 2014-2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk-0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-03-02 16:51+0100\n" +"Last-Translator: Мирослав Николић \n" +"Language-Team: Serbian <(nothing)>\n" +"Language: sr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Здраво, свима!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Овај програм се извршава као процес број %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/sv.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/sv.po new file mode 100644 index 0000000000000000000000000000000000000000..7f748f16c0b596fa4c5b7a9e43642c1a94c28f40 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/sv.po @@ -0,0 +1,30 @@ +# Swedish messages for hello-tcl-tk. +# Copyright © 2006, 2014, 2016, 2019, 2020, 2023, 2024, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Jan Djärv , 2003, 2006, 2014. +# Göran Uddeborg , 2016, 2019, 2020, 2023, 2024, 2025. +# Luna Jernberg , 2025. +# $Revision: 1.12 $ +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 12:18+0200\n" +"Last-Translator: Luna Jernberg \n" +"Language-Team: Swedish \n" +"Language: sv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Hej världen!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Detta program kör som process nummer %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ta.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ta.po new file mode 100644 index 0000000000000000000000000000000000000000..e127992c42324ad99665aacffc28c984c566f8ff --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/ta.po @@ -0,0 +1,28 @@ +# Tamil messages for GNU gettext. +# Copyright (C) 2018 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# List of contributors follow: +# Poorajith , 2018. +# Arun Isaac , 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-06-19 00:06+0100\n" +"Last-Translator: Arun Isaac \n" +"Language-Team: Tamil \n" +"Language: ta\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "வணக்கம், உலகு!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "இந்நிரல் செயலாக்க எண் %d ஆக இயங்கிக்கொண்டிருக்கிறது." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/tr.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/tr.po new file mode 100644 index 0000000000000000000000000000000000000000..04d154fe26d8f21867e1bb6c7a53b13e2687b88d --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/tr.po @@ -0,0 +1,29 @@ +# Turkish translation for hello-tcl-tk. +# This file is distributed under the same license as the gettext package. +# Copyright (C) 2017 Yoyodyne, Inc. (msgids) +# Copyright (C) 2004 Free Software Foundation, Inc. +# Nilgün Belma Bugüner , 2003,2004 +# Mehmet Kececi , 2017, 2019, 2020. +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.20.2\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2020-04-17 13:10+0300\n" +"Last-Translator: Mehmet Kececi \n" +"Language-Team: Turkish \n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 2.3\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Merhaba, dünya!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Bu yazılım %d işlem numarası ile çalışıyor." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/uk.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/uk.po new file mode 100644 index 0000000000000000000000000000000000000000..ba40eedf4c3576523914a2ece3293488bd5a3eb5 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/uk.po @@ -0,0 +1,30 @@ +# Ukrainian translation to hello-tcl-tk +# Copyright (C) 2014 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Maxim V. Dziumanenko , 2004-2007. +# Yuri Chornoivan , 2014, 2015, 2023, 2025. +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 13:56+0300\n" +"Last-Translator: Yuri Chornoivan \n" +"Language-Team: Ukrainian \n" +"Language: uk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Lokalize 23.04.3\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Привіт, світе!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Ця програма виконується як процес з номером %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/vi.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/vi.po new file mode 100644 index 0000000000000000000000000000000000000000..6075f26127bd0b726c2596d2481ef08f8c8ff848 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/vi.po @@ -0,0 +1,30 @@ +# Vietnamese Translation for Gettext Examples. +# Bản dịch tiếng Việt dành cho các ví dụ của gói gettext. +# Copyright © 2015 Yoyodyne, Inc. (msgids) +# Copyright © 2015 Free Software Foundation, Inc. +# This file is distributed under the same license as the gettext package. +# Clytie Siddall , 2005-2010. +# Trần Ngọc Quân , 2012-2015, 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-06-24 09:10+0700\n" +"Last-Translator: Trần Ngọc Quân \n" +"Language-Team: Vietnamese \n" +"Language: vi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "Chào thế giới!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Chương trình này đang chạy với mã số tiến trình %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/zh_CN.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/zh_CN.po new file mode 100644 index 0000000000000000000000000000000000000000..f434a517e2705f157344a9b65cf75d66e4e53e51 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/zh_CN.po @@ -0,0 +1,29 @@ +# zh_CN translation for hello-tcl-tk. +# Copyright (C) 2015 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Funda Wang , 2003. +# Ji ZhengYu , 2015. +# Boyuan Yang <073plan@gmail.com>, 2019, 2023, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-29 15:56-0400\n" +"Last-Translator: Boyuan Yang <073plan@gmail.com>\n" +"Language-Team: Chinese (simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.6\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "你好,世界!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "此程序正以进程号 %d 运行。" diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/zh_HK.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/zh_HK.po new file mode 100644 index 0000000000000000000000000000000000000000..aa632d17dc364d4bf38db698ccd267844460b7be --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/zh_HK.po @@ -0,0 +1,25 @@ +# Chinese (Hong Kong) translation of hello-tcl-tk. +# Copyright (C) 2006 Yoyodyne, Inc. +# Abel Cheung , 2006. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.15-pre5\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2006-07-05 15:40+0800\n" +"Last-Translator: Abel Cheung \n" +"Language-Team: Chinese (Hong Kong) \n" +"Language: zh_HK\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "你好!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "本程式正在執行中,進程編號為 %d。" diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/zh_TW.po b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/zh_TW.po new file mode 100644 index 0000000000000000000000000000000000000000..5824dcc17d3715dec150c954a2561c0194ef4967 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl-tk/po/zh_TW.po @@ -0,0 +1,29 @@ +# Traditional Chinese translation of hello-tcl-tk. +# Copyright (C) 2009 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Abel Cheung , 2005. +# Wei-Lun Chao , 2013, 2015. +# Yi-Jyun Pan , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-tk 0.23-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2024-11-30 14:14+0800\n" +"Last-Translator: Yi-Jyun Pan \n" +"Language-Team: Chinese (traditional) \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.tcl:13 +msgid "Hello, world!" +msgstr "哈囉,大家好!" + +#: hello.tcl:16 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "本程式正在執行,行程編號為 %d。" diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/INSTALL b/miniconda3/share/doc/gettext/examples/hello-tcl/INSTALL new file mode 100644 index 0000000000000000000000000000000000000000..c020e479e659418e06c36179d714f086cf743d6d --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/INSTALL @@ -0,0 +1,11 @@ +This example relies on: + - Tcl (tclsh and libtcl) + +Installation: + ./autogen.sh + ./configure --prefix=/some/prefix + make + make install +Cleanup: + make distclean + ./autoclean.sh diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/Makefile.am b/miniconda3/share/doc/gettext/examples/hello-tcl/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..b76e71d94a2fe75afa8bf3b55bef12edf344ed34 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/Makefile.am @@ -0,0 +1,17 @@ +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_SCRIPTS = hello + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/autoclean.sh b/miniconda3/share/doc/gettext/examples/hello-tcl/autoclean.sh new file mode 100644 index 0000000000000000000000000000000000000000..6f5fa67d4e91a07146b82aa11acf28ff8ce0e205 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/autoclean.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean +rm -rf autom4te.cache + +# Brought in by explicit copy. +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f m4/progtest.m4 +rm -f po/remove-potcdate.sed + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f po/Makefile.in +rm -f install-sh +rm -f missing +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.msg diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/autogen.sh b/miniconda3/share/doc/gettext/examples/hello-tcl/autogen.sh new file mode 100644 index 0000000000000000000000000000000000000000..98187f3b21038db0c74e6b8ec9e289695adae7b7 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/autogen.sh @@ -0,0 +1,44 @@ +#!/bin/sh +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +if test -r ../Makefile.am; then + # Inside the gettext source directory. + GETTEXT_TOPSRCDIR=../../.. +else + if test -r ../Makefile; then + # Inside a gettext build directory. + GETTEXT_TOOLS_SRCDIR=`sed -n -e 's,^top_srcdir *= *\(.*\)$,\1,p' ../Makefile` + # Adjust a relative top_srcdir. + case $GETTEXT_TOOLS_SRCDIR in + /*) ;; + *) GETTEXT_TOOLS_SRCDIR=../$GETTEXT_TOOLS_SRCDIR ;; + esac + GETTEXT_TOPSRCDIR=$GETTEXT_TOOLS_SRCDIR/../.. + else + # Installed under ${prefix}/share/doc/gettext/examples. + . ../installpaths + fi +fi + +cp -p ${ACLOCALDIR-$GETTEXT_TOPSRCDIR/gettext-runtime/m4}/nls.m4 m4/nls.m4 +cp -p ${ACLOCALDIR-$GETTEXT_TOPSRCDIR/gettext-runtime/m4}/po.m4 m4/po.m4 +cp -p ${ACLOCALDIR-$GETTEXT_TOPSRCDIR/gettext-runtime/m4}/progtest.m4 m4/progtest.m4 +cp -p ${GETTEXTSRCPODIR-$GETTEXT_TOPSRCDIR/gettext-runtime/po}/remove-potcdate.sed po/remove-potcdate.sed + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c --tcl -d . -l $lang $lang.po + fi +done +cd .. diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/configure.ac b/miniconda3/share/doc/gettext/examples/hello-tcl/configure.ac new file mode 100644 index 0000000000000000000000000000000000000000..61c065bea4a06b927f578b4d2959b1e007671b0d --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/configure.ac @@ -0,0 +1,44 @@ +dnl Example for use of GNU gettext. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT([hello-tcl], [0]) +AC_CONFIG_SRCDIR([hello.tcl]) +AM_INIT_AUTOMAKE([1.11]) + +dnl Check for availability of the Tcl interpreter. +AC_PATH_PROG([TCLSH], [tclsh]) +if test -z "$TCLSH"; then + echo "*** Essential program tclsh not found" 1>&2 + exit 1 +fi +AC_SUBST([TCLSH]) + +dnl The installed program must know where to find its message catalogs. +dnl Unfortunately, prefix gets only finally determined at the end of configure. +if test "X$prefix" = "XNONE"; then + final_prefix="$ac_default_prefix" +else + final_prefix="$prefix" +fi +save_prefix="$prefix" +prefix="$final_prefix" +save_datarootdir="$datarootdir" +eval "datarootdir=\"${datarootdir}\"" +save_datadir="$datadir" +eval "datadir=\"${datadir}\"" +pkgdatadir="${datadir}/${PACKAGE}" +datadir="$save_datadir" +datarootdir="$save_datarootdir" +prefix="$save_prefix" +AC_SUBST([pkgdatadir]) + +dnl Support for the po directory. +AM_PO_SUBDIRS + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([hello:hello.tcl], [chmod a+x hello]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) +AC_OUTPUT diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/hello.tcl b/miniconda3/share/doc/gettext/examples/hello-tcl/hello.tcl new file mode 100644 index 0000000000000000000000000000000000000000..19832736fb00803b2710ef145ee8dffbf46dda13 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/hello.tcl @@ -0,0 +1,12 @@ +#!@TCLSH@ +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Source code of the Tcl program. + +package require msgcat +::msgcat::mcload [file join "@pkgdatadir@" "msgs"] +proc _ {s} {return [::msgcat::mc $s]} + +puts [_ "Hello, world!"] +puts [format [_ "This program is running as process number %d."] [pid]] diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/m4/Makefile.am b/miniconda3/share/doc/gettext/examples/hello-tcl/m4/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..8a841b31f12ff3bd59428fbba049f50825d91510 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/m4/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + nls.m4 po.m4 diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/LINGUAS b/miniconda3/share/doc/gettext/examples/hello-tcl/po/LINGUAS new file mode 100644 index 0000000000000000000000000000000000000000..dc4a82afbad945018082c22f2061a43ef436dd68 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/LINGUAS @@ -0,0 +1,5 @@ +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Set of available languages. +af ast bg ca cs da de el eo es fi fr ga gl hr hu id it ja ka ky lv ms mt nb nl nn pl pt pt_BR ro ru sk sl sq sr sv ta tr uk vi zh_CN zh_HK zh_TW diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/Makefile.am b/miniconda3/share/doc/gettext/examples/hello-tcl/po/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..1f123a933b34025f18c9e2b00be6154f5e66b12f --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/Makefile.am @@ -0,0 +1,367 @@ +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# List of files which contain translatable strings. +POTFILES = \ + hello.tcl + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --flag=_:1:pass-tcl-format + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgid strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This tells whether or not to prepend "GNU " prefix to the package +# name that gets inserted into the header of the $(DOMAIN).pot file. +# Possible values are "yes", "no", or empty. If it is empty, try to +# detect it automatically by scanning the files in $(top_srcdir) for +# "GNU packagename" string. +PACKAGE_GNU = no + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gettext@gnu.org + +# These options get passed to msgmerge. +# Useful options are in particular: +# --previous to keep previous msgids of translated messages +MSGMERGE_OPTIONS = + +# These options get passed to msginit. +# If you want to disable line wrapping when writing PO files, add +# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and +# MSGINIT_OPTIONS. +MSGINIT_OPTIONS = + +MSGMERGE = @MSGMERGE@ +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done + +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg) +# It also creates the .tcl-rules file. +MSGFILES != tab=`printf '\t'`; \ + for lang in $(ALL_LINGUAS); do \ + frobbedlang=`echo $$lang | sed -e 's/\..*$$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`; \ + echo 1>&3 "$$frobbedlang.msg: $$lang.po"; \ + echo 1>&3 "$${tab}@echo \"\$$(MSGFMT) -c --tcl -d \$$(srcdir) -l $$lang \$$(srcdir)/$$lang.po\"; \\"; \ + echo 1>&3 "$${tab}\$$(MSGFMT) -c --tcl -d \"\$$(srcdir)\" -l $$lang \$$(srcdir)/$$lang.po || { rm -f \"\$$(srcdir)/$$frobbedlang.msg\"; exit 1; }"; \ + echo $(srcdir)/$$frobbedlang.msg; \ + done 3> .tcl-rules +# Include the generated rules that cannot be formulated as a simple rule. +-include .tcl-rules + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We use the presentlang catalog if desiredlang is +# a. equal to presentlang, or +# b. a variant of presentlang (because in this case, presentlang can be used +# as a fallback for messages which are not translated in the desiredlang +# catalog). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(frob $(lang)).msg) +CATALOGS != for lang in $(INST_LINGUAS); do \ + frobbedlang=`echo $$lang | sed -e 's/\..*$$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`; \ + echo $$frobbedlang.gmo; \ + done + +SUFFIXES = .nop .po-create .po-update + +# The .pot file, stamp-po, .po files, and .msg files appear in release tarballs. +# The GNU Coding Standards say in +# : +# "GNU distributions usually contain some files which are not source files +# ... . Since these files normally appear in the source directory, they +# should always appear in the source directory, not in the build directory. +# So Makefile rules to update them should put the updated files in the +# source directory." +# Therefore we put these files in the source directory, not the build directory. + + +all-local: all-local-@USE_NLS@ + +all-local-yes: $(srcdir)/stamp-po +all-local-no: + +# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no +# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because +# we don't want to bother translators with empty POT files). We assume that +# LINGUAS is empty in this case, i.e. $(POFILES) and $(MSGFILES) are empty. +# In this case, $(srcdir)/stamp-po is a nop (i.e. a phony target). + +# $(srcdir)/stamp-po is a timestamp denoting the last time at which the CATALOGS +# have been loosely updated. Its purpose is that when a developer or translator +# checks out the package from a version control system, and the $(DOMAIN).pot +# file is not under version control, "make" will update the $(DOMAIN).pot and +# the $(CATALOGS), but subsequent invocations of "make" will do nothing. This +# timestamp would not be necessary if updating the $(CATALOGS) would always +# touch them; however, the rule for $(POFILES) has been designed to not touch +# files that don't need to be changed. +$(srcdir)/stamp-po: $(srcdir)/$(DOMAIN).pot + test ! -f $(srcdir)/$(DOMAIN).pot || \ + test -z "$(MSGFILES)" || $(MAKE) $(MSGFILES) + @test ! -f $(srcdir)/$(DOMAIN).pot || { \ + echo "touch $(srcdir)/stamp-po" && \ + echo timestamp > $(srcdir)/stamp-poT && \ + mv $(srcdir)/stamp-poT $(srcdir)/stamp-po; \ + } + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +# The determination of whether the package xyz is a GNU one is based on the +# heuristic whether some file in the top level directory mentions "GNU xyz". +# If GNU 'find' is available, we avoid grepping through monster files. +$(DOMAIN).pot-update: $(POTFILES_DEPS) + package_gnu="$(PACKAGE_GNU)"; \ + test -n "$$package_gnu" || { \ + if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ + LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep -i 'GNU $(PACKAGE)' /dev/null '{}' ';' 2>/dev/null; \ + else \ + LC_ALL=C grep -i 'GNU $(PACKAGE)' $(top_srcdir)/* 2>/dev/null; \ + fi; \ + } | grep -v 'libtool:' >/dev/null; then \ + package_gnu=yes; \ + else \ + package_gnu=no; \ + fi; \ + }; \ + if test "$$package_gnu" = "yes"; then \ + package_prefix='GNU '; \ + else \ + package_prefix=''; \ + fi; \ + if test -n '$(MSGID_BUGS_ADDRESS)'; then \ + msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ + else \ + msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ + fi; \ + case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + $(POTFILES) \ + ;; \ + *) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --package-name="$${package_prefix}$(PACKAGE)" \ + --package-version='$(VERSION)' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + $(POTFILES) \ + ;; \ + esac + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot-header; then \ + sed -e '1,/^#$$/d' < $(DOMAIN).po > $(DOMAIN).1po && \ + cat $(srcdir)/$(DOMAIN).pot-header $(DOMAIN).1po > $(DOMAIN).po && \ + rm -f $(DOMAIN).1po \ + || exit 1; \ + fi; \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f $(srcdir)/remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f $(srcdir)/remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + if test -f "$(srcdir)/$${lang}.po"; then \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) \ + && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.10 | 0.10.*) \ + $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ + 0.1[1-5] | 0.1[1-5].*) \ + $(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ + 0.1[6-7] | 0.1[6-7].*) \ + $(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) --previous $${lang}.po $(DOMAIN).pot;; \ + *) \ + $(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot;; \ + esac; \ + }; \ + else \ + $(MAKE) $${lang}.po-create; \ + fi + + +install-data-local: install-data-local-@USE_NLS@ +install-data-local-no: all-local +install-data-local-yes: all-local + $(MKDIR_P) $(DESTDIR)$(pkgdatadir)/msgs + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$(pkgdatadir)/msgs/$$cat; \ + echo "installing $$realcat as $(DESTDIR)$(pkgdatadir)/msgs/$$cat"; \ + done + +installdirs-local: installdirs-local-@USE_NLS@ +installdirs-local-no: +installdirs-local-yes: + $(MKDIR_P) $(DESTDIR)$(pkgdatadir)/msgs + +uninstall-local: uninstall-local-@USE_NLS@ +uninstall-local-no: +uninstall-local-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + rm -f $(DESTDIR)$(pkgdatadir)/msgs/$$cat; \ + done + +html ID: + +DISTCLEANFILES = .tcl-rules + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* *.stackdump $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po +MOSTLYCLEANFILES += *.o + +MAINTAINERCLEANFILES = $(DOMAIN).pot stamp-po $(MSGFILES) + +EXTRA_DIST = remove-potcdate.sed LINGUAS $(POFILES) $(MSGFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + $(MAKE) $(srcdir)/stamp-po + @if test -f $(srcdir)/$(DOMAIN).pot; then \ + for file in $(DOMAIN).pot stamp-po; do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + cp -p $$d/$$file $(distdir)/$$file || exit 1; \ + done; \ + else \ + case $(XGETTEXT) in \ + :) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because a suitable 'xgettext' program was not found in PATH." 1>&2;; \ + *) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because 'xgettext' found no strings to extract. Check the POTFILES and the XGETTEXT_OPTIONS in the Makefile.am file." 1>&2;; \ + esac; \ + fi + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-msg + +# General rule for creating PO files. + +.nop.po-create: + @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ + echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ + exit 1 + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) --lang=$$lang --previous $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.10 | 0.10.*) \ + $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + 0.1[1-5] | 0.1[1-5].*) \ + $(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + 0.1[6-7] | 0.1[6-7].*) \ + $(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + *) \ + $(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) --lang=$$lang --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + esac; \ + }; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-msg: Makefile $(MSGFILES) + @: diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/af.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/af.po new file mode 100644 index 0000000000000000000000000000000000000000..17b43afe816fa0555bab98bfc51baad7383663eb --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/af.po @@ -0,0 +1,26 @@ +# Afrikaans translation for Silky +# Copyright (C) 2004 Free Software Foundation, Inc. +# This file is distributed under the same license as the silky package. +# Hanlie Pretorius , 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-0.13.1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2003-12-31 10:30+2\n" +"Last-Translator: Ysbeer \n" +"Language-Team: Afrikaans \n" +"Language: af\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Hallo wêreld!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Hierdie program loop as prosesnommer %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/ast.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/ast.po new file mode 100644 index 0000000000000000000000000000000000000000..74f729b2547f7a91b9b8abdbb71cebda393f1da0 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/ast.po @@ -0,0 +1,29 @@ +# Asturian translation for hello-tcl +# Copyright (C) 2018 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Marquinos , 2009. +# enolp , 2018. +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2018-07-16 00:28+0100\n" +"Last-Translator: enolp \n" +"Language-Team: Asturian \n" +"Language: ast\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Lokalize 2.0\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "¡Hola, mundu!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Esti programa ta executándose como procesu númberu %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/bg.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/bg.po new file mode 100644 index 0000000000000000000000000000000000000000..5a84be51815b7ba5f926cbbd1adafb37363bf2a6 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/bg.po @@ -0,0 +1,26 @@ +# Bulgarian translations for hello-tcl package. +# Copyright (C) 2010 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Roumen Petrov , 2010,2014,2015,2019,2023,2024.2025. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-tcl 0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-03-08 19:09+0200\n" +"Last-Translator: Roumen Petrov \n" +"Language-Team: Bulgarian \n" +"Language: bg\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Здравейте всички!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Програмата е пусната под процес номер %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/ca.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/ca.po new file mode 100644 index 0000000000000000000000000000000000000000..f37eaf02792808197f40e176cf855740ae5bedd2 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/ca.po @@ -0,0 +1,27 @@ +# Catalan messages for GNU hello-tcl. +# Copyright (C) 2003, 2014, 2015 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Ivan Vilata i Balaguer , 2003, 2014, 2015, 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-07-07 08:36+0200\n" +"Last-Translator: Ivan Vilata i Balaguer \n" +"Language-Team: Catalan \n" +"Language: ca\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Hola, món!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Aquest programa està corrent amb el número de procés %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/cs.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/cs.po new file mode 100644 index 0000000000000000000000000000000000000000..bdce7442d4f002efc54fb10a469c4e040ec3d376 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/cs.po @@ -0,0 +1,29 @@ +# The Czech translation for the gettext package. +# Copyright (C) 2011 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Marek Černocký , 2011. +# Petr Písař , 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 20:05+02:00\n" +"Last-Translator: Petr Pisar \n" +"Language-Team: Czech \n" +"Language: cs\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Ahoj světe!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Tento program běží jako proces číslo %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/da.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/da.po new file mode 100644 index 0000000000000000000000000000000000000000..095158588bcc31b4b2c444d1b45021a53590e90e --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/da.po @@ -0,0 +1,28 @@ +# Danish messages for hello-tcl. +# Copyright (C) 2015 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Jan Djærv , 2003, 2006. +# Keld Simonsen , 2011. +# Joe Hansen , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2015-06-27 12:39+0100\n" +"Last-Translator: Joe Hansen \n" +"Language-Team: Danish \n" +"Language: da\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Hej verden!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Dette program kører som proces nummer %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/de.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/de.po new file mode 100644 index 0000000000000000000000000000000000000000..7e40cefdcfc0d4fd4bbac21e01a7755cc94ee67d --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/de.po @@ -0,0 +1,32 @@ +# German messages for hello-tcl. +# Copyright © 2003, 2013 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Bruno Haible , 2003. +# Karl Eichwalder , 2003. +# Jakob Kramer , 2013. +# Mario Blättermann , 2014, 2023, 2025. +# Philipp Thomas , 2015. +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 17:15+0200\n" +"Last-Translator: Mario Blättermann \n" +"Language-Team: German \n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 25.04.0\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/el.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/el.po new file mode 100644 index 0000000000000000000000000000000000000000..8f53f431581ade39f20a76a65289fe88112edc9d --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/el.po @@ -0,0 +1,26 @@ +# Greek translation of hello-tcl +# Copyright (C) 2005 Free Software Foundation, Inc. +# Simos Xenitellis , 2005. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.14.1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2005-01-06 18:50+0000\n" +"Last-Translator: Simos Xenitellis \n" +"Language-Team: Greek \n" +"Language: el\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: KBabel 1.3.1\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Γεια σου, κόσμε!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Αυτό το πρόγραμμα εκτελείται με αριθμό διεργασίας %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/eo.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/eo.po new file mode 100644 index 0000000000000000000000000000000000000000..42bcc2305c5198ca465f118e4a15ff59cfb6c43b --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/eo.po @@ -0,0 +1,28 @@ +# La teksto por la mesaĝoj de la programo "gettext". +# Copyright (C) 2006, 2016 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Edmund GRIMLEY EVANS , 2006. +# Felipe CASTRO , 2016, 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-06-23 19:00-0300\n" +"Last-Translator: Felipe Castro \n" +"Language-Team: Esperanto \n" +"Language: eo\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 2.4.2\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Saluton, mondo!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Ĉi tiu programo rulas kiel procez-numero %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/es.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/es.po new file mode 100644 index 0000000000000000000000000000000000000000..a533d0f2fec93737ce52f7c392c62793259011a0 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/es.po @@ -0,0 +1,30 @@ +# Mensajes en español para GNU gettext. +# Copyright (C) 2014 Yoyodyne, Inc. (msgids) +# +# This file is distributed under the same license as the gettext package. +# +# Max de Mendizábal , 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004. +# Antonio Ceballos , 2014, 2015, 2023, 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-02-23 17:01+0100\n" +"Last-Translator: Antonio Ceballos \n" +"Language-Team: Spanish \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "¡Hola, mundo!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Este programa está corriendo como el proceso número %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/fi.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/fi.po new file mode 100644 index 0000000000000000000000000000000000000000..be600f499dac57e781bd435d8ff99185c58a49ac --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/fi.po @@ -0,0 +1,29 @@ +# Finnish messages for GNU Gettext examples. +# This file is distributed under the same license as the gettext package. +# Copyright © 2007, 2014, 2015 Yoyodyne, Inc. (msgids) +# Lauri Nurmi , 2007. +# Jorma Karvonen , 2014-2015. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2015-09-01 16:59+0300\n" +"Last-Translator: Jorma Karvonen \n" +"Language-Team: Finnish \n" +"Language: fi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 1.5.4\n" + +# Tämä nimenomainen käännös valittu GNU Hellon mukaisesti. +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Terve maailma!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Tämän ohjelman prosessinumero on %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/fr.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/fr.po new file mode 100644 index 0000000000000000000000000000000000000000..e91f52847eafbced40347870be948cd83da63140 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/fr.po @@ -0,0 +1,32 @@ +# Messages français pour GNU gettext. +# Copyright (C) 2006 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Michel Robitaille , 2006. +# Christophe Combelles , 2006 +# Stéphane Aulery , 2015 +# Christian Wiatr , 2023 +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-06-28 16:25+0200\n" +"Last-Translator: Christian Wiatr \n" +"Language-Team: French \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 2.4.2\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Bonjour, le monde !" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Ce programme est exécuté en tant que processus numéro %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/ga.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/ga.po new file mode 100644 index 0000000000000000000000000000000000000000..a784406af8b3b7ae6ac4416803a5d3eeec45263a --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/ga.po @@ -0,0 +1,26 @@ +# Irish translations for hello-tcl. +# Copyright (C) 2015 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Kevin Patrick Scannell , 2004, 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2017-01-10 12:09-0500\n" +"Last-Translator: Kevin Patrick Scannell \n" +"Language-Team: Irish \n" +"Language: ga\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Dia duit, a dhomhain!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Tá an clár seo ag rith mar phróiseas %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/gl.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/gl.po new file mode 100644 index 0000000000000000000000000000000000000000..66300deef1d7db6ce5f018acf0cea49ec0c5c3ec --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/gl.po @@ -0,0 +1,31 @@ +# Galician translation for hello-tcl package. +# Copyright (C) 2010 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Leandro Regueiro , 2010-2014. +# +# Proxecto Trasno - Adaptación do software libre á lingua galega: Se desexas +# colaborar connosco, podes atopar máis información en +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.19-rc1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2014-05-10 16:34+0100\n" +"Last-Translator: Leandro Regueiro \n" +"Language-Team: Galician \n" +"Language: gl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Ola, mundo!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Este programa estase executando como o proceso número %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/hr.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/hr.po new file mode 100644 index 0000000000000000000000000000000000000000..e57fa8db4c3285c93205a65820d066be94a43e19 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/hr.po @@ -0,0 +1,33 @@ +# Translation of hello-tcl to Croatian. +# Copyright (C) 2003, 2004, 2014, 2015, 2019 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Permission is granted to freely copy and distribute +# this file and modified versions, provided that this +# header is not removed and modified versions are marked +# as such. +# +# Tomislav Krznar , 2012. +# Božidar Putanec , 2018-2025. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-tcl 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 10:15-0700\n" +"Last-Translator: Božidar Putanec \n" +"Language-Team: Croatian \n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Pozdrav, svijete!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Ovaj program se izvršava kao proces broj %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/hu.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/hu.po new file mode 100644 index 0000000000000000000000000000000000000000..23a0a592f9519cb76e7f78abfdc6745ab539ab19 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/hu.po @@ -0,0 +1,29 @@ +# Hungarian translation for hello-tcl. +# This file is distributed under the same license as the gettext package. +# Copyright (C) 2014 Yoyodyne, Inc. (msgids) +# +# Tamás Kiss , 2005. +# Balázs Úr , 2014, 2015. +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2015-06-23 20:31+0200\n" +"Last-Translator: Balázs Úr \n" +"Language-Team: Hungarian \n" +"Language: hu\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 1.2\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Hello, világ!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Ez a program a(z) %d folyamatazonosítóval fut." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/id.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/id.po new file mode 100644 index 0000000000000000000000000000000000000000..bdb7cecdd41d07f3cd6e66084d031345f03ce317 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/id.po @@ -0,0 +1,27 @@ +# translation of hello-tcl-0.15-pre5.po to Indonesian +# Copyright (C) 2006 Yoyodyne, Inc. +# This file is distributed under the same license as the PACKAGE package. +# +# Tedi Heriyanto , 2006. +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-0.15-pre5\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2006-09-27 20:19+0700\n" +"Last-Translator: Tedi Heriyanto \n" +"Language-Team: Indonesian \n" +"Language: id\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: KBabel 1.11.2\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Hello, world!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Program ini berjalan sebagai proses nomor %d" diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/it.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/it.po new file mode 100644 index 0000000000000000000000000000000000000000..b082649f05e5083a0a8b7513c3ecc4dd967a98b5 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/it.po @@ -0,0 +1,29 @@ +# Italian messages for hello-tcl. +# Copyright (C) 2005, 2006 Yoyodyne, Inc. (msgids) +# Copyright (C) 2024 Free Software Foundation, Inc. +# This file is distributed under the same license as the gettext package. +# Marco Colombo , 2005, 2006, 2015. +# Michele Locati , 2024, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-tcl 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-05-04 18:28+0200\n" +"Last-Translator: Michele Locati \n" +"Language-Team: Italian \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Ciao, mondo!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Questo programma è in esecuzione con numero di processo %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/ja.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/ja.po new file mode 100644 index 0000000000000000000000000000000000000000..581b752fbdf1fa36c344ba1a532a253b6752598e --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/ja.po @@ -0,0 +1,26 @@ +# Translation of `hello-tcl' messages to Japanese. +# Copyright (C) 2005, 2006, 2014, 2015, 2023, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Masahito Yamaga , 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-tcl 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 19:59+0900\n" +"Last-Translator: Masahito Yamaga \n" +"Language-Team: Japanese \n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "世界よ, こんにちは!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "このプログラムはプロセス番号 %d で動いています." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/ka.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/ka.po new file mode 100644 index 0000000000000000000000000000000000000000..62fe0ac8b18fe09ebb0a6bff7f6b480814821a18 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/ka.po @@ -0,0 +1,28 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2022 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Temuri Doghonadze , 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.20.2\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2022-05-22 05:04+0200\n" +"Last-Translator: Temuri Doghonadze \n" +"Language-Team: Georgian <(nothing)>\n" +"Language: ka\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.0.1\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "გამარჯობა სამყაროვ!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "პროგრამა გაშვებულია პროცესის ნომრით %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/ky.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/ky.po new file mode 100644 index 0000000000000000000000000000000000000000..8188cba0a9342dc065bea7fc2944e38b65fd434d --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/ky.po @@ -0,0 +1,28 @@ +# Translation of 'hello-tcl' messages to Kirghiz. +# Copyright (C) 2004 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Ilyas Bakirov , 2007. +# Ilyas Bakirov , 2018. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2018-02-15 18:26+0600\n" +"Last-Translator: Ilyas Bakirov \n" +"Language-Team: Kirghiz \n" +"Language: ky\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 2.0.6\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Салам дүйнө!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Бул программа %d процесс номери катары иштеп жатат." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/lv.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/lv.po new file mode 100644 index 0000000000000000000000000000000000000000..229b5b79871ba4c5e83d3da67b28558ab6d6c0a7 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/lv.po @@ -0,0 +1,30 @@ +# Latvian translation of hello-tcl +# Copyright (C) 2009 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Arvis Lācis , 2009. +# Rihards Priedītis , 2023, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-03-09 11:44+0000\n" +"Last-Translator: Rihards Priedītis \n" +"Language-Team: Latvian \n" +"Language: lv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : " +"2);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Sveika, pasaule!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Šī programma darbojas ar procesa numuru %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/ms.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/ms.po new file mode 100644 index 0000000000000000000000000000000000000000..e3b69b0674417e4ee4c10ea0f7feb65494acc1fe --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/ms.po @@ -0,0 +1,28 @@ +# hello-tcl Bahasa Melayu (Malay) (ms). +# Copyright (C) 2006, 2015, 2023, 2025 Yoyodyne, Inc. (msgids) +# Copyright (C) 2006, 2015, 2023, 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the gettext package. +# Sharuzzaman Ahmat Raslan , 2006, 2015, 2023, 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-05-03 21:10+0800\n" +"Last-Translator: Sharuzzaman Ahmat Raslan \n" +"Language-Team: Malay \n" +"Language: ms\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Hello, dunia!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Program ini dilaksanakan sebagai proses bernombor %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/mt.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/mt.po new file mode 100644 index 0000000000000000000000000000000000000000..0674429db07d2cd9ed31326bee4a2241d3fd319c --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/mt.po @@ -0,0 +1,27 @@ +# hello-tcl-0.16.2-pre5. +# Copyright (C) 2008 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Clyde Meli , 2001-2008. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.16.2-pre5\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2008-11-18 17:27+0100\n" +"Last-Translator: Clyde Meli \n" +"Language-Team: Maltese \n" +"Language: mt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Hello, lil kulħadd!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Dal-programm qed jaħdem taħt il-proċess numru %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/nb.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/nb.po new file mode 100644 index 0000000000000000000000000000000000000000..c0b64169edb066337bea77a2cfefe329c5f21cab --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/nb.po @@ -0,0 +1,29 @@ +# Norwegian Bokmal translations for hello-tcl package. +# Copyright (C) 2012 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Johnny A. Solbu , 2012-2024 +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2024-01-06 16:33+0100\n" +"Last-Translator: Johnny A. Solbu \n" +"Language-Team: Norwegian Bokmaal \n" +"Language: nb\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 2.4.2\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Hallo verden!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Dette programmet kjører som prosess nummer %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/nl.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/nl.po new file mode 100644 index 0000000000000000000000000000000000000000..af64fc93c41ca1f0de6ec6ff86d35e11b1025b2b --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/nl.po @@ -0,0 +1,31 @@ +# Dutch translations for GNU hello-tcl. +# Copyright (C) 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# "There are three basic rules for writing a novel. +# Unfortunately nobody knows what they are." +# +# Benno Schulenberg , 2007, 2014, 2015, 2019, 2025. +# Elros Cyriatan , 2004. +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-03-01 14:51+0100\n" +"Last-Translator: Benno Schulenberg \n" +"Language-Team: Dutch \n" +"Language: nl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Hallo, wereld!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Dit programma draait als proces nummer %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/nn.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/nn.po new file mode 100644 index 0000000000000000000000000000000000000000..d2a765bed16fbdd23a8a4d7e92b115111b086e9a --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/nn.po @@ -0,0 +1,28 @@ +# Norwegian Nynorsk translation of GNU hello-tcl +# Copyright (C) 2020 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Karl Ove Hufthammer , 2020. +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-0.20.2\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2020-05-04 18:58+0200\n" +"Last-Translator: Karl Ove Hufthammer \n" +"Language-Team: Norwegian Nynorsk \n" +"Language: nn\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 20.04.0\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Hei, verda!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Dette programmet køyrer som prosess nummer %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/pl.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/pl.po new file mode 100644 index 0000000000000000000000000000000000000000..0d2caa7b50aa09cc7f8ed4b1a6536cd6eb3e2a98 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/pl.po @@ -0,0 +1,27 @@ +# Polish translations for the GNU gettext messages, hello-tcl domain +# Copyright (C) 2010, 2014, 2015, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Rafał Maszkowski , 2003, 2010, 2014, 2015, 2025 +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-tcl 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-25 17:16+0200\n" +"Last-Translator: Rafał Maszkowski \n" +"Language-Team: Polish \n" +"Language: pl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8-bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " +"|| n%100>=20) ? 1 : 2);\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Cześć, świecie!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Ten program działa jako proces o numerze %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/pt.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/pt.po new file mode 100644 index 0000000000000000000000000000000000000000..9f9f869e753fd4e013eddfbf9d6294f7994126c1 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/pt.po @@ -0,0 +1,28 @@ +# Portuguese (Portugal) translation of 'hello-tcl' package. +# Copyright (C) 2018 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Pedro Albuquerque , 2019, 2020, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 11:24+0100\n" +"Last-Translator: Pedro Albuquerque \n" +"Language-Team: Portuguese \n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\\n;\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.6\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Olá mundo!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Este programa está em execução como processo nº %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/pt_BR.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/pt_BR.po new file mode 100644 index 0000000000000000000000000000000000000000..21d6976134fade8815d3e42f6cd843a638169d3e --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/pt_BR.po @@ -0,0 +1,31 @@ +# Brazilian Portuguese translations for gettext-example +# Traduções em português brasileiro para gettext-example +# Copyright (C) 2025 Yoyodyne, Inc. (msgids) +# Copyright (C) 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the gettext package. +# Rafael Fontenelle , 2013-2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 10:24-0300\n" +"Last-Translator: Rafael Fontenelle \n" +"Language-Team: Brazilian Portuguese \n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Gtranslator 48.0\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Olá, mundo!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Este programa está sendo executado com número de processo %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/ro.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/ro.po new file mode 100644 index 0000000000000000000000000000000000000000..1a48aa47cf5fc1ce578403de35060b0f5831992b --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/ro.po @@ -0,0 +1,50 @@ +# Translation of "hello-tcl" messages to Romanian. +# Mesajele în limba română pentru pachetul hello-tcl. +# Copyright © 2015, 2019, 2022, 2023, 2024, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Eugen Hoancă , 2003. +# Mihai Cristescu , 2015 - 2019. +# Remus-Gabriel Chelu , 2022 - 2025. +# +# Cronologia traducerii fișierului „hello-tcl”: +# Traducerea inițială, făcută de EH, pentru versiunea hello-tcl 0.12.1, 2003. +# Actualizare a traducerii pentru versiunea hello-tcl 0.19.4-rc1, făcută de MC, mar-2015. +# Actualizare a traducerii pentru versiunea hello-tcl 0.19.4.73, făcută de MC, iun-2015. +# Actualizare a traducerii pentru versiunea hello-tcl 0.20-rc1, făcută de MC, apr-2019. +# Actualizare a mesajelor, de la fișierul „hello-tcl-0.20.2.pot”. +# Actualizare a algoritmului formelor de plural (de la „trei-vechi” la „trei-actual”). +# NU și a mesajelor traduse (acestea au rămas neschimbate). +# Eliminare a mesajelor ce-au dispărut în ultima versiune. +# Actualizări realizate de Remus-Gabriel Chelu , 15.01.2022. +# Actualizare a traducerii pentru versiunea 0.20.2 făcută de R-GC, ian-2022. +# Actualizare a traducerii pentru versiunea 0.22 făcută de R-GC, iun-2023. +# Revizuire și corectare a traducerii pentru versiunea 0.23-pre1 făcută de R-GC, oct-2024. +# Actualizare a traducerii pentru versiunea 0.24-pre1 făcută de R-GC, feb-2025. +# Actualizare a traducerii pentru versiunea 0.25-pre1 făcută de R-GC, apr-2025. +# Actualizare a traducerii pentru versiunea Y, făcută de X, Z(luna-anul). +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-29 00:25+0200\n" +"Last-Translator: Remus-Gabriel Chelu \n" +"Language-Team: Romanian \n" +"Language: ro\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < " +"20)) ? 1 : 2);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Salutare, lume!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Acest program rulează ca procesul numărul %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/ru.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/ru.po new file mode 100644 index 0000000000000000000000000000000000000000..ee2a0b0b57f57d31328939d66fc949cc86017493 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/ru.po @@ -0,0 +1,30 @@ +# Translation of hello-tcl-0.14.1.po to Russian +# Copyright (C) 2004 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Pavel Maryanov , 2004. +# SPDX-FileCopyrightText: 2014, 2015, 2023, 2025 Yuri Kozlov +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-05-02 09:17+0300\n" +"Last-Translator: Yuri Kozlov \n" +"Language-Team: Russian \n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Lokalize 24.12.0\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Здравствуй, мир!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Эта программа выполняется как процесс под номером %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/sk.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/sk.po new file mode 100644 index 0000000000000000000000000000000000000000..01ee95569869d8fd27ebc170eb2321b3e434553b --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/sk.po @@ -0,0 +1,26 @@ +# Slovak translations GNU for hello-tcl package. +# Copyright (C) 2003, 2004, 2014, 2023, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Marcel Telka , 2003, 2004, 2014, 2023, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-tcl 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 13:53+0200\n" +"Last-Translator: Marcel Telka \n" +"Language-Team: Slovak \n" +"Language: sk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Ahoj svet!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Tento program beží ako proces s číslom %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/sl.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/sl.po new file mode 100644 index 0000000000000000000000000000000000000000..cd127fc4a8d6646eecf0fef4a8532c917ff73f72 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/sl.po @@ -0,0 +1,29 @@ +# -*- mode: po; coding: utf-8; -*- Slovenian message catalog for GNU gettext-example +# Copyright (C) 2005 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Primož Peterlin , 2005, 2014, 2015, 2024. +# $Id: hello-tcl-0.22.sl.po,v 1.1 2024/03/28 17:02:19 peterlin Exp $ +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2024-03-28 18:02+0100\n" +"Last-Translator: Primož Peterlin \n" +"Language-Team: Slovenian \n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8-bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || " +"n%100==4 ? 3 : 0);\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Pozdravljen, svet!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Ta program teče kot proces številka %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/sq.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/sq.po new file mode 100644 index 0000000000000000000000000000000000000000..ca4dcf86533541ccfb7392914707525519134d5b --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/sq.po @@ -0,0 +1,28 @@ +# Albanian translation of gettext-example. +# Copyright (C) 2020 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Besnik Bleta , 2020,2023,2024,2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 19:56+0300\n" +"Last-Translator: Besnik Bleta \n" +"Language-Team: Albanian \n" +"Language: sq\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.2.2\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Tungjatjeta, botë!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Ky program po xhiron si procesi numër %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/sr.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/sr.po new file mode 100644 index 0000000000000000000000000000000000000000..418099e8bd6a14aa8aab154c0d72b001fccc70f8 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/sr.po @@ -0,0 +1,30 @@ +# Serbian translation of hello-tcl. +# Copyright (C) 2014 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Aleksandar Jelenak , 2004. +# Мирослав Николић , 2014-2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl-0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-03-02 16:51+0100\n" +"Last-Translator: Мирослав Николић \n" +"Language-Team: Serbian <(nothing)>\n" +"Language: sr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Здраво, свима!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Овај програм се извршава као процес број %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/sv.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/sv.po new file mode 100644 index 0000000000000000000000000000000000000000..5f4d3eb950400854b0851d94f76a637c760dd238 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/sv.po @@ -0,0 +1,30 @@ +# Swedish messages for hello-tcl. +# Copyright © 2006, 2014, 2016, 2019, 2020, 2023, 2024, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Jan Djärv , 2003, 2006, 2014. +# Göran Uddeborg , 2016, 2019, 2020, 2023, 2024, 2025. +# Luna Jernberg , 2025. +# $Revision: 1.12 $ +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 12:18+0200\n" +"Last-Translator: Luna Jernberg \n" +"Language-Team: Swedish \n" +"Language: sv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Hej världen!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Detta program kör som process nummer %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/ta.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/ta.po new file mode 100644 index 0000000000000000000000000000000000000000..e1efd416a9f60f4bf891f824fc946fc6659ad344 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/ta.po @@ -0,0 +1,28 @@ +# Tamil messages for GNU gettext. +# Copyright (C) 2018 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# List of contributors follow: +# Poorajith , 2018. +# Arun Isaac , 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-06-19 00:06+0100\n" +"Last-Translator: Arun Isaac \n" +"Language-Team: Tamil \n" +"Language: ta\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "வணக்கம், உலகு!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "இந்நிரல் செயலாக்க எண் %d ஆக இயங்கிக்கொண்டிருக்கிறது." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/tr.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/tr.po new file mode 100644 index 0000000000000000000000000000000000000000..8a5b0108c1566c209df86552b9fb7cce1c077626 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/tr.po @@ -0,0 +1,29 @@ +# Turkish translation for hello-tcl. +# This file is distributed under the same license as the gettext package. +# Copyright (C) 2017 Yoyodyne, Inc. (msgids) +# Copyright (C) 2004 Free Software Foundation, Inc. +# Nilgün Belma Bugüner , 2003,2004 +# Mehmet Kececi , 2017, 2019, 2020. +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.20.2\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2020-04-17 13:10+0300\n" +"Last-Translator: Mehmet Kececi \n" +"Language-Team: Turkish \n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 2.3\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Merhaba, dünya!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Bu yazılım %d işlem numarası ile çalışıyor." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/uk.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/uk.po new file mode 100644 index 0000000000000000000000000000000000000000..4039ae571c440730ab9d629a23e5c59db28fc7cb --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/uk.po @@ -0,0 +1,30 @@ +# Ukrainian translation to hello-tcl +# Copyright (C) 2014 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Maxim V. Dziumanenko , 2004-2007. +# Yuri Chornoivan , 2014, 2015, 2023, 2025. +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 13:56+0300\n" +"Last-Translator: Yuri Chornoivan \n" +"Language-Team: Ukrainian \n" +"Language: uk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Lokalize 23.04.3\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Привіт, світе!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Ця програма виконується як процес з номером %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/vi.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/vi.po new file mode 100644 index 0000000000000000000000000000000000000000..51029327c1b1b0272c29f45cc2817df420c0f386 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/vi.po @@ -0,0 +1,30 @@ +# Vietnamese Translation for Gettext Examples. +# Bản dịch tiếng Việt dành cho các ví dụ của gói gettext. +# Copyright © 2015 Yoyodyne, Inc. (msgids) +# Copyright © 2015 Free Software Foundation, Inc. +# This file is distributed under the same license as the gettext package. +# Clytie Siddall , 2005-2010. +# Trần Ngọc Quân , 2012-2015, 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-06-24 09:10+0700\n" +"Last-Translator: Trần Ngọc Quân \n" +"Language-Team: Vietnamese \n" +"Language: vi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "Chào thế giới!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "Chương trình này đang chạy với mã số tiến trình %d." diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/zh_CN.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/zh_CN.po new file mode 100644 index 0000000000000000000000000000000000000000..9951941ef677da44a3745053a546c1b25a184268 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/zh_CN.po @@ -0,0 +1,29 @@ +# zh_CN translation for hello-tcl. +# Copyright (C) 2015 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Funda Wang , 2003. +# Ji ZhengYu , 2015. +# Boyuan Yang <073plan@gmail.com>, 2019, 2023, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-29 15:56-0400\n" +"Last-Translator: Boyuan Yang <073plan@gmail.com>\n" +"Language-Team: Chinese (simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.6\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "你好,世界!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "此程序正以进程号 %d 运行。" diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/zh_HK.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/zh_HK.po new file mode 100644 index 0000000000000000000000000000000000000000..c19166c773246e762d83580709ecc9283eb8bdd9 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/zh_HK.po @@ -0,0 +1,25 @@ +# Chinese (Hong Kong) translation of hello-tcl. +# Copyright (C) 2006 Yoyodyne, Inc. +# Abel Cheung , 2006. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.15-pre5\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2006-07-05 15:40+0800\n" +"Last-Translator: Abel Cheung \n" +"Language-Team: Chinese (Hong Kong) \n" +"Language: zh_HK\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "你好!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "本程式正在執行中,進程編號為 %d。" diff --git a/miniconda3/share/doc/gettext/examples/hello-tcl/po/zh_TW.po b/miniconda3/share/doc/gettext/examples/hello-tcl/po/zh_TW.po new file mode 100644 index 0000000000000000000000000000000000000000..ae8f2514173c8835364883f857a8c357ea654c76 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-tcl/po/zh_TW.po @@ -0,0 +1,29 @@ +# Traditional Chinese translation of hello-tcl. +# Copyright (C) 2009 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Abel Cheung , 2005. +# Wei-Lun Chao , 2013, 2015. +# Yi-Jyun Pan , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-tcl 0.23-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2024-11-30 14:14+0800\n" +"Last-Translator: Yi-Jyun Pan \n" +"Language-Team: Chinese (traditional) \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.tcl:11 +msgid "Hello, world!" +msgstr "哈囉,大家好!" + +#: hello.tcl:12 +#, tcl-format +msgid "This program is running as process number %d." +msgstr "本程式正在執行,行程編號為 %d。" diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/INSTALL b/miniconda3/share/doc/gettext/examples/hello-ycp/INSTALL new file mode 100644 index 0000000000000000000000000000000000000000..1aaff4e1655618a253ddf08b0e155f5bb396fd3b --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/INSTALL @@ -0,0 +1,16 @@ +This example relies on YaST2 (SuSE Linux: package yast2-core). + +Before "make install", you need to make the locale directory writable: + chmod a+w /usr/share/YaST2/locale + chmod a+w /usr/share/YaST2/locale/*/LC_MESSAGES +Unfortunately this directory is hardwired in YaST; there is no way to +put the message catalogs elsewhere. + +Installation: + ./autogen.sh + ./configure --prefix=/some/prefix + make + make install +Cleanup: + make distclean + ./autoclean.sh diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/Makefile.am b/miniconda3/share/doc/gettext/examples/hello-ycp/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..ceeda90179c1456a5eb8d3814bc49d8e7f9d1a10 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/Makefile.am @@ -0,0 +1,30 @@ +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# General automake options. +AUTOMAKE_OPTIONS = foreign +ACLOCAL_AMFLAGS = -I m4 + +# The list of subdirectories containing Makefiles. +SUBDIRS = m4 po + +# The list of programs that are built. +bin_SCRIPTS = hello +all-local: hello +CLEANFILES = hello + +# The YCP program is installed as data and invoked through a shell script. +pkgdata_DATA = hello.ycp +hello: + { echo '#!/bin/sh'; \ + echo 'if test -n "$$DISPLAY"; then'; \ + echo " exec /usr/lib/YaST2/bin/y2base '$(pkgdatadir)/hello.ycp' qt"; \ + echo 'else'; \ + echo " exec /usr/lib/YaST2/bin/y2base '$(pkgdatadir)/hello.ycp' ncurses"; \ + echo 'fi'; \ + } > $@ + +# Additional files to be distributed. +EXTRA_DIST = autogen.sh autoclean.sh diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/autoclean.sh b/miniconda3/share/doc/gettext/examples/hello-ycp/autoclean.sh new file mode 100644 index 0000000000000000000000000000000000000000..8655a871726b2a31a935332f3e7cbba7b36928e8 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/autoclean.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Script for cleaning all autogenerated files. + +test ! -f Makefile || make distclean +rm -rf autom4te.cache + +# Brought in by explicit copy. +rm -f m4/nls.m4 +rm -f m4/po.m4 +rm -f m4/progtest.m4 +rm -f po/remove-potcdate.sed + +# Generated by aclocal. +rm -f aclocal.m4 + +# Generated by autoconf. +rm -f configure + +# Generated or brought in by automake. +rm -f Makefile.in +rm -f m4/Makefile.in +rm -f po/Makefile.in +rm -f install-sh +rm -f missing +rm -f po/*.pot +rm -f po/stamp-po +rm -f po/*.gmo diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/autogen.sh b/miniconda3/share/doc/gettext/examples/hello-ycp/autogen.sh new file mode 100644 index 0000000000000000000000000000000000000000..a972da8041799c1ddf0a23303c0660eb9fb827bc --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/autogen.sh @@ -0,0 +1,44 @@ +#!/bin/sh +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Script for regenerating all autogenerated files. + +if test -r ../Makefile.am; then + # Inside the gettext source directory. + GETTEXT_TOPSRCDIR=../../.. +else + if test -r ../Makefile; then + # Inside a gettext build directory. + GETTEXT_TOOLS_SRCDIR=`sed -n -e 's,^top_srcdir *= *\(.*\)$,\1,p' ../Makefile` + # Adjust a relative top_srcdir. + case $GETTEXT_TOOLS_SRCDIR in + /*) ;; + *) GETTEXT_TOOLS_SRCDIR=../$GETTEXT_TOOLS_SRCDIR ;; + esac + GETTEXT_TOPSRCDIR=$GETTEXT_TOOLS_SRCDIR/../.. + else + # Installed under ${prefix}/share/doc/gettext/examples. + . ../installpaths + fi +fi + +cp -p ${ACLOCALDIR-$GETTEXT_TOPSRCDIR/gettext-runtime/m4}/nls.m4 m4/nls.m4 +cp -p ${ACLOCALDIR-$GETTEXT_TOPSRCDIR/gettext-runtime/m4}/po.m4 m4/po.m4 +cp -p ${ACLOCALDIR-$GETTEXT_TOPSRCDIR/gettext-runtime/m4}/progtest.m4 m4/progtest.m4 +cp -p ${GETTEXTSRCPODIR-$GETTEXT_TOPSRCDIR/gettext-runtime/po}/remove-potcdate.sed po/remove-potcdate.sed + +aclocal -I m4 + +autoconf + +automake -a -c + +cd po +for f in *.po; do + if test -r "$f"; then + lang=`echo $f | sed -e 's,\.po$,,'` + msgfmt -c -o $lang.gmo $lang.po + fi +done +cd .. diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/configure.ac b/miniconda3/share/doc/gettext/examples/hello-ycp/configure.ac new file mode 100644 index 0000000000000000000000000000000000000000..59b40837219d797f4c0c23b3078c71780862703f --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/configure.ac @@ -0,0 +1,27 @@ +dnl Example for use of GNU gettext. +dnl This file is in the public domain. +dnl +dnl Configuration file - processed by autoconf. + +AC_INIT([hello-ycp], [0]) +AC_CONFIG_SRCDIR([hello.ycp]) +AM_INIT_AUTOMAKE([1.11]) + +dnl Check for availability of YaST's engine. +test -f /usr/lib/YaST2/bin/y2base || { + echo "*** Essential program y2base not found" 1>&2 + exit 1 +} + +dnl The installed program must know where to find its message catalogs. +dnl Unfortunately, YaST hard codes the message catalog directory. +localedir=/usr/share/YaST2/locale +AC_SUBST([localedir]) + +dnl Support for the po directory. +AM_PO_SUBDIRS + +AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([m4/Makefile]) +AC_CONFIG_FILES([po/Makefile], [AM_POSTPROCESS_PO_MAKEFILE]) +AC_OUTPUT diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/hello.ycp b/miniconda3/share/doc/gettext/examples/hello-ycp/hello.ycp new file mode 100644 index 0000000000000000000000000000000000000000..0affb10e1b9b059a242a587ee6c50c449c942c03 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/hello.ycp @@ -0,0 +1,30 @@ +// Example for use of GNU gettext. +// This file is in the public domain. + +// Source code of the YCP program. + +UI(``{ + textdomain "hello-ycp"; + + map bash_out = SCR::Execute (.target.bash_output, "echo $PPID"); + integer pid = tointeger (bash_out["stdout"]:"99999"); + + OpenDialog ( + `VBox ( + `HBox ( + `Label (_("Hello, world!")), + `HStretch () + ), + `HBox ( + `Label (sformat (_("This program is running as process number %1."), pid)), + `HStretch () + ), + `HBox ( + `HStretch (), + `PushButton (`opt(`default), "&OK") + ) + ) + ); + UserInput(); + CloseDialog(); +}) diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/m4/Makefile.am b/miniconda3/share/doc/gettext/examples/hello-ycp/m4/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..8a841b31f12ff3bd59428fbba049f50825d91510 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/m4/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = \ + nls.m4 po.m4 diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/LINGUAS b/miniconda3/share/doc/gettext/examples/hello-ycp/po/LINGUAS new file mode 100644 index 0000000000000000000000000000000000000000..dc4a82afbad945018082c22f2061a43ef436dd68 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/LINGUAS @@ -0,0 +1,5 @@ +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Set of available languages. +af ast bg ca cs da de el eo es fi fr ga gl hr hu id it ja ka ky lv ms mt nb nl nn pl pt pt_BR ro ru sk sl sq sr sv ta tr uk vi zh_CN zh_HK zh_TW diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/Makefile.am b/miniconda3/share/doc/gettext/examples/hello-ycp/po/Makefile.am new file mode 100644 index 0000000000000000000000000000000000000000..e13ef3a86647f2f33c182059cb551898d10f7d6b --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/Makefile.am @@ -0,0 +1,434 @@ +# Example for use of GNU gettext. +# This file is in the public domain. +# +# Makefile configuration - processed by automake. + +# List of files which contain translatable strings. +POTFILES = \ + hello.ycp + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgid strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Yoyodyne, Inc. + +# This tells whether or not to prepend "GNU " prefix to the package +# name that gets inserted into the header of the $(DOMAIN).pot file. +# Possible values are "yes", "no", or empty. If it is empty, try to +# detect it automatically by scanning the files in $(top_srcdir) for +# "GNU packagename" string. +PACKAGE_GNU = no + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = bug-gettext@gnu.org + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + +# These options get passed to msgmerge. +# Useful options are in particular: +# --previous to keep previous msgids of translated messages +MSGMERGE_OPTIONS = + +# These options get passed to msginit. +# If you want to disable line wrapping when writing PO files, add +# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and +# MSGINIT_OPTIONS. +MSGINIT_OPTIONS = + +MSGMERGE = @MSGMERGE@ +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done + +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.gmo; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We use the presentlang catalog if desiredlang is +# a. equal to presentlang, or +# b. a variant of presentlang (because in this case, presentlang can be used +# as a fallback for messages which are not translated in the desiredlang +# catalog). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(lang).gmo) +CATALOGS != for lang in $(INST_LINGUAS); do echo $$lang.gmo; done + +SUFFIXES = .po .gmo .nop .po-create .po-update + +# The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs. +# The GNU Coding Standards say in +# : +# "GNU distributions usually contain some files which are not source files +# ... . Since these files normally appear in the source directory, they +# should always appear in the source directory, not in the build directory. +# So Makefile rules to update them should put the updated files in the +# source directory." +# Therefore we put these files in the source directory, not the build directory. + +# During .po -> .gmo conversion, take into account the most recent changes to +# the .pot file. This eliminates the need to update the .po files when the +# .pot file has changed, which would be troublesome if the .po files are put +# under version control. +$(GMOFILES): $(srcdir)/$(DOMAIN).pot +.po.gmo: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \ + cd $(srcdir) && \ + rm -f $${lang}.gmo && \ + $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \ + $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \ + mv t-$${lang}.gmo $${lang}.gmo && \ + rm -f $${lang}.1po + + +all-local: all-local-@USE_NLS@ + +all-local-yes: $(srcdir)/stamp-po +all-local-no: + +# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no +# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because +# we don't want to bother translators with empty POT files). We assume that +# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. +# In this case, $(srcdir)/stamp-po is a nop (i.e. a phony target). + +# $(srcdir)/stamp-po is a timestamp denoting the last time at which the CATALOGS +# have been loosely updated. Its purpose is that when a developer or translator +# checks out the package from a version control system, and the $(DOMAIN).pot +# file is not under version control, "make" will update the $(DOMAIN).pot and +# the $(CATALOGS), but subsequent invocations of "make" will do nothing. This +# timestamp would not be necessary if updating the $(CATALOGS) would always +# touch them; however, the rule for $(POFILES) has been designed to not touch +# files that don't need to be changed. +$(srcdir)/stamp-po: $(srcdir)/$(DOMAIN).pot + test ! -f $(srcdir)/$(DOMAIN).pot || \ + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @test ! -f $(srcdir)/$(DOMAIN).pot || { \ + echo "touch $(srcdir)/stamp-po" && \ + echo timestamp > $(srcdir)/stamp-poT && \ + mv $(srcdir)/stamp-poT $(srcdir)/stamp-po; \ + } + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +# The determination of whether the package xyz is a GNU one is based on the +# heuristic whether some file in the top level directory mentions "GNU xyz". +# If GNU 'find' is available, we avoid grepping through monster files. +$(DOMAIN).pot-update: $(POTFILES_DEPS) + package_gnu="$(PACKAGE_GNU)"; \ + test -n "$$package_gnu" || { \ + if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ + LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep -i 'GNU $(PACKAGE)' /dev/null '{}' ';' 2>/dev/null; \ + else \ + LC_ALL=C grep -i 'GNU $(PACKAGE)' $(top_srcdir)/* 2>/dev/null; \ + fi; \ + } | grep -v 'libtool:' >/dev/null; then \ + package_gnu=yes; \ + else \ + package_gnu=no; \ + fi; \ + }; \ + if test "$$package_gnu" = "yes"; then \ + package_prefix='GNU '; \ + else \ + package_prefix=''; \ + fi; \ + if test -n '$(MSGID_BUGS_ADDRESS)'; then \ + msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ + else \ + msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ + fi; \ + case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + $(POTFILES) \ + ;; \ + *) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --package-name="$${package_prefix}$(PACKAGE)" \ + --package-version='$(VERSION)' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + $(POTFILES) \ + ;; \ + esac + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot-header; then \ + sed -e '1,/^#$$/d' < $(DOMAIN).po > $(DOMAIN).1po && \ + cat $(srcdir)/$(DOMAIN).pot-header $(DOMAIN).1po > $(DOMAIN).po && \ + rm -f $(DOMAIN).1po \ + || exit 1; \ + fi; \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f $(srcdir)/remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f $(srcdir)/remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + if test -f "$(srcdir)/$${lang}.po"; then \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) \ + && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.10 | 0.10.*) \ + $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ + 0.1[1-5] | 0.1[1-5].*) \ + $(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ + 0.1[6-7] | 0.1[6-7].*) \ + $(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) --previous $${lang}.po $(DOMAIN).pot;; \ + *) \ + $(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot;; \ + esac; \ + }; \ + else \ + $(MAKE) $${lang}.po-create; \ + fi + + +install-data-local: install-data-local-@USE_NLS@ +install-data-local-no: all-local +install-data-local-yes: all-local + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(MKDIR_P) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ + fi; \ + done; \ + done + +installdirs-local: installdirs-local-@USE_NLS@ +installdirs-local-no: +installdirs-local-yes: + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(MKDIR_P) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done + +uninstall-local: uninstall-local-@USE_NLS@ +uninstall-local-no: +uninstall-local-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ + done + +html ID: + +MOSTLYCLEANFILES = +MOSTLYCLEANFILES += stamp-poT +MOSTLYCLEANFILES += core core.* *.stackdump $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po +MOSTLYCLEANFILES += *.o + +MAINTAINERCLEANFILES = $(DOMAIN).pot stamp-po $(GMOFILES) + +EXTRA_DIST = remove-potcdate.sed LINGUAS $(POFILES) $(GMOFILES) + +# Hidden from automake, but really activated. Works around an automake-1.5 bug. +#distdir: distdir1 +distdir1: + $(MAKE) update-po + $(MAKE) $(srcdir)/stamp-po + @if test -f $(srcdir)/$(DOMAIN).pot; then \ + for file in $(DOMAIN).pot stamp-po; do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + cp -p $$d/$$file $(distdir)/$$file || exit 1; \ + done; \ + else \ + case $(XGETTEXT) in \ + :) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because a suitable 'xgettext' program was not found in PATH." 1>&2;; \ + *) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because 'xgettext' found no strings to extract. Check the POTFILES and the XGETTEXT_OPTIONS in the Makefile.am file." 1>&2;; \ + esac; \ + fi + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for creating PO files. + +.nop.po-create: + @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ + echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ + exit 1 + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) --lang=$$lang --previous $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.10 | 0.10.*) \ + $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + 0.1[1-5] | 0.1[1-5].*) \ + $(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + 0.1[6-7] | 0.1[6-7].*) \ + $(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + *) \ + $(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) --lang=$$lang --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + esac; \ + }; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-gmo: Makefile $(GMOFILES) + @: diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/af.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/af.po new file mode 100644 index 0000000000000000000000000000000000000000..398e1b3cb0183ca56f2cb9d108bfd747e8c86bf8 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/af.po @@ -0,0 +1,26 @@ +# Afrikaans translation for Silky +# Copyright (C) 2004 Free Software Foundation, Inc. +# This file is distributed under the same license as the silky package. +# Hanlie Pretorius , 2004. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp-0.13.1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2003-12-31 10:30+2\n" +"Last-Translator: Ysbeer \n" +"Language-Team: Afrikaans \n" +"Language: af\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Hallo wêreld!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Hierdie program loop as prosesnommer %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/ast.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/ast.po new file mode 100644 index 0000000000000000000000000000000000000000..dcb39c9e1181590e6b601bdb597035db4bb84d16 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/ast.po @@ -0,0 +1,29 @@ +# Asturian translation for hello-ycp +# Copyright (C) 2018 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Marquinos , 2009. +# enolp , 2018. +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2018-07-16 00:28+0100\n" +"Last-Translator: enolp \n" +"Language-Team: Asturian \n" +"Language: ast\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Lokalize 2.0\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "¡Hola, mundu!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Esti programa ta executándose como procesu númberu %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/bg.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/bg.po new file mode 100644 index 0000000000000000000000000000000000000000..139f2621059c5a64a839eb35ba94bf72d41b1e0b --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/bg.po @@ -0,0 +1,26 @@ +# Bulgarian translations for hello-ycp package. +# Copyright (C) 2010 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Roumen Petrov , 2010,2014,2015,2019,2023,2024.2025. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-ycp 0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-03-08 19:09+0200\n" +"Last-Translator: Roumen Petrov \n" +"Language-Team: Bulgarian \n" +"Language: bg\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Здравейте всички!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Програмата е пусната под процес номер %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/ca.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/ca.po new file mode 100644 index 0000000000000000000000000000000000000000..61d058c093161eae10095a9a24da5ad52176780e --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/ca.po @@ -0,0 +1,27 @@ +# Catalan messages for GNU hello-ycp. +# Copyright (C) 2003, 2014, 2015 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Ivan Vilata i Balaguer , 2003, 2014, 2015, 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-07-07 08:36+0200\n" +"Last-Translator: Ivan Vilata i Balaguer \n" +"Language-Team: Catalan \n" +"Language: ca\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Hola, món!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Aquest programa està corrent amb el número de procés %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/cs.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/cs.po new file mode 100644 index 0000000000000000000000000000000000000000..07e4bb70381ed691abf4f4501eb47003338dc628 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/cs.po @@ -0,0 +1,29 @@ +# The Czech translation for the gettext package. +# Copyright (C) 2011 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Marek Černocký , 2011. +# Petr Písař , 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 20:05+02:00\n" +"Last-Translator: Petr Pisar \n" +"Language-Team: Czech \n" +"Language: cs\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Ahoj světe!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Tento program běží jako proces číslo %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/da.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/da.po new file mode 100644 index 0000000000000000000000000000000000000000..023a81f029050cb50ba79ce1d8ec8e72864c3b0c --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/da.po @@ -0,0 +1,28 @@ +# Danish messages for hello-ycp. +# Copyright (C) 2015 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Jan Djærv , 2003, 2006. +# Keld Simonsen , 2011. +# Joe Hansen , 2015. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2015-06-27 12:39+0100\n" +"Last-Translator: Joe Hansen \n" +"Language-Team: Danish \n" +"Language: da\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Hej verden!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Dette program kører som proces nummer %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/de.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/de.po new file mode 100644 index 0000000000000000000000000000000000000000..d40b1998fedaa4852a2d39ff3f212f960fb9c1ba --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/de.po @@ -0,0 +1,32 @@ +# German messages for hello-ycp. +# Copyright © 2003, 2013 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Bruno Haible , 2003. +# Karl Eichwalder , 2003. +# Jakob Kramer , 2013. +# Mario Blättermann , 2014, 2023, 2025. +# Philipp Thomas , 2015. +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 17:15+0200\n" +"Last-Translator: Mario Blättermann \n" +"Language-Team: German \n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 25.04.0\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Hallo Welt!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Dieses Programm läuft mit der Prozess-Nummer %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/el.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/el.po new file mode 100644 index 0000000000000000000000000000000000000000..8f6b01a086babce056876520982333dea8672a94 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/el.po @@ -0,0 +1,26 @@ +# Greek translation of hello-ycp +# Copyright (C) 2005 Free Software Foundation, Inc. +# Simos Xenitellis , 2005. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.14.1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2005-01-06 18:50+0000\n" +"Last-Translator: Simos Xenitellis \n" +"Language-Team: Greek \n" +"Language: el\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: KBabel 1.3.1\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Γεια σου, κόσμε!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Αυτό το πρόγραμμα εκτελείται με αριθμό διεργασίας %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/eo.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/eo.po new file mode 100644 index 0000000000000000000000000000000000000000..3026fcea04f3920412fdaacd48149f6d3f25d579 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/eo.po @@ -0,0 +1,28 @@ +# La teksto por la mesaĝoj de la programo "gettext". +# Copyright (C) 2006, 2016 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Edmund GRIMLEY EVANS , 2006. +# Felipe CASTRO , 2016, 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-06-23 19:00-0300\n" +"Last-Translator: Felipe Castro \n" +"Language-Team: Esperanto \n" +"Language: eo\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 2.4.2\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Saluton, mondo!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Ĉi tiu programo rulas kiel procez-numero %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/es.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/es.po new file mode 100644 index 0000000000000000000000000000000000000000..5aa606cb2198b68c1bfb38ccfa977a876c505663 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/es.po @@ -0,0 +1,30 @@ +# Mensajes en español para GNU gettext. +# Copyright (C) 2014 Yoyodyne, Inc. (msgids) +# +# This file is distributed under the same license as the gettext package. +# +# Max de Mendizábal , 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004. +# Antonio Ceballos , 2014, 2015, 2023, 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp-0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-02-23 17:01+0100\n" +"Last-Translator: Antonio Ceballos \n" +"Language-Team: Spanish \n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "¡Hola, mundo!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Este programa está corriendo como el proceso número %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/fi.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/fi.po new file mode 100644 index 0000000000000000000000000000000000000000..324404a43ce89f15d7bd667825a5037cba54f622 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/fi.po @@ -0,0 +1,29 @@ +# Finnish messages for GNU Gettext examples. +# This file is distributed under the same license as the gettext package. +# Copyright © 2007, 2014, 2015 Yoyodyne, Inc. (msgids) +# Lauri Nurmi , 2007. +# Jorma Karvonen , 2014-2015. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2015-09-01 16:59+0300\n" +"Last-Translator: Jorma Karvonen \n" +"Language-Team: Finnish \n" +"Language: fi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 1.5.4\n" + +# Tämä nimenomainen käännös valittu GNU Hellon mukaisesti. +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Terve maailma!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Tämän ohjelman prosessinumero on %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/fr.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/fr.po new file mode 100644 index 0000000000000000000000000000000000000000..3c3d150aa1e90d310afd0a9fc867f5b8be83675c --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/fr.po @@ -0,0 +1,32 @@ +# Messages français pour GNU gettext. +# Copyright (C) 2006 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Michel Robitaille , 2006. +# Christophe Combelles , 2006 +# Stéphane Aulery , 2015 +# Christian Wiatr , 2023 +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-06-28 16:25+0200\n" +"Last-Translator: Christian Wiatr \n" +"Language-Team: French \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 2.4.2\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Bonjour, le monde !" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Ce programme est exécuté en tant que processus numéro %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/ga.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/ga.po new file mode 100644 index 0000000000000000000000000000000000000000..9cb27b9f934eda63f34f0c5442c80005b3511b96 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/ga.po @@ -0,0 +1,26 @@ +# Irish translations for hello-ycp. +# Copyright (C) 2015 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Kevin Patrick Scannell , 2004, 2017. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2017-01-10 12:09-0500\n" +"Last-Translator: Kevin Patrick Scannell \n" +"Language-Team: Irish \n" +"Language: ga\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Dia duit, a dhomhain!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Tá an clár seo ag rith mar phróiseas %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/gl.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/gl.po new file mode 100644 index 0000000000000000000000000000000000000000..f029191a59e5ae0eadb284398001e36f72cb00b3 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/gl.po @@ -0,0 +1,31 @@ +# Galician translation for hello-ycp package. +# Copyright (C) 2010 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Leandro Regueiro , 2010-2014. +# +# Proxecto Trasno - Adaptación do software libre á lingua galega: Se desexas +# colaborar connosco, podes atopar máis información en +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.19-rc1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2014-05-10 16:34+0100\n" +"Last-Translator: Leandro Regueiro \n" +"Language-Team: Galician \n" +"Language: gl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n!=1);\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Ola, mundo!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Este programa estase executando como o proceso número %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/hr.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/hr.po new file mode 100644 index 0000000000000000000000000000000000000000..7984a2ae4ec089815b5d4cb60bebfaeba28bcb5b --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/hr.po @@ -0,0 +1,33 @@ +# Translation of hello-ycp to Croatian. +# Copyright (C) 2003, 2004, 2014, 2015, 2019 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Permission is granted to freely copy and distribute +# this file and modified versions, provided that this +# header is not removed and modified versions are marked +# as such. +# +# Tomislav Krznar , 2012. +# Božidar Putanec , 2018-2025. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-ycp 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 10:15-0700\n" +"Last-Translator: Božidar Putanec \n" +"Language-Team: Croatian \n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Pozdrav, svijete!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Ovaj program se izvršava kao proces broj %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/hu.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/hu.po new file mode 100644 index 0000000000000000000000000000000000000000..ad2c325616c4dcddece0329ea5db909b8a3b7800 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/hu.po @@ -0,0 +1,29 @@ +# Hungarian translation for hello-ycp. +# This file is distributed under the same license as the gettext package. +# Copyright (C) 2014 Yoyodyne, Inc. (msgids) +# +# Tamás Kiss , 2005. +# Balázs Úr , 2014, 2015. +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2015-06-23 20:31+0200\n" +"Last-Translator: Balázs Úr \n" +"Language-Team: Hungarian \n" +"Language: hu\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 1.2\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Hello, világ!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Ez a program a(z) %1 folyamatazonosítóval fut." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/id.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/id.po new file mode 100644 index 0000000000000000000000000000000000000000..260962f985544b8a11d1716f3f812b39a2fdcf96 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/id.po @@ -0,0 +1,27 @@ +# translation of hello-ycp-0.15-pre5.po to Indonesian +# Copyright (C) 2006 Yoyodyne, Inc. +# This file is distributed under the same license as the PACKAGE package. +# +# Tedi Heriyanto , 2006. +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp-0.15-pre5\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2006-09-27 20:19+0700\n" +"Last-Translator: Tedi Heriyanto \n" +"Language-Team: Indonesian \n" +"Language: id\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: KBabel 1.11.2\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Hello, world!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Program ini berjalan sebagai proses nomor %1" diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/it.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/it.po new file mode 100644 index 0000000000000000000000000000000000000000..f20924c8a38c46ec812ff0b4ddba0dc5fce4af7a --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/it.po @@ -0,0 +1,29 @@ +# Italian messages for hello-ycp. +# Copyright (C) 2005, 2006 Yoyodyne, Inc. (msgids) +# Copyright (C) 2024 Free Software Foundation, Inc. +# This file is distributed under the same license as the gettext package. +# Marco Colombo , 2005, 2006, 2015. +# Michele Locati , 2024, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-ycp 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-05-04 18:28+0200\n" +"Last-Translator: Michele Locati \n" +"Language-Team: Italian \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Ciao, mondo!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Questo programma è in esecuzione con numero di processo %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/ja.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/ja.po new file mode 100644 index 0000000000000000000000000000000000000000..1c5e6a7840517d7940de45bc273c11a8a4f9c302 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/ja.po @@ -0,0 +1,26 @@ +# Translation of `hello-ycp' messages to Japanese. +# Copyright (C) 2005, 2006, 2014, 2015, 2023, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Masahito Yamaga , 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-ycp 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 19:59+0900\n" +"Last-Translator: Masahito Yamaga \n" +"Language-Team: Japanese \n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "世界よ, こんにちは!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "このプログラムはプロセス番号 %1 で動いています." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/ka.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/ka.po new file mode 100644 index 0000000000000000000000000000000000000000..7908865ca8e575bd2d0312de6c3cbdec7ca489b6 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/ka.po @@ -0,0 +1,28 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2022 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Temuri Doghonadze , 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.20.2\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2022-05-22 05:04+0200\n" +"Last-Translator: Temuri Doghonadze \n" +"Language-Team: Georgian <(nothing)>\n" +"Language: ka\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.0.1\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "გამარჯობა სამყაროვ!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "პროგრამა გაშვებულია პროცესის ნომრით %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/ky.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/ky.po new file mode 100644 index 0000000000000000000000000000000000000000..0e736d55686c13d01719cf1da19d58e686a3b91e --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/ky.po @@ -0,0 +1,28 @@ +# Translation of 'hello-ycp' messages to Kirghiz. +# Copyright (C) 2004 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Ilyas Bakirov , 2007. +# Ilyas Bakirov , 2018. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.19.4.73\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2018-02-15 18:26+0600\n" +"Last-Translator: Ilyas Bakirov \n" +"Language-Team: Kirghiz \n" +"Language: ky\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 2.0.6\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Салам дүйнө!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Бул программа %1 процесс номери катары иштеп жатат." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/lv.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/lv.po new file mode 100644 index 0000000000000000000000000000000000000000..1f3c329e79edc3c2d790d666950413ed74432ded --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/lv.po @@ -0,0 +1,30 @@ +# Latvian translation of hello-ycp +# Copyright (C) 2009 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Arvis Lācis , 2009. +# Rihards Priedītis , 2023, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp-0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-03-09 11:44+0000\n" +"Last-Translator: Rihards Priedītis \n" +"Language-Team: Latvian \n" +"Language: lv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : " +"2);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Sveika, pasaule!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Šī programma darbojas ar procesa numuru %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/ms.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/ms.po new file mode 100644 index 0000000000000000000000000000000000000000..7d579ce0e16714ddf3dbb7750cab40db7c2d73cf --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/ms.po @@ -0,0 +1,28 @@ +# hello-ycp Bahasa Melayu (Malay) (ms). +# Copyright (C) 2006, 2015, 2023, 2025 Yoyodyne, Inc. (msgids) +# Copyright (C) 2006, 2015, 2023, 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the gettext package. +# Sharuzzaman Ahmat Raslan , 2006, 2015, 2023, 2025 +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-05-03 21:10+0800\n" +"Last-Translator: Sharuzzaman Ahmat Raslan \n" +"Language-Team: Malay \n" +"Language: ms\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Hello, dunia!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Program ini dilaksanakan sebagai proses bernombor %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/mt.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/mt.po new file mode 100644 index 0000000000000000000000000000000000000000..0c5dec6763e51818729331e32947d1859d059969 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/mt.po @@ -0,0 +1,27 @@ +# hello-ycp-0.16.2-pre5. +# Copyright (C) 2008 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Clyde Meli , 2001-2008. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.16.2-pre5\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2008-11-18 17:27+0100\n" +"Last-Translator: Clyde Meli \n" +"Language-Team: Maltese \n" +"Language: mt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Hello, lil kulħadd!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Dal-programm qed jaħdem taħt il-proċess numru %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/nb.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/nb.po new file mode 100644 index 0000000000000000000000000000000000000000..10e9dac59dc0d2f1772a772b8302de71a7a6e847 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/nb.po @@ -0,0 +1,29 @@ +# Norwegian Bokmal translations for hello-ycp package. +# Copyright (C) 2012 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Johnny A. Solbu , 2012-2024 +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2024-01-06 16:33+0100\n" +"Last-Translator: Johnny A. Solbu \n" +"Language-Team: Norwegian Bokmaal \n" +"Language: nb\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 2.4.2\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Hallo verden!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Dette programmet kjører som prosess nummer %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/nl.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/nl.po new file mode 100644 index 0000000000000000000000000000000000000000..fcea17124c328d6fe5d07a17d98580ac8c9cb24c --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/nl.po @@ -0,0 +1,31 @@ +# Dutch translations for GNU hello-ycp. +# Copyright (C) 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# "There are three basic rules for writing a novel. +# Unfortunately nobody knows what they are." +# +# Benno Schulenberg , 2007, 2014, 2015, 2019, 2025. +# Elros Cyriatan , 2004. +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp-0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-03-01 14:51+0100\n" +"Last-Translator: Benno Schulenberg \n" +"Language-Team: Dutch \n" +"Language: nl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Hallo, wereld!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Dit programma draait als proces nummer %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/nn.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/nn.po new file mode 100644 index 0000000000000000000000000000000000000000..05869344b557b5f392565893a521b238d8e8e1d3 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/nn.po @@ -0,0 +1,28 @@ +# Norwegian Nynorsk translation of GNU hello-ycp +# Copyright (C) 2020 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Karl Ove Hufthammer , 2020. +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp-0.20.2\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2020-05-04 18:58+0200\n" +"Last-Translator: Karl Ove Hufthammer \n" +"Language-Team: Norwegian Nynorsk \n" +"Language: nn\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 20.04.0\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Hei, verda!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Dette programmet køyrer som prosess nummer %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/pl.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/pl.po new file mode 100644 index 0000000000000000000000000000000000000000..fd376acbf3193ae971ade5095eb8f6295af52c6c --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/pl.po @@ -0,0 +1,27 @@ +# Polish translations for the GNU gettext messages, hello-ycp domain +# Copyright (C) 2010, 2014, 2015, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Rafał Maszkowski , 2003, 2010, 2014, 2015, 2025 +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-ycp 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-25 17:16+0200\n" +"Last-Translator: Rafał Maszkowski \n" +"Language-Team: Polish \n" +"Language: pl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8-bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " +"|| n%100>=20) ? 1 : 2);\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Cześć, świecie!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Ten program działa jako proces o numerze %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/pt.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/pt.po new file mode 100644 index 0000000000000000000000000000000000000000..12403591f7089ee5941d5130a33cb28b5bf96270 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/pt.po @@ -0,0 +1,28 @@ +# Portuguese (Portugal) translation of 'hello-ycp' package. +# Copyright (C) 2018 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Pedro Albuquerque , 2019, 2020, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 11:24+0100\n" +"Last-Translator: Pedro Albuquerque \n" +"Language-Team: Portuguese \n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\\n;\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.6\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Olá mundo!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Este programa está em execução como processo nº %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/pt_BR.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/pt_BR.po new file mode 100644 index 0000000000000000000000000000000000000000..445140e07e6c31179c6c56b821d11ae683210cb0 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/pt_BR.po @@ -0,0 +1,31 @@ +# Brazilian Portuguese translations for gettext-example +# Traduções em português brasileiro para gettext-example +# Copyright (C) 2025 Yoyodyne, Inc. (msgids) +# Copyright (C) 2025 Free Software Foundation, Inc. +# This file is distributed under the same license as the gettext package. +# Rafael Fontenelle , 2013-2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 10:24-0300\n" +"Last-Translator: Rafael Fontenelle \n" +"Language-Team: Brazilian Portuguese \n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Gtranslator 48.0\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Olá, mundo!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Este programa está executando com número de processo %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/ro.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/ro.po new file mode 100644 index 0000000000000000000000000000000000000000..08345f998d1dd1a7c9f1c4b09203e8c3db14cb69 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/ro.po @@ -0,0 +1,50 @@ +# Translation of "hello-ycp" messages to Romanian. +# Mesajele în limba română pentru pachetul hello-ycp. +# Copyright © 2015, 2019, 2022, 2023, 2024, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Eugen Hoancă , 2003. +# Mihai Cristescu , 2015 - 2019. +# Remus-Gabriel Chelu , 2022 - 2025. +# +# Cronologia traducerii fișierului „hello-ycp”: +# Traducerea inițială, făcută de EH, pentru versiunea hello-ycp 0.12.1, 2003. +# Actualizare a traducerii pentru versiunea hello-ycp 0.19.4-rc1, făcută de MC, mar-2015. +# Actualizare a traducerii pentru versiunea hello-ycp 0.19.4.73, făcută de MC, iun-2015. +# Actualizare a traducerii pentru versiunea hello-ycp 0.20-rc1, făcută de MC, apr-2019. +# Actualizare a mesajelor, de la fișierul „hello-ycp-0.20.2.pot”. +# Actualizare a algoritmului formelor de plural (de la „trei-vechi” la „trei-actual”). +# NU și a mesajelor traduse (acestea au rămas neschimbate). +# Eliminare a mesajelor ce-au dispărut în ultima versiune. +# Actualizări realizate de Remus-Gabriel Chelu , 15.01.2022. +# Actualizare a traducerii pentru versiunea 0.20.2 făcută de R-GC, ian-2022. +# Actualizare a traducerii pentru versiunea 0.22 făcută de R-GC, iun-2023. +# Revizuire și corectare a traducerii pentru versiunea 0.23-pre1 făcută de R-GC, oct-2024. +# Actualizare a traducerii pentru versiunea 0.24-pre1 făcută de R-GC, feb-2025. +# Actualizare a traducerii pentru versiunea 0.25-pre1 făcută de R-GC, apr-2025. +# Actualizare a traducerii pentru versiunea Y, făcută de X, Z(luna-anul). +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-29 00:25+0200\n" +"Last-Translator: Remus-Gabriel Chelu \n" +"Language-Team: Romanian \n" +"Language: ro\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < " +"20)) ? 1 : 2);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Salutare, lume!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Acest program rulează ca procesul numărul %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/ru.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/ru.po new file mode 100644 index 0000000000000000000000000000000000000000..b0a3861e0aec8a7ac8aafa3be4ec0bf80f52ff3e --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/ru.po @@ -0,0 +1,30 @@ +# Translation of hello-ycp-0.14.1.po to Russian +# Copyright (C) 2004 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Pavel Maryanov , 2004. +# SPDX-FileCopyrightText: 2014, 2015, 2023, 2025 Yuri Kozlov +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-05-02 09:17+0300\n" +"Last-Translator: Yuri Kozlov \n" +"Language-Team: Russian \n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Lokalize 24.12.0\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Здравствуй, мир!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Эта программа выполняется как процесс под номером %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/sk.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/sk.po new file mode 100644 index 0000000000000000000000000000000000000000..4ea1615159b02e2594ea19d905dead176232748d --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/sk.po @@ -0,0 +1,26 @@ +# Slovak translations GNU for hello-ycp package. +# Copyright (C) 2003, 2004, 2014, 2023, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Marcel Telka , 2003, 2004, 2014, 2023, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU hello-ycp 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 13:53+0200\n" +"Last-Translator: Marcel Telka \n" +"Language-Team: Slovak \n" +"Language: sk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Ahoj svet!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Tento program beží ako proces s číslom %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/sl.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/sl.po new file mode 100644 index 0000000000000000000000000000000000000000..3f5d1aea6837355e281e11bff63348e52282c01d --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/sl.po @@ -0,0 +1,29 @@ +# -*- mode: po; coding: utf-8; -*- Slovenian message catalog for GNU gettext-example +# Copyright (C) 2005 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Primož Peterlin , 2005, 2014, 2015, 2024. +# $Id: hello-ycp-0.22.sl.po,v 1.1 2024/03/28 17:02:19 peterlin Exp $ +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2024-03-28 18:02+0100\n" +"Last-Translator: Primož Peterlin \n" +"Language-Team: Slovenian \n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8-bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || " +"n%100==4 ? 3 : 0);\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Pozdravljen, svet!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Ta program teče kot proces številka %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/sq.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/sq.po new file mode 100644 index 0000000000000000000000000000000000000000..72904a29a949a6812b8ce859931e823a1c189fb9 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/sq.po @@ -0,0 +1,28 @@ +# Albanian translation of gettext-example. +# Copyright (C) 2020 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Besnik Bleta , 2020,2023,2024,2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp-0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 19:56+0300\n" +"Last-Translator: Besnik Bleta \n" +"Language-Team: Albanian \n" +"Language: sq\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.2.2\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Tungjatjeta, botë!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Ky program po xhiron si procesi numër %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/sr.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/sr.po new file mode 100644 index 0000000000000000000000000000000000000000..006de5d722f56b7e5674f5b78a7f58128a87b7ba --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/sr.po @@ -0,0 +1,30 @@ +# Serbian translation of hello-ycp. +# Copyright (C) 2014 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Aleksandar Jelenak , 2004. +# Мирослав Николић , 2014-2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp-0.24-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-03-02 16:51+0100\n" +"Last-Translator: Мирослав Николић \n" +"Language-Team: Serbian <(nothing)>\n" +"Language: sr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Здраво, свима!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Овај програм се извршава као процес број %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/sv.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/sv.po new file mode 100644 index 0000000000000000000000000000000000000000..5f48c04f6f27b9910fbc7ae2ad9296e333baa564 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/sv.po @@ -0,0 +1,30 @@ +# Swedish messages for hello-ycp. +# Copyright © 2006, 2014, 2016, 2019, 2020, 2023, 2024, 2025 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Jan Djärv , 2003, 2006, 2014. +# Göran Uddeborg , 2016, 2019, 2020, 2023, 2024, 2025. +# Luna Jernberg , 2025. +# $Revision: 1.12 $ +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 12:18+0200\n" +"Last-Translator: Luna Jernberg \n" +"Language-Team: Swedish \n" +"Language: sv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Hej världen!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Detta program kör som process nummer %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/ta.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/ta.po new file mode 100644 index 0000000000000000000000000000000000000000..0430ffd018774fd076a2630036c0aed56229c928 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/ta.po @@ -0,0 +1,28 @@ +# Tamil messages for GNU gettext. +# Copyright (C) 2018 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# List of contributors follow: +# Poorajith , 2018. +# Arun Isaac , 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-06-19 00:06+0100\n" +"Last-Translator: Arun Isaac \n" +"Language-Team: Tamil \n" +"Language: ta\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "வணக்கம், உலகு!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "இந்நிரல் செயலாக்க எண் %1 ஆக இயங்கிக்கொண்டிருக்கிறது." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/tr.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/tr.po new file mode 100644 index 0000000000000000000000000000000000000000..d92dbec2a6968d1a980c3787d39b753ce8a0d10f --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/tr.po @@ -0,0 +1,29 @@ +# Turkish translation for hello-ycp. +# This file is distributed under the same license as the gettext package. +# Copyright (C) 2017 Yoyodyne, Inc. (msgids) +# Copyright (C) 2004 Free Software Foundation, Inc. +# Nilgün Belma Bugüner , 2003,2004 +# Mehmet Kececi , 2017, 2019, 2020. +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.20.2\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2020-04-17 13:10+0300\n" +"Last-Translator: Mehmet Kececi \n" +"Language-Team: Turkish \n" +"Language: tr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Poedit 2.3\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Merhaba, dünya!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Bu yazılım %1 süreç numarası ile çalışıyor." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/uk.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/uk.po new file mode 100644 index 0000000000000000000000000000000000000000..07536b5dcc1bd9e2f1b40a6f9bbf0e48f30d477e --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/uk.po @@ -0,0 +1,30 @@ +# Ukrainian translation to hello-ycp +# Copyright (C) 2014 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# +# Maxim V. Dziumanenko , 2004-2007. +# Yuri Chornoivan , 2014, 2015, 2023, 2025. +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-28 13:56+0300\n" +"Last-Translator: Yuri Chornoivan \n" +"Language-Team: Ukrainian \n" +"Language: uk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Lokalize 23.04.3\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Привіт, світе!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Ця програма виконується як процес з номером %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/vi.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/vi.po new file mode 100644 index 0000000000000000000000000000000000000000..63530c040169e43f46fc5325de3dc26924bac040 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/vi.po @@ -0,0 +1,30 @@ +# Vietnamese Translation for Gettext Examples. +# Bản dịch tiếng Việt dành cho các ví dụ của gói gettext. +# Copyright © 2015 Yoyodyne, Inc. (msgids) +# Copyright © 2015 Free Software Foundation, Inc. +# This file is distributed under the same license as the gettext package. +# Clytie Siddall , 2005-2010. +# Trần Ngọc Quân , 2012-2015, 2023. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.22\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2023-06-24 09:10+0700\n" +"Last-Translator: Trần Ngọc Quân \n" +"Language-Team: Vietnamese \n" +"Language: vi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "Chào thế giới!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "Chương trình này đang chạy với mã số tiến trình %1." diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/zh_CN.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/zh_CN.po new file mode 100644 index 0000000000000000000000000000000000000000..fcdbf3ecdeb1ed94d59df714e1e77b24c0dbded6 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/zh_CN.po @@ -0,0 +1,29 @@ +# zh_CN translation for hello-ycp. +# Copyright (C) 2015 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Funda Wang , 2003. +# Ji ZhengYu , 2015. +# Boyuan Yang <073plan@gmail.com>, 2019, 2023, 2025. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.25-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2025-04-29 15:56-0400\n" +"Last-Translator: Boyuan Yang <073plan@gmail.com>\n" +"Language-Team: Chinese (simplified) \n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.6\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "你好,世界!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "此程序正以进程号 %1 运行。" diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/zh_HK.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/zh_HK.po new file mode 100644 index 0000000000000000000000000000000000000000..a667a68d9b5262807300582f9633d5d4ab7cc165 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/zh_HK.po @@ -0,0 +1,25 @@ +# Chinese (Hong Kong) translation of hello-ycp. +# Copyright (C) 2006 Yoyodyne, Inc. +# Abel Cheung , 2006. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.15-pre5\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2006-07-05 15:40+0800\n" +"Last-Translator: Abel Cheung \n" +"Language-Team: Chinese (Hong Kong) \n" +"Language: zh_HK\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "你好!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "本程式正在執行中,進程編號為 %1。" diff --git a/miniconda3/share/doc/gettext/examples/hello-ycp/po/zh_TW.po b/miniconda3/share/doc/gettext/examples/hello-ycp/po/zh_TW.po new file mode 100644 index 0000000000000000000000000000000000000000..ad4ab8e4ec4ed73fed49a28e7effa48a46e79c03 --- /dev/null +++ b/miniconda3/share/doc/gettext/examples/hello-ycp/po/zh_TW.po @@ -0,0 +1,29 @@ +# Traditional Chinese translation of hello-ycp. +# Copyright (C) 2009 Yoyodyne, Inc. (msgids) +# This file is distributed under the same license as the gettext package. +# Abel Cheung , 2005. +# Wei-Lun Chao , 2013, 2015. +# Yi-Jyun Pan , 2024. +# +msgid "" +msgstr "" +"Project-Id-Version: hello-ycp 0.23-pre1\n" +"Report-Msgid-Bugs-To: bug-gettext@gnu.org\n" +"PO-Revision-Date: 2024-11-30 14:14+0800\n" +"Last-Translator: Yi-Jyun Pan \n" +"Language-Team: Chinese (traditional) \n" +"Language: zh_TW\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Bugs: Report translation errors to the Language-Team address.\n" +"X-Generator: Poedit 3.5\n" + +#: hello.ycp:15 +msgid "Hello, world!" +msgstr "哈囉,大家好!" + +#: hello.ycp:19 +#, ycp-format +msgid "This program is running as process number %1." +msgstr "本程式正在執行,行程編號為 %1。" diff --git a/miniconda3/share/doc/gettext/javadoc2/allclasses-frame.html b/miniconda3/share/doc/gettext/javadoc2/allclasses-frame.html new file mode 100644 index 0000000000000000000000000000000000000000..a788935a8ba684267e77fa2662da9dfd4ef4d6e6 --- /dev/null +++ b/miniconda3/share/doc/gettext/javadoc2/allclasses-frame.html @@ -0,0 +1,25 @@ + + + + + + +All Classes + + + + + +All Classes +
+ + + + + +
GettextResource +
+
+ + + diff --git a/miniconda3/share/doc/gettext/javadoc2/deprecated-list.html b/miniconda3/share/doc/gettext/javadoc2/deprecated-list.html new file mode 100644 index 0000000000000000000000000000000000000000..57a2b73782e699e3323498ec55f99a524d89c7cd --- /dev/null +++ b/miniconda3/share/doc/gettext/javadoc2/deprecated-list.html @@ -0,0 +1,87 @@ + + + + + + +: Deprecated List + + + + + + + + + + + + + + + + + +
+ +
+ + +
+
+

+Deprecated API

+
+
+ + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/miniconda3/share/doc/gettext/javadoc2/gnu/gettext/GettextResource.html b/miniconda3/share/doc/gettext/javadoc2/gnu/gettext/GettextResource.html new file mode 100644 index 0000000000000000000000000000000000000000..c1daa903a58a0f0556cdc209d43047e61f890cea --- /dev/null +++ b/miniconda3/share/doc/gettext/javadoc2/gnu/gettext/GettextResource.html @@ -0,0 +1,321 @@ + + + + + + +: Class GettextResource + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+ +

+ +gnu.gettext +
+Class GettextResource

+
+java.lang.Object
+  |
+  +--java.util.ResourceBundle
+        |
+        +--gnu.gettext.GettextResource
+
+
+
+
public abstract class GettextResource
extends java.util.ResourceBundle
+ +

+This class implements the main GNU libintl functions in Java. +

+ Using the GNU gettext approach, compiled message catalogs are normal + Java ResourceBundle classes and are thus interoperable with standard + ResourceBundle based code. +

+ The main differences between the Sun ResourceBundle approach and the + GNU gettext approach are: +

    +
  • In the Sun approach, the keys are abstract textual shortcuts. + In the GNU gettext approach, the keys are the English/ASCII version + of the messages. +
  • In the Sun approach, the translation files are called + "Resource_locale.properties" and have non-ASCII + characters encoded in the Java + \unnnn syntax. Very few editors + can natively display international characters in this format. In the + GNU gettext approach, the translation files are called + "Resource.locale.po" + and are in the encoding the translator has chosen. Many editors + can be used. There are at least three GUI translating tools + (Emacs PO mode, KDE KBabel, GNOME gtranslator). +
  • In the Sun approach, the function + ResourceBundle.getString throws a + MissingResourceException when no translation is found. + In the GNU gettext approach, the gettext function + returns the (English) message key in that case. +
  • In the Sun approach, there is no support for plural handling. + Even the most elaborate MessageFormat strings cannot provide decent + plural handling. In the GNU gettext approach, we have the + ngettext function. +
+

+ To compile GNU gettext message catalogs into Java ResourceBundle classes, + the msgfmt program can be used. +

+


+ +

+ + + + + + + + + + + + + + +
+Field Summary
+static booleanverbose + +
+           
+ + + + + + + +
Fields inherited from class java.util.ResourceBundle
parent
+  + + + + + + + + + + +
+Constructor Summary
GettextResource() + +
+           
+  + + + + + + + + + + + + + + + +
+Method Summary
+static java.lang.Stringgettext(java.util.ResourceBundle catalog, + java.lang.String msgid) + +
+          Returns the translation of msgid.
+static java.lang.Stringngettext(java.util.ResourceBundle catalog, + java.lang.String msgid, + java.lang.String msgid_plural, + long n) + +
+          Returns the plural form for n of the translation of + msgid.
+ + + + + + + +
Methods inherited from class java.util.ResourceBundle
getBundle, getBundle, getBundle, getKeys, getLocale, getObject, getString, getStringArray, handleGetObject, setParent
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+verbose

+
+public static boolean verbose
+
+
+ + + + + + + + +
+Constructor Detail
+ +

+GettextResource

+
+public GettextResource()
+
+
+ + + + + + + + +
+Method Detail
+ +

+gettext

+
+public static java.lang.String gettext(java.util.ResourceBundle catalog,
+                                       java.lang.String msgid)
+
+
Returns the translation of msgid.
+
Parameters:
catalog - a ResourceBundle
msgid - the key string to be translated, an ASCII string
Returns:
the translation of msgid, or msgid if + none is found
+
+
+
+ +

+ngettext

+
+public static java.lang.String ngettext(java.util.ResourceBundle catalog,
+                                        java.lang.String msgid,
+                                        java.lang.String msgid_plural,
+                                        long n)
+
+
Returns the plural form for n of the translation of + msgid.
+
Parameters:
catalog - a ResourceBundle
msgid - the key string to be translated, an ASCII string
msgid_plural - its English plural form
Returns:
the translation of msgid depending on n, + or msgid or msgid_plural if none is found
+
+
+ +
+ + + + + + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/miniconda3/share/doc/gettext/javadoc2/gnu/gettext/package-frame.html b/miniconda3/share/doc/gettext/javadoc2/gnu/gettext/package-frame.html new file mode 100644 index 0000000000000000000000000000000000000000..6e2f332a3909b40923a7af8a59c137fd7f76f6af --- /dev/null +++ b/miniconda3/share/doc/gettext/javadoc2/gnu/gettext/package-frame.html @@ -0,0 +1,26 @@ + + + + + + +: Package gnu.gettext + + + + + +gnu.gettext + + + + +
+Classes  + +
+GettextResource
+ + + + diff --git a/miniconda3/share/doc/gettext/javadoc2/gnu/gettext/package-summary.html b/miniconda3/share/doc/gettext/javadoc2/gnu/gettext/package-summary.html new file mode 100644 index 0000000000000000000000000000000000000000..d4909fa9b55263faa5f2950a98b91c9a0890f9b7 --- /dev/null +++ b/miniconda3/share/doc/gettext/javadoc2/gnu/gettext/package-summary.html @@ -0,0 +1,103 @@ + + + + + + +: Package gnu.gettext + + + + + + + + + + + + + + + + + +
+ +
+ + +
+

+Package gnu.gettext +

+ + + + + + + + + +
+Class Summary
GettextResourceThis class implements the main GNU libintl functions in Java. +
+  + +

+


+ + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/miniconda3/share/doc/gettext/javadoc2/gnu/gettext/package-tree.html b/miniconda3/share/doc/gettext/javadoc2/gnu/gettext/package-tree.html new file mode 100644 index 0000000000000000000000000000000000000000..75a500368dc2f8c4fb857f3c6ed13c96076aa51b --- /dev/null +++ b/miniconda3/share/doc/gettext/javadoc2/gnu/gettext/package-tree.html @@ -0,0 +1,99 @@ + + + + + + +: gnu.gettext Class Hierarchy + + + + + + + + + + + + + + + + + +
+ +
+ + +
+
+

+Hierarchy For Package gnu.gettext +

+
+

+Class Hierarchy +

+
    +
  • class java.lang.Object +
+
+ + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/miniconda3/share/doc/gettext/javadoc2/help-doc.html b/miniconda3/share/doc/gettext/javadoc2/help-doc.html new file mode 100644 index 0000000000000000000000000000000000000000..8f09871e43157c67f0b64074942bfe2978984f5b --- /dev/null +++ b/miniconda3/share/doc/gettext/javadoc2/help-doc.html @@ -0,0 +1,136 @@ + + + + + + +: API Help + + + + + + + + + + + + + + + + + +
+ +
+ + +
+
+

+How This API Document Is Organized

+
+This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.

+Package

+
+ +

+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:

    +
  • Interfaces (italic)
  • Classes
  • Exceptions
  • Errors
+
+

+Class/Interface

+
+ +

+Each class, interface, inner class and inner interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
  • Class inheritance diagram
  • Direct Subclasses
  • All Known Subinterfaces
  • All Known Implementing Classes
  • Class/interface declaration
  • Class/interface description +

    +

  • Inner Class Summary
  • Field Summary
  • Constructor Summary
  • Method Summary +

    +

  • Field Detail
  • Constructor Detail
  • Method Detail
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+

+Tree (Class Hierarchy)

+
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object.
    +
  • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
  • When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
+
+

+Deprecated API

+
+The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+

+Index

+
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+

+Prev/Next

+These links take you to the next or previous class, interface, package, or related page.

+Frames/No Frames

+These links show and hide the HTML frames. All pages are available with or without frames. +

+

+Serialized Form

+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. +

+ + +This help file applies to API documentation generated using the standard doclet. + +
+


+ + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/miniconda3/share/doc/gettext/javadoc2/index-all.html b/miniconda3/share/doc/gettext/javadoc2/index-all.html new file mode 100644 index 0000000000000000000000000000000000000000..48ebc2e4767a92725ceb75583be1464a653a6311 --- /dev/null +++ b/miniconda3/share/doc/gettext/javadoc2/index-all.html @@ -0,0 +1,111 @@ + + + + + + +: Index + + + + + + + + + + + + + + + + + +
+ +
+ + +G N V
+

+G

+
+
gettext(ResourceBundle, String) - +Static method in class gnu.gettext.GettextResource +
Returns the translation of msgid. +
GettextResource - class gnu.gettext.GettextResource.
This class implements the main GNU libintl functions in Java. +
GettextResource() - +Constructor for class gnu.gettext.GettextResource +
  +
+
+

+N

+
+
ngettext(ResourceBundle, String, String, long) - +Static method in class gnu.gettext.GettextResource +
Returns the plural form for n of the translation of + msgid. +
+
+

+V

+
+
verbose - +Static variable in class gnu.gettext.GettextResource +
  +
+
+G N V + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/miniconda3/share/doc/gettext/javadoc2/index.html b/miniconda3/share/doc/gettext/javadoc2/index.html new file mode 100644 index 0000000000000000000000000000000000000000..e3601570fd597ccc1f18242673b3ba952c0fc7ea --- /dev/null +++ b/miniconda3/share/doc/gettext/javadoc2/index.html @@ -0,0 +1,22 @@ + + + + + + +Generated Documentation (Untitled) + + + + + + + +<H2> +Frame Alert</H2> + +<P> +This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +<BR> +Link to <A HREF="gnu/gettext/GettextResource.html">Non-frame version.</A> + diff --git a/miniconda3/share/doc/gettext/javadoc2/overview-tree.html b/miniconda3/share/doc/gettext/javadoc2/overview-tree.html new file mode 100644 index 0000000000000000000000000000000000000000..310db687c30bc614ba8601f6583f88cadc73af04 --- /dev/null +++ b/miniconda3/share/doc/gettext/javadoc2/overview-tree.html @@ -0,0 +1,96 @@ + + + + + + +: Class Hierarchy + + + + + + + + + + + + + + + + + +
+ +
+ + +
+
+

+Hierarchy For All Packages

+
+

+Class Hierarchy +

+
    +
  • class java.lang.Object +
+
+ + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/miniconda3/share/doc/gettext/javadoc2/package-list b/miniconda3/share/doc/gettext/javadoc2/package-list new file mode 100644 index 0000000000000000000000000000000000000000..4820a252bfa90931c22cb0406cfb9328e5c1c6f3 --- /dev/null +++ b/miniconda3/share/doc/gettext/javadoc2/package-list @@ -0,0 +1 @@ +gnu.gettext diff --git a/miniconda3/share/doc/gettext/javadoc2/packages.html b/miniconda3/share/doc/gettext/javadoc2/packages.html new file mode 100644 index 0000000000000000000000000000000000000000..4807ba261ffc567053f8286d2846217d4f370c8c --- /dev/null +++ b/miniconda3/share/doc/gettext/javadoc2/packages.html @@ -0,0 +1,26 @@ + + + + + + + + + + + + +
+ +
+ +
+
+The front page has been relocated.Please see: +
+          Frame version +
+          Non-frame version.
+ + + diff --git a/miniconda3/share/doc/gettext/javadoc2/serialized-form.html b/miniconda3/share/doc/gettext/javadoc2/serialized-form.html new file mode 100644 index 0000000000000000000000000000000000000000..6ce40bc5a2dedbe828b7812ca1a7290323f42c1c --- /dev/null +++ b/miniconda3/share/doc/gettext/javadoc2/serialized-form.html @@ -0,0 +1,87 @@ + + + + + + +Serialized Form + + + + + + + + + + + + + + + + + +
+ +
+ + +
+
+

+Serialized Form

+
+
+ + + + + + + + + + + + + +
+ +
+ + +
+ + + diff --git a/miniconda3/share/doc/gettext/javadoc2/stylesheet.css b/miniconda3/share/doc/gettext/javadoc2/stylesheet.css new file mode 100644 index 0000000000000000000000000000000000000000..95f57649867706e9a2c352c08694bddfcc53f2ca --- /dev/null +++ b/miniconda3/share/doc/gettext/javadoc2/stylesheet.css @@ -0,0 +1,29 @@ +/* Javadoc style sheet */ + +/* Define colors, fonts and other style attributes here to override the defaults */ + +/* Page background color */ +body { background-color: #FFFFFF } + +/* Table colors */ +.TableHeadingColor { background: #CCCCFF } /* Dark mauve */ +.TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ +.TableRowColor { background: #FFFFFF } /* White */ + +/* Font used in left-hand frame lists */ +.FrameTitleFont { font-size: normal; font-family: normal } +.FrameHeadingFont { font-size: normal; font-family: normal } +.FrameItemFont { font-size: normal; font-family: normal } + +/* Example of smaller, sans-serif font in frames */ +/* .FrameItemFont { font-size: 10pt; font-family: Helvetica, Arial, sans-serif } */ + +/* Navigation bar fonts and colors */ +.NavBarCell1 { background-color:#EEEEFF;}/* Light mauve */ +.NavBarCell1Rev { background-color:#00008B;}/* Dark Blue */ +.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} +.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} + +.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} +.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} + diff --git a/miniconda3/share/doc/kbproto/XKBproto-1.svg b/miniconda3/share/doc/kbproto/XKBproto-1.svg new file mode 100644 index 0000000000000000000000000000000000000000..1f8ba5b75902388d6ac1afe32ee3f27ebd5ff8b7 --- /dev/null +++ b/miniconda3/share/doc/kbproto/XKBproto-1.svg @@ -0,0 +1,1177 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/miniconda3/share/doc/kbproto/XKBproto-10.svg b/miniconda3/share/doc/kbproto/XKBproto-10.svg new file mode 100644 index 0000000000000000000000000000000000000000..76600793e391515b9a1657e4b5b38c9b99bf185f --- /dev/null +++ b/miniconda3/share/doc/kbproto/XKBproto-10.svg @@ -0,0 +1,142 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/miniconda3/share/doc/kbproto/XKBproto-11.svg b/miniconda3/share/doc/kbproto/XKBproto-11.svg new file mode 100644 index 0000000000000000000000000000000000000000..fa334dea183012ccf3f9b530d5eaf402fb413087 --- /dev/null +++ b/miniconda3/share/doc/kbproto/XKBproto-11.svg @@ -0,0 +1,2730 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + <ESC> + <FK01> + <FK02> + <FK03> + <FK04> + <FK05> + <FK06> + <FK07> + <FK08> + + + + + <AE12> + + + <TAB> + + + <CAPS> + + + <LFSH> + + + <AE01> + + + <AD01> + + + <AC01> + + + <AB01> + + + <TLDE> + + + <AE02> + + + <AD02> + + + <AC02> + + + <AB02> + + + <INS> + + + <AE03> + + + <AD03> + + + <AC03> + + + <AB03> + + + <LEFT> + + + <AE04> + + + <AD04> + + + <AC04> + + + <AB04> + + + <RGHT> + + + <AE05> + + + <AD05> + + + <AC05> + + + <AB05> + + + + + + + + + + + + <FK09> + <FK10> + <FK11> + <FK12> + <PRSC> + <SCLK> + <PAUS> + <FK16> + <FK17> + + + + + + + + <AE06> + + + <AD06> + + + <AC06> + + + <AB06> + + + <NMLK> + <AE07> + + + <KP7> + <AD07> + + + <KP4> + <AC07> + + + <KP1> + <AB07> + + + <UP> + + + <KPEQ> + <AE08> + + + <KP8> + <AD08> + + + <KP5> + <AC08> + + + <KP2> + <AB08> + + + <DOWN> + + + <KPSL> + <AE09> + + + <KP9> + <AD09> + + + <KP6> + <AC09> + + + <KP3> + <AB09> + + + <AD11> + + + <KPMU> + <AE10> + + + <KPSU> + <AD10> + + + <KPAD> + <AC10> + + + <KPEN> + <AB10> + + + <AD12> + <KPEN> + <AE11> + + + <BKSL> + + + <AC11> + + + <RTSH> + + + + + + + + + <RALT> + + + + + + + <PGUP> + + + + + + + <PGDN> + + + + + + <RCTL> + + + + + <RTRN> + + + + + + <KP0> + <SPCE> + + + + + + + + <LALT> + + + + + <HOME> + + + + + <END> + + + + + <LCTL> + + + + + <DELE> + + + + + <BKSP> + + + + diff --git a/miniconda3/share/doc/kbproto/XKBproto-2.svg b/miniconda3/share/doc/kbproto/XKBproto-2.svg new file mode 100644 index 0000000000000000000000000000000000000000..495be15370218fb53cd5a056dd5f9df4ba8722c0 --- /dev/null +++ b/miniconda3/share/doc/kbproto/XKBproto-2.svg @@ -0,0 +1,544 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/miniconda3/share/doc/kbproto/XKBproto-3.svg b/miniconda3/share/doc/kbproto/XKBproto-3.svg new file mode 100644 index 0000000000000000000000000000000000000000..30744c590315ce9e7785c4df773f5c5b772c5a25 --- /dev/null +++ b/miniconda3/share/doc/kbproto/XKBproto-3.svg @@ -0,0 +1,461 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/miniconda3/share/doc/kbproto/XKBproto-4.svg b/miniconda3/share/doc/kbproto/XKBproto-4.svg new file mode 100644 index 0000000000000000000000000000000000000000..f5578d33229d22809b5c20329bf88afd8958b5f3 --- /dev/null +++ b/miniconda3/share/doc/kbproto/XKBproto-4.svg @@ -0,0 +1,463 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/miniconda3/share/doc/kbproto/XKBproto-5.svg b/miniconda3/share/doc/kbproto/XKBproto-5.svg new file mode 100644 index 0000000000000000000000000000000000000000..0deeacc189a5c20229ee1aa2cfbc4d7695085d66 --- /dev/null +++ b/miniconda3/share/doc/kbproto/XKBproto-5.svg @@ -0,0 +1,468 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/miniconda3/share/doc/kbproto/XKBproto-6.svg b/miniconda3/share/doc/kbproto/XKBproto-6.svg new file mode 100644 index 0000000000000000000000000000000000000000..a274f2b07d9c2e95f1f335562f80f4d0681633ef --- /dev/null +++ b/miniconda3/share/doc/kbproto/XKBproto-6.svg @@ -0,0 +1,558 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + Core Symbols + + + + + + + A + a + + + + L1 + L2 + L1 + L2 + G1 + G2 + + + + Xkb Symbols + + + + + + + A + a + + + L1 + L2 + G1 + G2 + + + Symbols + a + G1L1 = + A + G1L2 = + + + + G2L1 = + + + + G2L2 = + + + + + Physical Key + Shift Level + Group + + + + + + + a + A + + + + + diff --git a/miniconda3/share/doc/kbproto/XKBproto-7.svg b/miniconda3/share/doc/kbproto/XKBproto-7.svg new file mode 100644 index 0000000000000000000000000000000000000000..82b80a6505a33adf672b9a2575b508213fe4a4b5 --- /dev/null +++ b/miniconda3/share/doc/kbproto/XKBproto-7.svg @@ -0,0 +1,474 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + Key: + Keycode: + 13 + + NumLock + 15 + + Enter + 12 + + 1 + End + 9 + + è + ö + 8 + + Q + q + @ + 10 + + A + a + + + + æ + 11 + + ? + \ + ? + ϐ + + diff --git a/miniconda3/share/doc/kbproto/XKBproto-8.svg b/miniconda3/share/doc/kbproto/XKBproto-8.svg new file mode 100644 index 0000000000000000000000000000000000000000..8baa3e36ab2105821a130ce9f4cdeff2661ec2c0 --- /dev/null +++ b/miniconda3/share/doc/kbproto/XKBproto-8.svg @@ -0,0 +1,138 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/miniconda3/share/doc/kbproto/XKBproto-9.svg b/miniconda3/share/doc/kbproto/XKBproto-9.svg new file mode 100644 index 0000000000000000000000000000000000000000..8baa3e36ab2105821a130ce9f4cdeff2661ec2c0 --- /dev/null +++ b/miniconda3/share/doc/kbproto/XKBproto-9.svg @@ -0,0 +1,138 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/miniconda3/share/doc/kbproto/acknowledgements.xml b/miniconda3/share/doc/kbproto/acknowledgements.xml new file mode 100644 index 0000000000000000000000000000000000000000..95b9521e0d3d85699a44988fac94e4db2908a99e --- /dev/null +++ b/miniconda3/share/doc/kbproto/acknowledgements.xml @@ -0,0 +1,41 @@ + +Acknowledgments + + +I am grateful for all of the comments and suggestions I have received over the years. I could not possibly list everyone who has helped, but a few people have gone well above and beyond the call of duty and simply must be listed here. + + + +My managers here at SGI, Tom Paquin (now at Netscape) and Gianni Mariani were wonderful. Rather than insisting on some relatively quick, specialized proprietary solution to the keyboard problems we were having, both Tom and Gianni understood the importance of solving them in a general way and for the community as a whole. That was a difficult position to take and it was even harder to maintain when the scope of the project expanded beyond anything we imagined was possible. Gianni and Tom were unflagging in their support and their desire to “do the right thing” despite the schedule and budget pressure that intervened from time to time. + + + +Will Walker, at Digital Equipment Corporation, has been a longtime supporter of XKB. His help and input was essential to ensure that the extension as a whole fits and works together well. His focus was AccessX but the entire extension has benefited from his input and hard work. Without his unflagging good cheer and willingness to lend a hand, XKB would not be where it is today. + + + +Matt Landau, at the X Consortium, stood behind XKB during some tough spots in the release and standardization process. Without Matt’s support, XKB would likely not be a standard for a long time to come. When it became clear that we had too much to do for the amount of time we had remaining, Matt did a fantastic job of finding people to help finish the work needed for standardization. + + + +One of those people was George Sachs, at Hewlett-Packard, who jumped in to help out. His help was essential in getting the extension into this release. Another was Donna Converse, who helped figure out how to explain all of this stuff to someone who hadn’t had their head buried in it for years. + + + +Amber Benson and Gary Aitken were simply phenomenal. They jumped into a huge and complicated project with good cheer and unbelievable energy. They were “up to speed” and contributing within days. I stand in awe of the amount that they managed to achieve in such a short time. Thanks to Gary and Amber, the XKB library specification is a work of art and a thousand times easier to use and more useful than it would otherwise be. + + + +I truly cannot express my gratitude to all of you, without whom this would not have been possible. + + + +Erik Fortune + + +Silicon Graphics, Inc. + + +5 February 1996 + + diff --git a/miniconda3/share/doc/kbproto/appA.xml b/miniconda3/share/doc/kbproto/appA.xml new file mode 100644 index 0000000000000000000000000000000000000000..fd26bac22106bfa4f1cabd77168f3f58d8649883 --- /dev/null +++ b/miniconda3/share/doc/kbproto/appA.xml @@ -0,0 +1,916 @@ + +Default Symbol Transformations + + +Interpreting the Control Modifier + + +If the +Control + modifier is not consumed by the symbol lookup process, routines that determine +the symbol and string that correspond to an event should convert the symbol to +a string as defined in the table below. Only the string to be returned is +affected by the +Control + modifier; the symbol is not changed. + + + + +This table lists the decimal value of the standard control characters that +correspond to some keysyms for ASCII characters. Control characters for symbols +not listed in this table are application-specific. + + + + + + + + + + + + + + + + Keysyms + Value + Keysyms + Value + Keysyms + Value + Keysyms + Value + + + + + atsign + 0 + h, H + 8 + p, P + 16 + x, X + 24 + + + a, A + 1 + i, I + 9 + q, Q + 17 + y, Y + 25 + + + b, B + 2 + j, J + 10 + r, R + 18 + z, Z + 26 + + + c, C + 3 + k, K + 11 + s, S + 19 + left_bracket + 27 + + + d, D + 4 + l, L + 12 + t, T + 20 + backslash + 28 + + + e, E + 5 + m, M + 13 + u, U + 21 + right_bracket + 29 + + + f, F + 6 + n, N + 14 + v, V + 22 + asciicircum + 30 + + + g, G + 8 + o, O + 15 + w, W + 23 + underbar + 31 + + + + + + + +Interpreting the Lock Modifier + + +If the +Lock + modifier is not consumed by the symbol lookup process, routines that determine +the symbol and string that correspond to an event should capitalize the result. +Unlike the transformation for +Control +, the capitalization transformation changes both the symbol and the string +returned by the event. + + + +Locale-Sensitive Capitalization + + +If +Lock + is set in an event and not consumed, applications should capitalize the string +and symbols that result from an event according to the capitalization rules in +effect for the system on which the application is running, taking the current +state of the user environment (e.g. locale) into account. + + + + + +Locale-Insensitive Capitalization + + +XKB recommends but does not require locale-sensitive capitalization. In cases +where the locale is unknown or where locale-sensitive capitalization is +prohibitively expensive, applications can capitalize according to the rules +defined in this extension. + + + + +The following tables list all of the keysyms for which XKB defines +capitalization behavior. Any keysyms not explicitly listed in these tables are +not capitalized by XKB when locale-insensitive capitalization is in effect and +are not automatically assigned the +ALPHABETIC + type as described in the Alphabetic Key Type. + + + + +Capitalization Rules for Latin-1 Keysyms + + +This table lists the Latin-11 keysyms for which XKB defines upper and lower +case: + + + + + + + + + + + + + + + + Lower Case + Upper Case + Lower Case + Upper Case + Lower Case + Upper Case + Lower Case + Upper Case + + + + + a + A + o + O + acircumflex + Acircumflex + eth + ETH + + + b + B + p + P + adiaeresis + Adiaeresis + ntilde + Ntilde + + + c + C + q + Q + atilde + Atilde + ograve + Ograve + + + d + D + r + R + aring + Aring + oacute + Oacute + + + e + E + s + S + ae + AE + ocircumflex + Ocircumflex + + + f + F + t + T + ccedilla + Ccedilla + otilde + Otilde + + + g + G + u + U + egrave + Egrave + odiaeresis + Odiaeresis + + + h + H + v + V + eacute + Eacute + oslash + Ooblique + + + i + I + w + W + ecircumflex + Ecircumflex + ugrave + Ugrave + + + j + J + x + X + ediaeresis + Ediaeresis + uacute + Uacute + + + k + K + y + Y + igrave + Igrave + ucircumflex + Ucircumflex + + + l + L + z + Z + iacute + Iacute + udiaeresis + Udiaeresis + + + m + M + agrave + Agrave + icircumflex + Icircumflex + yacute + Yacute + + + n + N + aacute + Aacute + idiaeresis + Idiaeresis + thorn + THORN + + + + + + + +Capitalization Rules for Latin-2 Keysyms + + +This table lists the Latin-2 keysyms for which XKB defines upper and lower case: + + + + + + + + + + + + + + Lower Case + Upper Case + Lower Case + Upper Case + Lower Case + Upper Case + + + + + aogonek + Aogonek + zabovedot + Zabovedot + dstroke + Dstroke + + + lstroke + Lstroke + racute + Racute + nacute + Nacute + + + lcaron + Lcaron + abreve + Abreve + ncaron + Ncaron + + + sacute + Sacute + lacute + Lacute + odoubleacute + Odoubleacute + + + scaron + Scaron + cacute + Cacute + rcaron + Rcaron + + + scedilla + Scedilla + ccaron + Ccaron + uabovering + Uabovering + + + tcaron + Tcaron + eogonek + Eogonek + udoubleacute + Udoubleacute + + + zacute + Zacute + ecaron + Ecaron + tcedilla + Tcedilla + + + zcaron + Zcaron + dcaron + Dcaron + + + + + + + + + +Capitalization Rules for Latin-3 Keysyms + + +This table lists the Latin-3 keysyms for which XKB defines upper and lower case: + + + + + + + + + + + + + + Lower Case + Upper Case + Lower Case + Upper Case + Lower Case + Upper Case + + + + + hstroke + Hstroke + jcircumflex + Jcircumflex + gcircumflex + Gcircumflex + + + hcircumflex + Hcircumflex + cabovedot + Cabovedot + ubreve + Ubreve + + + idotless + Iabovedot + ccircumflex + Ccircumflex + scircumflex + Scircumflex + + + gbreve + Gbreve + gabovedot + Gabovedot + + + + + + + + + +Capitalization Rules for Latin-4 Keysyms + + +This table lists the Latin-4 keysyms for which XKB defines upper and lower case: + + + + + + + + + + + + + + Lower Case + Upper Case + Lower Case + Upper Case + Lower Case + Upper Case + + + + + rcedilla + Rcedilla + eng + ENG + omacron + Omacron + + + itilde + Itilde + amacron + Amacron + kcedilla + Kcedilla + + + lcedilla + Lcedilla + iogonek + Iogonek + uogonek + Uogonek + + + emacron + Emacron + eabovedot + eabovedot + utilde + Utilde + + + gcedilla + Gcedilla + imacron + Imacron + umacron + Umacron + + + tslash + Tslash + ncedilla + Ncedilla + + + + + + + + + +Capitalization Rules for Cyrillic Keysyms + + +This table lists the Cyrillic keysyms for which XKB defines upper and lower +case: + + + + + + + + + + + + Lower Case + Upper Case + Lower Case + Upper Case + + + + + Serbian_dje + Serbian_DJE + Cyrillic_i + Cyrillic_I + + + Macedonia_gje + Macedonia_GJE + Cyrillic_shorti + Cyrillic_SHORTI + + + Cyrillic_io + Cyrillic_IO + Cyrillic_ka + Cyrillic_KA + + + Ukrainian_ie + Ukrainian_IE + Cyrillic_el + Cyrillic_EL + + + Macedonia_dse + Macedonia_DSE + Cyrillic_em + Cyrillic_EM + + + Ukrainian_i + Ukrainian_I + Cyrillic_en + Cyrillic_EN + + + Ukrainian_yi + Ukrainian_YI + Cyrillic_o + Cyrillic_O + + + Cyrillic_je + Cyrillic_JE + Cyrillic_pe + Cyrillic_PE + + + Cyrillic_lje + Cyrillic_LJE + Cyrillic_ya + Cyrillic_YA + + + Cyrillic_nje + Cyrillic_NJE + Cyrillic_er + Cyrillic_ER + + + Serbian_tshe + Serbian_TSHE + Cyrillic_es + Cyrillic_ES + + + Macedonia_kje + Macedonia_KJE + Cyrillic_te + Cyrillic_TE + + + Byelorussian_shortu + Byelorussian_SHORTU + Cyrillic_u + Cyrillic_U + + + Cyrillic_dzhe + Cyrillic_DZHE + Cyrillic_zhe + Cyrillic_ZHE + + + Cyrillic_yu + Cyrillic_YU + Cyrillic_ve + Cyrillic_VE + + + Cyrillic_a + Cyrillic_A + Cyrillic_softsign + Cyrillic_SOFTSIGN + + + Cyrillic_be + Cyrillic_BE + Cyrillic_yeru + Cyrillic_YERU + + + Cyrillic_tse + Cyrillic_TSE + Cyrillic_ze + Cyrillic_ZE + + + Cyrillic_de + Cyrillic_DE + Cyrillic_sha + Cyrillic_SHA + + + Cyrillic_ie + Cyrillic_IE + Cyrillic_e + Cyrillic_E + + + Cyrillic_ef + Cyrillic_EF + Cyrillic_shcha + Cyrillic_SHCHA + + + Cyrillic_ghe + Cyrillic_GHE + Cyrillic_che + Cyrillic_CHE + + + Cyrillic_ha + Cyrillic_HA + Cyrillic_hardsign + Cyrillic_HARDSIGN + + + + + + + +Capitalization Rules for Greek Keysyms + + +This table lists the Greek keysyms for which XKB defines upper and lower case: + + + + + + + + + + + + Lower Case + Upper Case + Lower Case + Upper Case + + + + + Greek_omegaaccent + Greek_OMEGAACCENT + Greek_iota + Greek_IOTA + + + Greek_alphaaccent + Greek_ALPHAACCENT + Greek_kappa + Greek_KAPPA + + + Greek_epsilonaccent + Greek_EPSILONACCENT + Greek_lamda + Greek_LAMDA + + + Greek_etaaccent + Greek_ETAACCENT + Greek_lambda + Greek_LAMBDA + + + Greek_iotaaccent + Greek_IOTAACCENT + Greek_mu + Greek_MU + + + Greek_iotadieresis + Greek_IOTADIERESIS + Greek_nu + Greek_NU + + + Greek_omicronaccent + Greek_OMICRONACCENT + Greek_xi + Greek_XI + + + Greek_upsilonaccent + Greek_UPSILONACCENT + Greek_omicron + Greek_OMICRON + + + Greek_upsilondieresis + Greek_UPSILONDIERESIS + Greek_pi + Greek_PI + + + Greek_alpha + Greek_ALPHA + Greek_rho + Greek_RHO + + + Greek_beta + Greek_BETA + Greek_sigma + Greek_SIGMA + + + Greek_gamma + Greek_GAMMA + Greek_tau + Greek_TAU + + + Greek_delta + Greek_DELTA + Greek_upsilon + Greek_UPSILON + + + Greek_epsilon + Greek_EPSILON + Greek_phi + Greek_PHI + + + Greek_zeta + Greek_ZETA + Greek_chi + Greek_CHI + + + Greek_eta + Greek_ETA + Greek_psi + Greek_PSI + + + Greek_theta + Greek_THETA + Greek_omega + Greek_OMEGA + + + + + + + +Capitalization Rules for Other Keysyms + + +XKB defines no capitalization rules for symbols in any other set of keysyms +provided by the consortium. Applications are free to apply additional rules for +private keysyms or for other keysyms not covered by XKB. + + + + + diff --git a/miniconda3/share/doc/kbproto/appB.xml b/miniconda3/share/doc/kbproto/appB.xml new file mode 100644 index 0000000000000000000000000000000000000000..85137cff4372b9eb9b4e274fcb5faafefd7f1e9e --- /dev/null +++ b/miniconda3/share/doc/kbproto/appB.xml @@ -0,0 +1,129 @@ + +Canonical Key Types + + +Canonical Key Types + +The ONE_LEVEL Key Type + + +The +ONE_LEVEL + key type describes groups that have only one symbol. The default +ONE_LEVEL + type has no map entries and does not pay attention to any modifiers. + + + + +The TWO_LEVEL Key Type + + +The +TWO_LEVEL + key type describes groups that have two symbols but are neither alphabetic nor +numeric keypad keys. The default +TWO_LEVEL + type uses only the +Shift + modifier. It returns level two if +Shift + is set, level one if it is not. + + + + + +The ALPHABETIC Key Type + + +The +ALPHABETIC + key type describes groups that consist of two symbols — the lowercase form +of a symbol followed by the uppercase form of the same symbol. The default + +ALPHABETIC + type implements locale-sensitive "shift cancels caps lock" behavior using both +the +Shift + and +Lock + modifiers as follows: + + + + + If +Shift + and +Lock + are both set, the default +ALPHABETIC + type yields level one. + + + + If +Shift + alone is set, it yields level two. + + + + If +Lock + alone is set, it yields level one but preserves the +Lock + modifier. + + + + If neither +Shift + nor +Lock + are set, it yields level one. + + + + + + +The KEYPAD Key Type + + +The +KEYPAD + key type describes that consist of two symbols, at least one of which is a +numeric keypad symbol. The default +KEYPAD + type implements "shift cancels numeric lock" behavior using the +Shift + modifier and the real modifier bound to the virtual modifier named "NumLock" +(the "NumLock" modifier) as follows: + + + + + If +Shift + and the "NumLock" modifier are both set, the default +KEYPAD +type yields level one. + + + + If either +Shift + or the "NumLock" modifier alone are set, it yields level two. + + + + If neither +Shift + nor the "NumLock" modifier are set, it yields level one. + + + + + + diff --git a/miniconda3/share/doc/kbproto/appC.xml b/miniconda3/share/doc/kbproto/appC.xml new file mode 100644 index 0000000000000000000000000000000000000000..6e47caea95e07c3efdd5d1461d68f0d302402b6d --- /dev/null +++ b/miniconda3/share/doc/kbproto/appC.xml @@ -0,0 +1,715 @@ + +New KeySyms + + +New KeySyms + +KeySyms Used by the ISO9995 Standard + + + + + + + + + + Byte 3 + Byte 4 + Character + Name + + + + + 254 + 1 + + ISO LOCK + + + 254 + 2 + + ISO LATCHING LEVEL TWO SHIFT + + + 254 + 3 + + ISO LEVEL THREE SHIFT + + + 254 + 4 + + ISO LATCHING LEVEL THREE SHIFT + + + 254 + 5 + + ISO LEVEL THREE SHIFT LOCK + + + 254 + 6 + + ISO LATCHING GROUP SHIFT + + + 254 + 7 + + ISO GROUP SHIFT LOCK + + + 254 + 8 + + ISO NEXT GROUP + + + 254 + 9 + + ISO LOCK NEXT GROUP + + + 254 + 10 + + ISO PREVIOUS GROUP + + + 254 + 11 + + ISO LOCK PREVIOUS GROUP + + + 254 + 12 + + ISO FIRST GROUP + + + 254 + 13 + + ISO LOCK FIRST GROUP + + + 254 + 14 + + ISO LAST GROUP + + + 254 + 15 + + ISO LOCK LAST GROUP + + + 254 + 32 + + LEFT TAB + + + 254 + 33 + + MOVE LINE UP + + + 254 + 34 + + MOVE LINE DOWN + + + 254 + 35 + + PARTIAL LINE UP + + + 254 + 36 + + PARTIAL LINE DOWN + + + 254 + 37 + + PARTIAL SPACE LEFT + + + 254 + 38 + + PARTIAL SPACE RIGHT + + + 254 + 39 + + SET MARGIN LEFT + + + 254 + 40 + + SET MARGIN RIGHT + + + 254 + 41 + + RELEASE MARGIN LEFT + + + 254 + 42 + + RELEASE MARGIN RIGHT + + + 254 + 43 + + RELEASE MARGIN LEFT AND RIGHT + + + 254 + 44 + + FAST CURSOR LEFT + + + 254 + 45 + + FAST CURSOR RIGHT + + + 254 + 46 + + FAST CURSOR UP + + + 254 + 47 + + FAST CURSOR DOWN + + + 254 + 48 + + CONTINUOUS UNDERLINE + + + 254 + 49 + + DISCONTINUOUS UNDERLINE + + + 254 + 50 + + EMPHASIZE + + + 254 + 51 + + CENTER OBJECT + + + 254 + 52 + + ISO_ENTER + + + + + + + +KeySyms Used to Control The Core Pointer + + + + + + + + + + Byte 3 + Byte 4 + Character + Name + + + + + 254 + 224 + + POINTER LEFT + + + 254 + 225 + + POINTER RIGHT + + + 254 + 226 + + POINTER UP + + + 254 + 227 + + POINTER DOWN + + + 254 + 228 + + POINTER UP AND LEFT + + + 254 + 229 + + POINTER UP AND RIGHT + + + 254 + 230 + + POINTER DOWN AND LEFT + + + 254 + 231 + + POINTER DOWN AND RIGHT + + + 254 + 232 + + DEFAULT POINTER BUTTON + + + 254 + 233 + + POINTER BUTTON ONE + + + 254 + 234 + + POINTER BUTTON TWO + + + 254 + 235 + + POINTER BUTTON THREE + + + 254 + 236 + + POINTER BUTTON FOUR + + + 254 + 237 + + POINTER BUTTON FIVE + + + 254 + 238 + + DEFAULT POINTER BUTTON DOUBLE CLICK + + + 254 + 239 + + POINTER BUTTON ONE DOUBLE CLICK + + + 254 + 240 + + POINTER BUTTON TWO DOUBLE CLICK + + + 254 + 241 + + POINTER BUTTON THREE DOUBLE CLICK + + + 254 + 242 + + POINTER BUTTON FOUR DOUBLE CLICK + + + 254 + 243 + + POINTER BUTTON FIVE DOUBLE CLICK + + + 254 + 244 + + DRAG DEFAULT POINTER BUTTON + + + 254 + 245 + + DRAG POINTER BUTTON ONE + + + 254 + 246 + + DRAG POINTER BUTTON TWO + + + 254 + 247 + + DRAG POINTER BUTTON THREE + + + 254 + 248 + + DRAG POINTER BUTTON FOUR + + + 254 + 249 + + ENABLE POINTER FROM KEYBOARD + + + 254 + 250 + + ENABLE KEYBOARD POINTER ACCEL + + + 254 + 251 + + SET DEFAULT POINTER BUTTON NEXT + + + 254 + 252 + + SET DEFAULT POINTER BUTTON PREVIOUS + + + 254 + 253 + + DRAG POINTER BUTTON FIVE + + + + + + + +KeySyms Used to Change Keyboard Controls + + + + + + + + + + Byte 3 + Byte 4 + Character + Name + + + + + 254 + 112 + + ENABLE ACCESSX KEYS + + + 254 + 113 + + ENABLE ACCESSX FEEDBACK + + + 254 + 114 + + TOGGLE REPEAT KEYS + + + 254 + 115 + + TOGGLE SLOW KEYS + + + 254 + 116 + + ENABLE BOUNCE KEYS + + + 254 + 117 + + ENABLE STICKY KEYS + + + 254 + 118 + + ENABLE MOUSE KEYS + + + 254 + 119 + + ENABLE MOUSE KEYS ACCELERATION + + + 254 + 120 + + ENABLE OVERLAY1 + + + 254 + 121 + + ENABLE OVERLAY2 + + + 254 + 122 + + ENABLE AUDIBLE BELL + + + + + + + +KeySyms Used To Control The Server + + + + + + + + + + Byte + Byte + Character + Name + + + + + 254 + 208 + + FIRST SCREEN + + + 254 + 209 + + PREVIOUS SCREEN + + + 254 + 210 + + NEXT SCREEN + + + 254 + 211 + + LAST SCREEN + + + 254 + 212 + + TERMINATE SERVER + + + + + + + +KeySyms for Non-Spacing Diacritical Keys + + + + + + + + + + Byte + Byte + Character + Name + + + + + 254 + 80 + + DEAD GRAVE ACCENT + + + 254 + 81 + + DEAD ACUTE ACCENT + + + 254 + 82 + + DEAD CIRCUMFLEX + + + 254 + 83 + + DEAD TILDE + + + 254 + 84 + + DEAD MACRON + + + 254 + 85 + + DEAD BREVE + + + 254 + 86 + + DEAD DOT ABOVE + + + 254 + 87 + + DEAD DIAERESIS + + + 254 + 88 + + DEAD RING ABOVE + + + 254 + 89 + + DEAD DOUBLE ACUTE ACCENT + + + 254 + 90 + + DEAD CARON + + + 254 + 91 + + DEAD CEDILLA + + + 254 + 92 + + DEAD OGONEK + + + 254 + 93 + + DEAD IOTA + + + 254 + 94 + + DEAD VOICED SOUND + + + 254 + 95 + + DEAD SEMI VOICED SOUND + + + 254 + 96 + + DEAD DOT BELOW + + + + + + + diff --git a/miniconda3/share/doc/kbproto/appD.xml b/miniconda3/share/doc/kbproto/appD.xml new file mode 100644 index 0000000000000000000000000000000000000000..147373b23e4e968c4602698cc72cf3893344a065 --- /dev/null +++ b/miniconda3/share/doc/kbproto/appD.xml @@ -0,0 +1,2096 @@ + +Protocol Encoding + + +Syntactic Conventions + + +This document uses the same syntactic conventions as the encoding of the core X +protocol, with the following additions: + + + +A LISTofITEMs contains zero or more items of variable type and size. The encode +form for a LISTofITEMs is: + + + +v LISTofITEMs NAME + + TYPE MASK-EXPRESSION + value1 corresponding field(s) + ... + valuen corresponding field(s) + + + +The MASK-EXPRESSION is an expression using C-style boolean operators and fields +of the request which specifies the bitmask used to determine whether or not a +member of the LISTofITEMs is present. If present, TYPE specifies the +interpretation of the resulting bitmask and the values are listed using the +symbolic names of the members of the set. If TYPE is blank, the values are +numeric constants. + + + + +It is possible for a single bit in the MASK-EXPRESSION to control more than one +ITEM — if the bit is set, all listed ITEMs are present. It is also possible +for multiple bits in the MASK-EXPRESSION to control a single ITEM — if any of +the bits associated with an ITEM are set, it is present in the LISTofITEMs. + + + + +The size of a LISTofITEMS is derived from the items that are present in the +list, so it is always given as a variable in the request description, and the +request is followed by a section of the form: + + + +ITEMs +encode-form +... +encode-form + + + +listing an encode-form for each ITEM. The NAME in each encode-form keys to the +fields listed as corresponding to each bit in the MASK-EXPRESSION. Items are +not necessarily the same size, and the size specified in the encoding form is +the size that the item occupies if it is present. + + + + +Some types are of variable size. The encode-form for a list of items of a +single type but variable size is: + + + +S0+..Ss LISTofTYPE name + + + +Which indicates that the list has +s + elements of variable size and that the size of the list is the sum of the +sizes of all of the elements that make up the list. The notation Sn refers to +the size of the +n +th element of the list and the notation S* refers to the size of the list as a +whole. + + + + +The definition of a type of variable size includes an expression which +specifies the size. The size is specified as a constant plus a variable +expression; the constant specifies the size of the fields that are always +present and the variables which make up the variable expression are defined in +the constant portion of the structure. For example, the following definition +specifies a counted string with a two-byte length field preceding the string: + + + + +TYPE 2+n+p +2 n length +n STRING8 string +p unused,p=pad(n) + + + +Some fields are optional. The size of an optional field has the form: +"[ +expr +]" where expr specifies the size of the field if it is present. An explanation +of the conditions under which the field is present follows the name in the +encode form: + + + +1 BOOL more +3 unused +[4] CARD32 optData, if more==TRUE + + + +This portion of the structure is four bytes long if more is FALSE or eight +bytes long if more is TRUE. This notation can also be used in size expressions; +for example, the size of the previous structure is written as "4+[4]" bytes. + + + + + +Common Types + +SETofKB_EVENTTYPE + #x0001 XkbNewKeyboardNotify + #x0002 XkbMapNotify + #x0004 XkbStateNotify + #x0008 XkbControlsNotify + #x0010 XkbIndicatorStateNotify + #x0020 XkbIndicatorMapNotify + #x0040 XkbNamesNotify + #x0080 XkbCompatMapNotify + #x0100 XkbBellNotify + #x0200 XkbActionMessage + #x0400 XkbAccessXNotify + #x0800 XkbExtensionDeviceNotify + + +SETofKB_NKNDETAIL + #x01 XkbNKN_Keycodes + #x02 XkbNKN_Geometry + #x04 XkbNKN_DeviceID + + +SETofKB_AXNDETAIL + #x01 XkbAXN_SKPress + #x02 XkbAXN_SKAccept + #x04 XkbAXN_SKReject + #x08 XkbAXN_SKRelease + #x10 XkbAXN_BKAccept + #x20 XkbAXN_BKReject + #x40 XkbAXN_AXKWarning + + +SETofKB_MAPPART + #x0001 XkbKeyTypes + #x0002 XkbKeySyms + #x0004 XkbModifierMap + #x0008 XkbExplicitComponents + #x0010 XkbKeyActions + #x0020 XkbKeyBehaviors + #x0040 XkbVirtualMods + #x0080 XkbVirtualModMap + + +SETofKB_STATEPART + #x0001 XkbModifierState + #x0002 XkbModifierBase + #x0004 XkbModifierLatch + #x0008 XkbModifierLock + #x0010 XkbGroupState + #x0020 XkbGroupBase + #x0040 XkbGroupLatch + #x0080 XkbGroupLock + #x0100 XkbCompatState + #x0200 XkbGrabMods + #x0400 XkbCompatGrabMods + #x0800 XkbLookupMods + #x1000 XkbCompatLookupMods + #x2000 XkbPointerButtons + + +SETofKB_BOOLCTRL + #x00000001 XkbRepeatKeys + #x00000002 XkbSlowKeys + #x00000004 XkbBounceKeys + #x00000008 XkbStickyKeys + #x00000010 XkbMouseKeys + #x00000020 XkbMouseKeysAccel + #x00000040 XkbAccessXKeys + #x00000080 XkbAccessXTimeoutMask + #x00000100 XkbAccessXFeedbackMask + #x00000200 XkbAudibleBellMask + #x00000400 XkbOverlay1Mask + #x00000800 XkbOverlay2Mask + #x00001000 XkbIgnoreGroupLockMask + + +SETofKB_CONTROL + Encodings are the same as for SETofKB_BOOLCTRL, with the addition of: + #x080000000 XkbGroupsWrap + #x100000000 XkbInternalMods + #x200000000 XkbIgnoreLockMods + #x400000000 XkbPerKeyRepeat + #x800000000 XkbControlsEnabled + + +SETofKB_AXFBOPT + #x0001 XkbAX_SKPressFB + #x0002 XkbAX_SKAcceptFB + #x0004 XkbAX_FeatureFB + #x0008 XkbAX_SlowWarnFB + #x0010 XkbAX_IndicatorFB + #x0020 XkbAX_StickyKeysFB + #x0100 XkbAX_SKReleaseFB + #x0200 XkbAX_SKRejectFB + #x0400 XkbAX_BKRejectFB + #x0800 XkbAX_DumbBell + + +SETofKB_AXSKOPT + #x0040 XkbAX_TwoKeys + #x0080 XkbAX_LatchToLock + + +SETofKB_AXOPTION + Encoding same as the bitwise union of : + SETofKB_AXFBOPT + SETofKB_AXSKOPT + + +KB_DEVICESPEC + 0..255 input extension device id + #x100 XkbUseCoreKbd + #x200 XkbUseCorePtr + + +KB_LEDCLASSRESULT + 0 KbdFeedbackClass + 4 LedFeedbackClass + + +KB_LEDCLASSSPEC + Encoding same as KB_LEDCLASSRESULT, with the addition of: + #x0300 XkbDfltXIClass + #x0500 XkbAllXIClasses + + +KB_BELLCLASSRESULT + 0 KbdFeedbackClass + 5 BellFeedbackClass + + +KB_BELLCLASSSPEC + Encoding same as KB_BELLCLASSRESULT, with the addition of: + #x0300 XkbDfltXIClass + + +KB_IDSPEC + 0..255 input extension feedback id + #x0400 XkbDfltXIId + + +KB_IDRESULT + Encoding same as KB_IDSPEC, with the addition of: + #xff00 XkbXINone + + +KB_MULTIIDSPEC + encodings same as KB_IDSPEC, with the addition of: + #x0500 XkbAllXIIds + + +KB_GROUP + 0 XkbGroup1 + 1 XkbGroup2 + 2 XkbGroup3 + 3 XkbGroup4 + + +KB_GROUPS + Encoding same as KB_GROUP, with the addition of: + 254 XkbAnyGroup + 255 XkbAllGroups + + +SETofKB_GROUP + #x01 XkbGroup1 + #x02 XkbGroup2 + #x04 XkbGroup3 + #x08 XkbGroup4 + + +SETofKB_GROUPS + Encoding same as SETofKB_GROUP, with the addition of: + #x80 XkbAnyGroup + + +KB_GROUPSWRAP + #x00 XkbWrapIntoRange + #x40 XkbClampIntoRange + #x80 XkbRedirectIntoRange + + +SETofKB_VMODSHIGH + #x80 virtual modifier 15 + #x40 virtual modifier 14 + #x20 virtual modifier 13 + #x10 virtual modifier 12 + #x08 virtual modifier 11 + #x04 virtual modifier 10 + #x02 virtual modifier 9 + #x01 virtual modifier 8 + + +SETofKB_VMODSLOW + #x80 virtual modifier 7 + #x40 virtual modifier 6 + #x20 virtual modifier 5 + #x10 virtual modifier 4 + #x08 virtual modifier 3 + #x04 virtual modifier 2 + #x02 virtual modifier 1 + #x01 virtual modifier 0 + + +SETofKB_VMOD + #x8000 virtual modifier 15 + #x4000 virtual modifier 14 + #x2000 virtual modifier 13 + #x1000 virtual modifier 12 + #x0800 virtual modifier 11 + #x0400 virtual modifier 10 + #x0200 virtual modifier 9 + #x0100 virtual modifier 8 + #x0080 virtual modifier 7 + #x0040 virtual modifier 6 + #x0020 virtual modifier 5 + #x0010 virtual modifier 4 + #x0008 virtual modifier 3 + #x0004 virtual modifier 2 + #x0002 virtual modifier 1 + #x0001 virtual modifier 0 + + +SETofKB_EXPLICIT + #x80 XkbExplicitVModMap + #x40 XkbExplicitBehavior + #x20 XkbExplicitAutoRepeat + #x10 XkbExplicitInterpret + #x08 XkbExplicitKeyType4 + #x04 XkbExplicitKeyType3 + #x02 XkbExplicitKeyType2 + #x01 XkbExplicitKeyType1 + + +KB_SYMINTERPMATCH + #x80 XkbSI_LevelOneOnly + #x7f operation, one of the following: + 0 XkbSI_NoneOf + 1 XkbSI_AnyOfOrNone + 2 XkbSI_AnyOf + 3 XkbSI_AllOf + 4 XkbSI_Exactly + + +SETofKB_IMFLAG + #x80 XkbIM_NoExplicit + #x40 XkbIM_NoAutomatic + #x20 XkbIM_LEDDrivesKB + + +SETofKB_IMMODSWHICH + #x10 XkbIM_UseCompat + #x08 XkbIM_UseEffective + #x04 XkbIM_UseLocked + #x02 XkbIM_UseLatched + #x01 XkbIM_UseBase + + +SETofKB_IMGROUPSWHICH + #x10 XkbIM_UseCompat + #x08 XkbIM_UseEffective + #x04 XkbIM_UseLocked + #x02 XkbIM_UseLatched + #x01 XkbIM_UseBase + + +KB_INDICATORMAP +1 SETofKB_IMFLAGS flags +1 SETofKB_IMGROUPSWHICH whichGroups +1 SETofKB_GROUP groups +1 SETofKB_IMMODSWHICH whichMods +1 SETofKEYMASK mods +1 SETofKEYMASK realMods +2 SETofKB_VMOD vmods +4 SETofKB_BOOLCTRL ctrls + + +SETofKB_CMDETAIL + #x01 XkbSymInterp + #x02 XkbGroupCompat + + +SETofKB_NAMEDETAIL + #x0001 XkbKeycodesName + #x0002 XkbGeometryName + #x0004 XkbSymbolsName + #x0008 XkbPhysSymbolsName + #x0010 XkbTypesName + #x0020 XkbCompatName + #x0040 XkbKeyTypeNames + #x0080 XkbKTLevelNames + #x0100 XkbIndicatorNames + #x0200 XkbKeyNames + #x0400 XkbKeyAliases + #x0800 XkbVirtualModNames + #x1000 XkbGroupNames + #x2000 XkbRGNames + + +SETofKB_GBNDETAIL + #x01 XkbGBN_Types + #x02 XkbGBN_CompatMap + #x04 XkbGBN_ClientSymbols + #x08 XkbGBN_ServerSymbols + #x10 XkbGBN_IndicatorMaps + #x20 XkbGBN_KeyNames + #x40 XkbGBN_Geometry + #x80 XkbGBN_OtherNames + + +SETofKB_XIEXTDEVFEATURE + #x02 XkbXI_ButtonActions + #x04 XkbXI_IndicatorNames + #x08 XkbXI_IndicatorMaps + #x10 XkbXI_IndicatorState + + +SETofKB_XIFEATURE + Encoding same as SETofKB_XIEXTDEVFEATURE, with the addition of: + #x01 XkbXI_Keyboards + + +SETofKB_XIDETAIL + Encoding same as SETofKB_XIFEATURE, with the addition of: + #x8000 XkbXI_UnsupportedFeature + + +SETofKB_PERCLIENTFLAG + #x01 XkbDetectableAutorepeat + #x02 XkbGrabsUseXKBState + #x04 XkbAutoResetControls + #x08 XkbLookupStateWhenGrabbed + #x10 XkbSendEventUsesXKBState + + +KB_MODDEF +1 SETofKEYMASK mask +1 SETofKEYMASK realMods +2 SETofVMOD vmods + + +KB_COUNTED_STRING8 +1 l length +l STRING8 string + + +KB_COUNTED_STRING16 +2 l length +l STRING8 string + + +KB_COUNTED_STRING16 +p unused,p=pad(2+l) + + + + +Errors + +1 0 Error +2 ?? code +2 CARD16 sequence +4 CARD32 error value + most significant 8 bits of error value have the meaning: + 0xff XkbErrBadDevice + 0xfe XkbErrBadClass + 0xfd XkbErrBadId + the least significant 8 bits of the error value contain the device id, +class, or feedback + id which failed. +2 CARD16 minor opcode +1 CARD8 major opcode +21 unused + + + + +Key Actions + +1 0 type +7 unused + + +1 1 type +1 BITMASK flags + #x01 XkbSA_ClearLocks + #x02 XkbSA_LatchToLock + #x04 XkbSA_UseModMapMods +1 SETofKEYMASK mask +1 SETofKEYMASK real modifiers +1 SETofKB_VMODSHIGH virtual modifiers high +1 SETofKB_VMODSLOW virtual modifiers low +2 unused + + +1 2 type +1 BITMASK flags + #x01 XkbSA_ClearLocks + #x02 XkbSA_LatchToLock + #x04 XkbSA_UseModMapMods +1 SETofKEYMASK mask +1 SETofKEYMASK real modifiers +1 SETofKB_VMODSHIGH virtual modifiers high +1 SETofKB_VMODSLOW virtual modifiers low +2 unused + + +1 3 type +1 BITMASK flags + #x01 XkbSA_LockNoLock + #x02 XkbSA_LockNoUnlock + #x04 XkbSA_UseModMapMods +1 SETofKEYMASK mask +1 SETofKEYMASK real modifiers +1 SETofKB_VMODSHIGH virtual modifiers high +1 SETofKB_VMODSLOW virtual modifiers low +2 unused + + +1 4 type +1 BITMASK flags + #x01 XkbSA_ClearLocks + #x02 XkbSA_LatchToLock + #x04 XkbSA_GroupAbsolute +1 INT8 group +5 unused + + +1 5 type +1 BITMASK flags + #x01 XkbSA_ClearLocks + #x02 XkbSA_LatchToLock + #x04 XkbSA_GroupAbsolute +1 INT8 group +5 unused + + +1 6 type +1 BITMASK flags + #x01 XkbSA_LockNoLock + #x02 XkbSA_LockNoUnlock + #x04 XkbSA_GroupAbsolute +1 INT8 group +5 unused + + +1 7 type +1 BITMASK flags + #x01 XkbSA_NoAcceleration + #x02 XkbSA_MoveAbsoluteX + #x04 XkbSA_MoveAbsoluteY +1 INT8 x high +1 CARD8 x low +1 INT8 y high +1 CARD8 y low +2 unused + + +1 8 type +1 BITMASK flags +1 CARD8 count +1 CARD8 button +4 unused + + +1 9 type +1 BITMASK flags +1 unused +1 CARD8 button +4 unused + + +1 10 type +1 BITMASK flags + #x04 XkbSA_DfltBtnAbsolute +1 BITMASK affect + #x01 XkbSA_AffectDfltBtn +1 INT8 value +4 unused + + +1 11 type +1 BITMASK flags + #x01 XkbSA_LockNoLock + #x02 XkbSA_LockNoUnlock + #x04 XkbSA_UseModMapMods (if SA_ISODfltIsGroup is 0) + #x04 XkbSA_GroupAbsolute (if SA_ISODfltIsGroup is 1) + #x80 XkbSA_ISODfltIsGroup +1 SETofKEYMASK mask +1 SETofKEYMASK real modifiers +1 INT8 group +1 BITMASK affect + #x08 XkbSA_ISONoAffectCtrls + #x10 XkbSA_ISONoAffectPtr + #x20 XkbSA_ISONoAffectGroup + #x40 XkbSA_ISONoAffectMods +1 SETofKB_VMODSHIGH virtual modifiers high +1 SETofKB_VMODSLOW virtual modifiers low + + +1 12 type +7 unused + + +1 13 type +1 BITMASK flags + #x01 XkbSA_SwitchApplication + #x04 XkbSA_SwitchAbsolute +1 INT8 new screen +5 unused (must be 0) + + +1 14 type +3 unused (must be 0) +1 BITMASK boolean controls high + #x01 XkbAccessXFeedbackMask + #x02 XkbAudibleBellMask + #x04 XkbOverlay1Mask + #x08 XkbOverlay2Mask + #x10 XkbIgnoreGroupLockMask +1 BITMASK boolean controls low + #x01 XkbRepeatKeys + #x02 XkbSlowKeys + #x04 XkbBounceKeys + #x08 XkbStickyKeys + #x10 XkbMouseKeys + #x20 XkbMouseKeysAccel + #x40 XkbAccessXKeys + #x80 XkbAccessXTimeoutMask +2 unused (must be 0) + + +1 15 type +3 unused (must be 0) +1 BITMASK boolean controls high + #x01 XkbAccessXFeedbackMask + #x02 XkbAudibleBellMask + #x04 XkbOverlay1Mask + #x08 XkbOverlay2Mask + #x10 XkbIgnoreGroupLockMask +1 BITMASK boolean controls low + #x01 XkbRepeatKeys + #x02 XkbSlowKeys + #x04 XkbBounceKeys + #x08 XkbStickyKeys + #x10 XkbMouseKeys + #x20 XkbMouseKeysAccel + #x40 XkbAccessXKeys + #x80 XkbAccessXTimeoutMask + + +1 16 type +2 unused (must be 0) + + +1 16 type +1 BITMASK flags + #x01 XkbSA_MessageOnPress + #x02 XkbSA_MessageOnRelease + #x04 XkbSA_MessageGenKeyEvent +6 STRING message + + +1 17 type +1 KEYCODE new key +1 SETofKEYMASK mask +1 SETofKEYMASK real modifiers +1 SETofKB_VMODSHIGH virtual modifiers mask high +1 SETofKB_VMODSLOW virtual modifiers mask low +1 SETofKB_VMODSHIGH virtual modifiers high +1 SETofKB_VMODSLOW virtual modifiers low + + +1 18 type +1 0 flags +1 CARD8 count +1 CARD8 button +1 CARD8 device +3 unused (must be 0) + + +1 19 type +1 BITMASK flags + #x01 XkbSA_LockNoLock + #x02 XkbSA_LockNoUnlock +1 unused +1 CARD8 button +1 CARD8 device + + +1 20 type +1 CARD8 device +1 KB_SA_VALWHAT valuator 1 what + #x00 XkbSA_IgnoreVal + #x01 XkbSA_SetValMin + #x02 XkbSA_SetValCenter + #x03 XkbSA_SetValMax + #x04 XkbSA_SetValRelative + #x05 XkbSA_SetValAbsolute +1 CARD8 valuator 1 index +1 CARD8 valuator 1 value +1 KB_SA_VALWHAT valuator 2 what + Encodings as for "valuator 1 what" above +1 CARD8 valuator 2 index +1 CARD8 valuator 2 value + + + + +Key Behaviors + +1 #x00 type +1 unused + + +1 #x01 type +1 unused + + +1 #x02 type +1 0..31 group + + +1 #x03 type +1 KEYCODE key + + +1 #x04 type +1 CARD8 key + + +1 #x81 type +1 unused + + +1 #x82 type +1 0..31 group + + +1 #x83 type +1 KEYCODE key + + +1 #x84 type +1 KEYCODE key + + + + +Requests + +1 ?? opcode +1 0 xkb-opcode +2 2 request-length +2 CARD16 wantedMajor +2 CARD16 wantedMinor + + +1 1 Reply +1 BOOL supported +2 CARD16 sequence number +4 0 reply length +2 1 serverMajor +2 0 serverMinor +20 unused + + + +1 ?? opcode +1 1 xkb-opcode +2 4+(V+p)/4 request-length +2 KB_DEVICESPEC deviceSpec +2 SETofKB_EVENTTYPE affectWhich +2 SETofKB_EVENTTYPE clear +2 SETofKB_EVENTTYPE selectAll +2 SETofKB_MAPDETAILS affectMap +2 SETofKB_MAPDETAILS map +V LISTofITEMs details + SETofKB_EVENTTYPE +(affectWhich&(~clear)&(~selectAll)) + XkbNewKeyboardNotify affectNewKeyboard, newKeyboardDetails + XkbStateNotify affectState, stateDetails + XkbControlsNotify affectCtrls, ctrlDetails + XkbIndicatorStateNotify affectIndicatorState, indicatorStateDetails + XkbIndicatorMapNotify affectIndicatorMap, indicatorMapDetails + XkbNamesNotify affectNames, namesDetails + XkbCompatMapNotify affectCompat, compatDetails + XkbBellNotify affectBell, bellDetails + XkbActionMessage affectMsgDetails, msgDetails + XkbExtensionDeviceNotify affectExtDev, extdevDetails + + +ITEMs +p unused, p=pad(V) + + +ITEMs +2 SETofKB_NKNDETAIL affectNewKeyboard +2 SETofKB_NKNDETAIL newKeyboardDetails +2 SETofKB_STATEPART affectState +2 SETofKB_STATEPART stateDetails +4 SETofKB_CONTROL affectCtrls +4 SETofKB_CONTROL ctrlDetails +4 SETofKB_INDICATOR affectIndicatorState +4 SETofKB_INDICATOR indicatorStateDetails +4 SETofKB_INDICATOR affectIndicatorMaps +4 SETofKB_INDICATOR indicatorMapDetails +2 SETofKB_NAME_DETAIL affectNames +2 SETofKB_NAME_DETAIL namesDetails +1 SETofKB_CMDETAIL affectCompat +1 SETofKB_CMDETAIL compatDetails +1 SETofKB_BELLDETAIL affectBell +1 SETofKB_BELLDETAIL bellDetails +1 SETofKB_MSGDETAIL affectMsgDetails +1 SETofKB_MSGDETAIL msgDetails +2 SETofKB_AXNDETAIL affectAccessX +2 SETofKB_AXNDETAIL accessXDetails +2 SETofKB_XIDETAIL affectExtDev +2 SETofKB_XIDETAIL extdevDetails + + + +1 ?? opcode +1 3 xkb-opcode +2 7 request-length +2 KB_DEVICESPEC deviceSpec +2 KB_BELLCLASSSPEC bellClass +2 KB_IDSPEC bellID +1 INT8 percent +1 BOOL forceSound +1 BOOL eventOnly +1 unused +2 INT16 pitch +2 INT16 duration +2 unused +4 ATOM name +4 WINDOW window + + +1 ?? opcode +1 4 xkb-opcode +2 2 request-length +2 KB_DEVICESPEC deviceSpec +2 unused + + +1 1 Reply +1 CARD8 deviceID +2 CARD16 sequence number +4 0 length +1 SETofKEYMASK mods +1 SETofKEYMASK baseMods +1 SETofKEYMASK latchedMods +1 SETofKEYMASK lockedMods +1 KP_GROUP group +1 KP_GROUP lockedGroup +2 INT16 baseGroup +2 INT16 latchedGroup +1 SETofKEYMASK compatState +1 SETofKEYMASK grabMods +1 SETofKEYMASK compatGrabMods +1 SETofKEYMASK lookupMods +1 SETofKEYMASK compatLookupMods +1 unused +2 SETofBUTMASK ptrBtnState +6 unused + + + +1 ?? opcode +1 5 xkb-opcode +2 4 request-length +2 KB_DEVICESPEC deviceSpec +1 SETofKEYMASK affectModLocks +1 SETofKEYMASK modLocks +1 BOOL lockGroup +1 KB_GROUP groupLock +1 SETofKEYMASK affectModLatches +1 SETofKEYMASK modLatches +1 unused +1 BOOL latchGroup +2 INT16 groupLatch + + +1 ?? opcode +1 6 xkb-opcode +2 2 request-length +2 KB_DEVICESPEC deviceSpec +2 unused + + +1 1 Reply +1 CARD8 deviceID +2 CARD16 sequence number +4 15 length +1 CARD8 mouseKeysDfltBtn +1 CARD8 numGroups +1 CARD8 groupsWrap +1 SETofKEYMASK internalMods.mask +1 SETofKEYMASK ignoreLockMods.mask +1 SETofKEYMASK internalMods.realMods +1 SETofKEYMASK ignoreLockMods.realMods +1 unused +2 SETofKB_VMOD internalMods.vmods +2 SETofKB_VMOD ignoreLockMods.vmods +2 CARD16 repeatDelay +2 CARD16 repeatInterval +2 CARD16 slowKeysDelay +2 CARD16 debounceDelay +2 CARD16 mouseKeysDelay +2 CARD16 mouseKeysInterval +2 CARD16 mouseKeysTimeToMax +2 CARD16 mouseKeysMaxSpeed +2 INT16 mouseKeysCurve +2 SETofKB_AXOPTION accessXOptions +2 CARD16 accessXTimeout +2 SETofKB_AXOPTION accessXTimeoutOptionsMask +2 SETofKB_AXOPTION accessXTimeoutOptionValues +2 unused +4 SETofKB_BOOLCTRL accessXTimeoutMask +4 SETofKB_BOOLCTRL accessXTimeoutValues +4 SETofKB_BOOLCTRL enabledControls +32 LISTofCARD8 perKeyRepeat + + + +1 ?? opcode +1 7 xkb-opcode +2 25 request-length +2 KB_DEVICESPEC deviceSpec +1 SETofKEYMASK affectInternalRealMods +1 SETofKEYMASK internalRealMods +1 SETofKEYMASK affectIgnoreLockRealMods +1 SETofKEYMASK ignoreLockRealMods +2 SETofKB_VMOD affectInternalVirtualMods +2 SETofKB_VMOD internalVirtualMods +2 SETofKB_VMOD affectIgnoreLockVirtualMods +2 SETofKB_VMOD ignoreLockVirtualMods +1 CARD8 mouseKeysDfltBtn +1 CARD8 groupsWrap +2 SETofKB_AXOPTION accessXOptions +2 unused +4 SETofKB_BOOLCTRL affectEnabledControls +4 SETofKB_BOOLCTRL enabledControls +4 SETofKB_CONTROL changeControls +2 CARD16 repeatDelay +2 CARD16 repeatInterval +2 CARD16 slowKeysDelay +2 CARD16 debounceDelay +2 CARD16 mouseKeysDelay +2 CARD16 mouseKeysInterval +2 CARD16 mouseKeysTimeToMax +2 CARD16 mouseKeysMaxSpeed +2 INT16 mouseKeysCurve +2 CARD16 accessXTimeout +4 SETofKB_BOOLCTRL accessXTimeoutMask +4 SETofKB_BOOLCTRL accessXTimeoutValues +2 SETofKB_AXOPTION accessXTimeoutOptionsMask +2 SETofKB_AXOPTION accessXTimeoutOptionsValues +32 LISTofCARD8 perKeyRepeat + + +1 CARD8 opcode +1 8 xkb-opcode +2 7 request-length +2 KB_DEVICESPEC deviceSpec +2 SETofKB_MAPPART full +2 SETofKB_MAPPART partial +1 CARD8 firstType +1 CARD8 nTypes +1 KEYCODE firstKeySym +1 CARD8 nKeySyms +1 KEYCODE firstKeyAction +1 CARD8 nKeyActions +1 KEYCODE firstKeyBehavior +1 CARD8 nKeyBehaviors +2 SETofKB_VMOD virtualMods +1 KEYCODE firstKeyExplicit +1 CARD8 nKeyExplicit +1 KEYCODE firstModMapKey +1 CARD8 nModMapKeys +1 KEYCODE firstVModMapKey +1 CARD8 nVModMapKeys +2 unused + + +1 1 Reply +1 CARD8 deviceID +2 CARD16 sequence number +4 2+(I/4) length +2 unused +1 KEYCODE minKeyCode +1 KEYCODE maxKeyCode +2 SETofKB_MAPPART present +1 CARD8 firstType +1 t nTypes +1 CARD8 totalTypes +1 KEYCODE firstKeySym +2 S totalSyms +1 s nKeySyms +1 KEYCODE firstKeyAction +2 A totalActions +1 a nKeyActions +1 KEYCODE firstKeyBehavior +1 b nKeyBehaviors +1 B totalKeyBehaviors +1 KEYCODE firstKeyExplicit +1 e nKeyExplicit +1 E totalKeyExplicit +1 KEYCODE firstModMapKey +1 m nModMapKeys +1 M totalModMapKeys +1 KEYCODE firstVModMapKey +1 0 nVModMapKeys +1 V totalVModMapKeys +1 unused +2 SETofKB_VMOD virtualMods (has v bits set to 1) +I LISTofITEMs map + SETofKB_MAPPART (present) + XkbKeyTypes typesRtrn + XkbKeySyms symsRtrn + XkbKeyActions actsRtrn.count, actsRtrn.acts + XkbKeyBehaviors behaviorsRtrn + XkbVirtualMods vmodsRtrn + XkbExplicitComponents explicitRtrn + XkbModifierMap modmapRtrn + XkbVirtualModMap vmodMapRtrn + + +ITEMs +T1+..Tt LISTofKB_KEYTYPE typesRtrn +8s+4S LISTofKB_KEYSYMMAP symsRtrn +a LISTofCARD8 actsRtrn.count +p unused,p=pad(a) +8A LISTofKB_ACTION actsRtrn.acts +4B LISTofKB_SETBEHAVIOR behaviorsRtrn +v LISTofSETofKEYMASK vmodsRtrn +p unused, p=pad(v) +2E LISTofKB_SETEXPLICIT explicitRtrn +p unused,p=pad(2E) +2M LISTofKB_KEYMODMAP modmapRtrn +p unused, p=pad(2M) +4V LISTofKB_KEYVMODMAP vmodMapRtrn + + +KB_KEYTYPE 8+8m+[4m] +1 SETofKEYMASK mods.mask +1 SETofKEYMASK mods.mods +2 SETofKB_VMOD mods.vmods +1 CARD8 numLevels +1 m nMapEntries +1 BOOL hasPreserve +1 unused +8m LISTofKB_KTMAPENTRY map +[4m] LISTofKB_MODDEF preserve + + +KB_KTMAPENTRY +1 BOOL active +1 SETofKEYMASK mods.mask +1 CARD8 level +1 SETofKEYMASK mods.mods +2 SETofKB_VMOD mods.vmods +2 unused + + +KB_KEYSYMMAP 8+4n +4 LISTofCARD8 ktIndex +1 CARD8 groupInfo +1 CARD8 width +2 n nSyms +4n LISTofKEYSYM syms + + +KB_SETBEHAVIOR +1 KEYCODE keycode +2 KB_BEHAVIOR behavior +1 unused + + +KB_SETEXPLICIT +1 KEYCODE keycode +1 SETofKB_EXPLICIT explicit + + +KB_KEYMODMAP +1 KEYCODE keycode +1 SETofKB_KEYMASK mods + + +KB_KEYVMODMAP +1 KEYCODE keycode +1 unused +2 SETofKB_VMOD vmods + + + +1 CARD8 opcode +1 9 xkb-opcode +2 9+(I/4) request-length +2 KB_DEVICESPEC deviceSpec +2 SETofKB_MAPPART present +2 SETofKB_SETMAPFLAGS flags + #0001 SetMapResizeTypes + #0002 SetMapRecomputeActions +1 KEYCODE minKeyCode +1 KEYCODE maxKeyCode +1 CARD8 firstType +1 t nTypes +1 KEYCODE firstKeySym +1 s nKeySyms +2 S totalSyms +1 KEYCODE firstKeyAction +1 a nKeyActions +2 A totalActions +1 KEYCODE firstKeyBehavior +1 b nKeyBehaviors +1 B totalKeyBehaviors +1 KEYCODE firstKeyExplicit +1 e nKeyExplicit +1 E totalKeyExplicit +1 KEYCODE firstModMapKey +1 m nModMapKeys +1 M totalModMapKeys +1 KEYCODE firstVModMapKey +1 v nVModMapKeys +1 V totalVModMapKeys +2 SETofKB_VMOD virtualMods (has n bits set to 1) +I LISTofITEMs values + SETofKB_MAPPART (present) + XkbKeyTypes types + XkbKeySymbols syms + XkbKeyActions actions.count,actions.actions + XkbKeyBehaviors behaviors + XkbVirtualMods vmods + XkbExplicitComponents explicit + XkbModifierMap modmap + XkbVirtualModMap vmodmap + + +ITEMs +T0+..Tt LISTofKB_SETKEYTYPE types +8s+4S LISTofKB_KEYSYMMAP syms +a LISTofCARD8 actions.count +p unused,p=pad(a) +8A LISTofKB_ACTION actions.actions +4B LISTofKB_SETBEHAVIOR behaviors +v LISTofSETofKEYMASK vmods +p unused, p=pad(v) +2E LISTofKB_SETEXPLICIT explicit +p unused,p=pad(2E) +2M LISTofKB_KEYMODMAP modmap +P unused, p=pad(2M) +4V LISTofKB_KEYVMODMAP vmodmap + + +KB_SETKEYTYPE 8+4m+[4m] +1 SETofKEYMASK mask +1 SETofKEYMASK realMods +2 SETofKB_VMOD virtualMods +1 CARD8 numLevels +1 m nMapEntries +1 BOOL preserve +1 unused +4m LISTofKB_KTSETMAPENTRY entries +[4m] LISTofKB_MODDEF preserveEntries (if preserve==TRUE) + + +KB_KTSETMAPENTRY +1 CARD8 level +1 SETofKEYMASK realMods +2 SETofKB_VMOD virtualMods + + + +1 ?? opcode +1 10 xkb-opcode +2 3 request-length +2 KB_DEVICESPEC deviceSpec +1 SETofKB_GROUP groups +1 BOOL getAllSI +2 CARD16 firstSI +2 CARD16 nSI + + +1 1 Reply +1 CARD8 deviceID +2 CARD16 sequence number +4 (16n+4g)/4 length +1 SETofKB_GROUP groupsRtrn (has g bits set to 1) +1 unused +2 CARD16 firstSIRtrn +2 n nSIRtrn +2 CARD16 nTotalSI +16 unused +16n LISTofKB_SYMINTERPRET siRtrn +4g LISTofKB_MODDEF groupRtrn + + + +1 ?? opcode +1 11 xkb-opcode +2 4+(16n+4g) request-length +2 KB_DEVICESPEC deviceSpec +1 unused +1 BOOL recomputeActions +1 BOOL truncateSI +1 SETofKB_GROUP groups (has g bits set to 1) +2 CARD16 firstSI +2 n nSI +2 unused +16n LISTofKB_SYMINTERPRET si +4g LISTofKB_MODDEF groupMaps + + +1 ?? opcode +1 12 xkb-opcode +2 2 request-length +2 KB_DEVICESPEC deviceSpec + + +ITEMs +2 unused + + +1 1 Reply +1 CARD8 deviceID +2 CARD16 sequence number +4 0 length +4 SETofKB_INDICATOR state +20 unused + + + +1 ?? opcode +1 13 xkb-opcode +2 3 request-length +2 KB_DEVICESPEC deviceSpec +2 unused +4 SETofKB_INDICATOR which + + +1 1 Reply +1 CARD8 deviceID +2 CARD16 sequence number +4 12n/4 length +4 SETofKB_INDICATOR which (has n bits set to 1) +4 SETofKB_INDICATOR realIndicators +1 n nIndicators +15 unused +12n LISTofKB_INDICATORMAP maps + + + +1 ?? opcode +1 14 xkb-opcode +2 3+3n request-length +2 KB_DEVICESPEC deviceSpec +2 unused +4 SETofKB_INDICATOR which (has n bits set to 1) +12n LISTofKB_INDICATORMAP maps + + +1 CARD8 opcode +1 15 xkb-opcode +2 4 request-length +2 KB_DEVICESPEC deviceSpec +2 KB_LEDCLASSSPEC ledClass +2 KB_IDSPEC ledID +2 unused +4 ATOM indicator + + +1 1 Reply +1 CARD8 deviceID +2 CARD16 sequence number +4 0 length +4 ATOM indicator +1 BOOL found +1 BOOL on +1 BOOL realIndicator +1 KB_INDICATOR ndx +1 SETofKB_IMFLAGS map.flags +1 SETofKB_IMGROUPSWHICH map.whichGroups +1 SETofKB_GROUPS map.groups +1 SETofKB_IMMODSWHICH map.whichMods +1 SETofKEYMASK map.mods +1 SETofKEYMASK map.realMods +2 SETofKB_VMOD map.vmods +4 SETofKB_BOOLCTRL map.ctrls +1 BOOL supported +3 unused + + + +1 ?? opcode +1 16 xkb-opcode +2 8 request-length +2 KB_DEVICESPEC deviceSpec +2 KB_LEDCLASSSPEC ledClass +2 KB_IDSPEC ledID +2 unused +4 ATOM indicator +1 BOOL setState +1 BOOL on +1 BOOL setMap +1 BOOL createMap +1 unused +1 SETofKB_IMFLAGS map.flags +1 SETofKB_IMGROUPSWHICH map.whichGroups +1 SETofKB_GROUP map.groups +1 SETofKB_IMMODSWHICH map.whichMods +1 SETofKEYMASK map.realMods +2 SETofKB_VMOD map.vmods +4 SETofKB_BOOLCTRL map.ctrls + + +1 CARD8 opcode +1 17 xkb-opcode +2 3 request-length +2 KB_DEVICESPEC deviceSpec +2 unused +4 SETofKB_NAMEDETAIL which + + +1 1 Reply +1 CARD8 deviceID +2 CARD16 sequence number +4 V/4 length +4 SETofKB_NAMEDETAIL which +1 KEYCODE minKeyCode +1 KEYCODE maxKeyCode +1 t nTypes +1 SETofKB_GROUP groupNames (has g bits set to 1) +2 SETofKB_VMOD virtualMods (has v bits set to 1) +1 KEYCODE firstKey +1 k nKeys +4 SETofKB_INDICATOR indicators (has i bits set to 1) +1 r nRadioGroups +1 a nKeyAliases +2 l nKTLevels +4 unused +V LISTofITEMs valueList + SETofKB_NAMEDETAIL (which) + XkbKeycodesName keycodesName + XkbGeometryName geometryName + XkbSymbolsName symbolsName + XkbPhySymbolsName physSymbolsName + XkbTypesName typesName + XkbCompatName compatName + XkbKeyTypeNames typeNames + XkbKTLevelNames nLevelsPerType, ktLevelNames + XkbIndicatorNames indicatorNames + XkbVirtualModNames virtualModNames + XkbGroupNames groupNames + XkbKeyNames keyNames + XkbKeyAliases keyAliases + XkbRGNames radioGroupNames + + +ITEMs +4 ATOM keycodesName +4 ATOM geometryName +4 ATOM symbolsName +4 ATOM physSymbolsName +4 ATOM typesName +4 ATOM compatName +4t LISTofATOM typeNames +l LISTofCARD8 nLevelsPerType, sum of all elements=L +p unused, p=pad(l) +4L LISTofATOM ktLevelNames +4i LISTofATOM indicatorNames +4v LISTofATOM virtualModNames +4g LISTofATOM groupNames +4k LISTofKB_KEYNAME keyNames +8a LISTofKB_KEYALIAS keyAliases +4r LISTofATOM radioGroupNames + + + +1 CARD8 opcode +1 18 xkb-opcode +2 7+(V/4) request-length +2 KB_DEVICESPEC deviceSpec +2 SETofKB_VMOD virtualMods +4 SETofKB_NAMEDETAIL which +1 CARD8 firstType +1 t nTypes +1 CARD8 firstKTLevel +1 l nKTLevels +4 SETofKB_INDICATOR indicators (has i bits set to 1) +1 SETofKB_GROUP groupNames (has g bits set to 1) +1 r nRadioGroups +1 KEYCODE firstKey +1 k nKeys +1 a nKeyAliases +1 unused +2 L totalKTLevelNames +V LISTofITEMs values + SETofKB_NAMEDETAIL (which) + XkbKeycodesName keycodesName + XkbGeometryName geometryName + XkbSymbolsName symbolsName + XkbPhySymbolsName physSymbolsName + XkbTypesName typesName + XkbCompatName compatName + XkbKeyTypeNames typeNames + XkbKTLevelNames nLevelsPerType, ktLevelNames + XkbIndicatorNames indicatorNames + XkbVirtualModNames virtualModNames + XkbGroupNames groupNames + XkbKeyNames keyNames + XkbKeyAliases keyAliases + XkbRGNames radioGroupNames + + +ITEMs +4 ATOM keycodesName +4 ATOM geometryName +4 ATOM symbolsName +4 ATOM physSymbolsName +4 ATOM typesName +4 ATOM compatName +4t LISTofATOM typeNames +l LISTofCARD8 nLevelsPerType +p unused, p=pad(l) +4L LISTofATOM ktLevelNames +4i LISTofATOM indicatorNames +4v LISTofATOM virtualModNames +4g LISTofATOM groupNames +4k LISTofKB_KEYNAME keyNames +8a LISTofKB_KEYALIAS keyAliases +4r LISTofATOM radioGroupNames + + + +1 CARD8 opcode +1 19 xkb-opcode +2 3 request-length +2 KB_DEVICESPEC deviceSpec +2 unused +4 ATOM name + + +1 1 Reply +1 CARD8 deviceID +2 CARD16 sequence number +4 (f+8p+C*+H*+S*+D*+A*)/4 length +4 ATOM name +1 BOOL found +1 unused +2 CARD16 widthMM +2 CARD16 heightMM +2 p nProperties +2 c nColors +2 h nShapes +2 s nSections +2 d nDoodads +2 a nKeyAliases +1 CARD8 baseColorNdx +1 CARD8 labelColorNdx +f KB_COUNTED_STRING16 labelFont +8p LISTofKB_PROPERTY properties +C0+..Cc LISTofKB_COUNTED_STRING16 colors +H0+..Hh LISTofKB_SHAPE shapes +S0+..Ss LISTofKB_SECTION sections +D0+..Dd LISTofKB_DOODAD doodads +A0+..Aa LISTofKB_KEYALIAS keyAliases + + +KB_PROPERTY 4+n+v +2 n nameLength +n STRING8 name +2 v valueLength +v STRING8 value + + +KB_SHAPE 8+O* +4 ATOM name +1 o nOutlines +1 CARD8 primaryNdx +1 CARD8 approxNdx +1 unused +O0+..Oo LISTofKB_OUTLINE outlines + + +KB_OUTLINE 4+4p +1 p nPoints +1 CARD8 cornerRadius +2 unused +4p LISTofKB_POINT points + + +KB_POINT +2 INT16 x +2 INT16 y + + +KB_SECTION 20+R*+D*+O* +4 ATOM name +2 INT16 top +2 INT16 left +2 CARD16 width +2 CARD16 height +2 INT16 angle +1 CARD8 priority +1 r nRows +1 d nDoodads +1 o nOverlays +2 unused +R0+..Rr LISTofKB_ROW rows +D0+..Dd LISTofKB_DOODAD doodads +O0+..Oo LISTofKB_OVERLAY overlays + + +KB_ROW 8+8k +2 INT16 top +2 INT16 left +1 k nKeys +1 BOOL vertical +2 unused +8k LISTofKB_KEY keys + + +KB_KEY +4 STRING8 name +2 INT16 gap +1 CARD8 shapeNdx +1 CARD8 colorNdx + + +KB_OVERLAY 8+R* +4 ATOM name +1 r nRows +3 unused +R0+..Rr LISTofKB_OVERLAYROW rows + + +KB_OVERLAYROW 4+8k +1 CARD8 rowUnder +1 k nKeys +2 unused +8k LISTofKB_OVERLAYKEY keys + + +KB_OVERLAYKEY +4 STRING8 over +4 STRING8 under + + +KB_SHAPEDOODAD +4 ATOM name +1 CARD8 type + + +KB_SHAPEDOODAD + #1 XkbOutlineDoodad + #2 XkbSolidDoodad +1 CARD8 priority +2 INT16 top +2 INT16 left +2 INT16 angle +1 CARD8 colorNdx +1 CARD8 shapeNdx +6 unused + + +KB_TEXTDOODAD 20+t+f +4 ATOM name +1 CARD8 type + #3 XkbTextDoodad +1 CARD8 priority +2 INT16 top +2 INT16 left +2 INT16 angle +2 CARD16 width +2 CARD16 height +1 CARD8 colorNdx +3 unused +t KB_COUNTED_STRING16 text +f KB_COUNTED_STRING16 font + + +KB_INDICATORDOODAD +4 ATOM name +1 CARD8 type + #4 XkbIndicatorDoodad +1 CARD8 priority +2 INT16 top +2 INT16 left +2 INT16 angle +1 CARD8 shapeNdx +1 CARD8 onColorNdx +1 CARD8 offColorNdx +5 unused + + +KB_LOGODOODAD 20+n +4 ATOM name +1 CARD8 type + #5 XkbLogoDoodad +1 CARD8 priority +2 INT16 top +2 INT16 left +2 INT16 angle +1 CARD8 colorNdx +1 CARD8 shapeNdx +6 unused +n KB_COUNTED_STRING16 logoName + + +KB_DOODAD: + KB_SHAPEDOODAD, or KB_TEXTDOODAD, or + KB_INDICATORDOODAD, or KB_LOGODOODAD + + + +1 CARD8 opcode +1 20 xkb-opcode +2 7+(f+8p+C*+H*+S*+D*+A*)/4 request-length +2 KB_DEVICESPEC deviceSpec +1 h nShapes +1 s nSections +4 ATOM name +2 CARD16 widthMM +2 CARD16 heightMM +2 p nProperties +2 c nColors +2 d nDoodads +2 a nKeyAliases +1 CARD8 baseColorNdx +1 CARD8 labelColorNdx +2 unused +f KB_COUNTED_STRING16 labelFont +8p LISTofKB_PROPERTY properties +C0+..Cc LISTofKB_COUNTED_STRING16 colors +H0+..Hh LISTofKB_SHAPE shapes +S0+..Ss LISTofKB_SECTION sections +D0+..Dd LISTofKB_DOODAD doodads +A0+..Aa LISTofKB_KEYALIAS keyAliases + + +1 CARD8 opcode +1 21 xkb-opcode +2 7 request-length +2 KB_DEVICESPEC deviceSpec +2 unused +4 SETofKB_PERCLIENTFLAG change +4 SETofKB_PERCLIENTFLAG value +4 SETofKB_BOOLCTRL ctrlsToChange +4 SETofKB_BOOLCTRL autoCtrls +4 SETofKB_BOOLCTRL autoCtrlValues + + +1 1 Reply +1 CARD8 deviceID +2 CARD16 sequence number +4 0 length +4 SETofKB_PERCLIENTFLAG supported +4 SETofKB_PERCLIENTFLAG value +4 SETofKB_BOOLCTRL autoCtrls +4 SETofKB_BOOLCTRL autoCtrlValues +8 unused + + + +1 CARD8 opcode +1 22 xkb-opcode +2 2+(6+m+k+t+c+s+g+p)/4 request-length +2 KB_DEVICESPEC deviceSpec +2 CARD16 maxNames +1 m keymapsSpecLen +m STRING keymapsSpec +1 k keycodesSpecLen +k STRING keycodesSpec +1 t typesSpecLen +t STRING typesSpec +1 c compatMapSpecLen +c STRING compatMapSpec +1 s symbolsSpecLen +s STRING symbolsSpec +1 g geometrySpecLen +g STRING geometrySpec +p unused,p=pad(6+m+k+t+c+s+g) + + +1 1 Reply +1 CARD8 deviceID +2 CARD16 sequence number +4 (M*+K*+T*+C*+S*+G*+p)/4 length +2 m nKeymaps +2 k nKeycodes +2 t nTypes +2 c nCompatMaps +2 s nSymbols +2 g nGeometries +2 CARD16 extra +10 unused +M0+..Mm LISTofKB_LISTING keymaps +K0+..Kk LISTofKB_LISTING keycodes +T0+..Tt LISTofKB_LISTING types +C0+..Cc LISTofKB_LISTING compatMaps +S0+..Ss LISTofKB_LISTING symbols +G0+..Gg LISTofKB_LISTING geometries +p unused,p=pad(M*+K*+T*+C*+S*+G*) + + +KB_LISTING 4+n+p +2 CARD16 flags +2 n length +n STRING8 string +p unused,p=pad(n) to a 2-byte boundary + + + +1 CARD8 opcode +1 23 xkb-opcode +2 3+(6+m+k+t+c+s+g+p)/4 request-length +2 KB_DEVICESPEC deviceSpec +2 SETofKB_GBNDETAILMASK need +2 SETofKB_GBNDETAILMASK want +1 BOOL load +1 unused +1 m keymapsSpecLen +m STRING8 keymapsSpec +1 k keycodesSpecLen +k STRING8 keycodesSpec +1 t typesSpecLen +t STRING8 typesSpec +1 c compatMapSpecLen +c STRING8 compatMapSpec +1 s symbolsSpecLen +s STRING8 symbolsSpec +1 g geometrySpecLen +g STRING8 geometrySpec +p unused,p=pad(6+m+k+t+c+s+g) + + +1 1 Reply +1 CARD8 deviceID +2 CARD16 sequence number +4 V/4 length +1 KEYCODE minKeyCode +1 KEYCODE maxKeyCode +1 BOOL loaded +1 BOOL newKeyboard +2 SETofKB_GBNDETAILMASK found +2 SETofKB_GBNDETAILMASK reported +16 unused +V LISTofITEMs replies + SETofKB_GBNDETAILMASK (reported) + XkbGBN_Types map + XkbGBN_CompatMap compat + XkbGBN_ClientSymbols map + XkbGBN_ServerSymbols map + XkbGBN_IndicatorMap indicators + XkbGBN_KeyNames names + XkbGBN_OtherNames names + XkbGBN_Geometry geometry + + +ITEMs +M XkbGetMap reply map +C XkbGetCompatMap reply compat +I XkbGetIndicatorMap reply indicators +N XkbGetNames reply names +G XkbGetGeometry reply geometry + + + +1 CARD8 opcode +1 24 xkb-opcode +2 4 request-length +2 KB_DEVICESPEC deviceSpec +2 SETofKB_DEVFEATURE wanted +1 BOOL allButtons +1 CARD8 firstButton +1 CARD8 nButtons +1 unused +2 KB_LEDCLASSSPEC ledClass +2 KB_IDSPEC ledID + + +1 1 Reply +1 CARD8 deviceID +2 CARD16 sequence number +4 (2+n+p+8b+L*)/4 length +2 SETofKB_DEVFEATURE present +2 SETofKB_FEATURE supported +2 SETofKB_FEATURE unsupported +2 l nDeviceLedFBs +1 CARD8 firstBtnWanted +1 CARD8 nBtnsWanted +1 CARD8 firstBtnRtrn +1 b nBtnsRtrn +1 CARD8 totalBtns +1 BOOL hasOwnState +2 SETofKB_IDRESULT dfltKbdFB +2 SETofKB_IDRESULT dfltLedFB +2 unused +4 ATOM devType +2 n nameLen +n STRING8 name +p unused,p=pad(2+n) +8b LISTofKB_ACTION btnActions +L0+..Ll LISTofKB_DEVICELEDINFO leds + + +KB_DEVICELEDINFO 20+4n+12m +2 KB_LEDCLASSSPEC ledClass +2 KB_IDSPEC ledID +4 SETofKB_INDICATOR namesPresent (has n bits set to 1) +4 SETofKB_INDICATOR mapsPresent (has m bits set to 1) +4 SETofKB_INDICATOR physIndicators +4 SETofKB_INDICATOR state +4n LISTofATOM names +12m LISTofKB_INDICATORMAP maps + + + +1 ?? opcode +1 25 xkb-opcode +2 3+(8b+L*)/4 request-length +2 KB_DEVICESPEC deviceSpec +1 CARD8 firstBtn +1 b nBtns +2 SETofKB_DEVFEATURE change +2 l nDeviceLedFBs +8b LISTofKB_ACTION btnActions +L0+..Ll LISTofKB_DEVICELEDINFO leds + Encoding of KB_DEVICELEDINFO is as for XkbGetDeviceInfo + + +1 ?? opcode +1 101 xkb-opcode +2 6+(n+p)/4 request-length +2 n msgLength +2 unused +4 CARD32 affectFlags +4 CARD32 flags +4 CARD32 affectCtrls +4 CARD32 ctrls +n STRING8 message +p unused, p=pad(n) + + +1 1 Reply +1 unused +2 CARD16 sequence number +4 0 length +4 CARD32 currentFlags +4 CARD32 currentCtrls +4 CARD32 supportedFlags +4 CARD32 supportedCtrls +8 unused + + + + + +Events + +1 ?? code +1 0 xkb code +2 CARD16 sequence number +4 TIMESTAMP time +1 CARD8 deviceID +1 CARD8 oldDeviceID +1 KEYCODE minKeyCode +1 KEYCODE maxKeyCode +1 KEYCODE oldMinKeyCode +1 KEYCODE oldMaxKeyCode +1 CARD8 requestMajor +1 CARD8 requestMinor +2 SETofKB_NKNDETAIL changed +14 unused + + +1 ?? code +1 1 xkb code +2 CARD16 sequence number +4 TIMESTAMP time +1 CARD8 deviceID +1 SETofBUTMASK ptrBtnActions +2 SETofKB_MAPPART changed +1 KEYCODE minKeyCode +1 KEYCODE maxKeyCode +1 CARD8 firstType +1 CARD8 nTypes +1 KEYCODE firstKeySym +1 CARD8 nKeySyms +1 KEYCODE firstKeyAct +1 CARD8 nKeyActs +1 KEYCODE firstKeyBehavior +1 CARD8 nKeyBehavior +1 KEYCODE firstKeyExplicit +1 CARD8 nKeyExplicit +1 KEYCODE firstModMapKey +1 CARD8 nModMapKeys +1 KEYCODE firstVModMapKey +1 CARD8 nVModMapKeys +2 SETofKB_VMOD virtualMods +2 unused + + +1 ?? code +1 2 xkb code +2 CARD16 sequence number +4 TIMESTAMP time +1 CARD8 deviceID +1 SETofKEYMASK mods +1 SETofKEYMASK baseMods +1 SETofKEYMASK latchedMods +1 SETofKEYMASK lockedMods +1 KB_GROUP group +2 INT16 baseGroup +2 INT16 latchedGroup +1 KB_GROUP lockedGroup +1 SETofKEYMASK compatState +1 SETofKEYMASK grabMods +1 SETofKEYMASK compatGrabMods +1 SETofKEYMASK lookupMods +1 SETofKEYMASK compatLookupMods +2 SETofBUTMASK ptrBtnState +2 SETofKB_STATEPART changed +1 KEYCODE keycode +1 CARD8 eventType +1 CARD8 requestMajor +1 CARD8 requestMinor + + +1 ?? code +1 3 xkb code +2 CARD16 sequence number +4 TIMESTAMP time +1 CARD8 deviceID +1 CARD8 numGroups +2 unused +4 SETofKB_CONTROL changedControls +4 SETofKB_BOOLCTRL enabledControls +4 SETofKB_BOOLCTRL enabledControlChanges +1 KEYCODE keycode +1 CARD8 eventType +1 CARD8 requestMajor +1 CARD8 requestMinor +4 unused + + +1 ?? code +1 4 xkb code +2 CARD16 sequence number +4 TIMESTAMP time +1 CARD8 deviceID +3 unused +4 SETofKB_INDICATOR state +4 SETofKB_INDICATOR stateChanged +12 unused + + +1 ?? code +1 5 xkb code +2 CARD16 sequence number +4 TIMESTAMP time +1 CARD8 deviceID +3 unused +4 SETofKB_INDICATOR state +4 SETofKB_INDICATOR mapChanged +12 unused + + +1 ?? code +1 6 xkb code +2 CARD16 sequence number +4 TIMESTAMP time +1 CARD8 deviceID +1 unused +2 SETofKB_NAMEDETAIL changed +1 CARD8 firstType +1 CARD8 nTypes +1 CARD8 firstLevelName +1 CARD8 nLevelNames +1 unused +1 CARD8 nRadioGroups +1 CARD8 nKeyAliases +1 SETofKB_GROUP changedGroupNames +2 SETofKB_VMOD changedVirtualMods +1 KEYCODE firstKey +1 CARD8 nKeys +4 SETofKB_INDICATOR changedIndicators +4 unused + + +1 ?? code +1 7 xkb code +2 CARD16 sequence number +4 TIMESTAMP time +1 CARD8 deviceID +1 SETofKB_GROUP changedGroups +2 CARD16 firstSI +2 CARD16 nSI +2 CARD16 nTotalSI +16 unused + + +1 ?? code +1 8 xkb code +2 CARD16 sequence number +4 TIMESTAMP time +1 CARD8 deviceID +1 KB_BELLCLASSRESULT bellClass +1 CARD8 bellID +1 CARD8 percent +2 CARD16 pitch +2 CARD16 duration +4 ATOM name +4 WINDOW window +1 BOOL eventOnly +7 unused + + +1 ?? code +1 9 xkb code +2 CARD16 sequence number +4 TIMESTAMP time +1 CARD8 deviceID +1 KEYCODE keycode +1 BOOL press +1 BOOL keyEventFollows +1 SETofKEYMASK mods +1 KB_GROUP group +8 STRING8 message +10 unused + + +1 ?? code +1 10 xkb code +2 CARD16 sequence number +4 TIMESTAMP time +1 CARD8 deviceID +1 KEYCODE keycode +2 SETofKB_AXNDETAIL detail +2 CARD16 slowKeysDelay +2 CARD16 debounceDelay + + +1 ?? code +16 unused + + +1 ?? code +1 11 xkb code +2 CARD16 sequence number +4 TIMESTAMP time +1 CARD8 deviceID +1 unused +2 SETofKB_XIDETAIL reason +2 KB_LEDCLASSRESULT ledClass +2 CARD8 ledID +4 SETofKB_INDICATOR ledsDefined +4 SETofKB_INDICATOR ledState +1 CARD8 firstButton +1 CARD8 nButtons +2 SETofKB_XIFEATURE supported +2 SETofKB_XIFEATURE unsupported +2 unused + + + + diff --git a/miniconda3/share/doc/kbproto/ch01.xml b/miniconda3/share/doc/kbproto/ch01.xml new file mode 100644 index 0000000000000000000000000000000000000000..27dcc8830350086bd2a3f4fbba8d5bb2d2b79fc0 --- /dev/null +++ b/miniconda3/share/doc/kbproto/ch01.xml @@ -0,0 +1,101 @@ + +Overview + +This extension provides a number of new capabilities and controls for +text keyboards. + + + +The core X protocol specifies the ways that the +Shift +, +Control + and +Lock + modifiers and the modifiers bound to the +Mode_switch + or +Num_Lock + keysyms interact to generate keysyms and characters. The core protocol also +allows users to specify that a key affects one or more modifiers. This behavior +is simple and fairly flexible, but it has a number of limitations that make it +difficult or impossible to properly support many common varieties of keyboard +behavior. The limitations of core protocol support for keyboards include: + + + + + Use of a single, uniform, four-symbol mapping for all keyboard keys +makes it difficult to properly support keyboard overlays, PC-style break keys +or keyboards that comply with ISO9995 or a host of other national and +international standards. + + + + Use of a modifier to specify a second keyboard group has side-effects +that wreak havoc with client grabs and X toolkit translations and limit us to +two keyboard groups. + + + + Poorly specified locking key behavior requires X servers to look for a +few "magic" keysyms to determine which keys should lock when pressed. This +leads to incompatibilities between X servers with no way for clients to detect +implementation differences. + + + + Poorly specified capitalization and control behavior requires +modifications to X library source code to support new character sets or locales +and can lead to incompatibilities between system-wide and X library +capitalization behavior. + + + + Limited interactions between modifiers specified by the core protocol +make many common keyboard behaviors difficult or impossible to implement. For +example, there is no reliable way to indicate whether or not using shift should +"cancel" the lock modifier. + + + + The lack of any explicit descriptions for indicators, most modifiers +and other aspects of the keyboard appearance requires clients that wish to +clearly describe the keyboard to a user to resort to a mishmash of prior +knowledge and heuristics. + + + + + +This extension makes it possible to clearly and explicitly specify most aspects +of keyboard behavior on a per-key basis. It adds the notion of a numeric +keyboard group to the global keyboard state and provides mechanisms to more +closely track the logical and physical state of the keyboard. For keyboard +control clients, this extension provides descriptions and symbolic names for +many aspects of keyboard appearance and behavior. It also includes a number of +keyboard controls designed to make keyboards more accessible to people with +movement impairments. + + + + +The X Keyboard Extension essentially replaces the core protocol definition of a +keyboard. The following sections describe the new capabilities of the extension +and the effect of the extension on core protocol requests, events and errors. + + + +Conventions and Assumptions + +This document uses the syntactic +conventions, common types, and errors defined in sections two through four of +the specification of the X Window System Protocol. This document assumes +familiarity with the fundamental concepts of X, especially those related to the +way that X handles keyboards. Readers who are not familiar with the meaning or +use of keycodes, keysyms or modifiers should consult (at least) the first five +chapters of the protocol specification of the X Window System before +continuing. + + + diff --git a/miniconda3/share/doc/kbproto/ch02.xml b/miniconda3/share/doc/kbproto/ch02.xml new file mode 100644 index 0000000000000000000000000000000000000000..023429732490a78f255af5f6f9f7785133bdeb88 --- /dev/null +++ b/miniconda3/share/doc/kbproto/ch02.xml @@ -0,0 +1,441 @@ + +Keyboard State + +The core protocol description of +keyboard state consists of eight +modifiers +( +Shift +, +Lock +, +Control +, and +Mod1 +- +Mod5 +). A modifier reports the state of one or modifier keys, which are similar to +qualifier keys as defined by the ISO9995 standard: + + + + + Qualifier key + + +A key whose operation +has no immediate effect, but which, for as long as it is held down, modifies +the effect of other keys. A qualifier key may be, for example, a shift key or a +control key. + + + + + + +Whenever a modifier key is physically or logically depressed, the modifier it +controls is set in the keyboard state. The protocol implies that certain +modifier keys lock (i.e. affect modifier state after they have been physically +released) but does not explicitly discuss locking keys or their behavior. The +current modifier state is reported to clients in a number of core protocol +events and can be determined using the +QueryPointer + request. + + + +The XKB extension retains the eight "real" modifiers defined by the core +protocol but extends the core protocol notion of +keyboard state + to include up to four +keysym groups +, as defined by the ISO9995 standard: + + + + + + Group: + + +A logical state of a keyboard providing +access to a collection of characters. A group usually contains a set of +characters which logically belong together and which may be arranged on several +shift levels within that group. + + + + + + +For example, keyboard group can be used to select between multiple alphabets on +a single keyboard, or to access less-commonly used symbols within a character +set. + + + +Locking and Latching Modifiers and Groups + +With the core protocol, there is no way to +tell whether a modifier is set due to a lock or because the user is actually +holding down a key; this can make for a clumsy user-interface as locked +modifiers or group state interfere with accelerators and translations. + + +XKB adds explicit support for locking +and latching modifiers and groups. Locked modifiers or groups apply to all +future key events until they are explicitly changed. Latched modifiers or +groups apply only to the next key event that does not change keyboard state. + + + + +Fundamental Components of XKB Keyboard State + +The fundamental components of XKB keyboard state include: + + + + + The locked modifiers and group + + + The latched modifiers and group + + + The base modifiers and group (for which keys are physically or +logically down) + + + + The effective modifiers and group (the cumulative effect of the base, +locked and latched modifier and group states). + + + + State of the core pointer buttons. + + + + +The latched and locked state of modifiers and groups can be changed in response +to keyboard activity or under application control using the +XkbLatchLockState + request. The base modifier, base group +and pointer button states always reflect the logical state of the keyboard and +pointer and change +only + in response to keyboard or pointer activity. + + + +Computing Effective Modifier and Group + +The effective modifiers and group +report the cumulative effects of the base, latched and locked modifiers and +group respectively, and cannot be directly changed. Note that the effective +modifiers and effective group are computed differently. + + + +The effective modifiers are simply the bitwise union of the base, latched and +locked modifiers. + + + + +The effective group is the arithmetic sum of the base, latched and locked +groups. The locked and effective keyboard group must fall in the range + +Group1 +- +Group4 +, so they are adjusted into range as specified by the global +GroupsWrap +control as follows: + + + + + +If the +RedirectIntoRange + flag is set, the four least significant +bits of the groups wrap control specify the index of a group to which all +illegal groups correspond. If the specified group is also out of range, all +illegal groups map to +Group1. + + + + +If the +ClampIntoRange + flag is set, out-of-range groups +correspond to the nearest legal group. Effective groups larger than the highest +supported group are mapped to the highest supported group; effective groups +less than +Group1 + are mapped to +Group1 +. For example, a key with two groups of symbols uses +Group2 + type and symbols if the global effective group is either +Group3 + or +Group4. + + + + +If neither flag is set, group is +wrapped into range using integer modulus. For example, a key with two groups of +symbols for which groups wrap uses +Group1 + symbols if the global effective group is +Group3 + or +Group2 + symbols if the global effective group is +Group4. + + + + + +The base and latched keyboard groups are unrestricted eight-bit integer values +and are not affected by the +GroupsWrap + control. + + + + + +Computing A State Field from an XKB State + +Many events report the keyboard state +in a single +state + field. Using XKB, a state field combines modifiers, group and the pointer +button state into a single sixteen bit value as follows: + + + + + Bits 0 through 7 (the least significant eight bits) of the effective +state comprise a mask of type KEYMASK which reports the state modifiers. + + + + Bits 8 through 12 comprise a mask of type BUTMASK which reports pointer +button state. + + + + Bits 13 and 14 are interpreted as a two-bit unsigned numeric value and +report the state keyboard group. + + + + Bit 15 (the most significant bit) is reserved and must be zero. + + + + + +It is possible to assemble a state field from any of the components of the XKB +keyboard state. For example, the effective keyboard state would be assembled as +described above using the effective keyboard group, the effective keyboard +modifiers and the pointer button state. + + + + + + +Derived Components of XKB Keyboard State + +In addition to the fundamental state +components, XKB keeps track of and reports a number of state components which +are derived from the fundamental components but stored and reported separately +to make it easier to track changes in the keyboard state. These derived +components are updated automatically whenever any of the fundamental components +change but cannot be changed directly. + + + +The first pair of derived state components control the way that passive grabs +are activated and the way that modifiers are reported in core protocol events +that report state. The server uses the +ServerInternalModifiers +, +IgnoreLocksModifiers + and +IgnoreGroupLock + controls, described in Server +Internal Modifiers and Ignore Locks Behavior, to derive these two +states as follows: + + + + + The lookup state is the state used to determine the symbols associated +with a key event and consists of the effective state minus any server internal +modifiers. + + + + The grab state is the state used to decide whether a particular event +triggers a passive grab and consists of the lookup state minus any members of +the ignore locks modifiers that are not either latched or logically depressed. +If the ignore group locks control is set, the grab state does not include the +effects of any locked groups. + + + + + +Server Internal Modifiers and Ignore Locks Behavior + +The core protocol does not provide any +way to exclude certain modifiers from client events, so there is no way to set +up a modifier which affects only the server. + + + +The modifiers specified in the mask of the +InternalMods + control are not reported in any core +protocol events, are not used to determine grabs and are not used to calculate +compatibility state for XKB-unaware clients. Server internal modifiers affect +only the action applied when a key is pressed. + + + + +The core protocol does not provide any way to exclude certain modifiers from +grab calculations, so locking modifiers often have unanticipated and +unfortunate side-effects. XKB provides another mask which can help avoid some +of these problems. + + + + +The locked state of the modifiers specified in mask of the +IgnoreLockMods + control is not reported in most core +protocol events and is not used to activate grabs. The only core events which +include the locked state of the modifiers in the ignore locks mask are key +press and release events that do not activate a passive grab and which do not +occur while a grab is active. If the +IgnoreGroupLock + control is set, the locked state of the +keyboard group is not considered when activating passive grabs. + + + + +Without XKB, the passive grab set by a translation (e.g. +Alt<KeyPress>space +) does not trigger if any modifiers other than those specified by the +translation are set, with the result that many user interface components do not +react when either Num Lock or when the secondary keyboard group are active. The +ignore locks mask and the ignore group locks control make it possible to avoid +this behavior without exhaustively grabbing every possible modifier combination. + + + + + + +Compatibility Components of Keyboard State + +The core protocol interpretation of +keyboard modifiers does not include direct support for multiple groups, so XKB +reports the effective keyboard group to XKB-aware clients using some of the +reserved bits in the state field of some core protocol events, as described in +Computing A State Field from an +XKB State. + + + +This modified state field would not be interpreted correctly by XKB-unaware +clients, so XKB provides a +group compatibility mapping +(see Group Compatibility Map) which +remaps the keyboard group into a core modifier mask that has similar effects, +when possible. XKB maintains three compatibility state components that are used +to make non-XKB clients work as well as possible: + + + + + +The +compatibility state + corresponds to the effective modifier +and effective group state. + + + + +The +compatibility lookup state + is the core-protocol equivalent of the +lookup state. + + + + +The +compatibility grab state + is the nearest core-protocol equivalent +of the grab state. + + + + + +Compatibility states are essentially the corresponding XKB state, but with +keyboard group possibly encoded as one or more modifiers; Group Compatibility Map describes +the group compatibility map, which specifies the modifier(s) that correspond to +each keyboard group. + + + + +The compatibility state reported to XKB-unaware + clients for any given core protocol event +is computed from the modifier state that XKB-capable clients would see for that +same event. For example, if the ignore group locks control is set and group 2 +is locked, the modifier bound to +Mode_switch + is not reported in any event except (Device)KeyPress and (Device)KeyRelease +events that do not trigger a passive grab. + + + + +Referring to clients as "XKB-capable + is somewhat misleading in this context. +The sample implementation of XKB invisibly extends the X library to use the +keyboard extension if it is present. This means that most clients can take +advantage of all of XKB without modification, but it also means that the XKB +state can be reported to clients that have not explicitly requested the +keyboard extension. Clients that +directly + interpret the state field of core protocol events or that interpret the keymap +directly may be affected by some of the XKB differences; clients that use +library or toolkit routines to interpret keyboard events automatically use all +of the XKB features. + + + + +XKB-aware clients can query the keyboard state at any time or request immediate +notification of a change to any of the fundamental or derived components of the +keyboard state. + + + diff --git a/miniconda3/share/doc/kbproto/ch03.xml b/miniconda3/share/doc/kbproto/ch03.xml new file mode 100644 index 0000000000000000000000000000000000000000..d71f353783cabb8c03d13aaec1c8944282d0dc16 --- /dev/null +++ b/miniconda3/share/doc/kbproto/ch03.xml @@ -0,0 +1,220 @@ + +Virtual Modifiers + +The core protocol specifies that +certain keysyms, when bound to modifiers, affect the rules of keycode to keysym +interpretation for all keys; for example, when +Num_Lock + is bound to some modifier, that modifier is used to choose shifted or +unshifted state for the numeric keypad keys. The core protocol does not provide +a convenient way to determine the mapping of modifier bits, in particular + +Mod1 + through +Mod5 +, to keysyms such as +Num_Lock + and +Mode_switch +. Clients must retrieve and search the modifier map to determine the keycodes +bound to each modifier, and then retrieve and search the keyboard mapping to +determine the keysyms bound to the keycodes. They must repeat this process for +all modifiers whenever any part of the modifier mapping is changed. + + + +XKB provides a set of sixteen named virtual modifiers, each of which can be +bound to any set of the eight "real" modifiers ( +Shift +, +Lock +, +Control + and +Mod1 +- +Mod5 + as reported in the keyboard state). This makes it easier for applications and +keyboard layout designers to specify to the function a modifier key or data +structure should fulfill without having to worry about which modifier is bound +to a particular keysym. + + + + +The use of a single, server-driven mechanism for reporting changes to all data +structures makes it easier for clients to stay synchronized. For example, the +core protocol specifies a special interpretation for the modifier bound to the + +Num_Lock + key. Whenever any keys or modifiers are rebound, every application has to +check the keyboard mapping to make sure that the binding for +Num_Lock + has not changed. If +Num_Lock + is remapped when XKB is in use, the keyboard description is automatically +updated to reflect the new binding, and clients are notified immediately and +explicitly if there is a change they need to consider. + + + + +The separation of function from physical modifier bindings also makes it easier +to specify more clearly the intent of a binding. X servers do not all assign +modifiers the same way — for example, +Num_Lock + might be bound to +Mod2 + for one vendor and to +Mod4 + for another. This makes it cumbersome to automatically remap the keyboard to a +desired configuration without some kind of prior knowledge about the keyboard +layout and bindings. With XKB, applications simply use virtual modifiers to +specify the behavior they want, without regard for the actual physical bindings +in effect. + + + + +XKB puts most aspects of the keyboard under user or program control, so it is +even more important to clearly and uniformly refer to modifiers by function. + + + +Modifier Definitions + +Use an +XKB modifier definition + to specify the modifiers affected by any XKB control or data structure. An XKB +modifier definition consists of a set of real modifiers, a set of virtual +modifiers, and an effective mask. The mask is derived from the real and virtual +modifiers and cannot be explicitly changed — it contains all of the real +modifiers specified in the definition +plus + any real modifiers that are bound to the virtual modifiers specified in the +definition. For example, this modifier definition specifies the numeric lock +modifier if the +Num_Lock + keysym is not bound to any real modifier: + + +{ real_mods= None, virtual_mods= NumLock, mask= None } + + + +If we assign +Mod2 + to the +Num_Lock + key, the definition changes to: + + + +{ real_mods= None, virtual_mods= NumLock, mask= Mod2 } + + + +Using this kind of modifier definition makes it easy to specify the desired +behavior in such a way that XKB can automatically update all of the data +structures that make up a keymap to reflect user or application specified +changes in any one aspect of the keymap. + + + + +The use of modifier definitions also makes it possible to unambiguously specify +the reason that a modifier is of interest. On a system for which the +Alt + and +Meta + keysyms are bound to the same modifier, the following definitions behave +identically: + + + +{ real_mods= None, virtual_mods= Alt, mask= Mod1 } +{ real_mods= None, virtual_mods= Meta, mask= Mod1 } + + + +If we rebind one of the modifiers, the modifier definitions automatically +reflect the change: + + + +{ real_mods= None, virtual_mods= Alt, mask= Mod1 } +{ real_mods= None, virtual_mods= Meta, mask= Mod4 } + + + +Without the level of indirection provided by virtual modifier maps and modifier +definitions, we would have no way to tell which of the two definitions is +concerned with +Alt + and which is concerned with +Meta. + + + + +Inactive Modifier Definitions + +Some XKB structures ignore modifier +definitions in which the virtual modifiers are unbound. Consider this +example: + + +if ( state matches { Shift } ) Do OneThing; +if ( state matches { Shift+NumLock } ) Do Another; + + + +If the +NumLock + virtual modifier is not bound to any real modifiers, these effective masks for +these two cases are identical (i.e. they contain only +Shift +). When it is essential to distinguish between +OneThing + and Another, XKB considers only those modifier definitions for which all +virtual modifiers are bound. + + + + + +Virtual Modifier Mapping + +XKB maintains a +virtual modifier mapping +, which lists the virtual modifiers associated with each key. The real +modifiers bound to a virtual modifier always include all of the modifiers bound +to any of the keys that specify that virtual modifier in their virtual modifier +mapping. + + + +For example, if +Mod3 + is bound to the +Num_Lock + key by the core protocol modifier mapping, and the +NumLock + virtual modifier is bound to they +Num_Lock + key by the virtual modifier mapping, +Mod3 + is added to the set of modifiers associated with the +NumLock + virtual modifier. + + + + +The virtual modifier mapping is normally updated automatically whenever actions +are assigned to keys (see Changing +the Keyboard Mapping Using the Core Protocol for details) and few +applications should need to change the virtual modifier mapping explicitly. + + + diff --git a/miniconda3/share/doc/kbproto/ch04.xml b/miniconda3/share/doc/kbproto/ch04.xml new file mode 100644 index 0000000000000000000000000000000000000000..d35e2b4b3a18256ba7f335c04617af5dbc2d8d45 --- /dev/null +++ b/miniconda3/share/doc/kbproto/ch04.xml @@ -0,0 +1,865 @@ + +Global Keyboard Controls + + +The X Keyboard Extension supports a number of +global key controls +, which affect the way that XKB handles the keyboard as a whole. Many of these +controls make the keyboard more accessible to the physically impaired and are +based on the AccessDOS package +AccessDOS provides access to the DOS operating system for people with physical +impairments and was developed by the Trace R&D Center at the University of +Wisconsin. For more information on AccessDOS, contact the Trace R&D Center, +Waisman Center and Department of Industrial Engineering, University of +Wisconsin-Madison WI 53705-2280. Phone: 608-262-6966. e-mail: +info@trace.wisc.edu.. + + + +The RepeatKeys Control + + +The core protocol only allows control over whether or not the entire keyboard +or individual keys should autorepeat when held down. The +RepeatKeys + control extends this capability by adding control over the delay until a key +begins to repeat and the rate at which it repeats. +RepeatKeys + is also coupled with the core autorepeat control; changes to one are always +reflected in the other. + + + + +The +RepeatKeys + control has two parameters. The +autorepeat delay + specifies the delay between the initial press of an autorepeating key and the +first generated repeat event in milliseconds. The +autorepeat interval + specifies the delay between all subsequent generated repeat events in +milliseconds. + + + + +The PerKeyRepeat Control + + +When +RepeatKeys + are active, the +PerKeyRepeat + control specifies whether or not individual keys should autorepeat when held +down. XKB provides the +PerKeyRepeat + for convenience only, and it always parallels the +auto-repeats + field of the core protocol +GetKeyboardControl + request — changes to one are always reflected in the other. + + + + + +Detectable Autorepeat + + +The X server usually generates both press and release events whenever an +autorepeating key is held down. If an XKB-aware client enables the +DetectableAutorepeat + per-client option for a keyboard, the server sends that client a key release +event only when the key is +physically + released. For example, holding down a key to generate three characters without +detectable autorepeat yields: + + + +Press -> Release -> Press -> Release -> Press -> Release + + + +If detectable autorepeat is enabled, the client instead receives: + + + +Press-> Press -> Press -> Release + + + +Note that only clients that request detectable autorepeat are affected; other +clients continue to receive both press and release events for autorepeating +keys. Also note that support for detectable autorepeat is optional; servers are +not required to support detectable autorepeat, but they must correctly report +whether or not it is supported. + + + + +Querying and Changing Per-Client +Flags describes the +XkbPerClientFlags + request, which reports or changes values for all of the per-client flags, and +which lists the per-client flags that are supported. + + + + + + +The SlowKeys Control + + +Some users often bump keys accidentally while moving their hand or typing stick +toward the key they want. Usually, the keys that are bumped accidentally are +hit only for a very short period of time. The +SlowKeys + control helps filter these accidental bumps by telling the server to wait a +specified period, called the +SlowKeys acceptance delay +, before delivering key events. If the key is released before this period +elapses, no key events are generated. The user can then bump any number of keys +on their way to the one they want without generating unwanted characters. Once +they have reached the key they want, they can then hold it long enough for + +SlowKeys + to accept it. + + + + +The +SlowKeys + control has one parameter; the +slow keys delay + specifies the length of time, in milliseconds, that a key must be held down +before it is accepted. + + + + +When +SlowKeys + are active, the X Keyboard Extension reports the initial press, acceptance, +rejection or release of any key to interested clients using +AccessXNotify + events. The +AccessXNotify + event is described in more detail in Events. + + + + +The BounceKeys Control + + +Some people with physical impairments accidentally "bounce" on a key when they +press it. That is, they press it once, then accidentally press it again +immediately. The +BounceKeys + control temporarily disables a key after it has been pressed, effectively +"debouncing" the keyboard. + + + + +The +BounceKeys + has a single parameter. The +BounceKeys delay + specifies the period of time, in milliseconds, that the key is disabled after +it is pressed. + + + + +When +BounceKeys + are active, the server reports the acceptance or rejection of any key to +interested clients by sending an +AccessXNotify + event. The +AccessXNotify + event is described in more detail in Events. + + + + +The StickyKeys Control + + +Some people find it difficult or impossible to press two keys at once. The + +StickyKeys + control makes it easier for them to type by changing the behavior of the +modifier keys. When +StickyKeys + are enabled, a modifier is latched when the user presses it just once, so the +user can first press a modifier, release it, then press another key. For +example, to get an exclamation point (!) on a PC-style keyboard, the user can +press the +Shift + key, release it, then press the +1 + key. + + + + +By default, +StickyKeys + also allows users to lock modifier keys without requiring special locking +keys. The user can press a modifier twice in a row to lock it, and then unlock +it by pressing it one more time. + + + + +Modifiers are automatically unlatched when the user presses a non-modifier key. +For instance, to enter the sequence +Shift ++ +Ctrl ++ +Z + the user could press and release the +Shift + key to latch the +Shift + modifier, then press and release the +Ctrl + key to latch the +Control + modifier — the +Ctrl + key is a modifier key, so pressing it does not unlatch the +Shift + modifier, but leaves both the +Shift + and +Control + modifiers latched, instead. When the user presses the +Z + key, it will be as though the user pressed +Shift ++ +Ctrl ++ +Z + simultaneously. The +Z + key is not a modifier key, so the +Shift + and +Control + modifiers are unlatched after the event is generated. + + + + +A locked a modifier remains in effect until the user unlocks it. For example, +to enter the sequence ("XKB") on a PC-style keyboard with a typical US/ASCII +layout, the user could press and release the +Shift + key twice to lock the +Shift + modifier. Then, when the user presses the +9 +, +‘ +, +x +, +k +, +b +, +‘ +, and +0 + keys in sequence, it will generate ("XKB"). To unlock the +Shift + modifier, the user can press and release the +Shift + key. + + + + +Two option flags modify the behavior of the +StickyKeys + control: + + + + + If the +XkbAX_TwoKeys + flag is set, XKB automatically turns +StickyKeys + off if the user presses two or more keys at once. This serves to automatically +disable StickyKeys when a user who does not require sticky keys is using the +keyboard. + + + + The +XkbAX_LatchToLock + controls the locking behavior of +StickyKeys +; the +StickyKeys + control only locks modifiers as described above if the +XkbAX_LatchToLock + flag is set. + + + + + + +The MouseKeys Control + + +The +MouseKeys + control lets a user control all the mouse functions from the keyboard. When + +MouseKeys + are enabled, all keys with +MouseKeys + actions bound to them generate core pointer events instead of normal key press +and release events. + + + + +The +MouseKeys + control has a single parameter, the +mouse keys default button +, which specifies the core pointer button to be used by mouse keys actions that +do not explicitly specify a button. + + + + + +The MouseKeysAccel Control + + +If the +MouseKeysAccel + control is enabled, the effect of a pointer motion action changes as a key is +held down. The +mouse keys delay + specifies the amount of time between the initial key press and the first +repeated motion event. The +mouse keys interval + specifies the amount of time between repeated mouse keys events. The +steps to maximum acceleration + field specifies the total number of events before the key is travelling at +maximum speed. The +maximum acceleration + field specifies the maximum acceleration. The +curve + parameter controls the ramp used to reach maximum acceleration. + + + + +When +MouseKeys + are active and a +SA_MovePtr + key action (see Key +Actions) is activated, a pointer motion event is generated immediately. +If +MouseKeysAccel + is enabled and if acceleration is enabled for the key in question, a second +event is generated after +mouse keys delay +milliseconds, and additional events are generated every +mouse keys interval + milliseconds for as long as the key is held down. + + + + +Relative Pointer Motion + + +If the +SA_MovePtr + action specifies relative motion, events are generated as follows: The initial +event always moves the cursor the distance specified in the action; after + +steps to maximum acceleration + events have been generated, all subsequent events move the pointer the +distance specified in the action times the +maximum acceleration. + Events after the first but before maximum acceleration has been achieved are +accelerated according to the formula: + + + + + + + + + + +Where +action_delta + is the offset specified by the mouse keys action, +max_accel +and +steps_to_max + are parameters to the +MouseKeysAccel + ctrl, and the curveFactor is computed using the +MouseKeysAccel + +curve + parameter as follows: + + + + + + + + + +With the result that a +curve + of +0 + causes the distance moved to increase linearly from +action_delta + to + + + + +, and the minimum legal +curve + of - +1000 + causes all events after the first move at +max_accel +. A negative +curve + causes an initial sharp increase in acceleration which tapers off, while a +positive curve yields a slower initial increase in acceleration followed by a +sharp increase as the number of pointer events generated by the action +approaches +steps_to_max +. + + + + + +Absolute Pointer Motion + + +If an +SA_MovePtr + action specifies an absolute position for one of the coordinates but still +allows acceleration, all repeated events contain any absolute coordinates +specified in the action. + + + + + + +The AccessXKeys Control + + +If +AccessXKeys + is enabled many controls can also be turned on or off from the keyboard by +entering the following standard key sequences: + + + + + Holding down a shift key by itself for eight seconds toggles the + +SlowKeys + control. + + + + Pressing and releasing a shift key five times in a row without any +intervening key events and with less than 30 seconds delay between consecutive +presses toggles the state of the +StickyKeys + control. + + + + Simultaneously operating two or more modifier keys deactivates the + +StickyKeys + control. + + + + + +Some of these key sequences optionally generate audible feedback of the change +in state, as described in The +AccessXFeedback Control, or cause +XkbAccessXNotify + events as described in Events. + + + + + +The AccessXTimeout Control + + +In environments where computers are shared, features such as +SlowKeys + present a problem: if +SlowKeys + is on, the keyboard can appear to be unresponsive because keys have no effect +unless they are held for a certain period of time. To help address this +problem, XKB provides an +AccessXTimeout + control to automatically change the value of any global controls or AccessX +options if the keyboard is idle for a specified period of time. + + + + +The AccessXTimeout control has a number of parameters which affect the duration +of the timeout and the features changed when the timeout expires. + + + + +The +AccessX Timeout + field specifies the number of seconds the keyboard must be idle before the +global controls and AccessX options are modified. The +AccessX Options Mask + field specifies which values in the +AccessX Options + field are to be changed, and the +AccessX Options Values + field specifies the new values for those options. The +AccessX Controls Mask + field specifies which controls are to be changed in the global set of + +enabled controls +, and the +AccessX Controls Values + field specifies the new values for those controls. + + + + + +The AccessXFeedback Control + + +If +AccessXFeedback + is enabled, special beep-codes indicate changes in keyboard controls (or some +key events when +SlowKeys + or +StickyKeys + are active). Many beep codes sound as multiple tones, but XKB reports a single + +XkbBellNotify + event for the entire sequence of tones. + + + + +All feedback tones are governed by the +AudibleBell + control. Individual feedback tones can be explicitly enabled or disabled using +the +accessX options mask + or set to deactivate after an idle period using the +accessX timeout options mask +. XKB defines the following feedback tones: + + + + + + + + + + + + Feedback Name + Bell Name + Default Sound + Indicates + + + + + FeatureFB + AX_FeatureOn + rising tone + Keyboard control enabled + + + + AX_FeatureOff + falling tone + Keyboard control disabled + + + + AX_FeatureChange + two tones + Several controls changed state + + + IndicatorFB + AX_IndicatorOn + high tone + Indicator Lit + + + + AX_IndicatorOff + low tone + Indicator Extinguished + + + + AX_IndicatorChange + two high tones + Several indicators changed state + + + SlowWarnFB + AX_SlowKeysWarning + three high tones + Shift key held for four seconds + + + SKPressFB + AX_SlowKeyPress + single tone + Key press while +SlowKeys + are on + + + SKReleaseFB + AX_SlowKeyRelease + single tone + Key release while +SlowKeys + are on + + + SKAcceptFB + AX_SlowKeyAccept + single tone + Key event accepted by +SlowKeys + + + + SKRejectFB + AX_SlowKeyReject + low tone + Key event rejected by +SlowKeys + + + + StickyKeysFB + AX_StickyLatch + low tone then high tone + Modifier latched by +StickyKeys + + + + + AX_StickyLock + high tone + Modifier locked by +StickyKeys + + + + + AX_StickyUnlock + low tone + Modifier unlocked by +StickyKeys + + + + BKRejectFB + AX_BounceKeysReject + low tone + Key event rejected by +BounceKeys + + + + + + + +Implementations that cannot generate continuous tones may generate multiple +beeps instead of falling and rising tones; for example, they can generate a +high-pitched beep followed by a low-pitched beep instead of a continuous +falling tone. + + + + +If the physical keyboard bell is not very capable, attempts to simulate a +continuous tone with multiple bells can sound horrible. Set the +DumbBellFB + AccessX option to inform the server that the keyboard bell is not very capable +and that XKB should use only simple bell combinations. Keyboard capabilities +vary wildly, so the sounds generated for the individual bells when the + +DumbBellFB + option is set are implementation specific. + + + + + +The Overlay1 and Overlay2 Controls + + +A keyboard overlay allows some subset of the keyboard to report alternate +keycodes when the overlay is enabled. For example a keyboard overlay can be +used to simulate a numeric or editing keypad on keyboard that does not actually +have one by generating alternate of keycodes for some keys when the overlay is +enabled. This technique is very common on portable computers and embedded +systems with small keyboards. + + + + +XKB includes direct support for two keyboard overlays, using the +Overlay1 + and +Overlay2 + controls. When +Overlay1 + is enabled, all of the keys that are members of the first keyboard overlay +generate an alternate keycode. When +Overlay2 + is enabled, all of the keys that are members of the second keyboard overlay +generate an alternate keycode. + + + + +To specify the overlay to which a key belongs and the alternate keycode it +should generate when that overlay is enabled, assign it either the +KB_Overlay1 + or +KB_Overlay2 + key behaviors, as described in +Key Behavior. + + + + + +"Boolean" Controls and The EnabledControls Control + + +All of the controls described above, along with the +AudibleBell + control (described in Disabling +Server Generated Bells) and the +IgnoreGroupLock + control (described in Server +Internal Modifiers and Ignore Locks Behavior) comprise the +boolean controls +. In addition to any parameters listed in the descriptions of the individual +controls, the boolean controls can be individually enabled or disabled by +changing the value of the +EnabledControls + control. + + + + +The following +non-boolean + controls are always active and cannot be changed using the +EnabledControls + control or specified in any context that accepts only boolean controls: + +GroupsWrap + (Computing Effective Modifier and +Group), +EnabledControls +, +InternalMods + (Server Internal Modifiers and +Ignore Locks Behavior), and +IgnoreLockMods + (Server Internal Modifiers and +Ignore Locks Behavior) and +PerKeyRepeat + (The RepeatKeys Control) + + + + + +Automatic Reset of Boolean Controls + + +The +auto-reset controls + are a per-client value which consist of two masks that can contain any of the +boolean controls (see "Boolean" +Controls and The EnabledControls Control). Whenever the client exits +for any reason, any boolean controls specified in the +auto-reset mask + are set to the corresponding value from the +auto-reset values + mask. This makes it possible for clients to "clean up after themselves" +automatically, even if abnormally terminated. + + + + +For example, a client that replace the keyboard bell with some other audible +cue might want to turn off the +AudibleBell + control (Disabling Server +Generated Bells) to prevent the server from also generating a sound and +thus avoid cacophony. If the client were to exit without resetting the + +AudibleBell +control, the user would be left without any feedback at all. Setting +AudibleBell + in both the auto-reset mask and auto-reset values guarantees that the audible +bell will be turned back on when the client exits. + + + diff --git a/miniconda3/share/doc/kbproto/ch05.xml b/miniconda3/share/doc/kbproto/ch05.xml new file mode 100644 index 0000000000000000000000000000000000000000..5669a39eac50dfc9d28e1cf0e620a03d795a3ddd --- /dev/null +++ b/miniconda3/share/doc/kbproto/ch05.xml @@ -0,0 +1,86 @@ + + +Key Event Processing Overview + + +There are three steps to processing each key event in the X server, and at +least three in the client. This section describes each of these steps briefly; +the following sections describe each step in more detail. + + + + + First, the server applies global keyboard controls to determine whether +the key event should be processed immediately, deferred, or ignored. For +example, the +SlowKeys + control can cause a key event to be deferred until the slow keys delay has +elapsed while the +RepeatKeys + control can cause multiple X events from a single physical key press if the +key is held down for an extended period. The global keyboard controls affect +all of the keys on the keyboard and are described in +Global Keyboard Controls. + + + + Next, the server applies per-key behavior. Per key-behavior can be used +to simulate or indicate some special kinds of key behavior. For example, +keyboard overlays, in which a key generates an alternate keycode under certain +circumstances, can be implemented using per-key behavior. Every key has a +single behavior, so the effect of key behavior does not depend on keyboard +modifier or group state, though it might depend on global keyboard controls. +Per-key behaviors are described in detail in +Key Behavior. + + + + Finally, the server applies key actions. Logically, every keysym on the +keyboard has some action associated with it. The key action tells the server +what to do when an event which yields the corresponding keysym is generated. +Key actions might change or suppress the event, generate some other event, or +change some aspect of the server. Key actions are described in Key Actions. + + + + + +If the global controls, per-key behavior and key action combine to cause a key +event, the client which receives the event processes it in several steps. + + + + + First the client extracts the effective keyboard group and a set of +modifiers from the state field of the event. See Computing A State Field from an XKB +State for details. + + + + Using the modifiers and effective keyboard group, the client selects a +symbol from the list of keysyms bound to the key. Determining the KeySym Associated with a +Key Event discusses symbol selection. + + + + If necessary, the client transforms the symbol and resulting string +using any modifiers that are "left over" from the process of looking up a +symbol. For example, if the +Lock + modifier is left over, the resulting keysym is capitalized according to the +capitalization rules specified by the system. See + +Transforming the KeySym Associated with a +Key Event for a more detailed discussion of the transformations defined +by XKB. + + + + Finally, the client uses the keysym and remaining modifiers in an +application-specific way. For example, applications based on the X toolkit +might apply translations based on the symbol and modifiers reported by the +first three steps. + + + + diff --git a/miniconda3/share/doc/kbproto/ch06.xml b/miniconda3/share/doc/kbproto/ch06.xml new file mode 100644 index 0000000000000000000000000000000000000000..ec6a5f29be774fde717d812fa3ab31c3cb6d8c71 --- /dev/null +++ b/miniconda3/share/doc/kbproto/ch06.xml @@ -0,0 +1,1767 @@ + +Key Event Processing in the Server + + +This section describes the steps involved in processing a key event within the +server when XKB is present. Key events can be generated due to keyboard +activity and passed to XKB by the DDX layer, or they can be synthesized by +another extension, such as XTEST. + + + +Applying Global Controls + + +When the X Keyboard Extension receives a key event, it first checks the global +key controls to decide whether to process the event immediately or at all. The +global key controls which might affect the event, in descending order of +priority, are: + + + + + If a key is pressed while the +BounceKeys + control is enabled, the extension generates the event only if the key is +active. When a key is released, the server deactivates the key and starts a + +bounce keys timer + with an interval specified by the debounce delay. + + +If the bounce keys timer expires or if some other key is pressed before the +timer expires, the server reactivates the corresponding key and deactivates the +timer. Neither expiration nor deactivation of a bounce keys timer causes an +event. + + + If the +SlowKeys + control is enabled, the extension sets a +slow keys timer + with an interval specified by the slow keys delay, but does not process the +key event immediately. The corresponding key release deactivates this timer. + + +If the slow keys timer expires, the server generates a key press for the +corresponding key, sends an +XkbAccessXNotify + and deactivates the timer. + + + + The extension processes key press events normally whether or not the + +RepeatKeys + control is active, but if +RepeatKeys + are enabled and per-key autorepeat is enabled for the event key, the extension +processes key press events normally, but it also initiates an +autorepeat timer + with an interval specified by the autorepeat delay. The corresponding key +release deactivates the timer. + + +If the autorepeat timer expires, the server generates a key release and a key +press for the corresponding key and reschedules the timer according to the +autorepeat interval. + + + + + +Key events are processed by each global control in turn: if the +BounceKeys + control accepts a key event, +SlowKeys + considers it. Once +SlowKeys + allows or synthesizes an event, the +RepeatKeys + control acts on it. + + + + + +Key Behavior + + +Once an event is accepted by all of the controls or generated by a timer, the +server checks the per-key behavior of the corresponding key. This extension +currently defines the following key behaviors: + + + + + + + + + + Behavior + Effect + + + + + +KB_Default + + Press and release events are processed normally. + + + +KB_Lock + + If a key is logically up (i.e. the corresponding bit of the core key +map is cleared) when it is pressed, the key press is processed normally and the +corresponding release is ignored. If the key is logically down when pressed, +the key press is ignored but the corresponding release is processed normally. + + + + + + +KB_RadioGroup + + + + flags: CARD8 + + + index: CARD8 + + + If another member of the radio group specified by +index + is logically down when a key is pressed, the server synthesizes a key release +for the member that is logically down and then processes the new key press +event normally. + +If the key itself is logically down when pressed, the key press event is +ignored, but the processing of the corresponding key release depends on the +value of the +RGAllowNone + bit in +flags +. If it is set, the key release is processed normally; otherwise the key +release is also ignored. + + +All other key release events are ignored. + + + + + + +KB_Overlay1 + + + + key: KEYCODE + + + If the +Overlay1 + control is enabled, events from this key are reported as if they came from the +key specified in +key +. Otherwise, press and release events are processed normally. + + + + + +KB_Overlay2 + + + + key: KEYCODE + + + If the +Overlay2 + control is enabled, events from this key are reported as if they came from the +key specified in +key +. Otherwise, press and release events are processed normally. + + + + + + +The X server uses key behavior to determine whether to process or filter out +any given key event; key behavior is independent of keyboard modifier or group +state (each key has exactly one behavior. + + + +Key behaviors can be used to simulate any of these types of keys or to indicate +an unmodifiable physical, electrical or software driver characteristic of a +key. An optional +permanent + flag can modify any of the supported behaviors and indicates that behavior +describes an unalterable physical, electrical or software aspect of the +keyboard. Permanent behaviors cannot be changed or set by the +XkbSetMap + request. The +permanent + flag indicates a characteristic of the underlying system that XKB cannot +affect, so XKB treats all permanent behaviors as if they were +KB_Default + and does not filter key events described in the table above. + + + + + +Key Actions + + +Once the server has applied the global controls and per-key behavior and has +decided to process a key event, it applies +key actions + to determine the effects of the key on the internal state of the server. A key +action consists of an operator and some optional data. XKB supports actions +which: + + + + + change base, latched or locked modifiers or group + + + + move the core pointer or simulate core pointer button events + + + + change most aspects of keyboard behavior + + + + terminate or suspend the server + + + + send a message to interested clients + + + + simulate events on other keys + + + + + +Each key has an optional list of actions. If present, this list parallels the +list of symbols associated with the key (i.e. it has one action per symbol +associated with the key). For key press events, the server looks up the action +to be applied from this list using the key symbol mapping associated with the +event key, just as a client looks up symbols as described in Determining the KeySym Associated with a +Key Event; if the event key does not have any actions, the server uses +the +SA_NoAction + event for that key regardless of modifier or group state. + + + + +Key actions have essentially two halves; the effects on the server when the key +is pressed and the effects when the key is released. The action applied for a +key press event determines the further actions, if any, that are applied to the +corresponding release event or to events that occur while the key is held down. +Clients can change the actions associated with a key while the key is down +without changing the action applied next time the key is released; subsequent +press-release pairs will use the newly bound key action. + + + + +Most actions directly change the state of the keyboard or server; some actions +also modify other actions that occur simultaneously with them. Two actions +occur simultaneously if the keys which invoke the actions are both logically +down at the same time, regardless of the order in which they are pressed or +delay between the activation of one and the other. + + + + +Most actions which affect keyboard modifier state accept a modifier definition +(see Virtual Modifiers) +named +mods + and a boolean flag name +useModMap + among their arguments. These two fields combine to specify the modifiers +affected by the action as follows: If +useModMap + is +True +, the action sets any modifiers bound by the modifier mapping to the key that +initiated the action; otherwise, the action sets the modifiers specified by + +mods +. For brevity in the text of the following definitions, we refer to this +combination of +useModMap + and +mods + as the "action modifiers." + + + + +The X Keyboard Extension supports the following actions: + + + + + + + + + + Action + Effect + + + + + SA_NoAction + + + + +No direct effect, though SA_NoAction + events may change the effect of other server actions (see below). + + + + + + + + + SA_SetMods + + + mods: MOD_DEF + + + useModMap: BOOL + + + clearLocks: BOOL + + + + + + +Key press adds any action modifiers to the keyboard’s base modifiers. + + + + Key release clears any action modifiers in the keyboard’s base +modifiers, provided that no other key which affects the same modifiers is +logically down. + + + + If no keys were operated simultaneously with this key and +clearLocks + is set, release unlocks any action modifiers. + + + + + + + + + +SA_LatchMods + + + + mods: MOD_DEF + + + useModMap: BOOL + + + clearLocks: BOOL + + + latchToLock: BOOL + + + + + + Key press and release events have the same effect as for +SA_SetMods +; if no keys were operated simultaneously with the latching modifier key, key +release events have the following additional effects: + + + + Modifiers that were unlocked due to +clearLocks + have no further effect. + + + + If +latchToLock + is set, key release locks and then unlatches any remaining action modifiers +that are already latched. + + + + Finally, key release latches any action modifiers that were not used by +the +clearLocks + or +latchToLock + flags. + + + + + + + + + +SA_LockMods + + + + mods: MOD_DEF + + + useModMap: BOOL + + + noLock: BOOL + + + noUnlock: BOOL + + + + + + Key press sets the base and possibly the locked state of any action +modifiers. If +noLock + is +True +, only the base state is changed. + + + + For key release events, clears any action modifiers in the keyboard’s +base modifiers, provided that no other key which affects the same modifiers is +down. If +noUnlock + is +False + and any of the action modifiers were locked before the corresponding key press +occurred, key release unlocks them. + + + + + + + + + +SA_SetGroup + + + + group: INT8 + + + groupAbsolute: BOOL + + + clearLocks: BOOL + + + + + + If +groupAbsolute + is set, key press events change the base keyboard group to +group +; otherwise, they add +group + to the base keyboard group. In either case, the resulting effective keyboard +group is brought back into range depending on the value of the +GroupsWrap + control for the keyboard. + + + + If an +SA_ISOLock + key is pressed while this key is held down, key release has no effect, +otherwise it cancels the effects of the press. + + + + If no keys were operated simultaneously with this key and +clearLocks + is set, key release also sets the locked keyboard group to +Group1 +. + + + + + + + + + +SA_LatchGroup + + + + group: INT8 + + + groupAbsolute: BOOL + + + clearLocks: BOOL + + + latchToLock: BOOL + + + + + + Key press and release events have the same effect as an +SA_SetGroup + action; if no keys were operated simultaneously with the latching group key +and the +clearLocks + flag was not set or had no effect, key release has the following additional +effects: + + + + If +latchToLock + is set and the latched keyboard group is non-zero, the key release adds the +delta applied by the corresponding key press to the locked keyboard group and +subtracts it from the latched keyboard group. The locked and effective keyboard +group are brought back into range according to the value of the global + +GroupsWrap + control for the keyboard. + + + + Otherwise, key release adds the key press delta to the latched keyboard +group. + + + + + + + + + +SA_LockGroup + + + + group: INT8 + + + groupAbsolute: BOOL + + + + + + If +groupAbsolute + is set, key press sets the locked keyboard group to +group +. Otherwise, key press adds +group + to the locked keyboard group. In either case, the resulting locked and +effective group is brought back into range depending on the value of the + +GroupsWrap + control for the keyboard. + + + + Key release has no effect. + + + + + + + + + +SA_MovePtr + + + + x, y: INT16 + + + noAccel: BOOL + + + absoluteX: BOOL + + + absoluteY: BOOL + + + + + + If +MouseKeys + are not enabled, this action behaves like +SA_NoAction +, otherwise this action cancels any pending repeat key timers for this key and +has the following additional effects. + + + + Key press generates a core pointer +MotionNotify + event instead of the usual +KeyPress +. If +absoluteX + is +True +, +x + specifies the new pointer X coordinate, otherwise +x + is added to the current pointer X coordinate; +absoluteY + and +y + specify the new Y coordinate in the same way. + + + + If +noAccel + is +False +, and the +MouseKeysAccel + keyboard control is enabled, key press also initiates the mouse keys timer for +this key; every time this timer expires, the cursor moves again. The distance +the cursor moves in these subsequent events is determined by the mouse keys +acceleration as described in The +MouseKeysAccel Control. + + + + Key release disables the mouse keys timer (if it was initiated by the +corresponding key press) but has no other effect and is ignored (does not +generate an event of any type). + + + + + + + + + +SA_PtrBtn + + + + button: CARD8 + + + count: CARD8 + + + useDfltBtn: BOOL + + + + + + If +MouseKeys + are not enabled, this action behaves like +SA_NoAction +. + + + + If +useDfltBtn + is set, the event is generated for the current default core button. Otherwise, +the event is generated for the button specified by +button +. + + + + If the mouse button specified for this action is logically down, the +key press and corresponding release are ignored and have no effect. + + + + Otherwise, key press causes one or more core pointer button events +instead of the usual key press. If +count + is +0 +, key press generates a single +ButtonPress + event; if +count + is greater than +0 +, key press generates +count + pairs of +ButtonPress + and +ButtonRelease + events. + + + + If +count + is +0 +, key release generates a core pointer +ButtonRelease + which matches the event generated by the corresponding key press; if count is +non-zero, key release does not cause a +ButtonRelease + event. Key release never causes a key release event. + + + + + + + + + +SA_LockPtrBtn + + + + button: BUTTON + + + noLock: BOOL + + + noUnlock: BOOL + + + useDfltBtn: BOOL + + + + + + If +MouseKeys + are not enabled, this action behaves like +SA_NoAction +. + + + + Otherwise, if the button specified by +useDfltBtn + and +button + is not locked, key press causes a +ButtonPress + instead of a key press and locks the button. If the button is already locked +or if +noLock + is +True +, key press is ignored and has no effect. + + + + If the corresponding key press was ignored, and if +noUnlock + is +False +, key release generates a +ButtonRelease + event instead of a key release event and unlocks the specified button. If the +corresponding key press locked a button, key release is ignored and has no +effect. + + + + + + + + + +SA_SetPtrDflt + + + + affect: CARD8 + + + value: CARD8 + + + dfltBtnAbs: BOOL + + + + + + If +MouseKeys + are not enabled, this action behaves like +SA_NoAction +. + + + + Otherwise, both key press and key release are ignored, but key press +changes the pointer value specified by +affect +to +value +, as follows: + + + + If +which + is +SA_AffectDfltBtn +, +value + and +dfltBtnAbs + specify the default pointer button used by the various pointer actions as +follow: If +dfltBtnAbs +is True, value specifies the button to be used, otherwise, +value + specifies the amount to be added to the current default button. In either +case, illegal button choices are wrapped back into range. + + + + + + + + + +SA_ISOLock + + + + dfltIsGroup: +False + + + + mods: MOD_DEF + + + useModMap: BOOL + + + noLock: BOOL + + + noUnlock: BOOL + + + noAffectMods: BOOL + + + noAffectGrp: BOOL + + + noAffectPtr: BOOL + + + noAffectCtrls: BOOL + + +or + + + dfltIsGroup: +True + + + + group: INT8 + + + groupAbsolute: BOOL + + + noAffectMods: BOOL + + + noAffectGrp: BOOL + + + noAffectPtr: BOOL + + + noAffectCtrls: BOOL + + + + + + If +dfltIsGroup + is +True +, key press sets the base group specified by +groupAbsolute + and +group +. Otherwise, key press sets the action modifiers in the keyboard’s base +modifiers. + + + + Key release clears the base modifiers or group that were set by the key +press; it may have additional effects if no other appropriate actions occur +simultaneously with the +SA_ISOLock + operation. + + + + If +noAffectMods + is +False +, any +SA_SetMods + or +SA_LatchMods + actions that occur simultaneously with the +ISOLock + action are treated as +SA_LockMods + instead. + + + + If +noAffectGrp + is +False +, any +SA_SetGroup + or +SA_LatchGroup + actions that occur simultaneously with this action are treated as +SA_LockGroup + actions instead. + + + + If +noAffectPtr + is +False +, +SA_PtrBtn + actions that occur simultaneously with the +SA_ISOLock + action are treated as +SA_LockPtrBtn + actions instead. + + + + If +noAffectCtrls + is +False +, any +SA_SetControls + actions that occur simultaneously with the +SA_ISOLock + action are treated as +SA_LockControls + actions instead. + + + + If no other actions were transformed by the +SA_ISOLock + action, key release locks the group or modifiers specified by the action +arguments. + + + + + + + +SA_TerminateServer + + + + + Key press terminates the server. Key release is ignored. + + + + This action is optional; servers are free to ignore it. If ignored, it +behaves like +SA_NoAction +. + + + + + + + + + +SA_SwitchScreen + + + + num: INT8 + + + switchApp: BOOL + + + screenAbs: BOOL + + + + + + If the server supports this action and multiple screens or displays +(either virtual or real), this action changes to the active screen indicated by + +num + and +screenAbs +. If +screenAbs + is +True +, num specifies the index of the new screen; otherwise, num specifies an offset +from the current screen to the new screen. + + + + If +switchApp + is +False +, it should switch to another screen on the same server. Otherwise it should +switch to another X server or application which shares the same physical +display. + + + + This action is optional; servers are free to ignore the action or any +of its flags if they do not support the requested behavior. If the action is +ignored, it behaves like +SA_NoAction +, otherwise neither key press nor release generate an event. + + + + + + + + SA_SetControls + controls: KB_BOOLCTRLMASK + + + + + +Key press enables any boolean controls that are specified in +controls + and not already enabled at the time of the key press. Key release disables any +controls that were enabled by the corresponding key press. This action can +cause +XkbControlsNotify + events. + + + + + + + + SA_LockControls + + controls: KB_BOOLCTRLMASK + + + noLock: BOOL + + + noUnlock: BOOL + + + + + + If +noLock + is +False +, key press locks and enables any controls that are specified in +controls + and not already locked at the time of the key press. + + +If +noUnlock + is +False +, key release unlocks and disables any controls that are specified in +controls + and were not enabled at the time of the corresponding key press. + + + + + + + + + +SA_ActionMessage +: + pressMsg: BOOL + + + releaseMsg: BOOL + + + genEvent: BOOL + + + message: STRING + + + + + + if +pressMsg + is +True +, key press generates an +XkbActionMessage + event which reports the keycode, event type and the contents of +message +. + + + + If +releaseMsg + is +True +, key release generates an +XkbActionMessage + event which reports the keycode, event type and contents of +message +. + + + + If +genEvent + is +True +, both press and release generate key press and key release events, regardless +of whether they also cause an +XkbActionMessage +. + + + + + + + + + +SA_RedirectKey + + + + newKey: KEYCODE + + + modsMask: KEYMASK + + + mods: KEYMASK + + + vmodsMask: CARD16 + + + vmods: CARD16 + + + + + + Key press causes a key press event for the key specified by +newKey + instead of for the actual key. The state reported in this event reports of the +current effective modifiers changed as follow: Any real modifiers specified in + +modsMask + are set to corresponding values from +mods +. Any real modifiers bound to the virtual modifiers specified in +vmodsMask + are either set or cleared, depending on the corresponding value in +vmods +. If the real and virtual modifier definitions specify conflicting values for a +single modifier, the real modifier definition has priority. + + + + Key release causes a key release event for the key specified by + +newKey +; the state field for this event consists of the effective keyboard modifiers +at the time of the release, changed as described above. + + + + The +SA_RedirectKey + action normally redirects to another key on the same device as the key or +button which caused the event, unless that device does not belong to the input +extension KEYCLASS, in which case this action causes an event on the core +keyboard device. + + + + + + + + + +SA_DeviceBtn + + + + count: CARD8 + + + button: BUTTON + + + device: CARD8 + + + + + + The +device + field specifies the ID of an extension device; the +button + field specifies the index of a button on that device. If the button specified +by this action is logically down, the key press and corresponding release are +ignored and have no effect. If the device or button specified by this action +are illegal, this action behaves like +SA_NoAction +. + + + + Otherwise, key press causes one or more input extension device button +events instead of the usual key press event. If +count + is +0 +, key press generates a single +DeviceButtonPress + event; if +count + is greater than +0 +, key press generates +count + pairs of +DeviceButtonPress + and +DeviceButtonRelease + events. + + + + If +count + is +0 +, key release generates an input extension +DeviceButtonRelease + which matches the event generated by the corresponding key press; if count is +non-zero, key release does not cause a +DeviceButtonRelease + event. Key release never causes a key release event. + + + + + + + + + +SA_LockDeviceBtn + + + + button: BUTTON + + + device: CARD8 + + + noLock: BOOL + + + noUnlock: BOOL + + + + + + The +device + field specifies the ID of an extension device; the +button + field specifies the index of a button on that device. If the device or button +specified by this action are illegal, it behaves like +SA_NoAction +. + + + + Otherwise, if the specified button is not locked and if +noLock + is +False +, key press causes an input extension +DeviceButtonPress + event instead of a key press event and locks the button. If the button is +already locked or if +noLock + is +True +, key press is ignored and has no effect. + + + + If the corresponding key press was ignored, and if +noUnlock + is +False +, key release generates an input extension +DeviceButtonRelease + event instead of a core protocol or input extension key release event and +unlocks the specified button. If the corresponding key press locked a button, +key release is ignored and has no effect. + + + + + + + + + +SA_DeviceValuator + + + + +device +: CARD8 + + + +val1What +: SA_DVOP + + + +val1 +: CARD8 + + + +val1Value +: INT8 + + + +val1Scale +: 0...7 + + + +val2What +: BOOL + + + +val2 +: CARD8 + + + +val2Value +: INT8 + + + +val2Scale +: 0...7 + + + + + + The +device + field specifies the ID of an extension device; +val1 + and +val2 + specify valuators on that device. If +device + is illegal or if neither +val1 + nor +val2 + specifies a legal valuator, this action behaves like +SA_NoAction +. + + + + If +valn + specifies a legal valuator and +valnWhat + is not +SA_IgnoreVal +, the specified value is adjusted as specified by +valnWhat +: + + + + If +valnWhat + is +SA_SetValMin +, +valn + is set to its minimum legal value. + + + + If +valnWhat + is +SA_SetValCenter +, +valn + is centered (to (max-min)/2). + + + + If +valnWhat + is +SA_SetValMax +, +valn + is set to its maximum legal value. + + + + if +valnWhat + is +SA_SetValRelative +, + + + + + is added to +valn +. + + + + if +valnWhat + is +SA_SetValAbsolute +, +valn + is set to + + + + +. + + + + Illegal values for +SA_SetValRelative + or +SA_SetValAbsolute + are clamped into range. + + + + + + + + + + +If +StickyKeys + are enabled, all +SA_SetMods + and +SA_SetGroup + actions act like +SA_LatchMods + and +SA_LatchGroup + respectively. If the +LatchToLock + AccessX option is set, either action behaves as if both the +SA_ClearLocks + and +SA_LatchToLock + flags are set. + + + + +Actions which cause an event from another key or from a button on another +device immediately generate the specified event. These actions do not consider +the behavior or actions (if any) that are bound to the key or button to which +the event is redirected. + + + + +Core events generated by server actions contain the keyboard state that was in +effect at the time the key event occurred; the reported state does not reflect +any changes in state that occur as a result of the actions bound to the key +event that caused them. + + + + +Events sent to clients that have not issued an +XkbUseExtension + request contain a compatibility state in place of the actual XKB keyboard +state. See Effects of XKB on Core +Protocol Events for a description of this compatibility mapping. + + + + + +Delivering a Key or Button Event to a Client + + +The window and client that receive core protocol and input extension key or +button events are determined using the focus policy, window hierarchy and +passive grabs as specified by the core protocol and the input extension, with +the following changes: + + + + + A passive grab triggers if the modifier state specified in the grab +matches the grab compatibility state (described in Compatibility Components of Keyboard +State). Clients can choose to use the XKB grab state instead by setting +the +GrabsUseXKBState + per-client flag. This flag affects all passive grabs that are requested by the +client which sets it but does not affect passive grabs that are set by any +other client. + + + + The state field of events which trigger a passive grab reports the XKB +or compatibility grab state in effect at the time the grab is triggered; the +state field of the corresponding release event reports the corresponding grab +state in effect when the key or button is released. + + + + If the +LookupStateWhenGrabbed + per-client flag is set, all key or button events that occur while a keyboard +or pointer grab is active contain the XKB or compatibility lookup state, +depending on the value of the +GrabsUseXKBState + per-client flag. If +LookupStateWhenGrabbed + is not set, they include the XKB or compatibility grab state, instead. + + + + Otherwise, the state field of events that do not trigger a passive grab +report is derived from the XKB effective modifiers and group, as described in +Computing A State Field from an +XKB State. + + + + If a key release event is the result of an autorepeating key that is +being held down, and the client to which the event is reported has requested +detectable autorepeat (see +Detectable Autorepeat), the event is not delivered to the client. + + + + + +The following section explains the intent of the XKB interactions with core +protocol grabs and the reason that the per-client flags are needed. + + + + +XKB Interactions With Core Protocol Grabs + + +XKB provides the separate lookup and grab states to help work around some +difficulties with the way the core protocol specifies passive grabs. +Unfortunately, many clients work around those problems differently, and the way +that XKB handles grabs and reports keyboard state can sometimes interact with +those client workarounds in unexpected and unpleasant ways. + + + + +To provide more reasonable behavior for clients that are aware of XKB without +causing problems for clients that are unaware of XKB, this extension provides +two per-client flags that specify the way that XKB and the core protocol should +interact. + + + + + The largest problems arise from the fact that an XKB state field +encodes an explicit keyboard group in bits 13-14 (as described in Computing A State Field from an XKB +State), while pre-XKB clients use one of the eight keyboard modifiers +to select an alternate keyboard group. To make existing clients behave +reasonably, XKB normally uses the compatibility grab state instead of the XKB +grab state to determine whether or not a passive grab is triggered. XKB-aware +clients can set the +GrabsUseXKBState + per-client flag to indicate that they are specifying passive grabs using an +XKB state. + + + + Some toolkits start an active grab when a passive grab is triggered, in +order to have more control over the conditions under which the grab is +terminated. Unfortunately, the fact that XKB reports a different state in +events that trigger or terminate grabs means that this grab simulation can fail +to terminate the grab under some conditions. To work around this problem, XKB +normally reports the grab state in all events whenever a grab is active. +Clients which do not use active grabs like this can set the +LookupStateWhenGrabbed + per-client flag in order to receive the same state component whether or not a +grab is active. + + +The +GrabsUseXKBState + per-client flag also applies to the state of events sent while a grab is +active. If it is set, events during a grab contain the XKB lookup or grab +state; by default, events during a grab contain the compatibility lookup or +grab state. + + + + +The state used to trigger a passive grab is controlled by the setting of the + +GrabsUseXKBState + per-client flag at the time the grab is registered. Changing this flag does +not affect existing passive grabs. + + + + diff --git a/miniconda3/share/doc/kbproto/ch07.xml b/miniconda3/share/doc/kbproto/ch07.xml new file mode 100644 index 0000000000000000000000000000000000000000..b5ffc6850c396c5fa6efcafb87ae1987531f56d5 --- /dev/null +++ b/miniconda3/share/doc/kbproto/ch07.xml @@ -0,0 +1,688 @@ + +Key Event Processing in the Client + + +The XKB +client map + for a keyboard is the collection of information a client needs to interpret +key events that come from that keyboard. It contains a global list of +key types +, described in Key Types, +and an array of +key symbol map +s, each of which describes the symbols bound to one particular key and the +rules to be used to interpret those symbols. + + + +Notation and Terminology + + +XKB associates a two-dimensional array of symbols with each key. Symbols are +addressed by keyboard group (see +Keyboard State) and shift level, where level is defined as in the +ISO9995 standard: + + + + + Level + + +One of several states (normally 2 or 3) which govern which graphic +character is produced when a graphic key is actuated. In certain cases the +level may also affect function keys. + + + + + + +Note that shift level is derived from the modifier state, but not necessarily +in the same way for all keys. For example, the +Shift + modifier selects shift level 2 on most keys, but for keypad keys the modifier +bound to +Num_Lock + (i.e. the +NumLock + virtual modifier) also selects shift level 2.gray symbols on a key + + + +We use the notation G +n +L +n + to specify the position of a symbol on a key or in memory: + + + + + + + + + +The gray characters indicate symbols that are implied or expected but are not +actually engraved on the key. + + +Unfortunately, the "natural" orientation of symbols on a key and +the natural orientation in memory are reversed from one another, so keyboard +group refers to a column on the key and a row in memory. There’s no real help +for it, but we try to minimize confusion by using "group" and "level" (or +"shift level") to refer to symbols regardless of context. + + + +Determining the KeySym Associated with a Key Event + + +To look up the symbol associated with an XKB key event, we need to know the +group and shift level that correspond to the event. + + + + +Group is reported in bits 13-14 of the state field of the key event, as +described in Computing A State +Field from an XKB State. The keyboard group reported in the event might +be out-of-range for any particular key because the number of groups can vary +from key to key. The XKB description of each key contains a +group info + field which is interpreted identically to the global groups wrap control (see +Computing Effective Modifier and +Group) and which specifies the interpretation of groups that are +out-of-range for that key. + + + + +Once we have determined the group to be used for the event, we have to +determine the shift level. The description of a key includes a +key type + for each group of symbols bound to the key. Given the modifiers from the key +event, this key type yields a shift level and a set of "leftover" modifiers, as +described in Key Types +below. + + + + +Finally, we can use the effective group and the shift level returned by the +type of that group to look up a symbol in a two-dimensional array of symbols +associated with the key. + + + + +Key Types + + +Each entry of a key type’s +map + field specifies the shift level that corresponds to some XKB modifier +definition; any combination of modifiers that is not explicitly listed +somewhere in the map yields shift level one. Map entries which specify unbound +virtual modifiers (see Inactive +Modifier Definitions) are not considered; each entry contains an +automatically-updated +active + field which indicates whether or not it should be used. + + + + +Each key type includes a few fields that are derived from the contents of the +map and which report some commonly used values so they don’t have to be +constantly recalculated. The +numLevels + field contains the highest shift level reported by any of its map entries; XKB +uses +numLevels + to insure that the array of symbols bound to a key is large enough (the number +of levels reported by a key type is also referred to as its width). The + +modifiers + field reports all real modifiers considered by any of the map entries for the +type. Both +modifiers + + +and +numLevels + are updated automatically by XKB and neither can be changed explicitly. + + + + +Any modifiers specified in +modifiers + are normally +consumed + (see Transforming the KeySym +Associated with a Key Event), which means that they are not considered +during any of the later stages of event processing. For those rare occasions +that a modifier +should + be considered despite having been used to look up a symbol, key types include +an optional +preserve + field. If a +preserve + list is present, each entry corresponds to one of the key type’s map entries +and lists the modifiers that should +not + be consumed if the matching map entry is used to determine shift level. + + + + +For example, the following key type implements caps lock as defined by the core +protocol (using the second symbol bound to the key): + + + +type "ALPHABETIC" { + modifiers = Shift+Lock; + map[Shift]= Level2; + map[Lock]= Level2; + map[Shift+Lock]= Level2; +}; + + + +The problem with this kind of definition is that we could assign completely +unrelated symbols to the two shift levels, and "Caps Lock" would choose the +second symbol. Another definition for alphabetic keys uses system routines to +capitalize the keysym: + + + +type "ALPHABETIC" { + modifiers= Shift; + map[Shift]= Level2; +}; + + + +When caps lock is applied using this definition, we take the symbol from shift +level one and capitalize it using system-specific capitalization rules. If +shift and caps lock are both set, we take the symbol from shift level two and +try to capitalize it, which usually has no effect. + + + + +The following key type implements shift-cancels-caps lock behavior for +alphabetic keys: + + + +type "ALPHABETIC" { + modifiers = Shift+Lock; + map[Shift] = Level2; + preserve[Lock]= Lock; +}; + + + +Consider the four possible states that can affect alphabetic keys: no +modifiers, shift alone, caps lock alone or shift and caps lock together. The +map contains no explicit entry for +None + (no modifiers), so if no modifiers are set, any group with this type returns +the first keysym. The map entry for +Shift + reports +Level2 +, so any group with this type returns the second symbol when +Shift + is set. There is no map entry for +Lock + alone, but the type specifies that the +Lock + modifier should be preserved in this case, so +Lock + alone returns the first symbol in the group but first applies the +capitalization transformation, yielding the capital form of the symbol. In the +final case, there is no map entry for +Shift+Lock +, so it returns the first symbol in the group; there is no preserve entry, so +the +Lock + modifier is consumed and the symbol is not capitalized. + + + + + +Key Symbol Map + + +The +key symbol map + for a key contains all of the information that a client needs to process +events generated by that key. Each key symbol mapping reports: + + + + + The number of groups of symbols bound to the key ( +numGroups +). + + + + The treatment of out-of-range groups ( +groupInfo +). + + + + The index of the key type to for each +possible + group ( +kt_index[MaxKbdGroups] +). + + + + The width of the widest type associated with the key ( +groupsWidth +). + + + + The two-dimensional (numGroups + groupsWidth) array of symbols bound to the key. + + + + + +It is legal for a key to have zero groups, in which case it also has zero +symbols and all events from that key yield +NoSymbol +. The array of key types is of fixed width and is large enough to hold key +types for the maximum legal number of groups ( +MaxKbdGroups +, currently four); if a key has fewer than +MaxKbdGroups + groups, the extra key types are reported but ignored. The +groupsWidth + field cannot be explicitly changed; it is updated automatically whenever the +symbols or set of types bound to a key are changed. + + + + +If, when looking up a symbol, the effective keyboard group is out-of-range for +the key, the +groupInfo + field of the key symbol map specifies the rules for determining the +corresponding legal group as follows: + + + + + If the +RedirectIntoRange + flag is set, the two least significant bits of +groupInfo + specify the index of a group to which all illegal groups correspond. If the +specified group is also out of range, all illegal groups map to +Group1 +. + + + + If +ClampIntoRange + flag is set, out-of-range groups correspond to the nearest legal group. +Effective groups larger than the highest supported group are mapped to the +highest supported group; effective groups less than +Group1 + are mapped to +Group1 +. For example, a key with two groups of symbols uses +Group2 + type and symbols if the global effective group is either +Group3 + or +Group4 +. + + + + If neither flag is set, group is wrapped into range using integer +modulus. For example, a key with two groups of symbols for which groups wrap +uses +Group1 + symbols if the global effective group is +Group3 + or +Group2 + symbols if the global effective group is +Group4 +. + + + + + +The client map contains an array of key symbol mappings, with one entry for +each key between the minimum and maximum legal keycodes, inclusive. All +keycodes which fall in that range have key symbol mappings, whether or not any +key actually yields that code. + + + + + + +Transforming the KeySym Associated with a Key Event + + +Any modifiers that were not used to look up the keysym, or which were +explicitly preserved, might indicate further transformations to be performed on +the keysym or the character string that is derived from it. For example, If the + +Lock + modifier is set, the symbol and corresponding string should be capitalized +according to the locale-sensitive capitalization rules specified by the system. +If the +Control + modifier is set, the keysym is not affected, but the corresponding character +should be converted to a control character as described in Default Symbol Transformations. + + + + +This extension specifies the transformations to be applied when the +Control + or +Lock + modifiers are active but were not used to determine the keysym to be used: + + + + + + + + + + Modifier + Transformation + + + + + +Control + + Report the control character associated with the symbol. This +extension defines the control characters associated with the ASCII alphabetic +characters (both upper and lower case) and for a small set of punctuation +characters (see +Default Symbol Transformations). +Applications are +free to associate control characters with any symbols that are not specified by +this extension. + + + +Lock + + Capitalize the symbol either according to capitalization rules +appropriate to the application locale or using the capitalization rules defined +by this extension (see Default Symbol Transformations). + + + + + + +Interpretation of other modifiers is application dependent. + + +This definition of capitalization is fundamentally different from +the core protocol’s, which uses the lock modifier to select from the symbols +bound to the key. Consider key 9 in the +client map example; +the core protocol provides no way to generate the capital form +of either symbol bound to this key. XKB specifies that we first look up the +symbol and then capitalize, so XKB yields the capital form of the two symbols +when caps lock is active. + + +XKB specifies the behavior of +Lock + and +Control +, but interpretation of other modifiers is left to the application. + + + + + +Client Map Example + + +Consider a simple, if unlikely, keyboard with the following keys (gray +characters indicate symbols that are implied or expected but are not actually +engraved on the key): + + + + + + + + + +The core protocol represents this keyboard as a simple array with one row per +key and four columns (the widest key, key 10, determines the width of the +entire array). + + + + + + + + + + + + + Key + G1L1 + G1L2 + G2L1 + G2L2 + + + + + 8 + Q + NoSymbol + at + NoSymbol + + + 9 + odiaeresis + egrave + NoSymbol + NoSymbol + + + 10 + A + NoSymbol + Æ + NoSymbol + + + 11 + ssharp + question + backslash + questiondown + + + 12 + KP_End + KP_1 + NoSymbol + NoSymbol + + + 13 + Num_Lock + NoSymbol + NoSymbol + NoSymbol + + + 14 + NoSymbol + NoSymbol + NoSymbol + NoSymbol + + + 15 + Return + NoSymbol + NoSymbol + NoSymbol + + + + + + +The row to be used for a given key event is determined by keycode; the column +to be used is determined by the symbols bound to the key, the state of the + +Shift + and +Lock + Modifiers and the state of the modifiers bound to the +Num_Lock + and +Mode_switch + keys as specified by the core protocol. + + + + +The XKB description of this keyboard consists of six key symbol maps, each of +which specifies the types and symbols associated with each keyboard group for +one key: + + + + + + + + + + + + Key + Group: Type + L1 + L2 + + + + + 8 + G1: ALPHABETIC + q + Q + + + G2: ONE_LEVEL + @ + NoSymbol + + + 9 + G1: TWO_LEVEL + odiaeresis + egrave + + + 10 + G1: ALPHABETIC + a + A + + + G2: ALPHABETIC + ae + AE + + + 11 + G1: TWO_LEVEL + ssharp + question + + + G2: ONE_LEVEL + backslash + questiondown + + + 12 + G1: KEYPAD + KP_End + KP_1 + + + 13 + G1: ONE_LEVEL + Num_Lock + + + + 14 + No Groups + + + + + 15 + G1: ONE_LEVEL + Return + + + + + + + +The keycode reported in a key event determines the row to be used for that +event; the effective keyboard group determines the list of symbols and key type +to be used. The key type determines which symbol is chosen from the list. + + + + +Determining the KeySym Associated +with a Key Event details the procedure to map from a key event to a +symbol and/or a string. + + + diff --git a/miniconda3/share/doc/kbproto/ch08.xml b/miniconda3/share/doc/kbproto/ch08.xml new file mode 100644 index 0000000000000000000000000000000000000000..08524a8b10c731bad20fd2a1657df2ea937ab225 --- /dev/null +++ b/miniconda3/share/doc/kbproto/ch08.xml @@ -0,0 +1,157 @@ + +Symbolic Names + + +The core protocol does not provide any information to clients other than that +actually used to interpret events. This makes it difficult to write a client +which presents the keyboard to a user in an easy-to-understand way. Such +applications have to examine the vendor string and keycodes to determine the +type of keyboard connected to the server and have to examine keysyms and +modifier mappings to determine the effects of most modifiers (the +Shift +, +Lock + and +Control + modifiers are defined by the core protocol but no semantics are implied for +any other modifiers). + + + + +This extension provides such applications with symbolic names for most +components of the keyboard extension and a description of the physical layout +of the keyboard. + + + + +The +keycodes + name describes the range and meaning of the keycodes returned by the keyboard +in question; the +keyboard + +geometry +name describes the physical location, size and shape of the various keys on the +keyboard. As an example to distinguish between these two names, consider +function keys on PC-compatible keyboards. Function keys are sometimes above the +main keyboard and sometimes to the left of the main keyboard, but the same +keycode is used for the key that is logically +F1 + regardless of physical position. Thus, all PC-compatible keyboards might share +a keycodes name but different geometry names. + + +The keycodes name is intended to be a very general description of +the keycodes returned by a keyboard; A single keycodes name might cover +keyboards with differing numbers of keys provided that the keys that all keys +have the same semantics when present. For example, 101 and 102 key PC keyboards +might use the same name. Applications can use the keyboard geometry to +determine which subset of the named keyboard type is in use. + + +The +symbols + name identifies the symbols bound to the keys. The symbols name is a human or +application-readable description of the intended locale or usage of the +keyboard with these symbols. The +physical symbols + name describes the symbols actually engraved on the keyboard, which might be +different than the symbols currently being used. + + + + +The +types + name provides some information about the set of key types that can be +associated with the keyboard keys. The +compat + name provides some information about the rules used to bind actions to keys +changed using core protocol requests. + + + + +The +compat +, +types +, +keycodes +, +symbols + and +geometry + names typically correspond to the keyboard components from which the current +keyboard description was assembled. These components are stored individually in +the server’s database of keyboard components, described in + +The Server Database of Keyboard +Components, and can be combined to assemble a complete keyboard +description. + + + + +Each key has a four-byte symbolic name. The key name links keys with similar +functions or in similar positions on keyboards that report different scan +codes. +Key aliases + allow the keyboard layout designer to assign multiple names to a single key, +to make it easier to refer to keys using either their position +or + their "function." + + + + +For example, consider the common keyboard customizations: + + + + + Set the "key to the left of the letter a" to be a control key. + + + + Change the "caps lock" key, wherever it might be, to a control key. + + + + + +If we specify key names by position, the first customization is simple but the +second is impossible; if we specify key names by function, the second +customization is simple but the first is impossible. Using key aliases, we can +specify both function and position for "troublesome" keys, and both +customizations are straightforward. + + + + +Key aliases can be specified both in the symbolic names component and in the +keyboard geometry (see Keyboard +Geometry). Both sets of aliases are always valid, but key alias +definitions in the keyboard geometry have priority; if both symbolic names and +geometry include aliases, applications should consider the definitions from the +geometry before considering the definitions from the symbolic names section. + + + + +XKB provides symbolic names for each of the four keyboard groups, sixteen +virtual modifiers, thirty-two keyboard indicators, and up to +MaxRadioGroups + (32) radio groups. + + + + +XKB allows keyboard layout designers or editors to assign names to each key +type and to each of the levels in a key type. For example, the second position +on an alphabetic key might be called the "Caps" level while the second position +on a numeric keypad key might be called the "Num Lock" level. + + diff --git a/miniconda3/share/doc/kbproto/ch09.xml b/miniconda3/share/doc/kbproto/ch09.xml new file mode 100644 index 0000000000000000000000000000000000000000..d5f587b75e97bea6d3a5dd76224fd73777e4eb75 --- /dev/null +++ b/miniconda3/share/doc/kbproto/ch09.xml @@ -0,0 +1,605 @@ + +Keyboard Indicators + + +Although the core X protocol supports thirty-two LEDs on a keyboard, it does +not provide any way to link the state of the LEDs and the logical state of the +keyboard. For example, most keyboards have a "Caps Lock" LED, but X does not +provide any standard way to make the LED automatically follow the logical state +of the modifier bound to the +Caps Lock + key. + + + + +The core protocol also gives no way to determine which bits in the +led_mask + field of the keyboard state map to the particular LEDs on the keyboard. For +example, X does not provide a method for a client to determine which bit to set +in the +led_mask + to turn on the "Scroll Lock" LED, or even if the keyboard has a "Scroll Lock" +LED. + + + + +Most X servers implement some kind of automatic behavior for one or more of the +keyboard LEDs, but the details of that automatic behavior are +implementation-specific and can be difficult or impossible to control. + + + + +XKB provides indicator names and programmable indicators to help solve these +problems. Using XKB, clients can determine the names of the various indicators, +determine and control the way that the individual indicators should be updated +to reflect keyboard changes, and determine which of the 32 keyboard indicators +reported by the protocol are actually present on the keyboard. Clients may also +request immediate notification of changes to the state of any subset of the +keyboard indicators, which makes it straightforward to provide an on-screen +"virtual" LED panel. + + + +Global Information About Indicators + + +XKB provides only two pieces of information about the indicators as a group. + + + + +The +physical indicators + mask reports which of the 32 logical keyboard indicators supported by the core +protocol and XKB corresponds to some actual indicator on the keyboard itself. +Because the physical indicators mask describes a physical characteristic of the +keyboard, it cannot be directly changed under program control. It is possible, +however, for the set of physical indicators to be change if a new keyboard is +attached or if a completely new keyboard description is loaded by the +XkbGetKeyboardByName + request (see Using the Server’s +Database of Keyboard Components). + + + + +The +indicator state + mask reports the current state of the 32 logical keyboard indicators. This +field and the core protocol indicator state (as reported by the +led-mask + field of the core protocol +GetKeyboardControl + request) are always identical. + + + + + +Per-Indicator Information + + +Each of the thirty-two keyboard indicators has a symbolic name, of type ATOM. +The +XkbGetNames + request reports the symbolic names for all keyboard components, including the +indicators. Use the +XkbSetNames + request to change symbolic names. Both requests are described in Querying and Changing Symbolic +Names. + + + + +Indicator Maps + + +XKB also provides an +indicator map + for each of the thirty-two keyboard indicators; an indicator map specifies: + + + + + The conditions under which the keyboard modifier state affects the +indicator. + + + + The conditions under which the keyboard group state affects the +indicator. + + + + The conditions under which the state of the boolean controls affects +the indicator. + + + + The effect (if any) of attempts to explicitly change the state of the +indicator using the core protocol +SetKeyboardControl + request. + + + + + +If +IM_NoAutomatic + is set in the +flags + field of an indicator map, that indicator never changes in response to changes +in keyboard state or controls, regardless of the values for the other fields of +the indicator map. If +IM_NoAutomatic + is not set in +flags +, the other fields of the indicator map specify the automatic changes to the +indicator in response to changes in the keyboard state or controls. + + + + +The +which_groups + and the +groups + fields of an indicator map determine how the keyboard group state affects the +corresponding indicator. The +which_groups + field controls the interpretation of +groups + and may contain any one of the following values: + + + + + + + + + + Value + Interpretation of the Groups Field + + + + + +IM_UseNone + + The +groups + field and the current keyboard group state are ignored. + + + +IM_UseBase + + If +groups + is non-zero, the indicator is lit whenever the base keyboard group is +non-zero. If +groups + is zero, the indicator is lit whenever the base keyboard group is zero. + + + +IM_UseLatched + + If +groups + is non-zero, the indicator is lit whenever the latched keyboard group is +non-zero. If +groups + is zero, the indicator is lit whenever the latched keyboard group is +zero. + + + +IM_UseLocked + + The +groups + field is interpreted as a mask. The indicator is lit when the current locked +keyboard group matches one of the bits that are set in +groups +. + + + +IM_UseEffective + + The +groups + field is interpreted as a mask. The indicator is lit when the current +effective keyboard group matches one of the bits that are set in +groups +. + + + + + + +The +which_mods + and +mods + fields of an indicator map determine how the state of the keyboard modifiers +affect the corresponding indicator. The +mods + field is an XKB modifier definition, as described in Modifier Definitions, which can +specify both real and virtual modifiers. The mods field takes effect even if +some or all of the virtual indicators specified in +mods + are unbound. + + + + +The +which_mods + field can specify one or more components of the XKB keyboard state. The +corresponding indicator is lit whenever any of the real modifiers specified in +the +mask + field of the +mods + modifier definition are also set in any of the current keyboard state +components specified by the +which_mods +. The +which_mods + field may have any combination of the following values: + + + + + + + + + + Value + Keyboard State Component To Be Considered + + + + + +IM_UseBase + + Base modifier state + + + +IM_UseLatched + + Latched modifier state + + + +IM_UseLocked + + Locked modifier state + + + +IM_UseEffective + + Effective modifier state + + + +IM_UseCompat + + Modifier compatibility state + + + + + + +The +controls + field specifies a subset of the boolean keyboard controls (see "Boolean" Controls and The +EnabledControls Control). The indicator is lit whenever any of the +boolean controls specified in +controls + are enabled. + + + + +An indicator is lit whenever any of the conditions specified by its indicator +map are met, unless overridden by the +IM_NoAutomatic + flag (described above) or an explicit indicator change (described below). + + + + +Effects of Explicit Changes on Indicators + + +If the +IM_NoExplicit + flag is set in an indicator map, attempts to change the state of the indicator +are ignored. + + + + +If both +IM_NoExplicit + and +IM_NoAutomatic + are both absent from an indicator map, requests to change the state of the +indicator are honored but might be immediately superseded by automatic changes +to the indicator state which reflect changes to keyboard state or controls. + + + + +If the +IM_LEDDrivesKB + flag is set and the +IM_NoExplicit + flag is not, the keyboard state and controls are changed to reflect the other +fields of the indicator map, as described in the remainder of this section. +Attempts to explicitly change the value of an indicator for which +IM_LEDDrivesKB + is absent or for which +IM_NoExplicit + is present do not affect keyboard state or controls. + + + + +The effect on group state of changing an explicit indicator which drives the +keyboard is determined by the value of +which_groups + and +groups +, as follows: + + + + + + + + + + + which_groups + New State + Effect on Keyboard Group State + + + + + +IM_UseNone +, or +IM_UseBase + + On or Off + No Effect + + + +IM_UseLatched + + On + The +groups + field is treated as a group mask. The keyboard group latch is changed to the +lowest numbered group specified in +groups +; if +groups + is empty, the keyboard group latch is changed to zero. + + + IM_UseLatched + Off + The +groups + field is treated as a group mask. If the indicator is explicitly extinguished, +keyboard group latch is changed to the lowest numbered group not specified in + +groups +; if +groups + is zero, the keyboard group latch is set to the index of the highest legal +keyboard group. + + + +IM_UseLocked +, or +IM_UseEffective + + On + If the +groups + mask is empty, group is not changed, otherwise the locked keyboard group is +changed to the lowest numbered group specified in +groups +. + + + +IM_UseLocked +, or +IM_UseEffective + + Off + Locked keyboard group is changed to the lowest numbered group that +is not specified in the +groups + mask, or to +Group1 + if the +groups + mask contains all keyboard groups. + + + + + + +The effect on the keyboard modifiers of changing an explicit indicator which +drives the keyboard is determined by the values that are set in of +which_mods + and +mods +, as follows: + + + + + + + + + + + Set in which_mods + New State + Effect on Keyboard Modifiers + + + + + +IM_UseBase + + On or Off + No Effect + + + +IM_UseLatched + + On + Any modifiers specified in the +mask + field of +mods + are added to the latched modifiers. + + + +IM_UseLatched + + Off + Any modifiers specified in the +mask + field of +mods + are removed from the latched modifiers. + + + +IM_UseLocked +, +IM_UseCompat +, or +IM_UseEffective + + On + Any modifiers specified in the +mask + field of +mods + are added to the locked modifiers. + + + +IM_UseLocked + + Off + Any modifiers specified in the +mask + field of +mods + are removed from the locked modifiers. + + + +IM_UseCompat +, or +IM_UseEffective + + Off + Any modifiers specified in the +mask + field of +mods + are removed from both the locked and latched modifiers. + + + + + + +Lighting an explicit indicator which drives the keyboard also enables all of +the boolean controls specified in the +controls + field of its indicator map. Explicitly extinguishing such an indicator +disables all of the boolean controls specified in +controls +. + + + + +The effects of changing an indicator which drives the keyboard are cumulative; +it is possible for a single change to affect keyboard group, modifiers and +controls simultaneously. + + + + +If an indicator for which both the +IM_LEDDrivesKB + and +IM_NoAutomatic + flags are specified is changed, the keyboard changes specified above are +applied and the indicator is changed to reflect the state that was explicitly +requested. The indicator will remain in the new state until it is explicitly +changed again. + + + + +If the +IM_NoAutomatic + flag is not set for an indicator which drives the keyboard, the changes +specified above are applied and the state of the indicator is set to the values +specified by the indicator map. Note that it is possible in this case for the +indicator to end up in a different state than the one that was explicitly +requested. For example, an indicator with +which_mods + of +IM_UseBase + and +mods + of +Shift + is not extinguished if one of the +Shift + keys is physically depressed when the request to extinguish the indicator is +processed. + + + + + diff --git a/miniconda3/share/doc/kbproto/ch10.xml b/miniconda3/share/doc/kbproto/ch10.xml new file mode 100644 index 0000000000000000000000000000000000000000..74362b0a3f6b565ac039c21a250591617143a453 --- /dev/null +++ b/miniconda3/share/doc/kbproto/ch10.xml @@ -0,0 +1,174 @@ + +Keyboard Bells + + +The core protocol provides requests to control the pitch, volume and duration +of the keyboard bell and a request to explicitly sound the bell. + + + + +The X Keyboard Extension allows clients to disable the audible bell, attach a +symbolic name to a bell request or receive an event when the keyboard bell is +rung. + + + +Client Notification of Bells + + +Clients can ask to receive +XkbBellNotify + event when a bell is requested by a client or generated by the server. Bells +can be sounded due to core protocol +Bell + requests, X Input Extension +DeviceBell + requests, X Keyboard Extension +XkbBell + requests or for reasons internal to the server such as the XKB +AccessXFeedback + control. + + + + +Bell events caused by the +XkbBell + request or by the +AccessXFeedback + control include an optional window and symbolic name for the bell. If present, +the window makes it possible to provide some kind of visual indication of which +window caused the sound. The symbolic name can report some information about +the reason the bell was generated and makes it possible to generate a distinct +sound for each type of bell. + + + + + +Disabling Server Generated Bells + + +The global +AudibleBell + boolean control for a keyboard indicates whether bells sent to that device +should normally cause the server to generate a sound. Applications which +provide "sound effects" for the various named bells will typically disable the +server generation of bells to avoid burying the user in sounds. + + + + +When the +AudibleBell + control is active, all bells caused by core protocol +Bell + and X Input Extension +DeviceBell + requests cause the server to generate a sound, as do all bells generated by +the XKB +AccessXFeedback + control. Bells requested via the X +kbBell + request normally cause a server-generated sound, but clients can ask the +server not to sound the default keyboard bell. + + + + +When the +AudibleBell + control is disabled, the server generates a sound only for bells that are +generated using the +XkbBell + request and which specify forced delivery of the bell. + + + + + +Generating Named Bells + + +The +XkbBell + request allows clients to specify a symbolic name which is reported in the +bell events they cause. Bells generated by the +AccessXFeedback + control of this extension also include a symbolic name, but all kinds of +feedback cause a single event even if they sound multiple tones. + + + + +The X server is permitted to use symbolic bell names (when present) to generate +sounds other than simple tones, but it is not required to do so. + + + + +Aside from those used by the XKB +AccessXFeedback + control (see The AccessXFeedback +Control), this extension does not specify bell names or their +interpretation. + + + + + +Generating Optional Named Bells + + +Under some circumstances, some kind of quiet audio feedback is useful, but a +normal keyboard bell is not. For example, a quiet "launch effect" can be +helpful to let the user know that an application has been started, but a loud +bell would simply be annoying. + + + + +To simplify generation of these kinds of effects, the +XkbBell + request allows clients to specify "event only" bells. The X server never +generates a normal keyboard bell for "event only" bells, regardless of the +setting of the global +AudibleBell + control. + + + + +If the X server generates different sounds depending bell name, it is permitted +to generate a sound even for "event only" bells. This field is intended simply +to weed out "normal" keyboard bells. + + + + + +Forcing a Server Generated Bell + + +Occasionally, it is useful to force the server to generate a sound. For +example, a client could "filter" server bells, generating sound effects for +some but sounding the normal server bell for others. Such a client needs a way +to tell the server that the requested bell should be generated regardless of +the setting of the +AudibleBell + control. + + + + +To simplify this process, clients which call the +XkbBell + request can specify that a bell is forced. A forced bell always causes a +server generated sound and never causes a +XkbBellNotify + event. Because forced bells do not cause bell notify events, they have no +associated symbolic name or event window. + + + diff --git a/miniconda3/share/doc/kbproto/ch11.xml b/miniconda3/share/doc/kbproto/ch11.xml new file mode 100644 index 0000000000000000000000000000000000000000..39361a47c31c6af350571576e99e673f2f7fb81f --- /dev/null +++ b/miniconda3/share/doc/kbproto/ch11.xml @@ -0,0 +1,413 @@ + + +Keyboard Geometry + + +The XKB description of a keyboard includes an optional keyboard geometry which +describes the physical appearance of the keyboard. Keyboard geometry describes +the shape, location and color of all keyboard keys or other visible keyboard +components such as indicators. The information contained in a keyboard geometry +is sufficient to allow a client program to draw an accurate two-dimensional +image of the keyboard. + + + + +The components of the keyboard geometry include the following: + + + + + A +symbolic name + to help users identify the keyboard. + + + + The +width + and +height + of the keyboard, in + + + +. For non-rectangular keyboards, the width and height describe the smallest +bounding-box that encloses the outline of the keyboard. + + + + A list of up to +MaxColors + ( +32 +) +color names +. A color name is a string whose interpretation is not specified by XKB. Other +geometry components refer to colors using their indices in this list. + + + + The + base color + of the keyboard is the predominant color on the keyboard and is used as the +default color for any components whose color is not explicitly specified. + + + + The +label color + is the color used to draw the labels on most of the keyboard keys. + + + + The +label font + is a string which describes the font used to draw labels on most keys; XKB +does not specify a format or name space for font names. + + + + A list of +geometry properties +. A geometry property associates an arbitrary string with an equally arbitrary +name. Geometry properties can be used to provide hints to programs that display +images of keyboards, but they are not interpreted by XKB. No other geometry +structures refer to geometry properties. + + + + A list of +key aliases +, as described in Symbolic +Names. + + + + A list of +shapes +; other keyboard components refer to shapes by their index in this list. A +shape consists of a name and one or more closed-polygons called +outlines +. Shapes and outlines are described in detail in Shapes and Outlines. + + + + + +Unless otherwise specified, geometry measurements are in + + + + + units. The origin (0,0) is in the top left corner of the keyboard image. Some +geometry components can be drawn rotated; all such objects rotate about their +origin in + + + + + increments. + + + + +All geometry components include a +priority +, which indicates the order in which overlapping objects should be drawn. +Objects are drawn in order from highest priority ( +0 +) to lowest ( +255 +). + + + + +The description of the actual appearance of the keyboard is subdivided into +named +sections + of related keys and +doodads +. A a +doodad + describes some visible aspect of the keyboard that is not a key. A section is +a collection of keys and doodads that are physically close together and +logically related. + + + +Shapes and Outlines + + +An outline is a list of one or more points which describes a single +closed-polygon, as follows: + + + + + A list with a single point describes a rectangle with one corner at the +origin of the shape ( +0 +, +0 +) and the opposite corner at the specified point. + + + + A list of two points describes a rectangle with one corner at the +position specified by the first point and the opposite corner at the position +specified by the second point. + + + + A list of three or more points describes an arbitrary polygon. If +necessary, the polygon is automatically closed by connecting the last point in +the list with the first. + + + + A non-zero value for the +cornerRadius + field specifies that the corners of the polygon should be drawn as circles +with the specified radius. + + + + + +All points in an outline are specified relative to the origin of the enclosing +shape. Points in an outline may have negative values for the X and Y coordinate. + + + + +One outline (usually the first) is the primary outline; a keyboard display +application can generate a simpler but still accurate keyboard image by +displaying only the primary outlines for each shape. Non-rectangular keys must +include a rectangular +approximation + as one of the outlines associated with the shape; the approximation is not +normally displayed but can be used by very simple keyboard display applications +to generate a recognizable but degraded image of the keyboard. + + + + + +Sections + + +Each section has its own coordinate system — if a section is rotated, the +coordinates of any components within the section are interpreted relative to +the edges that were on the top and left before rotation. The components that +make up a section include: + + + + + A list of +rows +. A row is a list of horizontally or vertically adjacent keys. Horizontal rows +parallel the (pre-rotation) top of the section and vertical rows parallel the +(pre-rotation) left of the section. All keys in a horizontal row share a common +top coordinate; all keys in a vertical row share a left coordinate. + + +A key description consists of a key +name +, a +shape +, a key +color +, and a +gap +. The key +name + should correspond to one of the keys named in the keyboard names description, +the +shape + specifies the appearance of the key, and the key +color + specifies the color of the key (not the label on the key). Keys are normally +drawn immediately adjacent to one another from left-to-right (or top-to-bottom) +within a row. The +gap + field specifies the distance between a key and its predecessor. + + + + An optional list of doodads; any type of doodad can be enclosed within +a section. Position and angle of rotation are relative to the origin and angle +of rotation of the sections that contain them. Priority is relative to the +other components of the section, not to the keyboard as a whole. + + + + An optional list of +overlay keys +. Each overlay key definition indicates a key that can yield multiple scan +codes and consists of a field named +under +, which specifies the primary name of the key and a field named +over +, which specifies the name for the key when the overlay keycode is selected. +The key specified in +under + must be a member of the section that contains the overlay key definition, +while the key specified in over must not. + + + + + + +Doodads + + +Doodads can be global to the keyboard or part of a section. Doodads have +symbolic names of arbitrary length. The only doodad name whose interpretation +is specified by XKB is "Edges", which describes the outline of the entire +keyboard, if present. + + + + +All doodads report their origin in fields named +left + and +top +. XKB supports five kinds of doodads: + + + + + An +indicator doodad + describes one of the physical keyboard indicators. Indicator doodads specify +the shape of the indicator, the indicator color when it is lit ( +on_color +) and the indicator color when it is dark ( +off_color +). + + + + An +outline doodad + describes some aspect of the keyboard to be drawn as one or more hollow, +closed polygons. Outline doodads specify the shape, color, and angle of +rotation about the doodad origin at which they should be drawn. + + + + A +solid doodad + describes some aspect of the keyboard to be drawn as one or more filled +polygons. Solid doodads specify the shape, color and angle of rotation about +the doodad origin at which they should be drawn. + + + + A +text doodad + describes a text label somewhere on the keyboard. Text doodads specify the +label string, the font and color to use when drawing the label, and the angle +of rotation of the doodad about its origin. + + + + A +logo doodad + is a catch-all, which describes some other visible element of the keyboard. A +logo doodad is essentially an outline doodad with an additional symbolic name +that describes the element to be drawn. + + +If a keyboard display program recognizes the symbolic name, it can draw +something appropriate within the bounding region of the shape specified in the +doodad. If the symbolic name does not describe a recognizable image, it should +draw an outline using the specified shape, outline, and angle of rotation. + + +The XKB extension does not specify the interpretation of logo names. + + + + + + +Keyboard Geometry Example + + +Consider the following example keyboard: + + + + + + + + + + +This keyboard has six sections: The left and right function sections (at the +very top) each have one horizontal row with eight keys. The left and right +alphanumeric sections (the large sections in the middle) each have six vertical +rows, with four or five keys in each row. The left and right editing sections +each have three vertical rows with one to three keys per row; the left editing +section is rotated 20° clockwise about its origin while the right editing +section is rotated 20° counterclockwise. + + + + +This keyboard has four global doodads: Three small, round indicators and a +rectangular logo. The program which generated this image did not recognize the +logo, so it displays an outline with an appropriate shape in its place. + + + + +This keyboard has seven shapes: All of the keys in the two function sections +use the "FKEY" shape. Most of the keys in the alphanumeric sections, as well as +four of the keys in each of the editing sections use the "NORM" shape. The keys +in the first column of the left alphanumeric section and the last column of the +right alphanumeric section all use the "WIDE" shape. Two keys in each of the +editing sections use the "TALL" shape. The "LED" shape describes the three +small, round indicators between the function and alphabetic sections. The +"LOGO" shape describes the keyboard logo, and the "EDGE" shape describes the +outline of the keyboard as a whole. + + + + +The keyboard itself is white, as are all of the keys except for the eight keys +that make up the home row, which use the "grey20" color. It isn’t really +visible in this picture, but the three indicators have an "on" color of "green" +and are "green30" when they are turned off. The keys in the alphanumeric and +editing sections all have a (vertical) gap of 0.5mm; the keys in the two +function sections have a (horizontal) gap of 3mm. + + + + +Many of the keys in the right alphanumeric section, and the rightmost key in +the right editing section are drawn with two names in this image. Those are +overlay keys; the bottom key name is the normal name while the overlay name is +printed at the top. For example, the right editing section has a single overlay +key entry, which specifies an +under + name of +<SPCE> + and an +over + name of +<KP0> +, which indicates that the key in question is usually the shift key, but can +behave like the +0 + key on the numeric keypad when an overlay is active. + + + diff --git a/miniconda3/share/doc/kbproto/ch12.xml b/miniconda3/share/doc/kbproto/ch12.xml new file mode 100644 index 0000000000000000000000000000000000000000..efc6d6a2ca63725247d43161eea3e8f6b42cd5c1 --- /dev/null +++ b/miniconda3/share/doc/kbproto/ch12.xml @@ -0,0 +1,1024 @@ + + +Interactions Between XKB and the Core Protocol + + +In addition to providing a number of new requests, XKB replaces or extends +existing core protocol requests and events. Some aspects of the this extension, +such as the ability to lock any key or modifier, are visible even to clients +that are unaware of the XKB extension. Other capabilities, such as control of +keysym selection on a per-key basis, are available only to XKB-aware clients. + + + + +Though they do not have access to some advanced extension capabilities, the XKB +extension includes compatibility mechanisms to ensure that non-XKB clients +behave as expected and operate at least as well with an XKB-capable server as +they do today. + + + + +There are a few significant areas in which XKB state and mapping differences +might be visible to XKB-unaware clients: + + + + + The core protocol uses a modifier to choose between two keyboard +groups, while this extension provides explicit support for multiple groups. + + + + The order of the symbols associated with any given key by XKB might not +match the ordering demanded by the core protocol. + + + + + +To minimize problems that might result from these differences, XKB includes +ways to specify the correspondence between core protocol and XKB modifiers and +symbols. + + + + +This section describes the differences between the core X protocol’s notion +of a keyboard mapping and XKB and explains the ways they can interact. + + + +Group Compatibility Map + + +As described in Keyboard +State, the current keyboard group is reported to XKB-aware clients in +bits 13-14 of the state field of many core protocol events. XKB-unaware clients +cannot interpret those bits, but they might use a keyboard modifier to +implement support for a single keyboard group. To ensure that pre-XKB clients +continue to work when XKB is present, XKB makes it possible to map an XKB state +field, which includes both keyboard group and modifier state into a pre-XKB +state field which contains only modifiers. + + + + +A keyboard description includes one +group compatibility map + per keyboard group (four in all). Each such map is a modifier definition (i.e. +specifies both real and virtual modifiers) which specifies the modifiers to be +set in the compatibility states when the corresponding keyboard group is +active. Here are a few examples to illustrate the application of the group +compatibility map: + + + + + + + + + + + + + + Group + GroupCompat Map + Effective Modifiers + State for XKB Clients + Compatibility Modifiers + State for non-XKB Clients + + + + + 1 + Group1=None + Shift + x00xxxxx00000001 + Shift + xxxxxxxx00000001 + + + 2 + Group2=Mod3 + None + x01xxxxx00000000 + Mod3 + xxxxxxxx00100000 + + + 3 + Group3=Mod2 + Shift + x10xxxxx00000001 + Shift+Mod2 + xxxxxxxx00010001 + + + 4 + Group4=None + Control + x11xxxxx00000100 + Control + xxxxxxxx00000100 + + + + + + +Note that non-XKB clients (i.e. clients that are linked with a version of the X +library that does not support XKB) cannot detect the fact that +Group4 + is active in this example because the group compatibility map for +Group4 + does not specify any modifiers. + + + + +Setting a Passive Grab for an XKB State + + +The fact that the +state + field of an event might look different when XKB is present can cause problems +with passive grabs. Existing clients specify the modifiers they wish to grab +using the rules defined by the core protocol, which use a normal modifier to +indicate keyboard group. If we used an XKB state field, the high bits of the +state field would be non-zero whenever the keyboard was in any group other than + +Group1 +, and none of the passive grabs set by clients could ever be triggered. + + + + +To avoid this behavior, the X server normally uses the compatibility grab state +to decide whether or not to activate a passive grab, even for XKB-aware +clients. The group compatibility map attempts to encode the keyboard group in +one or more modifiers of the compatibility state, so existing clients continue +to work exactly the way they do today. By default, there is no way to directly +specify a keyboard group in a +Grabbed + or +GrabButton + request, but groups can be specified indirectly by correctly adjusting the +group compatibility map. + + + + +Clients that wish to specify an XKB keyboard state, including a separate +keyboard group, can set the +GrabsUseXKBState + per-client flag which indicates that all subsequent key and button grabs from +the requesting clients are specified using an XKB state. + + + + +Whether the XKB or core state should be used to trigger a grab is determined by +the setting of the +GrabsUseXKBState + flag for the requesting client at the time the key or button is grabbed. There +is no way to change the state to be used for a grab that is already registered +or for grabs that are set by some other client. + + + + + + +Changing the Keyboard Mapping Using the Core Protocol + + +An XKB keyboard description includes a lot of information that is not present +in the core protocol description of a keyboard. Whenever a client remaps the +keyboard using core protocol requests, XKB examines the map to determine likely +default values for the components that cannot be specified using the core +protocol. + + + + +Some aspects of this automatic mapping are configurable, and make it fairly +easy to take advantage of many XKB features using existing tools like +xmodmap +, but much of the process of mapping a core keyboard description into an XKB +description is designed to preserve compatible behavior for pre-XKB clients and +cannot be redefined by the user. Clients or users that want behavior that +cannot be described using this mapping should use XKB functions directly. + + + + +Explicit Keyboard Mapping Components + + +This automatic remapping might accidentally replace definitions that were +explicitly requested by an application, so the XKB keyboard description defines +a set of +explicit components + for each key; any components that are listed in the explicit components for a +key are not changed by the automatic keyboard mapping. The explicit components +field for a key can contain any combination of the following values: + + + + + + + + + + Bit in Explicit Mask + Protects Against + + + + + ExplicitKeyType1 + Automatic determination of the key type associated with +Group1 + (see Assigning Types To Groups of +Symbols for a Key) + + + ExplicitKeyType2 + Automatic determination of the key type associated with +Group2 +(see Assigning Types To Groups of +Symbols for a Key) + + + ExplicitKeyType3 + Automatic determination of the key type associated with +Group3 +(see Assigning Types To Groups of +Symbols for a Key). + + + ExplicitKeyType4 + Automatic determination of the key type associated with +Group4 +(see Assigning Types To Groups of +Symbols for a Key). + + + ExplicitInterpret + Application of any of the fields of a symbol interpretation to the +key in question (see Assigning +Actions To Keys). + + + ExplicitAutoRepeat + Automatic determination of autorepeat status for the key, as +specified in a symbol interpretation (see Assigning Actions To +Keys). + + + ExplicitBehavior + Automatic assignment of the +KB_Lock + behavior to the key, if the +LockingKey + flag is set in a symbol interpretation (see Assigning Actions To +Keys). + + + ExplicitVModMap + Automatic determination of the virtual modifier map for the key +based on the actions assigned to the key and the symbol interpretations which +match the key (see Assigning +Actions To Keys). + + + + + + + +Assigning Symbols To Groups + + +The first step in applying the changes specified by a core protocol +ChangeKeyboardMapping + request to the XKB description of a keyboard is to determine the number of +groups that are defined for the key and the width of each group. The XKB +extension does not change key types in response to core protocol +SetModifierMapping + requests, but it does choose key actions as described in Assigning Actions To Keys. + + + + +Determining the number of symbols required for each group is straightforward. +If the key type for some group is not protected by the corresponding +ExplicitKeyType + component, that group has two symbols. If any of the explicit components for +the key include +ExplicitKeyType3 + or +ExplicitKeyType4 +, the width of the key type currently assigned to that group determines the +number of symbols required for the group in the core protocol keyboard +description. The explicit type components for +Group1 + and +Group2 + behave similarly, but for compatibility reasons the first two groups must have +at least two symbols in the core protocol symbol mapping. Even if an explicit +type assigned to either of the first two keyboard groups has fewer than two +symbols, XKB requires two symbols for it in the core keyboard description. + + + + +If the core protocol request contains fewer symbols than XKB needs, XKB adds +trailing +NoSymbol + keysyms to the request to pad it to the required length. If the core protocol +request includes more symbols than it needs, XKB truncates the list of keysyms +to the appropriate length. + + + + +Finally, XKB divides the symbols from the (possibly padded or truncated) list +of symbols specified by the core protocol request among the four keyboard +groups. In most cases, the symbols for each group are taken from the core +protocol definition in sequence (i.e. the first pair of symbols is assigned to + +Group1 +, the second pair of symbols is assigned to +Group2 +, and so forth). If either +Group1 + or +Group2 + has an explicitly defined key type with a width other than two, it gets a +little more complicated. + + + + +Assigning Symbols to Groups One and Two with Explicitly Defined Key Types + + +The server assigns the first four symbols from the expanded or truncated map to +the symbol positions G1L1 , G1L2, +G2L1 and G2L2, respectively. If the key +type assigned to Group1 reports more than two shift levels, +the fifth and following symbols contain +the extra keysyms for +Group2 +. If the key type assigned to +Group2 + reports more than two shift levels, the extra symbols follow the symbols (if +any) for +Group1 + in the core protocol list of symbols. Symbols for +Group3 + and +Group4 + are contiguous and follow the extra symbols, if any, for +Group1 + and +Group2 +. + + + + +For example, consider a key with a key type that returns three shift levels +bound to each group. The symbols bound to the core protocol are assigned in +sequence to the symbol positions: + + + +G1L1, G1L2, G2L1, G2L2, G1L3, G2L3, G3L1, G3L2, G3L3, G4L1, G4L2, and G4L3 + + + +For a key with a width one key type on group one, a width two key type on group +two and a width three key type on group three, the symbols bound to the key by +the core protocol are assigned to the following key positions: + + + +G1L1, (G1L2), G2L1, G2L2, G3L1, G3L2, G3L3 + + + +Note that the second and fourth symbols (positions +G1L2 and G2L2 +) can never be generated if the key type associated with the group yields only +one symbol. XKB accepts and ignores them in order to maintain compatibility +with the core protocol. + + + + + + +Assigning Types To Groups of Symbols for a Key + + +Once the symbols specified by +ChangeKeyboardMapping + have been assigned to the four keyboard groups for a key, the X server assigns +a key type to each group on the key from a canonical list of key types. The +first four key types in any keyboard map are reserved for these standard key +types: + + + + + + + + + + Key Type Name + Standard Definition + + + + + +ONE_LEVEL + + Describes keys that have exactly one symbol per group. Most special +or function keys (such as +Return +) are +ONE_LEVEL + keys. Any combination of modifiers yields level +0 +. Index +0 + in any key symbol map specifies key type +ONE_LEVEL +. + + + +TWO_LEVEL + + Describes non-keypad and non-alphabetic keys that have exactly two +symbols per group. By default, the +TWO_LEVEL + type yields column +1 + if the Shift modifier is set, column +0 + otherwise. Index +1 + in any key symbol map specifies key type +TWO_LEVEL +. + + + +ALPHABETIC + + Describes alphabetic keys that have exactly two symbols per group. +The default definition of the +ALPHABETIC + type provides shift-cancels-caps behavior as described in Key Types. Index +2 + in any key symbol map specifies key type +ALPHABETIC +. + + + +KEYPAD + + Describes numeric keypad keys with two symbols per group. Yields +column +1 + if either of the +Shift + modifier or the real modifier bound to the virtual modifier named +NumLock + are set. Yields column +0 + if neither or both modifiers are set. Index +3 + in any key symbol map specifies key type +KEYPAD +. + + + + + + +Users or applications may change these key types to get different default +behavior (to make shift cancel caps lock, for example) but they must always +have the specified number of symbols per group. + + + + +Before assigning key types to groups, the X server expands any alphanumeric +symbol definitions as follows: + + + + +If the second symbol of either group is +NoSymbol + and the first symbol of that group is an alphabetic keysym for which both +lowercase and uppercase forms are defined, the X server treats the key as if +the first element of the group were the lowercase form of the symbol and the +second element were the uppercase form of the symbol. For the purposes of this +expansion, XKB ignores the locale and uses the capitalization rules defined in +Default Symbol Transformations. + + + + +For each keyboard group that does not have an explicit type definition, XKB +chooses a key type from the canonical key types. If the second symbol assigned +to a group is +NoSymbol + (after alphabetic expansion), the server assigns key type +ONE_LEVEL +. If the group contains the lowercase and uppercase forms of a single glyph +(after alphanumeric expansion), the server assigns key type +ALPHABETIC +. If either of the symbols in a group is a numeric keypad keysym ( +KP_* +), the server assigns key type +KEYPAD +. Otherwise, it assigns key type +TWO_LEVEL +. + + + + +Finally, XKB determines the number of groups of symbols that are actually +defined for the key. Trailing empty groups (i.e. groups that have +NoSymbol + in all symbol positions) are ignored. + + + + +There are two last special cases for compatibility with the core protocol: If, +after trailing empty groups are excluded, all of the groups of symbols bound to +the key have identical type and symbol bindings, XKB assigns only one group to +the key. If +Group2 + is empty and either of +Group3 + or +Group4 + are not, and if neither +Group1 + nor +Group2 + have explicit key types, XKB copies the symbols and key type from +Group1 + into +Group2 +. + + + + + +Assigning Actions To Keys + + +Once symbols have been divided into groups and key types chosen for the keys +affected by a +ChangeKeyboardMapping + request, XKB examines the symbols and modifier mapping for each changed key +and assigns server actions where appropriate. XKB also automatically assigns +server actions to changed keys if the client issues a core protocol +SetModifierMapping + request, and does so optionally in response to +XkbSetMap + and +XkbSetCompatMap + requests. + + + + +The compatibility map includes a list of +symbol interpretations +, which XKB compares to each symbol associated with any changed keys in turn, +unless the +ExplicitInterp + component is set for a key. Setting the +ExplicitInterp + component prevents the application of symbol interpretations to that key. + + + + +If the modifiers and keysym specified in a symbol interpretation match the +modifier mapping and a symbol bound to a changed key that is not protected by + +ExplicitInterp +, the server applies the symbol interpretation to the symbol position. The +server considers all symbol interpretations which specify an explicit keysym +before considering any that do not. The server uses the first interpretation +which matches the given combination of keysym and modifier mapping; other +matching interpretations are ignored. + + + + +XKB uses four of the fields of a symbol interpretation to decide if it matches +one of the symbols bound to some changed key: + + + + + The +symbol + field is a keysym which matches if it has the value +NoSymbol + or is identical to the symbol in question. + + + + The modifiers specified in the +mods + field are compared to the modifiers affected by the key in question as +indicated by +match +. + + + + The +match + field can specify any of the comparisons: +NoneOf +, +AnyOfOrNone +, +AnyOf +, +AllOf + or +Exactly +. + + + + The +levelOneOnly + setting, indicates that the interpretation in question should only use the +modifiers bound to this key by the modifier mapping if the symbol that matches +in level one of its group. Otherwise, if the symbol being considered is not in +shift level one of its group, the server behaves as if the modifier map for the +key were empty. Note that it is still possible for such an interpretation to +apply to a symbol in a shift level other than one if it matches a key without +modifiers; the +levelOneOnly + flag only controls the way that matches are determined and that the key +modifiers are applied when an interpretation does match. + + + + + +Applying a symbol interpretation can affect several aspects of the XKB +definition of the key symbol mapping to which it is applied: + + + + + The +action + specified in the symbol interpretation is bound to the symbol position; any +key event which yields that symbol will also activate the new action. + + + + If the matching symbol is in position G1L1, the autorepeat behavior of +the key is set from the +autorepeat + field of the symbol interpretation. The +ExplicitAutoRepeat + component protects the autorepeat status of a key from symbol interpretation +initiated changes. + + + + If the symbol interpretation specifies an associated virtual modifier, +that virtual modifier is added to the virtual modifier map for the key. The + +ExplicitVModMap + component guards the virtual modifier map for a key from automatic changes. If +the +levelOneOnly + flag is set for the interpretation, and the symbol in question is not in +position G1L1, the virtual modifier map is not updated. + + + + If the matching symbol is in position G1L1, and the +locking key + field is set in the symbol interpretation, the behavior of the key is changed +to +KB_Lock + (see Key Behavior). The + +ExplicitBehavior + component prevents this change. + + + + + +If no interpretations match a given symbol or key, the server uses: +SA_NoAction +, autorepeat enabled, non-locking key. with no virtual modifiers. + + + + +If all of the actions computed for a key are +SA_NoAction +, the server assigns an length zero list of actions to the key. + + + + +If the core protocol modifier mapping is changed, the server regenerates +actions for the affected keys. The +XkbSetMap + and +XkbSetCompatMap + requests can also cause actions for some or all keyboard keys to be recomputed. + + + + + +Updating Everything Else + + +Changes to the symbols or modifier mapping can affect the bindings of virtual +modifiers. If any virtual modifiers change, XKB updates all of its data +structures to reflect the change. Applying virtual modifier changes to the +keyboard mapping night result in changes to types, the group compatibility map, +indicator maps, internal modifiers or ignore locks modifiers. + + + + + + +Effects of XKB on Core Protocol Events + + +After applying server actions which modify the base, latched or locked modifier +or group state of the keyboard, the X server recomputes the effective group and +state. Several components of the keyboard state are reported to XKB-aware +clients depending on context (see +Keyboard State for a detailed description of each of the keyboard state +components): + + + + + The effective modifier state is reported in +XkbStateNotify + events and in response to +XkbGetState + requests. + + + + The symbol lookup state is reported to XKB-aware clients in the state +field of core protocol and input extension key press and release events that do +not activate passive grabs. Unless the +LookupStateWhenGrabbed + per-client flag is set, the lookup state is only reported in these events when +no grabs are active. + + + + The grab state is reported to XKB-aware clients in the state field of +all core protocol events that report keyboard state, except +KeyPress + and +KeyRelease + events that do not activate passive grabs. + + + + The effective group is the sum of the base, latched and locked keyboard +groups. An out of range effective group is wrapped or truncated into range +according to the setting of the +groupsWrap + flag for the keyboard. + + + + + +The server reports compatibility states to any clients that have not issued a +successful +XkbUseExtension + request. The server computes the compatibility symbol lookup state and the +compatibility effective grab state by applying the compatibility modifier map +to the corresponding computed XKB states. + + + + +The compatibility symbol lookup state is reported to non-XKB clients whenever +an XKB-aware client would receive the XKB lookup state. The compatibility grab +state is reported to XKB-unaware clients whenever an XKB client would receive +the XKB grab state. + + + + +If the +GrabsUseXKBState + per-client option is not set, even XKB-aware clients receive the compatibility +grab state in events that trigger or terminate passive grabs. If this flag is +not set, XKB clients also receive the compatibility grab or lookup state +whenever any keyboard grab is active. + + + + +If the +LookupStateWhenGrabbed + per-client option is set, clients receive either the XKB or compatibility +lookup state when the keyboard is grabbed, otherwise they receive either the +XKB or compatibility grab state. All non-XKB clients receive the compatibility +form of the appropriate state component; the form that is sent to an XKB-aware +client depends on the setting of the +GrabsUseXKBState + option for that client. + + + + + +Effect of XKB on Core Protocol Requests + + +Whenever a client updates the keyboard mapping using a core protocol request, +the server saves the requested core protocol keyboard mapping and reports it to +any clients that issue +GetKeyboardMapping + or +GetModifierMapping + requests. Whenever a client updates the keyboard mapping using XKB requests, +the server discards the affected portion of the stored core keyboard +description and regenerates it based on the XKB description of the keyboard. + + + + +The symbols associated with the XKB keyboard description appear in the order: + + + +G1L1 G1L2 G2L1 G2L2 G1L3-n G2L3-n G3L* G4L* + + + +If the type associated with +Group1 + is width one, the second symbol is +NoSymbol +; if the type associated with +Group2 + is width one, the fourth symbol is +NoSymbol +. + + + + +If a key has only one group but the keyboard has several, the symbols for + +Group1 + are repeated for each group. For example, given a keyboard with three groups +and a key with one group that contains the symbols { +a A + }, the core protocol description would contain the six symbols: { +a + +A + +a + +A + +a + +A + }. As a slightly more complicated example, an XKB key which had a single width +three group with the symbols { +a + +b + +c + } would show up in the generated core protocol keyboard description with the +symbols { +a + +b + +a + +b + +c + +c + +a + +b + +c + } for a keyboard with three groups. + + + + +The generated modifier mapping for a key contains all of the modifiers affected +by all of the actions associated with the key plus all of the modifiers +associated with any virtual modifiers bound to the key by the virtual modifier +mapping. If any of the actions associated with a key affect any component of +the keyboard group, any modifiers specified in any entry of the group +compatibility map (see Group +Compatibility Map) are reported in the modifier mask. The +SA_ISOLock + action can theoretically affect any modifier, but the modifier map of an + +SA_ISOLock + key contains only the modifiers or group state that it sets by default. + + + + +The server notifies interested clients of keyboard map changes in one of two +ways. It sends +XkbMapNotify + to clients that have explicitly selected them and core protocol +MappingNotify + events to clients that have not. Once a client requests +XkbMapNotify + events, the server stops sending it +MappingNotify + events to inform it of keyboard changes. + + + + + +Sending Events to Clients + + +XKB normally assumes that events sent to clients using the core protocol + +SendEvent + request contain a core protocol state, if applicable. If the client which will +receive the event is not XKB-capable, XKB attempts to convert the core state to +an XKB state as follows: if any of the modifiers bound to +Group2 + in the group compatibility map are set in the event state, XKB clears them in +the resulting event but sets the effective group in the event state to + +Group2 +. + + + + +If the +PCF_SendEventUsesXKBState + per-client flag is set at the time of the SendEvent request, XKB instead +assumes that the event reported in the event is an XKB state. If the receiving +client is not XKB-aware, the extension converts the XKB state (which contains +the effective state in bits 13-14) to a core state by applying the group +compatibility map just as it would for actual key events. + + + + diff --git a/miniconda3/share/doc/kbproto/ch13.xml b/miniconda3/share/doc/kbproto/ch13.xml new file mode 100644 index 0000000000000000000000000000000000000000..25fa96dd95a8a223bcaa929d655808765bee9b8e --- /dev/null +++ b/miniconda3/share/doc/kbproto/ch13.xml @@ -0,0 +1,442 @@ + +The Server Database of Keyboard Components + + +The X server maintains a database of keyboard components and common keyboard +mappings. This database contains five kinds of components; when combined, these +five components provide a complete description of a keyboard and its behavior. + + + + +The X Keyboard Extension provides requests to list the contents of this +database, to assemble and complete keyboard descriptions by merging the current +keyboard description with the contents of this database, or to replace the +current keyboard description with a complete keyboard description assembled as +described below. + + + +Component Names + + +Component and keymap names have the form " +class +( +member +)" where +class + describes a subset of the available components for a particular type and the +optional +member + identifies a specific component from that subset. For example, the name +"atlantis(acme)" might specify the symbols used for the atlantis national +keyboard layout by the vendor "acme." Each class has an optional +default + member — references which specify a class but not a member refer to the +default member of the class, if one exists. + + + + +The +class + and +member + names are both specified using characters from the Latin-1 character set. XKB +implementations must accept all alphanumeric characters, minus (‘-’) and +underscore (‘_’) in class or member names, and must not accept parentheses, +plus, vertical bar, percent sign, asterisk, question mark or white space. The +use of other characters is implementation-dependent. + + + + + +Partial Components and Combining Multiple Components + + +Some of the elements in the server database contain describe only a piece of +the corresponding keyboard component. These +partial + components should be combined with other components of the same type to be +useful. + + + + +For example, a partial symbols map might describe the differences between a +common ASCII keyboard and some national layout. Such a partial map is not +useful on its own because it does not include those symbols that are the same +on both the ASCII and national layouts (such as function keys). On the other +hand, this partial map can configure +any + ASCII keyboard to use a national layout. + + + + +Two components can be combined in two ways: + + + + + If the second component +overrides + the first, any definitions that are present in both components are taken from +the second. + + + + If the second component +augments + the first, any definitions that are present in both components are taken from +the first. + + + + + +Applications can use a +component expression + to combine multiple components of some time into a complete description of +some aspect of the keyboard. A component expression is a string which lists the +components to be combined separated by operators which specify the rules for +combining them. A complete description is assembled from the listed components, +left to right, as follows: + + + + + If the new elements are being merged with an existing map, the special +component name ‘%’ refers to the unmodified value of the map. + + + + The ‘+’ operator specifies that the next specified component should +override the current assembled definition. + + + + The ‘|’ operator specifies that the next specified component should +augment the currently assembled definition. + + + + If the new elements are being merged with an existing map and the +component expression begins with an operator, a leading ‘%’ is implied. + + + + If any unknown or illegal characters appear anywhere in the string, the +entire expression is invalid and is ignored. + + + + + +For example, the component expression "+de" specifies that the default element +of the "de" map should be applied to the current keyboard mapping, overriding +any existing definitions. + + + + +A slightly more involved example: the expression +"acme(ascii)+de(basic)|iso9995-3" constructs a German (de) mapping for the +ASCII keyboard supplied by the "acme" vendor. The new definition begins with +the symbols for the default ASCII keyboard for Acme, overrides them with any +keys that are defined for the default German keyboard layout and then applies +the definitions from the iso9995-3 to any undefined keys or groups of keys +(part three of the iso9995 standard defines a common set of bindings for the +secondary group, but allows national layouts to override those definitions +where necessary). + + + + + +Component Hints + + +Each component has a set of flags that provide some additional hints about that +component. XKB provides these hints for clients that present the keyboard +database to users and specifies their interpretation only loosely. Clients can +use these hints to constrain the list of components or to control the way that +components are presented to the user. + + + + +Hints for a component are reported with its name. The least significant byte of +the hints field has the same meaning for all five types of keyboard components, +and can contain any combination of the following values: + + + + + + + + + + Flag + Meaning + + + + + +LC_Hidden + + Indicates a component that should not normally be presented to the +user. + + + +LC_Default + + Indicates a component that is the default member of its +class. + + + +LC_Partial + + Indicates a partial component. + + + + + + +The interpretation of the most significant byte of the hints field is dependent +on the type of component. The hints defined for each kind of component are +listed in the section below that describes that kind of component. + + + + + +Keyboard Components + + +The five types of components stored in the server database of keyboard +components correspond to the +symbols +, +geometry +, +keycodes +, +compat + and +types + symbolic names associated with a keyboard. + + + + +The Keycodes Component + + +The +keycodes + component of a keyboard mapping specifies the range and interpretation of the +raw keycodes reported by the device. It sets the +keycodes + symbolic name, the minimum and maximum legal keycodes for the keyboard, and +the symbolic name for each key. The keycodes component might also contain +aliases for some keys, symbolic names for some indicators, and a description of +which indicators are physically present. + + + + +The special keycodes component named "computed" indicates that XKB should +assign unused keycodes to any unknown keys referenced by name by any of the +other components. The computed keycodes component is useful primarily when +browsing keymaps because it makes it possible to use the symbols and geometry +components without having to find a set of keycodes that includes keycode +definitions for all of the keys listed in the two components. + + + + +XKB defines no hints that are specific to the keycodes component. + + + + +The Types Component + + +The +types + component of a keyboard mapping specifies the key types that can be associated +with the various keyboard keys. It affects the +types + symbolic name and the list of types associated with the keyboard (see +Key Types). The types component +of a keyboard mapping can also optionally contain real modifier bindings and +symbolic names for one or more virtual modifiers. + + + + +The special types component named "canonical" always contains the types and +definitions listed in Canonical Key Types of this document. + + + + +XKB defines no hints that are specific to the types component. + + + + + +The Compatibility Map Component + + +The +compatibility map + component of a keyboard mapping primarily specifies the rules used to assign +actions to keysyms. It affects the +compat + symbolic name, the symbol compatibility map and the group compatibility map. +The compat component might also specify maps for some indicators and the real +modifier bindings and symbolic names of some virtual modifiers. + + + + +XKB defines no hints that are specific to the compatibility map component. + + + + + +The Symbols Component + + +The +symbols + component of a keyboard mapping specifies primarily the symbols bound to each +keyboard key. It affects the +symbols + symbolic name, a key symbol mapping for each key, they keyboard modifier +mapping, and the symbolic names for the keyboard symbol groups. Optionally, the + +symbols + component can contain explicit actions and behaviors for some keys, or the +real modifier bindings and symbolic names for some virtual modifiers. + + + + +XKB defines the following additional hints for the symbols component: + + + + + + + + + + Flag + Meaning + + + + + +LC_AlphanumericKeys + + Indicates a symbol component that contains bindings primarily for an +alphanumeric section of the keyboard. + + + +LC_ModifierKeys + + Indicates a symbol component that contains bindings primarily for +modifier keys. + + + +LC_KeypadKeys + + Indicates a symbol component that contains bindings primarily for +numeric keypad keys. + + + LC_FunctionKeys + Indicates a symbol component that contains bindings primarily for +function keys. + + + LC_AlternateGroup + Indicates a symbol component that contains bindings for an alternate +keyboard group. + + + + + + +These hints only apply to partial symbols components; full symbols components +are assumed to specify all of the pieces listed above. + + +The alphanumeric, modifier, keypad or function keys hints should +describe the primary intent of the component designer and should not simply an +exhaustive list of the kinds of keys that are affected. For example, national +keyboard layouts affect primarily alphanumeric keys, but many affect a few +modifier keys too; such mappings should set only +LC_AlphanumericKeys + hint. In general, symbol components should set only one of those four flags +(though +LC_AlternateGroup + may be combined with any of the other flags). + + + +The Geometry Component + + +The +geometry + component of a keyboard mapping specifies primarily the geometry of the +keyboard. It contains the geometry symbolic name and the keyboard geometry +description. The geometry component might also contain aliases for some keys or +symbolic names for some indicators and might affect the set of indicators that +are physically present. Key aliases defined in the geometry component of a +keyboard mapping override those defined in the keycodes component. + + + + +XKB defines no hints that are specific to the geometry component. + + + + + + +Complete Keymaps + + +The X server also reports a set of fully specified keymaps. The keymaps +specified in this list are usually assembled from the components stored in the +rest of the database and typically represent the most commonly used keymaps for +a particular system. + + + + +XKB defines no hints that are specific to complete keymaps. + + + diff --git a/miniconda3/share/doc/kbproto/ch14.xml b/miniconda3/share/doc/kbproto/ch14.xml new file mode 100644 index 0000000000000000000000000000000000000000..6a2f45a0bf24cd517277c2997c8317b013647f08 --- /dev/null +++ b/miniconda3/share/doc/kbproto/ch14.xml @@ -0,0 +1,94 @@ + +Replacing the Keyboard "On-the-Fly" + + +XKB supports the +XkbNewKeyboardNotify + event, which reports a change in keyboard geometry or the range of supported +keycodes. The server can generate an +XkbNewKeyboardNotify + event when it detects a new keyboard, or in response to an +XkbGetKeyboardByName + request (see Using the Server’s +Database of Keyboard Components) which loads a new keyboard description. + + + + +When a client opens a connection to the X server, the server reports the +minimum and maximum keycodes. If the range of supported keycodes is changed, +XKB keeps track of the minimum and maximum keycodes that were reported to each +client and filters out any events that fall outside of that range. Note that +these events are simply ignored; they are not delivered to some other client. + + + + +When the server sends an +XkbNewKeyboardNotify + event to a client to inform it of the new keycode range, XKB resets the stored +range of legal keycodes to the keycode range reported in the event. Non-XKB +clients and XKB-aware clients that do not request +XkbNewKeyboardNotify + events never receive events from keys that fall outside of the legal range +that XKB maintains for that client. + + + + +When a client requests +XkbNewKeyboardNotify + events, the server compares the range of keycodes for the current keyboard to +the range of keycodes that are valid for the client. If they are not the same, +the server immediately sends that client an +XkbNewKeyboardNotify + event. Even if the "new" keyboard is not new to the server, it is new to this +particular client. + + + + +In addition to filtering out-of-range key events, XKB: + + + + + Adjusts core protocol +MappingNotify + events to refer only to keys that match the stored legal range. + + + + Reports keyboard mappings for keys that match the stored legal range to +clients that issue a core protocol +GetKeyboardMapping + request. + + + + Reports modifier mappings only for keys that match the stored legal +range to clients that issue a core protocol +GetModifierMapping + request. + + + + Restricts the core protocol +ChangeKeyboardMapping + and +SetModifierMapping + requests to keys that fall inside the stored legal range. + + + + + +In short, XKB does everything possible to hide the fact that the range of legal +keycodes has changed from clients non-XKB clients, which cannot be expected to +deal with it. The corresponding XKB events and requests do +not + pay attention to the legal keycode range in the same way because XKB makes it +possible for clients to track changes to the keycode range for a device and +respond to them. + + diff --git a/miniconda3/share/doc/kbproto/ch15.xml b/miniconda3/share/doc/kbproto/ch15.xml new file mode 100644 index 0000000000000000000000000000000000000000..d3e47d0f75742dc6de6a0c47e578345391e488cc --- /dev/null +++ b/miniconda3/share/doc/kbproto/ch15.xml @@ -0,0 +1,233 @@ + +Interactions Between XKB and the X Input Extension + + +All XKB interactions with the input extension are optional; implementors are +free to restrict the effects of the X Keyboard Extension to the core keyboard +device. The +XkbGetExtensionDeviceInfo + request reports whether or not an XKB implementation supports a particular +capability for input extension devices. + + + + +XKB recognizes the following interactions with the X Input Extension: + + + + + + + + + + Name + Capability + + + + + XI_Keyboards + If set, applications can use all XKB requests and events with +extension keyboards. + + + XI_ButtonActions + If set, clients can assign key actions to buttons, even on input +extension devices that are not keyboards. + + + XI_IndicatorNames + If set, clients can assign names to indicators on non-keyboard +extension devices. + + + XI_IndicatorMaps + If set, clients can assign indicator maps to indicators on +non-keyboard extension devices. + + + XI_IndicatorState + If set, clients can change the state of device indicators using the + +XkbSetExtensionDeviceInfo + request. + + + + + + +Attempts to use an XKB feature with an extension device fail with a +Keyboard + error if the server does not support the +XkbXI_Keyboards + optional feature. If a capability particular capability other than +XkbXI_Keyboards + is not supported, attempts to use it fail silently. The replies for most +requests that can use one of the other optional features include a field to +report whether or not the request was successful, but such requests do not +cause an error condition. + + + + +Clients can also request an +XkbExtensionDeviceNotify + event. This event notifies interested clients of changes to any of the +supported XKB features for extension devices, or if a request from the client +that is receiving the event attempted to use an unsupported feature. + + + +Using XKB Functions with Input Extension Keyboards + + +All XKB requests and events include a device identifier which can refer to an +input extension +KeyClass + device, if the implementation allows XKB to control extension devices. If the +implementation does not support XKB manipulation of extension devices, the +device identifier is ignored but it must be either +0 + or +UseCoreKbd +. + + + + +Implementations which do not support the use of XKB functions with extension +keyboards must not set the +XkbXI_Keyboards + flag. Attempts to use XKB features on an extension keyboard with an +implementation that does not support this feature yield a +Keyboard + error. + + + + + +Pointer and Device Button Actions + + +The XKB extension optionally allows clients to assign any key action (see +Key Actions) to core +pointer or input extension device buttons. This makes it possible to control +the keyboard or generate keyboard key events from extension devices or from the +core pointer. + + + + +XKB implementations are required to support actions for the buttons of the core +pointer device, but support for actions on extension devices is optional. +Implementations which do not support button actions for extension devices must +not set the +XkbXI_ButtonActions + flag. + + + + +Attempts to query or assign button actions with an implementation that does not +support this feature report failure in the request reply and might cause the +server to send an +XkbExtensionDeviceNotify + event to the client which issued the request that failed. Such requests never +cause an error condition. + + + + + +Indicator Maps for Extension Devices + + +The XKB extension allows applications to assign indicator maps to the +indicators of non-keyboard extension devices. If supported, maps can be +assigned to all extension device indicators, whether they are part of a +keyboard feedback or part of an indicator feedback. + + + + +Implementations which do not support indicator maps for extension devices must +not set the +XkbXI_IndicatorMaps + flag. + + + + +Attempts to query or assign indicator maps with an implementation that does not +support this feature report failure in the request reply and might cause the +server to send an +XkbExtensionDeviceNotify + event to the client which issued the request that failed. Such requests never +cause an error condition. + + + + +If this feature is supported, the maps for the default indicators on the core +keyboard device are visible both as extension indicators and as the core +indicators. Changes made with +XkbSetDeviceInfo + are visible via +XkbGetIndicatorMap + and changes made with +XkbSetIndicatorMap + are visible via +XkbGetDeviceInfo +. + + + + + +Indicator Names for Extension Devices + + +The XKB extension allows applications to assign symbolic names to the +indicators of non-keyboard extension devices. If supported, symbolic names can +be assigned to all extension device indicators, whether they are part of a +keyboard feedback or part of an indicator feedback. + + + + +Implementations which do not support indicator maps for extension devices must +not set the +XkbXI_IndicatorMaps + flag. + + + + +Attempts to query or assign indicator names with an implementation that does +not support this feature report failure in the request reply and might cause +the server to send an +XkbExtensionDeviceNotify + event to the client which issued the request that failed. Such requests never +cause an error condition. + + + + +If this feature is supported, the names for the default indicators on the core +keyboard device are visible both as extension indicators and as the core +indicators. Changes made with +XkbSetDeviceInfo + are visible via +XkbGetNames + and changes made with +XkbSetNames + are visible via +XkbGetDeviceInfo +. + + + diff --git a/miniconda3/share/doc/kbproto/ch16.xml b/miniconda3/share/doc/kbproto/ch16.xml new file mode 100644 index 0000000000000000000000000000000000000000..6044843c46cebdd1f39461c9aaf31246d28df60a --- /dev/null +++ b/miniconda3/share/doc/kbproto/ch16.xml @@ -0,0 +1,9427 @@ + + +XKB Protocol Requests + + +This document uses the syntactic conventions and common types defined by the +specification of the core X protocol with a number of additions, which are +detailed below. + + + +Errors + + +If a client attempts to use any other XKB request except +XkbUseExtension + before the extension is properly initialized, XKB reports an +Access + error and ignores the request. XKB is properly initialized once +XkbUseExtension + reports that the client has asked for a supported or compatible version of the +extension. + + + + +Keyboard Errors + + +In addition to all of the errors defined by the core protocol, the X Keyboard +Extension defines a single error, +Keyboard +, which indicates that some request specified an illegal device identifier or +an extension device that is not a member of an appropriate. Unless otherwise +noted, any request with an argument of type KB_DEVICESPEC can cause +Keyboard + errors if an illegal or inappropriate device is specified. + + + + +When the extension reports a Keyboard error, the most significant byte of the + +resource_id + is a further refinement of the error cause, as defined in the table below. The +least significant byte contains the device, class, or feedback id as indicated: + + + + + + + + + + + + high-order byte + value + meaning + low-order byte + + + + + XkbErr_BadDevice + 0xff + device not found + device id + + + XkbErr_BadClass + 0xfe + device found, but is the wrong class + class id + + + XkbErr_BadId + 0xfd + device found, class ok, but device does not have a feedback with the +indicated id + feedback id + + + + + + + +Side-Effects of Errors + + +With the exception of +Alloc + or +Implementation + errors, which might result in an inconsistent internal state, no XKB request +that reports an error condition has any effect. Unless otherwise stated, +requests which update some aspect of the keyboard description will not apply +only part of a request — if part of a request fails, the whole thing is +ignored. + + + + + + +Common Types + + +The following types are used in the request and event definitions in subsequent +sections: + + + + + + + + + + Name + Value + + + + + LISTofITEMs + The type LISTofITEMs is special. It is similar to the +LISTofVALUE defined by the core protocol, but the elements of a LISTofITEMs are +not necessarily all the same size. The use of a BITMASK to indicate which +members are present is optional for a LISTofITEMs — it is possible for the +set of elements to be derived from one or more fields of the request. + + + KB_DEVICESPEC + 8 bit unsigned integer, +UseCoreKbd, or UseCorePtr + + + + KB_LEDCLASSSPEC + { +KbdFeedbackClass +, +LedFeedbackClass +, +DfltXIClass +, +AllXIClasses +, +XINone + } + + + KB_BELLCLASSSPEC + { +KbdFeedbackClass +, +BellFeedbackClass +, +DfltXIClass +, +AllXIClasses + } + + + KB_IDSPEC + 8 bit unsigned integer or +DfltXIId + + + + KB_VMODMASK + CARD16, each bit corresponds to a virtual modifier + + + KB_GROUPMASK + { +Group1 +, +Group2 +, +Group3 +, +Group4 + } + + + KB_GROUPSWRAP + { +WrapIntoRange +, +ClampIntoRange +, +RedirectIntoRange + } + + + KB_GROUPINFO + { groupsWrap: KB_GROUPSWRAP +redirectGroup: 1…4, +numGroups: 1…4 } + + + KB_NKNDETAILSMASK + { +NKN_Keycodes +, NKN_Geometry, +NKN_DeviceID + } + + + KB_STATEMASK + KEYBUTMASK or KB_GROUPMASK + + + KB_STATEPARTMASK + { +ModifierState +, +ModifierBase +, +ModifierLatch +, +ModifierLock +, +GroupState +, +GroupBase +, +GroupLatch +, +GroupLock +, +CompatState +, +GrabMods +, +CompatGrabMods +, +LookupMods +, +CompatLookupMods +, +PointerButtons + } + + + KB_BOOLCTRLMASK + { +RepeatKeys +, +SlowKeys +, +BounceKeys +, +StickyKeys +, +MouseKeys +, +MouseKeysAccel +, +AccessXKeys +, +AccessXTimeout +, +AccessXFeedback +, +AudibleBell +, +Overlay1 +, +Overlay2 +, +IgnoreGroupLock + } + + + KB_CONTROLSMASK + { +GroupsWrap, InternalMods +, +IgnoreLockMods +, +PerKeyRepeat +, +ControlsEnabled + } or KB_BOOLCTRLMASK + + + KB_MAPPARTMASK + { +KeyTypes +, +KeySyms +, +ModifierMap +, +ExplicitComponents +, +KeyActions +, +KeyBehaviors +, +VirtualMods +, +VirtualModMap +} + + + KB_CMDETAILMASK + { +SymInterp +, +GroupCompat + } + + + KB_NAMEDETAILMASK + { +KeycodesName +, +GeometryName +, +SymbolsName +, + +PhysSymbolsName +, +TypesName +, +CompatName +, +KeyTypeNames +, +KTLevelNames +, +IndicatorNames +, +KeyNames +, +KeyAliases +, +VirtualModNames +, +GroupNames +, +RGNames +} + + + KB_AXNDETAILMASK + { +AXN_SKPress +, +AXN_SKAccept +, +AXN_SKReject +, +AXN_SKRelease, AXN_BKAccept, AXN_BKReject, AXN_AXKWarning +} + + + KB_AXSKOPTSMASK + { +AX_TwoKeys +, +AX_LatchToLock + } + + + KB_AXFBOPTSMASK + { +AX_SKPressFB +, +AX_SKAcceptFB +, +AX_FeatureFB +, +AX_SlowWarnFB +, +AX_IndicatorFB +, +AX_StickyKeysFB +, +AX_SKReleaseFB +, + AX_SKRejectFB +, +AX_BKRejectFB +, +AX_DumbBellFB + } + + + KB_AXOPTIONSMASK + KB_AXFBOPTSMASK or KB_AXSKOPTSMASK + + + KB_GBNDETAILMASK + { +GBN_Types +, +GBN_CompatMap +, +GBN_ClientSymbols +, +GBN_ServerSymbols +, +GBN_IndicatorMap +, +GBN_KeyNames +, +GBN_Geometry +, +GBN_OtherNames + } + + + KB_BELLDETAILMASK + { +XkbAllBellNotifyEvents + } + + + KB_MSGDETAILMASK + { +XkbAllActionMessages + } + + + KB_EVENTTYPE + { +XkbNewKeyboardNotify +, +XkbMapNotify +, +XkbStateNotify +, +XkbControlsNotify +, +XkbIndicatorStateNotify +, +XkbIndicatorMapNotify +, +XkbNamesNotify +, +XkbCompatMapNotify +, +XkbBellNotify +, +XkbActionMessage +, +XkbAccessXNotify +, +XkbExtensionDeviceNotify + } + + + KB_ACTION + [ type: CARD8 +data: LISTofCARD8 ] + + + KB_BEHAVIOR + [ type: CARD8, data: CARD 8 ] + + + KB_MODDEF + [ mask: KEYMASK, +mods: KEYMASK, +vmods: KB_VMODMASK ] + + + KB_KTMAPENTRY + [ active: BOOL, +level: CARD8, +mods: KB_MODDEF ] + + + KB_KTSETMAPENTRY + [ level: CARD8, +mods: KB_MODDEF ] + + + KB_KEYTYPE + [ mods: KB_MODDEF, +numLevels: CARD8, +map: LISTofKB_KTMAPENTRY, +preserve: LISTofKB_MODDEF ] + + + KB_SETKEYTYPE + [ realMods: KEYMASK, +vmods: CARD16, +numLevels: CARD8, +map: LISTofKB_KTSETMAPENTRY, +preserve: LISTofKB_MODDEF ] + + + KB_KEYSYMMAP + [ ktIndex: LISTofCARD8, width: CARD8 + numGroups: 0…4, + groupsWrap: KB_GROUPSWRAP, + redirectGroup: 0…3, + syms: LISTofKEYSYM ] + + + KB_KEYVMODMAP + [ key: KEYCODE, vmods: CARD16 ] + + + KB_KEYMODMAP + [ key: KEYCODE, mods: KEYMASK ] + + + KB_EXPLICITMASK + { +ExplicitKeyType1 +, +ExplicitKeyType2 +, +ExplicitKeyType3 +, +ExplicitKeyType4 +, +ExplicitInterpret +, +ExplicitAutoRepeat +, +ExplicitBehavior +, +ExplicitVModMap + } + + + KB_INDICATORMASK + CARD32, each bit corresponds to an indicator + + + KB_IMFLAGS + { +IM_NoExplicit +, +IM_NoAutomatic +, +IM_LEDDrivesKB + } + + + KB_IMMODSWHICH + { +IM_UseNone +, +IM_UseBase +, +IM_UseLatched +, +IM_UseLocked +, +IM_UseEffective +, +IM_UseCompat + } + + + KB_IMGROUPSWHICH + { +IM_UseNone +, +IM_UseBase +, +IM_UseLatched +, +IM_UseLocked +, +IM_UseEffective + } + + + KB_INDICATORMAP + [ flags: CARD8, +mods: KB_MODDEF, +whichMods: +groups: KB_GROUPMASK, +whichGroups: +ctrls: KB_BOOLCTRLMASK ] + + + KB_SYMINTERPMATCH + { +SI_NoneOf +, +SI_AnyOfOrNone +, +SI_AnyOf +, +SI_AllOf +, +SI_Exactly + } + + + KB_SYMINTERP + [ sym: KEYSYM, + mods; KEYMASK, + levelOneOnly: BOOL, + match: KB_SYMINTERPMATCH, + virtualMod: CARD8, + autoRepeat: BOOL, + lockingKey: BOOL ] + + + KB_PCFMASK + { +PCF_DetectableAutorepeat +, +PCF_GrabsUseXkbState +, +PCF_AutoResetControls +, +PCF_LookupStateWhenGrabbed +, +PCF_SendEventUsesXKBState + } + + + KB_LCFLAGSMASK + { +LC_Hidden +, +LC_Default +, +LC_Partial + } + + + KB_LCSYMFLAGSMASK + { +LC_AlphanumericKeys +, +LC_ModifierKeys +, +LC_KeypadKeys +, +LC_FunctionKeys +, +LC_AlternateGroup + } + + + + + + +These types are used by the +XkbGetGeometry + and +XkbSetGeometry + requests: + + + + + + + + + + Name + Value + + + + + KB_PROPERTY + [ name, value: STRING8 ] + + + KB_POINT + [ x, y: CARD16 ] + + + KB_OUTLINE + [ cornerRadius: CARD8, points: LISTofKB_POINT ] + + + KB_SHAPE + [ name: ATOM, outlines: LISTofKB_OUTLINE + primaryNdx, approxNdx: CARD8 ] + + + KB_KEYNAME + [ name: LISTofCHAR ] + + + KB_KEYALIAS + [ real: LISTofCHAR, alias: LISTofCHAR ] + + + KB_KEY + [ name: KB_KEYNAME, gap: INT16, + shapeNdx, colorNdx: CARD8 ] + + + KB_ROW + [ top, left: INT16, vertical: BOOL, keys LISTofKB_KEY ] + + + KB_OVERLAYKEY + [ over, under: KB_KEYNAME ] + + + KB_OVERLAYROW + [ rowUnder: CARD8, keys: LISTofKB_OVERLAYKEY ] + + + KB_OVERLAY + [ sectionUnder: CARD8, +rows: LISTofKB_OVERLAYROW ] + + + KB_SHAPEDOODAD + [ name: ATOM, priority: CARD8, top, left: INT16, + type: { SolidDoodad, OutlineDoodad }, + angle: INT16, width, height: CARD16 + colorNdx, shapeNdx: CARD8 ] + + + KB_TEXTDOODAD + [ name: ATOM, priority: CARD8, top, left: INT16, + angle: INT16, width, height: CARD16, + colorNdx: CARD8, text: STRING8, font: STRING8 ] + + + KB_INDICATORDOODAD + [ name: ATOM, priority: CARD8, top, left: INT16, +angle: INT16, +shapeNdx, onColorNdx, offColorNdx: CARD8 ] + + + KB_LOGODOODAD + [ name: ATOM, priority: CARD8, top, left: INT16, + angle: INT16, colorNdx, shapeNdx: CARD8, + logoName: STRING8 ] + + + KB_DOODAD + KB_SHAPEDOODAD, or KB_TEXTDOODAD, or KB_INDICATORDOODAD, or +KB_LOGODOODAD + + + KB_SECTION + [ name: ATOM, + top, left, angle: INT16, + width, height: CARD16, + priority: CARD8, + rows: LISTofKB_ROW, + doodads: LISTofKB_DOODAD, + overlays: LISTofKB_OVERLAY ] + + + + + + +These types are used by +XkbGetDeviceInfo + and +XkbSetDeviceInfo +: + + + + + + + + + + Name + Value + + + + + KB_XIDEVFEATUREMASK + { +XI_ButtonActions +, +XI_IndicatorNames +, +XI_IndicatorMaps +, +XI_IndicatorState + } + + + KB_XIFEATUREMASK + { KB_XIDEVFEATURES or +XI_Keyboards + + + + KB_XIDETAILMASK + { KB_XIFEATURES or +XI_UnsupportedFeature + +} + + + + KB_DEVICELEDINFO + [ ledClass: KB_LEDCLASSSPEC, +ledID: KB_IDSPEC, +physIndicators: CARD32, +state: CARD32, +names: LISTofATOM, +maps: LISTofKB_INDICATORMAP ] + + + + + + + +Requests + + +This section lists all of the requests supported by the X Keyboard Extension, +separated into categories of related requests. + + + + +Initializing the X Keyboard Extension + + + + + + + + + XkbUseExtension + + + + + wantedMajor, wantedMinor: CARD16 + + + +supported: BOOL + + + + +serverMajor, serverMinor: CARD16 + + + + + + +This request enables XKB extension capabilities for the client that issues the +request; the +wantedMajor + and +wantedMinor + fields specify the extension version in use by the requesting client. The + +supported + field is +True + if the server supports a compatible version, +False + otherwise. The +serverMajor + and +serverMinor + fields return the actual version supported by the server. + + + + +Until a client explicitly and successfully requests the XKB extension, an XKB +capable server reports compatibility state in all core protocol events and +requests. Once a client asks for XKB extension semantics by issuing this +request, the server reports the extended XKB keyboard state in some core +protocol events and requests, as described in the overview section of this +specification. + + + + +Clients should issue an +XkbUseExtension + request before using any other extension requests. + + + + + +Selecting Events + + + + + + + + + XkbSelectEvents + + + + + deviceSpec: KB_DEVICESPEC + + + +affectWhich, clear, selectAll: KB_EVENTTYPE + + + +affectMap, map: KB_MAPPARTMASK + + + +details: LISTofITEMs + + + + Errors: +Keyboard +, +Match +, +Value + + + + + + + + +This request updates the event masks of the keyboard indicated by +deviceSpec + for this client. If +deviceSpec + specifies an illegal device, a +Keyboard + error results. + + + + +The +affectMap + and +map + fields specify changes to the event details mask for the +XkbMapNotify + event. If any map components are set in +map + but not in +affectMap +, a +Match + error results. Otherwise, any map components that are set in +affectMap + are set or cleared in the map notify details mask, depending on the value of +the corresponding field in +map +. + + + + +The +affectWhich +, +clear +, and +selectAll + fields specify changes to any other event details masks. If any event types +are set in both +clear + and +selectAll +, a +Match + error results; if any event types are specified in either +clear + or +selectAll + but not in +affectWhich +, a +Match + error results. Otherwise, the detail masks for any event types specified in +the +affectWhich + field of this request are changed as follows: + + + + + If the event type is also set in +clear +, the detail mask for the corresponding event is set to +0 + or +False +, as appropriate. + + + + If the event type is also set in +selectAll +, the detail mask for the corresponding event is set to include all legal +detail values for that type. + + + + If the event type is not set in either +clear + or +selectAll +, the corresponding element of +details + lists a set of explicit changes to the details mask for the event, as +described below. + + + + + +Each entry of the +details + list specifies changes to the event details mask for a single type of event, +and consists of an +affects + mask and a +values + mask. All details that are specified in +affects + are set to the corresponding value from +values +; if any details are listed in +values + but not in +affects +, a +Match + error results. + + + + +The details list contains entries only for those event types, if any, that are +listed in the +affectWhich + mask and not in either +clear + or +selectAll +. When present, the items of the +details + list appear in the following order: + + + + + + + + + + + Event Type + Legal Details + Type + + + + + +XkbNewKeyboardNotify + + +KB_NKNDETAILSMASK + + +CARD16 + + + + +XkbStateNotify + + +KB_STATEPARTMASK + + +CARD16 + + + + +XkbControlsNotify + + +KB_CONTROLMASK + + +CARD32 + + + + +XkbIndicatorMapNotify + + +KB_INDICATORMASK + + +CARD32 + + + + +XkbIndicatorStateNotify + + +KB_INDICATORMASK + + +CARD32 + + + + +XkbNamesNotify + + +KB_NAMEDETAILMASK + + +CARD16 + + + + +XkbCompatMapNotify + + +KB_CMDETAILMASK + + +CARD8 + + + + +XkbBellNotify + + +KB_BELLDETAILMASK + + +CARD8 + + + + +XkbActionMessage + + +KB_MSGDETAILMASK + + +CARD8 + + + + +XkbAccessXNotify + + +KB_AXNDETAILMASK + + +CARD16 + + + + +XkbExtensionDeviceNotify + + +KB_XIDETAILMASK + + +CARD16 + + + + + + + +Detail masks for event types that are not specified in +affectWhich + are not changed. + + + + +If any components are specified in a client’s event masks, the X server sends +the client an appropriate event whenever any of those components change state. +Unless explicitly modified, all event detail masks are empty. Events describes all XKB events +and the conditions under which the server generates them. + + + + + +Generating Named Keyboard Bells + + + + + + + + + XkbBell + + + + + deviceSpec: KB_DEVICESPEC + + + +bellClass: KB_BELLCLASSSPEC + + + +bellID: KB_IDSPEC + + + +percent: INT8 + + + +forceSound: BOOL + + + +eventOnly: BOOL + + + +pitch, duration: INT16 + + + +name: ATOM + + + +window: WINDOW + + + + Errors: +Keyboard +, +Value +, +Match + + + + + + + + +This request generates audible bells and/or +XkbBellNotify + events for the bell specified by the +bellClass + and +bellID + on the device specified by +deviceSpec + at the specified +pitch +, +duration + and volume ( +percent +). If deviceSpec specifies a device that does not have a bell or keyboard +feedback, a +Keyboard + error results. + + + + +If both +forceSound + and +eventOnly + are set, this request yields a +Match + error. Otherwise, if +forceSound + is +True +, this request always generates a sound and never generates an event; if + +eventOnly + is +True +, it causes an event but no sound. If neither +forceSound + nor +eventOnly + are +True +, this request always generates an event; if the keyboard’s global +AudibleBell + control is enabled, it also generates a sound. + + + + +Any bell event generated by this request contains all of the information about +the bell that was requested, including the symbolic name specified by +name + and the event window specified by window. The +name + and +window + are not directly interpreted by XKB, but they must have the value +None + or specify a legal Atom or Window, respectively. +XkbBellNotify + events generated in response to core protocol or X input extension bell +requests always report +None + as their +name +. + + + + +The +bellClass +, +bellID +, and +percent + fields are interpreted as for the X input extension +DeviceBell + request. If +pitch + and +duration + are zero, the server uses the corresponding values for that bell from the core +protocol or input extension, otherwise +pitch + and +duration + are interpreted as for the core protocol +ChangeKeyboardControl + request; if they do not include legal values, a +Value + error results. The +window + field must specify a legal Window or have the value +None +, or a +Value + error results. The name field must specify a legal Atom or have the value + +None +, or an +Atom + error results. If an error occurs, this request has no other effect (i.e. does +not cause a sound or generate an event). + + + + +The +pitch +, +volume +, and +duration + are suggested values for the bell, but XKB does not require the server to +honor them. + + + + + +Querying and Changing Keyboard State + + + + + + + + + XkbGetState + + + + + deviceSpec: KB_DEVICESPEC + + + + +deviceID: CARD8 + + + + +mods, baseMods, latchedMods, lockedMods: KEYMASK + + + + +group, lockedGroup: KB_GROUP + + + + +baseGroup, latchedGroup: INT16 + + + + +compatState: KEYMASK + + + + +grabMods, compatGrabMods: KB_GROUP + + + + +lookupMods, compatLookupMods: KEYMASK + + + + +ptrBtnState: BUTMASK + + + Errors: +Keyboard + + + + + + + + +This request returns a detailed description of the current state of the +keyboard specified by +deviceSpec +. + + + + +The +deviceID + return value contains the input extension identifier for the specified device, +or +0 + if the server does not support the input extension. + + + + +The +baseMods + return value reports the modifiers that are set because one or more modifier +keys are logically down. The +latchedMods + and +lockedMods + return values report the modifiers that are latched or locked respectively. +The +mods + return value reports the effective modifier mask which results from the +current combination of base, latched and locked modifiers. + + + + +The +baseGroup + return value reports the group state selected by group shift keys that are +logically down. The +latchedGroup + and +lockedGroup + return values detail the effects of latching or locking group shift keys and + +XkbLatchLockState + requests. The +group + return value reports the effective keyboard group which results from the +current combination of base, latched and locked group values. + + + + +The +lookupMods + return value reports the lookup modifiers, which consist of the current +effective modifiers minus any server internal modifiers. The +grabMods + return value reports the grab modifiers, which consist of the lookup modifiers +minus any members of the ignore locks mask that are not either latched or +logically depressed. Keyboard +State describes the lookup modifiers and grab modifiers in more detail. + + + + +The +ptrBtnState + return value reports the current logical state of up to five buttons on the +core pointer device. + + + + +The +compatState + return value reports the compatibility state that corresponds to the effective +keyboard group and modifier state. The +compatLookupMods + and +compatGrabMods + return values report the core protocol compatibility states that correspond to +the XKB lookup and grab state. All of the compatibility states are computed by +applying the group compatibility mapping to the corresponding XKB modifier and +group states, as described in +Group Compatibility Map. + + + + + + + + + + + XkbLatchLockState + + + + + deviceSpec: KB_DEVICESPEC + + + +affectModLocks, modLocks: KEYMASK + + + +lockGroup: BOOL + + + +groupLock: KB_GROUP + + + +affectModLatches,modLatches: KEYMASK + + + +latchGroup: BOOL + + + +groupLatch: INT16 + + + + Errors: +Keyboard +, +Value + + + + + + + + +This request locks or latches keyboard modifiers and group state for the device +specified by +deviceSpec +. If +deviceSpec + specifies an illegal or non-keyboard device, a +Keyboard + error occurs. + + + + +The locked state of any modifier specified in the +affectModLocks + mask is set to the corresponding value from +modLocks +. If +lockGroup + is +True +, the locked keyboard group is set to the group specified by +groupLock +. If any modifiers are set in +modLocks + but not +affectModLocks +, a +Match + error occurs. + + + + +The latched state of any modifier specified in the +affectModLatches + mask is set to the corresponding value from +modLatches +. If +latchGroup + is +True +, the latched keyboard group is set to the group specified by +groupLatch +. if any modifiers are set in +modLatches + but not in +affectModLatches +, a +Match + error occurs. + + + + +If the locked group exceeds the maximum number of groups permitted for the +specified keyboard, it is wrapped or truncated back into range as specified by +the global +GroupsWrap + + +control. No error results from an out-of-range group specification. + + + + +After changing the locked and latched modifiers and groups as specified, the X +server recalculates the effective and compatibility keyboard state and +generates +XkbStateNotify + events as appropriate if any state components have changed. Changing the +keyboard state might also turn indicators on or off which can cause +XkbIndicatorStateNotify + events as well. + + + + +If any errors occur, this request has no effect. + + + + + +Querying and Changing Keyboard Controls + + + + + + + + + XkbGetControls + + + + + deviceSpec: KB_DEVICESPEC + + + + +deviceID: CARD8 + + + + +mouseKeysDfltBtn: CARD8 + + + + +numGroups: CARD8 + + + + +groupsWrap: KB_GROUPINFO + + + + +internalMods,ignoreLockMods: KB_MODDEF + + + + +repeatDelay,repeatInterval: CARD16 + + + + +slowKeysDelay, debounceDelay: CARD16 + + + + +mouseKeysDelay, mouseKeysInterval: CARD16 + + + + +mouseKeysTimeToMax, mouseKeysMaxSpeed: CARD16 + + + + +mouseKeysCurve: INT16 + + + + +accessXOptions: KB_AXOPTIONMASK + + + + +accessXTimeout: CARD16 + + + + +accessXTimeoutOptionsMask, accessXTimeoutOptionValues: CARD16 + + + + +accessXTimeoutMask,accessXTimeoutValues: CARD32 + + + + +enabledControls: KB_BOOLCTRLMASK + + + + +perKeyRepeat: LISTofCARD8 + + + + Errors: +Keyboard + + + + + + + + +This request returns the current values and status of all controls for the +keyboard specified by +deviceSpec +. If +deviceSpec + specifies an illegal device a +Keyboard + error results. On return, the +deviceID + specifies the identifier of the requested device or zero if the server does +not support the input extension. + + + + +The +numGroups + return value reports the current number of groups, and +groupsWrap + reports the treatment of out-of-range groups, as described in Key Symbol Map. The +internalMods + and +ignoreLockMods + return values report the current values of the server internal and ignore +locks modifiers as described in +Keyboard State. Both are modifier definitions ( +Modifier Definitions) which +report the real modifiers, virtual modifiers, and the resulting combination of +real modifiers that are bound to the corresponding control. + + + + +The +repeatDelay +, +repeatInterval +, +slowKeysDelay + and +debounceDelay + fields report the current values of the for the autorepeat delay, autorepeat +interval, slow keys delay and bounce keys timeout, respectively. The +mouseKeysDelay +, +mouseKeysInterval +, +mouseKeysTimeToMax + and +mouseKeysMaxSpeed + and +mouseKeysCurve + return values report the current acceleration applied to mouse keys, as +described in The MouseKeysAccel +Control. All times are reported in milliseconds. + + + + +The +mouseKeysDfltBtn + return value reports the current default pointer button for which events are +synthesized by the mouse keys server actions. + + + + +The +accessXOptions + return value reports the current settings of the various AccessX options flags +which govern the behavior of the +StickyKeys + control and of AccessX feedback. + + + + +The +accessXTimeout + return value reports the length of time, in seconds, that the keyboard must +remain idle before AccessX controls are automatically changed; an +accessXTimeout + of +0 + indicates that AccessX controls are not automatically changed. The +accessXTimeoutMask + specifies the boolean controls to be changed if the AccessX timeout expires; +the +accessXTimeoutValues + field specifies new values for all of the controls in the timeout mask. The + +accessXTimeoutOptionsMask + field specifies the AccessX options to be changed when the AccessX timeout +expires; the +accessXTimeoutOptionValues + return value reports the values to which they will be set. + + + + +The +enabledControls + return value reports the current state of all of the global boolean controls. + + + + +The +perKeyRepeat + array consists of one bit per key and reports the current autorepeat behavior +of each keyboard key; if a bit is set in +perKeyRepeat +, the corresponding key repeats if it is held down while global keyboard +autorepeat is enabled. This array parallels the core protocol and input +extension keyboard controls, if the autorepeat behavior of a key is changed via +the core protocol or input extension, those changes are automatically reflected +in the +perKeyRepeat + array. + + + + + + + + + + + XkbSetControls + + + + + deviceSpec: KB_DEVICESPEC + + + +affectInternalRealMods, internalRealMods: KEYMASK + + + +affectInternalVirtualMods,internalVirtualMods: KB_VMODMASK + + + +affectIgnoreLockRealMods,ignoreLockRealMods: KB_MODMASK + + + +affectIgnoreLockVirtualMods,ignoreLockVirtualMods: KB_VMODMASK + + + +mouseKeysDfltBtn: CARD8 + + + +groupsWrap: KB_GROUPINFO + + + +accessXOptions: CARD16 + + + +affectEnabledControls: KB_BOOLCTRLMASK + + + +enabledControls: KB_BOOLCTRLMASK + + + +changeControls: KB_CONTROLMASK + + + +repeatDelay,repeatInterval: CARD16 + + + +slowKeysDelay, debounceDelay: CARD16 + + + +mouseKeysDelay, mouseKeysInterval: CARD16 + + + +mouseKeysTimeToMax, mouseKeysMaxSpeed: CARD16 + + + +mouseKeysCurve: INT16 + + + +accessXTimeout: CARD16 + + + +accessXTimeoutMask, accessXTimeoutValues: KB_BOOLCTRLMASK + + + +accessXTimeoutOptionsMask,accessXTimeoutOptionsValues: CARD16 + + + +perKeyRepeat: LISTofCARD8 + + + + Errors: + Keyboard +, +Value + + + + + + + + +This request sets the keyboard controls indicated in +changeControls + for the keyboard specified by +deviceSpec +. Each bit that is set in +changeControls + indicates that one or more of the other request fields should be applied, as +follows: + + + + + + + + + + Bit in changeControls + Field(s) to be Applied + + + + + +XkbRepeatKeysMask + + +repeatDelay +, +repeatInterval + + + + +XkbSlowKeysMask + + +slowKeysDelay + + + + +XkbStickyKeysMask + + +accessXOptions + (only the +XkbAX_TwoKeys + + +and the +XkbAX_LatchToLock + options are affected) + + + +XkbBounceKeysMask + + +debounceDelay + + + + +XkbMouseKeysMask + + +mouseKeysDfltBtn + + + + +XkbMouseKeysAccelMask + + +mouseKeysDelay +, +mouseKeysInterval +, +mouseKeysCurve +, +mouseKeysTimeToMax +, +mouseKeysMaxSpeed + + + + +XkbAccessXKeysMask + + +accessXOptions (all options) + + + + +XkbAccessXTimeoutMask + + +accessXTimeout +, +accessXTimeoutMask +, +accessXTimeoutValues +, +accessXTimeoutOptionsMask +, +accessXTimeoutOptionsValues + + + + XkbAccessXFeedbackMask + +accessXOptions + (all options except those affected by the +XkbStickyKeysMask + bit) + + + +XkbGroupsWrapMask + + +groupsWrap + + + + +XkbInternalModsMask + + +affectInternalRealMods +, +internalRealMods +, +affectInternalVirtualMods +, +internalVirtualMods + + + + +XkbIgnoreLockModsMask + + +affectIgnoreLockRealMods +, +ignoreLockRealMods +, +affectIgnoreLockVirtualMods +, +ignoreLockVirtualMods + + + + +XkbPerKeyRepeatMask + + +perKeyRepeat + + + + +XkbControlsEnabledMask + + +affectEnabledControls +, +enabledControls + + + + + + + +If any other bits are set in +changeControls +, a +Value + error results. If any of the bits listed above are not set in +changeControls +, the corresponding fields must have the value +0 +, or a +Match + error results. + + + + +If applied, +repeatDelay + and +repeatInterval + change the autorepeat characteristics of the keyboard, as described in +The RepeatKeys Control. If +specified, +repeatDelay + and +repeatInterval + must both be non-zero or a +Value + error results. + + + + +If applied, the +slowKeysDelay + field specifies a new delay for the +SlowKeys + control, as defined in The +SlowKeys Control. If specified, +slowKeysDelay + must be non-zero, or a +Value + error results. + + + + +If applied, the +debounceDelay + field specifies a new delay for the +BounceKeys + control, as described in The +BounceKeys Control. If present, the +debounceDelay + must be non-zero or a +Value + error results. + + + + +If applied, the +mouseKeysDfltBtn + field specifies the core pointer button for which events are generated +whenever a +SA_PtrBtn + or +SA_LockPtrBtn + key action is activated. If present, +mouseKeysDfltBtn + must specify a legal button for the core pointer device, or a +Value + error results. Key +Actions describes the +SA_PtrBtn + and +SA_LockPtrBtn + actions in more detail. + + + + +If applied, the +mouseKeysDelay +, +mouseKeysInterval +, +mouseKeysTimeToMax +, +mouseKeysMaxSpeed + and +mouseKeysCurve + fields change the rate at which the pointer moves when a key which generates a + +SA_MovePtr + action is held down. The +MouseKeysAccel Control describes these +MouseKeysAccel + parameters in more detail. If defined, the +mouseKeysDelay +, +mouseKeysInterval +, +mouseKeysTimeToMax + and +mouseKeysMaxSpeed + values must all be greater than zero, or a +Value + error results. The +mouseKeysCurve + value must be greater than +-1000 + or a +Value + error results. + + + + +If applied, the +accessXOptions + field sets the AccessX options, which are described in detail in +The AccessXKeys Control. If +either one of +XkbStickyKeysMask + and +XkbAccessXFeedbackMask + are set in +changeControls + and +XkbAccessXKeysMask + is not, only a subset of the AccessX options are changed, as described in the +table above; if both are set or if the +AccessXKeys + bit is set in +changeControls +, all of the AccessX options are updated. Any bit in +accessXOptions + whose interpretation is undefined must be zero, or a +Value + error results. + + + + +If applied, the +accessXTimeout +, +accessXTimeoutMask +, +accessXTimeoutValues +, +accessXTimeoutOptionsMask + and +accessXTimeoutOptionsValues + fields change the behavior of the AccessX Timeout control, as described in +The AccessXTimeout +Control. The +accessXTimeout + must be greater than zero, or a +Value + error results. The +accessXTimeoutMask + or +accessXTimeoutValues + fields must specify only legal boolean controls, or a +Value + error results. The +accessXTimeoutOptionsMask + and +accessXTimeoutOptionsValues + fields must contain only legal AccessX options or a +Value + error results. If any bits are set in either values field but not in the +corresponding mask, a +Match + error results. + + + + +If present, the +groupsWrap + field specifies the treatment of out-of-range keyboard groups, as described in +Key Symbol Map. If the + +groupsWrap + field does not specify a legal treatment for out-of-range groups, a +Value + error results. + + + + +If present, the +affectInternalRealMods + field specifies the set of real modifiers to be changed in the internal +modifier definition and the +internalRealMods + field specifies new values for those modifiers. The +affectInternalVirtualMods + and +internalVirtualMods + fields update the virtual modifier component of the modifier definition that +describes the internal modifiers in the same way. If any bits are set in either +values field but not in the corresponding mask field, a +Match + error results. + + + + +If present, the +affectIgnoreLockRealMods + field specifies the set of real modifiers to be changed in the ignore locks +modifier definition and the +ignoreLockRealMods + field specifies new values for those modifiers. The +affectIgnoreLockVirtualMods + and +ignoreLockVirtualMods + fields update the virtual modifier component of the ignore locks modifier +definition in the same way. If any bits are set in either values field but not +in the corresponding mask field, a +Match + error results. + + + + +If present, the +perKeyRepeat + array specifies the repeat behavior of the individual keyboard keys. The +corresponding core protocol or input extension per-key autorepeat information +is updated to reflect any changes specified in +perKeyRepeat +. If the bits that correspond to any out-of-range keys are set in +perKeyRepeat +, a +Value + error results. + + + + +If present, the +affectEnabledControls + and +enabledControls + field enable and disable global boolean controls. Any controls set in both +fields are enabled; any controls that are set in +affectEnabledControls + but not in +enabledControls + are disabled. Controls that are not set in either field are not affected. If +any controls are specified in +enabledControls + but not in +affectEnabledControls +, a +Match + error results. If either field contains anything except boolean controls, a + +Value + error results. + + + + + +Querying and Changing the Keyboard Mapping + + + + + + + + + XkbGetMap + + + + + deviceSpec: KB_DEVICESPEC + + + +full, partial: KB_MAPPARTMASK + + + +firstType, nTypes: CARD8 + + + +firstKeySym, firstKeyAction: KEYCODE + + + +nKeySyms, nKeyActions: CARD8 + + + +firstKeyBehavior,firstKeyExplicit: KEYCODE + + + +nKeyBehaviors,nKeyExplicit: CARD8 + + + +firstModMapKey,firstVModMapKey: KEYCODE + + + +nModMapKeys, nVModMapKeys: CARD8 + + + +virtualMods: KB_VMODMASK + + + + +deviceID: CARD8 + + + + +minKeyCode, maxKeyCode: KEYCODE + + + + +present: KB_MAPPARTMASK + + + + +firstType, nTypes, nTotalTypes: CARD8 + + + + +firstKeySym, firstKeyAction: KEYCODE + + + + +nKeySyms, nKeyActions: CARD8 + + + + +totalSyms, totalActions: CARD16 + + + + +firstKeyBehavior, firstKeyExplicit: KEYCODE + + + + +nKeyBehaviors, nKeyExplicit: CARD8 + + + + +totalKeyBehaviors, totalKeyExplicit: CARD8 + + + + +firstModMapKey, firstVModMapKey: KEYCODE + + + + +nModMapKeys, nVModMapKeys: CARD8 + + + + +totalModMapKeys, totalVModMapKeys: CARD8 + + + + +virtualMods: KB_VMODMASK + + + + +typesRtrn: LISTofKB_KEYTYPE + + + + +symsRtrn: LISTofKB_KEYSYMMAP + + + + +actsRtrn: { count: LISTofCARD8, acts: LISTofKB_ACTION } + + + + +behaviorsRtrn: LISTofKB_SETBEHAVIOR + + + + +vmodsRtrn: LISTofSETofKEYMASK + + + + +explicitRtrn: LISTofKB_SETEXPLICIT + + + + +modmapRtrn: LISTofKB_KEYMODMAP + + + + +vmodMapRtrn: LISTofKB_KEYVMODMAP + + + + +Errors: +Keyboard +, +Value +, +Match +, +Alloc + + + + + + + +This request returns the indicated components of the server and client maps of +the keyboard specified by +deviceSpec +. The +full + mask specifies the map components to be returned in full; the +partial + mask specifies the components for which some subset of the legal elements are +to be returned. The server returns a +Match + error if any component is specified in both +full + and +partial +, or a +Value + error if any undefined bits are set in either +full + or +partial +. + + + + +Each bit in the +partial + mask controls the interpretation of one or more of the other request fields, +as follows: + + + + + + + + + + + Bit in the Partial Mask + Type + Corresponding Field(s) + + + + + +XkbKeyTypesMask + + key types + +firstType +, +nTypes + + + + +XkbKeySymsMask + + keycodes + +firstKeySym +, +nKeySyms + + + + +XkbKeyActionsMask + + keycodes + +firstKeyAction +, +nKeyActions + + + + +XkbKeyBehaviorsMask + + keycodes + +firstKeyBehavior +, +nKeyBehaviors + + + + +XkbExplicitComponentsMask + + keycodes + +firstKeyExplicit +, +nKeyExplicit + + + + +XkbModifierMapMask + + keycodes + +firstModMapKey +, +nModMapKeys + + + + +XkbVirtualModMapMask + + keycodes + +firstVModMapKey +, +nVModMapKeys + + + + +XkbVirtualModsMask + + virtual modifiers + +virtualMods + + + + + + + +If any of these keyboard map components are specified in +partial +, the corresponding values must specify a valid subset of the requested +components or this request reports a +Value + error. If a keyboard map component is not specified in +partial +, the corresponding fields must contain zeroes, or a +Match + error results. + + + + +If any error is generated, the request aborts and does not report any values. + + + + +On successful return, the +deviceID + field reports the X input extension device ID of the keyboard for which +information is being returned, or +0 + if the server does not support the X input extension. The +minKeyCode + and +maxKeyCode + return values report the minimum and maximum keycodes that are legal for the +keyboard in question. + + + + +The +present + return value lists all of the keyboard map components contained in the reply. +The bits in +present + affect the interpretation of the other return values as follows: + + + + +If +XkbKeyTypesMask + is set in +present +: + + + + + +firstType + and +nTypes + specify the types reported in the reply. + + + + +nTotalTypes + reports the total number of types defined for the keyboard + + + + +typesRtrn + has +nTypes + elements of type KB_KEYTYPE which describe consecutive key types starting from + +firstType +. + + + + + +If +XkbKeySymsMask + is set in +present +: + + + + + +firstKeySym + and +nKeySyms + specify the subset of the keyboard keys for which symbols will be reported. + + + + +totalSyms + reports the total number of keysyms bound to the keys returned in this reply. + + + + +symsRtrn + has +nKeySyms + elements of type KB_KEYSYMMAP, which describe the symbols bound to consecutive +keys starting from +firstKeySym +. + + + + + +If +XkbKeyActionsMask + is set in +present +: + + + + + +firstKeyAction + and +nKeyActions + specify the subset of the keys for which actions are reported. + + + + +totalActions + reports the total number of actions bound to the returned keys. + + + + The +count +field of the +actsRtrn + return value has +nKeyActions + entries of type CARD8, which specify the number of actions bound to +consecutive keys starting from +firstKeyAction +. The +acts + field of +actsRtrn + has +totalActions + elements of type KB_ACTION and specifies the actions bound to the keys. + + + + + +If +XkbKeyBehaviorsMask + is set in +present +: + + + + + The +firstKeyBehavior + and +nKeyBehaviors + return values report the range of keyboard keys for which behaviors will be +reported. + + + + The +totalKeyBehaviors + return value reports the number of keys in the range to be reported that have +non-default values. + + + + The +behaviorsRtrn + value has +totalKeyBehaviors + entries of type KB_BEHAVIOR. Each entry specifies a key in the range for which +behaviors are being reported and the behavior associated with that key. Any +keys in that range that do not have an entry in +behaviorsRtrn + have the default behavior, +KB_Default +. + + + + + +If +XkbExplicitComponentsMask + is set in +present +: + + + + + The +firstKeyExplicit + and +nKeyExplicit + return values report the range of keyboard keys for which the set of explicit +components is to be returned. + + + + The +totalKeyExplicit + return value reports the number of keys in the range specified by +firstKeyExplicit + and +nKeyExplicit + that have one or more explicit components. + + + + The +explicitRtrn + return value has +totalKeyExplicit + entries of type KB_KEYEXPLICIT. Each entry specifies the a key in the range +for which explicit components are being reported and the explicit components +that are bound to it. Any keys in that range that do not have an entry in + +explicitRtrn + have no explicit components. + + + + + +If +XkbModifierMapMask + is set in +present +: + + + + + The +firstModMapKey + and +nModMapKeys + return values report the range of keyboard keys for which the modifier map is +to be reported. + + + + The +totalModMapKeys + return value reports the number of keys in the range specified by +firstModMapKey + and +nModMapKeys + that are bound with to one or more modifiers. + + + + The +modmapRtrn + return value has +totalModMapKeys + entries of type KB_KEYMODMAP. Each entry specifies the a key in the range for +which the modifier map is being reported and the set of modifiers that are +bound to that key. Any keys in that range that do not have an entry in + +modmapRtrn + are not associated with any modifiers by the modifier mapping. + + + + + +If +XkbVirtualModMapMask + is set in +present +: + + + + + The +firstVModMapKey + and +nVModMapKeys + return values report the range of keyboard keys for which the virtual modifier +map is to be reported. + + + + The +totalVModMapKeys + return value reports the number of keys in the range specified by +firstVModMapKey + and +nVModMapKeys + that are bound with to or more virtual modifiers. + + + + The +vmodmapRtrn + return value has +totalVModMapKeys + entries of type KB_KEYVMODMAP. Each entry specifies the a key in the range for +which the virtual modifier map is being reported and the set of virtual +modifiers that are bound to that key. Any keys in that range that do not have +an entry in +vmodmapRtrn + are not associated with any virtual modifiers, + + + + + +If +XkbVirtualModsMask + is set in +present +: + + + + + The +virtualMods + return value is a mask with one bit per virtual modifier which specifies the +virtual modifiers for which a set of corresponding real modifiers is to be +returned. + + + + The +vmodsRtrn + return value is a list with one entry of type KEYBUTMASK for each virtual +modifier that is specified in +virtualMods +. The entries in +vmodsRtrn + contain the real modifier bindings for the specified virtual modifiers, +beginning with the lowest-numbered virtual modifier that is present in + +virtualMods + and proceeding to the highest. + + + + + +If any of these bits are not set in +present +, the corresponding numeric fields all have the value zero, and the +corresponding lists are all of length zero. + + + + + + + + + + + XkbSetMap + + + + + deviceSpec: KB_DEVICESPEC + + + +flags: { +SetMapResizeTypes, SetMapRecomputeActions +} + + + +present: KB_MAPPARTMASK + + + +minKeyCode, maxKeyCode: KEYCODE + + + +firstType, nTypes: CARD8 + + + +firstKeySym, firstKeyAction: KEYCODE + + + +nKeySyms, nKeyActions: CARD8 + + + +totalSyms, totalActions: CARD16 + + + +firstKeyBehavior, firstKeyExplicit: KEYCODE + + + +nKeyBehaviors, nKeyExplicit: CARD8 + + + +totalKeyBehaviors, totalKeyExplicit: CARD8 + + + +firstModMapKey, firstVModMapKey: KEYCODE + + + +nModMapKeys, nVModMapKeys: CARD8 + + + +totalModMapKeys, totalVModMapKeys: CARD8 + + + +virtualMods: VMODMASK + + + +types: LISTofKB_KEYTYPE + + + +syms: LISTofKB_KEYSYMMAP + + + +actions: { count: LISTofCARD8, actions: LISTofKB_ACTION } + + + +behaviors: LISTofKB_BEHAVIOR + + + +vmods: LISTofKEYMASK + + + +explicit: LISTofKB_EXPLICIT + + + +modmap: LISTofKB_KEYMODMAP + + + +vmodmap: LISTofKB_KEYVMODMAP + + + + Errors: +Keyboard +, +Value +, +Match +, +Alloc + + + + + + + + +This request changes the indicated parts of the keyboard specified by +deviceSpec +. With XKB, the effect of a key release is independent of the keyboard mapping +at the time of the release, so this request can be processed regardless of the +logical state of the modifier keys at the time of the request. + + + + +The +present + field specifies the keyboard map components contained to be changed. The bits +in +present + affect the interpretation of the other fields as follows: + + + + +If +XkbKeyTypesMask + is set in +present +, +firstType + and +nTypes + specify a subset of the key types bound to the keyboard to be changed or +created. The index of the first key type to be changed must be less than or +equal to the unmodified length of the list of key types or a +Value + error results. + + + + +If +XkbKeyTypesMask + is set in +present + and +SetMapResizeTypes + is set in +flags +, the server resizes the list of key types bound to the keyboard so that the +last key type specified by this request is the last element in the list. If the +list of key types is shrunk, any existing key definitions that use key types +that eliminated are automatically assigned key types from the list of canonical +key types as described in +Assigning Types To Groups of Symbols for a Key. The list of key types +bound to a keyboard must always include the four canonical types and cannot +have more than +XkbMaxTypesPerKey + (32) types; any attempt to reduce the number of types bound to a keyboard +below four or above +XkbMaxTypesPerKey + causes a +Value + error. Symbolic names for newly created key types or levels within a key type +are initialized to +None +. + + + + +If +XkbKeyTypesMask + is set in +present +, the types list has +nTypes + entries of type KB_KEYTYPE.Each key type specified in +types + must be valid or a +Value + error results. To be valid a key type definition must meet the following +criteria: + + + + + The +numLevels + for the type must be greater than zero. + + + + If the key type is +ONE_LEVEL + (i.e. index zero in the list of key types), +numLevels + must be one. + + + + If the key type is +TWO_LEVEL + or +KEYPAD +, or +ALPHABETIC + (i.e. index one, two, or three in the lest of key types) group width must be +two. + + + + + +Each key type in types must also be internally consistent, or a Match error +results. To be internally consistent, a key type definition must meet the +following criteria: + + + + + Each map entry must specify a resulting level that is legal for the +type. + + + + Any real or virtual modifiers specified in any of the map entries must +also be specified in the +mods + for the type. + + + + + +If +XkbKeySymsMask + is set in +present +, +firstKeySym + and +nKeySyms + specify a subset of the keyboard keys to which new symbols are to be assigned +and +totalSyms + specifies the total number of symbols to be assigned to those keys. If any of +the keys specified by +firstKeySym + and +nKeySyms + are not legal, a +Match + error results. The +syms + list has +nKeySyms + elements of type KB_KEYSYMMAP. Each key in the resulting key symbol map must +be valid and internally consistent or a +Value + error results. To be valid and internally consistent, a key symbol map must +meet the following criteria: + + + + + The key type indices must specify legal result key types. + + + + The number of groups specified by +groupInfo + must be in the range +0…4 +. + + + + The +width + of the key symbol map must be equal to +numLevels + of the widest key type bound to the key. + + + + The number of symbols, +nSyms +, must equal the number of groups times +width +. + + + + + +If +XkbKeyActionsMask + is set in +present +, +firstKeyAction + and +nKeyActions + specify a subset of the keyboard keys to which new actions are to be assigned +and +totalActions + specifies the total number of actions to be assigned to those keys. If any of +the keys specified by +firstKeyAction + and +nKeyActions + are not legal, a +Match + error results. The +count + field of the +actions + return value has +nKeyActions + elements of type CARD8; each element of +count + specifies the number of actions bound to the corresponding key. The +actions + list in the +actions + field has +totalActions + elements of type KB_ACTION. These actions are assigned to each target key in +turn, as specified by +count +. The list of actions assigned to each key must either be empty or have exactly +as many actions as the key has symbols, or a +Match + error results. + + + + +If +XkbKeyBehaviorsMask + is set in +present +, +firstKeyBehavior + and +nKeyBehaviors + specify a subset of the keyboard keys to which new behaviors are to be +assigned, and +totalKeyBehaviors + specifies the total number of keys in that range to be assigned non-default +behavior. If any of the keys specified by +firstKeyBehavior + and +nKeyBehaviors + are not legal, a +Match + error results. The +behaviors + list has +totalKeyBehaviors + elements of type KB_BEHAVIOR; each entry of +behaviors + specifies a key in the specified range and a new behavior for that key; any +key that falls in the range specified by +firstBehavior + and +nBehaviors + for which no behavior is specified in +behaviors + is assigned the default behavior, +KB_Default +. The new behaviors must be legal, or a +Value + error results. To be legal, the behavior specified in the +XkbSetMap + request must: + + + + + Specify a key in the range indicated by +firstKeyBehavior + and +nKeyBehaviors +. + + + + Not specify the +permanent + flag; permanent behaviors cannot be set or changed using the +XkbSetMap + request. + + + + If present, the +KB_Overlay1 + and +KB_Overlay2 + behaviors must specify a keycode for the overlay key that is valid for the +current keyboard. + + + + If present, the +KB_RadioGroup + behavior must specify a legal index (0…31) for the radio group to which the +key belongs. + + + + + +Key behaviors that are not recognized by the server are accepted but ignored. +Attempts to replace a "permanent" behavior are silently ignored; the behavior +is not replaced, but not error is generated and any other components specified +in the +XkbSetMap + request are updated, as appropriate. + + + + +If +XkbVirtualModsMask + is set in +present +, +virtualMods + is a mask which specifies the virtual modifiers to be rebound. The +vmods + list specifies the real modifiers that are bound to each of the virtual +modifiers specified in +virtualMods +, starting from the lowest numbered virtual modifier and progressing upward. +Any virtual modifier that is not specified in +virtualMods + has no corresponding entry in +vmods +, so the +vmods + list has one entry for each bit that is set in +virtualMods +. + + + + +If +XkbExplicitComponentsMask + is set in +present +, +firstKeyExplicit + and +nKeyExplicit + specify a subset of the keyboard keys to which new explicit components are to +be assigned, and +totalKeyExplicit + specifies the total number of keys in that range that have at least one +explicit component. The +explicit + list has +totalKeyExplicit + elements of type KB_KEYEXPLICIT; each entry of +explicit + specifies a key in the specified range and a new set of explicit components +for that key. Any key that falls in the range specified by +firstKeyExplicit + and +nKeyExplicit + that is not assigned some value in +explicit + has no explicit components. + + + + +If +XkbModifierMapMask + is set in +present +, +firstModMapKey + and +nModMapKeys + specify a subset of the keyboard keys for which new modifier mappings are to +be assigned, and +totalModMapKeys + specifies the total number of keys in that range to which at least one +modifier is bound. The +modmap + list has +totalModMapKeys + elements of type KB_KEYMODMAP; each entry of +modmap + specifies a key in the specified range and a new set of modifiers to be +associated with that key. Any key that falls in the range specified by + +firstModMapKey + and +nModMapKeys + that is not assigned some value in +modmap + has no associated modifiers. + + + + +If the modifier map is changed by the +XkbSetMap + request, any changes are also reflected in the core protocol modifier mapping. +Changes to the core protocol modifier mapping are reported to XKB-unaware +clients via +MappingNotify + events and can be retrieved with the core protocol +GetModifierMapping + request. + + + + +If +XkbVirtualModMapMask + is set in +present +, +firstVModMapKey + and +nVModMapKeys + specify a subset of the keyboard keys for which new modifier mappings are to +be assigned, and +totalVModMapKeys + specifies the total number of keys in that range to which at least one virtual +modifier is bound. The +vmodmap + list has +totalVModMapKeys + elements of type KB_KEYVMODMAP; each entry of +vmodmap + specifies a key in the specified range and a new set of virtual modifiers to +be associated with that key. Any key that falls in the range specified by + +firstVModMapKey + and +nVModMapKeys + that is not assigned some value in +vmodmap + has no associated virtual modifiers. + + + + +If the resulting keyboard map is legal, the server updates the keyboard map. +Changes to some keyboard components have indirect effects on others: + + + + +If the +XkbSetMapRecomputeActions + bit is set in +flags +, the actions associated with any keys for which symbol or modifier bindings +were changed by this request are recomputed as described in +Assigning Actions To Keys. Note +that actions are recomputed +after +any actions specified in this request are bound to keys, so the actions +specified in this request might be clobbered by the automatic assignment of +actions to keys. + + + + +If the group width of an existing key type is changed, the list of symbols +associated with any keys of the changed type might be resized accordingly. If +the list increases in size, any unspecified new symbols are initialized to + +NoSymbol +. + + + + +If the list of actions associated with a key is not empty, changing the key +type of the key resizes the list. Unspecified new actions are calculated by +applying any keyboard symbol interpretations to the corresponding symbols. + + + + +The number of groups global to the keyboard is always equal to the largest +number of groups specified by any of the key symbol maps. Changing the number +of groups in one or more key symbol maps may change the number of groups global +to the keyboard. + + + + +Assigning key behavior +KB_RadioGroup + to a key adds that key as a member of the specified radio group. Changing a +key with the existing behavior +KB_RadioGroup + removes that key from the group. Changing the elements of a radio group can +cause synthetic key press or key release events if the key to be added or +removed is logically down at the time of the change. + + + + +Changing a key with behavior +KB_Lock + causes a synthetic key release event if the key is logically but not +physically down at the time of the change. + + + + +This request sends an +XkbMapNotify + event which reflects both explicit and indirect map changes to any interested +clients. If any symbolic names are changed, it sends a +XkbNamesNotify + reflecting the changes to any interested clients. XKB-unaware clients are +notified of keyboard changes via core protocol +MappingNotify + events. + + + + +Key press and key release events caused by changing key behavior may cause +additional +XkbStateNotify + or +XkbIndicatorStateNotify + events. + + + + + +Querying and Changing the Compatibility Map + + + + + + + + + XkbGetCompatMap + + + + + deviceSpec: KB_DEVICESPEC + + + +groups: KB_GROUPMASK + + + +getAllSI: BOOL + + + +firstSI, nSI: CARD16 + + + + +deviceID: CARD8 + + + + +groupsRtrn: KB_GROUPMASK + + + + +firstSIRtrn, nSIRtrn, nTotalSI: CARD16 + + + + +siRtrn: LISTofKB_SYMINTERP + + + + +groupRtrn: LISTofKB_MODDEF + + + Errors: +Keyboard +, +Match +, +Alloc + + + + + + + + +This request returns the listed compatibility map components for the keyboard +specified by +deviceSpec +. If +deviceSpec + does not specify a valid keyboard device, a +Keyboard + Error results. On return, +deviceID + reports the input extension identifier of the keyboard device or +0 + if the server does not support the input extension. + + + + +If +getAllSI + is +False +, +firstSI + and +nSI + specify a subset of the symbol interpretations to be returned; if used, + +nSI + must be greater than +0 + and all of the elements specified by +firstSI + and +nSI + must be defined or a +Value + error results. If +getAllSyms + is +True +, the server ignores +firstSym + and +nSyms + and returns all of the symbol interpretations defined for the keyboard. + + + + +The +groups + mask specifies the groups for which compatibility maps are to be returned. + + + + +The +nTotalSI + return value reports the total number of symbol interpretations defined for +the keyboard. On successful return, the +siRtrn + return list contains the definitions for +nSIRtrn + symbol interpretations beginning at +firstSIRtrn +. + + + + +The +groupRtrn + return values report the entries in the group compatibility map for any groups +specified in the +groupsRtrn + return value. + + + + + + + + + + + XkbSetCompatMap + + + + + deviceSpec: KB_DEVICESPEC + + + +recomputeActions: BOOL + + + +truncateSI: BOOL + + + +groups: KB_GROUPMASK + + + +firstSI, nSI: CARD16 + + + +si: LISTofKB_SYMINTERPRET + + + +groupMaps: LISTofKB_MODDEF + + + + Errors: +Keyboard +, +Match +, +Value +, +Alloc + + + + + + + + +This request changes a specified subset of the compatibility map of the +keyboard indicated by +deviceSpec +. If +deviceSpec + specifies an invalid device, a +Keyboard + error results and nothing is changed. + + + + +The +firstSI + and +nSI + fields specify a subset of the keyboard symbol interpretations to be changed. +The +si + list specifies new values for each of the interpretations in that range. + + + + +The first symbol interpretation to be changed, +firstSI +, must be less than or equal to the unchanged length of the list of symbol +interpretations, or a +Value + error results. If the resulting list would be larger than the unchanged list, +it server list of symbol interpretations is automatically increased in size. +Otherwise, if +truncateSyms + is +True +, the server deletes any symbol interpretations after the last element changed +by this request, and reduces the length of the list accordingly. + + + + +The +groupMaps + fields contain new definitions for a subset of the group compatibility map; + +groups + specifies the group compatibility map entries to be updated from +groupMaps +. + + + + + All changed compatibility maps and symbol interpretations must either ignore +group state or specify a legal range of groups, or a +Value + error results. + + + + +If the +recomputeActions + field is +True +, the server regenerates recalculates the actions bound to all keyboard keys by +applying the new symbol interpretations to the entire key symbol map, as +described in Assigning Actions To +Keys. + + + + + +Querying and Changing Indicators + + + + + + + + + XkbGetIndicatorState + + + + + deviceSpec: KB_DEVICESPEC + + + +deviceID: CARD8 +state: KB_INDICATORMASK + + + + Errors: +Keyboard + + + + + + + + +This request reports the current state of the indicators for the keyboard +specified by +deviceSpec +. If +deviceSpec + does not specify a valid keyboard, a +Keyboard + error results. + + + + +On successful return, the +deviceID + field reports the input extension identifier of the keyboard or +0 + if the server does not support the input extension. The +state + return value reports the state of each of the thirty-two indicators on the +specified keyboard. The least-significant bit corresponds to indicator 0, the +most significant bit to indicator 31; if a bit is set, the corresponding +indicator is lit. + + + + + + + + + + + XkbGetIndicatorMap + + + + + deviceSpec: KB_DEVICESPEC + + + +which: KB_INDICATORMASK + + + + +deviceID: CARD8 + + + + +which: KB_INDICATORMASK + + + + +realIndicators: KB_INDICATORMASK + + + + +nIndicators: CARD8 + + + + +maps: LISTofKB_INDICATORMAP + + + Errors: +Keyboard +, +Value + + + + + + + +This request returns a subset of the maps for the indicators on the keyboard +specified by +deviceSpec +. If +deviceSpec + does not specify a valid keyboard device, a +Keyboard + error results. + + + + +The +which + field specifies the subset to be returned; a set bit in the which field +indicates that the map for the corresponding indicator should be returned. + + + + +On successful return, the +deviceID + field reports the input extension identifier of the keyboard or +0 + if the server does not support the input extension. Any indicators specified +in +realIndicators + are actually present on the keyboard; the rest are virtual indicators. Virtual +indicators do not directly cause any visible or audible effect when they change +state, but they do cause +XkbIndicatorStateNotify + events. + + + + +The +maps + return value reports the requested indicator maps. Indicator maps are +described in Indicator Maps + + + + + + + + + + + XkbSetIndicatorMap + + + + + deviceSpec: KB_DEVICESPEC + + + +which: KB_INDICATORMASK + + + +maps: LISTofKB_INDICATORMAP + + + + Errors: +Keyboard +, +Value + + + + + + + + +This request changes a subset of the maps on the keyboard specified by + +deviceSpec +. If +deviceSpec + does not specify a valid keyboard device, a +Keyboard + error results. + + + + +The +which + field specifies the subset to be changed; the +maps + field contains the new definitions. + + + + +If successful, the new indicator maps are applied immediately. If any +indicators change state as a result of the new maps, the server generates + +XkbIndicatorStateNotify + events as appropriate. + + + + + + + + + + + XkbGetNamedIndicator + + + + + deviceSpec: KB_DEVICESPEC + + + +ledClass: KB_LEDCLASSSPEC + + + +ledID: KB_IDSPEC + + + +indicator: ATOM + + + + +deviceID: CARD8 + + + + +supported: BOOL + + + + +indicator: ATOM + + + + +found: BOOL + + + + +on: BOOL + + + + +realIndicator: BOOL + + + + +ndx: CARD8 + + + + +map: KB_INDICATORMAP + + + + Errors: +Keyboard +, +Atom +, +Value + + + + + + + + +This request returns information about the indicator specified by +ledClass +, +ledID +, and +indicator + on the keyboard specified by +deviceSpec +. The +indicator + field specifies the name of the indicator for which information is to be +returned. + + + + +If +deviceSpec + does not specify a device with indicators, a +Keyboard + error results. If +ledClass + does not have the value +DfltXIClass +, +LedFeedbackClass +, or +KbdFeedbackClass +, a +Value + error results. If +ledID + does not have the value +DfltXIId + or specify the identifier of a feedback of the class specified by +ledClass + on the device specified by +deviceSpec +, a +Match + error results. If +indicator + is not a valid ATOM other than +None +, an +Atom + error results. + + + + +This request is always supported with default class and identifier on the core +keyboard device. If the request specifies a device other than the core keyboard +device or a feedback class and identifier other than the defaults, and the +server does not support indicator names or indicator maps for extension +devices, the +supported + return value is +False + and the values of the other fields in the reply are undefined. If the client +which issued the unsupported request has also selected to do so, it will also +receive an +XkbExtensionDeviceNotify + event which reports the attempt to use an unsupported feature, in this case +one or both of +XkbXI_IndicatorMaps + or +XkbXI_IndicatorNames +. + + + + +Otherwise, +supported + is +True + and the +deviceID + field reports the input extension identifier of the keyboard or +0 + if the server does not support the input extension. The +indicator + return value reports the name for which information was requested and the + +found + return value is +True + if an indicator with the specified name was found on the device. + + + + +If a matching indicator was found: + + + + + The +on + return value reports the state of the indicator at the time of the request. + + + + The +realIndicator + return value is +True + if the requested indicator is actually present on the keyboard or +False + if it is virtual. + + + + The +ndx + return value reports the index of the indicator in the requested feedback. + + + + The +map + return value reports the indicator map used by to automatically change the +state of the specified indicator in response to changes in keyboard state or +controls. + + + + + +If no matching indicator is found, the +found + return value is +False +, and the +on +, +realIndicator +, +ndx +, and +map + return values are undefined. + + + + + + + + + + + XkbSetNamedIndicator + + + + + deviceSpec: KB_DEVICESPEC + + + +ledClass: KB_LEDCLASSSPEC + + + +ledID: KB_IDSPEC + + + +indicator: ATOM + + + +setState: BOOL + + + +on: BOOL + + + +setMap: BOOL + + + +createMap: BOOL + + + +map: KB_SETINDICATORMAP + + + + Errors: +Keyboard +, +Atom +, +Access + + + + + + + + +This request changes various aspects of the indicator specified by +ledClass +, +ledID +, and +indicator + on the keyboard specified by +deviceSpec +. The +indicator + argument specifies the name of the indicator to be updated. + + + + +If +deviceSpec + does not specify a device with indicators, a +Keyboard + error results. If +ledClass + does not have the value +DfltXIClass +, +LedFeedbackClass +, or +KbdFeedbackClass +, a +Value + error results. If +ledID + does not have the value +DfltXIId + or specify the identifier of a feedback of the class specified by +ledClass + on the device specified by +deviceSpec +, a +Match + error results. If +indicator + is not a valid ATOM other than +None +, an +Atom + error results. + + + + +This request is always supported with default class and identifier on the core +keyboard device. If the request specifies a device other than the core keyboard +device or a feedback class and identifier other than the defaults, and the +server does not support indicator names or indicator maps for extension +devices, the +supported + return value is +False + and the values of the other fields in the reply are undefined. If the client +which issued the unsupported request has also selected to do so, it will also +receive an +XkbExtensionDeviceNotify + event which reports the attempt to use an unsupported feature, in this case +one or both of +XkbXI_IndicatorMaps + and +XkbXI_IndicatorNames +. + + + + +Otherwise, +supported + is +True + and the +deviceID + field reports the input extension identifier of the keyboard or +0 + if the server does not support the input extension. The +indicator + return value reports the name for which information was requested and the + +found + return value is +True + if an indicator with the specified name was found on the device. + + + + +If no indicator with the specified name is found on the specified device, and +the +createMap + field is +True +, XKB assigns the specified name to the lowest-numbered indicator that has no +name (i.e. whose name is +None +) and applies the rest of the fields in the request to the newly named +indicator. If no unnamed indicators remain, this request reports no error and +has no effect. + + + + +If no matching indicator is found or new indicator assigned this request +reports no error and has no effect. Otherwise, it updates the indicator as +follows: + + + + +If +setMap +is +True +, XKB changes the map for the indicator (see Indicator Maps) to reflect the +values specified in +map +. + + + + +If +setState + is +True +, XKB attempts to explicitly change the state of the indicator to the state +specified in +on +. The effects of an attempt to explicitly change the state of an indicator +depend on the values in the map for that indicator and are not guaranteed to +succeed. + + + + +If this request affects both indicator map and state, it updates the indicator +map before attempting to change its state, so the success of the explicit +change depends on the indicator map values specified in the request. + + + + +If this request changes the indicator map, it applies the new map immediately +to determine the appropriate state for the indicator given the new indicator +map and the current state of the keyboard. + + + + + +Querying and Changing Symbolic Names + + + + + + + + + XkbGetNames + + + + + deviceSpec: KB_DEVICESPEC + + + +which: KB_NAMEDETAILMASK + + + +deviceID: CARD8 +which: KB_NAMESMASK +minKeyCode, maxKeyCode: KEYCODE +nTypes: CARD8 +nKTLevels: CARD16 +groupNames: KB_GROUPMASK +virtualMods: KB_VMODMASK +firstKey: KEYCODE +nKeys: CARD8 +indicators: KB_INDICATORMASK +nRadioGroups, nKeyAliases: CARD8 +present: KB_NAMEDETAILMASK +valueList: LISTofITEMs + + + + Errors: +Keyboard +, +Value + + + + + + + + +This request returns the symbolic names for various components of the keyboard +mapping for the device specified by +deviceSpec +. The +which + field specifies the keyboard components for which names are to be returned. If + +deviceSpec + does not specify a valid keyboard device, a +Keyboard + error results. If any undefined bits in +which + are non-zero, a +Value + error results. + + + + +The +deviceID + return value contains the X Input Extension device identifier of the specified +device or +0 + if the server does not support the input extension. The +present + and +valueList + return values specify the components for which names are being reported. If a +component is specified in +present +, the corresponding element is present in the +valueList +, otherwise that component has length +0 +. The components of the +valueList + appear in the following order, when present:. + + + + + + + + + + + Component + Size + Type + + + + + +XkbKeycodesName + + 1 + ATOM + + + +XkbGeometryName + + 1 + ATOM + + + +XkbSymbolsName + + 1 + ATOM + + + +XkbPhysSymbolsName + + 1 + ATOM + + + +XkbTypesName + + 1 + ATOM + + + +XkbCompatName + + 1 + ATOM + + + +XkbKeyTypeNames + + +nTypes + + LISTofATOM + + + +XkbKTLevelNames + + +nTypes +, + +nKTLevels + + { count: LISTofCARD8, + names: LISTofATOM } + + + +XkbIndicatorNames + + One per bit set in +indicators + + LISTofATOM + + + +XkbVirtualModNames + + One per bit set in +virtualMods + + LISTofATOM + + + +XkbGroupNames + + One per bit set in +groupNames + + LISTofATOM + + + +XkbKeyNames + + +nKeys + + LISTofKB_KEYNAME + + + +XkbKeyAliases + + +nKeyAliases + + LISTofKB_KEYALIAS + + + +XkbRGNames + + +nRadioGroups + + LISTofATOM + + + + + + +If type names are reported, the +nTypes + return value reports the number of types defined for the keyboard, and the +list of key type names in +valueList + has +nTypes + elements. + + + + +If key type level names are reported, the list of key type level names in the + +valueList + has two parts: The +count + array has +nTypes + elements, each of which reports the number of level names reported for the +corresponding key type. The +names + array has +nKTLevels + atoms and reports the names of each type sequentially. The +nKTLevels + return value is always equal to the sum of all of the elements of the + +count + array. + + + + +If indicator names are reported, the +indicators + mask specifies the indicators for which names are defined; any indicators not +specified in +indicators + have the name +None +. The list of indicator names in +valueList + contains the names of the listed indicators, beginning with the +lowest-numbered indicator for which a name is defined and proceeding to the +highest. + + + + +If virtual modifier names are reported, the +virtualMods + mask specifies the virtual modifiers for which names are defined; any virtual +modifiers not specified in +virtualMods + have the name +None +. The list of virtual modifier names in +valueList + contains the names of the listed virtual modifiers, beginning with the +lowest-numbered virtual modifier for which a name is defined and proceeding to +the highest. + + + + +If group names are reported, the +groupNames + mask specifies the groups for which names are defined; any groups not +specified in +groupNames + have the name +None +. The list of group names in +valueList + contains the names of the listed groups, beginning with the lowest-numbered +group for which a name is defined and proceeding to the highest. + + + + +If key names are reported, the +firstKey + and +nKeys + return values specify a range of keys which includes all keys for which names +are defined; any key that does not fall in the range specified by +firstKey + and +nKeys + has the name +NullKeyName +. The list of key names in the +valueList + has +nKeys + entries and specifies the names of the keys beginning at +firstKey +. + + + + +If key aliases are reported, the +nKeyAliases + return value specifies the total number of key aliases defined for the +keyboard. The list of key aliases in +valueList + has +nKeyAliases + entries, each of which reports an alias and the real name of the key to which +it corresponds. + + + + +If radio group names are reported, the +nRadioGroups + return value specifies the number of radio groups on the keyboard for which +names are defined. The list of radio group names in +valueList + reports the names of each group and has +nRadioGroups + entries. + + + + + + + + + + + XkbSetNames + + + + + deviceSpec: KB_DEVICESPEC + + + which: KB_NAMEDETAILMASK + + + +virtualMods: KB_VMODMASK + + + +firstType, nTypes: CARD8 + + + +firstKTLevel, nKTLevels: CARD8 + + + +totalKTLevelNames: CARD16 + + + +indicators: KB_INDICATORMASK + + + +groupNames: KB_GROUPMASK + + + +nRadioGroups: CARD8 + + + +firstKey: KEYCODE + + + +nKeys, nKeyAliases: CARD8 + + + +valueList: LISTofITEMs + + + + Errors: +Keyboard +, +Atom +, +Value +, +Match +, +Alloc + + + + + + + + +This request changes the symbolic names for the requested components of the +keyboard specified by +deviceSpec +. The +which + field specifies the components for which one or more names are to be updated. +If +deviceSpec + does not specify a valid keyboard device, a +Keyboard + error results. If any undefined bits in +which + are non-zero, a +Value + error results. If any error (other than +Alloc + or +Implementation +) occurs, this request returns without modifying any names. + + + + +The +which + and +valueList + fields specify the components to be changed; the type of each +valueList + entry, the order in which components appear in the +valueList + when specified, and the correspondence between components in +which + and the entries in the +valueList + are as specified for the +XkbGetNames + request. + + + + +If keycodes, geometry, symbols, physical symbols, types or compatibility map +names are to be changed, the corresponding entries in the +valueList + must have the value +None + or specify a valid ATOM, else an +Atom + error occurs. + + + + +If key type names are to be changed, the +firstType + and +nTypes + fields specify a range of types for which new names are supplied, and the list +of key type names in +valueList + has +nTypes + elements. Names for types that fall outside of the range specified by + +firstType + and +nTypes + are not affected. If this request specifies names for types that are not +present on the keyboard, a +Match + error results. All of the type names in the +valueList + must be valid ATOMs or have the value +None +, or an +Atom + error results. + + + + +The names of the first four keyboard types are specified by the XKB extension +and cannot be changed; including any of the canonical types in this request +causes an +Access + error, as does trying to assign the name reserved for a canonical type to one +of the other key types. + + + + +If key type level names are to be changed, the +firstKTLevel + and +nKTLevels + fields specify a range of key types for which new level names are supplied, +and the list of key type level names in the +valueList + has two parts: The +count + array has +nKTLevels + elements, each of which specifies the number of levels for which names are +supplied on the corresponding key type; any levels for which no names are +specified are assigned the name +None +. The +names + array has +totalKTLevels + atoms and specifies the names of each type sequentially. The +totalKTLevels + field must always equal the sum of all of the elements of the +count + array. Level names for types that fall outside of the specified range are not +affected. If this request specifies level names for types that are not present +on the keyboard, or if it specifies more names for a type than the type has +levels, a +Match + error results. All specified type level names must be +None + or a valid ATOM or an +Atom + error results. + + + + +If indicator names are to be changed, the +indicators + mask specifies the indicators for which new names are specified; the names for +indicators not specified in +indicators + are not affected. The list of indicator names in +valueList + contains the new names for the listed indicators, beginning with the +lowest-numbered indicator for which a name is defined and proceeding to the +highest. All specified indicator names must be a valid ATOM or +None +, or an +Atom + error results. + + + + +If virtual modifier names are to be changed, the +virtualMods + mask specifies the virtual modifiers for which new names are specified; names +for any virtual modifiers not specified in +virtualMods + are not affected. The list of virtual modifier names in +valueList + contains the new names for the specified virtual modifiers, beginning with the +lowest-numbered virtual modifier for which a name is defined and proceeding to +the highest. All virtual modifier names must be valid ATOMs or +None +, or an +Atom + error results. + + + + +If group names are to be changed, the +groupNames + mask specifies the groups for which new names are specified; the name of any +group not specified in +groupNames + is not changed. The list of group names in +valueList + contains the new names for the listed groups, beginning with the +lowest-numbered group for which a name is defined and proceeding to the +highest. All specified group names must be a valid ATOM or +None +, or an +Atom + error results. + + + + +If key names are to be changed, the +firstKey + and +nKeys + fields specify a range of keys for which new names are defined; the name of +any key that does not fall in the range specified by +firstKey + and +nKeys + is not changed. The list of key names in the +valueList + has +nKeys + entries and specifies the names of the keys beginning at +firstKey +. + + + + +If key aliases are to be changed, the +nKeyAliases + field specifies the length of a new list of key aliases for the keyboard. The +list of key aliases can only be replaced in its entirety; it cannot be +replaced. The list of key aliases in +valueList + has +nKeyAliases + entries, each of which reports an alias and the real name of the key to which +it corresponds. + + + + +XKB does not check key names or aliases for consistency and validity, so +applications should take care not to assign duplicate names or aliases + + + + +If radio group names are to be changed, the +nRadioGroups + field specifies the length of a new list of radio group names for the +keyboard. There is no way to edit the list of radio group names; it can only be +replaced in its entirety. The list of radio group names in +valueList + reports the names of each group and has +nRadioGroups + entries. If the list of radio group names specifies names for more radio +groups than XKB allows (32), a +Match + error results. All specified radio group names must be valid ATOMs or have the +value +None +, or an +Atom + error results. + + + + + +Querying and Changing Keyboard Geometry + + + + + + + + + XkbGetGeometry + + + + + deviceSpec: KB_DEVICESPEC + + + + +name: ATOM + + + +deviceID: CARD8 + + + + +name: ATOM + + + + +found: BOOL + + + + +widthMM, heightMM: CARD16 + + + + +baseColorNdx, labelColorNdx: CARD8 + + + + +properties: LISTofKB_PROPERTY + + + + +colors: LISTofSTRING8 + + + + +shapes: LISTofKB_SHAPE + + + + +sections: LISTofKB_SECTION + + + + +doodads: LISTofKB_DOODAD + + + + +keyAliases: LISTofKB_KEYALIAS + + + Errors: +Keyboard + + + + + + + +This request returns a description of the physical layout of a keyboard. If the + +name + field has the value +None +, or if name is identical to the name of the geometry for the keyboard +specified by +deviceSpec +, this request returns the geometry of the keyboard specified by +deviceSpec +; otherwise, if +name + is a valid atom other than +None +, the server returns the keyboard geometry description with that name in the +server database of keyboard components (see The Server Database of Keyboard +Components) if one exists. If +deviceSpec + does not specify a valid keyboard device, a +Keyboard + error results. If +name + has a value other than +None + or a valid ATOM, an +Atom + error results. + + + + +On successful return, the +deviceID + field reports the X Input extension identifier of the keyboard device +specified in the request, or +0 + if the server does not support the input extension. + + + + +The +found + return value reports whether the requested geometry was available. If + +found + is +False +, no matching geometry was found and the remaining fields in the request reply +are undefined; if +found + is +True +, the remaining fields of the reply describe the requested keyboard geometry. +The interpretation of the components that make up a keyboard geometry is +described in detail in Keyboard +Geometry + + + + + + + + + + + XkbSetGeometry + + + + + deviceSpec: KB_DEVICESPEC + + + +name: ATOM + + + +widthMM, heightMM, CARD16 + + + +baseColorNdx, labelColorNdx: CARD8 + + + +shapes: LISTofKB_SHAPE + + + +sections: LISTofKB_SECTION + + + +properties: LISTofKB_PROPERTY + + + +colors: LISTofSTRING8 + + + +doodads: LISTofKB_DOODAD + + + +keyAliases: LISTofKB_KEYALIAS + + + + Errors: +Keyboard +, +Atom +, +Value + + + + + + + + +This request changes the reported description of the geometry for the keyboard +specified by +deviceSpec +. If deviceSpec does not specify a valid keyboard device, a +Keyboard + error results. + + + + +The +name + field specifies the name of the new keyboard geometry and must be a valid ATOM +or an +Atom + error results. The new geometry is not added to the server database of +keyboard components, but it can be retrieved using the +XkbGetGeometry + request for as long as it is bound to the keyboard. The keyboard geometry +symbolic name is also updated from the name field, and an +XkbNamesNotify + event is generated, if necessary. + + + + +The list of +colors + must include at least two definitions, or a +Value + error results. All color definitions in the geometry must specify a legal +color (i.e. must specify a valid index for one of the entries of the +colors + list) or a +Match + error results. The +baseColorNdx + and the +labelColorNdx + must be different or a +Match + error results. + + + + +The list of +shapes + must include at least one shape definition, or a +Value + error results. If any two shapes have the same name, a +Match + error result. All doodads and keys which specify shape must specify a valid +index for one of the elements of the +shapes + list, or a +Match + error results. + + + + +All section, shape and doodad names must be valid ATOMs or an +Atom + error results; the constant +None + is not permitted for any of these components. + + + + +All doodads must be of a known type; XKB does not support "private" doodad +types. + + + + +If, after rotation, any keys or doodads fall outside of the bounding box for a +section, the bounding box is automatically adjusted to the minimum size which +encloses all of its components. + + + + +If, after adjustment and rotation, the bounding box of any section or doodad +extends below zero on either the X or Y axes, the entire geometry is translated +so that the minimum extent along either axis is zero. + + + + +If, after rotation and translation, any keyboard components fall outside of the +rectangle specified by +widthMM + and +heightMM +, the keyboard dimensions are automatically resized to the minimum bounding box +that surrounds all components. Otherwise, the width and height of the keyboard +are left as specified. + + + + +The +under + field of any overlay key definitions must specify a key that is in the section +that contains the overlay key, or a +Match + error results. This request does not check the value of the +over + field of an overlay key definition, so applications must be careful to avoid +conflicts with actual keys. + + + + +This request does not verify that key names or aliases are unique. It also does +not verify that all key names specified in the geometry are bound to some +keycode or that all keys that are named in the keyboard definition are also +available in the geometry. Applications should make sure that keyboard geometry +has no internal conflicts and is consistent with the other components of the +keyboard definition, but XKB does not check for or guarantee it. + + + + + +Querying and Changing Per-Client Flags + + + + + + + + + XkbPerClientFlags + + + + + deviceSpec: KB_DEVICESPEC + + + +change: KB_PCFMASK + + + +value: KB_PCFMASK + + + +ctrlsToChange: KB_BOOLCTRLMASK + + + +autoCtrls: KB_BOOLCTRLMASK + + + +autoCtrlValues: KB_BOOLCTRLMASK + + + +deviceID: CARD8 +supported: KB_PCFMASK +value: KB_PCFMASK +autoCtrls: KB_BOOLCTRLMASK +autoCtrlValues: KB_BOOLCTRLMASK +where: KB_PCFMASK: + + + + Errors: +Keyboard +, +Value +, +Match +, +Alloc + + + + + + + + +Changes the client specific flags for the keyboard specified by +deviceSpec +. Reports a +Keyboard + error if +deviceSpec + does not specify a valid keyboard device. + + + + +Any flags specified in +change + are set to the corresponding values in +value +, provided that the server supports the requested control. Legal +per-client-flags are: + + + + + + + + + + Flag… + Described in… + + + + + +XkbPCF_DetectableAutorepeat + + Detectable +Autorepeat + + + +XkbPCF_GrabsUseXKBStateMask + + Setting a Passive Grab +for an XKB State + + + +XkbPCF_AutoResetControlsMask + + Automatic Reset of +Boolean Controls + + + +XkbPCF_LookupStateWhenGrabbed + + Effects of XKB on Core +Protocol Events + + + +XkbPCF_SendEventUsesXKBState + + Sending Events to +Clients + + + + + + +If +PCF_AutoResetControls + is set in both +change + and +value +, the client’s mask of controls to be changed is updated from +ctrlsToChange +, +autoCtrls +, and +autoCtrlValues +. Any controls specified in +ctrlsToChange + are modified in the auto-reset controls mask for the client; the corresponding +bits from the +autoCtrls + field are copied into the auto-reset controls mask and the corresponding bits +from +autoCtrlValues + are copied into the auto-reset controls state values. If any controls are +specified in +autoCtrlValues + but not in +autoCtrls +, a +Match + error results. If any controls are specified in +autoCtrls + but not in +ctrlsToChange +, a +Match + error results. + + + + +If +PCF_AutoResetControls + is set in +change + but not in +value +, the client’s mask of controls to be changed is reset to all zeroes (i.e. +the client does not change any controls when it exits). + + + + +This request reports a +Match + error if a bit is set in any of the value masks but not in the control mask +that governs it or a +Value + error if any undefined bits are set in any of the masks. + + + + +On successful return, the +deviceID + field reports the X Input extension identifier of the keyboard, or +0 + if the server does not support the X Input Extension. + + + + +The +supported + return value reports the set of per-client flags that are supported by the +server; in this version of XKB, only the +XkbPCF_DetectableAutorepeat + per-client flag is optional; all other per-client flags must be supported. + + + + +The +value + return value reports the current settings of all per-client flags for the +specified keyboard. The +autoCtrls + return value reports the current set of controls to be reset when the client +exits, while the +autoCtrlValues + return value reports the state to which they should be set. + + + + + +Using the Server’s Database of Keyboard Components + + + + + + + + + XkbListComponents + + + + + deviceSpec: KB_DEVICESPEC + + + +maxNames: CARD16 + + + +keymapsSpec: STRING8 + + + +keycodesSpec: STRING8 + + + +typesSpec: STRING8 + + + +compatMapSpec: STRING8 + + + +symbolsSpec: STRING8 + + + +geometrySpec: STRING8 + + + + +deviceID: CARD8 + + + + +extra: CARD16 + + + + +keymaps,keycodes,types,compatMaps: LISTofKB_COMPONENTNAME + + + + +symbols, geometries: LISTofKB_COMPONENTNAME + + + Where: + + + KB_COMPONENTNAME { hints: CARD8, name: +STRING8 } + + + Errors: +Keyboard +, +Alloc + + + + + + + +This request returns one or more lists of keyboard components that are +available from the X server database of keyboard components for the device +specified by +deviceSpec +. The X server is allowed, but not required or expected, to maintain separate +databases for each keyboard device. A +Keyboard + error results if +deviceSpec + does not specify a valid keyboard device. + + + + +The +maxNames + field specifies the maximum number of component names to be reported, in +total, by this request. + + + + +The +keymapsSpec +, +keycodesSpec +, +typesSpec +, +compatMapSpec +, +symbolsSpec + and +geometrySpec + request fields specify a pattern to be matched against the names of all +components of the corresponding type in the server database of keyboard +components. + + + + +Each pattern uses the ISO Latin-1 encoding and should contain only parentheses, +the wildcard characters "?" and "*" or characters that are permitted in a +component class or member name (see Component Names). Illegal +characters in a pattern are simply ignored; no error results if a pattern +contains illegal characters. + + + + +Comparison is case-sensitive and, in a pattern, the "?" wildcard character +matches any single character except parentheses while the "*" character matches +any number of characters except parentheses. If an implementation accepts +characters other than those required by XKB, whether or not those characters +match either wildcard is also implementation dependent. An empty pattern does +not match any component names. + + + + +On successful return, the +deviceID + return value reports the X Input Extension device identifier of the specified +device, or +0 + if the server does not support the X input extension. The +extra + return value reports the number of matching component names that could not be +returned due to the setting of the +maxNames + field in the request. + + + + +The +keymaps +, +keycodes +, +types +, +compatMaps +, +symbols + and +geometries + return the hints (see Component +Hints) and names of any components from the server database that match +the corresponding pattern. + + + + +The Server Database of Keyboard +Components describes the X server database of keyboard components in +more detail. + + + + + + + + + + + XkbGetKbdByName + + + + + deviceSpec: KB_DEVICESPEC + + + +need, want: KB_GBNDETAILMASK + + + +load: BOOL + + + +keymapsSpec: STRING8 + + + +keycodesSpec, typesSpec: STRING8 + + + +compatMapSpec, symbolsSpec: STRING8 + + + +geometrySpec: STRING8 + + + + +deviceID: CARD8 + + + + +minKeyCode, maxKeyCode: KEYCODE + + + + +loaded, newKeyboard: BOOL + + + + +found, reported: KB_GBNDETAILMASK + + + + +map: optional +XkbGetMap + reply + + + + +compat: optional +XkbGetCompatMap + reply + + + + +indicators: optional +XkbGetIndicatorMap + reply + + + + +names: optional +XkbGetNames + reply + + + + +geometry: optional +XkbGetGeometry + reply + + + + Errors: +Keyboard +, +Access +, +Alloc + + + + + + + + +Assembles and returns a keymap from the current mapping and specified elements +from the server database of keymap components for the keyboard specified by + +deviceSpec +, and optionally replaces the current keyboard mapping with the newly generated +description. If +deviceSpec + does not specify a valid keyboard device, a +Keyboard + error results. + + + + +The +keymapsSpec +, +keycodesSpec +, +typesSpec +, +compatMapSpec +, +symbolsSpec + and +geometrySpec + component expressions (see +Partial Components and Combining Multiple Components) specify the +database components to be used to assemble the keyboard description. + + + + +The +want + field lists the pieces of the keyboard description that the client wants to +have reported for the newly constructed keymap. The +need + field lists all of the pieces that must be reported. If any of the pieces in + +need + cannot be loaded from the specified names, no description of the keyboard is +returned. + + + + +The +want + and +need + fields can include any combinations of these +XkbGetMapByName + (GBN) components: + + + + + + + + + + + XkbGetMapByName Keyboard Component… + Database Component… + Components of Keyboard Description + + + + + +XkbGBN_Types + + types + key types + + + +XkbGBN_CompatMap + + compat + symbol interpretations, group compatibility map + + + +XkbGBN_ClientSymbols + + symbols, types, keycodes + key types, key symbol mappings, modifier mapping + + + +XkbGBN_ServerSymbols + + symbols, types, keycodes + key behaviors, key actions, key explicit components, virtual +modifiers, virtual modifier mapping + + + +XkbGBN_IndicatorMap + + compat + indicator maps, indicator names + + + +XkbGBN_KeyNames + + keycodes + key names, key aliases + + + +XkbGBN_Geometry + + geometry + keyboard geometry + + + +XkbGBN_OtherNames + + all + key types, symbol interpretations, indicator maps, names, +geometry + + + + + + +If either field contains a GBN component that depends on some database +component for which the request does not supply an expression, XKB +automatically substitutes the special pattern "%" which copies the +corresponding component from the current keyboard description, as described in +Partial Components and Combining +Multiple Components. + + + + +The +load + flag asks the server to replace the current keyboard description for +deviceSpec + with the newly constructed keyboard description. If +load + is +True +, the request must include component expressions for all of the database +components; if any are missing, XKB substitutes "%" as described above. + + + + +If all necessary components are both specified and found, the new keyboard +description is loaded. If the new keyboard description has a different geometry +or keycode range than the previous keyboard description, XKB sends +XkbNewKeyboardNotify + events to all interested clients. See +Replacing the Keyboard +"On-the-Fly" for more information about the effects of replacing the +keyboard description on the fly. + + + + +If the range of keycodes changes, clients that have requested +XkbNewKeyboardNotify + events are not sent any other change notification events by this request. +Clients that do not request +XkbNewKeyboardNotify + events are sent other XKB change notification events (e.g. +XkbMapNotify +, +XkbNamesNotify +) as necessary to alert them to as many of the keyboard changes as possible. + + + + +If no error occurs, the request reply reports the GBN components that were +found and sends a description of any of the resulting keyboard that includes +and of the components that were requested. + + + + +The +deviceID + return value reports the X Input extension device identifier of the keyboard +that was used, or +0 + if the server does not support the X input extension. + + + + +The +minKeyCode + and +maxKeyCode + return values report the legal range of keycodes for the keyboard description +that was created. If the resulting keyboard description does not include at +least one of the key names, client symbols or server symbols components, + +minKeyCode + and +maxKeyCode + are both +0 +. + + + + +The +loaded + return value reports whether or not the existing keyboard definition was +replaced with the newly created one. If +loaded + is +True +, the +newKeyboard + return value reports whether or not the new map changed the geometry or range +of keycodes and caused +XkbNewKeyboardNotify + events for clients that have requested them. + + + + +The +found + return value reports the GBN components that were present in the keymap that +was constructed by this request. The +reported + return value lists the subset of those components for which descriptions +follow. if any of the components specified in the +need + field of the request were not found, +reported + is empty, otherwise it contains the intersection of the +found + return value with the union of the +need + and +want + request fields. + + + + +If any of +GBN_Types +, +GBN_ClientSymbols + or +GBN_ServerSymbols + are set in +reported +, the +map + return value has the same format as the reply to an +XkbGetMap + request and reports the corresponding pieces of the newly constructed keyboard +description. + + + + +If +GBN_CompatMap + is set in +reported +, the +compat + return value has the same format as the reply to an +XkbGetCompatMap + request and reports the symbol interpretations and group compatibility map for +the newly constructed keyboard description. + + + + +If +GBN_IndicatorMap + is set in +reported +, the +indicators + return value has the same format as the reply to an +XkbGetIndicatorMap + request and reports the physical indicators and indicator maps for the newly +constructed keyboard description. + + + + +If +GBN_KeyNames + or +GBN_OtherNames + are set in +reported +, the +names + return value has the same format as the reply to an +XkbGetNames + reply and reports the corresponding set of symbolic names for the newly +constructed keyboard description. + + + + +If +GBN_Geometry + is set in +reported +, the +geometry + return value has the same format as the reply to an +XkbGetGeometryMap + request and reports the keyboard geometry for the newly constructed keyboard +description. + + + + + +Querying and Changing Input Extension Devices + + + + + + + + + XkbGetDeviceInfo + + + + + deviceSpec: KB_DEVICESPEC + + + +wanted: KB_XIDEVFEATUREMASK + + + +ledClass: KB_LEDCLASSSPEC + + + +ledID: KB_IDSPEC + + + +allButtons: BOOL + + + +firstButton, nButtons: CARD8 + + + + +deviceID: CARD8 + + + + +present: KB_XIDEVFEATUREMASK + + + + +supported: KB_XIFEATUREMASK + + + + +unsupported: KB_XIFEATUREMASK + + + + +firstBtnWanted: CARD8 + + + + +nBtnsWanted: CARD8 + + + + +firstBtnRtrn: CARD8 + + + + +nBtnsRtrn: CARD8 + + + + +totalBtns: CARD8 + + + + +hasOwnState: BOOL + + + + +dfltKbdFB, dfltLedFB: KB_IDSPEC + + + + +devType: ATOM + + + + +name: STRING + + + + +btnActions: LISTofKB_ACTION + + + + +leds: LISTofKB_DEVICELEDINFO + + + + Errors: +Device +, +Match +, +Access +, +Alloc + + + + + + + + +Reports a subset of the XKB-supplied information about the input device +specified by +deviceSpec +. Unlike most XKB requests, the device specified for +XkbGetDeviceInfo + need not be a keyboard device. Nonetheless, a +Keyboard + error results if +deviceSpec + does not specify a valid core or input extension device. + + + + +The +wanted + field specifies the types of information to be returned, and controls the +interpretation of the other request fields. + + + + +If the server does not support assignment of XKB actions to extension device +buttons, the +allButtons +, +firstButton + and +nButtons + fields are ignored. + + + + +Otherwise, if the +XkbXI_ButtonActions + flag is set in +wanted +, the +allButtons +, +firstButton + and +nButtons + fields specify the device buttons for which actions should be returned. +Setting +allButtons + to +True + requests actions for all device buttons; if +allButtons + is +False +, +firstButton + and +nButtons + specify a range of buttons for which actions are requested. If the device has +no buttons or if +firstButton + and +nButtons + specify illegal buttons, a +Match + error results. If +allButtons + is +True +, +firstButton + and +nButtons + are ignored. + + + + +If the server does not support XKB access to any aspect of the indicators on +extension devices, or if the +wanted + field does not include any of the indicator flags, the +ledClass + and +ledID + fields are ignored. Otherwise, +ledClass + and +ledID + specify one or more feedback(s) for which indicator information is requested. +If +ledClass + or +ledID + have illegal values, a +Value + error results. If they have legal values but do not specify a keyboard or +indicator class feedback for the device in question, a +Match + error results. + + + + +The +ledClass + field can specify either +KbdFeedbackClass +, +LedFeedbackClass +, +XkbDfltXIClass +, or +XkbAllXIClasses +. If at least one keyboard feedback is defined for the specified device, + +XkbDfltXIClass + is equivalent to +KbdFeedbackClass +, otherwise it is equivalent to +LedFeedbackClass +. If +XkbAllXIClasses + is specified, this request returns information about both indicator and +keyboard class feedbacks which match the requested identifier, as described +below. + + + + +The +ledID + field can specify any valid input extension feedback identifier, +XkbDfltXIId +, or +XkbAllXIIds +. The default keyboard feedback is the one that is affected by core protocol +requests; the default led feedback is implementation-specific. If +XkbAllXIIds + is specified, this request returns indicator information about all feedbacks +of the class(es) specified by +ledClass +. + + + + +If no error results, the +deviceID + return value reports the input extension device identifier of the device for +which values are being returned. The +supported + return value reports the set of optional XKB extension device features that +are supported by this implementation (see + +Interactions Between XKB and the X Input +Extension) for the specified device, and the unsupported return value +reports any +unsupported + features. + + + + +If +hasOwnState + is +True +, the device is also a keyboard, and any indicator maps bound to the device use +the current state and control settings for this device to control automatic +changes. If +hasOwnState + is +False +, the state and control settings of the core keyboard device control automatic +indicator changes. + + + + +The +name + field reports the X Input Extension name for the device. The +devType + field reports the X Input Extension device type. Both fields are provided +merely for convenience and are not interpreted by XKB. + + + + +The +present + return value reports the kinds of device information being returned, and +controls the interpretation of the remaining fields. The +present + field consists of the +wanted + field from the original request minus the flags for any unsupported features. + + + + +If +XkbXI_ButtonActions + is set in +present +, the +totalBtns + return value reports the total number of buttons present on the device, + +firstBtnWanted + and +nBtnsWanted + specify the range of buttons for which actions were requested, and the + +firstBtnRtrn + and +nBtnsRtrn +values specify the range of buttons for which actions are reported. The + +actionsRtrn + list has +nButtonsRtrn + entries which contain the actions bound to the specified buttons on the +device. Any buttons for which actions were requested but not returned have the +action +NoAction() +. + + + + +If any indicator information is reported, the leds list contains one element +for each requested feedback. For example, if +ledClass + is +XkbAllXIClasses + and +ledID + is +XkbAllXIIds +, +leds + describes all of the indicators on the device and has one element for each +keyboard or led class feedback defined for the device. If any information at +all is reported about a feedback, the set of physical indicators is also +reported in the +physIndicators + field of the corresponding element of +leds +. + + + + +If the server supports assignment of indicator maps to extension device +indicators, and if the +XkbXI_IndicatorMaps + flag is set in +wanted +, each member of +leds + reports any indicators on the corresponding feedback to which names have been +assigned. Any indicators for which no map is reported have the default map, +which allows explicit changes and does not request any automatic changes. + + + + +If the server supports assignment of indicator names to extension device +indicators, and the +XkbXI_IndicatorNames + flag is set in +wanted +, each member of +leds + reports any indicators on the corresponding feedback to which names have been +assigned. Any indicators for which no name is reported have the name +None +. + + + + +If the server supports XKB access to the state of extension device indicators, +and the +XkbXI_IndicatorState + flag is set in wanted, each member of leds reports the state of the indicators +on the corresponding feedback. + + + + +If any unsupported features are requested, and the requesting client has +selected for them, the server sends the client an +XkbExtensionDeviceNotify + event which indicates that an unsupported feature was requested. This event is +only generated if the client which issued the unsupported request has selected +for it and, if generated, is not sent to any other clients. + + + + + + + + + + + XkbSetDeviceInfo + + + + + deviceSpec: KB_DEVICESPEC + + + +change: KB_XIDEVFEATUREMASK + + + +firstBtn, nBtns: CARD8 + + + +btnActions:LISTofKB_ACTION + + + +leds: LISTofKB_DEVICELEDINFO + + + + Errors: +Device +, +Match +, +Access +, +Alloc + + + + + + + + +Changes a subset of the XKB-supplied information about the input device +specified by +deviceSpec +. Unlike most XKB requests, the device specified for +XkbGetDeviceInfo + need not be a keyboard device. Nonetheless, a +Keyboard + error results if +deviceSpec + does not specify a valid core or input extension device + + + + +The +change + field specifies the features for which new values are supplied, and controls +the interpretation of the other request fields. + + + + +If the server does not support assignment of XKB actions to extension device +buttons, the +firstButton + and +nButtons + fields are ignored. + + + + +Otherwise, if the +XkbXI_ButtonActions + flag is set in +change +, the +firstBtn + and +nBtns + fields specify a range of buttons for which actions are specified in this +request. If the device has no buttons or if +firstBtn + and +nBtns + specify illegal buttons, a +Match + error results. + + + + +Each element of the +leds + list describes the changes for a single keyboard or led feedback. If the + +ledClass + field of any element of +leds + contains any value other than +KbdFeedbackClass +, +LedFeedbackClass + or +XkbDfltXIClass +, a +Value + error results. If the +ledId + field of any element of leds contains any value other than a valid input +extension feedback identifier or +XkbDfltXIId +, a +Value + error results. If both fields are valid, but the device has no matching +feedback, a +Match + error results. + + + + +The fields of each element of +leds + are interpreted as follows: + + + + + If +XkbXI_IndicatorMaps + is set in +change + and the server supports XKB assignment of indicator maps to the corresponding +feedback, the maps for all indicators on the corresponding feedback are taken +from +leds +. If the server does not support this feature, any maps specified in +leds + are ignored. + + + + If +XkbXI_IndicatorNames + is set in +change +, and the server supports XKB assignment of names to indicators for the +corresponding feedback, the names for all indicators on the corresponding +feedback are taken from +leds +. If the server does not support this feature, any names specified in +leds + are ignored. Regardless of whether they are used, any names be a valid Atom or + +None +, or an +Atom + error results. + + + + If +XkbXI_IndicatorState + is set in change, and the server supports XKB changes to extension device +indicator state, the server attempts to change the indicators on the +corresponding feedback as specified by +leds +. Any indicator maps bound to the feedback are applied, so state changes might +be blocked or have side-effects. + + + + + +If any unsupported features are requested, and the requesting client has +selected for them, the server sends the client an +XkbExtensionDeviceNotify + event which indicates that an unsupported feature was requested. This event is +only generated if the client which issued the unsupported request has selected +for it and, if generated, is not sent to any other clients. + + + + + +Debugging the X Keyboard Extension + + + + + + + + + XkbSetDebuggingFlags + + + + + affectFlags, flags: CARD32 + + + +affectCtrls, ctrls: CARD32 + + + +message: STRING + + + + +currentFlags, supportedFlags: CARD32 + + + + +currentCtrls, supportedCtrls: CARD32 + + + + + + + +This request sets up various internal XKB debugging flags and controls. It is +intended for developer use and may be disabled in production servers. If +disabled, +XkbSetDebuggingFlags + has no effect but returns +Success +. + + + + +The +affectFlags + field specifies the debugging flags to be changed, the +flags + field specifies new values for the changed flags. The interpretation of the +debugging flags is implementation-specific, but flags are intended to control +debugging output and should not otherwise affect the operation of the server. + + + + +The +affectCtrls + field specifies the debugging controls to be changed, the +ctrls + field specifies new values for the changed controls. The interpretation of the +debugging controls is implementation-specific, but debugging controls are +allowed to affect the behavior of the server. + + + + +The +message + field provides a message that the X server can print in any logging or +debugging files before changing the flags. The server must accept this field +but it is not required to actually display it anywhere. + + + + +The X Test Suite makes some assumptions about the implementation of locking +modifier keys that do not apply when XKB is present. The +XkbDF_DisableLocks + debugging control provides a simple workaround to these test suite problems by +simply disabling all locking keys. If +XkbDF_DisableLocks + is enabled, the +SA_LockMods + and +SA_LockGroup + actions behave like +SA_SetMods + and +SA_LockMods +, respectively. If it is disabled, +SA_LockMods + and +SA_LockGroup + actions behave normally. + + + + +Implementations are free to ignore the +XkbDF_DisableLocks + debugging control or to define others. + + + + +The +currentFlags + return value reports the current setting for the debugging flags, if +applicable. The +currentCtrls + return value reports the setting for the debugging controls, if applicable. +The +supportedFlags + and +supportedCtrls + fields report the flags and controls that are recognized by the +implementation. Attempts to change unsupported fields or controls are silently +ignored. + + + + +If the +XkbSetDebuggingFlags + request contains more data than expected, the server ignores the extra data, +but no error results. If the request has less data than expected, a +Length + error results. + + + + +If the +XkbSetDebuggingFlags + reply contains more data than expected, the client just ignores any +uninterpreted data without reporting an error. If the reply has less data than +expected, a +Length + error results. + + + + + + +Events + + +All XKB events report the time at which they occurred in a field named + +time + and the device on which they occurred in a field named +deviceID +. XKB uses a single X event code for all events and uses a common field to +distinguish XKB event type. + + + + +Tracking Keyboard Replacement + + + + + + + + + XkbNewKeyboardNotify + + + + + time: TIMESTAMP + + + +deviceID: CARD8 + + + +changed: KB_NKNDETAILMASK + + + +minKeyCode, maxKeyCode: KEYCODE + + + +oldDeviceID: CARD8 + + + +oldMinKeyCode, oldMaxKeyCode: KEYCODE + + + +requestMajor, requestMinor: CARD8 + + + + + + + +An +XkbNewKeyboardNotify + event reports that a new core keyboard has been installed. New keyboard notify +events can be generated: + + + + + When the X server detects that the keyboard was changed. + + + + When a client installs a new extension device as the core keyboard +using the X Input Extension +ChangeKeyboardDevice + request. + + + + When a client issues an +XkbGetMapByName + request which changes the keycodes range or geometry. + + + + + +The +changed + field of the event reports the aspects of the keyboard that have changed, and +can contain any combination of the event details for this event: + + + + + + + + + + Bit in Changed + Meaning + + + + + NKN_Keycodes + The new keyboard has a different minimum or maximum keycode. + + + NKN_Geometry + The new keyboard has a different keyboard geometry. + + + NKN_DeviceID + The new keyboard has a new X Input Extension device +identifier + + + + + + +The server sends an +XkbNewKeyboardNotify + event to a client only if at least one of the bits that is set in the + +changed + field of the event is also set in the appropriate event details mask for the +client. + + + + +The +minKeyCode + and +maxKeyCode + fields report the minimum and maximum keycodes that can be returned by the new +keyboard. The +oldMinKeyCode + and +oldMaxKeyCode + fields report the minimum and maximum values that could be returned before the +change. This event always reports all four values, but the old and new values +are the same unless +NKN_Keycodes + is set in +changed +. + + + + +Once a client receives a new keyboard notify event which reports a new keycode +range, the X server reports events from all keys in the new range to that +client. Clients that do not request or receive new keyboard notify events +receive events only from keys that fall in the last range for legal keys +reported to that client. See +Replacing the Keyboard "On-the-Fly" for a more detailed explanation. + + + + +If +NKN_Keycodes + is set in +changed +, the +XkbNewKeyboardNotify + event subsumes all other change notification events (e.g. +XkbMapNotify +, +XkbNamesNotify +) that would otherwise result from the keyboard change. Clients who receive an + +XkbNewKeyboardNotify + event should assume that all other aspects of the keyboard mapping have +changed and regenerate the entire local copy of the keyboard description. + + + + +The +deviceID + field reports the X Input Extension device identifier of the new keyboard +device; +oldDeviceID + reports the device identifier before the change. This event always includes +both values, but they are the same unless +NKN_DeviceID + is set in +changed +. If the server does not support the X Input Extension, both fields have the +value +0 +. + + + + +The +requestMajor + and +requestMinor + fields report the major and minor opcode of the request that caused the +keyboard change. If the keyboard change was not caused by some client request, +both fields have the value +0 +. + + + + + +Tracking Keyboard Mapping Changes + + + + + + + + + XkbMapNotify + + + + + time: TIMESTAMP + + + +deviceID: CARD8 + + + +ptrBtnActions: CARD8 + + + +changed: KB_MAPPARTMASK + + + +minKeyCode, maxKeyCode: KEYCODE + + + +firstType, nTypes: CARD8 + + + +firstKeySym, firstKeyAction: KEYCODE + + + +nKeySyms, nKeyActions: CARD8 + + + +firstKeyBehavior, firstKeyExplicit: KEYCODE + + + +nKeyBehaviors, nKeyExplicit: CARD8 + + + +virtualMods: KB_VMODMASK + + + +firstModMapKey, firstVModMapKey: KEYCODE + + + +nModMapKeys, nVModMapKeys: CARD8 + + + + + + + +An +XkbMapNotify + event reports that some aspect of XKB map for a keyboard has changed. Map +notify events can be generated whenever some aspect of the keyboard map is +changed by an XKB or core protocol request. + + + + +The +deviceID + field reports the keyboard for which some map component has changed and the + +changed + field reports the components with new values, and can contain any of the +values that are legal for the +full + and +partial + fields of the +XkbGetMap + request. The server sends an +XkbMapNotify + event to a client only if at least one of the bits that is set in the + +changed + field of the event is also set in the appropriate event details mask for the +client. + + + + +The +minKeyCode + and +maxKeyCode + fields report the range of keycodes that are legal on the keyboard for which +the change is being reported. + + + + +If +XkbKeyTypesMask + is set in +changed +, the +firstType + and +nTypes + fields report a range of key types that includes all changed types. Otherwise, +both fields are +0 +. + + + + +If +XkbKeySymsMask + is set in +changed +, the +firstKeySym + and +nKeySyms + fields report a range of keycodes that includes all keys with new symbols. +Otherwise, both fields are +0 +. + + + + +If +XkbKeyActionsMask + is set in +changed +, the +firstKeyAction + and +nKeyActions + fields report a range of keycodes that includes all keys with new actions. +Otherwise, both fields are +0 +. + + + + +If +XkbKeyBehaviorsMask + is set in +changed +, the +firstKeyBehavior +and +nKeyBehaviors + fields report a range of keycodes that includes all keys with new key +behavior. Otherwise, both fields are +0 +. + + + + +If +XkbVirtualModsMask + is set in +changed +, +virtualMods + contains all virtual modifiers to which a new set of real modifiers is bound. +Otherwise, +virtualMods + is +0 +. + + + + +If +XkbExplicitComponentsMask + is set in +changed +, the +firstKeyExplicit + and +nKeyExplicit + fields report a range of keycodes that includes all keys with changed explicit +components. Otherwise, both fields are +0 +. + + + + +If +XkbModifierMapMask + is set in +changed +, the +firstModMapKey + and +nModMapKeys + fields report a range of keycodes that includes all keys with changed modifier +bindings. Otherwise, both fields are +0 +. + + + + +If +XkbVirtualModMapMask + is set in +changed +, the +firstVModMapKey + and +nVModMapKeys + fields report a range of keycodes that includes all keys with changed virtual +modifier mappings. Otherwise, both fields are +0 +. + + + + + +Tracking Keyboard State Changes + + + + + + + + + XkbStateNotify + + + + + time: TIMESTAMP + + + +deviceID: CARD8 + + + +mods, baseMods, latchedMods, lockedMods: KEYMASK + + + +group, lockedGroup: CARD8 + + + +baseGroup, latchedGroup: INT16 + + + +compatState: KEYMASK + + + +grabMods, compatGrabMods: KEYMASK + + + +lookupMods, compatLookupMods: KEYMASK + + + +ptrBtnState: BUTMASK + + + +changed: KB_STATEPARTMASK + + + +keycode: KEYCODE + + + +eventType: CARD8 + + + +requestMajor, requestMinor: CARD8 + + + + + + + +An XkbStateNotify +event reports that some component of the XKB state (see +Keyboard State) has changed. +State notify events are usually caused by key or pointer activity, but they can +also result from explicit state changes requested by the +XkbLatchLockState + request or by other extensions. + + + + +The +deviceID + field reports the keyboard on which some state component changed. The + +changed + field reports the XKB state components (see +Keyboard State) that have changed +and contain any combination of: + + + + + + + + + + + Bit in changed + Event field + Changed component + + + + + +ModifierState + + +mods + + The effective modifiers + + + +ModifierBase + + +baseMods + + The base modifiers + + + +ModifierLatch + + +latchedMods + + The latched modifiers + + + +ModifierLock + + +lockedMods + + The locked modifiers + + + +GroupState + + +group + + The effective keyboard group + + + +GroupBase + + +baseGroup + + The base keyboard group + + + +GroupLatch + + +latchedGroup + + The latched keyboard group + + + +GroupLock + + +lockedGroup + + The locked keyboard group + + + +PointerButtons + + +ptrBtnState + + The state of the core pointer buttons + + + +GrabMods + + +grabMods + + The XKB state used to compute grabs + + + +LookupMods + + +lookupMods + + The XKB state used to look up symbols + + + +CompatState + + +compatState + + Default state for non-XKB clients + + + +CompatGrabMods + + +compatGrabMods + + The core state used to compute grabs + + + +CompatLookupMods + + +compatLookupMods + + The core state used to look up symbols + + + + + + +The server sends an +XkbStateNotify + event to a client only if at least one of the bits that is set in the + +changed + field of the event is also set in the appropriate event details mask for the +client. + + + + +A state notify event reports current values for all state components, even +those with unchanged values. + + + + +The +keycode + field reports the key or button which caused the change in state while the + +eventType + field reports the exact type of event (e.g. +KeyPress +). If the change in state was not caused by key or button activity, both fields +have the value +0 +. + + + + +The +requestMajor + and +requestMinor + fields report the major and minor opcodes of the request that caused the +change in state and have the value +0 + if it was resulted from key or button activity. + + + + + +Tracking Keyboard Control Changes + + + + + + + + + XkbControlsNotify + + + + + time: TIMESTAMP + + + +deviceID: CARD8 + + + +numGroups: CARD8 + + + +changedControls: KB_CONTROLMASK + + + +enabledControls,enabledControlChanges: KB_BOOLCTRLMASK + + + +keycode: KEYCODE + + + +eventType: CARD8 + + + +requestMajor: CARD8 + + + +requestMinor: CARD8 + + + + + + + +An +XkbControlsNotify + event reports a change in one or more of the global keyboard controls (see +Global Keyboard Controls) +or in the internal modifiers or ignore locks masks (see + +Server Internal Modifiers and Ignore +Locks Behavior). Controls notify events are usually caused by and + +XkbSetControls + request, but they can also be caused by keyboard activity or certain core +protocol and input extension requests. + + + + +The +deviceID + field reports the keyboard for which some control has changed, and the + +changed + field reports the controls that have new values. + + + + +The +changed + field can contain any of the values that are permitted for the +changeControls + field of the +XkbSetControls + request. The server sends an +XkbControlsNotify + event to a client only if at least one of the bits that is set in the + +changed + field of the event is also set in the appropriate event details mask for the +client. + + + + +The +numGroups + field reports the total number of groups defined for the keyboard, whether or +not the number of groups has changed. + + + + +The +enabledControls + field reports the current status of all of the boolean controls, whether or +not any boolean controls changed state. If +EnabledControls + is set in +changed +, the +enabledControlChanges + field reports the boolean controls that were enabled or disabled; if a control +is specified in +enabledControlChanges +, the value that is reported for that control in +enabledControls + represents a change in state. + + + + +The +keycode + field reports the key or button which caused the change in state while the + +eventType + field reports the exact type of event (e.g. +KeyPress +). If the change in state was not caused by key or button activity, both fields +have the value +0 +. + + + + +The +requestMajor + and +requestMinor + fields report the major and minor opcodes of the request that caused the +change in state and have the value +0 + if it was resulted from key or button activity. + + + + + +Tracking Keyboard Indicator State Changes + + + + + + + + + XkbIndicatorStateNotify + + + + + time: TIMESTAMP + + + +deviceID: CARD8 + + + +stateChanged, state: KB_INDICATORMASK + + + + + + + +An +XkbIndicatorStateNotify + event indicates that one or more of the indicators on a keyboard have changed +state. Indicator state notify events can be caused by: + + + + + Automatic update to reflect changes in keyboard state (keyboard +activity, +XkbLatchLockState + requests). + + + + Automatic update to reflect changes in keyboard controls ( +XkbSetControls +, keyboard activity, certain core protocol and input extension requests). + + + + Explicit attempts to change indicator state (core protocol and input +extension requests, +XkbSetNamedIndicator + requests). + + + + Changes to indicator maps ( +XkbSetIndicatorMap + and +XkbSetNamedIndicator + requests). + + + + + +The +deviceID + field reports the keyboard for which some indicator has changed, and the + +state + field reports the new state for all indicators on the specified keyboard. The + +stateChanged + field specifies which of the values in +state + represent a new state for the corresponding indicator. The server sends an + +XkbIndicatorStateNotify + event to a client only if at least one of the bits that is set in the + +stateChanged + field of the event is also set in the appropriate event details mask for the +client. + + + + + +Tracking Keyboard Indicator Map Changes + + + + + + + + + XkbIndicatorMapNotify + + + + + time: TIMESTAMP + + + +deviceID: CARD8 + + + +state: KB_INDICATORMASK + + + +mapChanged: KB_INDICATORMASK + + + + + + + +An +XkbIndicatorMapNotify + event indicates that the maps for one or more keyboard indicators have been +changed. Indicator map notify events can be caused by +XkbSetIndicatorMap + and +XkbSetNamedIndicator + requests. + + + + +The +deviceID + field reports the keyboard for which some indicator map has changed, and the + +mapChanged + field reports the indicators with changed maps. The server sends an +XkbIndicatorMapNotify + event to a client only if at least one of the bits that is set in the + +mapChanged + field of the event is also set in the appropriate event details mask for the +client. + + + + +The +state + field reports the current state of all indicators on the specified keyboard. + + + + + +Tracking Keyboard Name Changes + + + + + + + + + XkbNamesNotify + + + + + time: TIMESTAMP + + + +deviceID: CARD8 + + + +changed: KB_NAMEDETAILMASK + + + +firstType, nTypes: CARD8 + + + +firstLevelName, nLevelNames: CARD8 + + + +firstKey: KEYCODE + + + +nKeys, nKeyAliases, nRadioGroups: CARD8 + + + +changedGroupNames: KB_GROUPMASK + + + +changedVirtualMods: KB_VMODMASK + + + +changedIndicators: KB_INDICATORMASK + + + + + + + +An +XkbNamesNotify + event reports a change to one or more of the symbolic names associated with a +keyboard. Symbolic names can change when: + + + + + Some client explicitly changes them using +XkbSetNames +. + + + + The list of key types or radio groups is resized + + + + The group width of some key type is changed + + + + + +The +deviceID + field reports the keyboard on which names were changed. The +changed + mask lists the components for which some names have changed and can have any +combination of the values permitted for the +which + field of the +XkbGetNames + request. The server sends an +XkbNamesNotify + event to a client only if at least one of the bits that is set in the + +changed + field of the event is also set in the appropriate event details mask for the +client. + + + + +If +KeyTypeNames + is set in +changed +, the +firstType + and +nTypes + fields report a range of types that includes all types with changed names. +Otherwise, both fields are +0 +. + + + + +If +KTLevelNames + is set in +changed +, the +firstLevelName + and +nLevelNames + fields report a range of types that includes all types with changed level +names. Otherwise, both fields are +0 +. + + + + +If +IndicatorNames + is set in +changed +, the +changedIndicators + field reports the indicators with changed names. Otherwise, +changedIndicators + is +0 +. + + + + +If +VirtualModNames + is set in +changed +, the +changedVirtualMods + field reports the virtual modifiers with changed names. Otherwise, +changedVirtualMods + is +0 +. + + + + +If +GroupNames + is set in +changed +, the +changedGroupNames + field reports the groups with changed names. Otherwise, +changedGroupNames + is +0 +. + + + + +If +KeyNames + is set in +changed +, the +firstKey + and +nKeys + fields report a range of keycodes that includes all keys with changed names. +Otherwise, both fields are +0 +. + + + + +The +nKeyAliases + field reports the total number of key aliases associated with the keyboard, +regardless of whether +KeyAliases + is set in +changed +. + + + + +The +nRadioGroups + field reports the total number of radio group names associated with the +keyboard, regardless of whether +RGNames + is set in +changed +. + + + + + +Tracking Compatibility Map Changes + + + + + + + + + XkbCompatMapNotify + + + + + time: TIMESTAMP + + + +deviceID: CARD8 + + + +changedGroups: KB_GROUPMASK + + + +firstSI, nSI: CARD16 + + + +nTotalSI: CARD16 + + + + + + + +An +XkbCompatMapNotify + event indicates that some component of the compatibility map for a keyboard +has been changed. Compatibility map notify events can be caused by +XkbSetCompatMap + and +XkbGetMapByName + requests. + + + + +The +deviceID + field reports the keyboard for which the compatibility map has changed; if the +server does not support the X input extension, +deviceID + is +0 +. + + + + +The +changedGroups + field reports the keyboard groups, if any, with a changed entry in the group +compatibility map. The +firstSI + and +nSI + fields specify a range of symbol interpretations in the symbol compatibility +map that includes all changed symbol interpretations; if the symbol +compatibility map is unchanged, both fields are +0 +. The +nTotalSI + field always reports the total number of symbol interpretations present in the +symbol compatibility map, regardless of whether any symbol interpretations have +been changed. + + + + +The server sends an +XkbCompatMapNotify + event to a client only if at least one of the following conditions is met: + + + + + The +nSI + field of the event is non-zero, and the +XkbSymInterpMask + bit is set in the appropriate event details mask for the client. + + + + The +changedGroups + field of the event contains at least one group, and the +XkbGroupCompatMask + bit is set in the appropriate event details mask for the client. + + + + + + +Tracking Application Bell Requests + + + + + + + + + XkbBellNotify + + + + + time: TIMESTAMP + + + +deviceID: CARD8 + + + +bellClass: { KbdFeedbackClass, BellFeedbackClass } + + + +bellID: CARD8 + + + +percent: CARD8 + + + +pitch: CARD16 + + + +duration: CARD16 + + + +eventOnly: BOOL + + + +name: ATOM + + + +window: WINDOW + + + + + + + +An +XkbBellNotify + event indicates that some client has requested a keyboard bell. Bell notify +events are usually caused by +Bell +, +DeviceBell +, or +XkbBell + requests, but they can also be generated by the server (e.g. if the +AccessXFeedback + control is active). + + + + +The server sends an +XkbBellNotify + event to a client if the appropriate event details field for the client has +the value +True +. + + + + +The +deviceID + field specifies the device for which a bell was requested, while the +bellClass + and +bellID + fields specify the input extension class and identifier of the feedback for +which the bell was requested. If the reporting server does not support the +input extension, all three fields have the value 0. + + + + +The +percent +, +pitch + and +duration + fields report the volume, tone and duration requested for the bell as +specified by the +XkbBell + request. Bell notify events caused by core protocol or input extension +requests use the pitch and duration specified in the corresponding bell or +keyboard feedback control. + + + + +If the bell was caused by an +XkbBell + request or by the X server, +name + reports an optional symbolic name for the bell and the +window + field optionally reports the window for which the bell was generated. +Otherwise, both fields have the value +None +. + + + + +If the +eventOnly + field is +True +, the server did not generate a sound in response to the request, otherwise the +server issues the beep before sending the event. The eventOnly field can be + +True + if the +AudibleBell + control is disabled or if a client explicitly requests +eventOnly + when it issues an +XkbBell + request. + + + + + +Tracking Messages Generated by Key Actions + + + + + + + + + XkbActionMessage + + + + + time: TIMESTAMP + + + +deviceID: CARD8 + + + +keycode: KEYCODE + + + +press: BOOL + + + +mods: KEYMASK + + + +group: KB_GROUP + + + +keyEventFollows: BOOL + + + +message: LISTofCARD8 + + + + + + + +An +XkbActionMessage + event is generated when the user operates a key to which an +SA_ActionMessage + message is bound under the appropriate state and group. The server sends an + +XkbActionMessage + event to a client if the appropriate event details field for the client has +the value +True +. + + + + +The +deviceID + field specifies the keyboard device that contains the key which activated the +event. The +keycode + field specifies the key whose operation caused the message and press is + +True + if the message was caused by the user pressing the key. The +mods + and +group + fields report the effective keyboard modifiers and group in effect at the time +the key was pressed or released. + + + + +If +keyEventFollows + is +True +, the server will also send a key press or release event, as appropriate, for +the key that generated the message. If it is +False +, the key causes only a message. Note that the key event is delivered normally +with respect to passive grabs, keyboard focus, and cursor position, so that + +keyEventFollows + does not guarantee that any particular client which receives the +XkbActionMessage + notify event will also receive a key press or release event. + + + + +The +message + field is +NULL +-terminated string of up to +ActionMessageLength + ( +6 +) bytes, which reports the contents of the +message + field in the action that caused the message notify event. + + + + + +Tracking Changes to AccessX State and Keys + + + + + + + + + XkbAccessXNotify + + + + + time: TIMESTAMP + + + +deviceID: CARD8 + + + +detail: KB_AXNDETAILMASK + + + +keycode: KEYCODE + + + +slowKeysDelay: CARD16 + + + +debounceDelay: CARD16 + + + + + + + +An +XkbAccessXNotify + event reports on some kinds of keyboard activity when any of the +SlowKeys +, +BounceKeys + or +AccessXKeys + controls are active. Compatibility map notify events can only be caused by +keyboard activity. + + + + +The +deviceID + and +keycode + fields specify the keyboard and key for which the event occurred. The + +detail + field describes the event that occurred and has one of the following values: + + + + + + + + + + + Detail + Control + Meaning + + + + + +AXN_SKPress + + +SlowKeys + + Key pressed + + + +AXN_SKAccept + + +SlowKeys + + +K +ey held until it was accepted. + + + +AXN_SKReject + + +SlowKeys + + Key released before it was accepted. + + + +AXN_SKRelease + + +SlowKeys + + Key released after it was accepted. + + + +AXN_BKAccept + + +BounceKeys + + Key pressed while it was active. + + + +AXN_BKReject + + +BounceKeys + + Key pressed while it was still disabled. + + + +AXN_AXKWarning + + +AccessXKeys + + Shift key held down for four seconds + + + + + + +Each subclass of the AccessX notify event is generated only when the control +specified in the table above is enabled. The server sends an +XkbAccessXNotify + event to a client only if the bit which corresponds to the value of the + +detail + field for the event is set in the appropriate event details mask for the +client. + + + + +Regardless of the value of +detail +, the +slowKeysDelay + and +debounceDelay + fields always reports the current slow keys acceptance delay (see +The SlowKeys Control) and +debounce delay (see The BounceKeys +Control) for the specified keyboard. + + + + + +Tracking Changes To Extension Devices + + + + + + + + + XkbExtensionDeviceNotify + + + + + time: TIMESTAMP + + + +deviceID: CARD16 + + + +ledClass: { KbdFeedbackClass, LedFeedbackClass } + + + +ledID: CARD16 + + + +reason: KB_XIDETAILMASK + + + +supported: KB_XIFEATUREMASK + + + +unsupported: KB_XIFEATUREMASK + + + +ledsDefined: KB_INDICATORMASK + + + +ledState: KB_INDICATORMASK + + + +firstButton, nButtons: CARD8 + + + + + + + +An +XkbExtensionDeviceNotify + event reports: + + + + + A change to some part of the XKB information for an extension device. + + + + An attempt to use an XKB extension device feature that is not supported +for the specified device by the current implementation. + + + + + +The +deviceID + field specifies the X Input Extension device identifier of some device on +which an XKB feature was requested, or +XkbUseCorePtr + if the request affected the core pointer device. The +reason + field explains why the event was generated in response to the request, and can +contain any combination of +XkbXI_UnsupportedFeature + and the values permitted for the change field of the +XkbSetDeviceInfo + request. + + + + +If +XkbXI_ButtonActions + is set in +reason +, this event reports a successful change to the XKB actions bound to one or +more buttons on the core pointer or an extension device. The +firstButton + and +nButtons + fields report a range of device buttons that include all of the buttons for +which actions were changed. + + + + +If any combination of +XkbXI_IndicatorNames +, +XkbXI_IndicatorMaps +, or +XkbXI_IndicatorState + is set in either +reason + or +unsupported +, the +ledClass + and +ledID + fields specify the X Input Extension feedback class and identifier of the +feedback for which the change is reported. If this event reports any changes to +an indicator feedback, the +ledsDefined + field reports all indicators on that feedback for which either a name or a +indicator map are defined, and +ledState + reports the current state of all of the indicators on the specified feedback. + + + + +If +XkbXI_IndicatorNames + is set in +reason +, this event reports a successful change to the symbolic names bound to one or +more extension device indicators by XKB. If +XkbXI_IndicatorMaps + is set in +reason +, this event reports a successful change to the indicator maps bound to one or +more extension device indicators by XKB. If +XkbXI_IndicatorState + is set in reason, this event reports that one or more indicators in the +specified device and feedback have changed state. + + + + +If +XkbXI_UnsupportedFeature + is set in reason, this event reports an unsuccessful attempt to use some XKB +extension device feature that is not supported by the XKB implementation in the +server for the specified device. The +unsupported + mask reports the requested features that are not available on the specified +device. See Interactions Between +XKB and the X Input Extension for more information about possible XKB +interactions with the X Input Extension. + + + + +The server sends an +XkbExtensionDeviceNotify + event to a client only if at least one of the bits that is set in the + +reason + field of the event is also set in the appropriate event details mask for the +client. + + + + +Events that report a successful change to some extension device feature are +reported to all clients that have expressed interest in the event; events that +report an attempt to use an unsupported feature are reported only to the client +which issued the request. Events which report a partial success are reported to +all interested clients, but only the client that issued the request is informed +of the attempt to use unsupported features. + + + + diff --git a/miniconda3/share/doc/kbproto/xkbproto.xml b/miniconda3/share/doc/kbproto/xkbproto.xml new file mode 100644 index 0000000000000000000000000000000000000000..20f98d57e77273375d4aceb47a2fbacf03d95001 --- /dev/null +++ b/miniconda3/share/doc/kbproto/xkbproto.xml @@ -0,0 +1,70 @@ + + %defs; +]> + + + + + The X Keyboard Extension: Protocol Specification + X Consortium Standard + + Erik + Fortune + Silicon Graphics, Inc + + X Version 11, Release &fullrelvers; + Version 1.0 + 19951996 + X Consortium Inc. + Silicon Graphics Inc. + Hewlett-Packard Company + Digital Equipment Corporation + + + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +Except as contained in this notice, the names of the X Consortium, Silicon Graphics Inc., Hewlett-Packard Company, and Digital Equipment Corporation shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/miniconda3/share/doc/libasprintf/autosprintf_all.html b/miniconda3/share/doc/libasprintf/autosprintf_all.html new file mode 100644 index 0000000000000000000000000000000000000000..b8760c0795711baa9053fadfe8acf99255a51fc3 --- /dev/null +++ b/miniconda3/share/doc/libasprintf/autosprintf_all.html @@ -0,0 +1,1625 @@ + + + + + +GNU autosprintf + + + + + + + + + + + + + + +

GNU autosprintf

+ +

Table of Contents

+ + + + + +

This manual documents the GNU autosprintf class, version 1.0. +

+ + +
+ + +

1. Introduction

+ +

This package makes the C formatted output routines (fprintf et al.) +usable in C++ programs, for use with the <string> strings and the +<iostream> streams. +

+

It allows to write code like +

+
 
cerr << autosprintf ("syntax error in %s:%d: %s", filename, line, errstring);
+
+ +

instead of +

+
 
cerr << "syntax error in " << filename << ":" << line << ": " << errstring;
+
+ +

The benefits of the autosprintf syntax are: +

+
    +
  • +It reuses the standard POSIX printf facility. Easy migration from C to C++. + +
  • +English sentences are kept together. + +
  • +It makes internationalization possible. Internationalization requires format +strings, because in some cases the translator needs to change the order of a +sentence, and more generally it is easier for the translator to work with a +single string for a sentence than with multiple string pieces. + +
  • +It reduces the risk of programming errors due to forgotten state in the +output stream (e.g. cout << hex; not followed by cout << dec;). +
+ + + + +

2. The autosprintf class

+ +

An instance of class autosprintf just contains a string with the +formatted output result. Such an instance is usually allocated as an +automatic storage variable, i.e. on the stack, not with new on the +heap. +

+

The constructor autosprintf (const char *format, ...) takes a format +string and additional arguments, like the C function printf. +

+

Conversions to char * and std::string are defined that return +the encapsulated string. The conversion to char * returns a freshly +allocated copy of the encapsulated string; it needs to be freed using +delete[]. The conversion to std::string returns a copy of +the encapsulated string, with automatic memory management. +

+

The destructor ~autosprintf () destroys the encapsulated string. +

+

An operator << is provided that outputs the encapsulated string to the +given ostream. +

+ + + +

3. Using autosprintf in own programs

+ +

To use the autosprintf class in your programs, you need to add +

+
 
#include "autosprintf.h"
+using gnu::autosprintf;
+
+ +

to your source code. +The include file defines the class autosprintf, in a namespace called +gnu. The ‘using’ statement makes it possible to use the class +without the (otherwise natural) gnu:: prefix. +

+

When linking your program, you need to link with libasprintf, because +that's where the class is defined. In projects using GNU autoconf, +this means adding ‘AC_LIB_LINKFLAGS([asprintf])’ to configure.in +or configure.ac, and using the @LIBASPRINTF@ Makefile variable that +it provides. +

+ + + +

A. Licenses

+ +

The files of this package are covered by the licenses indicated in each +particular file or directory. Here is a summary: +

+
    +
  • +The libasprintf library is covered by the +GNU Lesser General Public License (LGPL), either version 2.1 of the +License, or (at your option) any later version published by the +Free Software Foundation (FSF). +A copy of the license is included in GNU LESSER GENERAL PUBLIC LICENSE. + +
  • +This manual is free documentation. It is dually licensed under the +GNU FDL and the GNU GPL. This means that you can redistribute this +manual under either of these two licenses, at your choice. +
    +This manual is covered by the GNU FDL. Permission is granted to copy, +distribute and/or modify this document under the terms of the +GNU Free Documentation License (FDL), either version 1.2 of the +License, or (at your option) any later version published by the +Free Software Foundation (FSF); with no Invariant Sections, with no +Front-Cover Text, and with no Back-Cover Texts. +A copy of the license is included in GNU Free Documentation License. +
    +This manual is covered by the GNU GPL. You can redistribute it and/or +modify it under the terms of the GNU General Public License (GPL), either +version 2 of the License, or (at your option) any later version published +by the Free Software Foundation (FSF). +A copy of the license is included in GNU GENERAL PUBLIC LICENSE. +
+ + + + + + +

A.1 GNU LESSER GENERAL PUBLIC LICENSE

+

Version 2.1, February 1999 +

+ +
 
Copyright © 1991, 1999 Free Software Foundation, Inc.
+<https://fsf.org/>
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+as the successor of the GNU Library Public License, version 2, hence the
+version number 2.1.]
+
+ + +

Preamble

+ +

The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software—to make sure the software is free for all its users. +

+

This license, the Lesser General Public License, applies to some +specially designated software—typically libraries—of the Free +Software Foundation and other authors who decide to use it. You can use +it too, but we suggest you first think carefully about whether this +license or the ordinary General Public License is the better strategy to +use in any particular case, based on the explanations below. +

+

When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of it +in new free programs; and that you are informed that you can do these +things. +

+

To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. +

+

For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. +

+

We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. +

+

To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. +

+

Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. +

+

Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. +

+

When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. +

+

We call this license the Lesser General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. +

+

For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. +

+

In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. +

+

Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. +

+

The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +“work based on the library” and a “work that uses the library”. The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. +

+ +

TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

+ +
    +
  1. +This License Agreement applies to any software library or other program +which contains a notice placed by the copyright holder or other +authorized party saying it may be distributed under the terms of this +Lesser General Public License (also called “this License”). Each +licensee is addressed as “you”. + +

    A “library” means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. +

    +

    The “Library”, below, refers to any such software library or work +which has been distributed under these terms. A “work based on the +Library” means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term “modification”.) +

    +

    “Source code” for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. +

    +

    Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. +

    +
  2. +You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + +

    You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. +

    +
  3. +You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +
      +
    1. +The modified work must itself be a software library. + +
    2. +You must cause the files modified to carry prominent notices +stating that you changed the files and the date of any change. + +
    3. +You must cause the whole of the work to be licensed at no +charge to all third parties under the terms of this License. + +
    4. +If a facility in the modified Library refers to a function or a +table of data to be supplied by an application program that uses +the facility, other than as an argument passed when the facility +is invoked, then you must make a good faith effort to ensure that, +in the event an application does not supply such function or +table, the facility still operates, and performs whatever part of +its purpose remains meaningful. + +

      (For example, a function in a library to compute square roots has +a purpose that is entirely well-defined independent of the +application. Therefore, Subsection 2d requires that any +application-supplied function or table used by this function must +be optional: if the application does not supply it, the square +root function must still compute square roots.) +

    + +

    These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. +

    +

    Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. +

    +

    In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. +

    +
  4. +You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + +

    Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. +

    +

    This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. +

    +
  5. +You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + +

    If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. +

    +
  6. +A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a “work that uses the Library”. Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + +

    However, linking a “work that uses the Library” with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a “work that uses the +library”. The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. +

    +

    When a “work that uses the Library” uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. +

    +

    If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) +

    +

    Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. +

    +
  7. +As an exception to the Sections above, you may also combine or +link a “work that uses the Library” with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + +

    You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: +

    +
      +
    1. +Accompany the work with the complete corresponding +machine-readable source code for the Library including whatever +changes were used in the work (which must be distributed under +Sections 1 and 2 above); and, if the work is an executable linked +with the Library, with the complete machine-readable “work that +uses the Library”, as object code and/or source code, so that the +user can modify the Library and then relink to produce a modified +executable containing the modified Library. (It is understood +that the user who changes the contents of definitions files in the +Library will not necessarily be able to recompile the application +to use the modified definitions.) + +
    2. +Use a suitable shared library mechanism for linking with the Library. A +suitable mechanism is one that (1) uses at run time a copy of the +library already present on the user's computer system, rather than +copying library functions into the executable, and (2) will operate +properly with a modified version of the library, if the user installs +one, as long as the modified version is interface-compatible with the +version that the work was made with. + +
    3. +Accompany the work with a written offer, valid for at +least three years, to give the same user the materials +specified in Subsection 6a, above, for a charge no more +than the cost of performing this distribution. + +
    4. +If distribution of the work is made by offering access to copy +from a designated place, offer equivalent access to copy the above +specified materials from the same place. + +
    5. +Verify that the user has already received a copy of these +materials or that you have already sent this user a copy. +
    + +

    For an executable, the required form of the “work that uses the +Library” must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies the +executable. +

    +

    It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. +

    +
  8. +You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + +
      +
    1. +Accompany the combined library with a copy of the same work +based on the Library, uncombined with any other library +facilities. This must be distributed under the terms of the +Sections above. + +
    2. +Give prominent notice with the combined library of the fact +that part of it is a work based on the Library, and explaining +where to find the accompanying uncombined form of the same work. +
    + +
  9. +You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + +
  10. +You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + +
  11. +Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + +
  12. +If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +

    If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. +

    +

    It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. +

    +

    This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. +

    +
  13. +If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + +
  14. +The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +

    Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +“any later version”, you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. +

    +
  15. +If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + +

    NO WARRANTY +

    +
  16. +BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY “AS IS” WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +
  17. +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. +
+ + +

END OF TERMS AND CONDITIONS

+ + + +

How to Apply These Terms to Your New Libraries

+ +

If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). +

+

To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +“copyright” line and a pointer to where the full notice is found. +

+
 
one line to give the library's name and an idea of what it does.
+Copyright (C) year  name of author
+
+This library is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 2.1 of the License, or (at
+your option) any later version.
+
+This library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, see <https://www.gnu.org/licenses/>.
+
+ +

Also add information on how to contact you by electronic and paper mail. +

+

You should also get your employer (if you work as a programmer) or your +school, if any, to sign a “copyright disclaimer” for the library, if +necessary. Here is a sample; alter the names: +

+
 
Yoyodyne, Inc., hereby disclaims all copyright interest in the library
+`Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+signature of Moe Ghoul, 1 April 1990
+Moe Ghoul, President of Vice
+
+ +

That's all there is to it! + +

+ + +

A.2 GNU GENERAL PUBLIC LICENSE

+

Version 2, June 1991 +

+ +
 
Copyright © 1989, 1991 Free Software Foundation, Inc.
+<https://fsf.org/>
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+ + +

Preamble

+ +

The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software—to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. +

+

When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. +

+

To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. +

+

For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. +

+

We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. +

+

Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. +

+

Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. +

+

The precise terms and conditions for copying, distribution and +modification follow. +

+ +

TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

+ +
    +
  1. +This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The “Program”, below, +refers to any such program or work, and a “work based on the Program” +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term “modification”.) Each licensee is addressed as “you”. + +

    Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. +

    +
  2. +You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +

    You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. +

    +
  3. +You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + +
      +
    1. +You must cause the modified files to carry prominent notices +stating that you changed the files and the date of any change. + +
    2. +You must cause any work that you distribute or publish, that in +whole or in part contains or is derived from the Program or any +part thereof, to be licensed as a whole at no charge to all third +parties under the terms of this License. + +
    3. +If the modified program normally reads commands interactively +when run, you must cause it, when started running for such +interactive use in the most ordinary way, to print or display an +announcement including an appropriate copyright notice and a +notice that there is no warranty (or else, saying that you provide +a warranty) and that users may redistribute the program under +these conditions, and telling the user how to view a copy of this +License. (Exception: if the Program itself is interactive but +does not normally print such an announcement, your work based on +the Program is not required to print an announcement.) +
    + +

    These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. +

    +

    Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. +

    +

    In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. +

    +
  4. +You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + +
      +
    1. +Accompany it with the complete corresponding machine-readable +source code, which must be distributed under the terms of Sections +1 and 2 above on a medium customarily used for software interchange; or, + +
    2. +Accompany it with a written offer, valid for at least three +years, to give any third party, for a charge no more than your +cost of physically performing source distribution, a complete +machine-readable copy of the corresponding source code, to be +distributed under the terms of Sections 1 and 2 above on a medium +customarily used for software interchange; or, + +
    3. +Accompany it with the information you received as to the offer +to distribute corresponding source code. (This alternative is +allowed only for noncommercial distribution and only if you +received the program in object code or executable form with such +an offer, in accord with Subsection b above.) +
    + +

    The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. +

    +

    If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. +

    +
  5. +You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + +
  6. +You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +
  7. +Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + +
  8. +If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +

    If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. +

    +

    It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. +

    +

    This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. +

    +
  9. +If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + +
  10. +The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +

    Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and “any +later version”, you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. +

    +
  11. +If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + +
  12. +BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + +
  13. +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. +
+ + + + +

Appendix: How to Apply These Terms to Your New Programs

+ +

If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. +

+

To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the “copyright” line and a pointer to where the full notice is found. +

+
 
one line to give the program's name and a brief idea of what it does.
+Copyright (C) yyyy  name of author
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, see <https://www.gnu.org/licenses/>.
+
+ +

Also add information on how to contact you by electronic and paper mail. +

+

If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: +

+
 
Gnomovision version 69, Copyright (C) year name of author
+Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+
+ +

The hypothetical commands ‘show w’ and ‘show c’ should show +the appropriate parts of the General Public License. Of course, the +commands you use may be called something other than ‘show w’ and +‘show c’; they could even be mouse-clicks or menu items—whatever +suits your program. +

+

You should also get your employer (if you work as a programmer) or your +school, if any, to sign a “copyright disclaimer” for the program, if +necessary. Here is a sample; alter the names: +

+
 
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+`Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+signature of Moe Ghoul, 1 April 1989
+Moe Ghoul, President of Vice
+
+ +

This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. + +

+ + +

A.3 GNU Free Documentation License

+

Version 1.3, 3 November 2008 +

+ +
 
Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+https://fsf.org/
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+ +
    +
  1. +PREAMBLE + +

    The purpose of this License is to make a manual, textbook, or other +functional and useful document free in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. +

    +

    This License is a kind of “copyleft”, which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. +

    +

    We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. +

    +
  2. +APPLICABILITY AND DEFINITIONS + +

    This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The “Document”, below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as “you”. You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. +

    +

    A “Modified Version” of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. +

    +

    A “Secondary Section” is a named appendix or a front-matter section +of the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. +

    +

    The “Invariant Sections” are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. +

    +

    The “Cover Texts” are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. +

    +

    A “Transparent” copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not “Transparent” is called “Opaque”. +

    +

    Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input +format, SGML or XML using a publicly available +DTD, and standard-conforming simple HTML, +PostScript or PDF designed for human modification. Examples +of transparent image formats include PNG, XCF and +JPG. Opaque formats include proprietary formats that can be +read and edited only by proprietary word processors, SGML or +XML for which the DTD and/or processing tools are +not generally available, and the machine-generated HTML, +PostScript or PDF produced by some word processors for +output purposes only. +

    +

    The “Title Page” means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, “Title Page” means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. +

    +

    The “publisher” means any person or entity that distributes copies +of the Document to the public. +

    +

    A section “Entitled XYZ” means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as “Acknowledgements”, +“Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” +of such a section when you modify the Document means that it remains a +section “Entitled XYZ” according to this definition. +

    +

    The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. +

    +
  3. +VERBATIM COPYING + +

    You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. +

    +

    You may also lend copies, under the same conditions stated above, and +you may publicly display copies. +

    +
  4. +COPYING IN QUANTITY + +

    If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. +

    +

    If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. +

    +

    If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. +

    +

    It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. +

    +
  5. +MODIFICATIONS + +

    You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: +

    +
      +
    1. +Use in the Title Page (and on the covers, if any) a title distinct +from that of the Document, and from those of previous versions +(which should, if there were any, be listed in the History section +of the Document). You may use the same title as a previous version +if the original publisher of that version gives permission. + +
    2. +List on the Title Page, as authors, one or more persons or entities +responsible for authorship of the modifications in the Modified +Version, together with at least five of the principal authors of the +Document (all of its principal authors, if it has fewer than five), +unless they release you from this requirement. + +
    3. +State on the Title page the name of the publisher of the +Modified Version, as the publisher. + +
    4. +Preserve all the copyright notices of the Document. + +
    5. +Add an appropriate copyright notice for your modifications +adjacent to the other copyright notices. + +
    6. +Include, immediately after the copyright notices, a license notice +giving the public permission to use the Modified Version under the +terms of this License, in the form shown in the Addendum below. + +
    7. +Preserve in that license notice the full lists of Invariant Sections +and required Cover Texts given in the Document's license notice. + +
    8. +Include an unaltered copy of this License. + +
    9. +Preserve the section Entitled “History”, Preserve its Title, and add +to it an item stating at least the title, year, new authors, and +publisher of the Modified Version as given on the Title Page. If +there is no section Entitled “History” in the Document, create one +stating the title, year, authors, and publisher of the Document as +given on its Title Page, then add an item describing the Modified +Version as stated in the previous sentence. + +
    10. +Preserve the network location, if any, given in the Document for +public access to a Transparent copy of the Document, and likewise +the network locations given in the Document for previous versions +it was based on. These may be placed in the “History” section. +You may omit a network location for a work that was published at +least four years before the Document itself, or if the original +publisher of the version it refers to gives permission. + +
    11. +For any section Entitled “Acknowledgements” or “Dedications”, Preserve +the Title of the section, and preserve in the section all the +substance and tone of each of the contributor acknowledgements and/or +dedications given therein. + +
    12. +Preserve all the Invariant Sections of the Document, +unaltered in their text and in their titles. Section numbers +or the equivalent are not considered part of the section titles. + +
    13. +Delete any section Entitled “Endorsements”. Such a section +may not be included in the Modified Version. + +
    14. +Do not retitle any existing section to be Entitled “Endorsements” or +to conflict in title with any Invariant Section. + +
    15. +Preserve any Warranty Disclaimers. +
    + +

    If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. +

    +

    You may add a section Entitled “Endorsements”, provided it contains +nothing but endorsements of your Modified Version by various +parties—for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. +

    +

    You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. +

    +

    The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. +

    +
  6. +COMBINING DOCUMENTS + +

    You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. +

    +

    The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. +

    +

    In the combination, you must combine any sections Entitled “History” +in the various original documents, forming one section Entitled +“History”; likewise combine any sections Entitled “Acknowledgements”, +and any sections Entitled “Dedications”. You must delete all +sections Entitled “Endorsements.” +

    +
  7. +COLLECTIONS OF DOCUMENTS + +

    You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. +

    +

    You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. +

    +
  8. +AGGREGATION WITH INDEPENDENT WORKS + +

    A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an “aggregate” if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. +

    +

    If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. +

    +
  9. +TRANSLATION + +

    Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. +

    +

    If a section in the Document is Entitled “Acknowledgements”, +“Dedications”, or “History”, the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. +

    +
  10. +TERMINATION + +

    You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. +

    +

    However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. +

    +

    Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. +

    +

    Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. +

    +
  11. +FUTURE REVISIONS OF THIS LICENSE + +

    The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +https://www.gnu.org/licenses/. +

    +

    Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License “or any later version” applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy's public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. +

    +
  12. +RELICENSING + +

    “Massive Multiauthor Collaboration Site” (or “MMC Site”) means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +“Massive Multiauthor Collaboration” (or “MMC”) contained in the +site means any set of copyrightable works thus published on the MMC +site. +

    +

    “CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. +

    +

    “Incorporate” means to publish or republish a Document, in whole or +in part, as part of another Document. +

    +

    An MMC is “eligible for relicensing” if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole +or in part into the MMC, (1) had no cover texts or invariant sections, +and (2) were thus incorporated prior to November 1, 2008. +

    +

    The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. +

    +
+ + + +

ADDENDUM: How to use this License for your documents

+ +

To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: +

+
 
  Copyright (C)  year  your name.
+  Permission is granted to copy, distribute and/or modify this document
+  under the terms of the GNU Free Documentation License, Version 1.3
+  or any later version published by the Free Software Foundation;
+  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+  Texts.  A copy of the license is included in the section entitled ``GNU
+  Free Documentation License''.
+
+ +

If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the “with…Texts.” line with this: +

+
 
    with the Invariant Sections being list their titles, with
+    the Front-Cover Texts being list, and with the Back-Cover Texts
+    being list.
+
+ +

If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. +

+

If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. +

+ + +

+ + This document was generated by Bruno Haible on June, 4 2025 using texi2html 1.78a. + +
+ +

+ + diff --git a/miniconda3/share/doc/libssh2/AUTHORS b/miniconda3/share/doc/libssh2/AUTHORS new file mode 100644 index 0000000000000000000000000000000000000000..e94299fcf6beffb15f222d659f49f585f24e8816 --- /dev/null +++ b/miniconda3/share/doc/libssh2/AUTHORS @@ -0,0 +1,80 @@ + libssh2 is the result of many friendly people. This list is an attempt to + mention all contributors. If we have missed anyone, tell us! + + This list of names is a-z sorted. + +Adam Gobiowski +Alexander Holyapin +Alexander Lamaison +Alfred Gebert +Ben Kibbey +Bjorn Stenborg +Carlo Bramini +Cristian Rodríguez +Daiki Ueno +Dan Casey +Dan Fandrich +Daniel Stenberg +Dave Hayden +Dave McCaldon +David J Sullivan +David Robins +Dmitry Smirnov +Douglas Masterson +Edink Kadribasic +Erik Brossler +Francois Dupoux +Gellule Xg +Grubsky Grigory +Guenter Knauf +Heiner Steven +Henrik Nordstrom +James Housleys +Jasmeet Bagga +Jean-Louis Charton +Jernej Kovacic +Joey Degges +John Little +Jose Baars +Jussi Mononen +Kamil Dudka +Lars Nordin +Mark McPherson +Mark Smith +Markus Moeller +Matt Lilley +Matthew Booth +Maxime Larocque +Mike Protts +Mikhail Gusarov +Neil Gierman +Olivier Hervieu +Paul Howarth +Paul Querna +Paul Veldkamp +Peter Krempa +Peter O'Gorman +Peter Stuge +Pierre Joye +Rafael Kitover +Romain Bondue +Sara Golemon +Satish Mittal +Sean Peterson +Selcuk Gueney +Simon Hart +Simon Josefsson +Sofian Brabez +Steven Ayre +Steven Dake +Steven Van Ingelgem +TJ Saunders +Tommy Lindgren +Tor Arntsen +Viktor Szakats +Vincent Jaulin +Vincent Torri +Vlad Grachov +Wez Furlong +Yang Tse +Zl Liu diff --git a/miniconda3/share/doc/libssh2/BINDINGS.md b/miniconda3/share/doc/libssh2/BINDINGS.md new file mode 100644 index 0000000000000000000000000000000000000000..63ad1b0d34fca1d2fc35f9e1a5bcfc8d8cdcc90b --- /dev/null +++ b/miniconda3/share/doc/libssh2/BINDINGS.md @@ -0,0 +1,25 @@ +libssh2 bindings +================ + +Creative people have written bindings or interfaces for various environments +and programming languages. Using one of these bindings allows you to take +advantage of libssh2 directly from within your favourite language. + +The bindings listed below are not part of the libssh2 distribution archives, +but must be downloaded and installed separately. + + + +[Cocoa/Objective-C](https://github.com/karelia/libssh2_sftp-Cocoa-wrapper) + +[Haskell FFI bindings](https://hackage.haskell.org/package/libssh2) + +[Perl Net::SSH2](https://metacpan.org/pod/Net::SSH2) + +[PHP ssh2](https://pecl.php.net/package/ssh2) + +[Python pylibssh2](https://pypi.python.org/pypi/pylibssh2) + +[Python-ctypes PySsh2](https://github.com/gellule/PySsh2) + +[Ruby libssh2-ruby](https://github.com/mitchellh/libssh2-ruby) diff --git a/miniconda3/share/doc/libssh2/COPYING b/miniconda3/share/doc/libssh2/COPYING new file mode 100644 index 0000000000000000000000000000000000000000..6eb51468404b21423ff3d842adfab0cd475de13d --- /dev/null +++ b/miniconda3/share/doc/libssh2/COPYING @@ -0,0 +1,43 @@ +/* Copyright (C) 2004-2007 Sara Golemon + * Copyright (C) 2005,2006 Mikhail Gusarov + * Copyright (C) 2006-2007 The Written Word, Inc. + * Copyright (C) 2007 Eli Fant + * Copyright (C) 2009-2023 Daniel Stenberg + * Copyright (C) 2008, 2009 Simon Josefsson + * Copyright (C) 2000 Markus Friedl + * Copyright (C) 2015 Microsoft Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, + * with or without modification, are permitted provided + * that the following conditions are met: + * + * Redistributions of source code must retain the above + * copyright notice, this list of conditions and the + * following disclaimer. + * + * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * Neither the name of the copyright holder nor the names + * of any other contributors may be used to endorse or + * promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE + * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * OF SUCH DAMAGE. + */ diff --git a/miniconda3/share/doc/libssh2/HACKING.md b/miniconda3/share/doc/libssh2/HACKING.md new file mode 100644 index 0000000000000000000000000000000000000000..11ddbd305dd7626ab6cab27bbea7f7149978fef9 --- /dev/null +++ b/miniconda3/share/doc/libssh2/HACKING.md @@ -0,0 +1,14 @@ +# libssh2 source code style guide + +- 4 level indent +- spaces-only (no tabs) +- open braces on the if/for line: + + ``` + if (banana) { + go_nuts(); + } + ``` + +- keep source lines shorter than 80 columns +- See `libssh2-style.el` for how to achieve this within Emacs diff --git a/miniconda3/share/doc/libssh2/NEWS b/miniconda3/share/doc/libssh2/NEWS new file mode 100644 index 0000000000000000000000000000000000000000..b3bd14cbab9a36062a11c6ac52c0e83ef95ac47d --- /dev/null +++ b/miniconda3/share/doc/libssh2/NEWS @@ -0,0 +1,10896 @@ + Changelog for the libssh2 project. Generated with git2news.pl + +Daniel Stenberg (16 Oct 2024) +- RELEASE-NOTES: 1.11.1 + +Viktor Szakats (8 Oct 2024) +- RELEASE-NOTES: sync [ci skip] + +- [Anders Borum brought this change] + + session: support server banners up to 8192 bytes (was: 256) + + If server had banner exceeding 256 bytes there wasn't enough room in + `_LIBSSH2_SESSION.banner_TxRx_banner`. Only the first 256 bytes would be + read making the first packet read fail but also dooming key exchange as + `session->remote.banner` didn't include everything. + + This change bumps the banner buffer to 8KB to match OpenSSH. + + Fixes #1442 + Closes #1443 + +- RELEASE-NOTES: sync [ci skip] + +- cmake: sync and improve Find modules, add `pkg-config` native detection + + - sync code between Find modules. + - wolfssl: replace `pkg-config` hints with native detection. + - libgcrypt, mbedtls: add `pkg-config`-based native detection. + - libgcrypt: add version detection. + - limit `pkg-config` use for `UNIX`, vcpkg, and non-cross MinGW builds, + and builds with no manual customization via `*_INCLUDE_DIR` or + `*_LIBRARY`. + - replace and sync Find module header comments. + - ci: delete manual mbedTLS config that's now redundant. + + Based on similar work done in curl. + + Second attempt at #1420 + Closes #1445 + +- cmake: initialize `LIBSSH2_LIBDIRS` [ci skip] + + Follow-up to c87f12963037b22e6b60411c9c2d6513c06e2f03 #1466 + +- ci/appveyor: fix and bump OpenSSL 3 path, add path check + + Follow-up to b5e68bdc37c6afa0dc777794dda8307167919d04 #1461 + Closes #1468 + +- cmake: link to OpenSSL::Crypto, not OpenSSL::SSL + + Follow-up to 82b09f9b3aae97f641fbcc2d746d2a6383abe857 #1322 + Follow-up to c84745e34e53f863ffba997ceeee7d43d1c63a4b #1128 + Cherry-picked from #1445 + Closes #1467 + +- cmake: generate `LIBSSH2_PC_LIBS_PRIVATE` dynamically + + Generate `LIBSSH2_PC_LIBS_PRIVATE` from `LIBSSH2_LIBS`. + + Also add extra libdirs (`-L`) to `Libs` and `Libs.private`. + + Logic copied from curl. + + Closes #1466 + +- cmake: initialize `LIBSSH2_PC_REQUIRES_PRIVATE` [ci skip] + + Follow-up to 0fce9dcc2909ffff5f4a1a1bc3d359fc7f409299 #1464 + +- cmake: add comment about `ibssh2.pc.in` variables [ci skip] + +- cmake: support absolute `CMAKE_INSTALL_INCLUDEDIR`/`CMAKE_INSTALL_LIBDIR` + + in `libssh2.pc`. + + Also use `${exec_prefix}` (instead of `${prefix}`) as a base for `libdir`. + + Closes #1465 + +- cmake: rename two variables and initialize them + + - `LIBRARIES` -> `LIBSSH2_LIBS` + - `SOCKET_LIBRARIES` -> `LIBSSH2_LIBS_SOCKET` + + Also initialize them before use. + + Cherry-picked from #1445 + Closes #1464 + +- ci/appveyor: reduce test runs (workaround for infrastructure permafails) + + Jobs consistently fail to connect to the test server (run in GHA) since + 2024-Aug-29: + https://ci.appveyor.com/project/libssh2org/libssh2/builds/50498393 + + There was an earlier phase of failures one month before that, that got + fixed by increasing the wait for the server in + bf3af90b3f1bb14cf452df7a8eb55cc9088f3e7f. + + Thus, skip running tests in AppVeyor CI jobs, except: After some + experiments, it seems that running tests with the last OpenSSL job and + the last WinCrypt job _work_, which still leaves some coverage. + It remains to be seen how stable this is. + + This is meant as a temporary fix till there is a solution to make all + jobs run tests reliable like up until a few months ago. + + Closes #1461 + +- [Patrick Monnerat brought this change] + + os400: drop vsprintf() use + + Follow-up to discussion in #1457 + + Plus e-mail address update. + + Closes #1462 + +- RELEASE-NOTES: sync [ci skip] + +Daniel Stenberg (30 Sep 2024) +- openssl: free allocated resources when using openssl3 + + Reproduces consistently with curl test case 638 + + Closes #1459 + +Viktor Szakats (28 Sep 2024) +- checksrc: update, check all sources, fix fallouts + + update from curl: + https://github.com/curl/curl/blob/cff75acfeca65738da8297aee0b30427b004b240/scripts/checksrc.pl + + Closes #1457 + +- cmake: prefer `find_dependency()` in `libssh2-config.cmake` + + CMake manual suggest using `find_dependency()` (over `find_package()`) + in `config.cmake` scripts. + + Ref: https://cmake.org/cmake/help/latest/module/CMakeFindDependencyMacro.html + + Closes #1460 + +- ci: use Ninja with cmake + + Closes #1458 + +GitHub (27 Sep 2024) +- [dksslq brought this change] + + Fix memory leaks in _libssh2_ecdsa_curve_name_with_octal_new and _libssh2_ecdsa_verify (#1449) + + Better error handling in`_libssh2_ecdsa_curve_name_with_octal_new` and `_libssh2_ecdsa_verify` to prevent leaks. + + Credit: dksslq + +- [rolag brought this change] + + Fix unstable connections over nonblocking sockets (#1454) + + The `send_existing()` function allows partially sent packets to be sent + fully before any further packets are sent. Originally this returned + `LIBSSH2_ERROR_BAD_USE` when a different caller or thread tried to send + an existing packet created by a different caller or thread causing the + connection to disconnect. Commit 33dddd2f8ac3bc81 removed the return + allowing any caller to continue sending another caller's packet. This + caused connection instability as discussed in #1397 and confused the + client and server causing occasional duplicate packets to be sent and + giving the error `rcvd too much data` as discussed in #1431. We return + `LIBSSH2_ERROR_EAGAIN` instead to allow existing callers to finish + sending their own packets. + + Fixes #1397 + Fixes #1431 + Related #720 + + Credit: klux21, rolag + +- [Will Cosgrove brought this change] + + Prevent possible double free of hostkey (#1452) + + NULL server hostkey based on fuzzer failure case. + +Viktor Szakats (7 Sep 2024) +- cmake: tidy up syntax, minor improvements + + - make internal variables underscore-lowercase. + - unfold lines. + - fold lines setting header directories. + - fix indent. + - drop interim variable `EXAMPLES`. + - initialize some variables before populating them. + - clear a variable after use. + - add `libssh2_dumpvars()` function for debugging. + - allow to override default `CMAKE_UNITY_BUILD_BATCH_SIZE`. + - bump up default `CMAKE_UNITY_BUILD_BATCH_SIZE` to 0 (was 32). + - tidy up option descriptions. + + Closes #1446 + +- cmake: rename mbedTLS and wolfSSL Find modules + + To match the curl ones. + + Cherry-picked from #1445 + +- RELEASE-NOTES: sync [ci skip] + +- cmake: fixup version detection in mbedTLS find module + + - avoid warning with 2.x versions about missing header file while + extracting the version number. + + - clear temp variables. + + Closes #1444 + +- buildconf: drop + + Use `autoreconf -fi` instead. + + Follow-up to fc5d77881eb6bb179f831e626d15f4f29179aad5 + Closes #1441 + +- [Michael Buckley brought this change] + + Implement chacha20-poly1305@openssh.com + + Probably the biggest and potentially most controversial change we have + to upstream. + + Because earlier versions of OpenSSL implemented the algorithm before + standardization, using an older version of OpenSSL can cause problems + connecting to OpenSSH servers. Because of this, we use the public domain + reference implementation instead of the crypto backends, just like + OpenSSH does. + + We've been holding this one for a few years. We were about to upstream + it around the same time as aes128gcm landed upstream, and the two + changes were completely incompatible. Honestly, it took me weeks to + reconcile these two implementations, and it could be much better. + + Our original implementation changed every crypt method to decrypt the + entire message at once. the AESGCM implementation instead went with this + firstlast design, where a firstlast paramater indicates whether this is + the first or last call to the crypt method for each message. That added + a lot of bookkeeping overhead, and wasn't compatible with the chacha + public domain implementation. + + As far as I could tell, OpenSSH uses the technique of decrypting the + entire message in one go, and doesn't have anything like firstlast. + However, I could not get out aes128gcm implementation to work that way, + nor could I get the chacha implementation to work with firstlast, so I + split it down the middle and let each implementation work differently. + It's kind of a mess, and probably should be cleaned up, but I don't have + the time to spend on it anymore, and it's probably better to have + everything upstream. + + Fixes #584 + Closes #1426 + +- tidy-up: do/while formatting + + Also fix an indentation and delete empty lines. + + Closes #1440 + +- wolfssl: drop header path hack + + The wolfSSL OpenSSL headers reside in `wolfssl/openssl/*.h`. + + Before this patch the wolfSSL OpenSSL compatibilty header includes were + shared with the native OpenSSL codepath, and used `openssl/*h`. For + wolfSSL builds this required a hack to append the + `/wolfssl` directory to the header search path, to find + the headers. + + This patch changes the source to use the correct header references, + allowing to drop the header path hack. + + Also fix to use the correct variable to set up the header path in CMake: + `WOLFSSL_INCLUDE_DIRS` (was: `WOLFSSL_INCLUDE_DIR`, without the `S`) + + Closes #1439 + +- cmake: mbedTLS detection tidy-ups + + - set and use `MBEDTLS_INCLUDE_DIRS`. + - stop marking `MBEDTLS_LIBRARIES` as advanced. + + Closes #1438 + +- cmake: add quotes, delete ending dirseps + + Follow-up to 3fa5282d6284efba62dc591697e6a687152bdcb1 #1166 + Closes #1437 + +- CI/appveyor: increase wait for SSH server on GHA [ci skip] + + Blind attempt to make AppVeyor CI tests work again. + +- disable DSA by default + + Also: + - add `LIBSSH2_DSA_ENABLE` to enable it explicitly. + - test the above option in CI. + - say 'deprecated' in docs and public header. + - disable DSA in the CI server config. + (OpenSSH 9.8 no longer builds with it by default) + https://www.openssh.com/txt/release-9.8 + Patch-by: Jose Quaresma + - disable more DSA code when not enabled. + + Fixes #1433 + Closes #1435 + +GitHub (30 Jul 2024) +- [Viktor Szakats brought this change] + + tidy-up: link updates (#1434) + +Marc Hoersken (27 Jul 2024) +- ci/GHA: revert concurrency and improve permissions + + Statuses are per AppVeyor event and commit, not pull-request. + Also align permissions approach with curl, least priviledge. + + Partially reverts b08cfbc99fa4df3459db4e1ccf4263fd260e9b15. + +GitHub (23 Jul 2024) +- [Will Cosgrove brought this change] + + Always init mbedtls_pk_context (#1430) + + In the failure case, mbedtls_pk_context could be free'd without first being initialized. + +- [Viktor Szakats brought this change] + + mbedtls: tidy-up (#1429) + +- [Will Cosgrove brought this change] + + Correctly initialize values (#1428) + + Fix regression with commit from #1421 + +Viktor Szakats (14 Jul 2024) +- RELEASE-NOTES: sync [ci skip] + +- [Seo Suchan brought this change] + + mbedtls: expose `mbedtls_pk_load_file()` for our use + + While it's moved to pk_internal, it won't removed in mbedTLS 3.6 LTS + so it's safe to redeclare it on our side to find it. + + This is implementing emergency fix suggested from + https://github.com/libssh2/libssh2/commit/2e4c5ec4627b3ecf4b6da16f365c011dec9a31b4#commitcomment-141379351 + + Follow-up to e973493f992313b3be73f51d3f7ca6d52e288558 #1393 + Follow-up to 2e4c5ec4627b3ecf4b6da16f365c011dec9a31b4 #1349 + Closes #1421 + +GitHub (13 Jul 2024) +- [Viktor Szakats brought this change] + + ci/GHA: simplify mbedTLS build hack for autotools (#1425) + + Follow-up to e973493f992313b3be73f51d3f7ca6d52e288558 #1393 + +- [Michael Buckley brought this change] + + Always check for null pointers before calling _libssh2_bn_set_word (#1423) + +- [Viktor Szakats brought this change] + + ci/GHA: FreeBSD 14.1, actions bump (#1424) + +- [Michael Buckley brought this change] + + Increase SFTP_HANDLE_MAXLEN back to 4092 (#1422) + + Match OpenSSH for compatibility. + +Viktor Szakats (10 Jul 2024) +- ci/GHA: tidy up casing [ci skip] + +- REUSE: fix typo in comment + +- REUSE: shorten and improve + + Follow-up to 70b8bf314cf4566a7529c5d6eae63097a926abb0 #1419 + +- REUSE: upgrade to `REUSE.toml` + + Closes #1419 + +- build: stop detecting `sys/param.h` header + + This header is no longer used. + + Follow-up to 12427f4fb8e789adcee4a6e30974932883915e88 #1415 + Closes #1418 + +- [Nicolas Mora brought this change] + + tests: avoid using `MAXPATHLEN`, for portability + + `MAXPATHLEN` is not present in some systems, e.g. GNU Hurd. + + Co-authored-by: Viktor Szakats + Ref: 54bef4c5dad868a9d45fdbfca9729b191c0abab5 #198 + Fixes #1414 + Closes #1415 + +- cmake: sync formatting in `cmake/Find*` modules + +- [Michael Buckley brought this change] + + sftp: implement posix-rename@openssh.com + + Add a new function `libssh2_sftp_posix_rename_ex()` and + `libssh2_sftp_posix_rename()`, which implement + the posix-rename@openssh.com extension. + + If the server does not support this extension, the function returns + `LIBSSH2_FX_OP_UNSUPPORTED` and it's up to the user to recover, possibly + by calling `libssh2_sftp_rename()`. + + Co-authored-by: Viktor Szakats (bump to size_t) + Closes #1386 + +- src: use `UINT32_MAX` + + Needs to be defined for platforms missing it, e.g. VS2008. + + Closes #1413 + +GitHub (25 Jun 2024) +- [Michael Buckley brought this change] + + Fix a memory leak in key exchange. (#1412) + + Original fix submitted as a patch by Trzik. + + Co-authored-by: Michael Buckley + +Viktor Szakats (25 Jun 2024) +- RELEASE-NOTES: sync [ci skip] + +- wolfssl: fix `EVP_Cipher()` use with v5.6.0 and older + + Add workaround for the wolfSSL `EVP_Cipher(*p, NULL, NULL, 0)` bug to + make libssh2 work with wolfSSL v5.6.0 and older. + + wolfSSL fixed this issue in v5.7.0: + https://github.com/wolfSSL/wolfssl/pull/7143 + https://github.com/wolfSSL/wolfssl/commit/b0de0a1c95119786cf5651dd76dd7d7bdfac5a04 + + Without our local workaround: + + - v5.3.0 and older fail most tests: + Ref: https://github.com/libssh2/libssh2/actions/runs/9646827522/job/26604211476#step:17:1263 + + - v5.4.0, v5.5.x, v5.6.0 fail these: + ``` + 29 - test_read-aes128-cbc (Failed) + 30 - test_read-aes128-ctr (Failed) + 32 - test_read-aes192-cbc (Failed) + 33 - test_read-aes192-ctr (Failed) + 34 - test_read-aes256-cbc (Failed) + 35 - test_read-aes256-ctr (Failed) + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/9646827522/job/26604233819#step:17:978 + + Oddly enough the workaround breaks OpenSSL tests, so only enable it for + the affected wolfSSL versions. + + Also add new build-from-source wolfSSL CI job to test the new codepath. + + wolfSSL has a build bug where `wolfssl/options.h` and + `wolfssl/version.h` are not copied to the `install` destination with + autotools. With CMake it has a different bug where `wolfcrypt/sp_int.h` + is not copied (with v5.4.0). And another with CMake where `FIPS_mode()` + remains missing (with v5.6.0 and earlier.) + + Therefore use CMake with v5.5.4 and a workaround for `FIPS_mode()`. + Another option is autotools with v5.4.0 and a workaround for `install`, + but CMake builds quicker. + + Regression-from 3c953c05d67eb1ebcfd3316f279f12c4b1d600b4 #797 + Fixes #1020 + Fixes #1299 + Assisted-by: Michael Buckley via #1394 + Closes #1394 (another attempt to fix the mentioned wolfSSL bug) + Closes #1407 + +- wolfssl: bump version in upstream issue comment [ci skip] + +- wolfssl: require v5.4.0 for AES-GCM + + Earlier versions crash while running tests. + + This patch is part of a series of fixes to make wolfSSL AES-GCM support + work together with libssh2. + + Possibly related is this wolfSSL bugfix patch, released in v5.4.0: + https://github.com/wolfSSL/wolfssl/pull/5205 + https://github.com/wolfSSL/wolfssl/commit/fb3c611275dfe454c331baa0818445a0406c208a + "Fix another AES-GCM EVP control command issue" + + Ref: #1020 + Ref: #1299 + Cherry-picked from #1407 + Closes #1411 + +- tests: fix excluding AES-GCM tests + + Replace hard-coded crypto backends and rely on `LIBSSH2_GCM` macro + to decide whether to run AES-GCM tests. + + Without this, build attempted to run AES-GCM tests (and failed) + for crypto backends that have conditional support for this feature, e.g. + wolfSSL without the necessary features built-in + (as in before Homewbrew wolfssl 5.7.0_1, or OpenSSL v1.1.0 and older). + + This patch is part of a series of fixes to make wolfSSL AES-GCM support + work together with libssh2. + + Cherry-picked from #1407 + Closes #1410 + +- ci/GHA: fix wolfSSL-from-source AES-GCM tests + + Turns out these tests: + ``` + 31 - test_read-aes128-gcm@openssh.com (Failed) + 36 - test_read-aes256-gcm@openssh.com (Failed) + ``` + were failing because AES-GCM wasn't enabled in libssh2. This in turn + happened because the `WOLFSSL_AESGCM_STREAM` macro wasn't enabled while + building wolfSSL. Which happened because this macro isn't enabled by + any CMake-level wolfSSL option. Passing it as `CPPFLAGS` fixes it. + + This allows enabling tests with wolfSSL 5.7.0. + + Follow-up to d4cea53f53c78febad14b4caa600e25d1aaf92fd #1408 + Closes #1409 + +- ci/GHA: add Linux job with latest wolfSSL built from source + + After this patch it's possible to run tests with wolfSSL 5.7.0. + + wolfSSL 5.7.0 fixes this bug that affects open issues #1020 and #1299: + https://github.com/wolfSSL/wolfssl/pull/7143 + + `-DWOLFSSL_OPENSSLALL=ON` is necessary for `wolfSSL_FIPS_mode()` + + Closes #1408 + +- ci/GHA: tidy up build-from-source steps [ci skip] + + - make curl downloads less verbose. + + - fix cmake warning: + ``` + CMake Warning: + No source or binary directory provided. Both will be assumed to be the + same as the current working directory, but note that this warning will + become a fatal error in future CMake releases. + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/9509866494/job/26213472410#step:5:32 + +- [Adam brought this change] + + src: fix type warning in `libssh2_sftp_unlink` macro + + The `libssh2_sftp_unlink` macro was implicitly casting the `size_t` + returned by `strlen` to the `unsigned int` type expected by + `libssh2_sftp_unlink_ex`. + + This fix adds an explicit cast to match similar macro definitions in + the same file (e.g. `libssh2_sftp_rename`, `libssh2_sftp_mkdir`). + + Closes #1406 + +- libssh2.pc: reference mbedcrypto pkgconfig + + mbedtls 3.6.0 got pkgconfig support: + https://github.com/Mbed-TLS/mbedtls/commit/a4d17b34f354557838e05d2cb47200e8dcaaf59b + + Reference it from `libssh2.pc`. + + Closes #1405 + +- tidy-up: typo in comment [ci skip] + +- RELEASE-NOTES: sync [ci skip] + + Also bump planned deprecation dates. + +- ci/GHA: show configure logs on failure and other tidy-ups + + - dump cmake error log on configure failure. (for cmake 3.26 and newer) + - dump `config.log` on autotools configure failure. + - convert specs filename to Windows format before passing to CMake. + - add missing quotes. + + Closes #1403 + +- ci/GHA: bump parallel jobs to nproc+1 + + Ref: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories + + Closes #1402 + +- ci/GHA: show test logs on failure + + Closes #1401 + +- ci/GHA: fix `Dockerfile` failing after Ubuntu package update + + Likely due an upstream Ubuntu package update (requiring an apt-get + install call beforehand), tests run via autotools started failing with + no change in the libssh2 repo: + ``` + FAIL: test_aa_warmup + ==================== + + Error running command 'docker build --quiet -t libssh2/openssh_server %s' (exit 256): Dockerfile:10 + -------------------- + 8 | && apt-get clean \ + 9 | && rm -rf /var/lib/apt/lists/* + 10 | >>> RUN mkdir /var/run/sshd + 11 | + 12 | # Chmodding because, when building on Windows, files are copied in with + -------------------- + ERROR: failed to solve: process "/bin/sh -c mkdir /var/run/sshd" did not complete successfully: exit code: 1 + + Failed to build docker image + Cannot stop session - none started + Cannot stop container - none started + Command: docker build --quiet -t libssh2/openssh_server ../../tests/openssh_server + FAIL test_aa_warmup (exit status: 1) + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/9322194756/job/25662748095#step:11:390 + + Fix it by skipping `mkdir` if `/var/run/sshd` already exists. + + (Why cmake-based jobs aren't affected, I don't know.) + + Ref: https://github.com/libssh2/libssh2/commit/50143d5867d35df76a6cf589ca8a13b22105aa64#commitcomment-142560875 + Closes #1400 + +- ci/GHA: use ubuntu-latest with OmniOS job + + It's the same as ubuntu-22.04. + + Also update OmniOS package search link. + +- ci: disable dependency tracking in autotools builds + + For better build performance. Dependency tracking causes a build + overhead while compiling to help a subsequent build, but in CI there is + never one and the extra work is discarded. + + Closes #1396 + +- mbedtls: fail to compile with v3.6.0 outside CI + + A compile-time failure is preferred over an unexpected one at + runtime. + + The problem is silenced with a macro in CI and this macro will have + to be added to more platforms when mbedTLS v3.6.0 reaches them. + + Follow-up to 2e4c5ec4627b3ecf4b6da16f365c011dec9a31b4 #1349 + Closes #1393 + +- tests: drop default cygpath option `-u` + +- tidy-up: fix typo found by codespell + + Ref: https://github.com/libssh2/libssh2/actions/runs/9224795055/job/25380857082?pr=1393#step:4:5 + +- ci/GHA: shell syntax tidy-up + + Closes #1390 + +- RELEASE-NOTES: sync [ci skip] + +- ci/GHA: bump NetBSD/OpenBSD, add NetBSD arm64 job + + OpenBSD arm64 jobs were very slow, so skipped that. + + Closes #1388 + +- autotools: fix to update `LDFLAGS` for each detected dependency + + autotools lib detection routine failed to extend LDFLAGS for each + detection. This could cause successful detection of a dependency, but + later failing to use it. This did not cause an issue as long as all + dependencies lived under the same prefix, but started breaking on macOS + ARM + Homebrew where this was no longer true for mbedTLS and zlib in + particular. + + Follow-up to 844115393bffb4e92c6569204cbe4cd8e553480d #1381 + Follow-up to ae2770de25949bc7c74e60b4cc6a011bbe1d3d7c #1377 + Closes #1384 + +GitHub (8 May 2024) +- [Michael Buckley brought this change] + + OpenSSL 3: Fix calculating DSA public key (#1380) + +Viktor Szakats (8 May 2024) +- ci/GHA: tidy-up wolfSSL autotools config on macOS + + Closes #1383 + +- ci/GHA: shorter mbedTLS autotools workaround + + Follow-up to 844115393bffb4e92c6569204cbe4cd8e553480d #1381 + Closes #1382 + +GitHub (8 May 2024) +- [Michael Buckley brought this change] + + ci: fix mbedtls runners on macOS (#1381) + + Sets LDFLAGS while configuring the autoconf mbedTLS build for macOS. + +Viktor Szakats (29 Apr 2024) +- RELEASE-NOTES: sync [ci skip] + +- [binary1248 brought this change] + + wincng: fix `DH_GEX_MAXGROUP` set higher than supported + + In 1c3a03ebc3166cf69735111aba2b8cee57cdba51 #493, + `LIBSSH2_DH_GEX_MAXGROUP` was introduced to specify + crypto-backend-specific modulus sizes. Unfortunately, the max size for + the wincng DH modulus was defined to 8192, probably because this is the + value most other backends support. + + According to Microsoft documentation [1], `BCryptGenerateKeyPair` + currently only supports up to 4096-bit keys when the selected algorithm + is `BCRYPT_DH_ALGORITHM`. Requesting larger keys when calling + `BCryptGenerateKeyPair` in `_libssh2_dh_key_pair` always results in + `STATUS_INVALID_PARAMETER` being returned and ultimately key exchange + failing. + + When attempting to connect to any server that offers 8192 bit DH, this + causes key exchange to always fail when using the wincng backend. + Reducing `LIBSSH2_DH_GEX_MAXGROUP` to 4096 fixes the issue. + + [1] https://learn.microsoft.com/en-us/windows/win32/api/bcrypt/nf-bcrypt-bcryptgeneratekeypair + + Closes #1372 + +- build: silence warnings inside `FD_SET()`/`FD_ISSET()` macros + + Use an ugly workaround to silence `-Wsign-conversion` warnings triggered + by the internals of `FD_SET()`/`FD_ISSET()` macros. They've been showing + up in OmniOS CI builds when compiling `example` programs. They also have + been seen with older Cygwin and other envs and configurations. + + Also scope two related variables in examples. + + E.g.: + ``` + ../../example/direct_tcpip.c:251:9: warning: conversion to 'long unsigned int' from 'libssh2_socket_t' {aka 'int'} may change the sign of the result [-Wsign-conversion] + 251 | FD_SET(forwardsock, &fds); + | ^~~~~~ + ../../example/direct_tcpip.c:251:9: warning: conversion to 'long unsigned int' from 'libssh2_socket_t' {aka 'int'} may change the sign of the result [-Wsign-conversion] + ../../example/direct_tcpip.c:251:9: warning: conversion to 'long unsigned int' from 'long int' may change the sign of the result [-Wsign-conversion] + ../../example/direct_tcpip.c:251:9: warning: conversion to 'long int' from 'long unsigned int' may change the sign of the result [-Wsign-conversion] + ../../example/direct_tcpip.c:259:18: warning: conversion to 'long unsigned int' from 'libssh2_socket_t' {aka 'int'} may change the sign of the result [-Wsign-conversion] + 259 | if(rc && FD_ISSET(forwardsock, &fds)) { + | ^~~~~~~~ + ../../example/direct_tcpip.c:259:18: warning: conversion to 'long unsigned int' from 'libssh2_socket_t' {aka 'int'} may change the sign of the result [-Wsign-conversion] + ../../example/direct_tcpip.c:259:18: warning: conversion to 'long unsigned int' from 'long int' may change the sign of the result [-Wsign-conversion] + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/8854199687/job/24316762831#step:3:2020 + + Closes #1379 + +- autotools: use `AM_CFLAGS` + + Use `AM_CFLAGS` to pass custom, per-target C flags. This replaces using + `CFLAGS` which triggered this warning when running `autoreconf -fi`: + ``` + tests/Makefile.am:8: warning: 'CFLAGS' is a user variable, you should not override it; + tests/Makefile.am:8: use 'AM_CFLAGS' instead + ``` + (Only for `tests`, even though `example` and `src` also used this + method. The warning is also missing from curl, that also uses + `CFLAGS`.) + + Follow-up to 3ec53f3ea26f61cbf2e0fbbeccb852fca7f9b156 #1286 + Closes #1378 + +GitHub (25 Apr 2024) +- [Viktor Szakats brought this change] + + ci/GHA: fix gcrypt with autotools/macOS/Homebrew/ARM64 (#1377) + + mbedtls configure fails to detect anything due to this: + ``` + configure:23101: gcc -o conftest -g -O2 -I/opt/homebrew/include conftest.c -lmbedcrypto -lz >&5 + ld: library 'mbedcrypto' not found + clang: error: linker command failed with exit code 1 (use -v to see invocation) + ``` + +Viktor Szakats (25 Apr 2024) +- autotools: delete bogus square bracket from help text [ci skip] + + Follow-up to 3f98bfb0900b5e68445a339cfebc60b307a24650 #1368 + +GitHub (25 Apr 2024) +- [Viktor Szakats brought this change] + + ci/GHA: fix verbose option for autotools jobs (#1376) + + Also enable verbose for macOS `make` step. + +- [Viktor Szakats brought this change] + + ci/GHA: dump `config.log` on failure for macOS autotools jobs (#1375) + +- [Viktor Szakats brought this change] + + ci/GHA: fix `autoreconf` failure on macOS/Homebrew (#1374) + + By manually installing `libtool`. + + ``` + autoreconf -fi + shell: /bin/bash -e {0} + configure.ac:75: error: possibly undefined macro: AC_LIBTOOL_WIN32_DLL + If this token and others are legitimate, please use m4_pattern_allow. + See the Autoconf documentation. + configure.ac:76: error: possibly undefined macro: AC_PROG_LIBTOOL + autoreconf: error: /opt/homebrew/Cellar/autoconf/2.72/bin/autoconf failed with exit status: 1 + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/8833608758/job/24253334557#step:4:1 + +- [Viktor Szakats brought this change] + + ci/GHA: fixup Homebrew location (for ARM runners) (#1373) + + GHA macOS runners became ARM64 machines. Make the Homebrew prefix + dynamic to adapt to these installations. + +Viktor Szakats (14 Apr 2024) +- RELEASE-NOTES: sync [ci skip] + +- [Patrick Monnerat brought this change] + + os400: Add two recent files to the distribution + + Closes #1364 + +- wincng: add to ci/GHA, add `./configure` option `--enable-ecdsa-wincng` + + - add `./configure` option `--enable-ecdsa-wincng` + + - add WinCNG autotools jobs to GHA. + + - enable WinCNG ECDSA in some GHA jobs (both CMake and autotools). + + Follow-up to 3e72343737e5b17ac98236c03d5591d429b119ae #1315 + Closes #1368 + +GitHub (14 Apr 2024) +- [Johannes Passing brought this change] + + wincng: add ECDSA support for host and user authentication (#1315) + + The WinCNG backend currently only supports DSA and RSA. This PR + adds ECDSA support for host and user authentication. + + * Disable WinCNG ECDSA support by default to maintain backward + compatibility for projects that target versions below Windows 10. + + * Add cmake option `ENABLE_ECDSA_WINCNG` to guard ECDSA support. + + * Update AppVeyor job matrix to only enable ECDSA on Server 2016+ + +Viktor Szakats (14 Apr 2024) +- ci: enable Unity mode for most CMake builds + + Ref: 7129ea9ca8cca86dac80a6bac2d63937987efe9d #1034 + Closes #1367 + +- os400: fix shellcheck warnings in scripts (fixups) + + - Build scripts must be executed by the os/400 shell (sh), not bash which + is a PASE program: The `-ot` non-POSIX test extension works in os/400 as + well. Ref: https://github.com/libssh2/libssh2/pull/1364#issue-2241646754 + + - Drop/fixup mods trying to make some syntax highlighters happier. + + Follow-up to c6625707b94d9093f38f1a0a4d89c11b64f12ba8 #1358 + Assisted-by: Patrick Monnerat + Closes #1364 + Closes #1366 + +- cmake: style tidy-up (more) + + Follow-up to 3fa5282d6284efba62dc591697e6a687152bdcb1 #1166 + Closes #1365 + +- RELEASE-NOTES: sync [ci skip] + +- os400: fix shellcheck warnings in scripts + + - use `$()` instead of backticks, and re-arrange double-quotes inside. + - add missing `|| exit 1` to `cd` calls. (could be dropped by using `set -eu`.) + - add `-n` to a few `if`s. + - shorten redirections by using `{} >` (as shellcheck recommended). + - silence warnings where variables were detected as unused (SC2034). + - a couple misc updates to silence warnings. + - switch to bash shebang for `-ot` feature. + - split two lines to unbreak syntax highlighting in my editor. (`$(expr \`, `$(dirname \`) + + Also enable CI checks for OS/400 shell scripts. + + Ref: d88b9bcdafe9d19aad2fb120d0a0acb3edab64f7 + Closes #1358 + +- RELEASE-NOTES: sync [ci skip] + +- ci: add shellcheck job and script + + Add FIXME for OS/400 scripts. + + Cherry-picked from #1358 + +- tests: fix shellcheck issues in `test_sshd.test` + + Cherry-picked from #1358 + +- RELEASE-NOTES: sync [ci skip] + +GitHub (9 Apr 2024) +- [Viktor Szakats brought this change] + + ci/appveyor: re-enable OpenSSL 3, also bump to 3.2.1 (#1363) + + Ref: 104744f4a523de574ce3767c50948d9b8385be4c #1348 + +Viktor Szakats (9 Apr 2024) +- ci: use a better test timestamp [ci skip] + + Mar 27 2024 08:00:00 GMT+0000 + + Follow-up to 2d765e454d98b794a5e5bbc497b1fcba4a9b8c4b #1360 + +GitHub (9 Apr 2024) +- [Viktor Szakats brought this change] + + ci: verify build and install from tarball (#1362) + + Install verification based on: + https://github.com/curl/curl/blob/28c5ddf13ac311d10bc4e8f9fc4ce0858a19b888/scripts/installcheck.sh + +Viktor Szakats (9 Apr 2024) +- tidy-up: dir names, command-line [ci skip] + + Follow-up to 2d765e454d98b794a5e5bbc497b1fcba4a9b8c4b #1360 + +- cmake: tidy up function name casing in `CopyRuntimeDependencies.cmake` + + Use lowercase to match callers. + +GitHub (9 Apr 2024) +- [Viktor Szakats brought this change] + + ci: add reproducibility test for `maketgz` (#1360) + +Viktor Szakats (9 Apr 2024) +- maketgz: add reproducible dir entries to tarballs + + In the initial implementation of reproducible tarballs, they were + missing directory entries, while .zip archives had them. It meant + that on extracting the tarball, on-disk directory entries got the + current timestamp. + + This patch fixes this by including directory entries in the tarball, + with reproducible timestamps. It also moves sorting inside tar, + to ensure reproducible directory entry timestamps on extract + (without the need of `--delay-directory-restore` option, when + extracting with GNU tar. BSD tar got that right by default.) + + GNU tar 1.28 (2014-07-28) introduced `--sort=`. + + Follow-up to d52fe1b4358fab891037d86b5c73c098079567db #1357 + Closes #1359 + +- ci/GHA: improve version number in `maketgz` test + + Follow-up to cba7f97506c1b8e5ff131bbbc57b5796ac634c56 #1353 + +GitHub (8 Apr 2024) +- [Michael Buckley brought this change] + + src: check the return value from `_libssh2_bn_*()` functions (#1354) + + Found by oss-fuzz. In `diffie_hellman_sha_algo()`, we were calling + `_libssh2_bn_from_bin()` with data recieved by the server without + checking whether that data was zero-length or ridiculously long. + In the OpenSSL backend, this would cause `_libssh2_bn_from_bin()` + to fail an allocation, which would eventually lead to a NULL + dereference when the bignum was used. + + Add the same check for `_libssh2_bn_set_word()` and + `_libssh2_bn_to_bin()`. + +Viktor Szakats (8 Apr 2024) +- maketgz: reproducible tarballs/zip, display tarball hashes + + - support `SOURCE_DATE_EPOCH` for reproducibility. + - make tarballs reproducible. + - make file timestamps in tarball/zip reproducible. + - make directory timestamps in zip reproducible. + - make timestamps of tarballs/zip reproducible. + - make file order in tarball/zip reproducible. + - use POSIX ustar tarball format to avoid supply chain vulnerability: https://seclists.org/oss-sec/2021/q4/0 + - make uid/gid in tarball reproducible. + - omit owner user/group names from tarball for reproducibility and privacy. + - omit current timestamp from .gz header for reproducibility. + - display SHA-256 hashes of produced tarballs/zip. (Requires `sha256sum`) + - re-sync formatting with curl's `maketgz`. + + Closes #1357 + +- maketgz: `set -eu`, reproducibility, improve zip, add CI test + + - set bash `-eu`. + - fix bash `-eu` issues. + - apply `TZ=UTC` and `LC_ALL=C` for reproducibility. + - sort `.zip` entries for reproducibility. + - zip with `--no-extra` for reproducibliity. + - use maximum zip compression. + - add the gpg sign command-line. Copied from curl. + - add CI test for `maketgz`. + + Closes #1353 + +- RELEASE-NOTES: sync and cleanups [ci skip] + +GitHub (3 Apr 2024) +- [Tejaswikandula brought this change] + + Support RSA SHA2 cert-based authentication (rsa-sha2-512_cert and rsa-sha2-256_cert) (#1314) + + Replicating OpenSSH's behavior to handle RSA certificate authentication + differently based on the remote server version. + + 1. For OpenSSH versions >= 7.8, ascertain server's support for RSA Cert + types by checking if the certificate's signature type is present in + the `server-sig-algs`. + + 2. For OpenSSH versions < 7.8, Set the "SSH_BUG_SIGTYPE" flag when the + RSA key in question is a certificate to ignore `server-sig-algs` and + only offer ssh-rsa signature algorithm for RSA certs. + + This arises from the fact that OpenSSH versions up to 7.7 accept + RSA-SHA2 keys but not RSA-SHA2 certificate types. Although OpenSSH <=7.7 + includes RSA-SHA2 keys in the `server-sig-algs`, versions <=7.7 do not + actually support RSA certs. Therefore, server sending RSA-SHA2 keys in + `server-sig-algs` should not be interpreted as indicating support for + RSA-SHA2 certs. So, `server-sig-algs` are ignored when the RSA key in + question is a cert, and the remote server version is 7.7 or below. + + Relevant sections of the OpenSSH source code: + + + + + Assisted-by: Will Cosgrove + Reviewed-by: Viktor Szakats + +Viktor Szakats (3 Apr 2024) +- RELEASE-NOTES: sync [ci skip] + + Also fix to include 3-digit issue/PR references. + +- mbedtls: add workaround + FIXME to build with 3.6.0 + + This is just a stub to make `_libssh2_mbedtls_ecdsa_new_private` + compile. + + mbedtls 3.6.0 silently deleted its public API `mbedtls_pk_load_file`, + which this function relies on. + + Closes #1349 + +GitHub (3 Apr 2024) +- [Viktor Szakats brought this change] + + ci/appveyor: OpenSSL 3 no longer found by CMake, revert to 1.1.1 (#1348) + + Ref: https://github.com/appveyor/build-images/commit/702e8cdca01f28f6a40687783f493c786cebbe2c + Ref: https://github.com/appveyor/build-images/pull/149 + +Viktor Szakats (3 Apr 2024) +- docs: improve `libssh2_userauth_publickey_from*` manpages + + Reported-by: Lyndon Brown + Assisted-by: Ryan Kelley + Fixes #652 + Closes #1308 + Closes #xxxx + +- RELEASE-NOTES: sync [ci skip] + +GitHub (2 Apr 2024) +- [Viktor Szakats brought this change] + + test debian:testing-slim post xz backdoor removal (#1346) + + The unexplained CI fallouts are gone with the latest debian:testing (20240330). + + Ref #1328 #1329 #1338. + Closes #1346 + +Viktor Szakats (30 Mar 2024) +- ci: use Linux runner for BSDs, add arm64 FreeBSD 14 job + + - bump cross-platform-actions to 0.23.0. + Ref: https://github.com/cross-platform-actions/action/releases/tag/v0.23.0 + + - switch to Linux runners (from macOS) for cross-platform-actions. + It's significantly faster. + + - switch back FreeBSD 14 job to cross-platform-actions. + Also switch back to default shell. + + - add FreeBSD 14 arm64 job. + + Closes #1343 + +- ci: use single quotes in yaml [ci skip] + +- ci: tidy-up job order [ci skip] + +- build: drop `-Wformat-nonliteral` warning suppressions + + Also markup a vararg function as such. + + In functions marked up as vararg functions, there is no need to suppress + `-Wformat-nonliteral` warnings. It's done automatically by the compiler. + + Closes #1342 + +- ci: delete flaky FreeBSD 13.2 job + + Keep FreeBSD 14. + +- RELEASE-NOTES: sync [ci skip] + +- example: restore `sys/time.h` for AIX + + In AIX, `time.h` header file doesn't have definitions like + `fd_set`, `struct timeval`, which are found in `sys/time.h`. + + Add `sys/time.h` to files affected when available. + + Regression from e53aae0e16dbf53ddd1a4fcfc50e365a15fcb8b9 #1001. + + Reported-by: shubhamhii on GitHub + Assisted-by: shubhamhii on GitHub + Fixes #1334 + Fixes #1335 + Closes #1340 + +- userauth: avoid oob with huge interactive kbd response + + - If the length of a response is `UINT_MAX - 3` or larger, an unsigned + integer overflow occurs on 64-bit systems. Avoid such truncation to + always allocate enough memory to avoid subsequent out of boundary + writes. + + Patch-by: Tobias Stoeckmann + + - also add FIXME to bump up length field to `size_t` (ABI break) + + Closes #1337 + +GitHub (28 Mar 2024) +- [Josef Cejka brought this change] + + transport: check ETM on remote end when receiving (#1332) + + We should check if encrypt-then-MAC feature is enabled in remote end's + configuration. + + Fixes #1331 + +- [Josef Cejka brought this change] + + kex: always add extension indicators to kex_algorithms (#1327) + + KEX pseudo-methods "ext-info-c" and "kex-strict-c-v00@openssh.com" + are in default kex method list but they were lost after configuring + custom kex method list in libssh2_session_method_pref(). + + Fixes #1326 + +- [Jiwoo Park brought this change] + + cmake: use the imported target of FindOpenSSL module (#1322) + + * Use the imported target of FindOpenSSL module + * Build libssh2 before test runner + * Use find_package() in the CMake config file + * Use find_dependency() rather than find_package() + * Install CMake module files and use them in the config file + * Use elseif() to choose the crypto backend + +- [Andrei Augustin brought this change] + + docs: update INSTALL_AUTOTOOLS (#1316) + + corrected --with-libmbedtls-prefix to current option --with-libmbedcrypto-prefix + +Viktor Szakats (28 Mar 2024) +- ci: don't parallelize `distcheck` job + + A while ago the `distcheck` CI job became flaky. This continued after + switching to Debian stable (from testing). Try stabilzing it by running + it single-threaded. + + Closes #1339 + +- Dockerfile: switch to Debian stable (from testing) + + This fixes flakiness experienced recently with two OpenSSL jobs and one + libgcrypt job, and/or intermittently causing all Docker-based tests to + fail. + + Reported-by: András Fekete + Fixes #1328 + Fixes #1329 + Closes #1338 + +GitHub (22 Feb 2024) +- [Michael Buckley brought this change] + + Supply empty hash functions for mac_method_hmac_aesgcm to avoid a crash when e.g. setting LIBSSH2_METHOD_CRYPT_CS (#1321) + +- [Michael Buckley brought this change] + + gen_publickey_from_dsa: Initialize BIGNUMs to NULL for OpenSSL 3 (#1320) + +Viktor Szakats (23 Jan 2024) +- RELEASE-NOTES: add algo deprecation notices [ci skip] + + Closes #1307 + +- RELEASE-NOTES: sync [ci skip] + +GitHub (22 Jan 2024) +- [Juliusz Sosinowicz brought this change] + + wolfssl: enable debug logging in wolfSSL when compiled in (#1310) + + Co-authored-by: Viktor Szakats + +- [monnerat brought this change] + + os400: maintain up to date (#1309) + + - Handle MD5 conditionals in os400qc3. + - Check for errors in os400qc3 pbkdf1. + - Implement an optional build options override file. + - Sync ILE/RPG copy files with current C header files. + - Allow a null session within a string conversion cache. + - Add an ILE/RPG example. + - Adjust outdated copyrights in changed files. + +Viktor Szakats (18 Jan 2024) +- RELEASE-NOTES: sync + +- src: check hash update/final success + + Also: + - delete unused internal macro `libssh2_md5()` where defined. + - prefix `libssh2_os400qc3_hash*()` function names with underscore. + These are public/visible, but internal. + - add FIXMEs to OS/400 code to verify update/final calls; some OS API, + some internal. + + Ref: https://github.com/libssh2/libssh2/pull/1301#discussion_r1446861650 + Reviewed-by: Michael Buckley + Reviewed-by: Patrick Monnerat + Closes #1303 + +- RELEASE-NOTES: sync [ci skip] + +GitHub (18 Jan 2024) +- [Ryan Kelley brought this change] + + openssl: fix cppcheck found NULL dereferences (#1304) + + * Fix NULL dereference in gen_publickey_from_rsa_evp and + gen_publickey_from_dsa_evp. + * Add checks for en_publickey_from_ec_evp and en_publickey_from_ed_evp + +Viktor Szakats (12 Jan 2024) +- openssl: delete internal `read_openssh_private_key_from_memory()` + + It was wrapping another internal function with no added logic. + + Closes #1306 + +- openssl: formatting/whitespace + + Also use `NULL` instead of `0` for pointers. + + Closes #1305 + +- HACKING-CRYPTO: more fixups [ci skip] + + Follow-up to f64885b6ab9bbdae2da9ebd70f4dd5cea56e838a #1297 + +- HACKING-CRYPTO: fixups [ci skip] + + Follow-up to f64885b6ab9bbdae2da9ebd70f4dd5cea56e838a #1297 + +- RELEASE-NOTES: sync [ci skip] + +- src: check hash init success + + Before this patch, SHA2 and SHA1 init function results were cast to + `void`. This patch makes sure to verify these values. + + Also: + - exclude an `assert(0)` from release builds in `_libssh2_sha_algo_ctx_init()`. + (return error instead) + - fix indentation / whitespace + + Reviewed-by: Michael Buckley + Closes #1301 + +- mac: handle low-level errors + + - update low-level hmac functions from macros to functions. + - libgcrypt: propagate low-level hmac errors. + - libgcrypt: add error checks for hmac calls. + - os400qc3: add error checks, propagate them. + Assisted-by: Patrick Monnerat + - mbedtls: fix propagating low-level hmac errors. + - wincng: fix propagating low-level hmac errors. + - mac: verify success of low-level hmac functions. + - knownhost: verify success of low-level hmac functions. + - transport: verify success of MAC hash call. + - minor type cleanup in wincng. + - delete unused ripemd wrapper in wincng. + - delete unused SHA384 wrapper in mbedtls. + + Reported-by: Paul Howarth + Reviewed-by: Michael Buckley + Closes #1297 + +GitHub (8 Jan 2024) +- [Michael Buckley brought this change] + + Fix an out-of-bounds read in _libssh2_kex_agree_instr when searching for a KEX not in the server list (#1302) + +Viktor Szakats (21 Dec 2023) +- RELEASE-NOTES: sync [ci skip] + +- ci/appveyor: re-enable parallel mode + + The comment cited earlier is no longer true with recent CMake versions. + This options does actually enable parallel builds with MSVC since CMake + v3.26.0: https://gitlab.kitware.com/cmake/cmake/-/issues/20564 + + The effect isn't much for libssh2, because it spends most time in tests, + but let's enable it anyway for efficiency. + + Ref: 0d08974633cfc02641e6593db8d569ddb3644255 #884 + Ref: 7a039d9a7a2945c10b4622f38eeed21ba6b4ec55 #867 + + Closes #1294 + +- ci/gha: review/fixup auto-cancel settings + + - use the group expression from `reuse.yml` (via curl). + - add auto-cancel for `ci` and `cifuzz`. + - add auto-cancel to `appveyor_docker`. I'm just guessing here. + The hope is that it fixes AppVeyor CI runs when re-pushing a PR. + This frequently caused the freshly pushed session to fail waiting for + a connection. + - sync group expression in `appveyor_status` with `reuse`. + + Closes #1292 + +- RELEASE-NOTES: fix casing in GitHub names [ci skip] + +- RELEASE-NOTES: synced [ci skip] + + Closes #1279 + +- [Michael Buckley brought this change] + + src: add 'strict KEX' to fix CVE-2023-48795 "Terrapin Attack" + + Refs: + https://terrapin-attack.com/ + https://seclists.org/oss-sec/2023/q4/292 + https://osv.dev/list?ecosystem=&q=CVE-2023-48795 + https://github.com/advisories/GHSA-45x7-px36-x8w8 + https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-48795 + + Fixes #1290 + Closes #1291 + +- session: add `libssh2_session_callback_set2()` + + Add new `libssh2_session_callback_set2()` API that deprecates + `libssh2_session_callback_set()`. + + The new implementation offers the same functionality, but accepts and + returns a generic function pointer (of type `libssh2_cb_generic *`), as + opposed to the old function that used data pointers (`void *`). The new + solution thus avoids data to function (and vice versa) pointer + conversions, which has undefined behaviour in standard C. + + About the name: It seems the `*2` suffix was used in the past for + replacement functions for deprecated ones. Let's stick with that. + `*_ex` was preferred for new functions that extend existing ones with + new features. + + Closes #1285 + +- build: enable `-pedantic-errors` + + According to the manual, this isn't the same as `-Werror -pedantic`. + Enable it together with `-Werror`. + + https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-pedantic-errors-1 + + This option results in autotools feature detection going into crazies. + To avoid this, we add it to `CFLAGS` late. Idea copied from curl. + + This option has an effect only with gcc 5.0 and newer as of this commit. + Let's enable it for clang and older versions too for simplicity. Ref: + https://github.com/curl/curl/commit/d5c0351055d5709da8f3e16c91348092fdb481aa + https://github.com/curl/curl/pull/2747 + + Closes #1286 + +- build: add mingw-w64 support to `LIBSSH2_PRINTF()` attribute + + And fix the warning it detected. + + Closes #1287 + +- libssh2.h: add deprecated function warnings + + With deprecated-at versions and suggested replacement function. + + It's possible to silence them by defining `LIBSSH2_DISABLE_DEPRECATION`. + + Also add depcreated-at versions to documentation, and unify wording. + + Ref: https://github.com/libssh2/libssh2/pull/1260#issuecomment-1837017987 + Closes #1289 + +- ci/spellcheck: delete redundant option [ci skip] + + `--check-hidden` not necessary when passing filenames explicitly. + + Follow-up to a79218d3a058a333bb9de14079548a3511679a04 + +- tidy-up: add empty line for clarity [ci skip] + +- build: FIXME `-Wsign-conversion` to be errors [ci skip] + +- src: disable `-Wsign-conversion` warnings, add option to re-enable + + To avoid the log noise till we fix those ~360 compiler warnings. + + Also add macro `LIBSSH2_WARN_SIGN_CONVERSION` to re-enable them. + + Follow-up to afa6b865604019ab27ec033294edfe3ded9ae0c0 #1257 + + Closes #1284 + +- cmake: fix indentation [ci skip] + +- example, tests: call `WSACleanup()` for each `WSAStartup()` + + On Windows. + + Closes #1283 + +- RELEASE-NOTES: update credits [ci skip] + + Ref: https://github.com/libssh2/libssh2/pull/1241#issuecomment-1830118584 + +- RELEASE-NOTES: avoid splitting names, fix typo, refine order [ci skip] + +- RELEASE-NOTES: synced [ci skip] + +- add portable `LIBSSH2_SOCKET_CLOSE()` macro + + Add `LIBSSH2_SOCKET_CLOSE()` to the public `libssh2.h` header, for user + code. It translates to `closesocket()` on Windows and `close()` on other + platforms. + + Use it in example code. + + It makes them more readable by reducing the number of `_WIN32` guards. + + Closes #1278 + +- ci: add FreeBSD 14 job, fix issues + + - install bash to fix error when running tests: + ``` + ERROR: test_sshd.test - missing test plan + ERROR: test_sshd.test - exited with status 127 (command not found?) + ===================================== + [...] + # TOTAL: 4 + # PASS: 2 + # SKIP: 0 + # XFAIL: 0 + # FAIL: 0 + # XPASS: 0 + # ERROR: 2 + [...] + env: bash: No such file or directory + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/7133852508/job/19427420687#step:3:3998 + + - fix sshd issue when running tests: + ``` + # sshd log: + # Server listening on :: port 4711. + # Server listening on 0.0.0.0 port 4711. + # Authentication refused: bad ownership or modes for file /home/runner/work/libssh2/libssh2/tests/key_rsa.pub + # Authentication refused: bad ownership or modes for file /home/runner/work/libssh2/libssh2/tests/openssh_server/authorized_keys + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/7134629175/job/19429828342#step:3:4059 + + Cherry-picked from #1277 + Closes #1277 + +- ci: add OmniOS job, fix issues + + - use GNU Make, to avoid errors: + ``` + make: Fatal error in reader: Makefile, line 983: Badly formed macro assignment + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/7134629175/job/19429838379#step:3:1956 + + Caused by `?=` in `Makefile.am`. Fix it just in case. + + ``` + make: Fatal error in reader: Makefile, line 438: Unexpected end of line seen + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/7135524843/job/19432451767#step:3:1966 + + It's around line 43 in `Makefile.am`, reason undiscovered. + + - fix error: + ``` + ../../src/hostkey.c:1227:44: error: pointer targets in passing argument 5 of '_libssh2_ed25519_sign' differ in signedness [-Werror=pointer-sign] + 1227 | datavec[0].iov_base, datavec[0].iov_len); + | ~~~~~~~~~~^~~~~~~~~ + | | + | caddr_t {aka char *} + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/7135102832/job/19431233967#step:3:2225 + + https://docs.oracle.com/cd/E36784_01/html/E36887/iovec-9s.html + + - FIXME: new `-Wsign-conversion` warnings appeared in examples: + ``` + ../../example/direct_tcpip.c:251:9: warning: conversion to 'long unsigned int' from 'libssh2_socket_t' {aka 'int'} may change the sign of the result [-Wsign-conversion] + 251 | FD_SET(forwardsock, &fds); + | ^~~~~~ + ../../example/direct_tcpip.c:251:9: warning: conversion to 'long unsigned int' from 'libssh2_socket_t' {aka 'int'} may change the sign of the result [-Wsign-conversion] + ../../example/direct_tcpip.c:251:9: warning: conversion to 'long unsigned int' from 'long int' may change the sign of the result [-Wsign-conversion] + ../../example/direct_tcpip.c:251:9: warning: conversion to 'long int' from 'long unsigned int' may change the sign of the result [-Wsign-conversion] + ../../example/direct_tcpip.c:259:18: warning: conversion to 'long unsigned int' from 'libssh2_socket_t' {aka 'int'} may change the sign of the result [-Wsign-conversion] + 259 | if(rc && FD_ISSET(forwardsock, &fds)) { + | ^~~~~~~~ + ../../example/direct_tcpip.c:259:18: warning: conversion to 'long unsigned int' from 'libssh2_socket_t' {aka 'int'} may change the sign of the result [-Wsign-conversion] + ../../example/direct_tcpip.c:259:18: warning: conversion to 'long unsigned int' from 'long int' may change the sign of the result [-Wsign-conversion] + [...] + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/7136086865/job/19433997429#step:3:3450 + + Cherry-picked from #1277 + +- example: use `libssh2_socket_t` in X11 example + + Cherry-picked from #1277 + +- [Aaron Stone brought this change] + + Handle EINTR from send/recv/poll/select to try again as the error is not fatal + + Integration-patches-by: Viktor Szakats + Fixes #955 + Closes #1058 + +- appveyor: delete UWP job broken since Visual Studio upgrade + + Few days ago UWP job started permafailing. + + fail: https://ci.appveyor.com/project/libssh2org/libssh2/builds/48678129/job/yb8n2pox8mfjwv6m + good: https://ci.appveyor.com/project/libssh2org/libssh2/builds/48673013 + + Other projects also affected: + https://ci.appveyor.com/project/c-ares/c-ares/builds/48687390/job/l0fo4b0sijvqkw9r + + No related local update. Same CMake version. Same CI image. + + This seems to be the culprit, which could mean that this update broke + CMake detection, needs a different CMake configuration on our end, or + that this MSVC update pulled support for UWP apps: + + fail: -- The C compiler identification is MSVC 19.38.33130.0 (~ Visual Studio 2022 v17.8) + good: -- The C compiler identification is MSVC 19.37.32825.0 (~ Visual Studio 2022 v17.7) + + If this is v17.8, release notes don't readily suggest a feature removal: + https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-notes-v17.8 + + So it might just be UWP accidentally broken in this release. + + Closes #1275 + +- checksrc: sync with curl + + Closes #1272 + +- autotools: delete `--disable-tests` option, fix CI tests + + Originally added to improve build performance by skipping building + tests. But, there seems to be no point in this, because autotools + doesn't build tests by default, unless explicitly invoking + `make check`. + + Delete this option from Cygwin and FreeBSD CI tests, where it caused + `make check` to do nothing. Tests are built now, and runtime tests are + too, where supported. + + Also disable Docker-based tests for these, and add a missing `make -j3` + for FreeBSD. + + Reverts 7483edfada1f7e17cf8f9ac1c87ffa3d814c987e #715 + + Closes #1271 + +GitHub (6 Dec 2023) +- [ren mingshuai brought this change] + + build: add `LIBSSH2_NO_DEPRECATED` option (#1266) + + The following APIs have been deprecated for over 10 years and + use `LIBSSH2_NO_DEPRECATED` to mark them as deprecated: + + libssh2_session_startup() + libssh2_banner_set() + libssh2_channel_receive_window_adjust() + libssh2_channel_handle_extended_data() + libssh2_scp_recv() + + Add these options to disable them: + - autotools: `--disable-deprecated` + - cmake: `-DLIBSSH2_NO_DEPRECATED=ON` + - `CPPFLAGS`: `-DLIBSSH2_NO_DEPRECATED` + + Fixes #1259 + Replaces #1260 + Co-authored-by: Viktor Szakats + Closes #1267 + +Viktor Szakats (5 Dec 2023) +- autotools: show the default for `hidden-symbols` option + + Closes #1269 + +- tidy-up: bump casts from int to long for large C99 types in printfs + + Cast large integer types to avoid dealing with printf masks for + `size_t` and other C99 types. Some of existing code used `int` + for this, bump them to `long`. + + Ref: afa6b865604019ab27ec033294edfe3ded9ae0c0 #1257 + + Closes #1264 + +- build: enable missing OpenSSF-recommended warnings, with fixes + + Ref: + https://best.openssf.org/Compiler-Hardening-Guides/Compiler-Options-Hardening-Guide-for-C-and-C++.html + (2023-11-29) + + Enable new warnings: + + - replace `-Wno-sign-conversion` with `-Wsign-conversion`. + + Fix them in example, tests and wincng. There remain about 360 of these + warnings in `src`. Add a TODO item for those and disable `-Werror` for + this particular warning. + + - enable `-Wformat=2` for clang (in both cmake and autotools). + + - enable `__attribute__((format))` for `_libssh2_debug()`, + `_libssh2_snprintf()` and in tests for `run_command()`. + + `LIBSSH2_PRINTF()` copied from `CURL_TEMP_PRINTF()` in curl. + + - enable `-Wimplicit-fallthrough`. + + - enable `-Wtrampolines`. + + Fix them: + + - src: replace obsolete fall-through-comments with + `__attribute__((fallthrough))`. + + - wincng: fix `-Wsign-conversion` warnings. + + - tests: fix `-Wsign-conversion` warnings. + + - example: fix `-Wsign-conversion` warnings. + + - src: fix `-Wformat` issues in trace calls. + + Also, where necessary fix `int` and `unsigned char` casts to + `unsigned int` and adjust printf format strings. These were not + causing compiler warnings. + + Cast large types to `long` to avoid dealing with printf masks for + `size_t` and other C99 types. Existing code often used `int` for this. + I'll update them to `long` in an upcoming commit. + + - tests: fix `-Wformat` warning. + + - silence `-Wformat-nonliteral` warnings. + + - mbedtls: silence `-Wsign-conversion`/`-Warith-conversion` + in external header. + + Closes #1257 + +- packet: whitespace fix + + Tested via #1257 + +- tidy-up: unsigned -> unsigned int + + In the `interval` argument of public `libssh2_keepalive_config()`. + + Tested via #1257 + +- tests: sync port number type with the rest of codebase + + Tested via #1257 + +- autotools: enable `-Wunused-macros` with gcc + + It works with gcc without the libtool warnings seen with clang + on Windows in 96682bd5e14c20828e18bf10ed5b4b5c7543924a #1227. + + Sync usage of of this macro with CMake and + autotools + clang + non-Windows. Making it enabled everywhere except + autotools + clang + Windows due to the libtool stub issue. + + Follow-up to 7ecc309cd10454c54814b478c4f85d0041da6721 #1224 + + Closes #1262 + +- TODO: disable or drop weak algos [ci skip] + + Closes #1261 + +- example, tests: fix/silence `-Wformat-truncation=2` gcc warnings + + Then sync this warning option with curl. + + Seems like a false positive and/or couldn't figure how to fix it, so silence: + ``` + example/ssh2.c:227:38: error: '%s' directive output may be truncated writing likely 1 or more bytes into a region of size 0 [-Werror=format-truncation=] + 227 | snprintf(fn1, fn1sz, "%s/%s", h, pubkey); + | ^~ + example/ssh2.c:227:34: note: assuming directive output of 1 byte + 227 | snprintf(fn1, fn1sz, "%s/%s", h, pubkey); + | ^~~~~~~ + example/ssh2.c:227:13: note: 'snprintf' output 3 or more bytes (assuming 4) into a destination of size 2 + 227 | snprintf(fn1, fn1sz, "%s/%s", h, pubkey); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + example/ssh2.c:228:38: error: '%s' directive output may be truncated writing likely 1 or more bytes into a region of size 0 [-Werror=format-truncation=] + 228 | snprintf(fn2, fn2sz, "%s/%s", h, privkey); + | ^~ + example/ssh2.c:228:34: note: assuming directive output of 1 byte + 228 | snprintf(fn2, fn2sz, "%s/%s", h, privkey); + | ^~~~~~~ + example/ssh2.c:228:13: note: 'snprintf' output 3 or more bytes (assuming 4) into a destination of size 2 + 228 | snprintf(fn2, fn2sz, "%s/%s", h, privkey); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/7055480458/job/19205970397#step:10:98 + + Fix: + ``` + tests/openssh_fixture.c:116:38: error: ' 2>&1' directive output may be truncated writing 5 bytes into a region of size between 1 and 1024 [-Werror=format-truncation=] + tests/openssh_fixture.c:116:11: note: 'snprintf' output between 6 and 1029 bytes into a destination of size 1024 + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/7055480458/job/19205969221#step:10:51 + + Tested via #1257 + +- example: fix indentation follow-up + + Fix long line and fix more indentations. + + Follow-up to 9e896e1b80911a53d6aabb322e034e6ca51b6898 + +- example: fix indentation + + Tested via #1257 + +- autotools: fix missed `-pedantic` and `-Wall` options for gcc + + Follow-up to 5996fefe2bad80cfba85b2569ce6ab6ef575142c #1223 + + Tested via #1257 + +- ci: show compiler in cross/cygwin job names + + Tested via #1257 + +- mbedtls: further improve disabling `-Wredundant-decls` + + Move warning option suppression to `src/mbedtls.h` to surround the actual + external header #includes that need it. + + Follow-up to ecec68a2c13a9c63fe8c2dc457ae785a513e157c #1226 + Follow-up to 7ecc309cd10454c54814b478c4f85d0041da6721 #1224 + + Tested via #1257 + +GitHub (1 Dec 2023) +- [ren mingshuai brought this change] + + example: replace remaining libssh2_scp_recv with libssh2_scp_recv2 in output messages (#1258) + + libssh2_scp_recv is deprecated and has been replaced by libssh2_scp_recv2 + in prior commit. + + Follow-up to 6c84a426beb494980579e5c1d244ea54d3fc1a3f + +Viktor Szakats (27 Nov 2023) +- openssl: use OpenSSL 3 HMAC API, add `no-deprecated` CI job + + - use OpenSSL 3 API when available for HMAC. + This fixes building with OpenSSL 3 `no-deprecated` builds. + + - ensure we support pure OpenSSL 3 API by adding a CI job using + OpenSSL 3 custom-built with `no-deprecated`. + + Follow-up to b0ab005fe79260e6e9fe08f8d73b58dd4856943d #1207 + + Fixes #1235 + Closes #1243 + +- ci: restore lost comment for FreeBSD [ci skip] + + Follow-up to eee4e8055ab375c9f9061d4feb39086737f41a9c + +- ci: add OpenBSD (v7.4) job + fix build error in example + + - Use CMake, LibreSSL and clang from the base install. + + - This uncovered a build error in `example/subsystem_netconf.c`, caused + by using the `%n` printf mask. This is a security risk and some + systems (notably OpenBSD) disable this feature. + + Fix it by applying this patch from OpenBSD ports (from 2021-09-11): + https://cvsweb.openbsd.org/ports/security/libssh2/patches/patch-example_subsystem_netconf_c?rev=1.1&content-type=text/x-cvsweb-markup + https://github.com/openbsd/ports/commit/2c5b2f3e94381914a3e8ade960ce8c997ca9d6d7 + "The old code is also broken, as it passes a pointer to a variable + of a different size (on LP64). There is no check for truncation, + but buf[] is 1MB in size." + Patch-by: naddy + + ``` + /home/runner/work/libssh2/libssh2/example/subsystem_netconf.c:252:17: error: '%n' format specifier support is deactivated and will call abort(3) [-Werror] + "]]>]]>\n%n", (int *)&len); + ~^ + /home/runner/work/libssh2/libssh2/example/subsystem_netconf.c:270:17: error: '%n' format specifier support is deactivated and will call abort(3) [-Werror] + "]]>]]>\n%n", (int *)&len); + ~^ + 2 errors generated. + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/6991449778/job/19022024280#step:3:420 + + Also made tests with arm64, but it takes consistently almost 14m to + finish the job, vs. 2-3m for the native amd64: + https://github.com/libssh2/libssh2/actions/runs/6991648984/job/19022440525 + https://github.com/libssh2/libssh2/actions/runs/6991551220/job/19022233651 + + Cherry-picked from #1250 + Closes #1250 + +- ci: add NetBSD (v9.3) job + + Use CMake, OpenSSL (v1.1) and clang from the base install. + + Cherry-picked from #1250 + +- ci: update and speed up FreeBSD job + + - switch to an alternate GitHub action. This one seems (more) actively + maintained, and runs faster: + https://github.com/cross-platform-actions/action + + - use clang instead of gcc. clang is already present in the base + install, saving install time and bandwidth. + + - stop installing `openssl-quictls` and use the OpenSSL (v1.1) from + the base system. + (I'm suspecting that quictls before this patch wasn't detected by + the build.) + https://wiki.freebsd.org/OpenSSL + + Cherry-picked from #1250 + +- stop using leading underscores in macro names + + Underscored macros are reserved for the compiler / standard lib / etc. + Stop using them in user code. + + We used them as header guards in `src` and in `__FILESIZE` in `example`. + + Closes #1248 + +- ci: use absolute path in `CMAKE_INSTALL_PREFIX` + + To make the installed locations unambiguous in the build logs. + + Closes #1247 + +- openssl: make a function static, add `#ifdef` comments + + Follow-up to 03092292597ac601c3f9f0c267ecb145dda75e4e #248 + where the function was added. + + Also add comments to make `#ifdef` branches easier to follow in + `openssl.h`. + + Closes #1246 + +- ci: boost mbedTLS build speed + + Build times down to 4 seconds (from 18-20). + + Closes #1245 + +- openssl: fix DSA code to use OpenSSL 3 API + + - fix missing `DSA` type when building for OpenSSL 3 `no-deprecated`. + - fix fallouts after fixing the above by switching away from `DSA` + with OpenSSL 3. + + Follow-up to b0ab005fe79260e6e9fe08f8d73b58dd4856943d #1207 + + Closes #1244 + +- openssl: formatting (delete empty lines) [ci skip] + +- tests: fall back to `$LOGNAME` for username + + If the `$USER` variable is empty, fall back to using `$LOGNAME` to + retrieve the logged-in username. + + In POSIX, `$LOGNAME` is a mandatory variable, while `$USER` isn't, and + on some systems it may not be set. Without this value, tests were unable + to provide the correct username when logging into the SSH server running + under the active user's session. + + Reported-by: Nicolas Mora + Suggested-by: Nicolas Mora + Ref: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1056348 + Fixes #1240 + Closes #1241 + +- libssh2.h: use `_WIN32` for Windows detection instead of rolling our own + + Sync up `libssh2.h` Windows detection with the libssh2 source code. + + `libssh2.h` was using `WIN32` and `LIBSSH2_WIN32` for Windows detection, + next to the official `_WIN32`. After this patch it only uses `_WIN32` + for this. Also, make it stop defining `LIBSSH2_WIN32`. + + There is a slight chance these break compatibility with Windows + compilers that fail to define `_WIN32`. I'm not aware of any obsolete + or modern compiler affected, but in case there is one, one possible + solution is to define this macro manually. + + Closes #1238 + +- openssl: fix `EC_KEY` reference with OpenSSL 3 `no-deprecated` build + + Fixes: + ``` + src/openssl.c:650:5: error: use of undeclared identifier 'EC_KEY' + EC_KEY *ec_key = EC_KEY_new_by_curve_name(curve); + ^ + src/openssl.c:650:13: error: use of undeclared identifier 'ec_key' + EC_KEY *ec_key = EC_KEY_new_by_curve_name(curve); + ^ + src/openssl.c:650:22: error: implicit declaration of function 'EC_KEY_new_by_curve_name' is invalid in C99 [-Werror,-Wimplicit-function-declaration] + EC_KEY *ec_key = EC_KEY_new_by_curve_name(curve); + ^ + src/openssl.c:650:22: note: did you mean 'EC_GROUP_new_by_curve_name'? + ./quictls/_a64-mac-sys/usr/include/openssl/ec.h:483:11: note: 'EC_GROUP_new_by_curve_name' declared here + EC_GROUP *EC_GROUP_new_by_curve_name(int nid); + ^ + In file included from ./_a64-mac-sys-bld/src/CMakeFiles/libssh2_static.dir/Unity/unity_0_c.c:19: + In file included from src/crypto.c:10: + src/openssl.c:652:8: error: use of undeclared identifier 'ec_key' + if(ec_key) { + ^ + ``` + Ref: https://github.com/curl/curl-for-win/actions/runs/6950001225/job/18909297867#step:3:4341 + + Follow-up to b0ab005fe79260e6e9fe08f8d73b58dd4856943d #1207 + + Bug #1235 + Closes #1236 + +- openssl: formatting + + Sync up these lines with the other two similar occurrences in the code. + + Cherry-picked from #1236 + +GitHub (21 Nov 2023) +- [Michael Buckley brought this change] + + openssl: use non-deprecated APIs with OpenSSL 3.x (#1207) + + Assisted-by: Viktor Szakats + +Viktor Szakats (21 Nov 2023) +- ci: add BoringSSL job (cmake, gcc, amd64) + + Closes #1233 + +- autotools: fix dotless gcc and Apple clang version detections + + - fix parsing dotless (major-only) gcc versions. + Follow-up to 00a3b88c51cdb407fbbb347a2e38c5c7d89875ad #1187 + + - sync gcc detection variable names with curl. + + - fix Apple clang version detection for releases between + 'Apple LLVM version 7.3.0' and 'Apple LLVM version 10.0.1' where the + version was under-detected as 3.7 llvm/clang equivalent. + + - fix Apple clang version detection for 'Apple clang version 11.0.0' + and newer where the Apple clang version was detected, instead of its + llvm/clang equivalent. + + - revert to show `clang` instead of `Apple clang`, because we follow it + with an llvm/clang version number. (Apple-ness still visible in raw + version.) + + Used this collection for Apple clang / llvm/clang translation and test + inputs: https://gist.github.com/yamaya/2924292 + + Closes #1232 + +- acinclude.m4: revert accidental edit [ci skip] + + Follow-up to 8c320a93a48775b74f40415e46f84bf68b4d5ae8 + +- autotools: show more clang/gcc version details + + Also: + - show if we detected Apple clang. + - delete duplicate version detection for clang. + + Closes #1230 + +- acinclude.m4: re-sync with curl [ci skip] + +- autotools: avoid warnings in libtool stub code + + Seen on Windows with clang64, in libtool-generated stub code for + examples and tests. + + The error didn't break the CI job for some reason. + + msys2 (autotools, clang64, clang-x86_64: + ``` + [...] + 2023-11-17T20:14:17.8639574Z ./.libs/lt-test_read.c:91:10: error: macro is not used [-Werror,-Wunused-macros] + [...] + 2023-11-17T20:14:39.8729255Z ./.libs/lt-sftp_write_nonblock.c:91:10: error: macro is not used [-Werror,-Wunused-macros] + [...] + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/6908585056/job/18798193405?pr=1226#step:8:474 + + Follow-up to 7ecc309cd10454c54814b478c4f85d0041da6721 #1224 + + Closes #1227 + +- mbedtls: improve disabling `-Wredundant-decls` + + Disable these warnings specifically for the mbedTLS public headers + and leave it on for the the rest of the code. This also fixes this + issue for autotools. Previous solution was globally disabling this + warning for the whole code when using mbedTLS and only with CMake. + + Follow-up to 7ecc309cd10454c54814b478c4f85d0041da6721 #1224 + + Closes #1226 + +- cmake: rename picky warnings script + + To match the camel-case style used in other CMake scripts and also + to match the name used in curl. + + Closes #1225 + +- build: enable more compiler warnings and fix them + + Enable more picky compiler warnings. I've found these options in the + nghttp3 project when implementing the CMake quick picky warning + functionality for it. + + Fix issues found along the way: + + - wincng, mbedtls: delete duplicate function declarations. + Most of this was due to re-#defining crypto functions to + crypto-backend specific implementations These redefines also remapped + the declarations in `crypto.h`, making the backend-specific + declarations duplicates. + This patch deletes the backend-specific declarations. + + - wincng mapped two crypto functions to the same local function. + Also causing double declarations. + Fix this by adding two disctinct wrappers and moving + the common function to a static one. + + - delete unreachable `break;` statements. + + - kex: disable macros when unused. + + - agent: disable unused constants. + + - mbedtls: disable double declaration warnings because public mbedTLS + headers trigger it. (with function `psa_set_key_domain_parameters`) + + - crypto.h: formatting. + + Ref: https://github.com/ngtcp2/nghttp3/blob/a70edb08e954d690e8fb2c1df999b5a056f8bf9f/cmake/PickyWarningsC.cmake + + Closes #1224 + +- autotools: sync warning enabler code with curl + + Tiny changes and minor updates to bring this code closer + to curl's `m4/curl-compilers.m4`. + + Closes #1223 + +- acinclude.m4: fix indentation [ci skip] + + Also match indentation of curl's `m4/curl-compilers.m4` for + easier syncing. + +- autotool: rename variable + + `WARN` -> `tmp_CFLAGS` + + To match curl and make syncing this code easier. + + Ref: https://github.com/curl/curl/blob/d1820768cce0e797d1f072343868ce1902170e93/m4/curl-compilers.m4#L479 + + Closes #1222 + +- autotools: picky warning options tidy-up + + - sync clang warning version limits with CMake. + - make `WARN=` vs. `CURL_ADD_COMPILER_WARNINGS()` consistent with curl + and between clang and gcc (`WARN=` is for `no-` options in general). + + Closes #1221 + +- build: picky warning updates + + - cmake, autotools: sync picky gcc warnings with curl. + - cmake, autotools: add `-Wold-style-definition` for clang too. + - cmake, autotools: add comment for `-Wformat-truncation=1`. + - cmake: more precise version info for old clang options. + + Closes #1219 + +- ci: fixup FreeBSD version, bump mbedtls + + We haven't been using the FreeBSD version. Also it turns out, + the single version supported is 13.2 at the moment: + https://github.com/vmactions/freebsd-vm/tree/main/conf + + Stop trying to set the version and instead rely on the action + providing the latest supported one automatically. + + Follow-up to a7d2a573be26238cc2b55e5ff6649bbe620cb8d9 + + Also: + - add more details to the FreeBSD job description. + - bump mbedtls version while here. + + Closes #1217 + +- cmake: fix multiple include of libssh2 package + + Also extend our integration test double inclusion. It will still not + catch this case, because that requires + `cmake_minimum_required(VERSION 3.18)` or higher. + + Fixes: + ``` + CMake Error at .../lib/cmake/libssh2/libssh2-config.cmake:8 (add_library): + add_library cannot create ALIAS target "libssh2::libssh2" because another + target with the same name already exists. + Call Stack (most recent call first): + CMakeLists.txt:24 (find_package) + + CMake Error at .../lib/cmake/libssh2/libssh2-config.cmake:13 (add_library): + add_library cannot create ALIAS target "Libssh2::libssh2" because another + target with the same name already exists. + Call Stack (most recent call first): + CMakeLists.txt:24 (find_package) + ``` + + Test to reproduce: + ```cmake + cmake_minimum_required(VERSION 3.18) # must be 3.18 or higher + + project(test) + + find_package(libssh2 CONFIG) + find_package(libssh2 CONFIG) # fails + + add_executable(test main.c) + target_link_libraries(test libssh2::libssh2) + ``` + + Ref: https://cmake.org/cmake/help/latest/release/3.18.html#other-changes + Ref: https://cmake.org/cmake/help/v3.18/policy/CMP0107.html + + Assisted-by: Kai Pastor + Assisted-by: Harry Mallon + Ref: https://github.com/curl/curl/pull/11913 + + Closes #1216 + +- ci: add FreeBSD 13.2 job + + It runs over Linux via qemu. First two runs were (very) slow, then it + became (much) more performant at just 2x slower than a native Linux + build. Then got slow again, then fast again. Still seems acceptable + for the value this adds. + + The build uses autotools and quictls. + + Successful builds: + 1. https://github.com/libssh2/libssh2/actions/runs/6802676786/job/18496286419 (13m59s, -j3) + 2. https://github.com/libssh2/libssh2/actions/runs/6802976375/job/18497243225 (11m5s, -j2) + 3. https://github.com/libssh2/libssh2/actions/runs/6803142201/job/18497785049 (3m6s, -j1) + 4. https://github.com/libssh2/libssh2/actions/runs/6803194839/job/18497962766 (3m10s, -j2) + 5. https://github.com/libssh2/libssh2/actions/runs/6803267201/job/18498208501 (3m13s) + 6. https://github.com/libssh2/libssh2/actions/runs/6803510333/job/18498993698 (15m25s) + 7. https://github.com/libssh2/libssh2/actions/runs/6813602863/job/18528571057 (3m13s) + + Similar solution exists for Solaris (over macOS via VirtualBox), but it + hangs forever at `Waiting for text: solaris console login`: + https://github.com/libssh2/libssh2/actions/runs/6802388128/job/18495391869#step:4:185 + + Idea taken from LibreSSL. + + FIXME: Unrelated, the `distcheck` job became flaky in recent days: + https://github.com/libssh2/libssh2/actions/runs/6802976375/job/18497256437#step:10:536 + ``` + FAIL: test_auth_pubkey_ok_rsa_aes256gcm + ``` + https://github.com/libssh2/libssh2/actions/runs/6813602863/job/18528588933#step:10:533 + ``` + FAIL: test_read + ``` + + Closes #1215 + +- reuse: fix duplicate copyright warning + + ``` + PendingDeprecationWarning: + Copyright and licensing information for 'tests/openssh_server/Dockerfile' + has been found in both 'tests/openssh_server/Dockerfile' and in the DEP5 + file located at '.reuse/dep5'. The information for these two sources has + been aggregated. In the future this behaviour will change, and you will + need to explicitly enable aggregation. [...] + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/6789274955/job/18456085964#step:4:4 + +- Makefile.mk: delete Windows-focused raw GNU Make build + + We recommend using CMake instead. Especially in unity mode, it's faster + and probably more familiar for most. It's also easily portable. + + (`Makefile.mk` was also portable, but in practice only usable for + Windows. Other platforms required a manual config header.) + + Also: + - migrate `LIBSSH2_NO_*` option CI tests to CMake. + - make MSYS2 CMake builds verbose to show compilation options. + + Closes #1204 + +- tidy-up: around `stdint.h` + + - os400: delete unused `HAVE_STDINT_H`. + + - fuzz: delete redundant `stdint.h` use. + `inttypes.h` is already included via `testinput.h`. + + - docs/TODO: adjust type in planned function. + + Closes #1212 + +- cmake: show crypto backend in feature summary + + This was visible as an enabled package before this patch, but it missed + to show WinCNG. + + Closes #1211 + +- man: fix double spaces and dash escaping + + - `- ` -> `- ` + - `. ` -> `. ` + - `\- ` -> `- ` + - `-1` -> `\-1` + - fold long lines along the way + + This makes the minus sign come out as a Unicode minus sign + (0x2212), and title separator dashes as Unicode hyphen (0x2010), + with `groff -Tutf8` v1.23.0. + + Ref: https://lwn.net/Articles/947941/ + + Closes #1210 + +- src: fix gcc 13 `-Wconversion` warning on Darwin + + ``` + src/session.c: In function 'libssh2_poll': + src/session.c:1776:22: warning: conversion from 'long int' to '__darwin_suseconds_t' {aka 'int'} may change value [-Wconversion] + 1776 | tv.tv_usec = (timeout_remaining % 1000) * 1000; + | ^ + ``` + Ref: https://github.com/curl/curl-for-win/actions/runs/6711735060/job/18239768548#step:3:4368 + + Follow-up to 08354e0abbe86d4cc5088d210d53531be6d8981a + + Closes #1209 + +- openssl: silence `-Wunused-value` warnings + + Seen with gcc 12. + + Manual: https://www.openssl.org/docs/man3.1/man3/BIO_reset.html + + ``` + ./quictls/linux-a64-musl/usr/include/openssl/bio.h:555:34: warning: value computed is not used [-Wunused-value] + 555 | # define BIO_reset(b) (int)BIO_ctrl(b,BIO_CTRL_RESET,0,NULL) + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ./libssh2/src/openssl.c:3518:5: note: in expansion of macro 'BIO_reset' + ./libssh2/src/openssl.c:3884:5: note: in expansion of macro 'BIO_reset' + ./libssh2/src/openssl.c:3995:5: note: in expansion of macro 'BIO_reset' + ``` + Ref: https://github.com/curl/curl-for-win/actions/runs/6696392318/job/18194032712#step:3:5060 + + Closes #1205 + +- Makefile.am: fix `cp` to preserve attributes and timestamp + +- cmake: simplify showing CMake version + + Move it to `CMakeLists.txt`. Drop `cmake --version` commands. + + Credit to the `zlib-ng` project for the idea: + https://github.com/zlib-ng/zlib-ng/blob/61e181c8ae93dbf56040336179c9954078bd1399/CMakeLists.txt#L7 + + Closes #1203 + +- ci: mbedtls 3.5.0 + + v3.5.0 needs extra compiler option for i386 to avoid: + ``` + #error "Must use `-mpclmul -msse2 -maes` for MBEDTLS_AESNI_C" + ``` + + Closes #1202 + +- tests: show cmake version used in integration tests + + Closes #1201 + +- readme.vms: fix typo [ci skip] + + Detected by codespell 2.2.6 + +- appveyor: YAML/PowerShell formatting, shorten variable name + + - use single-quotes in yaml and PowerShell. + + - shorten a variable name. + + - use indentation 2 for scripts. + + - use C else-style in PowerShell. + + Closes #1200 + +- ci: update actions, use shallow clones with appveyor + + - update GitHub Actions to their latest versions. + + - use shallow git clones in AppVeyor CI to save data over the wire. + + Closes #1199 + +- appveyor: move to pure PowerShell + + - replace batch commands with PowerShell. + + - merge separate command entries into single PowerShell blocks. + + Closes #1197 + +- windows: use built-in `_WIN32` macro to detect Windows + + Instead of `WIN32`. + + The compiler defines `_WIN32`. Windows SDK headers or build env defines + `WIN32`, or we have to take care of it. The agreement seems to be that + `_WIN32` is the preferred practice here. + + Minor downside is that CMake uses `WIN32` and we also adopted it in + `Makefile.mk`. + + In public libssh2 headers we stick with accepting either `_WIN32` or + `WIN32` and define our own namespaced `LIBSSH2_WIN32` based on them. + + grepping for `WIN32` remains useful to detect Windows-specific code. + + Closes #1195 + +- cmake: cleanup mbedTLS version detection more + + - lowercase, underscored local variables. + - fix `find_library()` to use the multiple names passed. + - rely more on `find_package_handle_standard_args()`. + Logic based on our `Findwolfssl.cmake`. + - delete ignored/unused `MBEDTLS_LIBRARY_DIR`. + - revert CI configuration to use `MBEDCRTYPO_LIBRARY`. + - clarify inputs/outputs in comment header. + - use variable for regex. + - formatting. + + Follow-up to 41594675072c578294674230d4cf5f47fa828778 #1192 + + Closes #1196 + +- cmake: delete duplicate `include()` + +- cmake: improve/fix mbedTLS detection + + - libssh2 needs the crypto lib only, stop dealing with the rest. + + - simplify logic. + + - drop hard-wired toolchain specific options that broke with e.g. MSVC. + + Reported by: AR Visions + Fixes #1191 + + - add mbedTLS version detection for recent releases. + + - merge custom detection results display into a single line. + + - shorten mbedTLS configuration in macOS CI job. + + Used the curl mbedTLS detection logic for ideas: + https://github.com/curl/curl/blob/a8c773845f4fdbfb09b08a6ec4b656c812568995/CMake/FindMbedTLS.cmake + + Closes #1192 + +GitHub (24 Sep 2023) +- [concussious brought this change] + + libssh2_session_get_blocking.3: Add description (#1185) + +Viktor Szakats (21 Sep 2023) +- autotools: fix selecting wincng in cross-builds (and more) + + - Fix explicitly selecting WinCNG in autotools cross-builds by moving + `windows.h` header check before the WinCNG availability check. + Follow-up to d43b8d9b0b9cd62668459fe5d582ed83aabf77e7 + + Reported-by: Jack L + Fixes #1186 + + - Add Linux -> mingw-w64 cross-builds for autotools and CMake. This + doesn't detect #1186, because that happened when explicitly specifying + WinCNG via `--with-crypto=wincng`, but not when falling back to WinCNG + by default. + + - autotools: fix to strip suffix from gcc version + + Before this patch we expected `n.n` `-dumpversion` output, but Ubuntu + may return `n-win32` (also with `-dumpfullversion`). Causing these + errors and failing to enable picky warnings: + ``` + ../configure: line 23845: test: : integer expression expected + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/6263453828/job/17007893718#step:5:143 + + Fix that by stripping any dash-suffix. + + gcc version detection is still half broken because we translate '10' + to '10.10' because `cut -d. -f2` returns the first word if the + delimiter missing. + + More possible `-dumpversion` output: `10-posix`, `10-win32`, + `9.3-posix`, `9.3-win32`, `6`, `9.3.0`, `11`, `11.2`, `11.2.0` + Ref: https://github.com/mamedev/mame/pull/9767 + + Closes #1187 + +GitHub (28 Aug 2023) +- [Michael Buckley brought this change] + + Properly bounds check packet_authagent_open() (#1179) + + * Properly bounds check packet_authagent_open + * packet.c: use strlen instead of sizeof for strings + * Make LIBSSH_CHANNEL's channel_type_len a size_t + * packet_authagent_open: use size_t for offset + + Credit: + Michael Buckley, signed off by Will Cosgrove + +Viktor Szakats (28 Aug 2023) +- os400qc3: move FIXME comment [ci skip] + + Follow-up to eb9f9de2c19ec67d12a444cce34bdd059fd26ddc + +- md5: allow disabling old-style encrypted private keys at build-time + + Before this patch, this happened at runtime when using an old (pre-3.0), + FIPS-enabled OpenSSL backend. + + This patch makes it possible to disable this via the build-time option + `LIBSSH2_NO_MD5_PEM`. + + Also: + - make sure to exclude all MD5 internal APIs when both the above and + `LIBSSH2_NO_MD5` are enabled. + - fix tests to support build with`LIBSSH2_NO_MD5`, `LIBSSH2_NO_MD5_PEM` + and `LIBSSH2_NO_3DES`. + - add FIXME to apply this change to `os400qc3.*`. + + Old-style encrypted private keys require MD5 and they look like this: + ``` + -----BEGIN RSA PRIVATE KEY----- + Proc-Type: 4,ENCRYPTED + DEK-Info: AES-128-CBC, + + + -----END RSA PRIVATE KEY----- + ``` + + E.g.: `tests/key_rsa_encrypted` + + Ref: https://github.com/libssh2/www/issues/20 + Closes #1181 + +- cmake: tidy-up `foreach()` syntax + + Use `IN LISTS` and `IN ITEMS`. This appears to be the preferred way + within CMake's own source code and possibly improves readability. + + Fixup a side-effect of `IN LISTS`, where it retains empty values at + the end of the list, as opposed to the syntax used before, which + dropped it. In our case this happened with lines read from a text + file via `file(READ)`. + + https://cmake.org/cmake/help/v3.7/command/foreach.html + + Closes #1180 + +- ci: replace `mv` + `chmod` with `install` in `Dockerfile` + + Cherry-picked from #1175 + Closes #1175 + +- ci: set file mode early in `appveyor_docker.yml` + + Also: + - replace tab with spaces in generated config file + - formatting + + Cherry-picked from #1175 + +- ci: add spellcheck (codespell) + + Also rename a variable in `src/os400qc3.c` to avoid a false positive. + + Cherry-picked from #1175 + +- cmake: also test for `libssh2_VERSION` + + Cherry-picked from #1175 + +- cmake: show cmake versions in ci + + Cherry-picked from #1175 + +- tests: formatting and tidy-ups + + - Dockerfile: use standard sep with `sed` + - Dockerfile: use single quotes in shell command + - appveyor.yml: use long-form option with `choco` + - tests/cmake: add language to test project + - reuse.yml: fix indentation + ``` + $ yamllint reuse.yml + reuse.yml + [...] + 11:5 error wrong indentation: expected 6 but found 4 (indentation) + 15:5 error wrong indentation: expected 6 but found 4 (indentation) + [...] + 27:5 error wrong indentation: expected 6 but found 4 (indentation) + ``` + + Cherry-picked from #1175 + +- openssl.c: whitespace fixes + + Cherry-picked from #1175 + +- checksrc: fix spelling in comment [ci skip] + +- cmake: quote more strings + + Follow-up to 3fa5282d6284efba62dc591697e6a687152bdcb1 + + Closes #1173 + +- drop `www.` from `www.libssh2.org` + + is now a 301 permanent redirect to + . + + Update all references to point directly to the new destination. + + Ref: https://github.com/libssh2/www/commit/ccf4a7de7f702a8ee17e2c697bcbef47fcf485ed + + Closes #1172 + +- cmake: add `ExternalProject` integration test + + - via `ExternalProject_Add()`: + https://cmake.org/cmake/help/latest/module/ExternalProject.html + (as documented in `docs/INSTALL_CMAKE.md`) + + - also make `FetchContent` fetch from local repo instead of live master. + + Closes #1171 + +- cmake: add integration tests + + Add a small project to test dependent/downstream CMake build using + libssh2. Also added to the GHA CI, and you can also run it locally with + `tests/cmake/test.sh`. + + Test three methods of integrating libssh2 into a project: + - via `find_package()`: + https://cmake.org/cmake/help/latest/command/find_package.html + - via `add_subdirectory()`: + https://cmake.org/cmake/help/latest/command/add_subdirectory.html + - via `FetchContent`: + https://cmake.org/cmake/help/latest/module/FetchContent.html + + Closes #1170 + +- cmake: (re-)add aliases for `add_subdirectory()` builds + + Add internal libssh2 library aliases to make these available for + downstream/dependent projects building libssh2 via `add_subdirectory()`: + + - `libssh2:libssh2_static` + - `libssh2:libssh2_shared` + - `libssh2:libssh2` (shared, or static when not building shared) + - `libssh2` (shared, or static when not building shared) + + Of these, `libssh2` was present in v1.10.0 and earlier releases, but + missing from v1.11.0. + + Closes #1169 + +- cmake: delete empty line [ci skip] + + Follow-up to 3fa5282d6284efba62dc591697e6a687152bdcb1 + +- cmake: reflect minimum version in docs [ci skip] + + Follow-up to 9cd18f4578baa41dfca197f60557063cad12cd59 + +- cmake: style tidy up + + - quote text literals to improve readability. + (exceptions: `FILES` items, `add_subdirectory` names, `find_package` + names, literal target names, version numbers, 0/1, built-in CMake + values and CMake keywords, list items in `cmake/max_warnings.cmake`) + - quote standalone variables that could break syntax on empty values. + - replace `libssh2_SOURCE_DIR` with `PROJECT_SOURCE_DIR`. + - add missing mode to `message()` call. + - `TRUE`/`FALSE` → `ON`/`OFF`. + - add missing default value `OFF` to `option()` for clarity. + - unfold some lines. + - `INSTALL_CMAKE.md` fixes and updates. Show defaults. + + Closes #1166 + +- wincng: prefer `ULONG`/`DWORD` over `unsigned long` + + To match with the types used by the `Crypt*()` (uses `DWORD`) and + `BCrypt*()` (uses `ULONG`) Windows APIs. + + This patch doesn't change data width or signedness. + + Closes #1165 + +- wincng: tidy-ups + + - make `_libssh2_wincng_key_sha_verify` static. + + - prefer `unsigned long` over `size_t` in two static functions. + + - prefer `ULONG` over `DWORD` to match `BCryptImportKeyPair()` + and `BCryptGenerateKeyPair()`. + + - add a newline. + + Closes #1164 + +- ci: add MSYS builds (autotools and cmake) + + Use existing MSYS2 section and extend it with builds for the MSYS + environment with both autotools and cmake. + + MSYS builds resemble Cygwin ones: The env is Unixy, where Windows + headers are all available but we don't use them. + + Also: + + - extend existing autotools logic for Cygwin to skip detecting + `windows.h` for MSYS targets too. + + - require `windows.h` for the WinCNG backend in autotools. Before this + patch, autotools allowed selecting WinCNG on the Cygwin and MSYS + platforms, but the builds then fell apart due to the resulting mixed + Unixy + Windowsy environment. The general expectation for Cygwin/MSYS + builds is not to use the Windows API directly in them. + + - stop manually selecting the `MSYS Makefiles` CMake generator for + MSYS2-based GHA CI builds. mingw-w64 builds work fine without it, but + it broke MSYS build which use `Unix Makefiles`. Deleting this setting + fixes all build flavours. + + Closes #1162 + +- ci: cygwin job tidy-ups + + `CMAKE_C_COMPILER=gcc` not necessary, delete it. + + Follow-up to f1e96e733fefb495bc31b07f5c2a5845ff877c9c + + Cherry-picked from #1163 + Closes #1163 + +- ci: add Cygwin builds (autotools and cmake) + + To avoid builds picking up non-Cygwin components coming by default with + the CI machine, I used the solution recommended by Cygwin [1] and set + `PATH` manually. To avoid repeating this for each step, I merged steps + into a single one. Let us know if there is a more elegant way. + + Cygwin's Github Action uses cleartext HTTP. We upgrade this to HTTPS. + + autotools build seemed to take slightly longer than other jobs. To save + turnaround time I disabled building tests. + + Cygwin package search: https://cygwin.com/cgi-bin2/package-grep.cgi + + [1] https://github.com/cygwin/cygwin-install-action/tree/v4#path + + Closes #1161 + +- cmake: add `LIB_NAME` variable + + It holds the name `libssh2`. Mainly to document its uses, and also + syncing up with the same variable in libcurl. + + Closes #1159 + +- cmake: add one missed `PROJECT_NAME` variable + + Follow-up to 72fd25958a7dc6f8e68f2b2d5d72839a2da98f9c + + Closes #1158 + +- cmake: tidy-up concatenation in `CMAKE_MODULE_PATH` + + Former solution was appending an empty element to the array if + `CMAKE_MODULE_PATH` was originally empty. The new syntax doesn't have + this side-effect. + + There is no known issue caused by this. Fixing it for good measure. + + Closes #1157 + +- ci: add mingw-w64 UWP build + + Add a CI test for Windows UWP builds using mingw-w64. Before this patch + we had UWP builds tested with MSVC only. + + Alike existing UWP jobs, it's not possible to run the binaries due to + the missing UWP runtime DLL: + https://github.com/libssh2/libssh2/actions/runs/5821297010/job/15783475118#step:11:42 + + We could install `winstorecompat-git` in the setup-msys2 step, but opted + to do it manually to avoid the overhead for every matrix job. + + All this would work smoother with llvm-mingw, which features an UWP + toolchain prefix and provides all necessary implibs by default. + + This also hit a CMake bug (with v3.26.4), where CMake gets confused and + sets up `windres.exe` to use the MSVC rc.exe-style command-line: + https://github.com/libssh2/libssh2/actions/runs/5819232677/job/15777236773#step:9:126 + + Notice that MS "sunset" UWP in 2021: + https://github.com/microsoft/WindowsAppSDK/discussions/1615 + + If this particular CI job turns out to be not worth the maintenance + burden or CPU time, or too much of a hack, feel free to delete it. + + Ref: https://github.com/libssh2/libssh2/pull/1147#issuecomment-1670850890 + Closes #1155 + +- cmake: replace `libssh2` literals with `PROJECT_NAME` variable + + Where applicable. + + This also makes it more obvious which `libssh2` uses were referring + to the project itself. + + Closes #1152 + +- cmake: fix `STREQUAL` check in error branch + + This caused a CMake error instead of our custom error when manually + selecting the `WinCNG` crypto-backend for a non-Windows target. + + Also cleanup `STREQUAL` checks to use variable name without `${}` on + the left side and quoted string literals on the right. + + Closes #1151 + +- misc: flatten `_libssh2_explicit_zero` if tree + + Closes #1149 + +- src: drop a redundant `#include` + + We include `misc.h` via `libssh2_priv.h` already. + + Closes #1153 + +- openssl: use automatic initialization with LibreSSL 2.7.0+ + + Stop calling `OpenSSL_add_all_*()` for LibreSSL 2.7.0 and later. + + LibreSSL 2.7.0 (2018-03-21) introduced automatic initialization and + deprecated these functions. Stop calling these functions manually for + LibreSSL version that no longer need them. + + Ref: https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.7.0-relnotes.txt + Ref: https://github.com/libressl/openbsd/commit/46f29f11977800547519ee65e2d1850f2483720b + Ref: https://github.com/libssh2/libssh2/issues/302 + + Also stop calling `ENGINE_*()` functions when initialization is + automatic with LibreSSL 2.7.0+ and OpenSSL 1.1.0+. Engines are also + initializated automatically with these. + + Closes #1146 + +- gha: restore curly braces in `if` + + Without curly braces it was less obvious which string is a GHA expression. + + Also fix an `if` expression that always missed its curly braces. + + Reverts cab3db588769d6deed97ba89ca9221fd7503405e + + Closes #1145 + +- ci: bump mbedtls + +- [renmingshuai brought this change] + + Add a new structure to separate memory read and file read. + We use different APIs when we read one private key from memory, + so it is improper to store the private key information in the + structure that stores the private key file information. + + Fixes https://github.com/libssh2/libssh2/issues/773 + Reported-by: mike-jumper + +- tests: replace FIXME with comments + + `key_dsa_wrong` is the same kind of (valid) key as `key_dsa`, both with + an empty passphrase. Named "wrong" because it's intentionally not added + to our `openssh_server/authorized_keys` file. + +- tidy-up: delete duplicate word from comment + +- cmake: cache more config values on Windows + + Set two cases of non-detection to save the time dynamically detecting + these on each build init. Affects old MSVC versions. + + Before: + https://ci.appveyor.com/project/libssh2org/libssh2/builds/47668870/job/i17e0e9yx8rgpv4i + + After: + https://ci.appveyor.com/project/libssh2org/libssh2/builds/47674950/job/ysa1jq0pxtyhui3f + + Closes #1142 + +- revert: build: respect autotools `DLL_EXPORT` in `libssh2.h` + + Revert fb1195cf88268a11e2709b9912ab9dca8c23739c #917 + + On a second look this change did not improve anything with autotools + builds. autotools seems to handle the dll export matter without it. + + This patch also broke (e.g.) curl-for-win autotools builds, where the + curl build defines `DLL_EXPORT` while building libcurl DLL. `libssh2.h` + picks it up, resulting in unresolved symbols while trying to link a + static libssh2 on Windows. The best fix seems to be to revert this, + instead of adding extra tweaks to dependents. + + Fixes: + https://ci.appveyor.com/project/curlorg/curl-for-win/builds/47667412#L11035 + ``` + ld.lld-15: error: undefined symbol: __declspec(dllimport) libssh2_session_block_directions + >>> referenced by vssh/.libs/libcurl_la-libssh2.o:(ssh_do) + >>> referenced by vssh/.libs/libcurl_la-libssh2.o:(ssh_connect) + >>> referenced by vssh/.libs/libcurl_la-libssh2.o:(ssh_multi_statemach) + >>> referenced 8 more times + + ld.lld-15: error: undefined symbol: __declspec(dllimport) libssh2_session_init_ex + >>> referenced by vssh/.libs/libcurl_la-libssh2.o:(ssh_connect) + + ld.lld-15: error: undefined symbol: __declspec(dllimport) libssh2_session_set_read_timeout + [...] + ``` + + Closes #1141 + +- gha: simplify `if` strings + + Closes #1140 + +- test_read: make it run without Docker + + Apply an existing fix to `test_read`, so that it falls back to use + the current username instead of the hardcoded `libssh2` when run + outside Docker. + + This allows to run algo tests with this command: + ```shell + cd tests + ./test_sshd.test ./test_read_algos.test + ``` + + Closes #1139 + +- cmake: streamline invocation + + Stop specifiying the current directory. + Simplify build instructions. + + Closes #1138 + +- NMakefile: delete + + This make file was for long time unmaintained (last updated in 2014). + Despite best efforts to keep it working in the recent round of major + overhauls, it appears to be broken now. There is also no way to test it + without an actual MSVC env and it's also missing from our CI. Based on + our Issue tracker, it's also not widely used. + + Since its addition in 2005, libssh2 got support for CMake in 2014. + CMake should be able to generate NMake makefiles with the option + `-G "NMake Makefiles"`. (I haven't tested this.) + + Ref: https://github.com/libssh2/libssh2/discussions/1129 + Closes #1134 + +- tests: add aes256-gcm encrypted key test + + Follow-up to #1133 + + Also update `tests/gen_keys.sh` to set `aes256-ctr` encryption method + for `key_ed25519_encrypted' explicitly. + + Closes #1135 + +GitHub (26 Jul 2023) +- [Jakob Egger brought this change] + + Fix private keys encrypted with aes-gcm methods (#1133) + + libssh2 1.11.0 fails to decrypt private keys encrypted with + aes128-gcm@openssh.com and aes256-gcm@openssh.com ciphers. + + To reproduce the issue, you can create a test key with a command like + the following: + + ```bash + ssh-keygen -Z aes256-gcm@openssh.com -f id_aes256-gcm + ``` + + If you attempt to use this key for authentication, libssh2 returns the + not-so-helpful error message "Wrong passphrase or invalid/unrecognized + private key file format". + + The problem is that OpenSSH encrypts keys differently than packets. It + does not include the length as AAD, and the 16 byte authentication tag + is appended after the encrypted key. The length of the authentication + tag is not included in the encrypted key length. + + I have not found any documentation for this behaviour -- I discovered it + by looking at the OpenSSH source. See the `private2_decrypt` function in + . + + This patch fixes the code for reading OpenSSH private keys encrypted + with AES-GCM methods. + +Viktor Szakats (26 Jul 2023) +- ci: add missing timeout to 'autotools distcheck' step + +- cmake: merge `set_target_properties()` calls + + Also rename variable `LIBSSH2_VERSION` to `LIBSSH2_LIBVERSION` in + context of lib versioning to avoid collision with another use. + + Closes #1132 + +- cmake: formatting [ci skip] + +- cmake: (re-)add zlib to `Libs.private` in `libssh2.pc` + + We mistakently added transitive zlib to `Requires.private` before, then + removed it. This patch re-adds zlib, but this time to `Libs.private`, + which is listing raw libs and should include transitive libs as well. + + Also add zlib when used as a direct dependency when zlib compression + support is enabled. + + Follow-up to ef538069a661a43134fe7b848b1fe66b2b43bdac + + Closes #1131 + +- cmake: formatting [ci skip] + +- cmake: use `wolfssl/options.h` for detection, like autotools + + Closes #1130 + +- build: stop requiring libssl from openssl + + libssh2 does not use or need the TLS/SSL library of OpenSSL. + It only needs libcrypto. + + Closes #1128 + +- cmake: add openssl libs to `Libs.private` in `libssh2.pc` + + Also to sync up with autotools-generated `libssh2.pc`, that + already added them. + + Closes #1127 + +- Makefile.mk: stop linking unused mbedtls libs + + Stop linking libmbedtls and libmbedx509 (similarly to autotools). + Only libmbedcrypto is necessary for libssh2. + +- cmake: bump minimum CMake version to v3.7.0 + + Fixes the warning below, which appeared in CMake v3.27.0: + ``` + CMake Deprecation Warning at CMakeLists.txt:39 (cmake_minimum_required): + Compatibility with CMake < 3.5 will be removed from a future version of + CMake. + + Update the VERSION argument value or use a ... suffix to tell + CMake that the project does not need compatibility with older versions. + ``` + + Bump straight up to v3.7.0 to sync up with the curl project: + https://github.com/curl/curl/blob/2900c29218d2d24ab519853589da84caa850e8c7/CMakeLists.txt#L64 + + CMake release dates: + v3.7.0 2016-11-11 + v3.5.0 2016-03-08 + v3.1.0 2014-12-17 + + Closes #1126 + +- build: tidy-up `libssh2.pc.in` variable names + + - prefix with `LIBSSH2_PC_` + + - match with the names of `pkg-config` values. + + - use the same names in autotools and CMake scripts. + + - use `LIBSSH2_VERSION` for the version number in autotools scripts, + to match the name used in CMake. + + Closes #1125 + +- libssh2.pc: re-add & extend support for static-only libssh2 builds + + Adapted for libssh2 from the curl commit message by James Le Cuirot: + + "A project built entirely statically will call `pkg-config` with + `--static`, which utilises the `Libs.private:` field. Conversely it will + not use `--static` when not being built entirely statically, even if + there is only a static build of libssh2 available. This will most + likely cause the build to fail due to underlinking unless we merge the + `Libs:` fields. + + Consider that this is what the Meson build system does when it generates + `pkg-config` files." + + This patch extends the above to `Requires:`, to mirror `Libs:` with + `pkg-config` package names. + + Follow-up to 1209c16d93cba3c5e0f68c12fa4a5049f49c00d8 #1114 + + Ref: https://github.com/libssh2/libssh2/pull/1114#issuecomment-1634334809 + Ref: https://github.com/curl/curl/commit/98e5904165859679cd78825bcccb52306ee3bb66 + Ref: https://github.com/curl/curl/pull/5373 + Closes #1119 + +GitHub (14 Jul 2023) +- [Nursan Valeyev brought this change] + + cmake: CMAKE_SOURCE_DIR -> PROJECT_SOURCE_DIR (#1121) + + Fixes compiling as dependency with FetchContent + + Co-authored-by: Viktor Szakats + +Viktor Szakats (14 Jul 2023) +- autotools: use comma separator in `Requires.private` of `libssh2.pc` + + In `Requires*:`, the documented name separator is comma. We already used + it in the CMake-generated `libssh2.pc`. Adjust the autotools-generated + one to use it too, instead of spaces. + + Ref: https://linux.die.net/man/1/pkg-config + Ref: https://gitlab.freedesktop.org/pkg-config/pkg-config/-/blob/d97db4fae4c1cd099b506970b285dc2afd818ea2/pkg-config.1 + + Closes #1124 + +- build: add/fix `Requires.private` packages in `libssh2.pc` + + - autotools was using `libwolfssl`. CMake left it empty. wolfSSL + provides `wolfssl.pc`. This patch sets `Requires.private: wolfssl` + with both build tools. + + - add `libgcrypt` to `Requires.private` with both autotools and CMake. + Ref: + https://github.com/gpg/libgcrypt/blob/e76e88eef7811ada4c6e1d57520ba8c439139782/src/libgcrypt.pc.in + Present since 2005-04-22: + https://github.com/gpg/libgcrypt/commit/32bf3f13e8b45497322177645bebf0b5d0c9cb8e + Released in v1.3.0 2007-05-04: + https://github.com/gpg/libgcrypt/releases/tag/libgcrypt-1.3.0 + + - also stop adding transitive `zlib` deps to `Requires.private`. + The referenced crypto package is adding it as nedded. + This makes deduplication of the list redundant, so stop doing it. + Follow-up to 2fc367900701e6149efc42bd674c4b69127756dd + + (`libssh2.pc` not tested as a project dependency.) + + Closes #1123 + +- cmake: tidy-ups + + - dedupe `Requires.private` in `libssh2.pc`. + `zlib` could appear on the list twice: + ``` + Requires.private: libssl,libcrypto,zlib,zlib + ``` + According to CMake docs `list(REMOVE_DUPLICATES ...)`, is supported by + our minimum required CMake version (and by earlier ones even): + https://cmake.org/cmake/help/v3.1/command/list.html#remove-duplicates + + - move `cmake_minimum_required()` to the top. + + - move `set(CMAKE_MODULE_PATH)` to the top. + + - delete duplicate `set(CMAKE_MODULE_PATH)`. + + - replace `CMAKE_CURRENT_SOURCE_DIR` with `PROJECT_SOURCE_DIR` in root + `CMakeLists.txt` for robustness. + + - replace `gcovr` option with long-form for readability/consistency. + + - rename `GCOV_OPTIONS` to `GCOV_CFLAGS`. These are C options we enable + when using gcov, not gcov tooling options. + + Closes #1122 + +- openssl: add missing check for `LIBRESSL_VERSION_NUMBER` before use + + Fixes: + ``` + openssl.h:101:5: warning: "LIBRESSL_VERSION_NUMBER" is not defined [-Wundef] + LIBRESSL_VERSION_NUMBER >= 0x3050000fL + ^ + ``` + + Ref: https://github.com/libssh2/libssh2/issues/1115#issuecomment-1631845640 + Closes #1117 + +- [Harmen Stoppels brought this change] + + Don't put `@LIBS@` in pc file + +- misc: delete redundant NULL check and assignment + + Follow-up to 724effcb47ebb713d3ef1776684b8f6407b4b6a5 #1109 + + Ref: https://github.com/libssh2/libssh2/pull/1109#discussion_r1246613274 + Closes #1111 + +- [renmingshuai brought this change] + + We should check whether *key_method is a NULL pointer instead of key_method + + Signed-off-by: renmingshuai + +GitHub (30 Jun 2023) +- [ren mingshuai brought this change] + + Add NULL pointer check for outlen before use (#1109) + + Before assigning a value to the outlen, we need to check whether it is NULL. + + Credit: Ren Mingshuai + +Viktor Szakats (25 Jun 2023) +- cmake: re-add `Libssh2:libssh2` for compatibiliy + lowercase namespace + + - add `libssh2:libssh2` target that selects the shared lib if built, + otherwise the static one. + + - re-add `Libssh2:libssh2` target for compatibility with v1.10.0 and + earlier. This is an alias for `libssh2:libssh2`. + + - keep `libssh2:libssh2_shared` and `libssh2_libssh2_static` targets. + + - allow using `find_package(libssh2)` in dependents as an alternative + to `find_package(Libssh2)`. + + Co-authored-by: Radek Brich + Suggested-by: Haowei Hsu + + Fixes #1103 + Fixes #731 + Closes #1104 + +- example: fix regression in `ssh2_exec.c` + + Regression from b13936bd6a89993cd3bf4a18317ca5bd84bb08d7 #861 #846. + Update a variable name missed above. + + Reported-by: PewPewPew + Fixes #1105 + Closes #1106 + +- docs: replace SHA1 with SHA256 in CMake example + +- checksrc: modernise perl file open + + Use regular variables and separate file open modes from filenames. + + Suggested by perlcritic + + Copied from https://github.com/curl/curl/commit/7f669aa0f1d40ef5d64543981f22bdc5af1272f5 + Copied from https://github.com/curl/trurl/commit/f2784a9240f47ee28a845 + +- reuse: comply with 3.1 spec and 2.0.0 checker + + The checker tool was upgraded upstream to 2.0.0 and the REUSE + Specification to version 3.1 (from 3.0), causing these new errors: + ``` + reuse.project - WARNING - Copyright and licensing information for 'docs/INSTALL_AUTOTOOLS' have been found in 'docs/INSTALL_AUTOTOOLS' and the DEP5 file located at '.reuse/dep5'. The information in the DEP5 file has been overridden. Please ensure that this is correct. + reuse.project - WARNING - Copyright and licensing information for 'tests/openssh_server/Dockerfile' have been found in 'tests/openssh_server/Dockerfile' and the DEP5 file located at '.reuse/dep5'. The information in the DEP5 file has been overridden. Please ensure that this is correct. + + The following files have no licensing information: + * docs/INSTALL_AUTOTOOLS + * tests/openssh_server/Dockerfile + ``` + Via: https://github.com/libssh2/libssh2/actions/runs/5333572682/jobs/9664211341?pr=1098#step:4:4 + + Ref: https://github.com/fsfe/reuse-tool/releases/tag/v2.0.0 + Ref: https://git.fsfe.org/reuse/docs/src/branch/stable/CHANGELOG.md#3-1-2023-06-21 + + Original discovery: https://github.com/libssh2/libssh2/pull/1098#issuecomment-1600719575 + + Fixes #1101 + Closes #1102 + +- tests: trap signals in scripts + + Closes #1098 + +- test_sshd.test: fixup to distcheck failure + + Fixes: + ``` + ERROR: test_sshd.test - missing test plan + ERROR: test_sshd.test - exited with status 1 + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/5322354271/jobs/9638694218#step:10:532 + + Caused by trying to create the log file in a read-only directory. + + Follow-up to 299c2040625830d06ad757d687807a166b57d6de + Closes #1099 + +GitHub (21 Jun 2023) +- [Viktor Szakats brought this change] + + test_sshd.test: show sshd and test connect logs on harness failure (#1097) + +- [Joel Depooter brought this change] + + Fix incorrect byte offset in debug message (#1096) + + Fixes debug log message + + Credit: + Joel Depooter + +Viktor Szakats (16 Jun 2023) +- tidy-up: delete whitespace at EOL [ci skip] + +- mbedtls: include `version.h` for `MBEDTLS_VERSION_NUMBER` + + Older (2021 or earlier?) mbedTLS releases require this. + + Reported-by: rahmanih on Github + Fixes #1094 + Closes #1095 + +- hostkey: do not advertise ssh-rsa when SHA1 is disabled + + Before this patch OpenSSL, mbedTLS, WinCNG and OS/400 advertised both + SHA2 and SHA1 host key algos, even when SHA1 was not supported by the + crypto backend or when forcefully disabled via `LIBSSH2_NO_RSA_SHA1`. + + Reported-by: João M. S. Silva + Fixes #1092 + Closes #1093 + +- openssl.h: whitespace tidy-up [ci skip] + +GitHub (14 Jun 2023) +- [Dan Fandrich brought this change] + + test_sshd.test: set a safe PID directory (#1089) + + The compiled in default to sshd can be a non-writable location since it + expects to be run as root. + +Viktor Szakats (13 Jun 2023) +- mingw: fix printf mask for 64-bit integers + + Before 02f2700a61157ce5a264319bdb80754c92a40a24 #846 #876, we used + `%I64d'. That patch changed this to `%lld`. This patch uses `PRId64` + (defined in `inttypes.h`). + + Fixes #1090 + Closes #1091 + +- test_sshd.test: minor cleanups + +Daniel Stenberg (7 Jun 2023) +- provide SPDX identifiers + + - All files have prominent copyright and SPDX identifier + - If not embedded in the file, in the .reuse/dep5 file + - All used licenses are in LICENSES/ (not shipped in tarballs) + - A new REUSE CI job verify that all files are OK + + Assisted-by: Viktor Szakats + + Closes #1084 + +Viktor Szakats (6 Jun 2023) +- src: improve MSVC C4701 warning fix + + Simplify the code to avoid this warning. This might also help avoiding + it with other compilers (e.g. gcc?). + + Improves 02f2700a61157ce5a264319bdb80754c92a40a24 #876 + Might fix #1083 + Closes #1086 + +Daniel Stenberg (5 Jun 2023) +- configure.ac: remove AB_INIT + + Not used. Remove m4/autobuild.m4 as well + +Viktor Szakats (4 Jun 2023) +- copyright: remove years from copyright headers + + Also: + - uppercase `(C)`. + - add missing 'All rights reserved.' lines. + - drop duplicate 'Author' lines. + - add copyright headers where missing. + - enable copyright header check in checksrc. + + Reasons for deleting years (copied as-is from curl): + - they are mostly pointless in all major jurisdictions + - many big corporations and projects already don't use them + - saves us from pointless churn + - git keeps history for us + - the year range is kept in COPYING + + Closes #1082 + +- tests: cast to avoid `-Wchar-subscripts` with Cygwin + + ``` + In file included from $HOME/src/cygwin/libssh2/libssh2-1.11.0-1.x86_64/src/libssh2-1.11.0/tests/openssh_fixture.c:57: + $HOME/src/cygwin/libssh2/libssh2-1.11.0-1.x86_64/src/libssh2-1.11.0/tests/openssh_fixture.c: In function 'run_command_varg': + $HOME/src/cygwin/libssh2/libssh2-1.11.0-1.x86_64/src/libssh2-1.11.0/tests/openssh_fixture.c:136:37: warning: array subscript has type 'char' [-Wchar-subscripts] + 136 | while(end > 0 && isspace(buf[end - 1])) { + | ~~~^~~~~~~~~ + ``` + Ref: https://github.com/libssh2/libssh2/files/11644340/cygwin-x86_64-libssh2-1.11.0-1-check.log + + Reported-by: Brian Inglis + Fixes #1080 + Closes #1081 + +- tidy-up: avoid exclamations, prefer single quotes, in outputs + + Closes #1079 + +- autotools: improve libz position + + We repositioned crypto libs in 4f0f4bff5a92dce6a6cd7a5600a8ee5660402c3f + via #941 and subsequently in d4f58f03438e326b8696edd31acadd6f3e028763 + from d93ccf4901ef26443707d341553994715414e207 via #1013. + + This patch moves libz accordingly, to unbreak certain build scenarios. + + Reported-by: Kenneth Davidson + Regression from 4f0f4bff5a92dce6a6cd7a5600a8ee5660402c3f #941 + Fixes #1075 + Closes #1077 + +- src: bump `hash_len` to `size_t` in `LIBSSH2_HOSTKEY_METHOD` + + Follow-up to 7b8e02257f01a6dac5f65305b18bb74a157fb5c4 + Closes #1076 + +- ci: add non-static autotools i386 build, ignore GHA updates on AppVeyor + + Add a non-static autotools build to GitHub Actions. Make this build + target i386 and libgcrypt, to test a new build combination if we are at + it. + + Also: + - GHA: add necessary generic bits for i386 autotools builds. + - AppVeyor CI: teach it to ignore commits updating our GHA config. + + Follow-up to 572c57c9d8d4e89cfce19dde40125d55481256d1 #1072 + Closes #1074 + +GitHub (31 May 2023) +- [Xi Ruoyao brought this change] + + autotools: skip tests requiring static lib if `--disable-static` (#1072) + + Co-authored-by: Viktor Szakats + Regression from 83853f8aea0e2f739cacd491632eb7fd3d03ad2d #663 + Fixes #1056 + +Viktor Szakats (31 May 2023) +- ci: prefer `=` operator in shell snippets + + Closes #1073 + +- src: bump DSA and ECDSA sign `hash_len` to `size_t` + + Closes #1055 + +- scp: fix missing cast for targets without large file support + + E.g. on 32-bit Linux. Issue revealed after adding i386 Linux CI build + in abdf40c741c575f94bdea1c67a9d1182ff813ccb #1057. + + ``` + /home/runner/work/libssh2/libssh2/src/scp.c: In function 'scp_recv': + /home/runner/work/libssh2/libssh2/src/scp.c:765:23: error: conversion from 'libssh2_int64_t' {aka 'long long int'} to '__off_t' {aka 'long int'} may change value [-Werror=conversion] + 765 | sb->st_size = session->scpRecv_size; + | ^~~~~~~ + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/5126803482/jobs/9221746299?pr=1054#step:12:51 + + Regression from 5db836b2a829c6fff1e8c7acaa4b21b246ae1757 #1002 + Closes #1060 + +- mbedtls.h: formatting [ci skip] + + For consistency with `mbedtls.c`. + + Follow-up to 1153ebdeba563ac657b525edd6bf6da68b1fe5e2 + +- libssh2.h: bump to 1.11.1_DEV [ci skip] + +- mbedtls: use more `size_t` to sync up with `crypto.h` + + Ref: 5a96f494ee0b00282afb2db2e091246fc5e1774a #846 #879 + + Fixes #1053 + Closes #1054 + +- ci: drop redundant/unused vars, sync var names + + Closes #1059 + +- ci: add i386 Linux build (with mbedTLS) + + Also: + - reorder Linux build matrix to make build tool more visible. + - hide apt-get progress bar. + - prepare package install step for i386 builds. + + Detects bug #1053 + Closes #1057 + +- checksrc: switch to dot file + + Closes #1052 + +Version 1.11.0 (30 May 2023) + +Daniel Stenberg (30 May 2023) +- libssh2.h: bump to 1.11.0 for release + +GitHub (30 May 2023) +- [Will Cosgrove brought this change] + + Libssh2 1.11 release notes, copyright (#1048) + + * Libssh2 1.11 release notes, copyright + +Viktor Szakats (29 May 2023) +- add copyright/credits + + Closes #1050 + +- ci: add LIBSSH2_NO_AES_CBC to GNU Make build + + Closes #1049 + +- ci: add wolfSSL Linux builds + + Exclude wolfSSL builds from tests. All fail: + + ``` + 2/43 Test #2: test_aa_warmup ............................***Failed 5.59 sec + libssh2_session_handshake failed (-44): Unable to ask for ssh-userauth service + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/5085775952/jobs/9139583212#step:12:942 (with logging) + Ref: https://github.com/libssh2/libssh2/actions/runs/5085586301/jobs/9139192562#step:12:225 + + wolfSSL version: + ``` + Get:1 http://azure.archive.ubuntu.com/ubuntu jammy/universe amd64 libwolfssl32 amd64 5.2.0-2 [818 kB] + Get:2 http://azure.archive.ubuntu.com/ubuntu jammy/universe amd64 libwolfssl-dev amd64 5.2.0-2 [1194 kB] + ``` + + Cherry-picked from #1046 + Closes #1046 + +- ci: mbedTLS build config tidy-up + + Cherry-picked from #1046 + +- wolfssl: fix detection of AES-GCM feature + + Follow-up to df513c0128e1a811ad863d153892618e728845f0 + + Ref: https://github.com/libssh2/libssh2/issues/1020#issuecomment-1562069241 + Closes #1045 + +- build: fix 'unused' compiler warnings with all `NO` options set + + - add `LIBSSH2_NO_ED25519` build-time option to force-disable ED25519 + support. Useful to replicate crypto-backend builds without ED25519, + such as wolfSSL. + + - openssl: fix unused variable and function warnings with all supported + `LIBSSH2_NO_*` options enabled. + + - mbedtls: fix misplaced `#endif` leaving out the required internal + public function `libssh2_supported_key_sign_algorithms()`. + + - mbedtls: add missing prototype for two internal public functions. + + - delete a redundant block. + + All `NO` options: + ```shell + CPPFLAGS=' + -DLIBSSH2_NO_MD5 -DLIBSSH2_NO_HMAC_RIPEMD -DLIBSSH2_NO_DSA + -DLIBSSH2_NO_RSA -DLIBSSH2_NO_RSA_SHA1 + -DLIBSSH2_NO_ECDSA -DLIBSSH2_NO_ED25519 -DLIBSSH2_NO_AES_CTR + -DLIBSSH2_NO_BLOWFISH -DLIBSSH2_NO_RC4 -DLIBSSH2_NO_CAST + -DLIBSSH2_NO_3DES' + ``` + + Closes #1044 + +- cmake: avoid `list(PREPEND)` for compatibility + + `list(PREPEND)` requires CMake v3.15, our minimum is v3.1. `APPEND` + should work fine for headers anyway. + + Also fix a wrongly placed comment. + + Ref: https://cmake.org/cmake/help/latest/command/list.html#prepend + + Regression from 1e3319a167d2f32d295603167486e9e88af9bb4e + + Closes #1043 + +- checksrc: verify label indent, fix fallouts + + Also update two labels to match the rest of the source. + + checksrc update credit: Emanuele Torre @emanuele6 + + Ref: https://github.com/curl/curl/pull/11134 + + Closes #1042 + +- tidy-up: minor nits + +- ci: drop default shared/static configuration options + + Both autotools and cmake build both shared and static lib by default. + + Ref: 896154bc17f000c0a1bb89b74bc879692ac0d47c + + Delete configuration enabling these explicitly in CI jobs. + + Cherry-picked from #1036 + Closes #1036 + +- cmake: enable shared libssh2 library by default + + This brings default behaviour in sync with autotools, which builds both + lib flavours by default. + + (Notice that on Windows, autotools includes the Windows Resource in the + static library, when building both at the same time. CMake doesn't have + this issue.) + + Enabling both lib flavours has a side-effect when using non-MinGW + toolchains (e.g. MSVC): to resolve the filename conflict between import + and static libraries, we add a suffix to the static lib, naming it + `libssh2_static.lib`. This can break dependent builds relying on + `libssh2.lib` for linking the static libssh2. + + Workarounds: + + - disable either shared or static libssh2 via + `-DBUILD_STATIC_LIBS=OFF` or + `-DBUILD_SHARED_LIBS=OFF`. This results in a libssh2 library (either + static or shared) without a prefix: `libssh2.lib`. + + - set a custom static library suffix via: + `-DSTATIC_LIB_SUFFIX=_my_static`. Resulting in + `libssh2_my_static.lib`, and import library + `libssh2.lib`. + + - set a custom import library suffix via: + `-DIMPORT_LIB_SUFFIX=_my_implib`. Resulting in + `libssh2_my_implib.lib` import library, and static library + `libssh2.lib`. + + - customize the default static/import library suffix (incl. extension) + via + `-DCMAKE_STATIC_LIBRARY_SUFFIX=_my_static_suffix.lib` or + `-DCMAKE_IMPORT_LIBRARY_SUFFIX=_my_import_suffix.lib`. + + Cherry-picked from #1036 + +- cmake: tweak static/import lib name collision avoidance logic + + The collision issue affects (typically) MSVC, when building both shared + and static libssh2 in one go. + + Ref: https://stackoverflow.com/questions/2140129/what-is-proper-naming-convention-for-msvc-dlls-static-libraries-and-import-libr + + Initially we handled this by appending the `_imp` suffix to the import + library filename. This is how curl tackles this, but on a second look, + this solution seem to be accidental and has no widespread use. + + It seems more widely accepted to use the '_static' suffix for the static + library. This patch implements this. + + (MinGW, Cygwin and unixy platforms are not affected by this issue.) + + Follow-up to 4e2580628dd1f8dc51ac65ac747ebcf0e93fa3d1 + + Cherry-picked from #1036 + +- cmake: add `IMPORT_LIB_SUFFIX` (like `STATIC_LIB_SUFFIX`) + + Allow resolving the import/static library name collision also by setting + a custom _import_ library name suffix. + + Follow-up to 4e2580628dd1f8dc51ac65ac747ebcf0e93fa3d1 + + Cherry-picked from #1036 + +- ci: do not disable shared lib with msys2/autotools in GHA + + Cherry-picked from #1036 + +- Makefile.mk: fix `DYN=1 test` by skipping tests needing static lib + + `DYN=1` means to build examples/tests against the shared libssh2. + + Before this patch this was broken for building tests. This patch skips + building tests that require the static libssh2 library, so the build now + succeeds. + + Also move the list of tests that require static lib from + `CMakeLists.txt` to `Makefile.inc`, so that we can reuse it in + `Makefile.mk`. + + Couldn't find a way to also reuse it in `Makefile.am`. Move the + `Makefile.am` specific definitions close to the shared list, to make it + easier to keep them synced. + + Cherry-picked from #1036 + +- ci: make one of the AppVeyor CMake jobs shared-only + + This build combination did not have a CI test before. + + Cherry-picked from #1036 + +- cmake: allow tests with `BUILD_STATIC_LIBS=OFF` + + Before this patch, the CMake build did not allow to disable static + libssh2 library while also building tests. + + This patch removes this constraint, and makes this combination possible. + In this case the 3 (at the moment) tests that require a static libssh2 + library, are skipped from the build and test runs. + + Cherry-picked from #1036 + +- build: fix to set `-DLIBSSH2DEBUG` for tests + + Required for tests using libssh2 internals. These are the ones + requiring the libssh2 _static_ lib. + + Before this patch, `src` and `tests` declared the `session` structure + differently, due to extra struct members added with the `LIBSSH2DEBUG` + macro set. But, the macro was only set for `src` when using CMake. At + runtime this caused struct members to be at different offsets between + lib and test code, resulting in the test failures below. + + Due to another bug in the affected test, these failures did not reflect + in the exit code, which always returned success, so this went unnoticed + for a good while. Fixed in: 84d31d0ca7b647ad4c2aa92bf8f4a94b233f5d3b + + ``` + Start 5: test_auth_keyboard_info_request + [...] + 5: Test case 1 passed + 5: Test case 2 passed + 5: Test case 3: expected return code to be 0 got -1 + 5: Test case 4: expected last error code to be "-6" got "-38" + 5: Test case 5: expected last error code to be "-6" got "-38" + 5: Test case 6: expected last error code to be "-6" got "-38" + 5: Test case 7: expected last error message to be "Unable to decode keyboard-interactive number of keyboard prompts" got "userauth keyboard data buffer too small to get l + 5: Test case 8: expected last error code to be "-41" got "-38" + 5: Test case 9: expected return code to be 0 got -1 + 5: Test case 10: expected return code to be 0 got -1 + 5: Test case 11: expected last error code to be "-6" got "-38" + 5: Test case 12: expected last error message to be "Unable to decode user auth keyboard prompt echo" got "userauth keyboard data buffer too small to get length" + 5: Test case 13: expected return code to be 0 got -1 + 5: Test case 14: expected return code to be 0 got -1 + 5: Test case 15: expected last error code to be "-6" got "-38" + 5: Test case 16: expected last error code to be "-6" got "-38" + 5: Test case 17: expected last error code to be "-6" got "-38" + 5: Test case 18: expected last error code to be "-6" got "-38" + ``` + Ref: https://ci.appveyor.com/project/libssh2org/libssh2/builds/46925869/job/i9uasceu3coss0i2#L440 + Ref: https://ci.appveyor.com/project/libssh2org/libssh2/builds/46983040/job/c3vag25c26a77lyr#L485 + + Cherry-picked from #1037 + Closes #1037 + +- test_auth_keyboard_info_request: fix to return failure + + Before this patch, this test returned success even when one of its tests + failed. Fix it by returning 1 in case any of the tests fails. + + This issue masked a CMake build bug with logging enabled. Subject to an + upcoming patch. + + Cherry-picked from #1037 + +- test_auth_keyboard_info_request: fix indentation + + Cherry-picked from #1037 + +- tidy-up: move comment off from copyright header + + Cherry-picked from #1037 + +- ci: enable shared libs in msys2/macOS cmake builds + + Shared libs improve example/tests build times. For "unity" + builds the overhead of building shared lib is negligible, so + this even reduced the overall build-time. + + Follow-up to 3d64a3f5100f7f4cf52202396eb4f1c3f3567771 + Follow-up to d93ccf4901ef26443707d341553994715414e207 + + Tests: + https://github.com/libssh2/libssh2/actions/runs/4906586658: unity builds enabled + https://github.com/libssh2/libssh2/actions/runs/4906925743: unity builds enabled + parallel msys2 builds + https://github.com/libssh2/libssh2/actions/runs/4906777629: unity + shared lib (this commit) + https://github.com/libssh2/libssh2/actions/runs/4906927190: unity + shared lib (this commit) + parallel msys2 builds + + Consider making shared libs enabled by default also in CMake, to sync it with autotools? + + Closes #1035 + +- ci: add missed --parallel 3 from msys2 cmake builds + + Follow-up to 3d64a3f5100f7f4cf52202396eb4f1c3f3567771 + +- cmake: add and test "unity" builds + + "Unity" (aka "jumbo", aka "amalgamation" builds concatenate source files + before compiling. It has these benefits for example: faster builds, + improved code optimization, cleaner code. Let's support and test this. + + - enable unity builds for some existing CI builds to test this build + scenario. + - tune `UNITY_BUILD_BATCH_SIZE` size. + - disable unity build for example and test programs (they use one source + each already). + + You can enable it by passing `-DCMAKE_UNITY_BUILD=ON` to cmake. + Supported by CMake 3.16 and newer. + + Ref: https://cmake.org/cmake/help/latest/prop_tgt/UNITY_BUILD.html + + Closes #1034 + +- tests: simplify passing `srcdir` to tests + + Before this patch libssh2 used a variety of solutions to pass the source + directory to tests: `FIXTURE_WORKDIR` build-time macro (cmake), + `FIXTURE_WORKDIR` envvar (unused), setting `srcdir` manually + (autotools), setting current directory (cmake), and also `builddir` + envvar (autotools) for passing current working dir to `mansyntax.sh`. + + This patch reduces this to using existing `srcdir` with autotools and + setting it ourselves in CMake. This was mostly enabled by this recent + patch: 4c9ed51f962f542b98789b15bedaaa427f4029a2 + + Details: + + - cmake: replace baked-in `FIXTURE_WORKDIR` macro with env. + + Added in 54bef4c5dad868a9d45fdbfca9729b191c0abab5 #198 (2018-03-21) + + - rename `FIXTURE_WORKDIR` to `srcdir`, to match autotools. + + - cmake: add missing `srcdir` for algo and sshd tests. + + - session_fixture: stop `chdir()`-ing, rely on prefixing with `srcdir`. + + Changing current directory should be unnecessary after + 4c9ed51f962f542b98789b15bedaaa427f4029a2 #801 (2023-02-24), + that prefixes referenced input filenames with the `srcdir` envvar. + + The `srcdir` envvar was already exported by autotools, and now we're + also setting it from CMake. + + - cmake: stop setting `WORKING_DIRECTORY`, rely on `srcdir` env. + + `WORKING_DIRECTORY` is no longer necessary, after passing `srcdir` to + all tests, so they can find our source tree and keys/etc in it + regardless of the current directory. + + Also this past commit hints that `WORKING_DIRECTORY` wasn't always + working for this purpose as expected: + "tests: Xcode doesn't obey CMake's test working directory" + Ref: https://github.com/libssh2/libssh2/pull/198/commits/10a5cbf945abcc60153ee3d59284d09fc64ea152 + + - autotools: delete explicit `srcdir` for test env. + + Added in 13f8addd1bc17e6c55d52491cc6304319ac38c6d (2015-07-02) + + automake documents `srcdir` as exported to the test environment: + https://github.com/autotools-mirror/automake/blob/c04c4e8856e3c933239959ce18e16599fcc04a8b/doc/automake.texi#L9302-L9304 + https://www.gnu.org/software/automake/manual/html_node/Scripts_002dbased-Testsuites.html + It's mentioned in the docs back in 1997 and got a regression test in + 2012. We can safely assume it to be available without setting it + ourselves. + + - autotools: delete explicit `builddir`. + + Added in 13f8addd1bc17e6c55d52491cc6304319ac38c6d (2015-07-02) + + It seems this wasn't necessary to make the above fix work, and + `mansyntax.sh` is able to figure out the build workdir by reading + `$PWD`. Our out-of-tree and `make distcheck` CI builds also work + without it. + + Let us know if there is a scenario we're missing and needs this. + + Closes #1032 + +- src: fix `libssh2_store_*()` for >u32 inputs + + `_libssh2_store_str()` and `_libssh2_store_bignum2_bytes()` accept + inputs of `size_t` max, store the size as 32-bit unsigned integer, then + store the complete input buffer. + + With inputs larger than `UINT_MAX` this means the stored size is smaller + than the data that follows it. + + This patch truncates the stored data to the stored size, and now returns + a boolean with false if the stored length differs from the requested + one. Also add `assert()`s for this condition. + + This is still not a correct fix, as we now dump consistent, but still + truncated data which is not what the caller wants. In future steps we'll + need to update all callers that might pass large data to this function + to check the return value and handle an error, or make sure to not call + this function with more than UINT_MAX bytes of data. + + Ref: c3bcdd88a44c4636818407aeb894fabc90bb0ecd (2010-04-17) + Ref: ed439a29bb0b4d1c3f681f87ccfcd3e5a66c3ba0 (2022-09-29) + + Closes #1025 + +- cmake: limit WinCNG to Windows + + After deleting the `bcrypt.h` check, no check remained. Restore + a `WIN32` check here to ensure WinCNG is not enabled outside Windows. + + Follow-up to 1289033598546ee5089ff0fc4369d24e1e2be81f + + Tested-in #1032 + +- cmake: move `CMAKE_VS_GLOBALS` setting to CI configs + + To not force this setting for local builds where they might serve + a good purpose. + + It makes our CI runs slightly faster and we don't need to track + file changes in unattended, single, CI runs. + + Cherry-picked from #1031 + +- cmake: prefill for faster config phase on Windows + + Prefill known detection results on Windows with MinGW and MSVC, to + avoid spending time on detecting these on every cmake configuration + run. + + With MinGW + clang and MSVC, this elminates all detections. + With MinGW + gcc, it reduces them to 3. + + Cherry-picked from #1031 + +- libssh2_setup.h: set `HAVE_INTTYPES_H` for MSVC + + To sync up the hand-crafted config with actual detection results + by CMake and autotools. Sources compiled fine without it anyway. + + Cherry-picked from #1031 + +- cmake: re-add `select()` detection (regression) + + `select()` detection suffered two regressions: First I accidentally + deleted it for non-Windows [1]. Then the Windows-specific setting got + missed from the generated `libssh2_config.h` after a rearrangement in + `CMakeLists.txt` files. + + [1] 31fb8860dbaae3e0b7d38f2a647ee527b4b2a95f (2023-03-07) + [2] 803f19f004eb6a5b525c48fff6f46a493d25775c (2023-04-18) + + This patch restores detection. For Windows, enable it unconditionally, + not only for speed reasons, but because detection needs `ws2_32`, and + even that is broken on the x86 platform. According to the original + `cmake/SocketLibraries.cmake`, caused by a calling convention mismatch. + FWIW autotools detects it correctly. + + Cherry-picked from #1031 + +- ci: merge make job into msys2 section, enable zlib + openssl + + Follow up to dd625766271a0ba13f5ac661bdc2fa40bbfa580a + + Cherry-picked from #1030 + +- ci: add missing timeouts for autotools tests + + Cherry-picked from #1030 + +- ci: add mingw-w64 clang and gcc CMake jobs + + Cherry-picked from #1030 + +- cmake: assume `bcrypt.h` with WinCNG + + autotools already didn't check for `bcrypt.h`, and such check is only + required for old/legacy mingw without obsolete/incomplete Windows + headers. + + curl deprecated old-mingw support just recently and will delete support + in September 2023. + + This patch saves some complexity and detection time by dropping this + check for CMake. Meaning that mingw-w64 is now required to compile + libssh2 when using the WinCNG backend for 32-bit builds. Other backends + and CPU platforms are not affected. + + Ref: https://github.com/curl/curl/commit/e4d5685cb5d6eb07e1b43156fd7e3ba3563afba5 + + Closes #1026 + +- cmake: do not check for `poll()` on Windows + + While it seems to exist on mingw in theory, it's not detected as of this + writing. It also has issues, and not ready for production use: + https://stackoverflow.com/questions/1671827/poll-c-function-on-windows + + On MSVC it's even less supported. + + Skip checking this to save CMake detection time. + + Closes #1027 + +- agent_win: make a struct static and other build improvements + + Also: + - merge back `agent.h` into `agent.c` where it was earlier. + Ref: c998f79384116e9f6633cb69c2731c60d3a442bb + - introduce `HAVE_WIN32_AGENT` internal macro. + - fix two guards to exclude more code unused in UWP builds. + + Follow-up to 1c1317cb768688eee0e5496c72683190aaf63b29 + + Closes #1028 + +- tidy-up: formatting nits + + Whitespace and redundant parenthesis in `return`s. + + Closes #1029 + +GitHub (3 May 2023) +- [Nick Woodruff brought this change] + + sftp: parse attribute extensions, if present, to avoid stream parsing errors (#1019) + + Prevents directory listing errors when attribute extensions are present + by advancing stream parsing past extensions. + +Viktor Szakats (3 May 2023) +- tests: merge `sshd_fixture.sh` into `test_sshd.test` + + Merge the loop executing multiple tests and the script that actually + launches the tests into a single script. This same script is now called + from both autotools and CMake. autotools loads the list of tests from + `Makefile.inc`, CMake passes it via the command-line. It's also possible + to call the script manually with a custom list of tests or individual + ones. + + With this setup we're now launching a single sshd session for all tests, + instead of launching and killing it for each test. This did not improve + reliability of these test on CI machines, and it's easy to go back to + the previous behaviour if necessary. + + Also: + + - allow passing custom sshd options via `SSHD_FLAGS`. + + - add `SSHD_TESTS_LIMIT_TO` to limit the number of tests to its value. + E.g. `SSHD_TESTS_LIMIT_TO=1` executes the first test only. Meant for + debugging. + + - use `ssh` to test the connection (if available) instead of fixed + amount of wait. Made to also work on Windows. + + - set `PermitRootLogin yes` in `sshd`, to allow running tests as root. + + - show `sshd` path and version. + + Cherry-picked from #1017 (the last one) + Closes #1024 + +- ci: make sure to run tests after all builds in GHA + + Whenever possible. Due to flakiness/hangs/timeouts, keep sshd + tests disabled on Windows and macOS. + + Also keep Docker tests disabled on these platforms, they do not work: + + GHA Windows: + ``` + no matching manifest for windows/amd64 in the manifest list entries + ``` + + GHA macOS: + ``` + sh: docker: command not found + ``` + + It's not possible to run UWP and ARM64 binaries: + UWP: + ``` + Test #2: test_simple ......................Exit code 0xc0000135 + ``` + Needs but doesn't find: `VCRUNTIME140_APP.dll`. + + ARM64 + ``` + D:/a/libssh2/libssh2/bld/tests/Release/test_ssh2.exe: cannot execute binary file: Exec format error + ``` + + Cherry-picked from #1017 + +- tests: disable sshd tests on Windows via new options + + Instead of using hacks inside the build systems. + + `SSHD` variable added to GitHub Actions is not currently used. + Added there to make it easy to experiment with these tests and + the path is non-trivial to discover. Using the Windows built-in + sshd server is another option (haven't discovered its path yet). + + Cherry-picked from #1017 + +- tests: add cmake/autotools options to disable running tests + + autotools: + - `--disable-docker-tests` + - `--disable-sshd-tests` + + cmake: + - `RUN_DOCKER_TESTS` + - `RUN_SSHD_TESTS` + + Update automake and ci to use this new flag and delete former logic + of relying on Windows detection and `HOST_WINDOWS`. Also fix honoring + this when running `test_read_algos.test`. + + This allows to disable these individually and on per-CI/local-job basis. + To run as much tests as the env allows. + + Cherry-picked from #1017 + +- ci: add `make distcheck` job + + Cherry-picked from #1017 + +- ci: switch to out-of-tree autotools builds + + Cherry-picked from #1017 + +- ci: restore parallel builds with cmake + + Also add missing -j3 for macOS builds. + + Partial revert of 0d08974633cfc02641e6593db8d569ddb3644255 + + Cherry-picked from #1017 + +- ci: sync names, steps, syntax, build dirname between jobs + + Also: + + - delete an unused 64-bit option for Linux (all jobs are 64-bit). + + - fix to not install libgcrypt and openssl when doing mbedTLS builds. + + [ Empty lines after multiline run commands are solely to unbreak + my editor's syntax highlighting. They can be deleted in the future ] + + Cherry-picked from #1017 + +- ci: add `Makefile.mk` test, with `LIBSSH2_NO_*` options + + Cherry-picked from #1017 + +- Makefile.mk: use Makefile.inc from example and tests + + Instead of assembling the list using `$(wildcard ...)`. + + Also split off a `tests/Makefile.inc` from `tests/Makefile.am`. With its + simpler syntax, this also allows to delete some complexity from the + CMake loader. + + Cherry-picked from #1017 + +- example, tests: fix ssh2 to correctly return failure + + Before this patch ssh2 and test_ssh2 returned success even if the session + failed at `libssh2_session_handshake()` or after. + + This patch depends on cda41f7cb87c3af5258ba48ccef19d3efdbd3d3b, that fixed + running test_ssh2 on Windows via sshd_fixture. + + Cherry-picked from #1017 + +- tests: set -e -u in shell scripts + + Cherry-picked from #1017 + +- cmake: use shared libs again in example and tests + + Re-sync with autotools and v1.10.0 behavior. + + This improves build times. It also allows to stop building our special + shared test target to test shared builds. + + Follow-up to 4e2580628dd1f8dc51ac65ac747ebcf0e93fa3d1 + + Cherry-picked from #1017 + Closes #1022 + +- tests: retry KEX failures when using the WinCNG backend + + Twice. This tests are flaky and we haven't figured out why. In the + meantime use this workaround to test and log these issues, but also + ensure that CI run aren't flagged red because of it. + + Also: + - kex: add debug message when hostkey `sig_verify` fails, + to help tracking WinCNG KEX failures. + - test_ssh2: also add retry logic. + I'm not quite sure this is correct. Please let me know. + - session_fixture: bump up `src_path` slots to fit retries and show + message when hitting the limit. + - session_fixture: clear `kbd_password` static variable after use. + - session_fixture: close and deinit socket after use. + - session_fixture: deinit libssh2 after use. + + Ref: #804 #846 #979 #1012 #1015 + + Cherry-picked from #1017 + Closes #1023 + +- example, test_ssh2: shutdown socket before close + + Syncing them with `tests/session_fixture.c`. + + Cherry-picked from #1017 + +- ci.yml: fix indentation [ci skip] + + Cherry-picked from #1017 + +- Makefile.mk: make tests depend on runner lib + + Cherry-picked from #1017 + +- build: compile agent_win.c via agent.c + + Silences these warnings on non-Windows: + ``` + ranlib: file: libssh2.a(agent_win.c.o) has no symbols + ``` + + Cherry-picked from #1017 + +- cmake: delete obsolete comment + + Follow-up to 80175921638fa0a345237d23206a2ad1644cdd9b + + Cherry-picked from #1017 + +- checksrc.sh: fix it to run from any current directory + + Also silence a shellcheck warning. + + Cherry-picked from #1017 + +- ISSUE_TEMPLATE: ask for crypto backend version + + Also fix casing in backend names. + + Cherry-picked from #1017 + +- tests: fix newlines in test keys for sshd on Windows + + Make sure these files get LF newlines on checkout. Before this patch + a checked out libssh2 Git repository may have used CRLF newlines in text + files, include test keys. Private keys with CRLF newlines could confuse + sshd on Windows: + + ``` + # sshd version: 'OpenSSH_9.2, OpenSSL 1.1.1t 7 Feb 2023' + Unable to load host key "/d/a/libssh2/libssh2/tests/openssh_server/ssh_host_ed25519_key": invalid format + Unable to load host key: /d/a/libssh2/libssh2/tests/openssh_server/ssh_host_ed25519_key + ``` + Ref: https://github.com/libssh2/libssh2/actions/runs/4846188677/jobs/8635575847#step:6:39 + + Cherry-picked from #1017 + +- cmake: move option descriptions next to definition + + Cherry-picked from #1017 + +- checksrc: sync with curl + + There were no new issues detected. + + Cherry-picked from #1017 + +- openssl: enable AES-GCM with wolfSSL + + Follow-up to 3c953c05d67eb1ebcfd3316f279f12c4b1d600b4 #797 + + There is pending issue with wolfSSL, where encryption/decryption is not + working (both with and without this patch). Ref: #1020 + + Cherry-picked from #1017 + +- appveyor: add a UWP OpenSSL 3 build + + Cherry-picked from #1017 + +- appveyor: skip `before_test` when not doing tests + + Also merge `before_test` section into `test_script`. + + Cherry-picked from #1017 + +- docs: delete two stray characters + + Cherry-picked from #1017 + +- tidy-up: avoid expression 'of course' + + Cherry-picked from #1017 + +- tidy-up: avoid word 'just' + + Cherry-picked from #1017 + +- tidy-up: avoid word 'simply' + + Cherry-picked from #1017 + +- tests: teach to use the `USERNAME` envvar on Windows + + Necessary to pick the correct local username when run on Windows. + + Cherry-picked from #1017 + +- test_ssh2: support `FIXTURE_TRACE_ALL*` envvars + + Cherry-picked from #1017 + +- tidy-up: add missing newline to error msg, formatting + + Also: + - fix indent + - lowercase variables names + - fix formatting in `src/global.c` + + Cherry-picked from #1017 + +- appveyor: wait more for SSH connection from GHA + + Cherry-picked from #1017 + +- ci: restrict permissions in GitHub Actions + + Cherry-picked from #1017 + +- build: fix autoreconf warnings + + - update `AC_HELP_STRING' to 'AS_HELP_STRING`: + ``` + configure.ac:[...]: warning: The macro `AC_HELP_STRING' is obsolete. + ``` + "AC_HELP_STRING is deprecated in 2.70+ and I believe AS_HELP_STRING works + already since 2.59 so bump the minimum required version to that." + + Ref: https://github.com/curl/curl/commit/a59f04611629f0db9ad8e768b9def73b9b4d9423 + + - simplify to avoid: + ``` + src/Makefile.inc:48: warning: variable 'EXTRA_DIST_SOURCES' is defined but no program or + src/Makefile.inc:48: library has 'DIST' as canonical name (possible typo) + ``` + Regression from 2c18b6fc8df060c770fa7e5da704c32cf40a5757 + + - `AC_TRY_LINK`/`AC_TRY_COMPILE`: + ``` + configure.ac:335: warning: The macro `AC_TRY_COMPILE' is obsolete. + configure.ac:335: warning: The macro `AC_TRY_LINK' is obsolete. + ``` + + - `libtool`-related ones: + ``` + configure.ac:70: warning: The macro `AC_LIBTOOL_WIN32_DLL' is obsolete. + configure.ac:70: warning: AC_LIBTOOL_WIN32_DLL: Remove this warning and the call to _LT_SET_OPTION when you + configure.ac:70: put the 'win32-dll' option into LT_INIT's first parameter. + configure.ac:71: warning: The macro `AC_PROG_LIBTOOL' is obsolete. + ``` + Using code copied from curl: + https://github.com/curl/curl/blob/9ce7eee07042605045dcfd02a6f5b38ad5c8a05d/m4/xc-lt-iface.m4#L157-L163 + + - delete commented and obsolete `AC_HEADER_STDC`. + + - formatting. + + Most cherry-picked from `autoupdate` updates. + + Cherry-picked from #1017 + Closes #1021 + +- docker-bridge.ps1: use native newlines + + Also add a shebang and exec flag to ease testing/handling on *nix. + PowerShell accepts both LF and CRLF. + + Cherry-picked from #1017 + +GitHub (1 May 2023) +- [Zenju brought this change] + + sftp: remove packet limit for directory reading (#791) + + Currently libssh2 cannot read huge directory listings when the package + size of `LIBSSH2_SFTP_PACKET_MAXLEN` (256KB) is hit. For example AWS + always sends a single package with all files of a directory, no matter + how big it is: https://freefilesync.org/forum/viewtopic.php?t=10020 + Package size is probably around 7MB in this case! + + `LIBSSH2_SFTP_PACKET_MAXLEN` is a good idea in general, but there + doesn't seem to be a one size fits all. While almost all(?) SFTP + responses come in very small packages, I believe the `SSH_FXP_READDIR` + request should be exempted. + + The proposed patch, enhances the package size reading to include parsing + the full SFTP packet header. And in case a package is of type + `SSH_FXP_NAME` and matches an expected `readdir_request_id`, it does not + fail if `LIBSSH2_SFTP_PACKET_MAXLEN` is hit. The chances of accidentally + hiding data-corruption are pretty non-existent, because both SFTP + `request_id` and packet type must match. No change in behavior + otherwise. + + Best, Zenju + + Previous discussion: #268 #269 + + With the above changes, the `LIBSSH2_SFTP_PACKET_MAXLEN` value could + (and should?) probably be set back to a small number again. + + Integration-patches-by: Viktor Szakats + +Viktor Szakats (28 Apr 2023) +- checksrc: update and apply fixes + + Update to latest revision and fix new issues detected. + + Closes #1014 + +- ci: add macOS CI jobs + fix issues revealed + + Add macOS CI jobs, both cmake and autotools for all supported crypto + backends (except BoringSSL), with debug, zlib enabled. Without running + tests. It also introduces OpenSSL 1.1 into the CI with a non-MSVC + compiler. + + Credits to curl's `macos.yml`, that I used as a base. + + Fix these issues uncovered by the new tests: + + - openssl: fix warning when built with wolfSSL, or OpenSSL 1.1 and + earlier. CI missed it because apparently the only OpenSSL 1.1 test + we had used MSVC, which did not complain. + + ``` + ../src/openssl.c:3852:19: error: variable 'sslError' set but not used [-Werror,-Wunused-but-set-variable] + unsigned long sslError; + ^ + ``` + + Regression from 097c8f0dae558643d43051947a1c35b65e1c5761 + + - pem: add hack to build without MD5 crypto-backend support. + + The Homebrew wolfSSL build comes with MD5 support disabled. We can + expect this becoming the norm. FIPS also requires MD5 disabled. + + We deleted the same hack from `hostkey.c` a month ago: + ad6aae302aaec84afbfacf0c1dfdc446d46eaf21 + + A better fix would be to guard the MD5 logic with our `LIBSSH2_MD5` + macro. + + ``` + pem.c:214:32: error: use of undeclared identifier 'MD5_DIGEST_LENGTH'; did you mean 'SHA_DIGEST_LENGTH'? + unsigned char secret[2*MD5_DIGEST_LENGTH]; + ^~~~~~~~~~~~~~~~~ + SHA_DIGEST_LENGTH + ``` + + Regression from 386e012292a96fcf0dc6861588397845df0aba2c + + - `configure.ac`: add crypto libs late. + + Fix it by adding crypto libs to `LIBS` at the end of the configuration + process. + + Otherwise `configure` links crypto libs while doing feature tests, + which can cause unwanted detections. For example LibreSSL publishes + the function `explicit_bzero()`, which masks the system alternative, + e.g. `memset_s()` on macOS. Then when trying to compile libssh2, its + declaration is missing: + + ``` + bcrypt_pbkdf.c:93:5: error: implicit declaration of function 'explicit_bzero' is invalid in C99 [-Werror,-Wimplicit-function-declaration] + _libssh2_explicit_zero(ciphertext, sizeof(ciphertext)); + ^ + ../src/misc.h:50:43: note: expanded from macro '_libssh2_explicit_zero' + ^ + ``` + + Regression from 4f0f4bff5a92dce6a6cd7a5600a8ee5660402c3f + + - cmake: fix to list our own include directory before the crypto libs', + when building tests. + + Otherwise a global crypto header path, such as `/usr/local/include`, + containing an external `libssh2.h` of a different version, could cause + weird errors: + + ``` + cc -DHAVE_CONFIG_H -DLIBSSH2_LIBGCRYPT \ + -I../src -I../../src -I/usr/local/include -I[...]/libssh2/include \ + -g -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk \ + -mmacosx-version-min=12.6 -MD -MT \ + tests/CMakeFiles/test_aa_warmup.dir/test_aa_warmup.c.o \ + -MF CMakeFiles/test_aa_warmup.dir/test_aa_warmup.c.o.d \ + -o CMakeFiles/test_aa_warmup.dir/test_aa_warmup.c.o -c \ + [...]/libssh2/tests/test_aa_warmup.c + ``` + + ``` + [ 62%] Building C object tests/CMakeFiles/test_aa_warmup.dir/test_aa_warmup.c.o + In file included from /Users/runner/work/libssh2/libssh2/tests/test_aa_warmup.c:4: + In file included from /Users/runner/work/libssh2/libssh2/tests/runner.h:42: + In file included from /Users/runner/work/libssh2/libssh2/tests/session_fixture.h:43: + /Users/runner/work/libssh2/libssh2/tests/../src/libssh2_priv.h:649:5: error: type name requires a specifier or qualifier + LIBSSH2_AUTHAGENT_FUNC((*authagent)); + ^ + /Users/runner/work/libssh2/libssh2/tests/../src/libssh2_priv.h:649:30: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int] + LIBSSH2_AUTHAGENT_FUNC((*authagent)); + ^ + /Users/runner/work/libssh2/libssh2/tests/../src/libssh2_priv.h:650:5: error: type name requires a specifier or qualifier + LIBSSH2_ADD_IDENTITIES_FUNC((*addLocalIdentities)); + ^ + /Users/runner/work/libssh2/libssh2/tests/../src/libssh2_priv.h:650:35: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int] + LIBSSH2_ADD_IDENTITIES_FUNC((*addLocalIdentities)); + ^ + /Users/runner/work/libssh2/libssh2/tests/../src/libssh2_priv.h:651:5: error: type name requires a specifier or qualifier + LIBSSH2_AUTHAGENT_SIGN_FUNC((*agentSignCallback)); + ^ + /Users/runner/work/libssh2/libssh2/tests/../src/libssh2_priv.h:651:35: error: type specifier missing, defaults to 'int' [-Werror,-Wimplicit-int] + LIBSSH2_AUTHAGENT_SIGN_FUNC((*agentSignCallback)); + ^ + 6 errors generated. + ``` + + - `tests/session_fixture.h`: delete duplicate `libssh2.h`, + `libssh2_priv.h` already includes it. + + Follow-up to a683133dfe96de126194f58f183131a84c7d36a2 + + CI logs with these errors: + https://github.com/libssh2/libssh2/actions/runs/4824079094 + https://github.com/libssh2/libssh2/actions/runs/4824270819 + + curl's `macos.yml`: https://github.com/curl/curl/blob/da2470de96e94e1c8d276b9ae6e4c97c2cf54239/.github/workflows/macos.yml + + Tidying-up while here: + + - tests/session_fixture.h: delete duplicate `libssh2.h`. + `libssh2_priv.h` includes it already. + + Follow-up to a683133dfe96de126194f58f183131a84c7d36a2 + + - ci.yml: yamllint warnings and formatting. + + - ci.yml: msvc section formatting and step-naming sync with macOS. + + Follow-up to f4a4c05dc3bcd62ecaa1b0cac5997faefe16c83f + + - ci.yml: enable `--enable-werror` for msys2 jobs. + + Follow-up to 71cae949d577fdd632a271da0bec89f977dc5dd2 + + - appveyor.yml: show OpenSSL versions, link to image content. + + Closes #1013 + +- ci: convert `docker-bridge.bat` to shell script + + Convert `ci/appveyor/docker-bridge.bat` to a POSIX shell script. + + Also bump the tunnel to use ed25519 (was RSA-2048). + + Closes #997 + +- kex: use distinctive error strings + + Use unique error strings to help localize errors. + + Closes #1011 + +- tidy-up: C header use + + - drop unused or duplicate C headers. + - add missing ones (that worked by chance). + (`string.h`, `stdlib.h`) + - mention the functions that need certain headers. + - move some headers from crypto header to crypto C source. + - reorder headers in some places. + - simplify the #if tree for `sys/select.h` in `libssh2_priv.h`. + - move scp-specific macros next to their header to `scp.c` + Follow-up to 5db836b2a829c6fff1e8c7acaa4b21b246ae1757 + + Closes #999 + +- tidy-up: text nits, English contractions [ci skip] + + In input/output text and docs mostly. + +- ci: add MSVC and UWP builds to GitHub Actions + + - add MSVC jobs to GitHub Actions. They are similar to the 'Build-only' + jobs we have on AppVeyor CI, though only the ARM64 Windows one is + identical. Major disadvantage is that we don't run tests here. Major + advantage is they only take a few minutes to complete, compared to + an hour on AppVeyor, so WinCNG build results now appear quicker. + + Docker tests might be possible, but my light attempts failed. + Finding ZLIB also failed, so we still miss an MSVC test with it. + + Tool versions as of now: Server 2022, VS2022, OpenSSL 1.1.1 + + - add UWP builds for both ARM64 and x64. This hasn't been CI tested + before. + + (We could probably enable UWP on AppVeyor CI as well. + I haven't tried.) + + - fix two uncovered UWP issues in tests. + + - rename internal macro `LIBSSH2_WINDOWS_APP` to `LIBSSH2_WINDOWS_UWP`. + + Follow-up to 2addafb77b662e64248d156c71c69b91ba7b926e + + - fold long lines and quote truthy values in `.github/workflows/ci.yml`. + + Closes #1010 + +- session_fixture: avoid no-op `chdir(getcwd())` + + If no `FIXTURE_WORKDIR` macro or envvar is present to set the cwd, + avoid querying the cwd and then calling chdir with the result. + + Ref: 54bef4c5dad868a9d45fdbfca9729b191c0abab5 (patch) + Ref: 10a5cbf945abcc60153ee3d59284d09fc64ea152 (individual commit) + + Closes #1009 + +- tests/sshd_fixture.sh: convert back to POSIX + + There was no strong reason to require bash. Let's use POSIX shell + like before the recent overhaul. + + Follow-up to a459a25302a31f6e2aba3c4e15b1472b83b596fc + + Closes #1008 + +GitHub (26 Apr 2023) +- [Miguel de Icaza brought this change] + + If SFTP fails to initialize, do not busy loop waiting for IO to happen (#720) + + Currently SFTP's init will busy loop waiting for the channel to close, + even if the underlying transport returns EAGAIN. While this works for + sockets, it might not work out if you have a different transport that + needs to do some additional processing on the side. + + Integration-patches-by: Viktor Szakats + +Viktor Szakats (26 Apr 2023) +- docs: simplify `.TH` header & other cleanups [ci skip] + + - simplify `.TH` headers. + - delete empty lines before sections. + - update template with an `AVAILABILITY` section. + + Left libssh2 version number in the `.TH` header for entries without an + `AVAILABILITY` section, or where there was a different version number + there. + +- tidy-up: formatting nits [ci skip] + +- vms: fix to include `sys/socket.h` + + Due to a typo in the `HAVE_*` macro, this header was never included. + + A comment suggests that `socklen_t` is not defined on VMS and defines it + manually. This symbol is usually in `sys/socket.h`, so the typo may have + been the reason for it to be missing. + + Closes #1007 + +- build: fix `make distcheck` regressions + + - add #included C files to `EXTRA_DIST`. + + Regression from 4f0f4bff5a92dce6a6cd7a5600a8ee5660402c3f + + - fix `tests/sshd_fixture.sh` to not write into the test dir, by using + a pre-assembled `TrustedUserCAKeys` file. Update `Dockerfile` too to + use this. + + Regression from a459a25302a31f6e2aba3c4e15b1472b83b596fc + + Also update `tests/sshd_fixture.sh` to use + `openssh_server/authorized_keys` like `Dockerfile` does. And a few more + cosmetic updates. + + Closes #1006 + +- libssh2_priv.h: assume `HAVE_LONGLONG` + + Unless I'm missing something, it looks like `libssh2.h` has been using + `libssh2_int64_t` unconditionally since at least 2010-04-17 when + `libssh2_scp_send64()` landed via commit + be9ee7095e2d5021985f57d88f5f889d3c2b9d8f. + + This makes it redundant to detect `HAVE_LONGLONG` to fallback to a + 32-bit `scpRecv_size` in `libssh2_priv.h`. Then deal with possible + combinations of this flag and `strtoll()` options, which was + error-prone. + + Instead, assume in `libssh2_priv.h` that we have `libssh2_int64_t`, and + use it always. + + For MSVC, this means `_MSC_VER` `1310` (from year 2003) is now + required. Based on the above, this was already so before this patch. + + If there happens to be no 64-bit `strtoll()` detected, fall back to the + 32-bit `strtol()` (this should never happen with MSVC, and probably + neither with any other reasonably modern toolchain.) + + Also make sure to set `HAVE_STRTOI64` for older, non-CMake, MSVC builds + (e.g. `Makefile.mk` or `NMakefile` ones). + + Closes #1002 + +GitHub (26 Apr 2023) +- [Miguel de Icaza brought this change] + + fix a couple of small regressions (#1004) + + - openssl: fix potentially missing `ERR_*` constants by including + `openssl/err.h`. This could happen with recent version of Xcode + or when building against OpenSSL built with the `OPENSSL_NO_ENGINE` + option. + + Regression from 097c8f0dae558643d43051947a1c35b65e1c5761 (#789) + + - channel: fix an issue that would corrupt the data stream when + attempting to initialize the agent in non-blocking mode, as it is + necessary to propagate the `EAGAIN` signal upstream when the transport + returns `EAGAIN`. + + Regression from bc4e619e76071393e466c29220fc4ef5764c2820 (#752) + + - packet: the current code does not set the state machine upon reaching + this point which means that if the code is suspended due to the + transport returning an `EAGAIN`, this will re-initialize the structure + every time. + + The issue is that this keeps assigning a new channel-id downstream, + which does not match the initial channel-id that is initially + generated, causing a lookup later to fail as there is no matching + channel. + + Regression from bc4e619e76071393e466c29220fc4ef5764c2820 (#752) + +Viktor Szakats (26 Apr 2023) +- tidy-up: `gettimeofday()` fallback and use + + Simplify the way we handle `gettimeofday()` fallback for platforms + without native support or without any support. Make it similar to + how we handle `snprintf()`. + + In case of no native `gettimeofday()` support and a non-Windows + platform, our local fallback returns zero in `tv_usec` and `tv_sec`, + ending up with a zero `timeout_remaining` in `session.c`, same as + before this patch. + + Also: + - drop unused `sys/time.h` headers. + - fix our fallback code to compile with any Windows compilers + (not just MSVC) + - delete unnecessary casts. + + Closes #1001 + +- libssh2_priv.h: fix checksrc warning [ci skip] + + Regression from 9ef75298fae0728305d9d38ba1e3c838ad0513f7 + +- libssh2_priv.h: whitespace fixes cont. [ci skip] + +- libssh2_priv.h: whitespace fixes [ci skip] + +- cmake: use portable mkdir for tests/coverage target [ci skip] + + Makes `make coverage` work without a POSIX mkdir. + + Tested locally. + + Ref: https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-E-arg-make_directory + +- kex: fix overlapping memcpy() to memmove() + + Noticed this when libasan started kicking out errors when sending in + MACs preferences that were not supported yet. + + Reported-by: fourierules on github + Fixes #611 + Closes #1000 + +- test/CMakeLists.txt: reuse `Makefile.am` librunner source list + + Follow-up to a459a25302a31f6e2aba3c4e15b1472b83b596fc + + Closes #998 + +GitHub (25 Apr 2023) +- [Zenju brought this change] + + openssl: fix misleading error message if wrong passphrase (#789) + + Fixes #608 + +Viktor Szakats (25 Apr 2023) +- tidy-up: tiny nits [ci skip] + +- tests: improve running tests + + TL;DR: Sync test builds between autotools and CMake. Sync sshd + configuration between Docker and non-Docker fixtures. Bump up + sshd_config for recent OpenSSH releases. + + This also opens up the path to have non-Docker tests that use a + local sshd process. Though sshd is practically unusable on Windows + CI machines out of the box, so this will need further efforts. + + Details: + + - cmake: run sshd fixture test just like autotool did already. + + - sync tests and their order between autotools and CMake. + + It makes `test_aa_warmup` the first test with both. + + - cmake: load test lists from `Makefile.am`. + + Needed to update the loader to throw away certain lines to keep the + converted output conform CMake syntax. Using regexp might be an + alternative way of doing this, but couldn't make it work. + + - cmake: use the official way to configure test environment variables. + Switch to syntax that's extendable. + + - cmake: allow to run the same test both under Docker and sshd fixture. + + Useful for testing the sshd fixture runner, or how the same test + behaves in each fixture. + + - update test fixture to read the username from `USER` envvar instead of + using the Dockfile-specific hardwired one, when running outside Docker. + + - rework `ssh2.sh` into `sshd_fixture.sh`, to: + + - allow running any tests (not just `test_ssh2`). + - configure Docker tests for running outside Docker. + - fixup `SSHD` path when running on Windows (e.g. in AppVeyor CI). + Fixes: `sshd re-exec requires execution with an absolute path` + - allow overriding `PUBKEY` and `PRIVKEY` envvars. + - allow overriding `ssh_config` via `SSHD_FIXTURE_CONFIG`. + + - prepare support for running multiple tests via sshd_fixture. + + Add a TAP runner for autotools and extend CMake logic. The TAP runner + loads the test list from `Makefile.am`. + + Notice however that on Windows, `sshd_fixture.sh` is very flaky with + GitHub Actions. And consistently broken for subsequent tests in + AppVeyor CI: + 'libssh2_session_handshake failed (-43): Failed getting banner' + + Another way to try is a single sshd instance serving all tests. + For CMake this would probably mean using an external script. + + - ed25519 test keys were identical for auth and host. Regenerate the + auth keypair to make them distinct. + + - sync the sshd environment between Docker and sshd_fixture. + + - use common via `openssh_server/sshd_config`. + - accept same auth keys. + - offer the same host keys. + - sync TrustedUserCAKeys. + - delete now unused keypairs: `etc/host*`, `etc/user*`. + - bump up startup delay for Windows (randomly, to 5 secs, from 3). + - delete `UsePrivilegeSeparation no` to avoid deprecation warnings. + `command-line line 0: Deprecated option UsePrivilegeSeparation` + - delete `Protocol 2` to avoid deprecation warnings. + It has been the default since OpenSSH 3.0 (2001-11-06). + - delete `StrictModes no` (CI tests work without it, Docker tests + never used it). + + - bump `Dockerfile` base image to `testing-slim` (from `bullseye-slim`). + + It needed `sshd_config` updates to keep things working with + OpenSSH 9.2 (compared to bullseye's 8.4). + + - replace `ChallengeResponseAuthentication` alias with + `KbdInteractiveAuthentication`. + The former is no longer present in default `sshd_config` since + OpenSSH 8.7 (2021-08-20). This broke the `Dockerfile` script. + The new name is documented since OpenSSH 4.9 (2008-03-31) + + - add `PubkeyAcceptedKeyTypes +ssh-rsa,ssh-dss,ssh-rsa-cert-v01@openssh.com` + and `HostKeyAlgorithms +ssh-rsa`. + + Original-patch-by: Eric van Gyzen (@vangyzen on github) + Fixes #691 + + There is a new name for `PubkeyAcceptedKeyTypes`: + `PubkeyAcceptedAlgorithms`. + It requires OpenSSH 8.5 (2021-03-03) and breaks some envs so we're + not using it just yet. + + - drop `rijndael-cbc@lysator.liu.se` tests and references from config. + + This is a draft alias for `aes256-cbc`. No need to test it twice. + Also this alias is no longer recognized by OpenSSH 8.5 (2021-03-03). + + - update `mansyntax.sh` and `sshd_fixture.sh` to not rely on `srcdir`. + + Hopefully this works with out-of-tree builds. + + - fix `test_read_algos.test` to honor CRLF EOLs in their inputs + (necessary when running on Windows.) + + - fix `test_read_algos.test` to honor `EXEEXT`. Might be useful when + running tests under cross-builds? + + - `test_ssh2.c`: + + - use libssh2 API to set blocking mode. This makes it support all + platforms. + - adapt socket open timeout logic from `openssh_fixture.c`. + Sadly this did not help fix flakiness on GHA Windows. + + - tests: delete unused C headers and variable initialization. + + - delete unused test files: `sshd_fixture.sh.in`, `sshdwrap`, + `etc/sshd_config`. + + Ref: cf80f2f4b5255cc85a04ee43b27a29c678c1edb1 + + - autotools: delete stray `.c` test sources from `EXTRA_DIST` in tests. + + - `tests/.gitignore`: drop two stray tests. + + - autotools: fix passing `SSHD` containing space (Windows needs this). + + - autotools: sort `EXTRA_DIST` in tests. + + - cmake: fix to add `test_ssh2` to `TEST_TARGETS`. + + - fix `authorized_key` order in `tests/gen_keys.sh`. + + - silence shellcheck warning in `ci/checksrc.sh`. + + - set `SSHD` for autotools on GitHub Actions Windows. [skipped] + + Auto-detection doesn't work (maybe because sshd is installed via + Git for Windows and we're using MSYS2's shell.) + + It enables running sshd fixture (non-Docker) tests in these jobs. + + I did not include this in the final patch due to flakiness: + ``` + Connection to 127.0.0.1:4711 attempt #0 failed: retrying... + Connection to 127.0.0.1:4711 attempt #1 failed: retrying... + Connection to 127.0.0.1:4711 attempt #2 failed: retrying... + Failure establishing SSH session: -43 + ``` + + Can be enabled with: + `export SSHD='C:/Program Files/Git/usr/bin/sshd.exe'` + + Closes #996 + +- ci: reduce algo test runtime on AppVeyor + + Make the block count customizable in `test_read` via environment + `FIXTURE_XFER_COUNT`. + + Set the custom count lower than the default when running on AppVeyor. + + The goal is to reduce CI roundtrip times. + + Closes #995 + +GitHub (22 Apr 2023) +- [Michael Buckley brought this change] + + Agent forwarding implementation (#752) + + This PR contains a series of patches that date back many years and I + believe were discussed on the mailing list, but never merged. We have + been using these in our local copy of libssh2 without issue since 2015, + if not earlier. I believe this is the full set of changes, as we tried + to use comments to mark where our copy of libssh2 differs from the + canonical version. + + This also contains changes I made earlier this year, but which were not + discussed on the mailing list, to support certificates and FIDO2 keys + with agent forwarding. + + Note that this is not a complete implementation of agent forwarding, as + that is outside the scope of libssh2. Clients still need to provide + their own implementation that parses ssh-agent methods after calling + libssh2_channel_read() and calls the appropriate callback messages in + libssh2. See the man page changes in this PR for more details. + + Integration-patches-by: Viktor Szakats + + * prefer size_t + * prefer unsigned int over u_int in public function + * add const + * docs, indent, checksrc, debug call, compiler warning fixes + +Viktor Szakats (21 Apr 2023) +- ci: add Windows Server 2016 into the test mix + + We had Windows Server 2012 R2 (8.1) and Windows Server 2019 (10) before + this patch. After, we also have Windows Server 2016 (10). + + The WinCNG flakey tests should have a better chance when running on the + newer OS. + + This update does not change the compiler mix. + + Also change the test fixture to not use the `--quiet` option with the + `docker pull` commant. This option requires docker v19.03, and + AppVeyor's Visual Studio 2017 image doesn't support it. Log output did + not change without `--quiet`, so it seems safe to delete it. In case + we'd need it, another solution is to retry without `--quiet` if the + command fails. docker's exit status is 125 in that case. + + Ref: https://github.com/libssh2/libssh2/issues/804#issuecomment-1515232799 + Ref: https://www.appveyor.com/docs/windows-images-software/ + + Closes #994 + +- build: add autotools test_read support and more + + Keep a single list for mac and crypt algos that we use in both CMake + and autotools. Use the same test names across build tools. + + Use the TAP protocol to track individual tests run from a single shell + script. + + Also: + + - enable the rest of our tests with autotools. + + - set `make check` verbose to see errors in case they happen. + + - silence stray 'command not found' error when running `mansyntax.sh` + on Windows. + + GitHub Actions Windows docker tests disabled due to: + ``` + Command: docker build --quiet -t libssh2/openssh_server ../tests/openssh_server + Error running command 'docker build --quiet -t libssh2/openssh_server ../tests/openssh_server' (exit 1): Sending build context to Docker daemon 22.02kB + Step 1/42 : FROM debian:bullseye-slim + bullseye-slim: Pulling from library/debian + no matching manifest for windows/amd64 10.0.20348 in the manifest list entries + Failed to build docker image + ``` + + Closes #993 + +- cmake: restore a dash char in comment [ci skip] + + It's a CMake comment header convention. + +GitHub (21 Apr 2023) +- [Dan Fandrich brought this change] + + tests: add AES-GCM protocol read tests (#992) + + Closes #992 + +- [Viktor Szakats brought this change] + + support encrypt-then-mac (etm) MACs (#987) + + Support for calculating MAC (message authentication code) on encrypted + data instead of plain text data. + + This adds support for the following MACs: + - `hmac-sha1-etm@openssh.com` + - `hmac-sha2-256-etm@openssh.com` + - `hmac-sha2-512-etm@openssh.com` + + Integration-patches-by: Viktor Szakats + + * rebase on master + * fix checksec warnings + * fix compiler warning + * fix indent/whitespace/eol + * rebase/manual merge onto AES-GCM patch #797 + * more manual merge of `libssh2_transport_send()` based + on dfandrich/shellfish + + Fixes #582 + Closes #655 + Closes #987 + +Viktor Szakats (20 Apr 2023) +- docs: fix typo in argument name [ci skip] + +- [Keith Dart brought this change] + + channel: add support for "signal" message + + Can send specific signals to remote process. Allows for slightly + improved remote process management, if the server supports it. + + Integration-patches-by: Viktor Szakats + + * doc updates + * change `signame_len` to `size_t` + * variable scopes + * fix checksrc warnings + + Closes #672 + Closes #991 + +- crypto: add `LIBSSH2_NO_AES_CBC` option + + Also rename internal `LIBSSH2_AES` to `LIBSSH2_AES_CBC`. + + Follow-up to 857e431648df6edcb3e17138d877f2e65d2d769d + + Closes #990 + +- tidy-up: indentation fixes [ci skip] + +GitHub (20 Apr 2023) +- [Dan Fandrich brought this change] + + Add support for AES-GCM crypto protocols (#797) + + Add support for aes256-gcm@openssh.com and aes128-gcm@openssh.com + ciphers, which are the OpenSSH implementations of AES-GCM cryptography. + It is similar to RFC5647 but has changes to the MAC protocol + negotiation. These are implemented for recent versions of OpenSSL only. + + The ciphers work differently than most previous ones in two big areas: + the cipher includes its own integrated MAC, and the packet length field + in the SSH frame is left unencrypted. The code changes necessary are + gated by flags in the LIBSSH2_CRYPT_METHOD configuration structure. + + These differences mean that both the first and last parts of a block + require special handling during encryption. The first part is where the + packet length field is, which must be kept out of the encryption path + but in the authenticated part (as AAD). The last part is where the + Authentication Tag is found, which is calculated and appended during + encryption or removed and validated on decryption. As encryption/ + decryption is performed on each packet in a loop, one block at a time, + flags indicating when the first and last blocks are being processed are + passed down to the encryption layers. + + The strict block-by-block encryption that occurs with other protocols is + inappropriate for AES-GCM, since the packet length shifts the first + encrypted byte 4 bytes into the block. Additionally, the final part of + the block must contain the AES-GCM's Authentication Tag, so it must be + presented to the lower encryption layer whole. These requirements mean + added code to consolidate blocks as they are passed down. + + When AES-GCM is negotiated as the cipher, its built-in MAC is + automatically used as the SSH MAC so further MAC negotiation is not + necessary. The SSH negotiation is skipped when _libssh2_mac_override() + indicates that such a cipher is in use. The virtual MAC configuration + block mac_method_hmac_aesgcm is then used as the MAC placeholder. + + This work was sponsored by Anders Borum. + + Integration-patches-by: Viktor Szakats + + * fix checksrc errors + * fix openssl.c warning + * fix transport.c warnings + * switch to `LIBSSH2_MIN/MAX()` from `MIN()`/`MAX()` + * fix indent + * fix libgcrypt unused warning + * fix mbedtls unused warning + * fix wincng unused warning + * fix old openssl unused variable warnings + * delete blank lines + * updates to help merging with the ETM patch + +Viktor Szakats (20 Apr 2023) +- tidy-up: align comments [ci skip] + +- tidy-up: whitespace nits [ci skip] + +- crypto: add/fix algo guards and extend `NO` options + + Add new guard `LIBSSH2_RSA_SHA1`. Add missing guards for `LIBSSH2_RSA`, + `LIBSSH2_DSA`. + + Fix warnings when all options are disabled. + + This is still not complete and it's possible to break a build with + certain crypto backends (e.g. mbedTLS) and/or combination of options. + It's not guaranteed that all bits everywhere get disabled by these + settings. Consider this a "best effort". + + Add these new options to disable certain crypto elements: + - `LIBSSH2_NO_3DES` + - `LIBSSH2_NO_AES_CTR` + - `LIBSSH2_NO_BLOWFISH` + - `LIBSSH2_NO_CAST` + - `LIBSSH2_NO_ECDSA` + - `LIBSSH2_NO_RC4` + - `LIBSSH2_NO_RSA_SHA1` + - `LIBSSH2_NO_RSA` + + The goal is to offer a way to disable legacy/obsolete/insecure ones. + + See also: 146a25a06dd2365a4330dad34fefcdcee1a206aa `LIBSSH2_NO_HMAC_RIPEMD` + See also: 38015f4e46d8dbeea522dc7ee664522d4f47fc75 `LIBSSH2_NO_DSA` + See also: be31457f3071686b555a0f0b19e5dcf63d67fc27 `LIBSSH2_NO_MD5` + + Closes #986 + +- scp: fix typo in comments [ci skip] + + Follow-up to 0a500b3554c29451708353279eefce750f4bca6c + +- base64: do not use `snprintf()` on encoding + + This also significantly (by 7-8x in my limited tests with a short + string) speeds up this function. The impact is still minor as this + function is only used in `knownhost.c` in release builds. + + Closes #985 + +- wincng: constify data arg of `libssh2_wincng_hash()` + + Tested in #979 + +- wincng: fix unused variables with `LIBSSH2_RSA_SHA2` disabled + + Tested in #979 + +- ci: delete config elements for unused 32-bit Linux builds + + They have been disabled since d9b4222ef1c5ab9b9e499fe6234556e5cca7c4fe + + Tested in #979 + +- ci: enable FIXTURE_TRACE_ALL_CONNECT for WinCNG tests + + To hopefully help finding the WinCNG hostkey verification + intermittent failure #804. + + Tested in #979 + +- tests: add `FIXTURE_TRACE_ALL_CONNECT` option + + Works like the `FIXTURE_TRACE_ALL` envvar, but enables full trace for + the connection phase only. + + Also fix a possible NULL deref with `FIXTURE_TRACE_ALL` and a failed + `libssh2_session_init_ex()`. + + Tested in #979 + +- ci: really enable logging in AppVeyor CMake builds + + `CONFIGURATION` was never passed to the cmake command, so it had + never enabled logging when set to `Debug`. + + Also `CONFIGURATION` is ambiguous depending on the "generator" used + by CMake. In case of Visual Studio, this is a build/ctest-time + setting, not a cmake-config parameter. + + So set this permanently to `Release` and enable logging via our + dedicated CMake option `ENABLE_DEBUG_LOGGING`. + + Tested in #979 + +- HACKING-CRYPTO: fix stray whitespace + +- tidy-up: fix more nits + + - fix indentation errors. + - reformat `cmake/FindmbedTLS.cmake` + - replace a macro with a variable in `example/sftp_RW_nonblock.c`. + - delete macOS macro `_DARWIN_USE_64_BIT_INODE` from the + OS/400 config header, `os400/libssh2_config.h`. + - fix other minor nits. + + Closes #983 + +- mansyntax: make it work on macOS, check reqs locally + + - use `gman` alias if present. This makes it work when the correct `man` + command is provided via `brew` on macOS. + + - move CMake attempts to detect tools necessary to run `mansyntax.sh` + into the script itself. + + - delete CMake TODO to move more test logic into CMake. This would make + it CMake-specific and require maintaining it separately for each build + tool. Just use our external script when a POSIX shell is available. + + Closes #982 + +- cmake: dedupe setting `-DHAVE_CONFIG_H` + + Move `libssh2_config.h` generation and setting `-DHAVE_CONFIG_H` to + the root `CMakeFile.txt`. + + Also move symbol hiding setup there. It needs to be done before + generating the config file for `LIBSSH2_API` value to be set in it. + + After this change the `HIDE_SYMBOLS` setting is accepted without an + annoying CMake warning when not actually building a shared libssh2 lib. + + Closes #981 + +- build: assume non-blocking I/O on Windows + + Drop checks from Windows builds and enable it based on `WIN32`. + + This saves detection time and also makes 3rd party builds simpler. + + Also: + + - delete `HAVE_DISABLED_NONBLOCKING`, that we used in build tools to + explicitly disable an explicit `#error` in `session.c`. + + - replace existing `WSAEWOULDBLOCK` check for Windows support with + `WIN32`. Cleaner with the same result. + + Follow-up to f1e80d8d8ce9570d81836da96ba02f4d4552a7b3 + Follow-up to 5644eea2161b17f7c16e18f3a10465ebb217ca1f + + Closes #980 + +- ci: rename Logging to Debug in AppVeyor + +- switch to internal base64 decode that uses size_t + + Make the public `libssh2_base64_decode()` a wrapper for that. + Bump up length sizes in callers. + + Also fix output size calculation to first divide then multiply. + + Closes #978 + +- tests: switch to debian:bullseye-slim in Dockerfile + + 'slim' provides all we need, with less bloat. + + Tested in #976 + + Follow-up to 78cb64a85955f2cd9700c4fbad3f02d589dd7169 + +- tests: build improvements and more + + - rename tests to have more succint names and a more useful natural + order. + + - rename `simple` and `ssh2` in tests to have the `test_` prefix. + + This avoids a name collisions with `ssh2` in examples. + + - cmake: drop the `example-` prefix for generated examples. + + Bringing their names in sync with other build tools, like autotools. + + - move common auth test code into the fixture and simplify tests by + using that. + + - move feature guards from CMake to preprocessor for auth tests. + + Now it works with all build tools and it's easier to keep it in sync + with the lib itself. + + For this we need to include `libssh2_priv.h` in tests, which in turn + needs tweaking on the trick we use to suppress extra MSVS warnings + when building tests and examples. + + - move mbedTLS blocklist for crypto tests from CMake to the test + fixture. + + - add ed25519 hostkey tests to `test_hostkey` and `test_hostkey_hash`. + + - add shell script to regenerate all test keys used for our tests. + + - alpha-sort tests. + + - rename `signed_*` keys to begin with `key` like the rest of the keys + do. + + - whitespace fixes. + + Closes #969 + +- autotools: rename a variable + + To match its counterpart we use for clang and to better match + the original code in curl. + + Follow-up to ec0feae7920d695ce234a5aba13014bf29824c09 + + Closes #977 + +- ssh2.sh: revert likely wrong quoting [ci skip] + + Follow-up to 50124428509ffc2f5d08d8d3c152fa36546c9a75 + +- build: add `-Wbad-function-cast` picky warning + + Also adjust minimum gcc versions in comment. + + Closes #975 + +- tests: restore debian:bullseye in Dockerfile + + Follow-up to 78cb64a85955f2cd9700c4fbad3f02d589dd7169 + +- session: simplify preprocessor logic + + - by using #elif + - by merging two blocks + + Closes #972 + +- tests: try debian:testing for Dockerfile + + Follow-up to 78cb64a85955f2cd9700c4fbad3f02d589dd7169 + +- src: add and use `LIBSSH2_MIN/MAX` macros + + Also for #797 + + Closes #974 + +- tests: switch Dockerfile to debian:testing-slim + + From debian:bullseye + + - doesn't need manual bumps. + - is ahead of stable and should be stable enough for our purpose. + - slim is saving resources. + + Closes #971 + +- cmake: optimize non-blocking tests on WIN32/non-WIN32 + + Skip testing unixy methods on Windows and vice versa. + + I continue to assume that CMake doesn't define `WIN32` with Cygwin + (as Cygwin doesn't define `_WIN32`/`WIN32` for C), though I haven't + tested this. + + Closes #970 + +GitHub (15 Apr 2023) +- [Jörgen Sigvardsson brought this change] + + scp: option to not quote paths (#803) + + A new flag named `LIBSSH2_FLAG_QUOTE_PATHS` has been added, to make + libssh2 not quote file paths sent to the remote's scp subsystem. Some + custom ssh daemons cannot handle quoted paths, and this makes this flag + useful. + + Authored-by: Jörgen Sigvardsson + +Viktor Szakats (15 Apr 2023) +- cmake: make Windows builds initialize faster + + By skipping unixy header checks that always fail with + the MSVC toolchain or all Windows toolchains. + + Closes #968 + +- cmake: use a single build rule for all tests + + - use the complete filename of test sources in the input list. + + - build all tests with the ability to access libssh2 internals. + + This is necessary for `test_keyboard_interactive_auth_info_request` + now and might be necessary for others in the future, e.g. to avoid + the depreacted public base64 decoding API. + + - move `test_keyboard_interactive_auth_info_request` into the main + test build loop. + + - move `simple` into the main test build loop too. + + - build `ssh2` also in static mode. + + - cleanup the way we detect and enable gcov. + + - fix indentation. + + Closes #967 + +- tidy-up: more whitespace in src + + Closes #966 + +- checksrc: fix `EQUALSNULL` warnings + + `s/([a-z0-9._>*-]+) == NULL/!\1/g` + + Closes #964 + +- Makefile.am: add new OS400 header [ci skip] + + Follow-up to 6dc42e9d625deb816a051d312d09e68926959e78 + +- checksrc: fix `NOTEQUALSZERO` warnings + + Closes #963 + +- checksrc: fix `SIZEOFNOPAREN` warnings + + `s/sizeof ([a-z0-9._>*-]+)/sizeof(\1)/g` + + Closes #962 + +- crypto: add `LIBSSH2_NO_HMAC_RIPEMD` option + + See also: 38015f4e46d8dbeea522dc7ee664522d4f47fc75 + See also: be31457f3071686b555a0f0b19e5dcf63d67fc27 + + Ref: https://github.com/stribika/stribika.github.io/issues/46 + + Closes #965 + +- tidy-up: example, tests continued + + - fix skip auth if `userauthlist` is NULL. + Closes #836 (Reported-by: @sudipm-mukherjee on github) + - fix most silenced `checksrc` warnings. + - sync examples/tests code between each other. + (output messages, error handling, declaration order, comments) + - stop including unnecessary headers. + - always deinitialize in case of error. + - drop some redundant variables. + - add error handling where missing. + - show more error codes. + - switch `perror()` to `fprintf()`. + - fix some `printf()`s to be `fprintf()`. + - formatting. + + Closes #960 + +- src: fix indentation of macro definitions (follow-up) + + Follow-up to d5438f4ba9036e8028f35258dd1ab97cc2edb37c + +- src: fix indentation of macro definitions + + And some comment cleanup. + + Closes #958 + +- example/ssh2_exec: drop conditional code for deprecated API + +GitHub (13 Apr 2023) +- [monnerat brought this change] + + Make OS/400 implementation work again (#953) + + * os400: support QADRT development files in a non-standard directory + + This enables the possibility to compile libssh2 even if the ascii + runtime development files are not installed system-wide. + + * userauth_kbd_packet: fix a pointer target type mismatch. + + A temporary variable matching the parameter type is used before copying + to the real target and checking for overflow (that should not occur!). + + * os400qc3: move and fix big number procedures + + A bug added by a previous code style cleaning is fixed. + _libssh2_random() now checks and return the success status. + + * os400qc3: fix cipher definition block lengths + + They were wrongly set to the key size. + + * Diffie-Hellman min/max modulus sizes are dependent of crypto-backend + + In particular, os400qc3 limits the maximum group size to 2048-bits. + Move definitions of these parameters to crypto backend header files. + + * kex: return an error if Diffie-Hellman key pair generation fails + + * os400: add an ascii assert.h header file + + * os400qc3: implement RSA SHA2 256/512 + +Viktor Szakats (13 Apr 2023) +- sftp: add open functions with custom attribute support + + Before this patch, libssh2 sent hardcoded `LIBSSH2_SFTP_ATTRIBUTES` + struct on handle open. This can be problematic on some special OS, + where the file size should be known on new file creation. I added + two new functions to resolve this issue. + + Patch-by: @vajdaakos on github via #506 + + Changes compared to #506: + - drop attr size fixup in favour of #946. + - move `memcpy()` under the state where we need it. + - bump filename length type to `size_t`. + - fix filenames in documentation and other nits. + + Closes #506 + Closes #947 + +- build: speed up and extend picky compiler options + + Implement picky warnings with clang in autotools. Extend picky gcc + warnings, sync them between build tools and compilers and greatly + speed up detection in CMake. + + - autotools: enable clang compiler warnings with `--enable-debug`. + + - autotools: enable more gcc compiler warnings with `--enable-debug`. + + - autotools/cmake: sync compiler warning options between gcc and clang. + + - sync compiler warning options between autotools and cmake. + + - cmake: reduce option-checks to speed up the detection phase. + Bring them down to 3 (from 35). Leaving some checks to keep the + CMake logic alive and for an easy way to add new options. + + clang 3.0 (2011-11-29) and gcc 2.95 (1999-07-31) now required. + + - autotools logic copied from curl, with these differences: + + - delete `-Wimplicit-fallthrough=4` due to a false positive. + + - reduce `-Wformat-truncation=2` to `1` due to a false positive. + + - simplify MinGW detection for `-Wno-pedantic-ms-format`. + + - cmake: show enabled picky compiler options (like autotools). + + - cmake: do compile `tests/simple.c` and `tests/ssh2.c`. + + - fix new compiler warnings. + + - `tests/CMakeLists.txt`: fix indentation. + + Original source of autotools logic: + - https://github.com/curl/curl/blob/a8fbdb461cecbfe1ac6ecc5d8f6cf181e1507da8/acinclude.m4 + - https://github.com/curl/curl/blob/a8fbdb461cecbfe1ac6ecc5d8f6cf181e1507da8/m4/curl-compilers.m4 + + Notice that the autotools implementation considers Apple clang as + legacy clang 3.7. CMake detection works more accurately, at the same + time more error-prone and difficult to update due to the sparsely + documented nature of Apple clang option evolution. + + Closes #952 + +- include: delete leading underscore from macro name + + It can cause compiler warnings in 3rd-party code. + + Follow-up to 59666e03f04927e5fe3e8d8772d40729f63c570e + + Closes #957 + +- ci: use OpenSSL 3 on AppVeyor VS2022 images + + Closes #954 + +- build: be friendly with 3rd-party build tools + + After recent build changes, 3rd party build that took the list of + C source to compile them as-is, stopped working as expected, due to + `blowfish.c` and crypto-backend C sources no longer expected to compile + separately but via `bcrypt_pbkdf.c` and `crypto.c`, respectively. + + This patch ensures that compiling these files directly result in an + empty object instead of redundant code and duplicated symbols. + + Also: + - add a compile-time error if none of the supported crypto backends + are enabled. + - fix `libssh2_crypto_engine()` for wolfSSL and os400qc3. + Rearrange code to avoid a hard-to-find copy of crypto-backend + selection guards. + + Follow-up to 4f0f4bff5a92dce6a6cd7a5600a8ee5660402c3f + Follow-up to ff3c774e03585252b70a9ee0fcf254de7b14a767 + + Closes #951 + +- sftp: calculate attr size based on attr content in `sftp_open()` + + Improve robustness by replacing constant argument of `sftp_attrsize()` + in `sftp_open()` with the actual `flag` value read from the `attr` we + plan to transfer. Restores state of this before + 37624b61e3ec4aa65a608800613d00b55ced56d7. + + Prerequisite for #947, #506. + + Also improve readability a bit and link to SFTP specs. Delete comment + about version 6: The latest spec no longer features the mentioned + "DO NOT IMPLEMENT" notice. + + Closes #946 + +- man: fixups + + - add missing `.fi` tags. + - fix misplaced `.nf` tags. + - add `.nf`/`.fi` tags `SYNOPSIS` where missing. + - fix missing/wrong function name from `SH NAME`. + - fix wrong function name in `TH`. + - keep return values in a separate line. + - indent. + - fold long lines. + - deleted `libssh2_channel_direct_streamlocal()`, there is no such function. + - add missing types. + - add missing headers. + + Closes #949 + +- include: indentation fixes + +- tidy-up: misc & minor cmake MSVS fix + + - `libssh2.rc`: document language/codepage codes. + + Ref: https://learn.microsoft.com/windows/win32/intl/code-page-identifiers + + - convert to Markdown: `docs/BINDINGS`, `docs/HACKING` + + Blind update for `vms/libssh2_make_help.dcl`. Please double-check. + + - cmake: fix to recognize dash-style warning options (`-Wn`) with MSVC. + + - `NMakefile`: sync `rd` command with `Makefile.mk`. + + - delete a CVS header. + + - cmake: simplify a `LIBSSH2_HAVE_ZLIB` macro. + + - few other nits and whitespace mods. + + Closes #943 + +GitHub (10 Apr 2023) +- [Viktor Szakats brought this change] + + Support for direct-streamlocal@openssh.com UNIX socket connection (#945) + + This patch allow to use direct-streamlocal service from OpenSSH 6.7, + that allows UNIX socket connections. + + Mods: + - delete unrelated condition: + Ref: https://github.com/libssh2/libssh2/pull/216#discussion_r374748111 + - rebase on master, whitespace updates. + + Patch-by: @gjalves Gustavo Junior Alves + + Closes #216 + Closes #632 + Closes #945 + +Viktor Szakats (10 Apr 2023) +- build: support `libssh2.rc` with autotools + + Caveat: When building `--enable-static` and `--enable-shared` at the + same time, the compiled Windows resource is also included in the + static library. This appears to be an autotools limitation, with no + way to have different input lists (or different custom options) for + shared and static libraries, even though it builds them separately. + + The workaround is to build static libraries in a separate + `./configure` + `make` pass. + + Closes #944 + +- crypto: add `LIBSSH2_NO_DSA` to disable DSA support + + See also: be31457f3071686b555a0f0b19e5dcf63d67fc27 + + Closes #942 + +- build: unify source lists + + - introduce `src/crypto.c` as an umbrella source that does nothing else + than include the selected crypto backend source. Moving this job from + the built-tool to the C preprocessor. + + - this allows dropping the various techniques to pick the correct crypto + backend sources in autotools, CMake and other build method. Including + the per-backend `Makefile..inc` makefiles. + + - copy a trick from curl and instead of maintaining duplicate source + lists for CMake, convert the GNU Makefile kept for autotools + automatically. Do this in `docs`, `examples` and `src`. + + Ref: https://github.com/curl/curl/blob/dfabe8bca218d2524af052bd551aa87e13b8a10b/CMakeLists.txt#L1399-L1413 + + Also fixes missing `libssh2_setup.h` from `src/CMakeFiles.txt` after + 59666e03f04927e5fe3e8d8772d40729f63c570e. + + - move `Makefile.inc` from root to `src`. + + - reformat `src/Makefile.inc` to list each source in separate lines, + re-align the continuation character and sort the lists alphabetically. + + - update `docs/HACKING-CRYPTO` accordingly. + + - autotools: update the way we add crypto-backends to `LIBS`. + + - delete old CSV headers, indent, and merge two lines in + `docs/Makefile.am` and `src/Makefile.am`. + + - add `libssh2.pc` to `.gitignore`, while there. + + Closes #941 + +GitHub (9 Apr 2023) +- [Zenju brought this change] + + sftp: always clear protocol error (#787) + +Viktor Szakats (9 Apr 2023) +- cmake: add `HIDE_SYMBOLS` option & do symbol hiding on *nix + + - implement symbol hiding on non-Windows platforms. + + The essence of the detection logic was copied from: + https://github.com/curl/curl/blob/dfabe8bca218d2524af052bd551aa87e13b8a10b/CMake/CurlSymbolHiding.cmake + + Then simplified and shortened. This method doesn't require a recent + CMake version, nor an external, auto-generated C header. + + Move `configure_file()` after `set(LIBSSH2_API ...)`, for the config + file to pick up `LIBSSH2_API`s value. + + Closes #602 + + - add CMake option `HIDE_SYMBOLS`. + + This setting means to hide non-public functions from the libssh2 + dynamic library when set to `ON`. The default. + + When set to `OFF`, make all non-static/internal functions visible + in the dynamic library. + + This setting requires `BUILD_SHARED_LIBS=ON`. + + - honor this setting on Windows. + + By setting the `LIBSSH2_EXPORTS` manual macro again, and stop + recognizing the automatic CMake macro for this purpose: + `libssh2_shared_EXPORT`. + + Closes #939 + +- build: make `windows.h` even leaner + + Disable GDI and NLS features in `windows.h`. libssh2 doesn't use these. + + Closes #940 + +- blowfish: build improvements + + - include `blowfish.c` into `bcrypt_pbkdf.c`, instead of + compiling it as a distinct object. + + - make low-level blowfish functions static. This prevents this symbols + to pollute the public namespace of libssh2. It also allows the + compiler to inline these functions. + + - integrate `blf.h` header into `bcrypt_pbkdf.c` as well. + + - use `_DEBUG_BLOWFISH` instead of `#if 0`. + + - fix `_DEBUG_BLOWFISH` compiler warnings and other nits. + + - `#undef` `inline` before redefining it in `libssh2_priv.h`. + (copied from `blowfish.c`) + + - delete unused `inline` redefinitions from `blowfish.c`. + + - disable unused low-level blowfish functions. + + - formatting, header order. + + Closes #938 + +- libssh2.rc: fix debug flag, other cleanups + + - fix to use `LIBSSH2DEBUG` macro to set the debug flag. + (was `DEBUGBUILD`, a curl-specific macro) + + - use manifest constants instead of literals + + - change language to neutral + + Closes #937 + +- tidy-up: example, tests + + - drop unnecessary `WIN32`-specific branches. + + - add `static`. + + - sync header inclusion order. + + - sync some common code between examples/tests. + + - fix formatting/indentation. + + - fix some `checksrc` errors not caught by `checksrc`. + + Closes #936 + +- tests/mansyntax.sh: avoid `if !` for portability + + Ref: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Limitations-of-Builtins.html#Limitations-of-Builtins + + Fixes #704 + Closes #935 + +- tidy-up: indentation in guarded #includes [ci skip] + +- Makefile.mk: drop `PROOT` variable [ci skip] + +- build: hand-crafted config rework & header tidy-up + + - introduce the concept of a project level setup header + `src/libssh2_setup.h`, that is used by `src`, `example` and `tests` + alike. Move there all common platform/compiler configuration from + `src/libssh2_priv.h`, individual sources and `CMakeFiles.txt` files. + Also move there our hand-crafted (= not auto-generated by CMake or + autotools) configuration `win32/libssh2-config.h`. + + - `win32` directory is empty now, delete it. + + - `Makefile.mk`: adapt to the above. Build-directory is the target + triplet, or any custom name set via `BLD_DIR`. + + - sync header path order between build systems: + build/src -> source/src -> source/include + + - delete redundant references to `windows.h`, `winsock2.h`, + `ws2tcpip.h`. + + - delete unnecessary #includes, update order (`libssh2_setup.h` first, + `winsock2.h` first), simplify where possible. + + This makes the code warning-free without `WIN32_LEAN_AND_MEAN`. + At the same time this patch applies this macro globally, to avoid + header bloat. + + - example: add missing *nix header guards. + + - example: fix misindented `HAVE_UNISTD_H` `#ifdef`s. + + - set `WIN32` with all build-tools. + + - set `HAVE_SYS_PARAM_H` in the hand-crafted config for MinGW. + To match auto-detection. + + - move a source-specific macro to `misc.c` from `libssh2_priv.h`. + + See the PR's individual commits for step-by-step updates. + + Closes #932 + +- Makefile.mk: build tests and other improvements [ci skip] + + - use `example` target for building examples (was: `test`). + + - add support for building tests via the `test` target. + + - accept lib-only options in a new `LIBSSH2_CPPFLAGS_LIB` variable. + + Useful to pass `-DLIBSSH2_EXPORTS` for correct `dllexport` in + `libssh2.dll`. + + - fix to put dynamic library in lib directory for non-Windows builds + + - fix to not delete lib objects on `testclean` + +- test_warmup: re-implement as `test()` + + Instead of overriding `main()`. To align with the other tests. + + Overriding `main()` can cause duplicate symbols without using a lib for + the `runner` code. + + Follow-up to 40ac6b230a309d35c57aa65a8f6d7ab6654aa3d8 + + Closes #934 + +- NMakefile: drop `/DEBUG` linker option in release mode [ci skip] + +- NMakefile: simplify [ci skip] + +- Makefile.mk: merge two rules [ci skip] + +- TODO: update item about compiler warnings [ci skip] + + Follow-up to 08354e0abbe86d4cc5088d210d53531be6d8981a + Follow-up to 29347905721d2e7fbb97dabfb0071bee51db3013 + Follow-up to 5a96f494ee0b00282afb2db2e091246fc5e1774a + Follow-up to 463449fb9ee7dbe5fbe71a28494579a9a6890d6d + Follow-up to 02f2700a61157ce5a264319bdb80754c92a40a24 + +GitHub (5 Apr 2023) +- [ihsinme brought this change] + + example/x11: Add null-termination (#749) + +Viktor Szakats (5 Apr 2023) +- crypto: fix `LIBSSH2_NO_MD5` compiler warnings + + Follow-up to be31457f3071686b555a0f0b19e5dcf63d67fc27 + + Closes #933 + +- build: add new man pages + + Follow-up to c20c81ab105cdf27f5a4e2604bd13085f46e21de + +GitHub (5 Apr 2023) +- [Daniel Silverstone brought this change] + + Configurable session read timeout (#892) + + This set of changes provides a mechanism to runtime-configure the + previously #define'd timeout for reading packets from a session. The + intention here is to also extend libcurl to be able to use this + interface so that when fetching from sftp servers which are very slow + to return directory listings, connections do not time-out so much. + + * Add new field to session to hold configurable read timeout + + * Updated `_libssh2_packet_require()`, `_libssh2_packet_requirev()`, + and `sftp_packet_requirev()` to use new field in session structure + + * Updated docs for API functions to set/get read timeout field in + session structure + + * Updated `libssh2.h` to declare the get/set read timeout functions + + Co-authored-by: Jon Axtell + Credit: Daniel Silverstone + +Viktor Szakats (4 Apr 2023) +- cmake: whitespace fixes [ci skip] + +- libssh2.h: bump LIBSSH2_COPYRIGHT year [ci skip] + +- Makefile.mk: move portable GNU Make file to the root + + Move the GNU Make file formerly known as `win32/GNUmakefile` to the + root directory from `win32`. It now supports any platform with a + GCC-like toolchain, while also keeping support for win32. + + For non-Windows platforms it's necessary to provide a hand-crafted + `libssh2_config.h` header for now. + + Usage: `make -f Makefile.mk` + +- src: include `limits.h` for `*_MAX` macros + + Follow-up to 5a96f494ee0b00282afb2db2e091246fc5e1774a + + Reported-by: OldWorldOrdr on github + Fixes #928 + Closes #930 + +- build: MSVS warning suppression option tidy-up + + - in `win32/libssh2_config.h` replace `_CRT_SECURE_NO_DEPRECATE` with + `_CRT_SECURE_NO_WARNINGS`, to use the official macro for this, like + in CMake. + + Also, it's now safe to move it back under `_MSC_VER`. + + Suppressing: + + `warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead.` + `warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead.` + + - move `_CRT_NONSTDC_NO_DEPRECATE` to `example` and `tests`. + Not needed for `src`. + + Suppressing: + + `warning C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strdup.` + `warning C4996: 'write': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _write.` + + - move `_WINSOCK_DEPRECATED_NO_WARNINGS` from source files to + CMake files, in `example` and `tests`. Also limit this to MSVC. + + Suppressing: + + `warning C4996: 'inet_addr': Use inet_pton() or InetPton() instead` + + TODO: try fixing these instead of suppressing. + + Closes #929 + +- win32/GNUmakefile: make it movable [ci skip] + + - add `BLD_DIR` to customize the output directory (where libs, .zip, + obj subdir will go). This directory must exist. + + It remains `./win32` for Windows builds. + + - add `CONFIG_H_DIR` option to customize `libssh2_config.h` location. + + It remains `./win32` for Windows builds. + + - include `.def` in distro zip for Windows. + + - ready to move to the root directory. + +- win32/GNUmakefile: drop an unnecessary variable [ci skip] + +- windows: re-add `libssh2.rc` + + Lost while moving it from the win32 directory + + Follow-up to 194cfc0f84192809c87f846140e5bf06b7a864af + +- crypto: add `LIBSSH2_NO_MD5` to disable MD5 support + + Closes #927 + +- hostkey: fix `hash_len` field constants + + Replace incorrect `MD5_DIGEST_LENGTH` with `SHA_DIGEST_LENGTH` for these + hostkey algos: + + - `ssh-rsa` and `ssh-dss` + + Ref: 7a5ffc8cee259bbde82ab92515cd8fea2166854b (2004-12-07 Initial) + + - `ssh-rsa-cert-v01@openssh.com` + + Ref: 4b21e49d9d2db74579b18804ed1f5eeb16578b2f (2022-07-28) + Ref: #710 + + Also delete local fall-back definition of `MD5_DIGEST_LENGTH` (added + in 9af7eb48dc3854ce8ee0589f7e2beb944e064847). Macro is no longer used. + + Reported-by: Markus-Schmidt on github + Fixes #919 + Closes #926 + +- ci: add MSVS 2008/2010 build tests and fix warnings + + Also: + + - fix newly surfaced (bogus) warnings in examples with MSVS 2010: + + ``` + ..\..\example\direct_tcpip.c(262): warning C4127: conditional expression is constant + ``` + Happens for every `FD_SET()` macro reference. + + Ref: https://ci.appveyor.com/project/libssh2org/libssh2/builds/46677835/job/ni4hs97bh18c14ap + + - silence MSVS 2010 predefined Windows macro warnings: + + ``` + ..\..\src\wincng.c(867): warning C4306: 'type cast' : conversion from 'int' to 'LPCSTR' of greater size + ..\..\src\wincng.c(897): warning C4306: 'type cast' : conversion from 'int' to 'LPCSTR' of greater size + ..\..\src\wincng.c(1132): warning C4306: 'type cast' : conversion from 'int' to 'LPCSTR' of greater size + ``` + + Ref: https://ci.appveyor.com/project/libssh2org/libssh2/builds/46678071/job/08t5ktvkcgdghp7r + + Closes #925 + +- transport: rename local `RANDOM_PADDING` macro + + Rename `RANDOM_PADDING` macro used internally to enable some code. + + Committed in the initial version of `transport.c` in + 9d55db6501aa4e21f0858cf36cdc2ddc11b96e83 (2007-02-02). libssh2 code + never defined it. + + The name happens to collide with a Windows macro in `wincrypt.h`. + `transport.c` doesn't include this header, but it includes `winsock2.h`, + and it turns out it can also define this macro in some cases, e.g. + when `WIN32_LEAN_AND_MEAN` is not set. + + To be on the safe side, prefix the name with `LIBSSH2_` to avoid + enabling it by accident. + + Q: Maybe it'd be best to delete it with the guarded code? + + Reported-by: Markus-Schmidt on github + Fixes #921 + Closes #924 + +- windows: move `libssh2.rc` to the `src` directory + + Closes #918 + +- autotools: delete unused conditional `HAVE_SYS_UN_H` + + No longer necessary after moving the disabling/enabling logic from + build tool to `example/x11.c`. + + Reverts 4774d500e724bc4e548f743a0cb644ab05599474 + Follow-up to d245c66cc0029e480674394c23e8be1c9410f7ad + +- win32/GNUmakefile: update help & exit without crypto backend [ci skip] + + Follow-up to: 5bcd25c4c980e9765c00a2f20ac5348635063aad + Follow-up to: 68fd02fba002c8c6af3ba51a2780de46b47b3787 + +- build: respect autotools `DLL_EXPORT` in `libssh2.h` + + The `DLL_EXPORT` macro is automatically set by autotools when building + the libssh2 DLL. Certain toolchains might require this to correctly + export symbols, so make sure to respect it in `libssh2.h` to enable + `declspec(dllexport)`. + + With this patch we have a manual macro for that (`LIBSSH2_EXPORT`), + this autotools one, the CMake one, and `_WINDLL` (added in + c355d31ff94a1622526c4988b9d09074f7f7605d), possibly defined by Visual + Studio. + + Closes #917 + +- build: make `HAVE_LIBCRYPT32` local to `wincng.c` + + libssh2 uses `wincrypt.h` aka the `crypt32` Windows system library + for the function `CryptDecodeObjectEx()` [1]. This function has been + available for Win32 (and UWP/WinRT apps) for a long while. Even old + MinGW supports it, and also Watcom 1.9, of the rare/old compilers + I checked. + + CMake had it permanently enabled, while it also did an extra check + for the header to add the lib to the lib list. Autotools did the + detection proper. Other builds had it permanently enabled. + + It seems safe to assume this function/header/lib is available in all + environments we support. + + In this patch we simplify by deleting these detections and feature + flags from all build tools. + + Keep the feature flag internal to `wincng.h`, and for extra safety add + the new macro `LIBSSH2_WINCNG_DISABLE_WINCRYPT` do disable it via + custom `CPPFLAGS`. + + WinCNG's other requirement is `bcrypt`. That also has been universally + available for a long time. Here the only known outlier is old/legacy + MinGW, which is missing support. + + [1] https://learn.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptdecodeobjectex + + Closes #916 + +- autotools: delete `src/libssh2.pc.in` reference [ci skip] + + Follow-up to 06f281921907fa077884c7020917661ca805b9d3 + +- tidy-up: null-mac/cipher documentation + + Move documentation for these deleted build-level options from + autotools/cmake docs to the source code itself. + + Follow-up to 50c9bf868e833258d23c5f55ed546d1fcd5687d0 + + Closes #915 + +- cmake: re-use existing `libssh2.pc` template + + Instead of maintaining a second copy of `libssh2.pc.in` in `src` just + for CMake, teach CMake to use the existing template in the root dir, + that we already use with autotools. + + Closes #914 + +- delete redundant `HAVE_STDLIB_H` + + libssh2 used this standard C89 header unconditionally before this patch. + + Delete the feature checks and all unnecessary header guards. + + Closes #913 + +- NMakefile: drop redundant variable and assignments [ci skip] + +- delete redundant `HAVE_WINSOCK2_H` + + `libssh2.h` required `winsock2.h` for `_WIN32` since + 81d53de4dc5ee39bd6215958c7dce3b12731195e (2011-06-04). + + Apply that to the whole codebase. This makes it unnecessary to detect + `HAVE_WINSOCK2_H` and allows to drop all its uses. + + Completes TODO from b66d7317ca6c882afbe52fe426f68c119c40d348 + + TODO: Straighten out the use a mixture of `HAVE_WINDOWS_H`, + `WIN32`, `_WIN32` to detect Windows. + +- cmake: detect WinCNG last + + This gives a chance to auto-detect mbedTLS on Windows with CMake. + +- NMakefile: rename config variables, default to WinCNG [ci skip] + + - replace `OPENSSLINC` and `OPENSSLLIB` with `OPENSSL_PATH`. + Assume `include` and `lib` subdirs for headers and libs. + + - replace `WITH_ZLIB`, `ZLIBINC` and `ZLIBLIB` with `ZLIB_PATH`. + Assume `include` and `lib` subdirs for header and lib. + + - make WinCNG the default if `WITH_OPENSSL` is not set. + +- win32/GNUmakefile: rename object dir and update .gitignore [ci skip] + + From `-{release|debug}` to `{release|debug}-`. + + Follow-up to 68fd02fba002c8c6af3ba51a2780de46b47b3787 + +- win32/GNUmakefile: add libgcrypt support [ci skip] + + In the previous commit 969487113aae856e43d3d905c3f2260246d44f9b, + the commit message should read `win32/GNUmakefile: ` instead of + `libssh2-gnumake.sh: `. Sorry for the mixup. + +- libssh2-gnumake.sh: make variable names platform-agnostic [ci skip] + + Also more consistent. Refer to DLL/SO/shared as 'dyn'. + + Also add comment on how to find customizable environment variables. + +- win32/GNUmakefile: make it support non-Windows builds [ci skip] + + With 20-ish extra lines, make this Makefile support all GCC-like + toolchains. + + The temporary directory becomes `-{release|debug}` from + the former `{release|debug}`. + + Also change the lib directory name in the `dist` package from + `win32` to `lib`, to match other packages and build tools. + +- win32/GNUmakefile: default to WinCNG [ci skip] + + Also check for wolfSSL before mbedTLS to match CMake. + +- win32/GNUmakefile: fixups to previous commit [ci skip] + + - `-lws2_32` is necessary when building examples. + + - drop a temporary variable. + + Follow-up to d245c66cc0029e480674394c23e8be1c9410f7ad + +- delete redundant `HAVE_WS2TCPIP_H` + + It was used once in `src/libssh2_priv.h`, but without any effect. + The header included `ws2tcpip.h` twice, once guarded by + `HAVE_WS2TCPIP_H` and another time by `HAVE_WINSOCK2_H`. + + Dedupe these to not use `HAVE_WS2TCPIP_H`. Then delete detection + of this feature from all build methods. + + TODO: Replace `HAVE_WINSOCK2_H` with `_WIN32`/`WIN32`. + +- win32/libssh2_config.h: set `HAVE_LONGLONG` & `HAVE_STDLIB_H` [ci skip] + + - enable `HAVE_LONGLONG` for MinGW and MSVC versions supporting it. + + Necessary for `GNUmakefile`/`NMakefile` builds to create the same + binaries as CMake/autotools ones do. + + - enable `HAVE_STDLIB_H`. It has been universally available on + Windows for a long time. + + Fixes these clang-cl warnings: + ``` + src\wincng.c(444,5) : warning: implicit declaration of function 'free' is invalid in C99 [-Wimplicit-function-declaration] + free(buf); + ^ + src\wincng.c(491,20) : warning: implicitly declaring library function 'malloc' with type 'void *(unsigned long long)' [-Wimplicit-function-declaration] + pbHashObject = malloc(dwHashObject); + ^ + src\wincng.c(491,20) : note: include the header or explicitly provide a declaration for 'malloc' + src\wincng.c(2106,14) : warning: implicitly declaring library function 'realloc' with type 'void *(void *, unsigned long long)' [-Wimplicit-function-declaration] + bignum = realloc(bn->bignum, length); + ^ + src\wincng.c(2106,14) : note: include the header or explicitly provide a declaration for 'realloc' + 3 warnings generated. + ``` + +- example: make `x11` exclusion build-tool-agnostic + + Whether to build the `x11` example or not was decided by each build + tool. CMake didn't build it even on supported platforms. GNUMakefile + used a specific blocklist for it, while autotools enabled it based on + feature-detection. + + Migrate the enabler logic to an #ifdef in source and build `x11` + unconditionally with all build tools. + + On unsupported platforms (=Windows) this program now displays a short + message stating that fact. + + Also: + + - fix `x11.c` warnings uncovered after CMake started building it. + + - use `libssh2_socket_t` type for portability in `x11.c` too. + + - use detected header guards in `x11.c`. + + - delete a duplicate reference to `-lws2_32` from `win32/GNUmakefile` + while there. + + Closes #909 + +- .gitignore updates [ci skip] + +- tidy-up: whitespace, sorting, comment and naming fixups + +- cmake: add missing man pages + +- cmake: dedupe and merge config detection + + Before this patch CMake did feature detections in three files: + `src/CMakefiles.txt`, `examples/CMakefiles.txt` and + `tests/CMakefiles.txt`. + + Merge and move them to the root `CMakefiles.txt`. + + After this patch we end up with a single `src/libssh2_config.h`. This + brings CMake in sync with autotools builds, which already worked with + a single config header. + + This also prevents mistakes where feature detection went out of sync + between `src` & `tests` (see ae90a35d15d97154ac0c8554bce99ebfb18ee825). + `tests` do compile sources from `src` directly, so these should always + be in sync. + + It also allows to better integrate hand-crafted, platform-specific + config headers into the builds, like the one currently residing in + the `win32` directory (and also in `vms` and `os400`). Subject to an + upcoming PR. + + Also fix a warning revealed after this patch made CMake correctly + enable `HAVE_GETTIMEOFDAY` for `example` programs. + + Closes #906 + +- cmake: dedupe crypto-backend detection + + Before this patch CMake did crypto-backend detection in both + `src/CMakefiles.txt` and `tests/CMakefiles.txt`. + + Merge them and move it to the root `CMakefiles.txt`. + + While here, also add zlib for OpenSSL. Necessary when using OpenSSL + builds with zlib enabled. + + Closes #905 + +- cmake: add missing #cmakedefines to src + + - `HAVE_MEMSET_S` missing since + 03092292597ac601c3f9f0c267ecb145dda75e4e (2018-08-02) + + - `HAVE_EXPLICIT_BZERO` and `HAVE_EXPLICIT_MEMSET` missing since + 00005682f7b9a1aa42be50e269056ea873637047 (2023-03-28) + +GitHub (31 Mar 2023) +- [Viktor Szakats brought this change] + + tidy-up: NMakefile (#903) + +Viktor Szakats (30 Mar 2023) +- GNUmakefile: adjust win32/.gitignore [ci skip] + +- build: delete references to deleted NMake files [ci skip] + + Follow-up to 057522bb0f15c10c33159e12899ecc60e40aa6ef + +GitHub (30 Mar 2023) +- [Viktor Szakats brought this change] + + NMakefile: merge them into a single file [ci skip] (#902) + + Also: + + - allow to override `AR` and `ARFLAGS`. + + - The extra `src` subdir in the target directory is no longer, to + simplify things. + + - gone the dynamically generated `objects.mk`. Now replaced with some + tricky logic to do that inline. + + - add necessary `LIBS` for WinCNG. (untested) + + Lightly tested via clang-cl. + +- [Viktor Szakats brought this change] + + maketgz: tidy-up [ci skip] (#901) + + - fix shellcheck warnings: + - use quotes + - use `$()` + - use `printf` (instead of calling perl). + - indent. + - copy/adapt header comment from curl to `maketgz`. + +- [Viktor Szakats brought this change] + + ci: flatten AppVeyor jobs, add debug builds (#900) + + This results in better job names (now including CPU), avoiding the + complex exception rules, and fine-tuning the order and variation of + these tests. + + Enable `LIBSSH2DEBUG` for two of the existing jobs. + +- [Viktor Szakats brought this change] + + ci: add VS2022 builds (incl. ARM64) to AppVeyor (#899) + + - add MSVS 2022 WinCNG builds for x64 and ARM64, + replacing MSVS 2013 WinCNG builds for x64 and x86. + + - add MSVS 2022 OpenSSL builds for x64. + + - fix a compiler warning uncovered by the new ARM64 build: + + ``` + tests\openssh_fixture.c(393,17): warning C4477: 'fprintf' : format string '%d' requires an argument of type 'int', but variadic argument 1 has type 'libssh2_socket_t' + tests\openssh_fixture.c(393,17): message : consider using '%lld' in the format string + tests\openssh_fixture.c(393,17): message : consider using '%Id' in the format string + tests\openssh_fixture.c(393,17): message : consider using '%I64d' in the format string + ``` + + - echo the actual CMake command-line. + + - cmake: echo the DLL filenames found by the OpenSSL DLL-finder + heuristics. + + - cmake: delete `libcrypto.dll` and `libssl.dll` names from the above + logic. + + I've added these in 19884e5055b6c65f0df93d7cc776a01c518a2f06. That + resulted in CMake picking up a rogue `libcrypto.dll` (with no + `libssl.dll` pair) from `C:\Windows\System32\` on the + `Visual Studio 2022` image, breaking tests. + + Turns out, OpenSSL v1.0.2 uses the "EAY" names, but let's not re-add + those either, because CMake mis-picks those up from + `C:/OpenSSL-Win64/bin/`, even while pointing `OPENSSL_ROOT_DIR` to a + v1.1.1 installation. + + - cmake: set `NO_DEFAULT_PATH` for OpenSSL DLL lookup to avoid picking + up all kinds of wrong DLLs. CMake considers not the first, but the + _last_ hit the valid one. This happened to be + `C:/Program Files/Meson/lib*-1_1.dll` when using the + `Visual Studio 2022` image. + + Ref: https://cmake.org/cmake/help/latest/command/find_file.html + + - cmake: leave two commented debug lines that will be useful next time + the DLL detection lookup goes wrong. + + Ref: https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_DEBUG_MODE.html + + - on error, also dump `CMakeFiles/CMakeConfigureLog.yaml` if it exists + (requires CMake 3.26 and newer) + +- [Viktor Szakats brought this change] + + src: fix compiler warning on Darwin (#898) + + ``` + src/session.c:675:52: warning: implicit conversion loses integer precision: 'long' to '__darwin_suseconds_t' (aka 'int') [-Wshorten-64-to-32] + tv.tv_usec = (ms_to_next - tv.tv_sec*1000) * 1000; + ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~ + ``` + +Viktor Szakats (29 Mar 2023) +- tidy-up: tabs to spaces in Makefile.am [ci skip] + + Follow-up to 2f16d8105c9491beb2a02b3081f4f1c2a224fa62 + +GitHub (29 Mar 2023) +- [Viktor Szakats brought this change] + + netware: delete support (#888) + + Last related commit happened 15 years ago. + NetWare had it last release in 2009. + + All links referenced from the make file are inaccessible. + +- [Viktor Szakats brought this change] + + wolfssl: add workaround for HMAC_Update() len arg difference (#897) + + It's `int` in wolfSSL. `size_t` in OpenSSL/quictls/LibreSSL/BoringSSL. + + Ref: https://github.com/wolfSSL/wolfssl/blob/ba47562d182e10e59813da012e0ab8ef20892231/wolfssl/openssl/hmac.h#L60-L61 + + /cc @wolfSSL + +- [Viktor Szakats brought this change] + + cmake: introduce variables for lib target names (#896) + + Make our CMake config more self-documenting by introducing variables + for the shared and static lib target names. Without this, it might be + non-trivial to find out which line is referring to a target name vs + libname, export name or other occurrences of `libssh2`. + + This allows to rename back the shared lib target name to the value used + before 4e2580628dd1f8dc51ac65ac747ebcf0e93fa3d1: + `libssh2_shared` -> `libssh2`, if necessary for compatibility. Notice: + before that patch, `libssh2` name referred to either the static or + shared lib, depending on build settings. + +- [Viktor Szakats brought this change] + + detect and use explicit_bzero() and explicit_memset() (#895) + + Also skip detecting these and `memset_s()` for Windows targets in CMake, + to save detection time. On Windows we always use `SecureZeroMemory()`. + +- [Viktor Szakats brought this change] + + ci: bump mbedtls (#894) + +- [Viktor Szakats brought this change] + + GNUmakefile: minor fix for DYN mode [ci skip] (#893) + + Follow-up to b8762c1003d97e109efa587bdc760ff9873949eb + +- [Viktor Szakats brought this change] + + build: delete MS Dev Studio build files (#891) + + Last updated in 2007. + + Also delete `VCPROJ` target remains (necessary files seem to have + been missing from the repo all along) for Visual Studio 2008. + +Viktor Szakats (28 Mar 2023) +- checksrc: fix reference in Makefile.am, update options [ci skip] + +GitHub (28 Mar 2023) +- [Viktor Szakats brought this change] + + build: delete native Watcom wmake support with Win32 (#889) + + CMake supports generating Watcom wmake files: + https://cmake.org/cmake/help/v3.1/generator/Watcom%20WMake.html + +- [Viktor Szakats brought this change] + + checksrc: update and fix warnings (#890) + + Update from: + https://github.com/curl/curl/blob/5fec927374e4d9553205d861f2dcb39ec78002cc/scripts/checksrc.pl + + - suppress these new checks: + + - EQUALSNULL: 320 warnings + - NOTEQUALSZERO: 142 warnings + - TYPEDEFSTRUCT: 16 warnings + + We can enabled them in the future. + + - fix all other new ones. + + - also fix whitespace in two `NMakefile` files. + +- [Viktor Szakats brought this change] + + tidy-up: fix/update URLs (#887) + +- [Viktor Szakats brought this change] + + tidy-up: fix typos (#886) + + detected by codespell 2.2.4. + +- [Viktor Szakats brought this change] + + tidy-up: replace tabs and other whitespace (#885) + + There are a few non-whitespace changes, see them here: + https://github.com/libssh2/libssh2/pull/885/files?w=1 + +- [Viktor Szakats brought this change] + + ci: drop cmake --parallel (#884) + + `--parallel 2` did not seem to make builds faster. Neither did 4 or 6. + + Delete this option from both GHA and AppVeyor jobs. + + On AppVeyor, with VS, it uses MSBuild under the hood where apparently + `--parallel` doesn't do much [1]. The suggested MSBuild-specific option + `/p:CL_MPcount=2` did not improve build times either. + + CMake spends significant time (comparable to building the project + itself) on feature detection, it'd be nice to execute those in parallel, + but I found not such CMake option. + + [1] https://discourse.cmake.org/t/parallel-does-not-really-enable-parallel-compiles-with-msbuild/964 + + Partial revert of 7a039d9a7a2945c10b4622f38eeed21ba6b4ec55 + +- [Viktor Szakats brought this change] + + rework how to enable insecure null-cipher/null-MAC (#873) + + Null-cipher and null-MAC are security footguns we want to avoid. + + Existing option names to toggle these were ambiguous and gave room for + misinterpretation. Some projects may have had these options enabled by + accident. + + This patch aims to make it more difficult to enable them, and making + sure that existing methods require an update to stay enabled. + + - delete CMake/autotools settings to enable the "none" cipher and MAC. + + - rename existing C macros that can enable them. + + To use them, pass them as custom `CPPFLAGS` to the build. + + - enable them only if `LIBSSH2DEBUG` is also enabled. + + Best would be to delete them, though they may have some use while + developing libssh2 itself, or debugging. + +- [Viktor Szakats brought this change] + + delete old gex (SSH2_MSG_KEX_DH_GEX_REQUEST_OLD) build option (#872) + + libssh2 supports an "old" style KEX message + `SSH2_MSG_KEX_DH_GEX_REQUEST_OLD`, as an off-by-default build option. + + OpenSSH deprecated/disabled this feature in v6.9 (2015-07-01): + https://www.openssh.com/releasenotes.html#6.9 + + This patch deletes this obsolete feature from libssh2, with no option + to enable it. + + Added to libssh2 in: cf8ca63ea0c9388c8ae9079961d7e6a91b72b5c8 (2004-12-31) + RFC: https://datatracker.ietf.org/doc/html/rfc4419 (2006-03) + +- [Viktor Szakats brought this change] + + src: more tolerant snprintf() local override (#881) + + `#undef snprintf` before redefining it, when `HAVE_SNPRINTF` is not + defined, even though `snprintf` is available and it should have been. + Possibly with 3rd party builds. + + Downside is that cases of missing `HAVE_SNPRINTF` are less trivially + detected at compile-time. + +- [Viktor Szakats brought this change] + + ci: fix cmake warning with AppVeyor WinCNG builds (#883) + + ``` + CMake Warning: + Manually-specified variables were not used by the project: + + OPENSSL_ROOT_DIR + ``` + + Follow-up to 0834b9bcc85b90c78afff103f909b5a909b95e45 + +- [Viktor Szakats brought this change] + + ci: cmake `ENABLE_WERROR` -> `ON` (#877) + + Consider warnings as errors for CMake jobs in CI. + +Viktor Szakats (26 Mar 2023) +- src: silence compiler warnings 4 (alignment in WinCNG) + + Silence alignment warnings in WinCNG, by reworking the code. + + Also add two unrelated casts to avoid gcc compiler warnings + in surrounding code. + + `increases required alignment from 1 to 4 [-Wcast-align]` + `increases required alignment from 1 to 8 [-Wcast-align]` + + See warning details in the PR's individual commits. + + Reviewed-by: Marc Hörsken in + Cherry-picked from #846 + Closes #880 + +- src: silence compiler warnings 3 (change types) + + Apply type changes to avoid casts and warnings. In most cases this + means changing to a larger type, usually `size_t` or `ssize_t`. + + Change signedness in a few places. + + Also introduce new variables to avoid reusing them for multiple + purposes, to avoid casts and warnings. + + - add FIXME for public `libssh2_sftp_readdir_ex()` return type. + + - fix `_libssh2_mbedtls_rsa_sha2_verify()` to verify if `sig_len` + is large enough. + + - fix `_libssh2_dh_key_pair()` in `wincng.c` to return error if + `group_order` input is negative. + + Maybe we should also reject zero? + + - bump `_libssh2_random()` size type `int` -> `size_t`. Add checks + for WinCNG and OpenSSL to return error if requested more than they + support (`ULONG_MAX`, `INT_MAX` respectively). + + - change `_libssh2_ntohu32()` return value `unsigned int` -> `uint32_t`. + + - fix `_libssh2_mbedtls_bignum_random()` to check for a negative `top` + input. + + - size down `_libssh2_wincng_key_sha_verify()` `hashlen` to match + Windows'. + + - fix `session_disconnect()` to limit length of `lang_len` + (to 256 bytes). + + - fix bad syntax in an `assert()`. + + - add a few `const` to casts. + + - `while(1)` -> `for(;;)`. + + - add casts that didn't fit into #876. + + - update `docs/HACKING-CRYPTO` with new sizes. + + May need review for OS400QC3: /cc @monnerat @jonrumsey + + See warning details in the PR's individual commits. + + Cherry-picked from #846 + Closes #879 + +- src: silence compiler warnings 2 (ZLIB interface) + + Silence warnings in the ZLIB interface by adding casts and changing + types. + + See PR for individual commits. + + Cherry-picked from #846 + Closes #878 + +- src: silence compiler warnings 1 + + Most of the changes aim to silence warnings by adding casts. + + An assortment of other issues, mainly compiler warnings, resolved: + + - unreachable code fixed by using `goto` in + `publickey_response_success()` in `publickey.c`. + + - potentially uninitialized variable in `sftp_open()`. + + - MSVS-specific bogus warnings with `nid_type` in `kex.c`. + + - check result of `kex_session_ecdh_curve_type()`. + + - add missing function declarations. + + - type changes to fit values without casts: + - `cmd_len` in `scp_recv()` and `scp_send()`: `int` -> `size_t` + - `Blowfish_expandstate()`, `Blowfish_expand0state()` loop counters: + `uint16_t` -> `int` + - `RECV_SEND_ALL()`: `int` -> `ssize_t` + - `shell_quotearg()` -> `unsigned` -> `size_t` + - `sig_len` in `_libssh2_mbedtls_rsa_sha2_sign()`: + `unsigned` -> `size_t` + - `prefs_len` in `libssh2_session_method_pref()`: `int` -> `size_t` + - `firstsec` in `_libssh2_debug_low()`: `int` -> `long` + - `method_len` in `libssh2_session_method_pref()`: `int` -> `size_t` + + - simplify `_libssh2_ntohu64()`. + + - fix `LIBSSH2_INT64_T_FORMAT` for MinGW. + + - fix gcc warning by not using a bit field for + `burn_optimistic_kexinit`. + + - fix unused variable warning in `_libssh2_cipher_crypt()` in + `libgcrypt.c`. + + - fix unused variables with `HAVE_DISABLED_NONBLOCKING`. + + - avoid const stripping with `BIO_new_mem_buf()` and OpenSSL 1.0.2 and + newer. + + - add a missing const in `wincng.h`. + + - FIXME added for public: + - `libssh2_channel_window_read_ex()` `read_avail` argument type. + - `libssh2_base64_decode()` `datalen` argument type. + + - fix possible overflow in `sftp_read()`. + + Ref: 4552c73cd58fccb1fc49cb0f25f86619133e560f + + - formatting in `wincng.h`. + + See warning details in the PR's individual commits. + + Cherry-picked from #846 + Closes #876 + +GitHub (24 Mar 2023) +- [Viktor Szakats brought this change] + + cmake: automatic exports macro tidy-up (#875) + + In a recent CMake update I left the original CMake EXPORTS macro + unchanged (`libssh2_EXPORTS`) for compatibility. + + However, that macro was also recently added [1] and not present in an + official release yet, so we might as well just use the new native one + instead (`libssh2_shared_EXPORTS`), defined by CMake automatically. + This way we don't need to define the old macro manually. + + CMake forms this macro from the lib's internal name as defined in + `add_library()` by appending `_EXPORTS`. That target name changed from + `libssh2` to `libssh2_shared` after introducing dual shared + static + builds in the recent update. + + If we're here, add a new, stable, build-tool agnostic macro with the + same effect, for non-CMake use: `LIBSSH2_EXPORTS` + + [1] 1f0fe7443a1ecddd320f2c693607b2afee9bbe2f (2021-10-26) + + Follow-up to 4e2580628dd1f8dc51ac65ac747ebcf0e93fa3d1 + +- [Viktor Szakats brought this change] + + maketgz: add .xz, .bz2, .zip source archive formats (#874) + + Copied from curl: + https://github.com/curl/curl/blob/4528690cd51e5445df74aef8f83470a602683797/maketgz#L174-L222 + + [ci skip] + +Viktor Szakats (23 Mar 2023) +- dist: delete reference to recently deleted file [ci skip] + + Follow-up to b8762c1003d97e109efa587bdc760ff9873949eb + +GitHub (23 Mar 2023) +- [Viktor Szakats brought this change] + + cmake: separate compilation passes for shared/static (#871) + + Before this patch, cmake did a single compilation pass when we enabled + both shared and static lib targets. This saves build time (esp. with + MinGW targets and cross-compiling), but has the disadvantage that static + libs built this way must have PIC enabled (offering slightly less + performance) and `dllexport` enabled also, which means that executables + linking the static libssh2 lib export its public symbols. + + To avoid these downsides, this patch separates the two passes and + creates a non-PIC, non-`dllexport` static lib, even when also building + the shared lib. + +- [Viktor Szakats brought this change] + + ci: test with OpenSSL v1.1.1 on AppVeyor (#870) + + Was: v1.0.2. + + Keep using v1.0.2 with the static-only test. To make sure we don't break + support. + +- [Viktor Szakats brought this change] + + ci: speed up static-only build tests on AppVeyor (#868) + + - limit static-only build to a single platform (x64). + + - skip running ctest for the static-only build. + + - use MSVS 2013 for static-only builds. It's faster. + + - run static-only test before WinCNG ones. Otherwise it's often skipped + due to WinCNG failures (#804). + +- [Viktor Szakats brought this change] + + cmake: fix error with static lib off and example/tests on (#869) + + Regression from 4e2580628dd1f8dc51ac65ac747ebcf0e93fa3d1 + +- [Viktor Szakats brought this change] + + ci: parallelize more (#867) + +- [Viktor Szakats brought this change] + + cmake/src: move build options before target definitions (#864) + + To allow more flexibility when defining targets. + +- [Viktor Szakats brought this change] + + ci: use static+shared builds to cut number of cmake jobs (#865) + + With CMake builds supporting static-shared libssh2 builds in a single + pass, we no longer need to run static and shared jobs separately. For + the same effect it's enough to run builds with both shared and static + builds enabled. Halving CI jobs. + + We add an extra run to test the CMake config-path without shared builds + enabled. + + This allows to add useful jobs, e.g. MSVS 2022 or ZLIB-enabled builds + for Windows, valgrind builds or other useful stuff, without stretching + CI run times further. + + Ref: #863 + +Viktor Szakats (22 Mar 2023) +- cmake: allow building static + shared libs in a single pass + + - `BUILD_SHARED_LIBS=ON` no longer disables building static lib. + + When set, we build the static lib with PIC enabled. + + For shared lib only, set `BUILD_STATIC_LIBS=OFF`. For static lib + without PIC, leave this option disabled. + + - new setting: `BUILD_STATIC_LIBS`. `ON` by default. + + Force-enabled when building examples or tests (we build those in + static mode always.) + + - fix to exclude Windows Resource from the static lib. + + - fix to not overwrite static lib with shared implib on Windows + platforms using identical suffix for them (MSVS). By using + `libssh2_imp<.ext>` implib filename. + + - add support for `STATIC_LIB_SUFFIX` setting to set an optional suffix + (e.g. `_static`) for the static lib. (experimental, not documented). + Overrides the above when set. + + - fix to set `dllexport` when building shared lib. + + - set `TrackFileAccess=false` for MSVS. + + For faster builds, shorter verbose logs. + + - tests: new test linking against shared libssh2: `test_warmup_shared` + + - tests: simplify 'runner' lib by merging 3 libs into a single one. + + - tests: drop hack from `test_keyboard_interactive_auth_info_request` + build. + + We no longer need to compile `src/misc.c` because we always link + libssh2 statically. + + - tests: limit `FIXTURE_WORKDIR=` to the `runner` target. + + TL;DR: Default behavior unchanged: static (no-PIC), no shared. + Enabling shared unchanged, but now also builds a static (PIC) + lib by default. + + Based-on: b60dca8b6450a9729670986d2899cca54ccdbb6d #547 by berney on github + Fixes: #547 + Fixes: #675 + Closes: #863 + +- include: silence warnings with casts in public `libssh2_sftp.h` + + Avoid triggering warnings in macros coming from public libssh2 headers. + + Cherry-picked from: #846 + Closes #862 + +- example, tests: address compiler warnings + + Fix or silence all C compiler warnings discovered with (or without) + `PICKY_COMPILER=ON` (in CMake). This means all warnings showing up in + CI (gcc, clang, MSVS 2013/2015), in local tests on macOS (clang 14) and + Windows cross-builds using gcc (12) and llvm/clang (14/15). + + Also fix the expression `nread -= nread` in `sftp_RW_nonblock.c`. + + Cherry-picked from: #846 + Closes #861 + +- openssl: require `EVP_aes_128_ctr()` support + + libssh2 built with OpenSSL and without its `EVP_aes_128_ctr()`, aka + `HAVE_EVP_AES_128_CTR`, option are working incorrectly. This option + wasn't always auto-detected by autotools up until recently (#811). + Non-cmake, non-autotools build methods never enabled it automatically. + + OpenSSL supports this options since at least v1.0.2, which is already + EOLed and considered obsolete. OpenSSL forks (LibreSSL, BoringSSL) + supported it all along. + + In this patch we enable this option unconditionally, now requiring + OpenSSL supporting this function, or one of its forks. + + Also modernize OpenSSL lib references to what 1.0.2 and newer versions + have been using. + + Fixes #739 + +- wincng: fix memory leak in `_libssh2_dh_secret()` + + Patch-by: iruis on github + Assisted-by: Marc Hörsken + Bug #846, commit e3487092ef9553af67633c6747cb9ab2f86465e0. + Fixes #856 + Closes #858 + +GitHub (19 Mar 2023) +- [Viktor Szakats brought this change] + + nw, os400, watcom: stop setting unused macros [ci skip] (#859) + +Viktor Szakats (19 Mar 2023) +- cmake: fix `ENABLE_WERROR=ON` breaking auto-detections + + - cmake: fix compiler warnings in `CheckNonblockingSocketSupport`. + detection functions. + + Without this, these detections fail when `ENABLE_WERROR=ON`. + + - cmake: disable ENABLE_WERROR for MSVC during symbol checks in `src`. + + CMake's built-in symbol check function `check_symbol_exists()` + generate warnings with MSVC. With warnings considered errors, these + detections fail permanently. Our workaround is to disable + warnings-as-errors while running these checks. + + ``` + CheckSymbolExists.c(8): warning C4054: 'type cast': from function pointer '__int64 (__cdecl *)(const char *,char **,int)' to data pointer 'int *' + in `return ((int*)(&strtoll))[argc];` + ``` + + Ref: https://ci.appveyor.com/project/libssh2org/libssh2/builds/46537222/job/4vg4yg333mu2lg9b + + - example: replace `strcasecmp()` with C89 `strcmp()`. + + To avoid using CMake symbol checks in `example`. + + Another option is to duplicate the `check_symbol_exists()` workaround + from `src`, but I figure it's not worth the complexity. We use + `strcasecmp()` solely to check optional command-line options for + example programs, and those are fine as lower-case. + + Without this, these detections fail when `ENABLE_WERROR=ON`. + + - also delete `__function__` detection/use in `example`. + + To avoid the complexity for the sake of using it at a single place in + of the example's error branch. Replace that use with a literal name of + the function. + + - cmake: also use `CMakePushCheckState` functions instead of manual + save/restore. + + Closes #857 + +- build: improve a test build workaround with bcrypt + + - cmake: extend workaround for linking a test with shared libssh2. + + One of the tests uses internal libssh2 functions, and with CMake it + compiles `src/misc.c` directly for this. `misc.c` references bcrypt / + blowfish code. This needs a workaround for build configs where libssh2 + doesn't export these. + + Before this patch, we enabled this workaround for MSVC. + + In the patch we extend this to all Windows. There is no CI test for + this, but gcc and llvm/clang + mingw64 builds also need it. This may + well apply to other configurations (it should, as shared libs are not + supposed to export internal functions), so also make it easy to enable + it at a single point. + + [ autotools builds force-link this one test against static libssh2. ] + + - make `misc.c` not depend on bcrypt. + + By moving out our `bcrypt_pbkdf()` wrapper into `bcrypt_pbkdf.c` + itself. + + This allows to compile `misc.c` into tests without pulling in bcrypt / + blowfish functions, and simplify the above workaround. + + Source code uses `HAVE_BCRYPT_PBKDF`, a leftover from original bcrypt + source. We never define this inside libssh2. Defining it breaks the + build, and this patch doesn't change that. + + - make `bcrypt_pbkdf()` static. + + While here, make the low-level `bcrypt_pbkdf()` function static to + avoid namespace pollution. + + Closes #855 + +GitHub (17 Mar 2023) +- [Viktor Szakats brought this change] + + ci: more timeout adjustments (#853) + + - add timeout to SSH connection wait loop in AppVeyor test prep. + (2 minutes) + + - switch to per-step timeout for GitHub CI cmake/ctest runs. + (10 minutes) + + ctest timeout (of 450 seconds) didn't seem to make any difference. + +Viktor Szakats (17 Mar 2023) +- ci: set timeout to ctest and GitHub CI jobs + + - `ctest` shows a the default timeout '10000000' (turns out to be + in seconds), cause infinite waits e.g. in case the necessary server + worker is not available. + + CMake CI tests take approx: + - GitHub / Linux : 125 seconds + - AppVeyor / Windows: 300 seconds + + New timeouts are: 450 and 900 seconds respectively. + + - set timeouts for style-check, fuzz, Linux and Windows GitHub CI + jobs to avoid hanging forever. + + Also: + + - move `choco install` to before_test to make builds start faster + in `appveyor.yml`. + + - fix some yamllint `ON`/`OFF`-confusion issue by quoting these + values in `appveyor.yml`. + + - fix indentation in `appveyor.yml`. + + - convert to GitHub workflows to LF line-ending. + + Ref: https://github.com/libssh2/libssh2/pull/655#issuecomment-1472853493 + + Closes #851 + +GitHub (17 Mar 2023) +- [Viktor Szakats brought this change] + + ci: update mbedTLS repo URL, delete Travis CI (#850) + + Last Travis CI session run on 2021-11-18. + + Ref: https://app.travis-ci.com/github/libssh2/libssh2 + Ref: https://travis-ci.org/github/libssh2/libssh2/builds + +- [Viktor Szakats brought this change] + + appveyor.yml: reorder tests to return relevant feedback earlier (#849) + + - build x64 first + + x64 is the more interesting target. Most type conversion issues are + revealed here. Also more commonly used by now. + + - test VS 2013 earlier + + - test WinCNG earlier + + - delete reference to no longer used VS 2008 + + After this patch we end up starting with all Shared builds (2015, 2013, + OpenSSL, WinCNG), then continue with Static ones. Shared/Static makes + a minor if any difference in builds/tests compared to different VS + versions of TLS backends. + + -- + + CI run times: + + Preparation + build takes: + 8 x VS2015 4.5 mins -> total: 36 + 8 x VS2013 2 mins -> total: 16 + Total: 52 mins + + with our 30 tests, it increases to: + 8 x VS2015 8-10 mins -> total: 72 + 8 x VS2013 6- 9 mins -> total: 60 + Total: 132 mins + + Without tests: https://ci.appveyor.com/project/libssh2org/libssh2/builds/46475315 + With tests: https://ci.appveyor.com/project/libssh2org/libssh2/builds/46480549 + +Dan Fandrich (14 Mar 2023) +- src: check for NULL pointer passed to _libssh2_get_string + + Callers should be protecting against this, but it's prudent to check + here anyway. + + Fixes #802 + Closes #848 + +Viktor Szakats (14 Mar 2023) +- appveyor.yml: choco install improvements [ci skip] + + - avoid outputting 4000 log lines by hiding the progress bar. + Reduces log size by 5x. + + - decrease timeout (from the default 2700 seconds). + + - omit unnecessary output. + + Tested as part of #846 + +GitHub (14 Mar 2023) +- [Jakob Egger brought this change] + + build: update instructions for autoreconf (#847) + + The "convenience script" talks about the "buildconf" file, + which is no longer recommended. + +- [Viktor Szakats brought this change] + + win32: set HAVE_STRTOLL with MSVS 2013 and newer (#845) + + As in curl: + https://github.com/curl/curl/blob/7fa6e36583b52dd8f1e639b370c9a2849be81b54/lib/config-win32.h#L221 + +- [Viktor Szakats brought this change] + + GNUmakefile: move HAVE_STRTOLL to libssh2_config.h [ci skip] (#844) + +- [Viktor Szakats brought this change] + + src: silence unused variable warnings (#843) + +Viktor Szakats (13 Mar 2023) +- GNUmakefile: add wolfSSL support + major rework + + - add wolfSSL support. + - reduce size and redundant logic. + - fix a bunch of small issues. + - rework configuration, now with: `CC`, `AR`, `RC`, `TRIPLET`, `CFLAGS`, + `CPPFLAGS`, `LDFLAGS`, `RCFLAGS`, `LIBS`, `LIBSSH2_DLL_SUFFIX`, + `LIBSSH2_LDFLAGS_LIB`, `LIBSSH2_LDFLAGS_BIN` (and more). + - merge examples build into the main Makefile. + - relative dependency paths are now the same for building libssh2 or + examples. + - drop detection for obsolete OpenSSL versions (can be configure via new + `OPENSSL_LIBS`). + - merge dev/dist distribution zip options. + - build libssh2 with `-DHAVE_STRTOLL`. + - tidy-up. + - build examples in static mode by default (use `DYN` to build them in + shared mode). + - drop forced (in non-debug mode) `-O2`. + - drop Win9x support. + - deprecate `ARCH` in favour of custom options and `TRIPLET`. + - drop Windows resources from examples for simplicity + - drop `WITH_ZLIB`. Default `ZLIB_PATH` to enable zlib support. + - drop `LIBSSH2_DLL_A_SUFFIX`, use standard value `.dll` (as in + `libssh2.dll.a`). + - always link `bcrypt` (for LibreSSL and OpenSSL) and `crypt32` + (for wolfSSL). + - unhide executed build commands. + - fix mbedTLS `lib` path + - drop specific options to force static linking. Custom options seems + a better way for this. + - based on similar work made for curl: + https://github.com/curl/curl/commit/a8861b6ccdd7ca35b6115588a578e36d765c9e38 + + Closes #842 + +GitHub (13 Mar 2023) +- [Viktor Szakats brought this change] + + wincng: fix memory leak in libssh2_dh_key_pair() (#829) + + Fixes #722 + +- [Viktor Szakats brought this change] + + src: C89-compliant _libssh2_debug() macro (#831) + + Before this patch, with debug logging disabled, libssh2 code used a + variadic macro to catch `_libssh2_debug()` calls, and convert them to + no-ops. In certain conditions, it used an empty inline function instead. + + Variadic macro is a C99 feature. It means that depending on compiler, + and build settings, it littered the build log with warnings about this. + + The new solution uses the trick of passing the variable arg list as a + single argument and pass that down to the debug function with a regular + macro. When disabled, another regular C89-compatible macro converts it + to a no-op. + + This makes inlining, C99 variadic macros and maintaining the conditions + for each unnecessary and also makes the codebase compile more + consistently, e.g. with forced C standards and/or picky warnings. + + TL;DR: It makes this feature C89-compliant. + +- [Viktor Szakats brought this change] + + openssl: fix possible compiler warning in macro condition (#839) + + Building with wolfSSL or pre-OpenSSL v1.1.1 triggered it. + + ``` + ../src/openssl.h:130:5: warning: 'LIBRESSL_VERSION_NUMBER' is not defined, evaluates to 0 [-Wundef] + LIBRESSL_VERSION_NUMBER >= 0x3070000fL + ^ + ``` + + Regression from 2e2812dde8c1fc9b48eca592823770ab2e601f7a + +- [Viktor Szakats brought this change] + + GNUmakefile: cleanups [ci skip] (#840) + + - indent + - sync `test/GNUmakefile` with main + - delete `RANLIB` + - use `else if` + - use more `?=` + - use ASCII-7 copyright symbol (in test) + +- [Viktor Szakats brought this change] + + win32: convert tabs to spaces [ci skip] (#838) + + Also strip stray newlines from `win32/rules.mk`. + +- [Viktor Szakats brought this change] + + ci: retry choco install on appveyor (#837) + + Trying to mitigate occasional intermittent failures while installing + docker. + + Ref: https://ci.appveyor.com/project/libssh2org/libssh2/builds/46460704/job/g3t7bro6ta6n3pk6#L52 + +- [Viktor Szakats brought this change] + + cmake: drop unnecessary exception for warmup build (#835) + +- [Viktor Szakats brought this change] + + cmake: reflect minimum version in docs (#834) + + Follow-up to 505ea626b6e125b7ce15caf453b522192008a884 + +- [Viktor Szakats brought this change] + + cmake: add wolfSSL support to tests (#833) + + wolfSSL supports building with zlib as a dependency, that's the reason + for the ZLIB logic in the patch. + + Also add it to `docs/INSTALL_CMAKE.md` and to the help text in + `src/CMakeLists.txt`. + + Running tests not actually tested. + + Follow-up to 9f217a17f6f3c2047c4a1668a5c037a75a02abfd + + Ref: #817 + +- [Viktor Szakats brought this change] + + tests: workaround for intermittent first test failures (#832) + + Flakiness got continously worse these last days. It didn't seem related + to recent commits. Flakiness also picked up in GitHub CI runs, something + rarely seen before. Manual restart consistently fixed them. + + The repeating pattern was the _first_ test (`test_hostkey`) failing, + with `libssh2_session_handshake failed (-13): Failed getting banner`. + Failures came after a lengthy wait, suggesting a timeout. + + I then reversed the order of the first two tests, and it turned out that + the _first_ test failed again (`test_hostkey_hash`). Also pointing to a + timeout issue. + + Then I added a dummy test to "warm up" whatever needs warming up in the + layers of CI + Docker + ssh server and their interconnects. This helped, + and GitHub CI tests run without failure right for the first time. + AppVeyor CI also improved a little. + + This patch adds a new first test called `test_warmup`, that creates a + new libssh2 session, and exits with success even if that attempt failed. + + A stop-gap solution at best, and there is no guarantee it will continue + to fix this or similar future issues, but it's also untenable to have + almost every CI run fail for intermittent reasons. + + In some [1] cases [2] it's not the first test failing intermittently. + That's a different issue, and this patch doesn't fix it. + + [1] #804 + [2] https://ci.appveyor.com/project/libssh2org/libssh2/builds/46440828/job/8rej6cq6itg7vc4w#L500 + +- [Viktor Szakats brought this change] + + cmake: detect HAVE_SNPRINTF for tests (#830) + + Turns out `test_keyboard_interactive_auth_info_request.c` requires + `src/libssh2_priv.h`, which in turn requires a correctly set + `HAVE_SNPRINTF`. + + Follow-up to 4cdf785cd313c3272d04c2ef7458a35d44533d8b. + +- [Viktor Szakats brought this change] + + cmake: unset forced CMAKE_C_STANDARD 90 (#822) + + Added in cf80f2f4b5255cc85a04ee43b27a29c678c1edb1 (on 2016-08-14), + with the title "Basic dockerised test suite". + + It's not clear why a C standard was explicitly set, but a side-effect + of this is that CMake-built binaries diverged from ones built with + autotools or GNU Make (using the same compiler and configuration). + + Another issue is that this may introduce ABI incompatibility with + binaries built with a different C standard flag, e.g. the C compiler + default or one used for other components of a final app. + + Seems unlikely, but if our tests require this option, we should set it + for the CI builds only? + +- [Viktor Szakats brought this change] + + example: silence MSVS 2013 C4127 warnings (#828) + +- [Viktor Szakats brought this change] + + cmake: reposition ws2_32 to make binutils ld work again (#827) + + This restores socket libs to their pre-regression positions. + + Without this, `ld` doesn't find `ws2_32` symbols when referenced + from TLS libs. + + Regression from 31fb8860dbaae3e0b7d38f2a647ee527b4b2a95f + +- [Viktor Szakats brought this change] + + fix compiling with LIBSSH2_NO_CLEAR_MEMORY and OpenSSL (#825) + + Regression from a0e424a51c27cc27af611ba20d134f9a9ae35273 + + Fixes #824 + +- [Viktor Szakats brought this change] + + snprintf: add missing prototype for local replacement (#820) + + Should fix these warnings with MSVS 2013 and older: + `agent.c(294): warning C4013: '_libssh2_snprintf' undefined; assuming extern returning int` + + Follow-up to 4cdf785cd313c3272d04c2ef7458a35d44533d8b. + +- [Viktor Szakats brought this change] + + build: set _FILE_OFFSET_BITS=64 for mingw-w64 (#821) + + autotools builds already did auto-detect and set this mingw-specific + macro, but CMake and GNU Make builds did not. This patch fixes that. + + Necessary for `src/scp.c`. + +- [Viktor Szakats brought this change] + + cmake: add os400qc3.c to SOURCES (#826) + + This re-syncs the list of compiled objects in cmake builds with + non-cmake builds. + + Follow-up to 16619a8eddec35bb8582d1c334db0fc13b0817c4. + +- [Viktor Szakats brought this change] + + build: silence bogus C4127 warnings with MSVS 2013 and earlier (#819) + + E.g.: + `channel.c(370): warning C4127: conditional expression is constant` + Ref: + https://ci.appveyor.com/project/libssh2org/libssh2/builds/46437333/job/5rak1vcl9hue31ei#L190 + +- [Viktor Szakats brought this change] + + cmake: use only needed socket libs when checking non-blocking sockets (#816) + + Based on patch by Christian Beier. + + Fixes #694 + Closes #712 + +- [Viktor Szakats brought this change] + + cmake: update openssl dll list (#818) + + Add OpenSSL 3 and versionless DLL names. Also modernize warning messages + and variable names. + + Do we need the OpenSSL-Windows-specific check and the related + `RUNTIME_DEPENDENCIES` feature? The list of OpenSSL DLLs was out of date + for 1.5 years without anybody noticing. Keeping it fresh is a chore and + copying around DLL dependencies rarely helps as much as expected. This + check also results in unuseful warnings in certain build scenarios, e.g. + when linking to OpenSSL statically. + +- [Viktor Szakats brought this change] + + cmake: add wolfSSL support (#817) + + Implement wolfSSL support for libssh2 when building with CMake. + + Configuration example from curl-for-win: + ``` + -DCRYPTO_BACKEND=wolfSSL + -DWOLFSSL_LIBRARY=/path-to/wolfssl/lib/libwolfssl.a + -DWOLFSSL_INCLUDE_DIR=/path-to/wolfssl/include + ``` + + Module `cmake/Findwolfssl.cmake` copied from: + https://github.com/ngtcp2/ngtcp2/blob/e4d920c4b7a350d63b6978c68b216b76faa12635/cmake/Findwolfssl.cmake + via commit: + https://github.com/ngtcp2/ngtcp2/commit/296396d3730b721ad97f9de22f525400f8524c0e + by Stefan Eissing + +- [Viktor Szakats brought this change] + + cmake: restore non-Windows socket lib detection (#815) + + I mistakenly pruned some non-Windows logic, also missing the fact that + our local `check_function_exists_may_need_library()` set the `NEED_*` + variables. Oddly, only `src` imported this function, yet also `examples` + and `tests` called it indirectly. The referenced `HAVE_SOCKET` / + `HAVE_INET_ADDR` variables might be coming from an upstream CMake + project? Leaving those there also, just in case. + + Regression from 31fb8860dbaae3e0b7d38f2a647ee527b4b2a95f + +Viktor Szakats (7 Mar 2023) +- build: more fixes and tidy-up (mostly for Windows) + + - cmake: always link `ws2_32` on Windows. Also add it to `libssh2.pc`. + + Fixes #745 + + - agent: fix gcc compiler warning: + `src/agent.c:296:35: warning: 'snprintf' output truncated before the last format character [-Wformat-truncation=]` + + - autotools: fix `EVP_aes_128_ctr` detection with binutils `ld` + + The prerequisite for a successful detection is setting + `LIBS=-lbcrypt` if the chosen openssl-compatible library requires + it, e.g. libressl, or quictls/openssl built with + `-DUSE_BCRYPTGENRANDOM`. + + With llvm `lld`, detection works out of the box. With binutils `ld`, + it does not. The reason is `ld`s world-famous pickiness with lib + order. + + To fix it, we pass all custom libs before and after the TLS libs. + This ugly hack makes `ld` happy and detection succeed. + + - agent: fix Windows-specific warning: + `src/agent.c:318:10: warning: implicit conversion loses integer precision: 'LRESULT' (aka 'long long') to 'int' [-Wshorten-64-to-32]` + + - src: fix llvm/clang compiler warning: + `src/libssh2_priv.h:987:28: warning: variadic macros are a C99 feature [-Wvariadic-macros]` + + - src: support `inline` with `__GNUC__` (llvm/clang and gcc), fixing: + ``` + src/libssh2_priv.h:990:8: warning: extension used [-Wlanguage-extension-token] + static inline void + ^ + ``` + + - blowfish: support `inline` keyword with MSVC. + + Also switch to `__inline__` (from `__inline`) for `__GNUC__`: + https://gcc.gnu.org/onlinedocs/gcc/Inline.html + https://clang.llvm.org/docs/UsersManual.html#differences-between-various-standard-modes + + - example/test: fix MSVC compiler warnings: + + - `example\direct_tcpip.c(209): warning C4244: 'function': conversion from 'unsigned int' to 'u_short', possible loss of data` + - `tests\session_fixture.c(96): warning C4013: 'getcwd' undefined; assuming extern returning int` + - `tests\session_fixture.c(100): warning C4013: 'chdir' undefined; assuming extern returning int` + + - delete unused macros: + - `HAVE_SOCKET` + - `HAVE_INET_ADDR` + - `NEED_LIB_NSL` + - `NEED_LIB_SOCKET` + - `HAVE_NTSTATUS_H` + - `HAVE_NTDEF_H` + + - build: delete stale zlib/openssl version numbers from path defaults. + + - cmake: convert tabs to spaces, add newline at EOFs. + + Closes #811 + +- cmake: make `test_read` runs cross-build-friendly + + Improve tests added in 7487dcf4b4ddae54b2a850737789b57b4251b0ae by + running `test_read` commands directly. This makes external shell/batch + files unnecessary, and is friendlier with cross-builds and when run + from non-default shells, like MSYS2. + + Also extend CRYPT/MAC test error messages with the CRYPT/MAC name. + + External runner shell scripts kept for future use. + + Closes #814 + +- src: enable clear memory on all platforms + + - convert `_libssh2_explicit_zero()` to macro. This allows inlining + where supported (e.g. `SecureZeroMemory()`). + + - replace `SecureZeroMemory()` (in `wincng.c`) and + `LIBSSH2_CLEAR_MEMORY`-guarded `memset()` (in `os400qc3.c`) with + `_libssh2_explicit_zero()` macro. + + - delete `LIBSSH2_CLEAR_MEMORY` guards, which enables secure-zeroing + universally. + + - add `LIBSSH2_NO_CLEAR_MEMORY` option to disable secure-zeroing. + + - while here, delete double/triple inclusion of `misc.h`. + `libssh2_priv.h` included it already. + + Closes #810 + +- cmake: bump minimum version to 3.1 (from 2.8.12) + + This allows to delete some fallback code. + + CMake release dates: + - 2014-12-15: 3.1 + - 2013-10-07: 2.8.12 + + Closes #813 + +- snprintf: unify fallback logic + + Before this patch, the `snprintf()` fallback logic for envs not + supporting this function (i.e. Visual Studio 2013 and older) varied + depending on build tool, and used different techniques in examples, + tests and libssh2 itself. + + This patch aims to apply a common logic to libssh2 and examples/tests. + + - libssh2: use local `snprintf()` fallback with all build tools. + + We already had a local implementation, but only with CMake. Move that + to the library as `_libssh2_snprintf()`, and map `snprintf()` to it + when `HAVE_SNPRINTF` is not set. + + Also change the length type from `int` to `size_t`, and fix + formatting. + + - set or detect `HAVE_SNPRINTF` in non-CMake builds. + + Detect in autotools. Keep existing logic in `win32/libssh2_config.h`. + Always set for OS/400, NetWare and VMS, keeping existing behaviour. + (OS/400 builds use a different local implementation) + + - examples/tests: drop the CMake-specific fallback logic and map + `snprintf()` to `_snprintf()` for old MSVC versions, like we did + before with other build tools. This is unsafe, but should be fine for + these uses. + + - `win32/libssh2_config.h`: make it easier to read. + + Closes #812 + +- cmake: build fixes with OpenSSL/LibreSSL on Windows + + - Link `bcrypt` for newer (non-fork) OpenSSL. + + - Link `bcrypt` and `ws2_32` when using (non-fork) OpenSSL or LibreSSL, + to allow `Looking for EVP_aes_128_ctr` detecting this feature. + + With the feature available, but not found by CMake, build failed with: + `openssl.c:636:21: error: incompatible integer to pointer conversion assigning to 'EVP_CIPHER *' (aka 'struct evp_cipher_st *') from 'int' [-Wint-conversion]` + + Closes #809 + +- build fixes and improvements (mostly for Windows) + + - in `hostkey.c` check the result of `libssh2_sha256_init()` and + `libssh2_sha512_init()` calls. This avoid the warning that we're + ignoring the return values. + + - fix code using `int` (or `SOCKET`) for sockets. Use libssh2's + dedicated `libssh2_socket_t` and `LIBSSH2_INVALID_SOCKET` instead. + + - fix compiler warnings due to `STATUS_*` macro redefinitions between + `ntstatus.h` / `winnt.h`. Solve it by manually defining the single + `STATUS` value we need from `ntstatus.h` and stop including the whole + header. + Fixes #733 + + - improve Windows UWP/WinRT builds by detecting it with code copied + from the curl project. Then excluding problematic libssh2 parts + according to PR by Dmitry Kostjučenko. + Fixes #734 + + - always use `SecureZeroMemory()` on Windows. + + We can tweak this if not found or not inlined by a C compiler which + we otherwise support. Same if it causes issues with UWP apps. + + Ref: https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/aa366877(v=vs.85) + Ref: https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-rtlsecurezeromemory + + - always enable `LIBSSH2_CLEAR_MEMORY` on Windows. CMake and + curl-for-win builds already did that. Delete `SecureZeroMemory()` + detection from autotools' WinCNG backend logic, that this + setting used to depend on. + + TODO: Enable it for all platforms in a separate PR. + TODO: For clearing buffers in WinCNG, call `_libssh2_explicit_zero()`, + insead of a local function or explicit `SecureZeroMemory()`. + + - Makefile.inc: move `os400qc3.h` to `HEADERS`. This fixes + compilation on non-unixy platforms. Recent regression. + + - `libssh2.rc`: replace copyright with plain ASCII, as in curl. + + Ref: curl/curl@1ca62bb + Ref: curl/curl#7765 + Ref: curl/curl#7776 + + - CMake fixes and improvements: + + - enable warnings with llvm/clang. + - enable more comprehensive warnings with gcc and llvm/clang. + Logic copied from curl: + https://github.com/curl/curl/blob/233810bb5f6c5e7bedfc10bdd36607b958c0cfe4/CMakeLists.txt#L131-L148 + - fix `Policy CMP0080` CMake warning by deleting that reference. + - add `ENABLE_WERROR` (default: `OFF`) option. Ported from curl. + - add `PICKY_COMPILER` (default: `ON`) option, as known from curl. + + It controls both the newly added picky warnings for llvm/clang and + gcc, and also the pre-existing ones for MSVC. + + - `win32/GNUmakefile` fixes and improvements: + + - delete `_AMD64_` and add missing `-m64` for x64 builds under test. + - add support for `ARCH=custom`. + It disables hardcoded Intel 64-bit and Intel 32-bit options, + allowing ARM64 builds. + - add support for `LIBSSH2_RCFLAG_EXTRAS`. + To pass custom options to windres, e.g. in ARM64 builds. + - add support for `LIBSSH2_RC`. To override `windres`. + - delete support for Metrowerks C. Last released in 2004. + + - `win32/libssh2_config.h`: delete unnecessary socket #includes + + `src/libssh2_priv.h` includes `winsock2.h` and `ws2tcpip.h` further + down the line, triggered by `HAVE_WINSOCK2_H`. + + `mswsock.h` does not seem to be necessary anymore. + + Double-including these (before `windows.h`) caused compiler failures + when building against BoringSSL and warnings with LibreSSL. We could + work this around by passing `-DNOCRYPT`. Deleting the duplicates + fixes these issues. + + Timeline: + 2013: c910cd382dfa07fed2adaabf688af9e4a084fa1d deleted `mswsock.h` from `src/libssh2_priv.h` + 2008: 8c43bc52b1e3de2c8fc7899a80aec0e98de4e2d8 added `winsock2.h` and `ws2tcpip.h` to `src/libssh2_priv.h` + 2005: dc4bb1af967d2c53e90349f2f37324c622e714f5 added the now deleted #includes + + - delete or replace `LIBSSH2_WIN32` with `WIN32`. + + - replace hand-rolled `HAVE_WINDOWS_H` macro with `WIN32`. Also delete + its detections/definitions. + + - delete unused `LIBSSH2_DARWIN` macro. + + - delete unused `writev()` Windows implementation + + There is no reference to `writev()` since 2007-02-02, commit + 9d55db6501aa4e21f0858cf36cdc2ddc11b96e83. + + - fix a bunch of MSVC / llvm/clang / gcc compiler warnings: + + - `warning C4100: '...': unreferenced formal parameter` + - using value of undefined PP macro `LIBSSH2DEBUG` + - missing void from function definition + - `if()` block missing in non-debug builds + - unreferenced variable in non-debug builds + - `warning: must specify at least one argument for '...' parameter of variadic macro [-Wgnu-zero-variadic-macro-arguments]` + in `_libssh2_debug()` + - `warning C4295: 'ciphertext' : array is too small to include a terminating null character` + - `warning C4706: assignment within conditional expression` + - `warning C4996: 'inet_addr': Use inet_pton() or InetPton() instead or + define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings` + By suppressning it. Would be best to use inet_pton() as suggested. + On Windows this needs Vista though. + - `warning C4152: nonstandard extension, function/data pointer conversion in expression` + (silenced locally) + - `warning C4068: unknown pragma` + + Ref: https://ci.appveyor.com/project/libssh2org/libssh2/builds/46354480/job/j7d0m34qgq8rag5w + + Closes #808 + +Dan Fandrich (1 Mar 2023) +- Add tests to check individual crypt & HMAC methods + + One specific crypt or hmac method is requested to be negotiated, then + several MB of data is transferred. + +- Add test to read lots of data over a channel + + Connects to the ssh server then downloads several MB of data. This + tests the data transfer path as well as boundary cases in packet + handling as data is split into smaller SSH blocks. + +GitHub (27 Feb 2023) +- [Will Cosgrove brought this change] + + Disable deprecated warnings for OpenSSL 3 #805 (#806) + + Disable deprecated warnings (for now) when building against OpenSSL 3 for a clean build. + + Reported: + Daniel Stenberg + +Dan Fandrich (24 Feb 2023) +- Fix a couple of warnings of errors in MSVC builds + + Two warnings (in tests & examples) in particular would cause problems: + bad format causing invalid data output or a bad chdir due to out of + scope buffer use. + +- tests: Support running tests in out-of-tree builds + + Various files are found by referencing the srcdir environment variable + in that case. + + Closes #801 + +- Improve the ssh2 example program to run a command + + This performs better as an example since it shows more working code, and + in the simplest possible way. It also turns the program into an actually + useful tool out of the box, able to run an arbitrary command (with one + restriction) on a remote machine and return the response, without + needing to touch the source. + + Closes #800 + +GitHub (14 Feb 2023) +- [Will Cosgrove brought this change] + + Add NULL session check to _libssh2_error_flags() (#796) + + Don't dereference null if a null session happens to make it into _libssh2_error_flags() + +Dan Fandrich (7 Feb 2023) +- Reorder AES crypt methods so stronger ones are first + + This make it more likely that a stronger one will be negotiated rather + than a weaker variant. + +- CI: update uses: dependencies to the latest versions + + We were seeing some deprecation warning messages on some of the older + ones. + +- transport.c: Add some comments + +- Add missing files to automake makefiles & build tests + + Many files have been added to the cmake build files but not the automake + ones in recent years. Missing ones have been added so automake "make + dist" will now create a usable tar ball. + + The integration tests using Docker are now built with automake as well + (with "make check"). They are not run yet since they aren't working yet + on Linux. + +- tests: Fix gcc compile warnings + + These were mostly due to missing and non-ANSI prototypes. + +- Enable trace debugging in example/ssh2 + + This is intended to be a test program, so debugging is likely to be + useful by default. + +- Improve example/ssh2 to allow unmodified use of public key auth + + The previous hard-coded key file paths were not valid for normal users. + Make the paths relative to the user's home directory instead so they + can work out of the box. Add a banner showing what connection will be + attempted to make it easier for the user to see what is being attempted. + Enable trace debugging since this is designed as a test program. + +GitHub (13 Dec 2022) +- [Viktor Szakats brought this change] + + openssl.h: enable ed25519 for LibreSSL 3.7.0 (#778) + + This brings LibreSSL libssh2 builds on par with OpenSSL. + +Dan Fandrich (5 Dec 2022) +- configure.ac: check for sys/param.h + + This file is required by glibc for the test suite. + +GitHub (12 Nov 2022) +- [Viktor Szakats brought this change] + + tests: add option to run tests without docker (#762) + + via `export OPENSSH_NO_DOCKER=1`. + + SSH server host can be set via: + `export OPENSSH_SERVER_HOST=127.0.0.1` + + SSH server port via existing: + `export OPENSSH_SERVER_PORT=4711` + + This requires more work to be usable out of the box. The necessery sshd + config is (partly) embedded into `tests/openssh_server/Dockerfile`. + + After this patch, it is possible to run tests in envs where docker is + not installed or not available, by running a preconfigured, + non-containerized sshd. + +- [Michael Buckley brought this change] + + Skip leading \r and \n characters in banner_receive() (#769) + + Fixes #768 + + Credit: + Michael Buckley + +- [Zenju brought this change] + + Fixed error handling of _libssh2_packet_requirev callers (#767) + + Notes: + + some callers of _libssh2_packet_requirev() fail to set _libssh2_error(). + This creates the situation where e.g. libssh2_session_handshake() fails, but libssh2_session_last_error() confusingly returns LIBSSH2_ERROR_NONE. + + Credit: + Zenju + +- [Will Cosgrove brought this change] + + Revert usage of EVP_CipherUpdate #764 #739 (#765) + + Revert usage of EVP_CipherUpdate from wolfSSL PR to fix #764 #739. + +- [Will Cosgrove brought this change] + + Fix regression with rsa_sha2_verify #758 (#763) + + Fixes comparison with the result value coming from `mbedtls_rsa_pkcs1_verify`. Success is 0, not 1. + +Marc Hoersken (24 Oct 2022) +- CI: fix AppVeyor status failing for starting jobs + +Viktor Szakats (24 Oct 2022) +- delete cast5 - null-cipher mapping + +- more feature guard cleanup + +- indent + +- formatting + +- fold long lines + +- cleanup + +- temporarily silence checksrc + +- add mbedTLS 3.x support + + Make libssh2 compile cleanly with mbedTLS 3.x and later. + + This patch makes use of `MBEDTLS_PRIVATE()`, which is not the + recommended, future-proof way to access mbedTLS data structures. This + method may break with a minor upgrade, according to the authors. This + is also the method used by libcurl. + + Also: + + - Fix a potentially uninitialized variable in + `libssh2_mbedtls_rsa_sha2_sign()`. This happened in an error path, + resulting in an unnecessary mbedTLS API call, with an uninitialized + `md_type`. + + - Bump mbedTLS version used in CI tests to 3.2.1. + + Fixes #751 + +- tests: add option to enable all trace messages in fixture + + via `export FIXTURE_TRACE_ALL=1`. + +- win32/GNUmakefile: add mbedTLS support + + via `export MBEDTLS_PATH=`. + +Marc Hoersken (21 Oct 2022) +- CI: fix AppVeyor job links only working for most recent build + + Ref: https://github.com/curl/curl/pull/9768#issuecomment-1286675916 + Reported-by: Daniel Stenberg + + Follow up to #754 + +- CI: add missing permission section to AppVeyor status workflow + + Follow up to #754 + +- Remove OSSFuzz integration which was replaced with CIFuzz (#756) + + Confirmed-by: Max Dymond + +- Rename workflow file appveyor.yml to appveyor_docker.yml + +- Streamline names of CI workflow jobs + +- [Jeroen Ooms brought this change] + + Add CI for mingw-w64 via msys2 (#742) + + Credit: Jeroen Ooms + +- CI: report AppVeyor build status for each job (#754) + + Also give each job on AppVeyor CI a human-readable name. + + This aims to make job and therefore build failures more visible. + +GitHub (29 Sep 2022) +- [Michael Buckley brought this change] + + Support for sk-ecdsa-sha2-nistp256 and sk-ssh-ed25519 keys, FIDO (#698) + + Notes: + Add support for sk-ecdsa-sha2-nistp256@openssh.com and sk-ssh-ed25519@openssh.com key exchange for FIDO auth using the OpenSSL backend. Stub API for other backends. + + Credit: + Michael Buckley + +- [Y. Yang brought this change] + + Fix DLL import library name (#711) + + Notes: + Fix DLL import library name + + https://aur.archlinux.org/packages/mingw-w64-libssh2 + https://cmake.org/cmake/help/latest/prop_tgt/IMPORT_PREFIX.html + + Credit: + metab0t + Y. Yang + +- [skundu07 brought this change] + + Add RSA-SHA2 support for the WinCNG backend (#736) + + Notes: + Added code to support RSA-SHA2 for WinCNG backend. + + Credit: + skundu07 + +- [Gabriel Smith brought this change] + + sftp: Prevent files from being skipped if the output buffer is too small (#746) + + Notes: + LIBSSH2_ERROR_BUFFER_TOO_SMALL is returned if the buffer is too small + to contain a returned directory entry. On this condition we jump to the + label `end`. At this point the number of names left is decremented + despite no name being returned. + + As suggested in #714, this commit moves the error label after the + decrement of `names_left`. + + Fixes #714 + + Credit: + Co-authored-by: Gabriel Smith + +- [bgermann brought this change] + + Drop advertisement clause on Blowfish (#747) + + Originally driven by https://github.com/pyca/bcrypt/issues/169, OpenBSD + removed Niels Provos's BSD advertisement clause in version 7.1: + + https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/lib/libsa/blowfish.c.diff?r1=1.1&r2=1.2 + https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/lib/libsa/blowfish.h.diff?r1=1.1&r2=1.2 + + This enables using libssh2 in GPL software. + +- [zhaochongliu brought this change] + + Support building with gcc < version 8 + + Files: CMakeLists.txt + + Notes: don't use gcc arguments that don't exist in gcc versions lower than 8 if building with older gcc. + + Credit: + zhaochongliu + +- [Miguel de Icaza brought this change] + + Document the obscure LIBSSH2_ERROR_BAD_USE when writing to a channel (#713) + + Document the obscure LIBSSH2_ERROR_BAD_USE when writing to a channel + + Credit: + Miguel de Icaza + +- [Michael Buckley brought this change] + + Don't erroneously log SSH_MSG_REQUEST_FAILURE packets from keepalive (#727) + + Notes: + When setting a ServerAliveInterval using libssh2_keepalive_config() with want_reply set to true, some servers will reply to the keep-alive requests with a single SSH_MSG_REQUEST_FAILURE packet. This is an allowed behavior in RFC 4254, section 4. + + Credit: + Michael Buckley + +- [Ryan Kelley brought this change] + + Updating docs for libssh2_channel_flush_ex (#728) + + Notes: + In #614 it was identified the docs do not accurately show how libssh2_channel_flush_ex() return value is set. I have updated the doc's to correctly show what the function is returning. + + Credit: + Ryan Kelley + +- [Sandeep Bansal brought this change] + + Support RSA certificate authentication (#710) + + * Adding support for signed RSA keys and unit test + + Credit: + Sandeep Bansal + +Viktor Szakats (2 Jul 2022) +- configure: add --disable-tests option + +- cmake: do not add libssh2.rc to the static library + +GitHub (23 May 2022) +- [AyushiN brought this change] + + Fixed typo #697 (#701) + + Credit: + AyushiN + +- [Viktor Szakats brought this change] + + Openssl: add support for LibreSSL 3.5.x (#700) + + LibreSSL 3.5.0 made more structures opaque, so let's enable existing + support for that when building against these LibreSSL versions. + + Ref: https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.5.0-relnotes.txt + + Credit: + Viktor Szakats + +- [Michael Buckley brought this change] + + Ensure KEX replies don't include extra bytes (#696) + + Addresses #695 + + Credit: + Michael Buckley, reported by Harry Sintonen + +- [Zenju brought this change] + + Fix buffer overflow during SSH_MSG_USERAUTH_BANNER (#693) + + File: userauth.c + Notes: + This patch fixes application crashes due to heap corruption. Turns out the null terminator is written one byte outside of the allocated area. + Credit: + Zenju + +- [Will Cosgrove brought this change] + + Changed NULL check to avoid logic change + +- [Will Cosgrove brought this change] + + NULL check before calling session_handshake + +- [Harry Sintonen brought this change] + + Fix build since openssl 1.1.0 when ECDSA and/or RIPEMD are disabled (#666) + + File: openssl.h + + Notes: + In openssl 1.1.0 and later openssl decided to change some of the defines used to check if certain features are not compiled in the libraries. This updates the define checks. + + Credit: + Harry Sintonen + Co-authored-by: Harry Sintonen + +- [gbaraldi brought this change] + + Add RSA-SHA2 support for the mbedtls backend (#688) + + File: mbedtls.c + + Notes: + * Add sha2 support for RSA key upgrading to mbedTLS backend + + Credit: + gbaraldi + +Daniel Stenberg (21 Mar 2022) +- misc/libssh2_copy_string: avoid malloc zero bytes + + Avoids the inconsistent malloc return code for malloc(0) + + Closes #686 + +Marc Hoersken (17 Mar 2022) +- wincng: rename struct field referring to the DH private big number + + Closes #684 + +- tests/openssh_fixture.c: print command after variable expansion + +- CI: store and reuse OpenSSH Server docker image used for tests + + Supersedes #588 + Fixes #665 + Closes #685 + +GitHub (26 Feb 2022) +- [Will Cosgrove brought this change] + + Added LibreSSL to crypto backend list + +- [Will Cosgrove brought this change] + + Added crypto backend list to template + + Added OS version as well + +- [Will Cosgrove brought this change] + + Revert "Option to build both static and shared libraries (#547)" (#675) + + This reverts commit b60dca8b6450a9729670986d2899cca54ccdbb6d. + + #547 doesn't build clean anymore with the keyboard interactive changes. + +- [berney brought this change] + + Option to build both static and shared libraries (#547) + + files: cmakelists.txt + + Notes: + * Option to build both static and shared libraries when using CMake + + Credit: + berney + +- [xalopp brought this change] + + Use modern API in userauth_keyboard_interactive() (#663) + + Files: userauth_kbd_packet.c, userauth_kbd_packet.h, test_keyboard_interactive_auth_info_request.c, userauth.c + + Notes: + This refactors `SSH_MSG_USERAUTH_INFO_REQUEST` processing in `userauth_keyboard_interactive()` in order to improve robustness, correctness and readability or the code. + + * Refactor userauth_keyboard_interactive to use new api for packet parsing + * add unit test for userauth_keyboard_interactive_parse_response() + * add _libssh2_get_boolean() and _libssh2_get_byte() utility functions + + Credit: + xalopp + +- [xalopp brought this change] + + Fix formatting in manual page (#667) + + Fixed formatting of `LIBSSH2_ERROR_AUTHENTICATION_FAILED` in the errors section. + + credit: xalopp + +- [tihmstar brought this change] + + NULL terminate server_sign_algorithms string (#669) + + files: packet.c, libssh2_priv.h + + notes: + * Fix heap buffer overflow in _libssh2_key_sign_algorithm + + When allocating `session->server_sign_algorithms` which is a `char*` is is important to also allocate space for the string-terminating null byte at the end and make sure the string is actually null terminated. + + Without this fix, the `strchr()` call inside the `_libssh2_key_sign_algorithm` (line 1219) function will try to parse the string and go out of buffer on the last invocation. + + Credit: tihmstar + Co-authored-by: Will Cosgrove + +- [Will Cosgrove brought this change] + + free RSA2 related memory (#664) + + Free `server_sign_algorithms` and `sign_algo_prefs`. + +- [Will Cosgrove brought this change] + + Legacy Agent support for rsa2 key upgrading/downgrading #659 (#662) + + Files: libssh2.h, agent.c, userauth.c + + Notes: + Part 2 of the fix for #659. This adds rsa key downgrading for agents that don't support sha2 upgrading. It also adds better trace output for debugging/logging around key upgrading. + + Credit: + Will Cosgrove (signed off by Michael Buckley) + +- [Ian Hattendorf brought this change] + + Support rsa-sha2 agent flags (#661) + + File: agent.c + Notes: implements rsa-sha2 flags used to tell the agent which signing algo to use. + https://tools.ietf.org/id/draft-miller-ssh-agent-01.html#rfc.section.4.5.1 + + Credit: + Ian Hattendorf + +Daniel Stenberg (13 Jan 2022) +- [Sunil Nimmagadda brought this change] + + ssh: Add support for userauth banner. + + The new libssh2_userauth_banner API allows to get an optional + userauth banner sent with SSH_MSG_USERAUTH_BANNER packet by the + server. + + Closes #610 + +GitHub (6 Jan 2022) +- [Michael Buckley brought this change] + + Fix a memcmp errors in code that was changed from memmem to memcmp (#656) + + Notes: + Fixed supported algo prefs list check when upgrading rsa keys + + Credit: Michael Buckley + +- [Hayden Roche brought this change] + + Add support for a wolfSSL crypto backend. (#629) + + It uses wolfSSL's OpenSSL compatibility layer, so rather than introduce new + wolfssl.h/c files, the new backend just reuses openssl.h/c. Additionally, + replace EVP_Cipher() calls with EVP_CipherUpdate(), since EVP_Cipher() is not + recommended. + + Credit: Hayden Roche + +- [Bastien Durel brought this change] + + Runtime engine detection with libssh2_crypto_engine() (#643) + + File: + version.c, HACKING-CRYPTO, libssh2.h, libssh2_crypto_engine.3, makefile. + + Notes: + libssh2_crypto_engine() API to get crypto engine at runtime. + + Credit: Bastien Durel + +- [Will Cosgrove brought this change] + + RSA SHA2 256/512 key upgrade support RFC 8332 #536 (#626) + + Notes: + * Host Key RSA 256/512 support #536 + * Client side key hash upgrading for RFC 8332 + * Support for server-sig-algs, ext-info-c server messages + * Customizing preferred server-sig-algs via the preference LIBSSH2_METHOD_SIGN_ALGO + + Credit: Anders Borum, Will Cosgrove + +- [xalopp brought this change] + + fix: use userauth name length to check memory boundaries for userauth name, fixes #653 (#654) + + File: userauth.c + + Notes: + Fixes `userauth_kybd_auth_name_len` length check + + Co-authored-by: Xaver Lopenstedt + +- [Daniel Stenberg brought this change] + + agent: handle overly large comment lengths (#651) + + Reported-by: Harry Sintonen + +- [Daniel Stenberg brought this change] + + userauth: check for too large userauth_kybd_auth_name_len (#650) + + ... before using it. + + Reported-by: MarcoPoloPie + Fixes #649 + +Daniel Stenberg (17 Dec 2021) +- .github/SECURITY.md: fix the URL + +- .github/SECURITY.md: add security policy + +GitHub (30 Nov 2021) +- [Will Cosgrove brought this change] + + hostkey_method_ssh_ed25519_init() check key bounds (#645) + + * hostkey_method_ssh_ed25519_init() check key bounds + + File: hostkey.c + + Notes: + Additional key length checking before calling _libssh2_ed25519_new_public() + + Credit: + Will Cosgrove + +- [Will Cosgrove brought this change] + + Fix error message in memory_read_privatekey #636 + + file: userauth.c + note: fix error message + credit: + volund + +- [cntrump brought this change] + + Update maketgz for macOS (#543) + + File: + maketgz + + Notes: + Fix error on macOS: sed: -e: No such file or directory + + Credit: + cntrump + +- [Jun Tseng brought this change] + + CMake update minimum version to 2.8.12 (#639) + + File: + CMakeLists.txt + + Notes: + Following CMake's advice, Update the minimum required version. + + Credit: + Jun Tseng + +Daniel Stenberg (8 Nov 2021) +- [David Korczynski brought this change] + + ci: Add CIFuzz integration + + Notes: + Add CIFuzz integration to run fuzzer using the OSS-Fuzz infrastructure + at each PR. + + Signed-off-by: David Korczynski + Closes #635 + +GitHub (26 Oct 2021) +- [Uwe L. Korn brought this change] + + Use libssh2_EXPORTS as an alternative to _WINDLL (#470) + + Files: libssh2.h + + Notes: + `_WINDLL` is only defined when a Visual Studio CMake generator is used, `libssh2_EXPORTS` is used though for all CMake generator if a shared libssh2 library is being built. + + Credit: + Uwe L. Korn + +Viktor Szakats (1 Oct 2021) +- windows: fix clang and WinCNG warnings + + Fix these categories of warning: + + - in `wincng.c` disagreement in signed/unsigned char when passing around + the passphrase string: + `warning: pointer targets in passing argument [...] differ in signedness [-Wpointer-sign]` + Fixed by using `const unsigned char *` in all static functions and + applying/updating casts as necessary. + + - in each use of `libssh2_*_init()` macros where the result is not used: + `warning: value computed is not used [-Wunused-value]` + Fixed by using `(void)` casts. + + - `channel.c:1171:7: warning: 'rc' may be used uninitialized in this function [-Wmaybe-uninitialized]` + Fixed by initializing this variable with `LIBSSH2_ERROR_CHANNEL_UNKNOWN`. + While there I replaced a few 0 literals with `LIBSSH2_ERROR_NONE`. + + - in `sftp.c`, several of these two warnings: + `warning: 'data' may be used uninitialized in this function [-Wmaybe-uninitialized]` + `warning: 'data_len' may be used uninitialized in this function [-Wmaybe-uninitialized]` + Fixed by initializing these variables with NULL and 0 respectively. + + - Also removed the exec attribute from `wincng.h`. + + Notes: + - There are many pre-existing checksrc issues. + - The `sftp.c` and `channel.c` warnings may apply to other platforms as well. + + Closes #628 + +Daniel Stenberg (25 Sep 2021) +- README: use www.libssh2.org for the license link + +- libssh2.h: bump it to 1.10.1-dev + +- mailing list: moved to lists.haxx.se + +GitHub (2 Sep 2021) +- [Laurent Stacul brought this change] + + openssh_fixture.c: Fix openssh_server build not working (#616) (#620) + + File: openssh_fixture.c + + Notes: + fixes too long of output lines building docker image + + Credit: + Laurent Stacul + +- [Will Cosgrove brought this change] + + openssh_fixture.c: fix warning (#621) + + File: openssh_fixture.c + + Notes: + Fix `portable_sleep` return type warning + + Credit: + Will Cosgrove + +- [Will Cosgrove brought this change] + + Update CI to use latest Ubuntu #624 (#625) + + File: ci.yml + + Notes: + Update CI to use latest Ubuntu #624 + + Also removed 32 bit building in the matrix. + + Credit: + Will Cosgrove + +- [Will Cosgrove brought this change] + + Update .gitignore + + Add .DS_Store files for macOS + +- [Laurent Stacul brought this change] + + Makefile.am: Add missing key in case openssl > 1.1.0 (#617) + + File: Makefile.am + + Notes: fix missing test keys + + Credit: + Laurent Stacul + +Version 1.10.0 (29 Aug 2021) + +Daniel Stenberg (29 Aug 2021) +- [Will Cosgrove brought this change] + + updated docs for 1.10.0 release + +Marc Hörsken (30 May 2021) +- [Laurent Stacul brought this change] + + [tests] Try several times to connect the ssh server + + Sometimes, as the OCI container is run in detached mode, it is possible + the actual server is not ready yet to handle SSH traffic. The goal of + this PR is to try several times (max 3). The mechanism is the same as + for the connection to the docker machine. + +- [Laurent Stacul brought this change] + + Remove openssh_server container on test exit + +- [Laurent Stacul brought this change] + + Allow the tests to run inside a container + + The current tests suite starts SSH server as OCI container. This commit + add the possibility to run the tests in a container provided that: + + * the docker client is installed builder container + * the host docker daemon unix socket has been mounted in the builder + container (with, if needed, the DOCKER_HOST environment variable + accordingly set, and the permission to write on this socket) + * the builder container is run on the default bridge network, or the + host network. This PR does not handle the case where the builder + container is on another network. + +Marc Hoersken (28 May 2021) +- CI/appveyor: run SSH server for tests on GitHub Actions (#607) + + No longer rely on DigitalOcean to host the Docker container. + + Unfortunately we require a small dispatcher script that has + access to a GitHub access token with scope repo in order to + trigger the daemon workflow on GitHub Actions also for PRs. + + This script is hosted by myself for the time being until GitHub + provides a tighter scope to trigger the workflow_dispatch event. + +GitHub (26 May 2021) +- [Will Cosgrove brought this change] + + openssl.c: guards around calling FIPS_mode() #596 (#603) + + Notes: + FIPS_mode() is not implemented in LibreSSL and this API is removed in OpenSSL 3.0 and was introduced in 0.9.7. Added guards around making this call. + + Credit: + Will Cosgrove + +- [Will Cosgrove brought this change] + + configure.ac: don't undefine scoped variable (#594) + + * configure.ac: don't undefine scoped variable + + To get this script to run with Autoconf 2.71 on macOS I had to remove the undefine of the backend for loop variable. It seems scoped to the for loop and also isn't referenced later in the script so it seems OK to remove it. + + * configure.ac: remove cygwin specific CFLAGS #598 + + Notes: + Remove cygwin specific Win32 CFLAGS and treat the build like a posix build + + Credit: + Will Cosgrove, Brian Inglis + +- [Laurent Stacul brought this change] + + tests: Makefile.am: Add missing tests client keys in distribution tarball (#604) + + Notes: + Added missing test keys. + + Credit: + Laurent Stacul + +- [Laurent Stacul brought this change] + + Makefile.am: Add missing test keys in the distribution tarball (#601) + + Notes: + Fix tests missing key to build the OCI image + + Credit: + Laurent Stacul + +Daniel Stenberg (16 May 2021) +- dist: add src/agent.h + + Fixes #597 + Closes #599 + +GitHub (12 May 2021) +- [Will Cosgrove brought this change] + + packet.c: Reset read timeout after received a packet (#576) (#586) + + File: + packet.c + + Notes: + Attempt keyboard interactive login (Azure AD 2FA login) and use more than 60 seconds to complete the login, the connection fails. + + The _libssh2_packet_require function does almost the same as _libssh2_packet_requirev but this function sets state->start = 0 before returning. + + Credit: + teottin, Co-authored-by: Tor Erik Ottinsen + +- [kkoenig brought this change] + + Support ECDSA certificate authentication (#570) + + Files: hostkey.c, userauth.c, test_public_key_auth_succeeds_with_correct_ecdsa_key.c + + Notes: + Support ECDSA certificate authentication + + Add a test for: + - Existing ecdsa basic public key authentication + - ecdsa public key authentication with a signed public key + + Credit: + kkoenig + +- [Gabriel Smith brought this change] + + agent.c: Add support for Windows OpenSSH agent (#517) + + Files: agent.c, agent.h, agent_win.c + + Notes: + * agent: Add support for Windows OpenSSH agent + + The implementation was partially taken and modified from that found in + the Portable OpenSSH port to Win32 by the PowerShell team, but mostly + based on the existing Unix OpenSSH agent support. + + https://github.com/PowerShell/openssh-portable + + Regarding the partial transfer support implementation: partial transfers + are easy to deal with, but you need to track additional state when + non-blocking IO enters the picture. A tracker of how many bytes have + been transfered has been placed in the transfer context struct as that's + where it makes most sense. This tracker isn't placed behind a WIN32 + #ifdef as it will probably be useful for other agent implementations. + + * agent: win32 openssh: Disable overlapped IO + + Non-blocking IO is not currently supported by the surrounding agent + code, despite a lot of the code having everything set up to handle it. + + Credit: + Co-authored-by: Gabriel Smith + +- [Zenju brought this change] + + Fix detailed _libssh2_error being overwritten (#473) + + Files: openssl.c, pem.c, userauth.c + + Notes: + * Fix detailed _libssh2_error being overwritten by generic errors + * Unified error handling + + Credit: + Zenju + +- [Paul Capron brought this change] + + Fix _libssh2_random() silently discarding errors (#520) + + Notes: + * Make _libssh2_random return code consistent + + Previously, _libssh2_random was advertized in HACKING.CRYPTO as + returning `void` (and was implemented that way in os400qc3.c), but that + was in other crypto backends a lie; _libssh2_random is (a macro + expanding) to an int-value expression or function. + + Moreover, that returned code was: + — 0 or success, -1 on error for the MbedTLS & WinCNG crypto backends + But also: + — 1 on success, -1 or 0 on error for the OpenSSL backend! + – 1 on success, error cannot happen for libgcrypt! + + This commit makes explicit that _libssh2_random can fail (because most of + the underlying crypto functions can indeed fail!), and it makes its result + code consistent: 0 on success, -1 on error. + + This is related to issue #519 https://github.com/libssh2/libssh2/issues/519 + It fixes the first half of it. + + * Don't silent errors of _libssh2_random + + Make sure to check the returned code of _libssh2_random(), and + propagates any failure. + + A new LIBSSH_ERROR_RANDGEN constant is added to libssh2.h + None of the existing error constants seemed fit. + + This commit is related to d74285b68450c0e9ea6d5f8070450837fb1e74a7 + and to https://github.com/libssh2/libssh2/issues/519 (see the issue + for more info.) It closes #519. + + Credit: + Paul Capron + +- [Gabriel Smith brought this change] + + ci: Remove caching of docker image layers (#589) + + Notes: + continued ci reliability work. + + Credit: + Gabriel Smith + +- [Gabriel Smith brought this change] + + ci: Speed up docker builds for tests (#587) + + Notes: + The OpenSSH server docker image used for tests is pre-built to prevent + wasting time building it during a test, and unneeded rebuilds are + prevented by caching the image layers. + + Credit: + Gabriel Smith + +- [Will Cosgrove brought this change] + + userauth.c: don't error if using keys without RSA (#555) + + file: userauth.c + + notes: libssh2 now supports many other key types besides RSA, if the library is built without RSA support and a user attempts RSA auth it shouldn't be an automatic error + + credit: + Will Cosgrove + +- [Marc brought this change] + + openssl.c: Avoid OpenSSL latent error in FIPS mode (#528) + + File: + openssl.c + + Notes: + Avoid initing MD5 digest, which is not permitted in OpenSSL FIPS certified cryptography mode. + + Credit: + Marc + +- [Laurent Stacul brought this change] + + openssl.c: Fix EVP_Cipher interface change in openssl 3 #463 + + File: + openssl.c + + Notes: + Fixes building with OpenSSL 3, #463. + + The change is described there: + https://github.com/openssl/openssl/commit/f7397f0d58ce7ddf4c5366cd1846f16b341fbe43 + + Credit: + Laurent Stacul, reported by Sergei + +- [Gabriel Smith brought this change] + + openssh_fixture.c: Fix potential overwrite of buffer when reading stdout of command (#580) + + File: + openssh_fixture.c + Notes: + If reading the full output from the executed command took multiple + passes (such as when reading multiple lines) the old code would read + into the buffer starting at the some position (the start) every time. + The old code only works if fgets updated p or had an offset parameter, + both of which are not true. + + Credit: + Gabriel Smith + +- [Gabriel Smith brought this change] + + ci: explicitly state the default branch (#585) + + Notes: + It looks like the $default-branch macro only works in templates, not + workflows. This is not explicitly stated anywhere except the linked PR + comment. + + https://github.com/actions/starter-workflows/pull/590#issuecomment-672360634 + + credit: + Gabriel Smith + +- [Gabriel Smith brought this change] + + ci: Swap from Travis to Github Actions (#581) + + Files: ci files + + Notes: + Move Linux CI using Github Actions + + Credit: + Gabriel Smith, Marc Hörsken + +- [Mary brought this change] + + libssh2_priv.h: add iovec on 3ds (#575) + + file: libssh2_priv.h + note: include iovec for 3DS + credit: Mary Mstrodl + +- [Laurent Stacul brought this change] + + Tests: Fix unused variables warning (#561) + + file: test_public_key_auth_succeeds_with_correct_ed25519_key_from_mem.c + + notes: fixed unused vars + + credit: + Laurent Stacul + +- [Viktor Szakats brought this change] + + bcrypt_pbkdf.c: fix clang10 false positive warning (#563) + + File: bcrypt_pbkdf.c + + Notes: + blf_enc() takes a number of 64-bit blocks to encrypt, but using + sizeof(uint64_t) in the calculation triggers a warning with + clang 10 because the actual data type is uint32_t. Pass + BCRYPT_BLOCKS / 2 for the number of blocks like libc bcrypt(3) + does. + + Ref: https://github.com/openbsd/src/commit/04a2240bd8f465bcae6b595d912af3e2965856de + + Fixes #562 + + Credit: + Viktor Szakats + +- [Will Cosgrove brought this change] + + transport.c: release payload on error (#554) + + file: transport.c + notes: If the payload is invalid and there is an early return, we could leak the payload + credit: + Will Cosgrove + +- [Will Cosgrove brought this change] + + ssh2_client_fuzzer.cc: fixed building + + The GitHub web editor did some funky things + +- [Will Cosgrove brought this change] + + ssh_client_fuzzer.cc: set blocking mode on (#553) + + file: ssh_client_fuzzer.cc + + notes: the session needs blocking mode turned on to avoid EAGAIN being returned from libssh2_session_handshake() + + credit: + Will Cosgrove, reviewed by Michael Buckley + +- [Etienne Samson brought this change] + + Add a LINT option to CMake (#372) + + * ci: make style-checking available locally + + * cmake: add a linting target + + * tests: check test suite syntax with checksrc.pl + +- [Will Cosgrove brought this change] + + kex.c: kex_agree_instr() improve string reading (#552) + + * kex.c: kex_agree_instr() improve string reading + + file: kex.c + notes: if haystack isn't null terminated we should use memchr() not strchar(). We should also make sure we don't walk off the end of the buffer. + credit: + Will Cosgrove, reviewed by Michael Buckley + +- [Will Cosgrove brought this change] + + kex.c: use string_buf in ecdh_sha2_nistp (#551) + + * kex.c: use string_buf in ecdh_sha2_nistp + + file: kex.c + + notes: + use string_buf in ecdh_sha2_nistp() to avoid attempting to parse malformed data + +- [Will Cosgrove brought this change] + + kex.c: move EC macro outside of if check #549 (#550) + + File: kex.c + + Notes: + Moved the macro LIBSSH2_KEX_METHOD_EC_SHA_HASH_CREATE_VERIFY outside of the LIBSSH2_ECDSA since it's also now used by the ED25519 code. + + Sha 256, 384 and 512 need to be defined for all backends now even if they aren't used directly. I believe this is already the case, but just a heads up. + + Credit: + Stefan-Ghinea + +- [Tim Gates brought this change] + + kex.c: fix simple typo, niumber -> number (#545) + + File: kex.c + + Notes: + There is a small typo in src/kex.c. + + Should read `number` rather than `niumber`. + + Credit: + Tim Gates + +- [Tseng Jun brought this change] + + session.c: Correct a typo which may lead to stack overflow (#533) + + File: session.c + + Notes: + Seems the author intend to terminate banner_dup buffer, later, print it to the debug console. + + Author: + Tseng Jun + +Marc Hoersken (10 Oct 2020) +- wincng: fix random big number generation to match openssl + + The old function would set the least significant bits in + the most significant byte instead of the most significant bits. + + The old function would also zero pad too much bits in the + most significant byte. This lead to a reduction of key space + in the most significant byte according to the following listing: + - 8 bits reduced to 0 bits => eg. 2048 bits to 2040 bits DH key + - 7 bits reduced to 1 bits => eg. 2047 bits to 2041 bits DH key + - 6 bits reduced to 2 bits => eg. 2046 bits to 2042 bits DH key + - 5 bits reduced to 3 bits => eg. 2045 bits to 2043 bits DH key + + No change would occur for the case of 4 significant bits. + For 1 to 3 significant bits in the most significant byte + the DH key would actually be expanded instead of reduced: + - 3 bits expanded to 5 bits => eg. 2043 bits to 2045 bits DH key + - 2 bits expanded to 6 bits => eg. 2042 bits to 2046 bits DH key + - 1 bits expanded to 7 bits => eg. 2041 bits to 2047 bits DH key + + There is no case of 0 significant bits in the most significant byte + since this would be a case of 8 significant bits in the next byte. + + At the moment only the following case applies due to a fixed + DH key size value currently being used in libssh2: + + The DH group_order is fixed to 256 (bytes) which leads to a + 2047 bits DH key size by calculating (256 * 8) - 1. + + This means the DH keyspace was previously reduced from 2047 bits + to 2041 bits (while the top and bottom bits are always set), so the + keyspace is actually always reduced from 2045 bits to 2039 bits. + + All of this is only relevant for Windows versions supporting the + WinCNG backend (Vista or newer) before Windows 10 version 1903. + + Closes #521 + +Daniel Stenberg (28 Sep 2020) +- libssh2_session_callback_set.3: explain the recv/send callbacks + + Describe how to actually use these callbacks. + + Closes #518 + +GitHub (23 Sep 2020) +- [Will Cosgrove brought this change] + + agent.c: formatting + + Improved formatting of RECV_SEND_ALL macro. + +- [Will Cosgrove brought this change] + + CMakeLists.txt: respect install lib dir #405 (#515) + + Files: + CMakeLists.txt + + Notes: + Use CMAKE_INSTALL_LIBDIR directory + + Credit: Arfrever + +- [Will Cosgrove brought this change] + + kex.c: group16-sha512 and group18-sha512 support #457 (#468) + + Files: kex.c + + Notes: + Added key exchange group16-sha512 and group18-sha512. As a result did the following: + + Abstracted diffie_hellman_sha256() to diffie_hellman_sha_algo() which is now algorithm agnostic and takes the algorithm as a parameter since we needed sha512 support. Unfortunately it required some helper functions but they are simple. + Deleted diffie_hellman_sha1() + Deleted diffie_hellman_sha1 specific macro + Cleaned up some formatting + Defined sha384 in os400 and wincng backends + Defined LIBSSH2_DH_MAX_MODULUS_BITS to abort the connection if we receive too large of p from the server doing sha1 key exchange. + Reorder the default key exchange list to match OpenSSH and improve security + + Credit: + Will Cosgrove + +- [Igor Klevanets brought this change] + + agent.c: Recv and send all bytes via network in agent_transact_unix() (#510) + + Files: agent.c + + Notes: + Handle sending/receiving partial packet replies in agent.c API. + + Credit: Klevanets Igor + +- [Daniel Stenberg brought this change] + + Makefile.am: include all test files in the dist #379 + + File: + Makefile.am + + Notes: + No longer conditionally include OpenSSL specific test files, they aren't run if we're not building against OpenSSL 1.1.x anyway. + + Credit: + Daniel Stenberg + +- [Max Dymond brought this change] + + Add support for an OSS Fuzzer fuzzing target (#392) + + Files: + .travis.yml, configure.ac, ossfuzz + + Notes: + This adds support for an OSS-Fuzz fuzzing target in ssh2_client_fuzzer, + which is a cut down example of ssh2.c. Future enhancements can improve + coverage. + + Credit: + Max Dymond + +- [Sebastián Katzer brought this change] + + mbedtls.c: ECDSA support for mbed TLS (#385) + + Files: + mbedtls.c, mbedtls.h, .travis.yml + + Notes: + This PR adds support for ECDSA for both key exchange and host key algorithms. + + The following elliptic curves are supported: + + 256-bit curve defined by FIPS 186-4 and SEC1 + 384-bit curve defined by FIPS 186-4 and SEC1 + 521-bit curve defined by FIPS 186-4 and SEC1 + + Credit: + Sebastián Katzer + +Marc Hoersken (1 Sep 2020) +- buildconf: exec autoreconf to avoid additional process (#512) + + Also make buildconf exit with the return code of autoreconf. + + Follow up to #224 + +- scp.c: fix indentation in shell_quotearg documentation + +- wincng: make more use of new helper functions (#496) + +- wincng: make sure algorithm providers are closed once (#496) + +GitHub (10 Jul 2020) +- [David Benjamin brought this change] + + openssl.c: clean up curve25519 code (#499) + + File: openssl.c, openssl.h, crypto.h, kex.c + + Notes: + This cleans up a few things in the curve25519 implementation: + + - There is no need to create X509_PUBKEYs or PKCS8_PRIV_KEY_INFOs to + extract key material. EVP_PKEY_get_raw_private_key and + EVP_PKEY_get_raw_public_key work fine. + + - libssh2_x25519_ctx was never used (and occasionally mis-typedefed to + libssh2_ed25519_ctx). Remove it. The _libssh2_curve25519_new and + _libssh2_curve25519_gen_k interfaces use the bytes. Note, if it needs + to be added back, there is no need to roundtrip through + EVP_PKEY_new_raw_private_key. EVP_PKEY_keygen already generated an + EVP_PKEY. + + - Add some missing error checks. + + Credit: + David Benjamin + +- [Will Cosgrove brought this change] + + transport.c: socket is disconnected, return error (#500) + + File: transport.c + + Notes: + This is to fix #102, instead of continuing to attempt to read a disconnected socket, it will now error out. + + Credit: + TDi-jonesds + +- [Will Cosgrove brought this change] + + stale.yml + + Increasing stale values. + +Marc Hoersken (6 Jul 2020) +- wincng: try newer DH API first, fallback to legacy RSA API + + Avoid the use of RtlGetVersion or similar Win32 functions, + since these depend on version information from manifests. + + This commit makes the WinCNG backend first try to use the + new DH algorithm API with the raw secret derivation feature. + In case this feature is not available the WinCNG backend + will fallback to the classic approach of using RSA-encrypt + to perform the required modular exponentiation of BigNums. + + The feature availability test is done during the first handshake + and the result is stored in the crypto backends global state. + + Follow up to #397 + Closes #484 + +- wincng: fix indentation of function arguments and comments + + Follow up to #397 + +- [Wez Furlong brought this change] + + wincng: use newer DH API for Windows 8.1+ + + Since Windows 1903 the approach used to perform DH kex with the CNG + API has been failing. + + This commit switches to using the `DH` algorithm provider to perform + generation of the key pair and derivation of the shared secret. + + It uses a feature of CNG that is not yet documented. The sources of + information that I've found on this are: + + * https://stackoverflow.com/a/56378698/149111 + * https://github.com/wbenny/mini-tor/blob/5d39011e632be8e2b6b1819ee7295e8bd9b7a769/mini/crypto/cng/dh.inl#L355 + + With this change I am able to successfully connect from Windows 10 to my + ubuntu system. + + Refs: https://github.com/alexcrichton/ssh2-rs/issues/122 + Fixes: https://github.com/libssh2/libssh2/issues/388 + Closes: https://github.com/libssh2/libssh2/pull/397 + +GitHub (1 Jul 2020) +- [Zenju brought this change] + + comp.c: Fix name clash with ZLIB macro "compress" (#418) + + File: comp.c + + Notes: + * Fix name clash with ZLIB macro "compress". + + Credit: + Zenju + +- [yann-morin-1998 brought this change] + + buildsystem: drop custom buildconf script, rely on autoreconf (#224) + + Notes: + The buildconf script is currently required, because we need to copy a + header around, because it is used both from the library and the examples + sources. + + However, having a custom 'buildconf'-like script is not needed if we can + ensure that the header exists by the time it is needed. For that, we can + just append the src/ directory to the headers search path for the + examples. + + And then it means we no longer need to generate the same header twice, + so we remove the second one from configure.ac. + + Now, we can just call "autoreconf -fi" to generate the autotools files, + instead of relying on the canned sequence in "buildconf", since + autoreconf has now long known what to do at the correct moment (future + versions of autotools, automake, autopoint, autoheader etc... may + require an other ordering, or other intermediate steps, etc...). + + Eventually, get rid of buildconf now it is no longer needed. In fact, we + really keep it for legacy, but have it just call autoreconf (and print a + nice user-friendly warning). Don't include it in the release tarballs, + though. + + Update doc, gitignore, and travis-CI jobs accordingly. + + Credit: + Signed-off-by: "Yann E. MORIN" + Cc: Sam Voss + +- [Will Cosgrove brought this change] + + libssh2.h: Update Diffie Hellman group values (#493) + + File: libssh2.h + + Notes: + Update the min, preferred and max DH group values based on RFC 8270. + + Credit: + Will Cosgrove, noted from email list by Mitchell Holland + +Marc Hoersken (22 Jun 2020) +- travis: use existing Makefile target to run checksrc + +- Makefile: also run checksrc on test source files + +- tests: avoid use of deprecated function _sleep (#490) + +- tests: avoid use of banned function strncat (#489) + +- tests: satisfy checksrc regarding max line length of 79 chars + + Follow up to 2764bc8e06d51876b6796d6080c6ac51e20f3332 + +- tests: satisfy checksrc with whitespace only fixes + + checksrc.pl -i4 -m79 -ASIZEOFNOPAREN -ASNPRINTF + -ACOPYRIGHT -AFOPENMODE tests/*.[ch] + +- tests: add support for ports published via Docker for Windows + +- tests: restore retry behaviour for docker-machine ip command + +- tests: fix mix of declarations and code failing C89 compliance + +- wincng: add and improve checks in bit counting function + +- wincng: align bits to bytes calculation in all functions + +- wincng: do not disable key validation that can be enabled + + The modular exponentiation also works with key validation enabled. + +- wincng: fix return value in _libssh2_dh_secret + + Do not ignore return value of modular exponentiation. + +- appveyor: build and run tests for WinCNG crypto backend + +GitHub (1 Jun 2020) +- [suryakalpo brought this change] + + INSTALL_CMAKE.md: Update formatting (#481) + + File: INSTALL_CMAKE.md + + Notes: + Although the original text would be immediately clear to seasoned users of CMAKE and/or Unix shell, the lack of newlines may cause some confusion for newcomers. Hence, wrapping the texts in a md code-block such that the newlines appear as intended. + + credit: + suryakalpo + +Marc Hoersken (31 May 2020) +- src: add new and align include guards in header files (#480) + + Make sure all include guards exist and follow the same format. + +- wincng: fix multiple definition of `_libssh2_wincng' (#479) + + Add missing include guard and move global state + from header to source file by using extern. + +GitHub (28 May 2020) +- [Will Cosgrove brought this change] + + transport.c: moving total_num check from #476 (#478) + + file: transport.c + + notes: + moving total_num zero length check from #476 up to the prior bounds check which already includes a total_num check. Makes it slightly more readable. + + credit: + Will Cosgrove + +- [lutianxiong brought this change] + + transport.c: fix use-of-uninitialized-value (#476) + + file:transport.c + + notes: + return error if malloc(0) + + credit: + lutianxiong + +- [Dr. Koutheir Attouchi brought this change] + + libssh2_sftp.h: Changed type of LIBSSH2_FX_* constants to unsigned long, fixes #474 + + File: + libssh2_sftp.h + + Notes: + Error constants `LIBSSH2_FX_*` are only returned by `libssh2_sftp_last_error()` which returns `unsigned long`. + Therefore these constants should be defined as unsigned long literals, instead of int literals. + + Credit: + Dr. Koutheir Attouchi + +- [monnerat brought this change] + + os400qc3.c: constify libssh2_os400qc3_hash_update() data parameter. (#469) + + Files: os400qc3.c, os400qc3.h + + Notes: + Fixes building on OS400. #426 + + Credit: + Reported-by: hjindra on github, dev by Monnerat + +- [monnerat brought this change] + + HACKING.CRYPTO: keep up to date with new crypto definitions from code. (#466) + + File: HACKING.CRYPTO + + Notes: + This commit updates the HACKING.CRYPTO documentation file in an attempt to make it in sync with current code. + New documented features are: + + SHA384 + SHA512 + ECDSA + ED25519 + + Credit: + monnerat + +- [Harry Sintonen brought this change] + + kex.c: Add diffie-hellman-group14-sha256 Key Exchange Method (#464) + + File: kex.c + + Notes: Added diffie-hellman-group14-sha256 kex + + Credit: Harry Sintonen + +- [Will Cosgrove brought this change] + + os400qc3.h: define sha512 macros (#465) + + file: os400qc3.h + notes: fixes for building libssh2 1.9.x + +- [Will Cosgrove brought this change] + + os400qc3.h: define EC types to fix building #426 (#462) + + File: os400qc3.h + Notes: define missing EC types which prevents building + Credit: hjindra + +- [Brendan Shanks brought this change] + + hostkey.c: Fix 'unsigned int'/'uint32_t' mismatch (#461) + + File: hostkey.c + + Notes: + These types are the same size so most compilers are fine with it, but CodeWarrior (on classic MacOS) throws an ‘illegal implicit conversion’ error + + Credit: Brendan Shanks + +- [Thomas Klausner brought this change] + + Makefile.am: Fix unportable test(1) operator. (#459) + + file: Makefile.am + + Notes: + The POSIX comparison operator for test(1) is =; bash supports == but not even test from GNU coreutils does. + + Credit: + Thomas Klausner + +- [Tseng Jun brought this change] + + openssl.c: minor changes of coding style (#454) + + File: openssl.c + + Notes: + minor changes of coding style and align preprocessor conditional for #439 + + Credit: + Tseng Jun + +- [Hans Meier brought this change] + + openssl.c: Fix for use of uninitialized aes_ctr_cipher.key_len (#453) + + File: + Openssl.c + + Notes: + * Fix for use of uninitialized aes_ctr_cipher.key_len when using HAVE_OPAQUE_STRUCTS, regression from #439 + + Credit: + Hans Meirer, Tseng Jun + +- [Zenju brought this change] + + agent.c: Fix Unicode builds on Windows (#417) + + File: agent.c + + Notes: + Fixes unicode builds for Windows in Visual Studio 16.3.2. + + Credit: + Zenju + +- [Hans Meier brought this change] + + openssl.c: Fix use-after-free crash in openssl backend without memory leak (#439) + + Files: openssl.c + + Notes: + Fixes memory leaks and use after free AES EVP_CIPHER contexts when using OpenSSL 1.0.x. + + Credit: + Hans Meier + +- [Romain Geissler @ Amadeus brought this change] + + Session.c: Fix undefined warning when mixing with LTO-enabled libcurl. (#449) + + File: Session.c + + Notes: + With gcc 9, libssh2, libcurl and LTO enabled for all binaries I see this + warning (error with -Werror): + + vssh/libssh2.c: In function ‘ssh_statemach_act’: + /data/mwrep/rgeissler/ospack/ssh2/BUILD/libssh2-libssh2-03c7c4a/src/session.c:579:9: error: ‘seconds_to_next’ is used uninitialized in this function [-Werror=uninitialized] + 579 | int seconds_to_next; + | ^ + lto1: all warnings being treated as errors + + Gcc normally issues -Wuninitialized when it is sure there is a problem, + and -Wmaybe-uninitialized when it's not sure, but it's possible. Here + the compiler seems to have find a real case where this could happen. I + looked in your code and overall it seems you always check if the return + code is non null, not often that it's below zero. I think we should do + the same here. With this patch, gcc is fine. + + Credit: + Romain-Geissler-1A + +- [Zenju brought this change] + + transport.c: Fix crash with delayed compression (#443) + + Files: transport.c + + Notes: + Fixes crash with delayed compression option using Bitvise server. + + Contributor: + Zenju + +- [Will Cosgrove brought this change] + + Update INSTALL_MAKE path to INSTALL_MAKE.md (#446) + + Included for #429 + +- [Will Cosgrove brought this change] + + Update INSTALL_CMAKE filename to INSTALL_CMAKE.md (#445) + + Fixing for #429 + +- [Wallace Souza brought this change] + + Rename INSTALL_CMAKE to INTALL_CMAKE.md (#429) + + Adding Markdown file extension in order to Github render the instructions properly + +Will Cosgrove (17 Dec 2019) +- [Daniel Stenberg brought this change] + + include/libssh2.h: fix comment: the known host key uses 4 bits (#438) + +- [Zenju brought this change] + + ssh-ed25519: Support PKIX + calc pubkey from private (#416) + + Files: openssl.c/h + Author: Zenju + Notes: + Adds support for PKIX key reading by fixing: + + _libssh2_pub_priv_keyfile() is missing the code to extract the ed25519 public key from a given private key + + _libssh2_ed25519_new_private_frommemory is only parsing the openssh key format but does not understand PKIX (as retrieved via PEM_read_bio_PrivateKey) + +GitHub (15 Oct 2019) +- [Will Cosgrove brought this change] + + .travis.yml: Fix Chrome and 32 bit builds (#423) + + File: .travis.yml + + Notes: + * Fix Chrome installing by using Travis build in directive + * Update to use libgcrypt20-dev package to fix 32 bit builds based on comments found here: + https://launchpad.net/ubuntu/xenial/i386/libgcrypt11-dev + +- [Will Cosgrove brought this change] + + packet.c: improved parsing in packet_x11_open (#410) + + Use new API to parse data in packet_x11_open() for better bounds checking. + +Will Cosgrove (12 Sep 2019) +- [Michael Buckley brought this change] + + knownhost.c: Double the static buffer size when reading and writing known hosts (#409) + + Notes: + We had a user who was being repeatedly prompted to accept a server key repeatedly. It turns out the base64-encoded key was larger than the static buffers allocated to read and write known hosts. I doubled the size of these buffers. + + Credit: + Michael Buckley + +GitHub (4 Sep 2019) +- [Will Cosgrove brought this change] + + packet.c: improved packet parsing in packet_queue_listener (#404) + + * improved bounds checking in packet_queue_listener + + file: packet.c + + notes: + improved parsing packet in packet_queue_listener + +- [Will Cosgrove brought this change] + + packet.c: improve message parsing (#402) + + * packet.c: improve parsing of packets + + file: packet.c + + notes: + Use _libssh2_get_string API in SSH_MSG_DEBUG/SSH_MSG_DISCONNECT. Additional uint32 bounds check in SSH_MSG_GLOBAL_REQUEST. + +- [Will Cosgrove brought this change] + + misc.c: _libssh2_ntohu32 cast bit shifting (#401) + + To quite overly aggressive analyzers. + + Note, the builds pass, Travis is having some issues with Docker images. + +- [Will Cosgrove brought this change] + + kex.c: improve bounds checking in kex_agree_methods() (#399) + + file: kex.c + + notes: + use _libssh2_get_string instead of kex_string_pair which does additional checks + +Will Cosgrove (23 Aug 2019) +- [Fabrice Fontaine brought this change] + + acinclude.m4: add mbedtls to LIBS (#371) + + Notes: + This is useful for static builds so that the Libs.private field in + libssh2.pc contains correct info for the benefit of pkg-config users. + Static link with libssh2 requires this information. + + Signed-off-by: Baruch Siach + [Retrieved from: + https://git.buildroot.net/buildroot/tree/package/libssh2/0002-acinclude.m4-add-mbedtls-to-LIBS.patch] + Signed-off-by: Fabrice Fontaine + + Credit: + Fabrice Fontaine + +- [jethrogb brought this change] + + Generate debug info when building with MSVC (#178) + + files: CMakeLists.txt + + notes: Generate debug info when building with MSVC + + credit: + jethrogb + +- [Panos brought this change] + + Add agent forwarding implementation (#219) + + files: channel.c, test_agent_forward_succeeds.c, libssh2_priv.h, libssh2.h, ssh2_agent_forwarding.c + + notes: + * Adding SSH agent forwarding. + * Fix agent forwarding message, updated example. + Added integration test code and cmake target. Added example to cmake list. + + credit: + pkittenis + +GitHub (2 Aug 2019) +- [Will Cosgrove brought this change] + + Update EditorConfig + + Added max_line_length = 80 + +- [Will Cosgrove brought this change] + + global.c : fixed call to libssh2_crypto_exit #394 (#396) + + * global.c : fixed call to libssh2_crypto_exit #394 + + File: global.c + + Notes: Don't call `libssh2_crypto_exit()` until `_libssh2_initialized` count is down to zero. + + Credit: seba30 + +Will Cosgrove (30 Jul 2019) +- [hlefebvre brought this change] + + misc.c : Add an EWOULDBLOCK check for better portability (#172) + + File: misc.c + + Notes: Added support for all OS' that implement EWOULDBLOCK, not only VMS + + Credit: hlefebvre + +- [Etienne Samson brought this change] + + userauth.c: fix off by one error when loading public keys with no id (#386) + + File: userauth.c + + Credit: + Etienne Samson + + Notes: + Caught by ASAN: + + ================================================================= + ==73797==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60700001bcf0 at pc 0x00010026198d bp 0x7ffeefbfed30 sp 0x7ffeefbfe4d8 + READ of size 69 at 0x60700001bcf0 thread T0 + 2019-07-04 08:35:30.292502+0200 atos[73890:2639175] examining /Users/USER/*/libssh2_clar [73797] + #0 0x10026198c in wrap_memchr (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1f98c) + #1 0x1000f8e66 in file_read_publickey userauth.c:633 + #2 0x1000f2dc9 in userauth_publickey_fromfile userauth.c:1513 + #3 0x1000f2948 in libssh2_userauth_publickey_fromfile_ex userauth.c:1590 + #4 0x10000e254 in test_userauth_publickey__ed25519_auth_ok publickey.c:69 + #5 0x1000090c3 in clar_run_test clar.c:260 + #6 0x1000038f3 in clar_run_suite clar.c:343 + #7 0x100003272 in clar_test_run clar.c:522 + #8 0x10000c3cc in main runner.c:60 + #9 0x7fff5b43b3d4 in start (libdyld.dylib:x86_64+0x163d4) + + 0x60700001bcf0 is located 0 bytes to the right of 80-byte region [0x60700001bca0,0x60700001bcf0) + allocated by thread T0 here: + #0 0x10029e053 in wrap_malloc (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x5c053) + #1 0x1000b4978 in libssh2_default_alloc session.c:67 + #2 0x1000f8aba in file_read_publickey userauth.c:597 + #3 0x1000f2dc9 in userauth_publickey_fromfile userauth.c:1513 + #4 0x1000f2948 in libssh2_userauth_publickey_fromfile_ex userauth.c:1590 + #5 0x10000e254 in test_userauth_publickey__ed25519_auth_ok publickey.c:69 + #6 0x1000090c3 in clar_run_test clar.c:260 + #7 0x1000038f3 in clar_run_suite clar.c:343 + #8 0x100003272 in clar_test_run clar.c:522 + #9 0x10000c3cc in main runner.c:60 + #10 0x7fff5b43b3d4 in start (libdyld.dylib:x86_64+0x163d4) + + SUMMARY: AddressSanitizer: heap-buffer-overflow (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1f98c) in wrap_memchr + Shadow bytes around the buggy address: + 0x1c0e00003740: fd fd fd fd fd fd fd fd fd fd fa fa fa fa fd fd + 0x1c0e00003750: fd fd fd fd fd fd fd fa fa fa fa fa 00 00 00 00 + 0x1c0e00003760: 00 00 00 00 00 00 fa fa fa fa 00 00 00 00 00 00 + 0x1c0e00003770: 00 00 00 fa fa fa fa fa fd fd fd fd fd fd fd fd + 0x1c0e00003780: fd fd fa fa fa fa fd fd fd fd fd fd fd fd fd fa + =>0x1c0e00003790: fa fa fa fa 00 00 00 00 00 00 00 00 00 00[fa]fa + 0x1c0e000037a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x1c0e000037b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x1c0e000037c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x1c0e000037d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + 0x1c0e000037e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa + Shadow byte legend (one shadow byte represents 8 application bytes): + Addressable: 00 + Partially addressable: 01 02 03 04 05 06 07 + Heap left redzone: fa + Freed heap region: fd + Stack left redzone: f1 + Stack mid redzone: f2 + Stack right redzone: f3 + Stack after return: f5 + Stack use after scope: f8 + Global redzone: f9 + Global init order: f6 + Poisoned by user: f7 + Container overflow: fc + Array cookie: ac + Intra object redzone: bb + ASan internal: fe + Left alloca redzone: ca + Right alloca redzone: cb + Shadow gap: cc + +- [Thilo Schulz brought this change] + + openssl.c : Fix use-after-free crash on reinitialization of openssl backend + + file : openssl.c + + notes : + libssh2's openssl backend has a use-after-free condition if HAVE_OPAQUE_STRUCTS is defined and you call libssh2_init() again after prior initialisation/deinitialisation of libssh2 + + credit : Thilo Schulz + +- [axjowa brought this change] + + openssl.h : Use of ifdef where if should be used (#389) + + File : openssl.h + + Notes : + LIBSSH2_ECDSA and LIBSSH2_ED25519 are always defined so the #ifdef + checks would never be false. + + This change makes it possible to build libssh2 against OpenSSL built + without EC support. + + Change-Id: I0a2f07c2d80178314dcb7d505d1295d19cf15afd + + Credit : axjowa + +- [Zenju brought this change] + + Agent.c : Preserve error info from agent_list_identities() (#374) + + Files : agent.c + + Notes : + Currently the error details as returned by agent_transact_pageant() are overwritten by a generic "agent list id failed" message by int agent_list_identities(LIBSSH2_AGENT* agent). + + Credit : + Zenju + +- [Who? Me?! brought this change] + + Channel.c: Make sure the error code is set in _libssh2_channel_open() (#381) + + File : Channel.c + + Notes : + if _libssh2_channel_open() fails, set the error code. + + Credit : + mark-i-m + +- [Orgad Shaneh brought this change] + + Kex.c, Remove unneeded call to strlen (#373) + + File : Kex.c + + Notes : + Removed call to strlen + + Credit : + Orgad Shaneh + +- [Pedro Monreal brought this change] + + Spelling corrections (#380) + + Files : + libssh2.h, libssh2_sftp.h, bcrypt_pbkdf.c, mbedtls.c, sftp.c, ssh2.c + + Notes : + * Fixed misspellings + + Credit : + Pedro Monreal + +- [Sebastián Katzer brought this change] + + Fix Potential typecast error for `_libssh2_ecdsa_key_get_curve_type` (#383) + + Issue : #383 + + Files : hostkey.c, crypto.h, openssl.c + + Notes : + * Fix potential typecast error for `_libssh2_ecdsa_key_get_curve_type` + * Rename _libssh2_ecdsa_key_get_curve_type to _libssh2_ecdsa_get_curve_type + + Credit : + Sebastián Katzer + +GitHub (20 Jun 2019) +- [Will Cosgrove brought this change] + + bump copyright date + +Version 1.9.0 (19 Jun 2019) + +GitHub (19 Jun 2019) +- [Will Cosgrove brought this change] + + 1.9 Formatting + +- [Will Cosgrove brought this change] + + 1.9 Release notes + +Will Cosgrove (17 May 2019) +- [Alexander Curtiss brought this change] + + libgcrypt.c : Fixed _libssh2_rsa_sha1_sign memory leak. (#370) + + File: libgcrypt.c + + Notes : Added calls to gcry_sexp_release to free memory allocated by gcry_sexp_find_token + + Credit : + Reporter : beckmi + PR by: Alexander Curtiss + +- [Orivej Desh brought this change] + + libssh2_priv.h : Fix musl build warning on sys/poll.h (#346) + + File : libssh2_priv.h + + Notes : + musl prints `redirecting incorrect #include to ` + http://git.musl-libc.org/cgit/musl/commit/include/sys/poll.h?id=54446d730cfb17c5f7bcf57f139458678f5066cc + + poll is defined by POSIX to be in poll.h: + http://pubs.opengroup.org/onlinepubs/7908799/xsh/poll.html + + Credit : Orivej Desh + +GitHub (1 May 2019) +- [Will Cosgrove brought this change] + + kex.c : additional bounds checks in diffie_hellman_sha1/256 (#361) + + Files : kex.c, misc.c, misc.h + + Notes : + Fixed possible out of bounds memory access when reading malformed data in diffie_hellman_sha1() and diffie_hellman_sha256(). + + Added _libssh2_copy_string() to misc.c to return an allocated and filled char buffer from a string_buf offset. Removed no longer needed s var in kmdhgGPshakex_state_t. + +Will Cosgrove (26 Apr 2019) +- [Tseng Jun brought this change] + + sftp.c : sftp_bin2attr() Correct attrs->gid assignment (#366) + + Regression with fix for #339 + + Credit : Tseng Jun + +- [Tseng Jun brought this change] + + kex.c : Correct type cast in curve25519_sha256() (#365) + +GitHub (24 Apr 2019) +- [Will Cosgrove brought this change] + + transport.c : scope local total_num var (#364) + + file : transport.c + notes : move local `total_num` variable inside of if block to prevent scope access issues which caused #360. + +Will Cosgrove (24 Apr 2019) +- [doublex brought this change] + + transport.c : fixes bounds check if partial packet is read + + Files : transport.c + + Issue : #360 + + Notes : + 'p->total_num' instead of local value total_num when doing bounds check. + + Credit : Doublex + +GitHub (23 Apr 2019) +- [Will Cosgrove brought this change] + + Editor config file for source files (#322) + + Simple start to an editor config file when editing source files to make sure they are configured correctly. + +- [Will Cosgrove brought this change] + + misc.c : String buffer API improvements (#332) + + Files : misc.c, hostkey.c, kex.c, misc.h, openssl.c, sftp.c + + Notes : + * updated _libssh2_get_bignum_bytes and _libssh2_get_string. Now pass in length as an argument instead of returning it to keep signedness correct. Now returns -1 for failure, 0 for success. + + _libssh2_check_length now returns 0 on success and -1 on failure to match the other string_buf functions. Added comment to _libssh2_check_length. + + Credit : Will Cosgrove + +Will Cosgrove (19 Apr 2019) +- [doublex brought this change] + + mbedtls.c : _libssh2_mbedtls_rsa_new_private_frommemory() allow private-key from memory (#359) + + File : mbedtls.c + + Notes: _libssh2_mbedtls_rsa_new_private_frommemory() fixes private-key from memory reading to by adding NULL terminator before parsing; adds passphrase support. + + Credit: doublex + +- [Ryan Kelley brought this change] + + Session.c : banner_receive() from leaking when accessing non ssh ports (#356) + + File : session.c + + Release previous banner in banner_receive() if the session is reused after a failed connection. + + Credit : Ryan Kelley + +GitHub (11 Apr 2019) +- [Will Cosgrove brought this change] + + Formatting in agent.c + + Removed whitespace. + +- [Will Cosgrove brought this change] + + Fixed formatting in agent.c + + Quiet linter around a couple if blocks and pointer. + +Will Cosgrove (11 Apr 2019) +- [Zhen-Huan HWANG brought this change] + + sftp.c : discard and reset oversized packet in sftp_packet_read() (#269) + + file : sftp.c + + notes : when sftp_packet_read() encounters an sftp packet which exceeds SFTP max packet size it now resets the reading state so it can continue reading. + + credit : Zhen-Huan HWANG + +GitHub (11 Apr 2019) +- [Will Cosgrove brought this change] + + Add agent functions libssh2_agent_get_identity_path() and libssh2_agent_set_identity_path() (#308) + + File : agent.c + + Notes : + Libssh2 uses the SSH_AUTH_SOCK env variable to read the system agent location. However, when using a custom agent path you have to set this value using setenv which is not thread-safe. The new functions allow for a way to set a custom agent socket path in a thread safe manor. + +- [Will Cosgrove brought this change] + + Simplified _libssh2_check_length (#350) + + * Simplified _libssh2_check_length + + misc.c : _libssh2_check_length() + + Removed cast and improved bounds checking and format. + + Credit : Yuriy M. Kaminskiy + +- [Will Cosgrove brought this change] + + _libssh2_check_length() : additional bounds check (#348) + + Misc.c : _libssh2_check_length() + + Ensure the requested length is less than the total length before doing the additional bounds check + +Daniel Stenberg (25 Mar 2019) +- misc: remove 'offset' from string_buf + + It isn't necessary. + + Closes #343 + +- sftp: repair mtime from e1ead35e475 + + A regression from e1ead35e4759 broke the SFTP mtime logic in + sftp_bin2attr + + Also simplified the _libssh2_get_u32/u64 functions slightly. + + Closes #342 + +- session_disconnect: don't zero state, just clear the right bit + + If we clear the entire field, the freeing of data in session_free() is + skipped. Instead just clear the bit that risk making the code get stuck + in the transport functions. + + Regression from 4d66f6762ca3fc45d9. + + Reported-by: dimmaq on github + Fixes #338 + Closes #340 + +- libssh2_sftp.h: restore broken ABI + + Commit 41fbd44 changed variable sizes/types in a public struct which + broke the ABI, which breaks applications! + + This reverts that change. + + Closes #339 + +- style: make includes and examples code style strict + + make travis and the makefile rule verify them too + + Closes #334 + +GitHub (21 Mar 2019) +- [Daniel Stenberg brought this change] + + create a github issue template + +Daniel Stenberg (21 Mar 2019) +- stale-bot: activated + + The stale bot will automatically mark stale issues (inactive for 90 + days) and if still untouched after 21 more days, close them. + + See https://probot.github.io/apps/stale/ + +- libssh2_session_supported_algs.3: fix formatting mistakes + + Reported-by: Max Horn + Fixes #57 + +- [Zenju brought this change] + + libssh2.h: Fix Error C2371 'ssize_t': redefinition + + Closes #331 + +- travis: add code style check + + Closes #324 + +- code style: unify code style + + Indent-level: 4 + Max columns: 79 + No spaces after if/for/while + Unified brace positions + Unified white spaces + +- src/checksrc.pl: code style checker + + imported as-is from curl + +Will Cosgrove (19 Mar 2019) +- Merge branch 'MichaelBuckley-michaelbuckley-security-fixes' + +- Silence unused var warnings (#329) + + Silence warnings about unused variables in this test + +- Removed unneeded > 0 check + + When checking `userauth_kybd_num_prompts > 100` we don't care if it's also above zero. + +- [Matthew D. Fuller brought this change] + + Spell OpenSS_H_ right when talking about their specific private key (#321) + + Good catch, thanks. + +GitHub (19 Mar 2019) +- [Will Cosgrove brought this change] + + Silence unused var warnings (#329) + + Silence warnings about unused variables in this test + +Michael Buckley (19 Mar 2019) +- Fix more scope and printf warning errors + +- Silence unused variable warning + +GitHub (19 Mar 2019) +- [Will Cosgrove brought this change] + + Removed unneeded > 0 check + + When checking `userauth_kybd_num_prompts > 100` we don't care if it's also above zero. + +Will Cosgrove (19 Mar 2019) +- [Matthew D. Fuller brought this change] + + Spell OpenSS_H_ right when talking about their specific private key (#321) + + Good catch, thanks. + +Michael Buckley (18 Mar 2019) +- Fix errors identified by the build process + +- Fix casting errors after merge + +GitHub (18 Mar 2019) +- [Michael Buckley brought this change] + + Merge branch 'master' into michaelbuckley-security-fixes + +Michael Buckley (18 Mar 2019) +- Move fallback SIZE_MAX and UINT_MAX to libssh2_priv.h + +- Fix type and logic issues with _libssh2_get_u64 + +Daniel Stenberg (17 Mar 2019) +- examples: fix various compiler warnings + +- lib: fix various compiler warnings + +- session: ignore pedantic warnings for funcpointer <=> void * + +- travis: add a build using configure + + Closes #320 + +- configure: provide --enable-werror + +- appveyor: remove old builds that mostly cause failures + + ... and only run on master branch. + + Closes #323 + +- cmake: add two missing man pages to get installed too + + Both libssh2_session_handshake.3 and + libssh2_userauth_publickey_frommemory.3 were installed by the configure + build already. + + Reported-by: Arfrever on github + Fixes #278 + +- include/libssh2.h: warning: "_WIN64" is not defined, evaluates to 0 + + We don't use #if for defines that might not be defined. + +- pem: //-comments are not allowed + +Will Cosgrove (14 Mar 2019) +- [Daniel Stenberg brought this change] + + userauth: fix "Function call argument is an uninitialized value" (#318) + + Detected by scan-build. + +- fixed unsigned/signed issue + +Daniel Stenberg (15 Mar 2019) +- session_disconnect: clear state + + If authentication is started but not completed before the application + gives up and instead wants to shut down the session, the '->state' field + might still be set and thus effectively dead-lock session_disconnect. + + This happens because both _libssh2_transport_send() and + _libssh2_transport_read() refuse to do anything as long as state is set + without the LIBSSH2_STATE_KEX_ACTIVE bit. + + Reported in curl bug https://github.com/curl/curl/issues/3650 + + Closes #310 + +Will Cosgrove (14 Mar 2019) +- Release notes from 1.8.1 + +Michael Buckley (14 Mar 2019) +- Use string_buf in sftp_init(). + +- Guard against out-of-bounds reads in publickey.c + +- Guard against out-of-bounds reads in session.c + +- Guard against out-of-bounds reads in userauth.c + +- Use LIBSSH2_ERROR_BUFFER_TOO_SMALL instead of LIBSSH2_ERROR_OUT_OF_BOUNDARY in sftp.c + +- Additional bounds checking in sftp.c + +- Additional length checks to prevent out-of-bounds reads and writes in _libssh2_packet_add(). https://libssh2.org/CVE-2019-3862.html + +- Add a required_size parameter to sftp_packet_require et. al. to require callers of these functions to handle packets that are too short. https://libssh2.org/CVE-2019-3860.html + +- Check the length of data passed to sftp_packet_add() to prevent out-of-bounds reads. + +- Prevent zero-byte allocation in sftp_packet_read() which could lead to an out-of-bounds read. https://libssh2.org/CVE-2019-3858.html + +- Sanitize padding_length - _libssh2_transport_read(). https://libssh2.org/CVE-2019-3861.html + + This prevents an underflow resulting in a potential out-of-bounds read if a server sends a too-large padding_length, possibly with malicious intent. + +- Defend against writing beyond the end of the payload in _libssh2_transport_read(). + +- Defend against possible integer overflows in comp_method_zlib_decomp. + +GitHub (14 Mar 2019) +- [Will Cosgrove brought this change] + + Security fixes (#315) + + * Bounds checks + + Fixes for CVEs + https://www.libssh2.org/CVE-2019-3863.html + https://www.libssh2.org/CVE-2019-3856.html + + * Packet length bounds check + + CVE + https://www.libssh2.org/CVE-2019-3855.html + + * Response length check + + CVE + https://www.libssh2.org/CVE-2019-3859.html + + * Bounds check + + CVE + https://www.libssh2.org/CVE-2019-3857.html + + * Bounds checking + + CVE + https://www.libssh2.org/CVE-2019-3859.html + + and additional data validation + + * Check bounds before reading into buffers + + * Bounds checking + + CVE + https://www.libssh2.org/CVE-2019-3859.html + + * declare SIZE_MAX and UINT_MAX if needed + +- [Will Cosgrove brought this change] + + fixed type warnings (#309) + +- [Will Cosgrove brought this change] + + Bumping version number for pending 1.8.1 release + +Will Cosgrove (4 Mar 2019) +- [Daniel Stenberg brought this change] + + _libssh2_string_buf_free: use correct free (#304) + + Use LIBSSH2_FREE() here, not free(). We allow memory function + replacements so free() is rarely the right choice... + +GitHub (26 Feb 2019) +- [Will Cosgrove brought this change] + + Fix for building against libreSSL #302 + + Changed to use the check we use elsewhere. + +- [Will Cosgrove brought this change] + + Fix for when building against LibreSSL #302 + +Will Cosgrove (25 Feb 2019) +- [gartens brought this change] + + docs: update libssh2_hostkey_hash.3 [ci skip] (#301) + +GitHub (21 Feb 2019) +- [Will Cosgrove brought this change] + + fix malloc/free mismatches #296 (#297) + +- [Will Cosgrove brought this change] + + Replaced malloc with calloc #295 + +- [Will Cosgrove brought this change] + + Abstracted OpenSSL calls out of hostkey.c (#294) + +- [Will Cosgrove brought this change] + + Fix memory dealloc impedance mis-match #292 (#293) + + When using ed25519 host keys and a custom memory allocator. + +- [Will Cosgrove brought this change] + + Added call to OpenSSL_add_all_digests() #288 + + For OpenSSL 1.0.x we need to call OpenSSL_add_all_digests(). + +Will Cosgrove (12 Feb 2019) +- [Zhen-Huan HWANG brought this change] + + SFTP: increase maximum packet size to 256K (#268) + + to match implementations like OpenSSH. + +- [Zenju brought this change] + + Fix https://github.com/libssh2/libssh2/pull/271 (#284) + +GitHub (16 Jan 2019) +- [Will Cosgrove brought this change] + + Agent NULL check in shutdown #281 + +Will Cosgrove (15 Jan 2019) +- [Adrian Moran brought this change] + + mbedtls: Fix leak of 12 bytes by each key exchange. (#280) + + Correctly free ducts by calling _libssh2_mbedtls_bignum_free() in dtor. + +- [alex-weaver brought this change] + + Fix error compiling on Win32 with STDCALL=ON (#275) + +GitHub (8 Nov 2018) +- [Will Cosgrove brought this change] + + Allow default permissions to be used in sftp_mkdir (#271) + + Added constant LIBSSH2_SFTP_DEFAULT_MODE to use the server default permissions when making a new directory + +Will Cosgrove (13 Sep 2018) +- [Giulio Benetti brought this change] + + openssl: fix dereferencing ambiguity potentially causing build failure (#267) + + When dereferencing from *aes_ctr_cipher, being a pointer itself, + ambiguity can occur; fixed possible build errors. + +Viktor Szakats (12 Sep 2018) +- win32/GNUmakefile: define HAVE_WINDOWS_H + + This macro was only used in test/example code before, now it is + also used in library code, but only defined automatically by + automake/cmake, so let's do the same for the standalone win32 + make file. + + It'd be probably better to just rely on the built-in _WIN32 macro + to detect the presence of windows.h though. It's already used + in most of libssh2 library code. There is a 3rd, similar macro + named LIBSSH2_WIN32, which might also be replaced with _WIN32. + + Ref: https://github.com/libssh2/libssh2/commit/8b870ad771cbd9cd29edbb3dbb0878e950f868ab + Closes https://github.com/libssh2/libssh2/pull/266 + +Marc Hoersken (2 Sep 2018) +- Fix conditional check for HAVE_DECL_SECUREZEROMEMORY + + "Unlike the other `AC_CHECK_*S' macros, when a symbol is not declared, + HAVE_DECL_symbol is defined to `0' instead of leaving HAVE_DECL_symbol + undeclared. When you are sure that the check was performed, + use HAVE_DECL_symbol in #if." + + Source: autoconf documentation for AC_CHECK_DECLS. + +- Fix implicit declaration of function 'SecureZeroMemory' + + Include window.h in order to use SecureZeroMemory on Windows. + +- Fix implicit declaration of function 'free' by including stdlib.h + +GitHub (27 Aug 2018) +- [Will Cosgrove brought this change] + + Use malloc abstraction function in pem parse + + Fix warning on WinCNG build. + +- [Will Cosgrove brought this change] + + Fixed possible junk memory read in sftp_stat #258 + +- [Will Cosgrove brought this change] + + removed INT64_C define (#260) + + No longer used. + +- [Will Cosgrove brought this change] + + Added conditional around engine.h include + +Will Cosgrove (6 Aug 2018) +- [Alex Crichton brought this change] + + Fix OpenSSL link error with `no-engine` support (#259) + + This commit fixes linking against an OpenSSL library that was compiled with + `no-engine` support by bypassing the initialization routines as they won't be + available anyway. + +GitHub (2 Aug 2018) +- [Will Cosgrove brought this change] + + ED25519 Key Support #39 (#248) + + OpenSSH Key and ED25519 support #39 + Added _libssh2_explicit_zero() to explicitly zero sensitive data in memory #120 + + * ED25519 Key file support - Requires OpenSSL 1.1.1 or later + * OpenSSH Key format reading support - Supports RSA/DSA/ECDSA/ED25519 types + * New string buffer reading functions - These add build-in bounds checking and convenance methods. Used for OpenSSL PEM file reading. + * Added new tests for OpenSSH formatted Keys + +- [Will Cosgrove brought this change] + + ECDSA key types are now explicit (#251) + + * ECDSA key types are now explicit + + Issue was brough up in pull request #248 diff --git a/miniconda3/share/doc/libssh2/README b/miniconda3/share/doc/libssh2/README new file mode 100644 index 0000000000000000000000000000000000000000..fca539dbbc94b890eb4a9a00e4713bf5e817d977 --- /dev/null +++ b/miniconda3/share/doc/libssh2/README @@ -0,0 +1,19 @@ +libssh2 - SSH2 library +====================== + +libssh2 is a library implementing the SSH2 protocol, available under +the revised BSD license. + +Web site: https://libssh2.org/ + +Mailing list: https://lists.haxx.se/listinfo/libssh2-devel + +License: see COPYING + +Source code: https://github.com/libssh2/libssh2 + +Web site source code: https://github.com/libssh2/www + +Installation instructions are in: + - docs/INSTALL_CMAKE for CMake + - docs/INSTALL_AUTOTOOLS for Autotools diff --git a/miniconda3/share/doc/libssh2/RELEASE-NOTES b/miniconda3/share/doc/libssh2/RELEASE-NOTES new file mode 100644 index 0000000000000000000000000000000000000000..d9af1689d697ce61d1b64c52fbbb49812a3a4d45 --- /dev/null +++ b/miniconda3/share/doc/libssh2/RELEASE-NOTES @@ -0,0 +1,325 @@ +libssh2 1.11.1 + +Deprecation notices: + +- Starting October 2024, the following algos go deprecated and will be + disabled in default builds (with an option to enable them): + + - DSA: `ssh-dss` hostkeys. + You can enable it now with `-DLIBSSH2_DSA_ENABLE`. + Disabled by default in OpenSSH 7.0 (2015-08-11). + Support to be removed by early 2025 from OpenSSH. + - MD5-based MACs and hashes: `hmac-md5`, `hmac-md5-96`, + `LIBSSH2_HOSTKEY_HASH_MD5` + You can disable it now with `-DLIBSSH2_NO_MD5`. + Disabled by default since OpenSSH 7.2 (2016-02-29). + - 3DES cipher: `3des-cbc` + You can disable it now with `-DLIBSSH2_NO_3DES`. + Disabled by default since OpenSSH 7.4 (2016-12-19). + - RIPEMD-160 MACs: `hmac-ripemd160`, `hmac-ripemd160@openssh.com` + You can disable it now with `-DLIBSSH2_NO_HMAC_RIPEMD`. + Removed in OpenSSH 7.6 (2017-10-03). + - Blowfish cipher: `blowfish-cbc` + You can disable it now with `-DLIBSSH2_NO_BLOWFISH`. + Removed in OpenSSH 7.6 (2017-10-03). + - RC4 ciphers: `arcfour`, `arcfour128` + You can disable it now with `-DLIBSSH2_NO_RC4`. + Removed in OpenSSH 7.6 (2017-10-03). + - CAST cipher: `cast128-cbc` + You can disable it now with `-DLIBSSH2_NO_CAST`. + Removed in OpenSSH 7.6 (2017-10-03). + +- Starting April 2025, above options will be deleted from the + libssh2 codebase. + + - Default builds will also disable support for old-style, MD5-based + encrypted private keys. + You can disable it now with `-DLIBSSH2_NO_MD5_PEM`. + +This release includes the following enhancements and bugfixes: + +- autotools: fix to update `LDFLAGS` for each detected dependency (d19b6190 #1384 #1381 #1377) +- autotools: delete `--disable-tests` option, fix CI tests (e051ae34 #1271 #715 revert: 7483edfa) +- autotools: show the default for `hidden-symbols` option (a3f5594a #1269) +- autotools: enable `-Wunused-macros` with gcc (ecdf5199 #1262 #1227 #1224) +- autotools: fix dotless gcc and Apple clang version detections (89ccc83c #1232 #1187) +- autotools: show more clang/gcc version details (fb580161 #1230) +- autotools: avoid warnings in libtool stub code (96682bd5 #1227 #1224) +- autotools: sync warning enabler code with curl (5996fefe #1223) +- autotools: rename variable (ce5f208a #1222) +- autotools: picky warning options tidy-up (cdca8cff #1221) +- autotools: fix `cp` to preserve attributes and timestamp in `Makefile.am` (f64e6318) +- autotools: fix selecting WinCNG in cross-builds (and more) (00a3b88c #1187 #1186) +- autotools: use comma separator in `Requires.private` of `libssh2.pc` (7f83de14 #1124) +- autotools: remove `AB_INIT` from `configure.ac` (f4f52ccc) +- autotools: improve libz position (c89174a7 #1077 #941 #1075 #1013 regr: 4f0f4bff) +- autotools: skip tests requiring static lib if `--disable-static` (572c57c9 #1072 #663 #1056 regr: 83853f8a) +- build: stop detecting `sys/param.h` header (2677d3b0 #1418 #1415) +- build: silence warnings inside `FD_SET()`/`FD_ISSET()` macros (323a14b2 #1379) +- build: drop `-Wformat-nonliteral` warning suppressions (c452c5cc #1342) +- build: enable `-pedantic-errors` (3ec53f3e #1286) +- build: add mingw-w64 support to `LIBSSH2_PRINTF()` attribute (f8c45794 #1287) +- build: add `LIBSSH2_NO_DEPRECATED` option (b1414503 #1267 #1266 #1260 #1259) +- build: enable missing OpenSSF-recommended warnings, with fixes (afa6b865 #1257) +- build: enable more compiler warnings and fix them (7ecc309c #1224) +- build: picky warning updates (328a96b3 #1219) +- build: revert: respect autotools `DLL_EXPORT` in `libssh2.h` (481be044 #1141 #917 revert: fb1195cf) +- build: stop requiring libssl from openssl (c84745e3 #1128) +- build: tidy-up `libssh2.pc.in` variable names (5720dd9f #1125) +- build: add/fix `Requires.private` packages in `libssh2.pc` (ef538069 #1123) +- buildconf: drop (814a850c #1441 follow: fc5d7788) +- checksrc: update, check all sources, fix fallouts (1117b677 #1457) +- checksrc: sync with curl (8cd473c9 #1272) +- checksrc: fix spelling in comment (a95d401f) +- checksrc: modernise Perl file open (3d309f9b) +- checksrc: switch to dot file (d67a91aa #1052) +- ci: use Ninja with cmake (20ad047d #1458) +- ci: disable dependency tracking in autotools builds (e44f0418 #1396) +- ci: fix mbedtls runners on macOS (84411539 #1381) +- ci: enable Unity mode for most CMake builds (1bfae57b #1367 #1034) +- ci: add shellcheck job and script (d88b9bcd) +- ci: verify build and install from tarball (a86e27e8 #1362) +- ci: add reproducibility test for `maketgz` (2d765e45 #1360) +- ci: use Linux runner for BSDs, add arm64 FreeBSD 14 job (6f86b196 #1343) +- ci: do not parallelize `distcheck` job (5e65dd87 #1339) +- ci: add FreeBSD 14 job, fix issues (46333adf #1277) +- ci: add OmniOS job, fix issues (5e0ec991) +- ci: show compiler in cross/cygwin job names (c9124088) +- ci: add OpenBSD (v7.4) job + fix build error in example (0c9a8e35 #1250) +- ci: add NetBSD (v9.3) job (65c7a7a5) +- ci: update and speed up FreeBSD job (eee4e805) +- ci: use absolute path in `CMAKE_INSTALL_PREFIX` (74948816 #1247) +- ci: boost mbedTLS build speed (236e79a1 #1245) +- ci: add BoringSSL job (cmake, gcc, amd64) (c9dd3566 #1233) +- ci: fixup FreeBSD version, bump mbedTLS (fea6664e #1217) +- ci: add FreeBSD 13.2 job (a7d2a573 #1215) +- ci: mbedTLS 3.5.0 (5e190442 #1202) +- ci: update actions, use shallow clones with appveyor (d468a33f #1199) +- ci: replace `mv` + `chmod` with `install` in `Dockerfile` (5754fed6 #1175) +- ci: set file mode early in `appveyor_docker.yml` (633db55f) +- ci: add spellcheck (codespell) (a79218d3) +- ci: add MSYS builds (autotools and cmake) (d43b8d9b #1162) +- ci: add Cygwin builds (autotools and cmake) (f1e96e73 #1161) +- ci: add mingw-w64 UWP build (1215aa5f #1155 #1147) +- ci: add missing timeout to 'autotools distcheck' step (6265ffdb) +- ci: add non-static autotools i386 build, ignore GHA updates on AppVeyor (c6e137f7 #1074 #1072) +- ci: prefer `=` operator in shell snippets (e5c03043 #1073) +- ci: drop redundant/unused vars, sync var names (ab8e95bc #1059) +- ci: add i386 Linux build (with mbedTLS) (abdf40c7 #1057 #1053) +- ci/appveyor: reduce test runs (workaround for infrastructure permafails) (b5e68bdc #1461) +- ci/appveyor: increase wait for SSH server on GHA (bf3af90b) +- ci/appveyor: bump to OpenSSL 3.2.1 (53d9c1a6 #1363 #1348) +- ci/appveyor: re-enable parallel mode (e190e5b2 #1294 #884 #867) +- ci/appveyor: delete UWP job broken since Visual Studio upgrade (d0a7f1da #1275) +- ci/appveyor: YAML/PowerShell formatting, shorten variable name (06fd721f #1200) +- ci/appveyor: move to pure PowerShell (8a081fd9 #1197) +- ci/GHA: revert concurrency and improve permissions (e4c042f6) +- ci/GHA: FreeBSD 14.1, actions bump (ae04b1b9 #1424) +- ci/GHA: fix wolfSSL-from-source AES-GCM tests (1c0b07a7 #1409 #1408) +- ci/GHA: add Linux job with latest wolfSSL built from source (d4cea53f #1408 #1299 #1020) +- ci/GHA: tidy up build-from-source steps (2c633033) +- ci/GHA: show configure logs on failure and other tidy-ups (dab48398 #1403) +- ci/GHA: bump parallel jobs to nproc+1 (6f3d3bc8 #1402) +- ci/GHA: show test logs on failure (b8ffa7a5 #1401) +- ci/GHA: fix `Dockerfile` failing after Ubuntu package update (839bb84e #1400) +- ci/GHA: use ubuntu-latest with OmniOS job (50143d58) +- ci/GHA: shell syntax tidy-up (3b23e039 #1390) +- ci/GHA: bump NetBSD/OpenBSD, add NetBSD arm64 job (e980af72 #1388) +- ci/GHA: tidy up wolfSSL autotools config on macOS (5953c1f1 #1383) +- ci/GHA: shorter mbedTLS autotools workaround (736e3d7d #1382 #1381) +- ci/GHA: fix gcrypt with autotools/macOS/Homebrew/ARM64 (ae2770de #1377) +- ci/GHA: fix verbose option for autotools jobs (499b27ae #1376) +- ci/GHA: dump `config.log` on failure for macOS autotools jobs (4fa69214 #1375) +- ci/GHA: fix `autoreconf` failure on macOS/Homebrew (0b64b30b #1374) +- ci/GHA: fixup Homebrew location (for ARM runners) (6128aee0 #1373) +- ci/GHA: review/fixup auto-cancel settings (b08cfbc9 #1292) +- ci/GHA: restore curly braces in `if` (36748270 #1145) +- ci/GHA: simplify `if` strings (cab3db58 #1140) +- cmake: sync and improve Find modules, add `pkg-config` native detection (45064137 #1445 #1420) +- cmake: generate `LIBSSH2_PC_LIBS_PRIVATE` dynamically (c87f1296 #1466) +- cmake: add comment about `ibssh2.pc.in` variables (14b1b9d0) +- cmake: support absolute `CMAKE_INSTALL_INCLUDEDIR`/`CMAKE_INSTALL_LIBDIR` (d70cee36 #1465) +- cmake: rename two variables and initialize them (0fce9dcc #1464) +- cmake: prefer `find_dependency()` in `libssh2-config.cmake` (d9c2e550 #1460) +- cmake: tidy up syntax, minor improvements (9d9ee780 #1446) +- cmake: rename mbedTLS and wolfSSL Find modules (570de0f2) +- cmake: fixup version detection in mbedTLS Find module (8e3c40b2 #1444) +- cmake: mbedTLS detection tidy-ups (6d1d13c2 #1438) +- cmake: add quotes, delete ending dirseps (2bb46d44 #1437 #1166) +- cmake: sync formatting in `cmake/Find*` modules (a0310699) +- cmake: tidy up function name casing in `CopyRuntimeDependencies.cmake` (03547cb8) +- cmake: use the imported target of FindOpenSSL module (82b09f9b #1322) +- cmake: rename picky warnings script (64d6789f #1225) +- cmake: fix multiple include of libssh2 package (932d6a32 #1216) +- cmake: show crypto backend in feature summary (20387285 #1211) +- cmake: simplify showing CMake version (fc00bdd7 #1203) +- cmake: cleanup mbedTLS version detection more (4c241d5c #1196 #1192) +- cmake: delete duplicate `include()` (30eef0a6) +- cmake: improve/fix mbedTLS detection (41594675 #1192 #1191) +- cmake: tidy-up `foreach()` syntax (4a64ca14 #1180) +- cmake: verify `libssh2_VERSION` in integration tests (a20572e9) +- cmake: show cmake versions in ci (87f5769b) +- cmake: quote more strings (e9c7d3af #1173) +- cmake: add `ExternalProject` integration test (aeaefaf6 #1171) +- cmake: add integration tests (8715c3d5 #1170) +- cmake: (re-)add aliases for `add_subdirectory()` builds (4ff64ae3 #1169) +- cmake: style tidy-up (3fa5282d #1166) +- cmake: add `LIB_NAME` variable (5453fc80 #1159) +- cmake: tidy-up concatenation in `CMAKE_MODULE_PATH` (ae7d5108 #1157) +- cmake: replace `libssh2` literals with `PROJECT_NAME` variable (72fd2595 #1152) +- cmake: fix `STREQUAL` check in error branch (42d3bf13 #1151) +- cmake: cache more config values on Windows (11a03690 #1142) +- cmake: streamline invocation (f58f77b5 #1138) +- cmake: merge `set_target_properties()` calls (a9091007 #1132) +- cmake: (re-)add zlib to `Libs.private` in `libssh2.pc` (64643018 #1131) +- cmake: use `wolfssl/options.h` for detection, like autotools (c5ec6c49 #1130) +- cmake: add openssl libs to `Libs.private` in `libssh2.pc` (5cfa59d3 #1127) +- cmake: bump minimum CMake version to v3.7.0 (9cd18f45 #1126) +- cmake: CMAKE_SOURCE_DIR -> PROJECT_SOURCE_DIR (0f396aa9 #1121) +- cmake: tidy-ups (2fc36790 #1122) +- cmake: re-add `Libssh2:libssh2` for compatibility + lowercase namespace (2da13c13 #1104 #731 #1103) +- copyright: remove years from copyright headers (187d89bb #1082) +- disable DSA by default (b7ab0faa #1435 #1433) +- docs: update `INSTALL_AUTOTOOLS` (2f0efde3 #1316) +- docs: replace SHA1 with SHA256 in CMake example (766bde9f) +- example: restore `sys/time.h` for AIX (24503cb9 #1340 #1335 #1334 #1001 regr: e53aae0e) +- example: use `libssh2_socket_t` in X11 example (3f60ccb7) +- example: replace remaining libssh2_scp_recv with libssh2_scp_recv2 in output messages (8d69e63d #1258 follow: 6c84a426) +- example: fix regression in `ssh2_exec.c` (279a2e57 #1106 #861 #846 #1105 regr: b13936bd) +- example, tests: call `WSACleanup()` for each `WSAStartup()` (94b6bad3 #1283) +- example, tests: fix/silence `-Wformat-truncation=2` gcc warnings (744e059f) +- hostkey: do not advertise ssh-rsa when SHA1 is disabled (82d1b8ff #1093 #1092) +- kex: prevent possible double free of hostkey (b3465418 #1452) +- kex: always check for null pointers before calling _libssh2_bn_set_word (9f23a3bb #1423) +- kex: fix a memory leak in key exchange (19101843 #1412 #1404) +- kex: always add extension indicators to kex_algorithms (00e2a07e #1327 #1326) +- libssh2.h: add deprecated function warnings (9839ebe5 #1289 #1260) +- libssh2.h: add portable `LIBSSH2_SOCKET_CLOSE()` macro (28dbf016 #1278) +- libssh2.h: use `_WIN32` for Windows detection instead of rolling our own (631e7734 #1238) +- libssh2.pc: reference mbedcrypto pkgconfig (c149a127 #1405) +- libssh2.pc: re-add & extend support for static-only libssh2 builds (624abe27 #1119 #1114) +- libssh2.pc: don't put `@LIBS@` in pc file (1209c16d) +- mac: add empty hash functions for `mac_method_hmac_aesgcm` to not crash when e.g. setting `LIBSSH2_METHOD_CRYPT_CS` (b2738391 #1321) +- mac: handle low-level errors (f64885b6 #1297) +- Makefile.mk: delete Windows-focused raw GNU Make build (43485579 #1204) +- maketgz: reproducible tarballs/zip, display tarball hashes (d52fe1b4 #1357 #1359) +- maketgz: `set -eu`, reproducibility, improve zip, add CI test (cba7f975 #1353) +- man: improve `libssh2_userauth_publickey_from*` manpages (581b72aa #1347 #1308 #652) +- man: fix double spaces and dash escaping (a3ffc422 #1210) +- man: add description to `libssh2_session_get_blocking.3` (67e39091 #1185) +- mbedtls: always init ECDSA mbedtls_pk_context (a50d7deb #1430) +- mbedtls: correctly initialize values (ECDSA) (1701d5c0 #1428 #1421) +- mbedtls: expose `mbedtls_pk_load_file()` for our use (1628f6ca #1421 #1393 #1349 follow: e973493f) +- mbedtls: add workaround + FIXME to build with 3.6.0 (2e4c5ec4 #1349) +- mbedtls: improve disabling `-Wredundant-decls` (ecec68a2 #1226 #1224) +- mbedtls: include `version.h` for `MBEDTLS_VERSION_NUMBER` (9d7bc253 #1095 #1094) +- mbedtls: use more `size_t` to sync up with `crypto.h` (1153ebde #1054 #879 #846 #1053) +- md5: allow disabling old-style encrypted private keys at build-time (eb9f9de2 #1181) +- mingw: fix printf mask for 64-bit integers (36c1e1d1 #1091 #876 #846 #1090) +- misc: flatten `_libssh2_explicit_zero` if tree (74e74288 #1149) +- NMakefile: delete (c515eed3 #1134 #1129) +- openssl: free allocated resources when using openssl3 (b942bad1 #1459) +- openssl: fix memory leaks in `_libssh2_ecdsa_curve_name_with_octal_new` and `_libssh2_ecdsa_verify` (8d3bc19b #1449) +- openssl: fix calculating DSA public key with OpenSSL 3 (8b3c6e9d #1380) +- openssl: initialize BIGNUMs to NULL in `gen_publickey_from_dsa` for OpenSSL 3 (f1133c75 #1320) +- openssl: fix cppcheck found NULL dereferences (f2945905 #1304) +- openssl: delete internal `read_openssh_private_key_from_memory()` (34aff5ff #1306) +- openssl: use OpenSSL 3 HMAC API, add `no-deprecated` CI job (363dcbf4 #1243 #1235 #1207) +- openssl: make a function static, add `#ifdef` comments (efee9133 #1246 #248 follow: 03092292) +- openssl: fix DSA code to use OpenSSL 3 API (82581941 #1244 #1207) +- openssl: fix `EC_KEY` reference with OpenSSL 3 `no-deprecated` build (487152f4 #1236 #1235 #1207) +- openssl: use non-deprecated APIs with OpenSSL 3.x (b0ab005f #1207) +- openssl: silence `-Wunused-value` warnings (bf285500 #1205) +- openssl: use automatic initialization with LibreSSL 2.7.0+ (d79047c9 #1146 #302) +- openssl: add missing check for `LIBRESSL_VERSION_NUMBER` before use (4a42f42e #1117 #1115) +- os400: drop vsprintf() use (40e817ff #1462 #1457) +- os400: Add two recent files to the distribution (e4c65e5b #1364) +- os400: fix shellcheck warnings in scripts (fixups) (81341e1e #1366 #1364 #1358) +- os400: fix shellcheck warnings in scripts (c6625707 #1358) +- os400: maintain up to date (8457c37a #1309) +- packet: properly bounds check packet_authagent_open() (88a960a8 #1179) +- pem: fix private keys encrypted with AES-GCM methods (e87bdefa #1133) +- reuse: upgrade to `REUSE.toml` (70b8bf31 #1419) +- reuse: fix duplicate copyright warning (b9a4ed83) +- reuse: comply with 3.1 spec and 2.0.0 checker (fe6239a1 #1102 #1101 #1098) +- reuse: provide SPDX identifiers (f6aa31f4 #1084) +- scp: fix missing cast for targets without large file support (c317e06f #1060 #1057 #1002 regr: 5db836b2) +- session: support server banners up to 8192 bytes (was: 256) (1a9e8811 #1443 #1442) +- session: add `libssh2_session_callback_set2()` (c0f69548 #1285) +- session: handle EINTR from send/recv/poll/select to try again as the error is not fatal (798ed4a7 #1058 #955) +- sftp: increase SFTP_HANDLE_MAXLEN back to 4092 (75de6a37 #1422) +- sftp: implement posix-rename@openssh.com (fb652746 #1386) +- src: implement chacha20-poly1305@openssh.com (492bc543 #1426 #584) +- src: use `UINT32_MAX` (dc206408 #1413) +- src: fix type warning in `libssh2_sftp_unlink` macro (ac2e8c73 #1406) +- src: check the return value from `_libssh2_bn_*()` functions (95c824d5 #1354) +- src: support RSA-SHA2 cert-based authentication (rsa-sha2-512_cert and rsa-sha2-256_cert) (3a6ab70d #1314) +- src: check hash update/final success (4718ede4 #1303 #1301) +- src: check hash init success (2ed9eb92 #1301) +- src: add 'strict KEX' to fix CVE-2023-48795 "Terrapin Attack" (d34d9258 #1291 #1290) +- src: disable `-Wsign-conversion` warnings, add option to re-enable (6e451669 #1284 #1257) +- src: fix gcc 13 `-Wconversion` warning on Darwin (8cca7b77 #1209 follow: 08354e0a) +- src: drop a redundant `#include` (1f0174d0 #1153) +- src: improve MSVC C4701 warning fix (8b924999 #1086 #876 #1083) +- src: bump `hash_len` to `size_t` in `LIBSSH2_HOSTKEY_METHOD` (8b917d76 #1076) +- src: bump DSA and ECDSA sign `hash_len` to `size_t` (7b8e0225 #1055) +- tests: avoid using `MAXPATHLEN`, for portability (12427f4f #1415 #198 #1414) +- tests: fix excluding AES-GCM tests (fbd9d192 #1410) +- tests: drop default cygpath option `-u` (38e50aa0) +- tests: fix shellcheck issues in `test_sshd.test` (a2ac8c55) +- tests: sync port number type with the rest of codebase (eb996af8) +- tests: fall back to `$LOGNAME` for username (5326a5ce #1241 #1240) +- tests: show cmake version used in integration tests (2cd2f40e #1201) +- tests: formatting and tidy-ups (e61987a3) +- tests: replace FIXME with comments (1a99a86a) +- tests: add aes256-gcm encrypted key test (802336cf #1135 #1133) +- tests: trap signals in scripts (b2916b28 #1098) +- tests: cast to avoid `-Wchar-subscripts` with Cygwin (43df6a46 #1081 #1080) +- test_read: make it run without Docker (57e9d18e #1139) +- test_sshd.test: show sshd and test connect logs on harness failure (299c2040 #1097) +- test_sshd.test: set a safe PID directory (e8cabdcf #1089) +- test_sshd.test: minor cleanups (d29eea1d) +- tidy-up: link updates (c905bfd2 #1434) +- tidy-up: typo in comment (792e1b6f) +- tidy-up: fix typo found by codespell (706ec36d) +- tidy-up: bump casts from int to long for large C99 types in printfs (2e5a8719 #1264 #1257) +- tidy-up: `unsigned` -> `unsigned int` (b136c379) +- tidy-up: stop using leading underscores in macro names (c6589b88 #1248) +- tidy-up: around `stdint.h` (bfa00f1b #1212) +- tidy-up: fix typo in `readme.vms` (a9a79e7a) +- tidy-up: use built-in `_WIN32` macro to detect Windows (6fbc9505 #1195) +- tidy-up: drop `www.` from `www.libssh2.org` (6e3e8839 #1172) +- tidy-up: delete duplicate word from comment (76307435) +- tidy-up: avoid exclamations, prefer single quotes, in outputs (003fb454 #1079) +- TODO: disable or drop weak algos (0b4bdc85 #1261) +- transport: fix unstable connections over non-blocking sockets (de004875 #1454 #720 #1431 #1397) +- transport: check ETM on remote end when receiving (bde10825 #1332 #1331) +- transport: fix incorrect byte offset in debug message (2388a3aa #1096) +- userauth: avoid oob with huge interactive kbd response (f3a85cad #1337) +- userauth: add a new structure to separate memory read and file read (63b4c20e #773) +- userauth: check whether `*key_method` is a NULL pointer instead of `key_method` (bec57c40) +- wincng: fix `DH_GEX_MAXGROUP` set higher than supported (48584671 #1372 #493) +- wincng: add to ci/GHA, add `./configure` option `--enable-ecdsa-wincng` (3f98bfb0 #1368 #1315) +- wincng: add ECDSA support for host and user authentication (3e723437 #1315) +- wincng: prefer `ULONG`/`DWORD` over `unsigned long` (186c1d63 #1165) +- wincng: tidy-ups (7bb669b5 #1164) +- wolfssl: drop header path hack (8ae1b2d7 #1439) +- wolfssl: fix `EVP_Cipher()` use with v5.6.0 and older (a5b0fac2 #1407 #1394 #797 #1299 #1020) +- wolfssl: bump version in upstream issue comment (5cab802c) +- wolfssl: require v5.4.0 for AES-GCM (260a721c #1411 #1299 #1020) +- wolfssl: enable debug logging in wolfSSL when compiled in (76e7a68a #1310) + +This release would not have looked like this without help, code, reports and +advice from friends like these: + + Viktor Szakats, Michael Buckley, Patrick Monnerat, Ren Mingshuai, + Will Cosgrove, Daniel Stenberg, Josef Cejka, Nicolas Mora, Ryan Kelley, + Aaron Stone, Adam, Anders Borum, András Fekete, Andrei Augustin, binary1248, + Brian Inglis, brucsc on GitHub, concussious on github, Dan Fandrich, + dksslq on github, Haowei Hsu, Harmen Stoppels, Harry Mallon, Jack L, + Jakob Egger, Jiwoo Park, João M. S. Silva, Joel Depooter, Johannes Passing, + Jose Quaresma, Juliusz Sosinowicz, Kai Pastor, Kenneth Davidson, + klux21 on github, Lyndon Brown, Marc Hoersken, mike-jumper, naddy, + Nursan Valeyev, Paul Howarth, PewPewPew, Radek Brich, rahmanih on github, + rolag on github, Seo Suchan, shubhamhii on github, Steve McIntyre, + Tejaswi Kandula, Tobias Stoeckmann, Trzik, Xi Ruoyao diff --git a/miniconda3/share/doc/libtextstyle/libtextstyle_1.html b/miniconda3/share/doc/libtextstyle/libtextstyle_1.html new file mode 100644 index 0000000000000000000000000000000000000000..4703389e704b9c21bc674efbaef60cfd4588e690 --- /dev/null +++ b/miniconda3/share/doc/libtextstyle/libtextstyle_1.html @@ -0,0 +1,186 @@ + + + + + +GNU libtextstyle: 1. Introduction + + + + + + + + + + + + + + + + + + + + + + + + + + +
[ << ][ >> ]           [Top][Contents][Index][ ? ]
+ +
+ + +

1. Introduction

+ +

Text is easier to read when it is accompanied with styling information, +such as color, font attributes (weight, posture), or underlining, and +this styling is customized appropriately for the output device. +

+

GNU libtextstyle provides an easy way to add styling to programs that +produce output to a console or terminal emulator window. It does this +in a way that allows the end user to customize the styling using the +industry standard, namely Cascading Style Sheets (CSS). +

+ + + + +

1.1 Style definitions

+ +

Let's look at the traditional way styling is done for specific programs. +

+

Browsers, when they render HTML, use CSS styling. +

+

The older approach to user-customizable text styling is that the user +associates patterns with escape sequences in an environment variable or a +command-line argument. This is the approach used, for example, by the +GNU ‘ls’ program in combination with the ‘dircolors’ program. +The processing is distributed across several steps: +

    +
  1. +There is default style definition that is hard-coded in the +‘dircolors’ program. The user can also define their own definitions +in a file such as ‘~/.dir_colors’. This style definition contains +explicit terminal escape sequences; thus, it can only be used with +consoles and terminal emulators, and each style definition applies only +to a certain class of mostly-compatible terminal emulators. +
  2. +The dircolors program, when invoked, translates such a style +definition to a sequence of shell statements that sets an environment +variable LS_COLORS. +
  3. +The shell executes these statements, and thus sets the environment +variable LS_COLORS. +
  4. +The program looks at the environment variable and emits the listed escape +sequences. +
+ +

In contrast, this library implements styling as follows: +

    +
  1. +There is a default style definition in a CSS file that is part of the +same package as the stylable program. The user can also define their own +definitions in a CSS file, and set an environment environment variable to +point to it. +
  2. +The program looks at the environment variable, parses the CSS file, +translates the styling specifications to the form that is appropriate for +the output device (escape sequences for terminal emulators, inline CSS +and <span> elements for HTML output), and emits it. +
+ +

Thus, with GNU libtextstyle, the styling has the following properties: +

    +
  • +It is easier for the user to define their own styling, because the file +format is standardized and supported by numerous syntax aware editors. +
  • +A styling file does not depend on the particular output device. An HTML +output and a black-on-white terminal emulator can use the same styling +file. A white-on-black (or even green-on-black) terminal emulator will +need different styling, though. +
  • +It is simpler: There is no need for a program that converts the style +specification from one format to another. +
+ + + + +

1.2 Built-in versus separate styling

+ +

There are generally two approaches for adding styling to text: +

    +
  • +The program that generates the text adds the styling. It does so through +interleaved statements that turn on or off specific attributes. +
  • +The styling gets added by a separate program, that postprocesses the +output. This separate program usually uses regular expressions to +determine which text regions to style with a certain set of text +attributes. +
+ +

The first approach produces a styling that is 100% correct, regardless of +the complexity of the text that is being output. This is the preferred +approach for example for JSON, XML, or programming language text. +

+

The second approach works well if the output has a simple, easy-to-parse +format. It may produce wrong styling in some cases when the text format +is more complex. This approach is often used for viewing log files. +

+

GNU libtextstyle supports both approaches; it includes an example program +for each of the two approaches. +

+ + + + + + + + + + + + + +
[ << ][ >> ]           [Top][Contents][Index][ ? ]
+

+ + This document was generated by Bruno Haible on June, 4 2025 using texi2html 1.78a. + +
+ +

+ + diff --git a/miniconda3/share/doc/libtextstyle/libtextstyle_2.html b/miniconda3/share/doc/libtextstyle/libtextstyle_2.html new file mode 100644 index 0000000000000000000000000000000000000000..47074aebb08bea457b8bb218678f706def68825b --- /dev/null +++ b/miniconda3/share/doc/libtextstyle/libtextstyle_2.html @@ -0,0 +1,441 @@ + + + + + +GNU libtextstyle: 2. The end user's perspective + + + + + + + + + + + + + + + + + + + + + + + + + + +
[ << ][ >> ]           [Top][Contents][Index][ ? ]
+ +
+ + +

2. The end user's perspective

+ +

Styled output can viewed fine in a console or terminal emulator window. +

+

The stylable program will typically have the following options: +

+
--color
+

Use colors and other text attributes always. +

+
--color=when
+

Use colors and other text attributes if when. when may be +always, never, auto, or html. +

+
--style=style-file
+

Specify the CSS style rule file for --color. +

+
+ +

For more details, see the sections The --color option and +The --style option below. +

+

If the output does not fit on a screen, you can use ‘less -R’ to +scroll around in the styled output. For example: +

 
program --color arguments | less -R
+
+ + + + + +

2.1 The environment variable TERM

+ +

The environment variable TERM contains a identifier for the text +window's capabilities. You can get a detailed list of these cababilities +by using the ‘infocmp’ command (for example: infocmp -L1 xterm), +using ‘man 5 terminfo’ as a reference. +

+

When producing text with embedded color directives, a +libtextstyle-enabled program looks at the TERM variable. +Text windows today typically support at least 8 colors. Often, however, +the text window supports 16 or more colors, even though the TERM +variable is set to a identifier denoting only 8 supported colors. It +can be worth setting the TERM variable to a different value in +these cases. +

+

After setting TERM, you can verify how well it works by invoking +‘program --color=test’, where program is any +libtextstyle-enabled program, and seeing whether the output looks +like a reasonable color map. +

+ + + + +

2.1.1 Terminal emulator programs

+ +

The following terminal emulator programs support 256 colors and set +TERM=xterm-256color accordingly: +

+
    +
  • +In GNOME: gnome-terminal, tilda. +
  • +rxvt-unicode (sets TERM=rxvt-unicode-256color). +
  • +st (sets TERM=st-256color). +
  • +QTerminal. +
  • +On macOS: Terminal, iTerm2. +
+ +

The following terminal emulator programs support 256 colors. You only +need to set TERM=xterm-256color or similar; the programs by default +set TERM to a value that supports only 8 colors. +

+
    +
  • +xterm is in many cases built with support for 256 colors. But it +sets TERM=xterm. You need to set TERM=xterm-256color. +
  • +In GNOME: guake (sets TERM=xterm). You need to set +TERM=xterm-256color. +
  • +In KDE: konsole (sets TERM=xterm). You need to set +TERM=xterm-256color or TERM=konsole-256color. +
  • +In KDE: yakuake (sets TERM=xterm). You need to set +TERM=xterm-256color. +
  • +In Enlightenment: Eterm (sets TERM=Eterm). You need to set +TERM=Eterm-256color. +
  • +mlterm (sets TERM=mlterm). You need to set +TERM=mlterm-256color. +
  • +On Windows: PuTTY (sets TERM=xterm). You need to set +TERM=xterm-256color or TERM=putty-256color. +
  • +On Windows: TeraTerm (sets TERM=xterm). You need to set +TERM=xterm-256color. +
+ +

A couple of terminal emulator programs support even the entire RGB color +space (16 million colors). To get this to work, at this date (2019), you +need three things: +

    +
  • +The ncurses library version 6.1 or newer must be installed. +
  • +You need a recent version of the respective terminal emulator program. +See https://github.com/termstandard/colors for the most recent +developments in this area. +
  • +You need to set the TERM environment variable to the corresponding +value: +TERM=xterm-direct instead of +TERM=xterm or TERM=xterm-256color, +TERM=konsole-direct in konsole, +TERM=st-direct in st, +TERM=mlterm-direct in mlterm, +or TERM=iterm2-direct in iTerm2 on macOS. +
+ + + + +

2.1.2 Consoles

+ +

On OpenBSD 6 consoles, TERM=xterm produces better results than the +default TERM=vt220. +

+

On NetBSD 8 consoles, TERM=netbsd6 produces better results than the +default TERM=vt100. +

+

On Windows consoles, no TERM setting is needed. +

+ + + +

2.2 The environment variable NO_COLOR

+ +

The environment variable NO_COLOR can be used to suppress styling +in the textual output. When this environment variable is set (to any value), +libtextstyle-enabled programs will not emit colors and other text +styling. +

+

This environment variable can be overridden by passing the command-line option +‘--color=always’ (see The --color option). +

+ + + +

2.3 The environment variable NO_TERM_HYPERLINKS

+ +

The environment variable NO_TERM_HYPERLINKS can be used to suppress +hyperlinks in the textual output. When this environment variable is set +(to any value), libtextstyle-enabled programs will not emit +hyperlinks. This may be useful for terminal emulators which produce +garbage output when they receive the escape sequence for a hyperlink. +Currently (as of 2019), this affects some versions of +konsole, emacs, lxterminal, guake, yakuake, rxvt.

+ + + +

2.4 Emacs as a terminal emulator

+ +

Emacs has several terminal emulators: M-x shell and +M-x term. M-x term has good support for styling, whereas +in M-x shell most of the styling gets lost. +

+ + + +

2.5 The --color option

+ +

The ‘--color=when’ option specifies under which conditions +styled (colorized) output should be generated. The when part can +be one of the following: +

+
+
always
+
yes
+

The output will be colorized. +

+
+
never
+
no
+

The output will not be colorized. +

+
+
auto
+
tty
+

The output will be colorized if the output device is a tty, i.e. when +the output goes directly to a text screen or terminal emulator window. +

+
+
html
+

The output will be colorized and be in HTML format. This value is only +supported by some programs. +

+
+
test
+

This is a special value, understood only by some programs. It is +explained in the section (The environment variable TERM) above. +

+
+ +

--color’ is equivalent to ‘--color=yes’. The default is +‘--color=auto’. +

+

Thus, a command that invokes a libtextstyle-enabled program will +produce colorized output when called by itself in a command window. +Whereas in a pipe, such as ‘program arguments | less -R’, +it will not produce colorized output. To get colorized output in this +situation nevertheless, use the command +‘program --color arguments | less -R’. +

+

The ‘--color=html’ option will produce output that can be viewed in +a browser. This can be useful, for example, for Indic languages, +because the renderic of Indic scripts in browsers is usually better than +in terminal emulators. +

+

Note that the output produced with the --color option is +not consumable by programs that expect the raw text. It contains +additional terminal-specific escape sequences or HTML tags. For example, +an XML parser will give a syntax error when confronted with a colored XML +output. Except for the ‘--color=html’ case, you therefore normally +don't need to save output produced with the --color option in a +file. +

+ + + +

2.6 The --style option

+ +

The ‘--style=style_file’ option specifies the style file to +use when colorizing. It has an effect only when the --color +option is effective. +

+

If the --style option is not specified, the program may consider +the value of an environment variable. It is meant to point to the user's +preferred style for such output. The name of such an environment +variable, if supported, is documented in the documentation of the +libtextstyle-enabled program. +

+

You can also design your own styles. This is described in the next +section. +

+ + + + +

2.6.1 Creating your own style files

+ +

The same style file can be used for styling a certain type of output, for +terminal output and for HTML output. It is written in CSS +(Cascading Style Sheet) syntax. See +https://www.w3.org/TR/CSS2/ for a formal definition of +CSS. Many HTML authoring tutorials also contain explanations of CSS. +

+

In the case of HTML output, the style file is embedded in the HTML output. +In the case of text output, the style file is interpreted by the +libtextstyle-enabled program. +

+

You should avoid @import statements, because +

    +
  • - +In the case of HTML output, the files referenced by the @import +statements would not be embedded in the HTML output. In fact, relative +file names would be interpreted relative to the resulting HTML file. +
  • - +In the case of text output, @imports are not supported, due to a +limitation in libcroco. +
+ +

CSS rules are built up from selectors and declarations. The declarations +specify graphical properties; the selectors specify when they apply. +

+

GNU libtextstyle supports simple selectors based on "CSS classes", see +the CSS2 spec, section 5.8.3. The set of CSS classes that are supported +by a libtextstyle-enabled program are documented in the +documentation of that program. +

+

These selectors can be combined to hierarchical selectors. For example, +assume a program supports the CSS classes string (that matches a +string) and non-ascii (that matches a word with non-ASCII +characters), you could write +

+
 
.string .non-ascii { color: red; }
+
+ +

to highlight only the non-ASCII words inside strings. +

+

In text mode, pseudo-classes (CSS2 spec, section 5.11) and +pseudo-elements (CSS2 spec, section 5.12) are not supported. +

+

The declarations in HTML mode are not limited; any graphical attribute +supported by the browsers can be used. +

+

The declarations in text mode are limited to the following properties. +Other properties will be silently ignored. +

+
+
color (CSS2 spec, section 14.1)
+
background-color (CSS2 spec, section 14.2.1)
+

These properties are supported. Colors will be adjusted to match the +terminal's capabilities. Note that many terminals support only 8 colors. +

+
+
font-weight (CSS2 spec, section 15.2.3)
+

This property is supported, but most terminals can only render two +different weights: normal and bold. Values >= 600 are +rendered as bold. +

+
+
font-style (CSS2 spec, section 15.2.3)
+

This property is supported. The values italic and oblique +are rendered the same way. +

+
+
text-decoration (CSS2 spec, section 16.3.1)
+

This property is supported, limited to the values none and +underline. +

+
+ + + + +

2.6.2 Debugging style files

+ +

If you want to understand why the style rules in a style file produce +the output that you see, you can do so in three steps: +

+
    +
  1. +Run the program with the command-line option --color=html, +redirecting the output to a file. +
  2. +Open the resulting HTML file in a browser. +
  3. +Use the browser's built-in CSS debugging tool. +
      +
    • +In Firefox: From the pop-up menu, select "Inspect Element". +Click somewhere in the DOM tree ("Inspector" tab) and look at the +CSS declarations in the "Rules" tab. +
    • +In Chromium: From the pop-up menu, select "Inspect". +Click somewhere in the DOM tree ("Elements" tab) and look at the +CSS declarations in the "Styles" tab. +
    +
+ +

This technique allows you, in particular, to see which CSS declarations +override which other CSS declarations from other CSS rules. +

+ + + + + + + + + + + + + +
[ << ][ >> ]           [Top][Contents][Index][ ? ]
+

+ + This document was generated by Bruno Haible on June, 4 2025 using texi2html 1.78a. + +
+ +

+ + diff --git a/miniconda3/share/doc/libtextstyle/libtextstyle_3.html b/miniconda3/share/doc/libtextstyle/libtextstyle_3.html new file mode 100644 index 0000000000000000000000000000000000000000..957e73e24a3908cd00790c39975234a5afc03556 --- /dev/null +++ b/miniconda3/share/doc/libtextstyle/libtextstyle_3.html @@ -0,0 +1,1110 @@ + + + + + +GNU libtextstyle: 3. The programmer's perspective + + + + + + + + + + + + + + + + + + + + + + + + + + +
[ << ][ >> ]           [Top][Contents][Index][ ? ]
+ +
+ + +

3. The programmer's perspective

+ +

As a programmer, enabling styling consists of the following tasks: +

    +
  1. +Define the command-line options and environment variable that the user +can use to control the styling. +
  2. +Define the CSS classes that the user can use in the CSS file. Each CSS +class corresponds to a text role; each CSS class can be given a different +styling by the user. +
  3. +Change the output routines so that they take an ‘ostream_t’ object +as argument instead of a ‘FILE *’. +
  4. +Insert paired invocations to styled_ostream_begin_css_class, +styled_ostream_end_css_class around each run of text with a +specific text role. +
  5. +Link with libtextstyle. If your package is using GNU autoconf, +you can use the libtextstyle.m4 macro from Gnulib. +
  6. +Prepare a default style file. +
  7. +Update the documentation of your package. +
+ +

The following sections go into more detail. +

+ + + + +

3.1 Basic use of libtextstyle

+ +

Source code that makes use of GNU libtextstyle needs an include statement: +

+
 
#include <textstyle.h>
+
+ +

Basic use of GNU libtextstyle consists of statements like these: +

+
 
  styled_ostream_t stream =
+    styled_ostream_create (STDOUT_FILENO, "(stdout)", TTYCTL_AUTO,
+                           style_file_name);
+  ...
+  styled_ostream_begin_use_class (stream, css_class);
+  ...
+  ostream_write_str (stream, string);
+  ...
+  styled_ostream_end_use_class (stream, css_class);
+  ...
+  styled_ostream_free (stream);
+
+ +

Before this snippet, your code needs to determine the name of the style +file to use (style_file_name). If no styling is desired – the +precise condition depends on the value of color_mode but also on +your application logic –, you should set style_file_name to +NULL. +

+

An object of type styled_ostream_t is allocated. The function +styled_ostream_create allocates it; the function +styled_ostream_free deallocates it. +

+

Such styled_ostream_t supports output operations +(ostream_write_str), interleaved with adding and removing CSS +classes. The CSS class in effect when an output operation is performed +determines, through the style file, the text attributes associated with +that piece of text. +

+ + + + +

3.1.1 Hyperlinks

+ +

Text output may contain hyperlinks. These hyperlinks are encoded through +an escape sequence, specified at +Hyperlinks in terminal emulators. Currently (as of 2024), they are +displayed in many modern terminals, see +OSC8-Adoption. More +terminal emulators will support hyperlinks in the future. Terminal +emulators which don't support hyperlinks ignore it, except for a few +terminal emulators, for which users may need to disable the hyperlinks +(see The environment variable NO_TERM_HYPERLINKS) if the heuristic built into +libtextstyle does not already disable them. +

+

To emit a hyperlink, use code like this: +

+
 
  styled_ostream_t stream = ...
+  ...
+  /* Start a hyperlink.  */
+  styled_ostream_set_hyperlink (stream, url, NULL);
+  ...
+  /* Emit the anchor text.  This can be styled text.  */
+  ostream_write_str (stream, "Click here!");
+  ...
+  /* End the current hyperlink.  */
+  styled_ostream_set_hyperlink (stream, NULL, NULL);
+
+ +

The anchor text can be styled. But the hyperlinks themselves cannot be +styled; they behave as implemented by the terminal emulator. +

+ + + +

3.2 Include files

+ +

The include file <textstyle.h> declares all facilities defined by +the library. +

+ + + +

3.3 Link options

+ +

The library to link with is called libtextstyle, with a +system-dependent suffix. You link with it though link options of the +form -ltextstyle for a library installed in system locations, or +-Llibdir -ltextstyle for a static library installed in other +locations, or -Llibdir -ltextstyle -Wl,-rpath,libdir +for a shared library installed in other locations (assuming a GCC +compatible compiler and linker and no libtool), or +-Llibdir -ltextstyle -Rlibdir for a shared library +installed in other locations (with libtool). Additionally, the +link options may need to include the dependencies: -lm, and +-lncurses or (on NetBSD) -ltermcap or (on AIX) +-lxcurses or (on HP-UX) -lcurses, and on some systems also +-liconv. +

+

It is a bit complicated to determine the right link options in a portable +way. Therefore an Autoconf macro is provided in the file +libtextstyle.m4 in Gnulib, that makes this task easier. Assuming +the build system of your package is based on GNU Autoconf, you invoke it +through gl_LIBTEXTSTYLE. It searches for an installed +libtextstyle. If found, it sets and AC_SUBSTs +HAVE_LIBTEXTSTYLE=yes and the LIBTEXTSTYLE and +LTLIBTEXTSTYLE variables, and augments the CPPFLAGS +variable, and #defines HAVE_LIBTEXTSTYLE to 1. Otherwise, it sets +and AC_SUBSTs HAVE_LIBTEXTSTYLE=no and LIBTEXTSTYLE and +LTLIBTEXTSTYLE to empty. In link commands that use libtool, +use LTLIBTEXTSTYLE; in link commands that don't use libtool, +use LIBTEXTSTYLE. +

+

If you use GNU Automake, the proper place to use the link options is +program_LDADD for programs and library_LIBADD +for libraries. +

+ + + +

3.4 Command-line options

+ +

While you are free to provide any command-line option to enable the +styling of the output, it is good if different GNU programs use the same +command-line options for this purpose. These options are described in +the sections The --color option and The --style option. To +achieve this, use the following API (declared in <textstyle.h>): +

+
+
Variable: bool color_test_mode + +
+

True if a --color option with value test has been seen. +

+ +
+
Variable: enum color_option color_mode + +
+

Stores the value of the --color option. +

+ +
+
Variable: const char * style_file_name + +
+

Stores the value of the --style option. +

+ +

Note: These variables, like any variables exported from shared libraries, +can only be used in executable code. You cannot portably use +their address in initializers of global or static variables. This is a +restriction that is imposed by the Windows, Cygwin, and Android platforms. +

+
+
Function: bool handle_color_option (const char *option) + +
+

You invoke this function when, during argument parsing, you have +encountered a --color or --color=... option. The return +value is an error indicator: true means an invalid option. +

+ +
+
Function: void handle_style_option (const char *option) + +
+

You invoke this function when, during argument parsing, you have +encountered a --style or --style=... option. +

+ +
+
Function: void print_color_test (void) + +
+

Prints a color test page. You invoke this function after argument +parsing, when the color_test_mode variable is true. +

+ +
+
Function: void style_file_prepare (const char *style_file_envvar, const char *stylesdir_envvar, const char *stylesdir_after_install, const char *default_style_file) + +
+

Assigns a default value to style_file_name if necessary. You +invoke this function after argument parsing, when color_test_mode +is false. +

+

style_file_envvar is an environment variable that, when set +to a non-empty value, specifies the style file to use. This environment +variable is meant to be set by the user. +

+

stylesdir_envvar is an environment variable that, when set +to a non-empty value, specifies the directory with the style files, or +NULL. This is necessary for running the testsuite before +‘make install’. +

+

stylesdir_after_install is the directory with the style +files after ‘make install’. +

+

default_style_file is the file name of the default style +file, relative to stylesdir. +

+ + + + +

3.5 The output stream hierarchy

+ +

There are various classes of output streams, some of them with styling +support. These “classes” are defined in an object-oriented programming +style that resembles C++ or Java, but are actually implemented in C with +a little bit of object orientation syntax. These definitions are +preprocessed down to C. As a consequence, GNU libtextstyle is a C +library and does not need to link with the C++ standard library. +

+

All these classes are declared in <textstyle.h>. +

+

The base output stream type is ‘ostream_t’. It is a pointer type to +a (hidden) implementation type. Similarly for the subclasses. +

+

When we say that ‘some_ostream_t’ is a subclass of ‘ostream_t’, +what we mean is: +

    +
  • +Every ‘some_ostream_t’ object can be converted to an +‘ostream_t’, by virtue of a simple assignment. No cast is needed. +
  • +The opposite conversion, from ‘ostream_t’ to ‘some_ostream_t’, +can also be performed, provided that the object is actually an instance +of ‘some_ostream_t’. You can test whether an object is an instance +of ‘some_ostream_t’ by invoking the method +‘bool is_instance_of_some_ostream (ostream_t stream)’. + + + + + + + + + + +
  • +Every method ‘ostream_foobar’ exists also as a method +‘some_ostream_foobar’ with compatible argument types and a +compatible return type. +
+ + + + + +

3.5.1 The abstract ostream class

+ +

The base output stream type is ‘ostream_t’. +

+

It has the following methods: +

+
+
Function: void ostream_write_mem (ostream_t stream, const void *data, size_t len) + +
+

Writes a sequence of bytes to a stream. +

+ +
+
Function: void ostream_write_str (ostream_t stream, const char *string) + +
+

Writes a string's contents to a stream. +

+ +
+
Function: ptrdiff_t ostream_printf (ostream_t stream, const char *format, ...) + +
+
Function: ptrdiff_t ostream_vprintf (ostream_t stream, const char *format, va_list args) + +
+

Writes formatted output to a stream. +

+

These functions return the size of formatted output, or a negative value +in case of an error. +

+ +
+
Function: void ostream_flush (ostream_t stream, ostream_flush_scope_t scope) + +
+

Brings buffered data to its destination. +

+ +
+
Function: void ostream_free (ostream_t stream) + +
+

Closes and frees a stream. +

+ + + + +

3.5.2 The abstract styled_ostream class

+ +

The type for a styled output stream is ‘styled_ostream_t’. It is a +subclass of ‘ostream_t’ that adds the following methods: +

+
+
Function: void styled_ostream_begin_use_class (styled_ostream_t stream, const char *classname) + +
+

Starts a run of text belonging to classname. The +classname is the name of a CSS class. It can be chosen +arbitrarily and customized through the CSS file. +

+ +
+
Function: void styled_ostream_end_use_class (styled_ostream_t stream, const char *classname) + +
+

Ends a run of text belonging to classname. The +styled_ostream_begin_use_class / +styled_ostream_end_use_class calls must match properly. +

+ +
+
Function: const char * styled_ostream_get_hyperlink_ref (styled_ostream_t stream) + +
+

Returns the referred URL of the currently set hyperlink, or NULL +if no hyperlink attribute is currently set. +

+

Note: The returned string is only valid up to the next invocation of +styled_ostream_set_hyperlink. +

+ +
+
Function: const char * styled_ostream_get_hyperlink_id (styled_ostream_t stream) + +
+

Returns the id of the currently set hyperlink, or NULL if no +hyperlink attribute is currently set. +

+

Note: The returned string is only valid up to the next invocation of +styled_ostream_set_hyperlink. +

+ +
+
Function: void styled_ostream_set_hyperlink (styled_ostream_t stream, const char *ref, const char *id) + +
+

Sets or removes a hyperlink attribute. +

+

To set a hyperlink attribute, pass a non-NULL ref. +ref is an URL; it should be at most 2083 bytes long. Non-ASCII +characters should be URI-escaped (using the %nn syntax). id is +an optional identifier. On terminal output, multiple hyperlinks with +the same id will be highlighted together. If specified, id +should be at most 250 bytes long. +

+

To remove a hyperlink attribute, pass NULL for ref and id. +

+

Hyperlinks don't nest. That is, a hyperlink attribute is enabled only +up to the next invocation of styled_ostream_set_hyperlink. +

+ +
+
Function: void styled_ostream_flush_to_current_style (styled_ostream_t stream) + +
+

This function acts like ostream_flush (stream, FLUSH_THIS_STREAM), +except that it leaves the destination with the current text style enabled, +instead of with the default text style. +

+

After calling this function, you can output strings without newlines(!) to the +underlying stream, and they will be rendered like strings passed to +ostream_write_mem, ostream_write_str, or ostream_printf. +

+ + + + +

3.5.3 Concrete ostream subclasses without styling

+ + + + + +

3.5.3.1 The file_ostream class

+ +

The file_ostream class supports output to an <stdio.h> +FILE stream. Its type is ‘file_ostream_t’. It is a subclass +of ‘ostream_t’ that adds no methods. +

+

It can be instantiated through this function: +

+
+
Function: file_ostream_t file_ostream_create (FILE *fp) + +
+

Creates an output stream referring to fp. +

+

Note: The resulting stream must be closed before fp can be +closed. +

+ + + + +

3.5.3.2 The fd_ostream class

+ +

The file_ostream class supports output to a file descriptor. Its +type is ‘fd_ostream_t’. It is a subclass of ‘ostream_t’ that +adds no methods. +

+

It can be instantiated through this function: +

+
+
Function: fd_ostream_t fd_ostream_create (int fd, const char *filename, bool buffered) + +
+

Creates an output stream referring to the file descriptor fd. +

+

filename is used only for error messages. +

+

Note: The resulting stream must be closed before fd can be +closed. +

+ + + + +

3.5.3.3 The term_ostream class

+ +

The term_ostream class supports output to a file descriptor that +is connected to a terminal emulator or console. Its type is +‘term_ostream_t’. It is a subclass of ‘ostream_t’. +

+

It can be instantiated through this function: +

+
+
Function: term_ostream_t term_ostream_create (int fd, const char *filename, ttyctl_t tty_control) + +
+

Creates an output stream referring to the file descriptor fd. +

+

filename is used only for error messages. +

+

tty_control specifies the amount of control to take over the +underlying tty. +

+

The resulting stream will be line-buffered. +

+

Note: The resulting stream must be closed before fd can be +closed. +

+ +

The class adds the following methods: +

+
+
Function: term_color_t term_ostream_rgb_to_color (term_ostream_t stream, int red, int green, int blue) + +
+

Converts an RGB value +(red, green, blue in [0..255]) to +a color, valid for this stream only. +

+ +
+
Function: term_color_t term_ostream_get_color (term_ostream_t stream) + +
+
Function: void term_ostream_set_color (term_ostream_t stream, term_color_t color) + +
+

Gets/sets the text color. +

+ +
+
Function: term_color_t term_ostream_get_bgcolor (term_ostream_t stream) + +
+
Function: void term_ostream_set_bgcolor (term_ostream_t stream, term_color_t color) + +
+

Gets/sets the background color. +

+ +
+
Function: term_weight_t term_ostream_get_weight (term_ostream_t stream) + +
+
Function: void term_ostream_set_weight (term_ostream_t stream, term_weight_t weight) + +
+

Gets/sets the font weight. +

+ +
+
Function: term_posture_t term_ostream_get_posture (term_ostream_t stream) + +
+
Function: void term_ostream_set_posture (term_ostream_t stream, term_posture_t posture) + +
+

Gets/sets the font posture. +

+ +
+
Function: term_underline_t term_ostream_get_underline (term_ostream_t stream) + +
+
Function: void term_ostream_set_underline (term_ostream_t stream, term_underline_t underline) + +
+

Gets/sets the text underline decoration. +

+ +
+
Function: const char * term_ostream_get_hyperlink_ref (term_ostream_t stream) + +
+

Returns the referred URL of the currently set hyperlink, or NULL +if no hyperlink attribute is currently set. +

+

Note: The returned string is only valid up to the next invocation of +term_ostream_set_hyperlink. +

+ +
+
Function: const char * term_ostream_get_hyperlink_id (term_ostream_t stream) + +
+

Returns the id of the currently set hyperlink, or NULL if no +hyperlink attribute is currently set. +

+

Note: The returned string is only valid up to the next invocation of +term_ostream_set_hyperlink. +

+ +
+
Function: void term_ostream_set_hyperlink (term_ostream_t stream, const char *ref, const char *id) + +
+

Sets or removes a hyperlink attribute. +

+

To set a hyperlink attribute, pass a non-NULL ref. +ref is an URL; it should be at most 2083 bytes long. Non-ASCII +characters should be URI-escaped (using the %nn syntax). id is +an optional identifier. Multiple hyperlinks with the same id +will be highlighted together. If specified, id should be at most +250 bytes long. +

+

To remove a hyperlink attribute, pass NULL for ref and id. +

+

Hyperlinks don't nest. That is, a hyperlink attribute is enabled only +up to the next invocation of styled_ostream_set_hyperlink. +

+ +
+
Function: void term_ostream_flush_to_current_style (term_ostream_t stream) + +
+

This function acts like ostream_flush (stream, FLUSH_THIS_STREAM), +except that it leaves the terminal with the current text attributes enabled, +instead of with the default text attributes. +

+

After calling this function, you can output strings without newlines(!) to the +underlying file descriptor, and they will be rendered like strings passed to +ostream_write_mem, ostream_write_str, or ostream_printf. +

+ + + + +

3.5.3.4 The html_ostream class

+ +

The html_ostream class supports output to any destination, in HTML +syntax. Its type is ‘html_ostream_t’. It is a subclass of +‘ostream_t’. +

+

It can be instantiated through this function: +

+
+
Function: html_ostream_t html_ostream_create (ostream_t destination) + +
+

Creates an output stream that takes input in the UTF-8 encoding and +writes it in HTML form on destination. +

+

This stream produces a sequence of lines. The caller is responsible for +opening the <body><html> elements before and for closing them +after the use of this stream. +

+

Note: The resulting stream must be closed before destination +can be closed. +

+ +

The class adds the following methods: +

+
+
Function: void html_ostream_begin_span (html_ostream_t stream, const char *classname) + +
+

Starts a <span class="classname"> element. The +classname is the name of a CSS class. It can be chosen +arbitrarily and customized through the CSS file. +

+ +
+
Function: void html_ostream_end_span (html_ostream_t stream, const char *classname) + +
+

Ends a <span class="classname"> element. +

+

The html_ostream_begin_span / html_ostream_end_span calls +must match properly. +

+ +
+
Function: const char * html_ostream_get_hyperlink_ref (html_ostream_t stream) + +
+

Returns the referred URL of the currently set hyperlink, or NULL +if no hyperlink attribute is currently set. +

+

Note: The returned string is only valid up to the next invocation of +html_ostream_set_hyperlink_ref. +

+ +
+
Function: void html_ostream_set_hyperlink_ref (html_ostream_t stream, const char *ref) + +
+

Sets or removes a hyperlink attribute. +

+

To set a hyperlink attribute, pass a non-NULL ref. +ref is an URL; it should be at most 2083 bytes long. Non-ASCII +characters should be URI-escaped (using the %nn syntax). +

+

To remove a hyperlink attribute, pass NULL for ref. +

+

Hyperlinks don't nest. That is, a hyperlink attribute is enabled only +up to the next invocation of html_ostream_set_hyperlink_ref. +

+ +
+
Function: void html_ostream_flush_to_current_style (html_ostream_t stream) + +
+

This function acts like ostream_flush (stream, FLUSH_THIS_STREAM), +except that it leaves the destination with the current text style enabled, +instead of with the default text style. +

+

After calling this function, you can output strings without newlines(!) to the +underlying stream, and they will be rendered like strings passed to +ostream_write_mem, ostream_write_str, or ostream_printf. +

+ + + + +

3.5.3.5 The memory_ostream class

+ +

The memory_ostream class supports output to an in-memory buffer. +Its type is ‘memory_ostream_t’. It is a subclass of +‘ostream_t’. +

+

It can be instantiated through this function: +

+
+
Function: memory_ostream_t memory_ostream_create (void) + +
+

Creates an output stream that accumulates the output in a memory buffer. +

+ +

The class adds the following method: +

+
+
Function: void memory_ostream_contents (memory_ostream_t stream, const void **bufp, size_t *buflenp) + +
+

Returns a pointer to the output accumulated so far and its size. It +stores them in *bufp and *buflenp, respectively. +

+

Note: These two return values become invalid when more output is done to +the stream or when the stream is freed. +

+ + + + +

3.5.3.6 The iconv_ostream class

+ +

The iconv_ostream class supports output to any destination. Its +type is ‘iconv_ostream_t’. It is a subclass of ‘ostream_t’ +that adds no methods. +

+

It can be instantiated through this function: +

+
+
Function: iconv_ostream_t iconv_ostream_create (const char *from_encoding, const char *to_encoding, ostream_t destination) + +
+

Creates an output stream that converts from from_encoding to +to_encoding, writing the result to destination. +

+

Note: The resulting stream must be closed before destination +can be closed. +

+ + + + +

3.5.4 Concrete styled_ostream subclasses

+ + + + + +

3.5.4.1 The term_styled_ostream class

+ +

The term_styled_ostream class supports styled output to a file +descriptor that is connected to a terminal emulator or console. Its type +is ‘term_styled_ostream_t’. It is a subclass of +‘styled_ostream_t’. +

+

It can be instantiated through this function: +

+
+
Function: term_styled_ostream_t term_styled_ostream_create (int fd, const char *filename, ttyctl_t tty_control, const char *css_filename) + +
+

Creates an output stream referring to the file descriptor fd, +styled with the file css_filename. +

+

filename is used only for error messages. +

+

tty_control specifies the amount of control to take over the +underlying tty. +

+

Note: The resulting stream must be closed before fd can be +closed. +

+

Returns NULL upon failure. +

+ +

The following is a variant of this function. Upon failure, it does not +return NULL; instead, it returns a styled fd_stream on +which the styling operations exist but are no-ops. +

+
+
Function: styled_ostream_t styled_ostream_create (int fd, const char *filename, ttyctl_t tty_control, const char *css_filename) + +
+

Creates an output stream referring to the file descriptor fd, +styled with the file css_filename if possible. +

+

filename is used only for error messages. +

+

tty_control specifies the amount of control to take over the +underlying tty. +

+

Note: The resulting stream must be closed before fd can be +closed. +

+ + + + +

3.5.4.2 The html_styled_ostream class

+ +

The html_styled_ostream class supports styled output to any +destination, in HTML syntax. Its type is ‘html_styled_ostream_t’. +It is a subclass of ‘styled_ostream_t’. +

+

It can be instantiated through this function: +

+
+
Function: html_styled_ostream_t html_styled_ostream_create (ostream_t destination, const char *css_filename) + +
+

Creates an output stream that takes input in the UTF-8 encoding and +writes it in HTML form on destination, styled with the file +css_filename. +

+

Note: The resulting stream must be closed before destination +can be closed. +

+ + + + +

3.5.4.3 The noop_styled_ostream class

+ +

The noop_styled_ostream class supports the styled output operations +to any destination. The text is output to the given destination; the +styling operations, however, do nothing. Its type is +‘noop_styled_ostream_t’. It is a subclass of ‘styled_ostream_t’. +

+

It can be instantiated through this function: +

+
+
Function: noop_styled_ostream_t noop_styled_ostream_create (ostream_t destination, bool pass_ownership) + +
+

Creates an output stream that delegates to destination and +that supports the styling operations as no-ops. +

+

If pass_ownership is true, closing the resulting +stream will automatically close the destination. +

+

Note: If pass_ownership is false, the resulting stream +must be closed before destination can be closed. +

+ + + + +

3.5.5 Accessor functions

+ +

The various concrete stream classes have methods that allow you to retrieve +the arguments passed to the respective constructor function. +

+

Note: While these methods allow you to retrieve the underlying destination +stream of various kinds of stream, it is not recommended to operate on both +the stream and its underlying destination stream at the same time. Doing +so can lead to undesired interactions between the two streams. +

+

The file_ostream class has this accessor method: +

+
+
Function: FILE * file_ostream_get_stdio_stream (file_ostream_t stream) + +
+
+ +

The fd_ostream class has these accessor methods: +

+
+
Function: int fd_ostream_get_descriptor (fd_ostream_t stream) + +
+
+
+
Function: const char * fd_ostream_get_filename (fd_ostream_t stream) + +
+
+
+
Function: bool fd_ostream_is_buffered (fd_ostream_t stream) + +
+
+ +

The term_ostream class has these accessor methods: +

+
+
Function: int term_ostream_get_descriptor (term_ostream_t stream) + +
+
+
+
Function: const char * term_ostream_get_filename (term_ostream_t stream) + +
+
+
+
Function: ttyctl_t term_ostream_get_tty_control (term_ostream_t stream) + +
+
+
+
Function: ttyctl_t term_ostream_get_effective_tty_control (term_ostream_t stream) + +
+

Returns the effective tty control of the stream (not TTYCTL_AUTO). +

+ +

The iconv_ostream class has these accessor methods: +

+
+
Function: const char * iconv_ostream_get_from_encoding (iconv_ostream_t stream) + +
+
+
+
Function: const char * iconv_ostream_get_to_encoding (iconv_ostream_t stream) + +
+
+
+
Function: ostream_t iconv_ostream_get_destination (iconv_ostream_t stream) + +
+
+ +

The html_ostream class has this accessor method: +

+
+
Function: ostream_t html_ostream_get_destination (html_ostream_t stream) + +
+
+ +

The term_styled_ostream class has these accessor methods: +

+
+
Function: term_ostream_t term_styled_ostream_get_destination (term_styled_ostream_t stream) + +
+
+
+
Function: const char * term_styled_ostream_get_css_filename (term_styled_ostream_t stream) + +
+
+ +

The html_styled_ostream class has these accessor methods: +

+
+
Function: ostream_t html_styled_ostream_get_destination (html_styled_ostream_t stream) + +
+
+
+
Function: html_ostream_t html_styled_ostream_get_html_destination (html_styled_ostream_t stream) + +
+
+
+
Function: const char * html_styled_ostream_get_css_filename (html_styled_ostream_t stream) + +
+
+ +

The noop_styled_ostream class has these accessor methods: +

+
+
Function: ostream_t noop_styled_ostream_get_destination (noop_styled_ostream_t stream) + +
+
+
+
Function: bool noop_styled_ostream_is_owning_destination (noop_styled_ostream_t stream) + +
+
+ + + + +

3.6 Debugging the text styling support

+ +

If you want to understand which output of your program is associated with +which CSS classes, the simplest way is as follows: +

+
    +
  1. +Run the program with the command-line option --color=html, +redirecting the output to a file. +
  2. +Then inspect this output. Text regions associated with a CSS class are +surrounded by <span class="css-class">...</span>. +
+ + + + +

3.7 Documenting the text styling support

+ +

To make the text styling support available to the end user of your +package, the following need to be documented: +

    +
  • +The command-line options. This typically needs to be done in several +places: in the ‘--help’ output, in the man pages (if present), +and in the documentation. +
  • +Which programs support ‘--color=test’? +
  • +The list of CSS classes and their meaning. This is necessary, so that +the user can create their own style file; the CSS classes are part of the +selectors in the CSS rules. +
  • +The location of the default style file. This is a convenience, so that +the user, when creating their own style file, can start from the default +one. +
  • +The environment variable, called style_file_envvar above, +that, when set to a non-empty value, specifies the style file to use. +
+ + + + + + + + + + + + + + +
[ << ][ >> ]           [Top][Contents][Index][ ? ]
+

+ + This document was generated by Bruno Haible on June, 4 2025 using texi2html 1.78a. + +
+ +

+ + diff --git a/miniconda3/share/doc/libtextstyle/libtextstyle_4.html b/miniconda3/share/doc/libtextstyle/libtextstyle_4.html new file mode 100644 index 0000000000000000000000000000000000000000..a32f97003db6adcdd8d0f25f98f05fb60898f5ee --- /dev/null +++ b/miniconda3/share/doc/libtextstyle/libtextstyle_4.html @@ -0,0 +1,1334 @@ + + + + + +GNU libtextstyle: A. Licenses + + + + + + + + + + + + + + + + + + + + + + + + + + +
[ << ][ >> ]           [Top][Contents][Index][ ? ]
+ +
+ + +

A. Licenses

+ +

The files of this package are covered by the licenses indicated in each +particular file or directory. Here is a summary: +

+
    +
  • +The libtextstyle library and the example programs +are covered by the GNU General Public License (GPL). +A copy of the license is included in GNU GENERAL PUBLIC LICENSE. + +
  • +This manual is free documentation. It is dually licensed under the +GNU FDL and the GNU GPL. This means that you can redistribute this +manual under either of these two licenses, at your choice. +
    +This manual is covered by the GNU FDL. Permission is granted to copy, +distribute and/or modify this document under the terms of the +GNU Free Documentation License (FDL), either version 1.2 of the +License, or (at your option) any later version published by the +Free Software Foundation (FSF); with no Invariant Sections, with no +Front-Cover Text, and with no Back-Cover Texts. +A copy of the license is included in GNU Free Documentation License. +
    +This manual is covered by the GNU GPL. You can redistribute it and/or +modify it under the terms of the GNU General Public License (GPL), either +version 3 of the License, or (at your option) any later version published +by the Free Software Foundation (FSF). +A copy of the license is included in GNU GENERAL PUBLIC LICENSE. +
+ + + + + + +

A.1 GNU GENERAL PUBLIC LICENSE

+

Version 3, 29 June 2007 +

+ +
 
Copyright © 2007 Free Software Foundation, Inc. https://fsf.org/
+
+Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
+
+ + +

Preamble

+ +

The GNU General Public License is a free, copyleft license for +software and other kinds of works. +

+

The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom +to share and change all versions of a program—to make sure it remains +free software for all its users. We, the Free Software Foundation, +use the GNU General Public License for most of our software; it +applies also to any other work released this way by its authors. You +can apply it to your programs, too. +

+

When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. +

+

To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you +have certain responsibilities if you distribute copies of the +software, or if you modify it: responsibilities to respect the freedom +of others. +

+

For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, +receive or can get the source code. And you must show them these +terms so they know their rights. +

+

Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. +

+

For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. +

+

Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the +manufacturer can do so. This is fundamentally incompatible with the +aim of protecting users' freedom to change the software. The +systematic pattern of such abuse occurs in the area of products for +individuals to use, which is precisely where it is most unacceptable. +Therefore, we have designed this version of the GPL to prohibit the +practice for those products. If such problems arise substantially in +other domains, we stand ready to extend this provision to those +domains in future versions of the GPL, as needed to protect the +freedom of users. +

+

Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish +to avoid the special danger that patents applied to a free program +could make it effectively proprietary. To prevent this, the GPL +assures that patents cannot be used to render the program non-free. +

+

The precise terms and conditions for copying, distribution and +modification follow. +

+ +

TERMS AND CONDITIONS

+ +
    +
  1. Definitions. + +

    “This License” refers to version 3 of the GNU General Public License. +

    +

    “Copyright” also means copyright-like laws that apply to other kinds +of works, such as semiconductor masks. +

    +

    “The Program” refers to any copyrightable work licensed under this +License. Each licensee is addressed as “you”. “Licensees” and +“recipients” may be individuals or organizations. +

    +

    To “modify” a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of +an exact copy. The resulting work is called a “modified version” of +the earlier work or a work “based on” the earlier work. +

    +

    A “covered work” means either the unmodified Program or a work based +on the Program. +

    +

    To “propagate” a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. +

    +

    To “convey” a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user +through a computer network, with no transfer of a copy, is not +conveying. +

    +

    An interactive user interface displays “Appropriate Legal Notices” to +the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. +

    +
  2. Source Code. + +

    The “source code” for a work means the preferred form of the work for +making modifications to it. “Object code” means any non-source form +of a work. +

    +

    A “Standard Interface” means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. +

    +

    The “System Libraries” of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +“Major Component”, in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. +

    +

    The “Corresponding Source” for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. +

    +

    The Corresponding Source need not include anything that users can +regenerate automatically from other parts of the Corresponding Source. +

    +

    The Corresponding Source for a work in source code form is that same +work. +

    +
  3. Basic Permissions. + +

    All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. +

    +

    You may make, run and propagate covered works that you do not convey, +without conditions so long as your license otherwise remains in force. +You may convey covered works to others for the sole purpose of having +them make modifications exclusively for you, or provide you with +facilities for running those works, provided that you comply with the +terms of this License in conveying all material for which you do not +control copyright. Those thus making or running the covered works for +you must do so exclusively on your behalf, under your direction and +control, on terms that prohibit them from making any copies of your +copyrighted material outside their relationship with you. +

    +

    Conveying under any other circumstances is permitted solely under the +conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. +

    +
  4. Protecting Users' Legal Rights From Anti-Circumvention Law. + +

    No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. +

    +

    When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such +circumvention is effected by exercising rights under this License with +respect to the covered work, and you disclaim any intention to limit +operation or modification of the work as a means of enforcing, against +the work's users, your or third parties' legal rights to forbid +circumvention of technological measures. +

    +
  5. Conveying Verbatim Copies. + +

    You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. +

    +

    You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. +

    +
  6. Conveying Modified Source Versions. + +

    You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these +conditions: +

    +
      +
    1. +The work must carry prominent notices stating that you modified it, +and giving a relevant date. + +
    2. +The work must carry prominent notices stating that it is released +under this License and any conditions added under section 7. This +requirement modifies the requirement in section 4 to “keep intact all +notices”. + +
    3. +You must license the entire work, as a whole, under this License to +anyone who comes into possession of a copy. This License will +therefore apply, along with any applicable section 7 additional terms, +to the whole of the work, and all its parts, regardless of how they +are packaged. This License gives no permission to license the work in +any other way, but it does not invalidate such permission if you have +separately received it. + +
    4. +If the work has interactive user interfaces, each must display +Appropriate Legal Notices; however, if the Program has interactive +interfaces that do not display Appropriate Legal Notices, your work +need not make them do so. +
    + +

    A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +“aggregate” if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. +

    +
  7. Conveying Non-Source Forms. + +

    You may convey a covered work in object code form under the terms of +sections 4 and 5, provided that you also convey the machine-readable +Corresponding Source under the terms of this License, in one of these +ways: +

    +
      +
    1. +Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by the +Corresponding Source fixed on a durable physical medium customarily +used for software interchange. + +
    2. +Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by a written +offer, valid for at least three years and valid for as long as you +offer spare parts or customer support for that product model, to give +anyone who possesses the object code either (1) a copy of the +Corresponding Source for all the software in the product that is +covered by this License, on a durable physical medium customarily used +for software interchange, for a price no more than your reasonable +cost of physically performing this conveying of source, or (2) access +to copy the Corresponding Source from a network server at no charge. + +
    3. +Convey individual copies of the object code with a copy of the written +offer to provide the Corresponding Source. This alternative is +allowed only occasionally and noncommercially, and only if you +received the object code with such an offer, in accord with subsection +6b. + +
    4. +Convey the object code by offering access from a designated place +(gratis or for a charge), and offer equivalent access to the +Corresponding Source in the same way through the same place at no +further charge. You need not require recipients to copy the +Corresponding Source along with the object code. If the place to copy +the object code is a network server, the Corresponding Source may be +on a different server (operated by you or a third party) that supports +equivalent copying facilities, provided you maintain clear directions +next to the object code saying where to find the Corresponding Source. +Regardless of what server hosts the Corresponding Source, you remain +obligated to ensure that it is available for as long as needed to +satisfy these requirements. + +
    5. +Convey the object code using peer-to-peer transmission, provided you +inform other peers where the object code and Corresponding Source of +the work are being offered to the general public at no charge under +subsection 6d. + +
    + +

    A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. +

    +

    A “User Product” is either (1) a “consumer product”, which means any +tangible personal property which is normally used for personal, +family, or household purposes, or (2) anything designed or sold for +incorporation into a dwelling. In determining whether a product is a +consumer product, doubtful cases shall be resolved in favor of +coverage. For a particular product received by a particular user, +“normally used” refers to a typical or common use of that class of +product, regardless of the status of the particular user or of the way +in which the particular user actually uses, or expects or is expected +to use, the product. A product is a consumer product regardless of +whether the product has substantial commercial, industrial or +non-consumer uses, unless such uses represent the only significant +mode of use of the product. +

    +

    “Installation Information” for a User Product means any methods, +procedures, authorization keys, or other information required to +install and execute modified versions of a covered work in that User +Product from a modified version of its Corresponding Source. The +information must suffice to ensure that the continued functioning of +the modified object code is in no case prevented or interfered with +solely because modification has been made. +

    +

    If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). +

    +

    The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or +updates for a work that has been modified or installed by the +recipient, or for the User Product in which it has been modified or +installed. Access to a network may be denied when the modification +itself materially and adversely affects the operation of the network +or violates the rules and protocols for communication across the +network. +

    +

    Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. +

    +
  8. Additional Terms. + +

    “Additional permissions” are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. +

    +

    When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. +

    +

    Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders +of that material) supplement the terms of this License with terms: +

    +
      +
    1. +Disclaiming warranty or limiting liability differently from the terms +of sections 15 and 16 of this License; or + +
    2. +Requiring preservation of specified reasonable legal notices or author +attributions in that material or in the Appropriate Legal Notices +displayed by works containing it; or + +
    3. +Prohibiting misrepresentation of the origin of that material, or +requiring that modified versions of such material be marked in +reasonable ways as different from the original version; or + +
    4. +Limiting the use for publicity purposes of names of licensors or +authors of the material; or + +
    5. +Declining to grant rights under trademark law for use of some trade +names, trademarks, or service marks; or + +
    6. +Requiring indemnification of licensors and authors of that material by +anyone who conveys the material (or modified versions of it) with +contractual assumptions of liability to the recipient, for any +liability that these contractual assumptions directly impose on those +licensors and authors. +
    + +

    All other non-permissive additional terms are considered “further +restrictions” within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. +

    +

    If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. +

    +

    Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; the +above requirements apply either way. +

    +
  9. Termination. + +

    You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). +

    +

    However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. +

    +

    Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. +

    +

    Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. +

    +
  10. Acceptance Not Required for Having Copies. + +

    You are not required to accept this License in order to receive or run +a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. +

    +
  11. Automatic Licensing of Downstream Recipients. + +

    Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. +

    +

    An “entity transaction” is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. +

    +

    You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. +

    +
  12. Patents. + +

    A “contributor” is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's “contributor version”. +

    +

    A contributor's “essential patent claims” are all patent claims owned +or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, “control” includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. +

    +

    Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. +

    +

    In the following three paragraphs, a “patent license” is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To “grant” such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. +

    +

    If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. “Knowingly relying” means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. +

    +

    If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. +

    +

    A patent license is “discriminatory” if it does not include within the +scope of its coverage, prohibits the exercise of, or is conditioned on +the non-exercise of one or more of the rights that are specifically +granted under this License. You may not convey a covered work if you +are a party to an arrangement with a third party that is in the +business of distributing software, under which you make payment to the +third party based on the extent of your activity of conveying the +work, and under which the third party grants, to any of the parties +who would receive the covered work from you, a discriminatory patent +license (a) in connection with copies of the covered work conveyed by +you (or copies made from those copies), or (b) primarily for and in +connection with specific products or compilations that contain the +covered work, unless you entered into that arrangement, or that patent +license was granted, prior to 28 March 2007. +

    +

    Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. +

    +
  13. No Surrender of Others' Freedom. + +

    If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey +a covered work so as to satisfy simultaneously your obligations under +this License and any other pertinent obligations, then as a +consequence you may not convey it at all. For example, if you agree +to terms that obligate you to collect a royalty for further conveying +from those to whom you convey the Program, the only way you could +satisfy both those terms and this License would be to refrain entirely +from conveying the Program. +

    +
  14. Use with the GNU Affero General Public License. + +

    Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. +

    +
  15. Revised Versions of this License. + +

    The Free Software Foundation may publish revised and/or new versions +of the GNU General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. +

    +

    Each version is given a distinguishing version number. If the Program +specifies that a certain numbered version of the GNU General Public +License “or any later version” applies to it, you have the option of +following the terms and conditions either of that numbered version or +of any later version published by the Free Software Foundation. If +the Program does not specify a version number of the GNU General +Public License, you may choose any version ever published by the Free +Software Foundation. +

    +

    If the Program specifies that a proxy can decide which future versions +of the GNU General Public License can be used, that proxy's public +statement of acceptance of a version permanently authorizes you to +choose that version for the Program. +

    +

    Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. +

    +
  16. Disclaimer of Warranty. + +

    THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT +WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND +PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE +DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR +CORRECTION. +

    +
  17. Limitation of Liability. + +

    IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR +CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT +NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR +LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM +TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER +PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +

    +
  18. Interpretation of Sections 15 and 16. + +

    If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. +

    +
+ + +

END OF TERMS AND CONDITIONS

+ + +

How to Apply These Terms to Your New Programs

+ +

If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. +

+

To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the “copyright” line and a pointer to where the full notice is found. +

+
 
one line to give the program's name and a brief idea of what it does.
+Copyright (C) year name of author
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
+
+This program is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see https://www.gnu.org/licenses/.
+
+ +

Also add information on how to contact you by electronic and paper mail. +

+

If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: +

+
 
program Copyright (C) year name of author
+This program comes with ABSOLUTELY NO WARRANTY; for details type ‘show w’.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type ‘show c’ for details.
+
+ +

The hypothetical commands ‘show w’ and ‘show c’ should show +the appropriate parts of the General Public License. Of course, your +program's commands might be different; for a GUI interface, you would +use an “about box”. +

+

You should also get your employer (if you work as a programmer) or school, +if any, to sign a “copyright disclaimer” for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +https://www.gnu.org/licenses/. +

+

The GNU General Public License does not permit incorporating your +program into proprietary programs. If your program is a subroutine +library, you may consider it more useful to permit linking proprietary +applications with the library. If this is what you want to do, use +the GNU Lesser General Public License instead of this License. But +first, please read https://www.gnu.org/licenses/why-not-lgpl.html. + +

+ + +

A.2 GNU Free Documentation License

+

Version 1.3, 3 November 2008 +

+ +
 
Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+https://fsf.org/
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+ +
    +
  1. +PREAMBLE + +

    The purpose of this License is to make a manual, textbook, or other +functional and useful document free in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. +

    +

    This License is a kind of “copyleft”, which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. +

    +

    We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. +

    +
  2. +APPLICABILITY AND DEFINITIONS + +

    This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The “Document”, below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as “you”. You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. +

    +

    A “Modified Version” of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. +

    +

    A “Secondary Section” is a named appendix or a front-matter section +of the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. +

    +

    The “Invariant Sections” are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. +

    +

    The “Cover Texts” are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. +

    +

    A “Transparent” copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not “Transparent” is called “Opaque”. +

    +

    Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input +format, SGML or XML using a publicly available +DTD, and standard-conforming simple HTML, +PostScript or PDF designed for human modification. Examples +of transparent image formats include PNG, XCF and +JPG. Opaque formats include proprietary formats that can be +read and edited only by proprietary word processors, SGML or +XML for which the DTD and/or processing tools are +not generally available, and the machine-generated HTML, +PostScript or PDF produced by some word processors for +output purposes only. +

    +

    The “Title Page” means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, “Title Page” means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. +

    +

    The “publisher” means any person or entity that distributes copies +of the Document to the public. +

    +

    A section “Entitled XYZ” means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as “Acknowledgements”, +“Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” +of such a section when you modify the Document means that it remains a +section “Entitled XYZ” according to this definition. +

    +

    The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. +

    +
  3. +VERBATIM COPYING + +

    You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. +

    +

    You may also lend copies, under the same conditions stated above, and +you may publicly display copies. +

    +
  4. +COPYING IN QUANTITY + +

    If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. +

    +

    If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. +

    +

    If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. +

    +

    It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. +

    +
  5. +MODIFICATIONS + +

    You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: +

    +
      +
    1. +Use in the Title Page (and on the covers, if any) a title distinct +from that of the Document, and from those of previous versions +(which should, if there were any, be listed in the History section +of the Document). You may use the same title as a previous version +if the original publisher of that version gives permission. + +
    2. +List on the Title Page, as authors, one or more persons or entities +responsible for authorship of the modifications in the Modified +Version, together with at least five of the principal authors of the +Document (all of its principal authors, if it has fewer than five), +unless they release you from this requirement. + +
    3. +State on the Title page the name of the publisher of the +Modified Version, as the publisher. + +
    4. +Preserve all the copyright notices of the Document. + +
    5. +Add an appropriate copyright notice for your modifications +adjacent to the other copyright notices. + +
    6. +Include, immediately after the copyright notices, a license notice +giving the public permission to use the Modified Version under the +terms of this License, in the form shown in the Addendum below. + +
    7. +Preserve in that license notice the full lists of Invariant Sections +and required Cover Texts given in the Document's license notice. + +
    8. +Include an unaltered copy of this License. + +
    9. +Preserve the section Entitled “History”, Preserve its Title, and add +to it an item stating at least the title, year, new authors, and +publisher of the Modified Version as given on the Title Page. If +there is no section Entitled “History” in the Document, create one +stating the title, year, authors, and publisher of the Document as +given on its Title Page, then add an item describing the Modified +Version as stated in the previous sentence. + +
    10. +Preserve the network location, if any, given in the Document for +public access to a Transparent copy of the Document, and likewise +the network locations given in the Document for previous versions +it was based on. These may be placed in the “History” section. +You may omit a network location for a work that was published at +least four years before the Document itself, or if the original +publisher of the version it refers to gives permission. + +
    11. +For any section Entitled “Acknowledgements” or “Dedications”, Preserve +the Title of the section, and preserve in the section all the +substance and tone of each of the contributor acknowledgements and/or +dedications given therein. + +
    12. +Preserve all the Invariant Sections of the Document, +unaltered in their text and in their titles. Section numbers +or the equivalent are not considered part of the section titles. + +
    13. +Delete any section Entitled “Endorsements”. Such a section +may not be included in the Modified Version. + +
    14. +Do not retitle any existing section to be Entitled “Endorsements” or +to conflict in title with any Invariant Section. + +
    15. +Preserve any Warranty Disclaimers. +
    + +

    If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. +

    +

    You may add a section Entitled “Endorsements”, provided it contains +nothing but endorsements of your Modified Version by various +parties—for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. +

    +

    You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. +

    +

    The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. +

    +
  6. +COMBINING DOCUMENTS + +

    You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. +

    +

    The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. +

    +

    In the combination, you must combine any sections Entitled “History” +in the various original documents, forming one section Entitled +“History”; likewise combine any sections Entitled “Acknowledgements”, +and any sections Entitled “Dedications”. You must delete all +sections Entitled “Endorsements.” +

    +
  7. +COLLECTIONS OF DOCUMENTS + +

    You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. +

    +

    You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. +

    +
  8. +AGGREGATION WITH INDEPENDENT WORKS + +

    A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an “aggregate” if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. +

    +

    If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. +

    +
  9. +TRANSLATION + +

    Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. +

    +

    If a section in the Document is Entitled “Acknowledgements”, +“Dedications”, or “History”, the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. +

    +
  10. +TERMINATION + +

    You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. +

    +

    However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. +

    +

    Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. +

    +

    Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. +

    +
  11. +FUTURE REVISIONS OF THIS LICENSE + +

    The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +https://www.gnu.org/licenses/. +

    +

    Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License “or any later version” applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy's public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. +

    +
  12. +RELICENSING + +

    “Massive Multiauthor Collaboration Site” (or “MMC Site”) means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +“Massive Multiauthor Collaboration” (or “MMC”) contained in the +site means any set of copyrightable works thus published on the MMC +site. +

    +

    “CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. +

    +

    “Incorporate” means to publish or republish a Document, in whole or +in part, as part of another Document. +

    +

    An MMC is “eligible for relicensing” if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole +or in part into the MMC, (1) had no cover texts or invariant sections, +and (2) were thus incorporated prior to November 1, 2008. +

    +

    The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. +

    +
+ + + +

ADDENDUM: How to use this License for your documents

+ +

To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: +

+
 
  Copyright (C)  year  your name.
+  Permission is granted to copy, distribute and/or modify this document
+  under the terms of the GNU Free Documentation License, Version 1.3
+  or any later version published by the Free Software Foundation;
+  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+  Texts.  A copy of the license is included in the section entitled ``GNU
+  Free Documentation License''.
+
+ +

If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the “with…Texts.” line with this: +

+
 
    with the Invariant Sections being list their titles, with
+    the Front-Cover Texts being list, and with the Back-Cover Texts
+    being list.
+
+ +

If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. +

+

If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. +

+ + + + + + + + + + + + + + +
[ << ][ >> ]           [Top][Contents][Index][ ? ]
+

+ + This document was generated by Bruno Haible on June, 4 2025 using texi2html 1.78a. + +
+ +

+ + diff --git a/miniconda3/share/doc/libtextstyle/libtextstyle_5.html b/miniconda3/share/doc/libtextstyle/libtextstyle_5.html new file mode 100644 index 0000000000000000000000000000000000000000..4b93cae4e97c012e4b7715b05b72223ac157819b --- /dev/null +++ b/miniconda3/share/doc/libtextstyle/libtextstyle_5.html @@ -0,0 +1,222 @@ + + + + + +GNU libtextstyle: Function Index + + + + + + + + + + + + + + + + + + + + + + + + + + +
[ << ][ >> ]           [Top][Contents][Index][ ? ]
+ +
+ + +

Function Index

+ +
Jump to:   F +   +H +   +I +   +M +   +N +   +O +   +P +   +S +   +T +   +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Index Entry Section

F
fd_ostream_create3.5.3.2 The fd_ostream class
fd_ostream_get_descriptor3.5.5 Accessor functions
fd_ostream_get_filename3.5.5 Accessor functions
fd_ostream_is_buffered3.5.5 Accessor functions
file_ostream_create3.5.3.1 The file_ostream class
file_ostream_get_stdio_stream3.5.5 Accessor functions

H
handle_color_option3.4 Command-line options
handle_style_option3.4 Command-line options
html_ostream_begin_span3.5.3.4 The html_ostream class
html_ostream_create3.5.3.4 The html_ostream class
html_ostream_end_span3.5.3.4 The html_ostream class
html_ostream_flush_to_current_style3.5.3.4 The html_ostream class
html_ostream_get_destination3.5.5 Accessor functions
html_ostream_get_hyperlink_ref3.5.3.4 The html_ostream class
html_ostream_set_hyperlink_ref3.5.3.4 The html_ostream class
html_styled_ostream_create3.5.4.2 The html_styled_ostream class
html_styled_ostream_get_css_filename3.5.5 Accessor functions
html_styled_ostream_get_destination3.5.5 Accessor functions
html_styled_ostream_get_html_destination3.5.5 Accessor functions

I
iconv_ostream_create3.5.3.6 The iconv_ostream class
iconv_ostream_get_destination3.5.5 Accessor functions
iconv_ostream_get_from_encoding3.5.5 Accessor functions
iconv_ostream_get_to_encoding3.5.5 Accessor functions
is_instance_of_fd_ostream3.5 The output stream hierarchy
is_instance_of_file_ostream3.5 The output stream hierarchy
is_instance_of_html_ostream3.5 The output stream hierarchy
is_instance_of_html_styled_ostream3.5 The output stream hierarchy
is_instance_of_iconv_ostream3.5 The output stream hierarchy
is_instance_of_memory_ostream3.5 The output stream hierarchy
is_instance_of_noop_styled_ostream3.5 The output stream hierarchy
is_instance_of_styled_ostream3.5 The output stream hierarchy
is_instance_of_term_ostream3.5 The output stream hierarchy
is_instance_of_term_styled_ostream3.5 The output stream hierarchy

M
memory_ostream_contents3.5.3.5 The memory_ostream class
memory_ostream_create3.5.3.5 The memory_ostream class

N
noop_styled_ostream_create3.5.4.3 The noop_styled_ostream class
noop_styled_ostream_get_destination3.5.5 Accessor functions
noop_styled_ostream_is_owning_destination3.5.5 Accessor functions

O
ostream_flush3.5.1 The abstract ostream class
ostream_free3.5.1 The abstract ostream class
ostream_printf3.5.1 The abstract ostream class
ostream_vprintf3.5.1 The abstract ostream class
ostream_write_mem3.5.1 The abstract ostream class
ostream_write_str3.5.1 The abstract ostream class

P
print_color_test3.4 Command-line options

S
style_file_prepare3.4 Command-line options
styled_ostream_begin_use_class3.5.2 The abstract styled_ostream class
styled_ostream_create3.5.4.1 The term_styled_ostream class
styled_ostream_end_use_class3.5.2 The abstract styled_ostream class
styled_ostream_flush_to_current_style3.5.2 The abstract styled_ostream class
styled_ostream_get_hyperlink_id3.5.2 The abstract styled_ostream class
styled_ostream_get_hyperlink_ref3.5.2 The abstract styled_ostream class
styled_ostream_set_hyperlink3.5.2 The abstract styled_ostream class

T
term_ostream_create3.5.3.3 The term_ostream class
term_ostream_flush_to_current_style3.5.3.3 The term_ostream class
term_ostream_get_bgcolor3.5.3.3 The term_ostream class
term_ostream_get_color3.5.3.3 The term_ostream class
term_ostream_get_descriptor3.5.5 Accessor functions
term_ostream_get_effective_tty_control3.5.5 Accessor functions
term_ostream_get_filename3.5.5 Accessor functions
term_ostream_get_hyperlink_id3.5.3.3 The term_ostream class
term_ostream_get_hyperlink_ref3.5.3.3 The term_ostream class
term_ostream_get_posture3.5.3.3 The term_ostream class
term_ostream_get_tty_control3.5.5 Accessor functions
term_ostream_get_underline3.5.3.3 The term_ostream class
term_ostream_get_weight3.5.3.3 The term_ostream class
term_ostream_rgb_to_color3.5.3.3 The term_ostream class
term_ostream_set_bgcolor3.5.3.3 The term_ostream class
term_ostream_set_color3.5.3.3 The term_ostream class
term_ostream_set_hyperlink3.5.3.3 The term_ostream class
term_ostream_set_posture3.5.3.3 The term_ostream class
term_ostream_set_underline3.5.3.3 The term_ostream class
term_ostream_set_weight3.5.3.3 The term_ostream class
term_styled_ostream_create3.5.4.1 The term_styled_ostream class
term_styled_ostream_get_css_filename3.5.5 Accessor functions
term_styled_ostream_get_destination3.5.5 Accessor functions

+
Jump to:   F +   +H +   +I +   +M +   +N +   +O +   +P +   +S +   +T +   +
+ + + + + + + + + + + + + + +
[ << ][ >> ]           [Top][Contents][Index][ ? ]
+

+ + This document was generated by Bruno Haible on June, 4 2025 using texi2html 1.78a. + +
+ +

+ + diff --git a/miniconda3/share/doc/libtextstyle/libtextstyle_6.html b/miniconda3/share/doc/libtextstyle/libtextstyle_6.html new file mode 100644 index 0000000000000000000000000000000000000000..570a901a4e067eaccc1c1d153d173b5c9e717880 --- /dev/null +++ b/miniconda3/share/doc/libtextstyle/libtextstyle_6.html @@ -0,0 +1,122 @@ + + + + + +GNU libtextstyle: Variable Index + + + + + + + + + + + + + + + + + + + + + + + + + + +
[ << ][ >> ]           [Top][Contents][Index][ ? ]
+ +
+ + +

Variable Index

+ +
Jump to:   C +   +N +   +S +   +T +   +
+ + + + + + + + + + + + + + + + + +
Index Entry Section

C
color_mode3.4 Command-line options
color_test_mode3.4 Command-line options

N
NO_COLOR, environment variable2.2 The environment variable NO_COLOR
NO_TERM_HYPERLINKS, environment variable2.3 The environment variable NO_TERM_HYPERLINKS

S
style_file_name3.4 Command-line options

T
TERM, environment variable2.1 The environment variable TERM

+
Jump to:   C +   +N +   +S +   +T +   +
+ + + + + + + + + + + + + + +
[ << ][ >> ]           [Top][Contents][Index][ ? ]
+

+ + This document was generated by Bruno Haible on June, 4 2025 using texi2html 1.78a. + +
+ +

+ + diff --git a/miniconda3/share/doc/libtextstyle/libtextstyle_7.html b/miniconda3/share/doc/libtextstyle/libtextstyle_7.html new file mode 100644 index 0000000000000000000000000000000000000000..36dbc1aff8214d64869030a88d897b34a7fe6008 --- /dev/null +++ b/miniconda3/share/doc/libtextstyle/libtextstyle_7.html @@ -0,0 +1,147 @@ + + + + + +GNU libtextstyle: General Index + + + + + + + + + + + + + + + + + + + + + + + + + + +
[ << ][ >> ]           [Top][Contents][Index][ ? ]
+ +
+ + +

General Index

+ +
Jump to:   - +   +< +   +
+D +   +F +   +G +   +I +   +L +   +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Index Entry Section

-
--color option2.5 The --color option
--style option2.6 The --style option

<
<textstyle.h>3.2 Include files

D
Debugging2.6.2 Debugging style files
Debugging3.6 Debugging the text styling support

F
FDL, GNU Free Documentation LicenseA.2 GNU Free Documentation License

G
GPL, GNU General Public LicenseA.1 GNU GENERAL PUBLIC LICENSE

I
Include file3.2 Include files

L
License, GNU FDLA.2 GNU Free Documentation License
License, GNU GPLA.1 GNU GENERAL PUBLIC LICENSE
LicensesA. Licenses

+
Jump to:   - +   +< +   +
+D +   +F +   +G +   +I +   +L +   +
+ + + + + + + + + + + + + + +
[ << ][ >> ]           [Top][Contents][Index][ ? ]
+

+ + This document was generated by Bruno Haible on June, 4 2025 using texi2html 1.78a. + +
+ +

+ + diff --git a/miniconda3/share/doc/libtextstyle/libtextstyle_abt.html b/miniconda3/share/doc/libtextstyle/libtextstyle_abt.html new file mode 100644 index 0000000000000000000000000000000000000000..dd680b994250d8cc2232f7aa88b84c9ad0705cd6 --- /dev/null +++ b/miniconda3/share/doc/libtextstyle/libtextstyle_abt.html @@ -0,0 +1,167 @@ + + + + + +GNU libtextstyle: About This Document + + + + + + + + + + + + + + + + + + + + +
[Top][Contents][Index][ ? ]
+

About This Document

+

+ This document was generated by Bruno Haible on June, 4 2025 using texi2html 1.78a. +

+

+ The buttons in the navigation panels have the following meaning: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Button Name Go to From 1.2.3 go to
[ < ] BackPrevious section in reading order1.2.2
[ > ] ForwardNext section in reading order1.2.4
[ << ] FastBackBeginning of this chapter or previous chapter1
[ Up ] UpUp section1.2
[ >> ] FastForwardNext chapter2
[Top] TopCover (top) of document  
[Contents] ContentsTable of contents  
[Index] IndexIndex  
[ ? ] AboutAbout (help)  
+ +

+ where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure: +

+ +
    +
  • 1. Section One +
      +
    • 1.1 Subsection One-One +
        +
      • ...
      • +
      +
    • +
    • 1.2 Subsection One-Two +
        +
      • 1.2.1 Subsubsection One-Two-One
      • +
      • 1.2.2 Subsubsection One-Two-Two
      • +
      • 1.2.3 Subsubsection One-Two-Three     + <== Current Position
      • +
      • 1.2.4 Subsubsection One-Two-Four
      • +
      +
    • +
    • 1.3 Subsection One-Three +
        +
      • ...
      • +
      +
    • +
    • 1.4 Subsection One-Four
    • +
    +
  • +
+ +
+ + + + + +
[Top][Contents][Index][ ? ]
+

+ + This document was generated by Bruno Haible on June, 4 2025 using texi2html 1.78a. + +
+ +

+ + diff --git a/miniconda3/share/doc/libtextstyle/libtextstyle_toc.html b/miniconda3/share/doc/libtextstyle/libtextstyle_toc.html new file mode 100644 index 0000000000000000000000000000000000000000..ac441887396917a0a8a5dc506ec6240a5d73e943 --- /dev/null +++ b/miniconda3/share/doc/libtextstyle/libtextstyle_toc.html @@ -0,0 +1,146 @@ + + + + + +GNU libtextstyle: GNU libtextstyle + + + + + + + + + + + + + + + + + + + +
[Top][Contents][Index][ ? ]
+

GNU libtextstyle

+ +

Table of Contents

+ + + + + +

This manual documents the GNU libtextstyle library, version +0.25. +

+ + +
+ + + + + +
[Top][Contents][Index][ ? ]
+

+ + This document was generated by Bruno Haible on June, 4 2025 using texi2html 1.78a. + +
+ +

+ + diff --git a/miniconda3/share/doc/pcre2/AUTHORS.md b/miniconda3/share/doc/pcre2/AUTHORS.md new file mode 100644 index 0000000000000000000000000000000000000000..708fc2325ce8b3ef9eb9dccc51d05b00668f578a --- /dev/null +++ b/miniconda3/share/doc/pcre2/AUTHORS.md @@ -0,0 +1,200 @@ +PCRE2 Authorship and Contributors +================================= + +COPYRIGHT +--------- + +Please see the file [LICENCE](./LICENCE.md) in the PCRE2 distribution for +copyright details. + + +MAINTAINERS +----------- + +The PCRE and PCRE2 libraries were authored and maintained by Philip Hazel. + +Since 2024, the contributors with administrator access to the project are now +Nicholas Wilson and Zoltán Herczeg. See the file [SECURITY](./SECURITY.md) for +GPG keys. + +Both administrators are volunteers acting in a personal capacity. + + + + + + + + + + + + + + + + + + +
NameRole
+ + Nicholas Wilson
+ `nicholas@nicholaswilson.me.uk`
+ Currently of Microsoft Research Cambridge, UK + +
+ + * General project administration & maintenance + * Release management + * Code maintenance + +
+ + Zoltán Herczeg
+ `hzmester@freemail.hu`
+ Currently of the University of Szeged, Hungary + +
+ + * Code maintenance + * Ownership of `sljit` and PCRE2's JIT + +
+ + +CONTRIBUTORS +------------ + +Many others have participated and contributed to PCRE2 over its history. + +The maintainers are grateful for all contributions and participation over the +years. We apologise for any names we have forgotten. + +We are especially grateful to Philip Hazel, creator of PCRE and PCRE2, and +maintainer from 1997 to 2024. + +All names listed alphabetically. + +### Contributors to PCRE2 + +This list includes names up until the PCRE2 10.44 release. New names will be +added from the Git history on each release. + + Scott Bell + Carlo Marcelo Arenas Belón + Edward Betts + Jan-Willem Blokland + Ross Burton + Dmitry Cherniachenko + Alexey Chupahin + Jessica Clarke + Alejandro Colomar + Jeremie Courreges-Anglas + Addison Crump + Alex Dowad + Daniel Engberg + Daniel Richard G + David Gaussmann + Andrey Gorbachev + Jordan Griege + Jason Hood + Bumsu Hyeon + Roy Ivy + Martin Joerg + Guillem Jover + Ralf Junker + Ayesh Karunaratne + Michael Kaufmann + Yunho Kim + Joshua Kinard + David Korczynski + Uwe Korn + Jonas Kvinge + Kristian Larsson + Kai Lu + Behzod Mansurov + B. Scott Michel + Nathan Moinvaziri + Mike Munday + Marc Mutz + Fabio Pagani + Christian Persch + Tristan Ross + William A Rowe Jr + David Seifert + Yaakov Selkowitz + Rich Siegel + Karl Skomski + Maciej Sroczyński + Wolfgang Stöggl + Thomas Tempelmann + Greg Thain + Lucas Trzesniewski + Theodore Tsirpanis + Matthew Vernon + Rémi Verschelde + Thomas Voss + Ezekiel Warren + Carl Weaver + Chris Wilson + Amin Yahyaabadi + Joe Zhang + +### Contributors to PCRE1 + +These people contributed either by sending patches or reporting serious issues. + + Irfan Adilovic + Alexander Barkov + Daniel Bergström + David Burgess + Ross Burton + David Byron + Fred Cox + Christian Ehrlicher + Tom Fortmann + Lionel Fourquaux + Mike Frysinger + Daniel Richard G + Dair Gran + "Graycode" (Red Hat Product Security) + Viktor Griph + Wen Guanxing + Robin Houston + Martin Jerabek + Peter Kankowski + Stephen Kelly + Yunho Kim + Joshua Kinard + Carsten Klein + Evgeny Kotkov + Ronald Landheer-Cieslak + Alan Lehotsky + Dmitry V. Levin + Nuno Lopes + Kai Lu + Giuseppe Maxia + Dan Mooney + Marc Mutz + Markus Oberhumer + Sheri Pierce + Petr Pisar + Ari Pollak + Bob Rossi + Ruiger Rill + Michael Shigorin + Rich Siegel + Craig Silverstein (C++ wrapper) + Karl Skomski + Paul Sokolovsky + Stan Switzer + Ian Taylor + Mark Tetrode + Jeff Trawick + Steven Van Ingelgem + Lawrence Velazquez + Jiong Wang + Stefan Weber + Chris Wilson + +Thanks go to Jeffrey Friedl for testing and debugging assistance. diff --git a/miniconda3/share/doc/pcre2/COPYING b/miniconda3/share/doc/pcre2/COPYING new file mode 100644 index 0000000000000000000000000000000000000000..c233950f6f1766b1b1023373dcbee51dbc9a8669 --- /dev/null +++ b/miniconda3/share/doc/pcre2/COPYING @@ -0,0 +1,5 @@ +PCRE2 LICENCE + +Please see the file LICENCE in the PCRE2 distribution for licensing details. + +End diff --git a/miniconda3/share/doc/pcre2/ChangeLog b/miniconda3/share/doc/pcre2/ChangeLog new file mode 100644 index 0000000000000000000000000000000000000000..766313dee645d9d6488d14154766d031ec036f57 --- /dev/null +++ b/miniconda3/share/doc/pcre2/ChangeLog @@ -0,0 +1,3301 @@ +Change Log for PCRE2 +-------------------- + +Before the move to GitHub, this was the only record of changes to PCRE2. Now +there is also the log of commit messages. + +Internal changes which are not visible to clients of the library are mostly not +listed here. + +Version 10.46 27-August-2025 +---------------------------- + +1. (#771) (CVE-2025-58050) Security fix to prevent a read-past-the-end memory +error, of arbitrary length. An attacker-controlled regex pattern is required, +and it cannot be triggered by providing crafted subject (match) text. The +(*ACCEPT) and (*scs:) pattern features must be used together. + +Release 10.44 and earlier are not affected. + +This could have implications of denial-of-service or information disclosure, +and could potentially be used to escalate other vulnerabilities in a system +(such as information disclosure being used to escalate the severity of an +unrelated bug in another system). + + +Version 10.45 05-February-2025 +------------------------------ + +1. (#418) Change 6 of 10.44 broke 32-bit tests because pcre2test's reporting of +memory size was changed to the entire compiled data block, instead of just the +pattern and tables data, so as to align with the new length restriction. +Because the block's header contains pointers, this meant the pcre2test output +was different in 32-bit mode. A patch by Carlo reverts to the previous state +and makes sure that any limit set by pcre2_set_max_pattern_compiled_length() +also avoids the internal struct overhead. + +2. (#416, #622) Updates to build.zig. + +3. (#427, et al.) Various fixes to pacify static analyzers. + +4. (#428) Add --posix-pattern-file to pcre2grep to allow processing of empty +patterns through the -f option, as well as patterns that end in space +characters, for compatibility with other grep tools. + +5. (4fa5b8bd) Fix a bug in the fuzz support quantifier-limiting code. It ignores +strings of more than 5 digits because they are necessarily numbers greater than +65535, the largest legal quantifier. However, it wasn't ignoring non-significant +leading zeros. + +6. (6d82f0cd) The case-independent processing of the letter-matching Unicode +properties Ll, Lt, and Lu have been changed to match Perl (which changed a while +ago). When caseless matching is in force, all three of these properties are now +treated as Lc (cased letter). + +7. (#433) The pcre2_jit_compile() function was updated by the addition of a new +option PCRE2_JIT_TEST_ALLOC which, if called with a NULL first argument, tests +not only the availability of JIT, but also its ability to allocate executable +memory. Update pcre2test to use this support to extend the -C option. + +8. (75b1025a) The code for parsing Unicode property descriptions for \p and \P +been changed as follows: + + . White space etc. before ^ in a negated value such as \p{ ^L } was not being + ignored. + + . The code wouldn't have worked if PCRE2 was compiled for UTF-8 support + within an EBCDIC environment. Possibly nobody does this any more, but it + should now work. + + . The documentation of the syntax of what can follow \p and \P has been + updated. + +9. (1c24ba01) There was an error in the table of lengths for parsed items for +the OPTIONS item, but fortuitously it could never have actually bitten. While +fixing this, some other code that could never be obeyed was discovered and +removed. + +10. (674b6640) Removed some incorect optimization code from DFA matching that +has been there since PCRE1, but has just been found to cause a no match return +instead of a partial match in some cases. It involves partial matching when (*F) +is present so is unlikely to have actually affected anyone. + +11. (b0f4ac17) Tidy the wording and formatting of some pcre2test error messages +concerned with bad modifiers. Also restrict single-letter modifier sequences to +the first item in a modifier list, as documented and always intended. + +12. (1415565c) An iterator at the end of many assertions can always be +auto-possessified, but not at the end of variable-length lookbehinds. There was +a bug in the code that checks for such a lookbehind; it was looking only at the +first branch, which is wrong because some branches can be fixed length when +others are not, for example (?<=AB|CD?). Now all branches are checked for +variability. + +13. (ead08288) Matching with pcre2_match() could give an incorrect result if a +variable-length lookbehind was used as the condition in a conditional group. +The condition could erroneously be treated as true if a branch matched but +overran the current position. This bug was in the interpreter only; matching +with JIT was correct. + +14. (#443) Split out the sljit sub-project into a "Git submodule". Git users +must now run `git submodule init; git submodule update` after a Git checkout, or +the build will fail due to missing files in deps/sljit. + +15. (#441) Add a new error code (PCRE2_ERROR_JIT_UNSUPPORTED) which is yielded +for unsupported jit features. + +16. (#444) Fix bug in 'first code unit' and 'last code unit' optimization +combined with lookahead assertions. + +17. (#445, #447, #449, #451, #452, #459, #563) Add a new feature called scan +substring. This feature is a new type of assertion which matches the content of +a capturing block to a sub-pattern. + +18. (#450) Improvements to 'first code unit' / 'starting code units' +optimisation. + +19. (#455) Many, many improvements to the JIT compiler. + +20. Item 43 of 10.43 was incomplete because it addressed only \z and not \Z, +which was still misbehaving when matching fragments inside invalid UTF strings. + +21. (d29e7290) Octal escapes of the form \045 or \111 were not being recognized +in substitution strings, and if encountered gave an error, though the \o{...} +form was recognized. This bug is now fixed. + +22. (#463, #487) Fix 1 byte out-of-bounds read when parsing malformed limits +(e.g. LIMIT_HEAP) + +23. Many improvements to test infrastructure. Many more platforms and +configurations are now run in Continuous Integration, and all the platforms now +run the full test suite, rather than a partial subset. + +24. (#475) Implement title casing in substitution strings using Perl syntax. + +25. (#478, #504) Disallow \x if not followed by { or a hex digit. + +26. (#473) Implements Python-style backrefs in substitutions. + +27. (#472) Fix error reporting for certain over-large octal escapes. + +28. (#482) Fix parsing of named captures in replacement strings, allowing +non-ASCII capture names to be used. + +29. (#477, #474, #488, #494, #496, #506, #508, #511, #518, #524, #540) Many +improvements to parsing and optimising of character classes. + +30. (#483, #498) Add support for \g and $ to replacement strings. + +31. (#470) Add option flags PCRE2_EXTRA_NO_BS0 and PCRE2_EXTRA_PYTHON_OCTAL. + +32. (#471) Add new API function pcre2_set_optimize() for controlling which +optimizations are enabled. + +33. (#491) Adds $& $` $' and $_ to substitution replacements, as well as +interpreting \b and \v as characters. + +34. (#499) Add option PCRE2_EXTRA_NEVER_CALLOUT to disable callouts. + +35. (#503, #513) Update Unicode support to UCD 16. + +36. (#512, #618, #638) Add new function pcre2_set_substitute_case_callout() to +allow clients to provide a custom callback with locale-aware case +transformation. + +37. (#516) Fix case-insensitive matching of backreferences when using the +PCRE2_EXTRA_CASELESS_RESTRICT option. + +38. (#519) In pcre2grep, add $& as an alias for $0 + +39. (c9bf8339, #534) Updated perltest.sh to enable locale setting. + +40. (#521) Add support for Turkish I casefolding, using new options +PCRE2_EXTRA_TURKISH_CASING, and added pre-pattern flags (*TURKISH_CASING) and +(*CASELESS_RESTRICT). + +41. (#523, #546, #547) Add support for UTS#18 compatible character classes, +using the new option PCRE2_ALT_EXTENDED_CLASS. This adds '[' as a metacharacter +within character classes and the operators '&&', '--' and '~~', allowing +subtractions and intersections of character classes to be easily expressed. + +42. (#553, #586, #596, #597) Add support for Perl-style extended character +classes, using the syntax (?[...]). This also allows expressing subtractions and +intersections of character classes, but using a different syntax to UTS#18. + +43. (#554) Fixed a bug in JIT affecting greedy bounded repeats. The upper limit +of repeats inside a repeated bracket might be incorrectly checked. + +44. (#556) Fixed a bug in JIT affecting caseful matching of backreferences. When +utf is disabled, and dupnames is enabled, caseless matching was used even +if caseful matching was needed. + +45. (f34fc0a3) Fixed a bug in pcre2grep reported by Alejandro Colomar + (GitHub issue #577). In certain cases, when lines of above and +below context were contiguous, a separator line was incorrectly being inserted. + +46. (#594) Fix a small (one/two byte) out-of-bounds read on invalid UTF-8 input +in pcre2grep. + +47. (#370) Fix the INSTALL_MSVC_PDB CMake flag. + +48. (#366) Install cmake files in prefix/lib/cmake/pcre2 rather than +prefix/cmake. The new CMake flag PCRE2_INSTALL_CMAKEDIR allows customising this +location. + +49. (#624, #626, #628, #632, #639, #641) Reduce code size of generated JIT code +for repeated character classes. + +50. (#623) Update the Bazel build files. + + +Version 10.44 07-June-2024 +-------------------------- + +1. If a pattern contained a variable-length lookbehind in which the first +branch was not the one with the shortest minimum length, and the lookbehind +contained a capturing group, and elsewhere in the pattern there was another +lookbehind that referenced that group, the pattern was incorrectly compiled, +leading to unpredictable results, including crashes in JIT compiling. An +example pattern is: /(((?<=123?456456|ABC)))(?<=\2)/ + +2. Further updates to the oss-fuzz support: + + (a) Limit quantifiers for groups and classes to be no more than 10. This + avoids very long JIT compile times that happen in some cases when groups + are replicated for quantification, and very long match times when + classes contain a lot of non-ascii characters. + + (b) Added PCRE2_EXTENDED_MORE to the list of allowed options. + + (c) Arranged for text error messages to be shown in 16-bit and 32-bit modes. + + (d) Made the output in standalone mode more readable. + + (e) General code tidies. + + (f) Limit the size of compiled patterns to 10MB (see 6 below). + + (g) Do not run JIT on patterns whose compiled length is greater than 200K + bytes because this takes a long time, causing oss-fuzz to time out. + + (h) Avoid compiling or matching twice with the same options (this could + happen if the input didn't set any options). + +3. Increase the maximum length of a name for a group from 32 to 128 because +there is a user for whom 32 is too small. + +4. Cause pcre2test to output a message when pcre2_jit_compile() gives an error +return if either jitverify or info is specified. + +5. Some auxiliary files for building under OpenVMS that were contributed by +Alexey Chupahin have been installed. + +6. Added pcre2_set_max_pattern_compiled_length() to limit the size of compiled +patterns. + +7. There was a bug in the implementation of \X caused by my (PH) misreading or +misunderstanding one of the grapheme sequence breaking rules in Unicode Annex +#29. A break should occur between two characters with the Extended Pictographic +break property unless a zero-width joiner intervenes. PCRE2 was not insisting +on the ZWJ, causing \X to match more than it should. See GitHub issue #410. + +8. Avoid compilation issues with proprietary compilers in UNIX since 10.43. + + +Version 10.43 16-February-2024 +------------------------------ + +1. The test program added by change 2 of 10.42 didn't work when the default +newline setting didn't include \n as a newline. One test needed (*LF) to ensure +that it worked. + +2. Added the new freestanding POSIX test program to the ManyConfigTests script +in the maint directory (overlooked in 2 below). Also improved the selection +facilities in that script, and added a test with JIT in a non-source directory, +fixing an oversight that would have made such a test fail before. + +3. Added pcre2_get_match_data_heapframes_size() and related pcre2test flags +to allow for finer control of the heap used when pcre2_match() without JIT is +used and the match_data might be reused. This began as PR #191, but has had +further refinement and documentation edits. + +4. Applied PR #181, which tidies some casts in pcre2_valid_utf.c. + +5. Applied PR #184, which avoids overflow issues with the heap limit +(introduced in 10.41/9). + +6. Applied PR #192, which changes the timing units for pcre2test from +milliseconds to microseconds. This is more useful for modern CPUs. + +7. Applied PR #193, which makes the requirement for C99 explicit in +configure.ac and CMakeLists.txt. + +8. Fixed a bug in pcre2test when a ridiculously large string repeat required a +stupid amount of memory. It now gives a clean realloc() failure error. + +9. Updates to restrict the interaction between ASCII and non-ASCII characters +for caseless matching and items like \d: + + (a) Added PCRE2_EXTRA_CASELESS_RESTRICT to lock out mixing of ASCII and + non-ASCII when matching caselessly. This is also /r in pcre2test and + (?r) within patterns. + + (b) Added PCRE2_EXTRA_ASCII_{BSD,BSS,BSW,POSIX} and corresponding (?aD) etc + in patterns and /a in pcre2test. + + (c) Corresponding updates to pcre2test. + +10. Unicode has been updated to 15.0.0. + +11. The Python scripts and ucptest.c in maint have been updated (a) a minor +change needed for 9(a) above; (b) fix bugs in ucptest, + +12. Integer overflow testing is now centralized in a new function. + +13. Made PCRE2_UCP the default in UTF mode in pcre2grep, and added new options +--case-restrict and --no-ucp. + +14. In the debugging printint module (which is normally only linked into +pcre2test), avoid the use of a variable called "not" because that's deprecated +in C and forbidden in C++. Also rewrite some code to avoid a goto into a block +that bypassed its initialization (though it didn't actually matter). + +15. More minor code adjustments to avoid using reserved C++ words as variable +names ("new" and "typename") and another jump that bypassed an (irrelevant) +initialization. + +16. Merged a pull request that removed pcre2_ucptables.c from the list of files +to compile in NON-AUTOTOOLS-BUILD because it is #included in pcre2_tables.c. +Also adjusted the BUILD.bazel and build.zig files, which had the same issue. At +the same time, fixed a typo in the Bazel file. + +17. Add PCRE2_EXTRA_ASCII_DIGIT to allow [:digit:] to be kept on sync with \d +even in UCP mode. + +18. Fix an invalid match of ascii word classes when invalid utf is enabled. + +19. Add a --posix-digit to pcre2grep for compatibility with GNU grep, and +other tools that prefer the POSIX compatible unicode definition for \d. + +20. Report the bit width of the library in use by pcre2test for usability. + +21. A pathological pattern conversion test could result in a string longer than +the available input buffer. Cause such a test to fail. + +22. Add a check that forces a compiler error if PCRE2_CODE_UNIT_WIDTH is not 8, +16, or 32 when compiling any of the library modules. + +23. Update pcre2_compile() to treat a NULL pattern with zero length as an empty +string. + +24. Add support for limited-length variable-length lookbehind assertions, with +default maximum length 255 characters (same as Perl) but with a function to +adjust the limit. + +25. Applied pull request #262, which updates the zig configuration, and #278 +which fixes a bug with out-of-source-tree CMake build testing. + +26. Add support for LoongArch to JIT. + +27. Fixed a bug in pcre2_match() in the code for handling the vector of +backtracking frames on the heap, which caused a heap overflow if *LIMIT_HEAP +restricted an attempt to extend to less than the frame size. Generally tidy up +the code for extending the heap frames vector. This fixes GitHub issue #275. + +28. Update pcre2_fuzzsupport.c to avoid clang sanitize complaint about shifting +left by 16 when there are non-zeros in the top 16 bits. + +29. Perl 5.34.0 changed the meaning of (for example) {,3} which did not used to +be treated as a quantifier. Now it is interpreted as {0,3} and PCRE2 has +changed to match. Note that {,} is still not a quantifier. + +30. Perl allows spaces and/or horizontal tabs after { or before } in all items +that use braces, and also before or after the comma in quantifiers. PCRE2 now +does the same, except for \u{...}, which is recognized only when +PCRE2_EXTRA_ALT_BSUX is set. This an ECMAScript, non-Perl compatible, +extension, so PCRE2 follows ECMAScript rather than Perl. + +31. Applied pull request #300 by Carlo, which fixes #261. The bug was that +pcre2_match() was not fully resetting all captures that had been set within a +(possibly recursive) subroutine call such as (?3). + +32. Changed the meaning of \w (and its synonyms) in UCP mode to match Perl. It +now matches characters whose general categories are L or N or whose particular +categories are Mn (non-spacing mark) or Pc (combining punctuation). The latter +includes underscore. + +33. Changed the meaning of [:xdigit:] in UCP mode to match Perl. It now also +matches the "fullwidth" versions of the hex digits. Just like it is done for +[:digit:], PCRE2_EXTRA_ASCII_DIGIT can be used to keep this class ASCII only +without affecting other POSIX classes. + +34. GitHub PR305 fixes a potential integer overflow in pcre2_dfa_match(). + +35. Updated handling of \b and \B in UCP mode to match the changes to \w in 32 +above because \b and \B are defined in terms of \w. + +36. Within a pattern (?aT) and (?-aT) set and reset the PCRE2_EXTRA_ASCII_DIGIT +option, and (?aP) also sets (?aT) so that (?-aP) disables all ASCII +restrictions on POSIX classes. + +37. If PCRE2_FIRSTLINE was set on an anchored pattern, pcre2_match() and +pcre2_dfa_match() misbehaved. PCRE2_FIRSTLINE is now ignored for anchored +patterns. + +38. Add a test for ridiculous ovector offset values to the substring extraction +functions. + +39. Make OP_REVERSE use IMM2_SIZE for its data instead of LINK_SIZE, for +consistency with OP_VREVERSE. + +40. In some legacy environments with a pre C99 snprintf, pcre2_regerror could +return an incorrect value when the provided buffer was too small. + +41. Applied pull request #342 which adds sanity checks for ctype functions and +locks out any accidental sign-extension. + +42. In the 32-bit library, in non-UTF mode, a quantifier that followed a +literal character with a value greater than or equal to 0x80000000u caused +undefined behaviour. + +43. \z was misbehaving when matching fragments inside invalid UTF strings. + +44. Implement --group-separator and --no-group-separator for pcre2grep. + +45. Fix \X matching in 32 bit mode without UTF in JIT. + +46. Fix backref iterators when PCRE2_MATCH_UNSET_BACKREF is set in JIT. + +47. Refactor the handling of whole-pattern recursion (?0) in pcre2_match() so +that its end is handled similarly to other recursions. This has altered the +behaviour of /|(?0)./endanchored which was previously not right. + +48. Improved the test for looping recursion by checking the last referenced +character as well as the current character. This allows some patterns that +previously triggered the check to run to completion instead of giving the loop +error. + +49. In 32-bit mode, the compiler looped for the pattern /[\x{ffffffff}]/ when +PCRE2_CASELESS and PCRE2_UCP (but not PCRE2_UTF) were set. Fixed by not trying +to look for other cases for characters above the Unicode range. + +50. In caseless 32-bit mode with UCP (but not UTF) set, the character +0xffffffff incorrectly matched any character that has more than one other case, +in particular k and s. + +51. Fix accept and endanchored interaction in JIT. + +52. Fix backreferences with unset backref and non-greedy iterators in JIT. + +53. Improve the logic that checks for a list of starting code units -- positive +lookahead assertions are now ignored if the immediately following item is one +that sets a mandatory starting character. For example, /a?(?=bc|)d/ used to set +all of a, b, and d as possible starting code units; now it sets only a and d. + +54. Fix incorrect class character matches in JIT. + +55. In pcre2test, ensure pcre2_jit_match() is used when jitfast is used with +substitution testing. + +56. Insert omitted setting of subject length in match data at the end of +pcre2_jit_match(). + +57. Implemented PCRE2_DISABLE_RECURSELOOP_CHECK for pcre2_match() to enable +some apparently looping recursions to run to completion and therefore match the +JIT behaviour. With this set, real loops will eventually get caught by match or +heap limits or run out of resource. + +58. AC did a lot of work on pcre2_fuzzsupport.c to extend it to 16-bit and +32-bit libraries and to compare JIT and non-JIT matching. + + +Version 10.42 11-December-2022 +------------------------------ + +1. Change 19 of 10.41 wasn't quite right; it put the definition of a default, +empty value for PCRE2_CALL_CONVENTION in src/pcre2posix.c instead of +src/pcre2posix.h, which meant that programs that included pcre2posix.h but not +pcre2.h failed to compile. + +2. To catch similar issues to the above in future, a new small test program +that includes pcre2posix.h but not pcre2.h has been added to the test suite. + +3. When the -S option of pcre2test was used to set a stack size greater than +the allowed maximum, the error message displayed the hard limit incorrectly. +This was pointed out on GitHub pull request #171, but the suggested patch +didn't cope with all cases. Some further modification was required. + +4. Supplying an ovector count of more than 65535 to pcre2_match_data_create() +caused a crash because the field in the match data block is only 16 bits. A +maximum of 65535 is now silently applied. + +5. Merged @carenas patch #175 which fixes #86 - segfault on aarch64 (ARM), + +6. The prototype for pcre2_substring_list_free() specified its argument as +PCRE2_SPTR * which is a const data type, whereas the yield from +pcre2_substring_list() is not const. This caused compiler warnings. I have +changed the argument of pcre2_substring_list_free() to be PCRE2_UCHAR ** to +remove this anomaly. This might cause new warnings in existing code where a +cast has been used to avoid previous ones. + + +Version 10.41 06-December-2022 +------------------------------ + +1. Add fflush() before and after a fork callout in pcre2grep to get its output +to be the same on all systems. (There were previously ordering differences in +Alpine Linux). + +2. Merged patch from @carenas (GitHub #110) for pthreads support in CMake. + +3. SSF scorecards grumbled about possible overflow in an expression in +pcre2test. It never would have overflowed in practice, but some casts have been +added and at the some time there's been some tidying of fprints that output +size_t values. + +4. PR #94 showed up an unused enum in pcre2_convert.c, which is now removed. + +5. Minor code re-arrangement to remove gcc warning about realloc() in +pcre2test. + +6. Change a number of int variables that hold buffer and line lengths in +pcre2grep to PCRE2_SIZE (aka size_t). + +7. Added an #ifdef to cut out a call to PRIV(jit_free) when JIT is not +supported (even though that function would do nothing in that case) at the +request of a user who doesn't even want to link with pcre_jit_compile.o. Also +tidied up an untidy #ifdef arrangement in pcre2test. + +8. Fixed an issue in the backtracking optimization of character repeats in +JIT. Furthermore optimize star repetitions, not just plus repetitions. + +9. Removed the use of an initial backtracking frames vector on the system stack +in pcre2_match() so that it now always uses the heap. (In a multi-thread +environment with very small stacks there had been an issue.) This also is +tidier for JIT matching, which didn't need that vector. The heap vector is now +remembered in the match data block and re-used if that block itself is re-used. +It is freed with the match data block. + +10. Adjusted the find_limits code in pcre2test to work with change 9 above. + +11. Added find_limits_noheap to pcre2test, because the heap limits are now +different in different environments and so cannot be included in the standard +tests. + +12. Created a test for pcre2_match() heap processing that is not part of the +tests run by 'make check', but can be run manually. The current output is from +a 64-bit system. + +13. Implemented -Z aka --null in pcre2grep. + +14. A minor change to pcre2test and the addition of several new pcre2grep tests +have improved LCOV coverage statistics. At the same time, code in pcre2grep and +elsewhere that can never be obeyed in normal testing has been excluded from +coverage. + +15. Fixed a bug in pcre2grep that could cause an extra newline to be written +after output generated by --output. + +16. If a file has a .bz2 extension but is not in fact compressed, pcre2grep +should process it as a plain text file. A bug stopped this happening; now fixed +and added to the tests. + +17. When pcre2grep was running not in UTF mode, if a string specified by +--output or obtained from a callout in a pattern contained a character (byte) +greater than 127, it was incorrectly output in UTF-8 format. + +18. Added some casts after warnings from Clang sanitize. + +19. Merged patch from cbouc (GitHub #139): 4 function prototypes were missing +PCRE2_CALL_CONVENTION in src/pcre2posix.h. All function prototypes returning +pointers had out of place PCRE2_CALL_CONVENTION in src/pcre2.h.*. These +produced errors when building for Windows with #define PCRE2_CALL_CONVENTION +__stdcall. + +20. A negative repeat value in a pcre2test subject line was not being +diagnosed, leading to infinite looping. + +21. Updated RunGrepTest to discard the warning that Bash now gives when setting +LC_CTYPE to a bad value (because older versions didn't). + +22. Updated pcre2grep so that it behaves like GNU grep when matching more than +one pattern and a later pattern matches at an earlier point in the subject when +the matched substrings are being identified by colour or by offsets. + +23. Updated the PrepareRelease script so that the man page that it makes for +the pcre2demo demonstration program is more standard and does not cause errors +when processed by lexgrog or mandb -c (GitHub issue #160). + +24. The JIT compiler was updated. + + +Version 10.40 15-April-2022 +--------------------------- + +1. Merged patch from @carenas (GitHub #35, 7db87842) to fix pcre2grep incorrect +handling of multiple passes. + +2. Merged patch from @carenas (GitHub #36, dae47509) to fix portability issue +in pcre2grep with buffered fseek(stdin). + +3. Merged patch from @carenas (GitHub #37, acc520924) to fix tests when -S is +not supported. + +4. Revert an unintended change in JIT repeat detection. + +5. Merged patch from @carenas (GitHub #52, b037bfa1) to fix build on GNU Hurd. + +6. Merged documentation and comments patches from @carenas (GitHub #47). + +7. Merged patch from @carenas (GitHub #49) to remove obsolete JFriedl test code +from pcre2grep. + +8. Merged patch from @carenas (GitHub #48) to fix CMake install issue #46. + +9. Merged patch from @carenas (GitHub #53) fixing NULL checks in matching and +substituting. + +10. Add null_subject and null_replacement modifiers to pcre2test. + +11. Add check for NULL subject to POSIX regexec() function. + +12. Add check for NULL replacement to pcre2_substitute(). + +13. For the subject arguments of pcre2_match(), pcre2_dfa_match(), and +pcre2_substitute(), and the replacement argument of the latter, if the pointer +is NULL and the length is zero, treat as an empty string. Apparently a number +of applications treat NULL/0 in this way. + +14. Added support for Bidi_Class and a number of binary Unicode properties, +including Bidi_Control. + +15. Fix some minor issues raised by clang sanitize. + +16. Very minor code speed up for maximizing character property matches. + +17. A number of changes to script matching for \p and \P: + + (a) Script extensions for a character are now coded as a bitmap instead of + a list of script numbers, which should be faster and does not need a + loop. + + (b) Added the syntax \p{script:xxx} and \p{script_extensions:xxx} (synonyms + sc and scx). + + (c) Changed \p{scriptname} from being the same as \p{sc:scriptname} to being + the same as \p{scx:scriptname} because this change happened in Perl at + release 5.26. + + (d) The standard Unicode 4-letter abbreviations for script names are now + recognized. + + (e) In accordance with Unicode and Perl's "loose matching" rules, spaces, + hyphens, and underscores are ignored in property names, which are then + matched independent of case. + +18. The Python scripts in the maint directory have been refactored. There are +now three scripts that generate pcre2_ucd.c, pcre2_ucp.h, and pcre2_ucptables.c +(which is #included by pcre2_tables.c). The data lists that used to be +duplicated are now held in a single common Python module. + +19. On CHERI, and thus Arm's Morello prototype, pointers are represented as +hardware capabilities, which consist of both an integer address and additional +metadata, meaning they are twice the size of the platform's size_t type, i.e. +16 bytes on a 64-bit system. The ovector member of heapframe happens to only be +8 byte aligned, and so computing frame_size ended up with a multiple of 8 but +not 16. Whilst the first frame was always suitably aligned, this then +misaligned the frame that follows, resulting in an alignment fault when storing +a pointer to Fecode at the start of match. Patch to fix this issue by Jessica +Clarke PR#72. + +20. Added -LP and -LS listing options to pcre2test. + +21. A user discovered that the library names in CMakeLists.txt for MSVC +debugger (PDB) files were incorrect - perhaps never tried for PCRE2? + +22. An item such as [Aa] is optimized into a caseless single character match. +When this was quantified (e.g. [Aa]{2}) and was also the last literal item in a +pattern, the optimizing "must be present for a match" character check was not +being flagged as caseless, causing some matches that should have succeeded to +fail. + +23. Fixed a unicode property matching issue in JIT. The character was not +fully read in caseless matching. + +24. Fixed an issue affecting recursions in JIT caused by duplicated data +transfers. + +25. Merged patch from @carenas (GitHub #96) which fixes some problems with +pcre2test and readline/readedit: + + * Use the right header for libedit in FreeBSD with autoconf + * Really allow libedit with cmake + * Avoid using readline headers with libedit + + +Version 10.39 29-October-2021 +----------------------------- + +1. Fix incorrect detection of alternatives in first character search in JIT. + +2. Merged patch from @carenas (GitHub #28): + + Visual Studio 2013 includes support for %zu and %td, so let newer + versions of it avoid the fallback, and while at it, make sure that + the first check is for DISABLE_PERCENT_ZT so it will be always + honoured if chosen. + + prtdiff_t is signed, so use a signed type instead, and make sure + that an appropriate width is chosen if pointers are 64bit wide and + long is not (ex: Windows 64bit). + + IMHO removing the cast (and therefore the possibility of truncation) + make the code cleaner and the fallback is likely portable enough + with all 64-bit POSIX systems doing LP64 except for Windows. + +3. Merged patch from @carenas (GitHub #29) to update to Unicode 14.0.0. + +4. Merged patch from @carenas (GitHub #30): + + * Cleanup: remove references to no longer used stdint.h + + Since 19c50b9d (Unconditionally use inttypes.h instead of trying for stdint.h + (simplification) and remove the now unnecessary inclusion in + pcre2_internal.h., 2018-11-14), stdint.h is no longer used. + + Remove checks for it in autotools and CMake and document better the expected + build failures for systems that might have stdint.h (C99) and not inttypes.h + (from POSIX), like old Windows. + + * Cleanup: remove detection for inttypes.h which is a hard dependency + + CMake checks for standard headers are not meant to be used for hard + dependencies, so will prevent a possible fallback to work. + + Alternatively, the header could be checked to make the configuration fail + instead of breaking the build, but that was punted, as it was missing anyway + from autotools. + +5. Merged patch from @carenas (GitHub #32): + + * jit: allow building with ancient MSVC versions + + Visual Studio older than 2013 fails to build with JIT enabled, because it is + unable to parse non C89 compatible syntax, with mixed declarations and code. + While most recent compilers wouldn't even report this as a warning since it + is valid C99, it could be also made visible by adding to gcc/clang the + -Wdeclaration-after-statement flag at build time. + + Move the code below the affected definitions. + + * pcre2grep: avoid mixing declarations with code + + Since d5a61ee8 (Patch to detect (and ignore) symlink loops in pcre2grep, + 2021-08-28), code will fail to build in a strict C89 compiler. + + Reformat slightly to make it C89 compatible again. + + +Version 10.38 01-October-2021 +----------------------------- + +1. Fix invalid single character repetition issues in JIT when the repetition +is inside a capturing bracket and the bracket is preceded by character +literals. + +2. Installed revised CMake configuration files provided by Jan-Willem Blokland. +This extends the CMake build system to build both static and shared libraries +in one go, builds the static library with PIC, and exposes PCRE2 libraries +using the CMake config files. JWB provided these notes: + +- Introduced CMake variable BUILD_STATIC_LIBS to build the static library. + +- Make a small modification to config-cmake.h.in by removing the PCRE2_STATIC + variable. Added PCRE2_STATIC variable to the static build using the + target_compile_definitions() function. + +- Extended the CMake config files. + + - Introduced CMake variable PCRE2_USE_STATIC_LIBS to easily switch between + the static and shared libraries. + + - Added the PCRE_STATIC variable to the target compile definitions for the + import of the static library. + +Building static and shared libraries using MSVC results in a name clash of +the libraries. Both static and shared library builds create, for example, the +file pcre2-8.lib. Therefore, I decided to change the static library names by +adding "-static". For example, pcre2-8.lib has become pcre2-8-static.lib. +[Comment by PH: this is MSVC-specific. It doesn't happen on Linux.] + +3. Increased the minimum release number for CMake to 3.0.0 because older than +2.8.12 is deprecated (it was set to 2.8.5) and causes warnings. Even 3.0.0 is +quite old; it was released in 2014. + +4. Implemented a modified version of Thomas Tempelmann's pcre2grep patch for +detecting symlink loops. This is dependent on the availability of realpath(), +which is now tested for in ./configure and CMakeLists.txt. + +5. Implemented a modified version of Thomas Tempelmann's patch for faster +case-independent "first code unit" searches for unanchored patterns in 8-bit +mode in the interpreters. Instead of just remembering whether one case matched +or not, it remembers the position of a previous match so as to avoid +unnecessary repeated searching. + +6. Perl now locks out \K in lookarounds, so PCRE2 now does the same by default. +However, just in case anybody was relying on the old behaviour, there is an +option called PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK that enables the old behaviour. +An option has also been added to pcre2grep to enable this. + +7. Re-enable a JIT optimization which was unintentionally disabled in 10.35. + +8. There is a loop counter to catch excessively crazy patterns when checking +the lengths of lookbehinds at compile time. This was incorrectly getting reset +whenever a lookahead was processed, leading to some fuzzer-generated patterns +taking a very long time to compile when (?|) was present in the pattern, +because (?|) disables caching of group lengths. + + +Version 10.37 26-May-2021 +------------------------- + +1. Change RunGrepTest to use tr instead of sed when testing with binary +zero bytes, because sed varies a lot from system to system and has problems +with binary zeros. This is from Bugzilla #2681. Patch from Jeremie +Courreges-Anglas via Nam Nguyen. This fixes RunGrepTest for OpenBSD. Later: +it broke it for at least one version of Solaris, where tr can't handle binary +zeros. However, that system had /usr/xpg4/bin/tr installed, which works OK, so +RunGrepTest now checks for that command and uses it if found. + +2. Compiling with gcc 10.2's -fanalyzer option showed up a hypothetical problem +with a NULL dereference. I don't think this case could ever occur in practice, +but I have put in a check in order to get rid of the compiler error. + +3. An alternative patch for CMakeLists.txt because 10.36 #4 breaks CMake on +Windows. Patch from email@cs-ware.de fixes bugzilla #2688. + +4. Two bugs related to over-large numbers have been fixed so the behaviour is +now the same as Perl. + + (a) A pattern such as /\214748364/ gave an overflow error instead of being + treated as the octal number \214 followed by literal digits. + + (b) A sequence such as {65536 that has no terminating } so is not a + quantifier was nevertheless complaining that a quantifier number was too big. + +5. A run of autoconf suggested that configure.ac was out-of-date with respect +to the latest autoconf. Running autoupdate made some valid changes, some valid +suggestions, and also some invalid changes, which were fixed by hand. Autoconf +now runs clean and the resulting "configure" seems to work, so I hope nothing +is broken. Later: the requirement for autoconf 2.70 broke some automatic test +robots. It doesn't seem to be necessary: trying a reduction to 2.60. + +6. The pattern /a\K.(?0)*/ when matched against "abac" by the interpreter gave +the answer "bac", whereas Perl and JIT both yield "c". This was because the +effect of \K was not propagating back from the full pattern recursion. Other +recursions such as /(a\K.(?1)*)/ did not have this problem. + +7. Restore single character repetition optimization in JIT. Currently fewer +character repetitions are optimized than in 10.34. + +8. When the names of the functions in the POSIX wrapper were changed to +pcre2_regcomp() etc. (see change 10.33 #4 below), functions with the original +names were left in the library so that pre-compiled programs would still work. +However, this has proved troublesome when programs link with several libraries, +some of which use PCRE2 via the POSIX interface while others use a native POSIX +library. For this reason, the POSIX function names are removed in this release. +The macros in pcre2posix.h should ensure that re-compiling fixes any programs +that haven't been compiled since before 10.33. + + +Version 10.36 04-December-2020 +------------------------------ + +1. Add CET_CFLAGS so that when Intel CET is enabled, pass -mshstk to +compiler. This fixes https://bugs.exim.org/show_bug.cgi?id=2578. Patch for +Makefile.am and configure.ac by H.J. Lu. Equivalent patch for CMakeLists.txt +invented by PH. + +2. Fix infinite loop when a single byte newline is searched in JIT when +invalid utf8 mode is enabled. + +3. Updated CMakeLists.txt with patch from Wolfgang Stöggl (Bugzilla #2584): + + - Include GNUInstallDirs and use ${CMAKE_INSTALL_LIBDIR} instead of hardcoded + lib. This allows differentiation between lib and lib64. + CMAKE_INSTALL_LIBDIR is used for installation of libraries and also for + pkgconfig file generation. + + - Add the version of PCRE2 to the configuration summary like ./configure + does. + + - Fix typo: MACTHED_STRING->MATCHED_STRING + +4. Updated CMakeLists.txt with another patch from Wolfgang Stöggl (Bugzilla +#2588): + + - Add escaped double quotes around include directory in CMakeLists.txt to + allow spaces in directory names. + + - This fixes a cmake error, if the path of the pcre2 source contains a space. + +5. Updated CMakeLists.txt with a patch from B. Scott Michel: CMake's +documentation suggests using CHECK_SYMBOL_EXISTS over CHECK_FUNCTION_EXIST. +Moreover, these functions come from specific header files, which need to be +specified (and, thankfully, are the same on both the Linux and WinXX +platforms.) + +6. Added a (uint32_t) cast to prevent a compiler warning in pcre2_compile.c. + +7. Applied a patch from Wolfgang Stöggl (Bugzilla #2600) to fix postfix for +debug Windows builds using CMake. This also updated configure so that it +generates *.pc files and pcre2-config with the same content, as in the past. + +8. If a pattern ended with (?(VERSION=n.d where n is any number but d is just a +single digit, the code unit beyond d was being read (i.e. there was a read +buffer overflow). Fixes ClusterFuzz 23779. + +9. After the rework in r1235, certain character ranges were incorrectly +handled by an optimization in JIT. Furthermore a wrong offset was used to +read a value from a buffer which could lead to memory overread. + +10. Unnoticed for many years was the fact that delimiters other than / in the +testinput1 and testinput4 files could cause incorrect behaviour when these +files were processed by perltest.sh. There were several tests that used quotes +as delimiters, and it was just luck that they didn't go wrong with perltest.sh. +All the patterns in testinput1 and testinput4 now use / as their delimiter. +This fixes Bugzilla #2641. + +11. Perl has started to give an error for \K within lookarounds (though there +are cases where it doesn't). PCRE2 still allows this, so the tests that include +this case have been moved from test 1 to test 2. + +12. Further to 10 above, pcre2test has been updated to detect and grumble if a +delimiter other than / is used after #perltest. + +13. Fixed a bug with PCRE2_MATCH_INVALID_UTF in 8-bit mode when PCRE2_CASELESS +was set and PCRE2_NO_START_OPTIMIZE was not set. The optimization for finding +the start of a match was not resetting correctly after a failed match on the +first valid fragment of the subject, possibly causing incorrect "no match" +returns on subsequent fragments. For example, the pattern /A/ failed to match +the subject \xe5A. Fixes Bugzilla #2642. + +14. Fixed a bug in character set matching when JIT is enabled and both unicode +scripts and unicode classes are present at the same time. + +15. Added GNU grep's -m (aka --max-count) option to pcre2grep. + +16. Refactored substitution processing in pcre2grep strings, both for the -O +option and when dealing with callouts. There is now a single function that +handles $ expansion in all cases (instead of multiple copies of almost +identical code). This means that the same escape sequences are available +everywhere, which was not previously the case. At the same time, the escape +sequences $x{...} and $o{...} have been introduced, to allow for characters +whose code points are greater than 255 in Unicode mode. + +17. Applied the patch from Bugzilla #2628 to RunGrepTest. This does an explicit +test for a version of sed that can handle binary zero, instead of assuming that +any Linux version will work. Later: replaced $(...) by `...` because not all +shells recognize the former. + +18. Fixed a word boundary check bug in JIT when partial matching is enabled. + +19. Fix ARM64 compilation warning in JIT. Patch by Carlo. + +20. A bug in the RunTest script meant that if the first part of test 2 failed, +the failure was not reported. + +21. Test 2 was failing when run from a directory other than the source +directory. This failure was previously missed in RunTest because of 20 above. +Fixes added to both RunTest and RunTest.bat. + +22. Patch to CMakeLists.txt from Daniel to fix problem with testing under +Windows. + + +Version 10.35 09-May-2020 +--------------------------- + +1. Use PCRE2_MATCH_EMPTY flag to detect empty matches in JIT. + +2. Fix ARMv5 JIT improper handling of labels right after a constant pool. + +3. A JIT bug is fixed which allowed to read the fields of the compiled +pattern before its existence is checked. + +4. Back in the PCRE1 day, capturing groups that contained recursive back +references to themselves were made atomic (version 8.01, change 18) because +after the end a repeated group, the captured substrings had their values from +the final repetition, not from an earlier repetition that might be the +destination of a backtrack. This feature was documented, and was carried over +into PCRE2. However, it has now been realized that the major refactoring that +was done for 10.30 has made this atomizing unnecessary, and it is confusing +when users are unaware of it, making some patterns appear not to be working as +expected. Capture values of recursive back references in repeated groups are +now correctly backtracked, so this unnecessary restriction has been removed. + +5. Added PCRE2_SUBSTITUTE_LITERAL. + +6. Avoid some VS compiler warnings. + +7. Added PCRE2_SUBSTITUTE_MATCHED. + +8. Added (?* and (?<* as synonyms for (*napla: and (*naplb: to match another +regex engine. The Perl regex folks are aware of this usage and have made a note +about it. + +9. When an assertion is repeated, PCRE2 used to limit the maximum repetition to +1, believing that repeating an assertion is pointless. However, if a positive +assertion contains capturing groups, repetition can be useful. In any case, an +assertion could always be wrapped in a repeated group. The only restriction +that is now imposed is that an unlimited maximum is changed to one more than +the minimum. + +10. Fix *THEN verbs in lookahead assertions in JIT. + +11. Added PCRE2_SUBSTITUTE_REPLACEMENT_ONLY. + +12. The JIT stack should be freed when the low-level stack allocation fails. + +13. In pcre2grep, if the final line in a scanned file is output but does not +end with a newline sequence, add a newline according to the --newline setting. + +14. (?(DEFINE)...) groups were not being handled correctly when checking for +the fixed length of a lookbehind assertion. Such a group within a lookbehind +should be skipped, as it does not contribute to the length of the group. +Instead, the (DEFINE) group was being processed, and if at the end of the +lookbehind, that end was not correctly recognized. Errors such as "lookbehind +assertion is not fixed length" and also "internal error: bad code value in +parsed_skip()" could result. + +15. Put a limit of 1000 on recursive calls in pcre2_study() when searching +nested groups for starting code units, in order to avoid stack overflow issues. +If the limit is reached, it just gives up trying for this optimization. + +16. The control verb chain list must always be restored when exiting from a +recurse function in JIT. + +17. Fix a crash which occurs when the character type of an invalid UTF +character is decoded in JIT. + +18. Changes in many areas of the code so that when Unicode is supported and +PCRE2_UCP is set without PCRE2_UTF, Unicode character properties are used for +upper/lower case computations on characters whose code points are greater than +127. + +19. The function for checking UTF-16 validity was returning an incorrect offset +for the start of the error when a high surrogate was not followed by a valid +low surrogate. This caused incorrect behaviour, for example when +PCRE2_MATCH_INVALID_UTF was set and a match started immediately following the +invalid high surrogate, such as /aa/ matching "\x{d800}aa". + +20. If a DEFINE group immediately preceded a lookbehind assertion, the pattern +could be mis-compiled and therefore not match correctly. This is the example +that found this: /(?(DEFINE)(?bar))(? has been raised to +50, (b) the new --om-capture option changes the limit, (c) an error is raised +if -o asks for a group that is above the limit. + +12. The quantifier {1} was always being ignored, but this is incorrect when it +is made possessive and applied to an item in parentheses, because a +parenthesized item may contain multiple branches or other backtracking points, +for example /(a|ab){1}+c/ or /(a+){1}+a/. + +13. For partial matches, pcre2test was always showing the maximum lookbehind +characters, flagged with "<", which is misleading when the lookbehind didn't +actually look behind the start (because it was later in the pattern). Showing +all consulted preceding characters for partial matches is now controlled by the +existing "allusedtext" modifier and, as for complete matches, this facility is +available only for non-JIT matching, because JIT does not maintain the first +and last consulted characters. + +14. DFA matching (using pcre2_dfa_match()) was not recognising a partial match +if the end of the subject was encountered in a lookahead (conditional or +otherwise), an atomic group, or a recursion. + +15. Give error if pcre2test -t, -T, -tm or -TM is given an argument of zero. + +16. Check for integer overflow when computing lookbehind lengths. Fixes +Clusterfuzz issue 15636. + +17. Implemented non-atomic positive lookaround assertions. + +18. If a lookbehind contained a lookahead that contained another lookbehind +within it, the nested lookbehind was not correctly processed. For example, if +/(?<=(?=(?<=a)))b/ was matched to "ab" it gave no match instead of matching +"b". + +19. Implemented pcre2_get_match_data_size(). + +20. Two alterations to partial matching: + + (a) The definition of a partial match is slightly changed: if a pattern + contains any lookbehinds, an empty partial match may be given, because this + is another situation where adding characters to the current subject can + lead to a full match. Example: /c*+(?<=[bc])/ with subject "ab". + + (b) Similarly, if a pattern could match an empty string, an empty partial + match may be given. Example: /(?![ab]).*/ with subject "ab". This case + applies only to PCRE2_PARTIAL_HARD. + + (c) An empty string partial hard match can be returned for \z and \Z as it + is documented that they shouldn't match. + +21. A branch that started with (*ACCEPT) was not being recognized as one that +could match an empty string. + +22. Corrected pcre2_set_character_tables() tables data type: was const unsigned +char * instead of const uint8_t *, as generated by pcre2_maketables(). + +23. Upgraded to Unicode 12.1.0. + +24. Add -jitfast command line option to pcre2test (to make all the jit options +available directly). + +25. Make pcre2test -C show if libreadline or libedit is supported. + +26. If the length of one branch of a group exceeded 65535 (the maximum value +that is remembered as a minimum length), the whole group's length was +incorrectly recorded as 65535, leading to incorrect "no match" when start-up +optimizations were in force. + +27. The "rightmost consulted character" value was not always correct; in +particular, if a pattern ended with a negative lookahead, characters that were +inspected in that lookahead were not included. + +28. Add the pcre2_maketables_free() function. + +29. The start-up optimization that looks for a unique initial matching +code unit in the interpretive engines uses memchr() in 8-bit mode. When the +search is caseless, it was doing so inefficiently, which ended up slowing down +the match drastically when the subject was very long. The revised code (a) +remembers if one case is not found, so it never repeats the search for that +case after a bumpalong and (b) when one case has been found, it searches only +up to that position for an earlier occurrence of the other case. This fix +applies to both interpretive pcre2_match() and to pcre2_dfa_match(). + +30. While scanning to find the minimum length of a group, if any branch has +minimum length zero, there is no need to scan any subsequent branches (a small +compile-time performance improvement). + +31. Installed a .gitignore file on a user's suggestion. When using the svn +repository with git (through git svn) this helps keep it tidy. + +32. Add underflow check in JIT which may occur when the value of subject +string pointer is close to 0. + +33. Arrange for classes such as [Aa] which contain just the two cases of the +same character, to be treated as a single caseless character. This causes the +first and required code unit optimizations to kick in where relevant. + +34. Improve the bitmap of starting bytes for positive classes that include wide +characters, but no property types, in UTF-8 mode. Previously, on encountering +such a class, the bits for all bytes greater than \xc4 were set, thus +specifying any character with codepoint >= 0x100. Now the only bits that are +set are for the relevant bytes that start the wide characters. This can give a +noticeable performance improvement. + +35. If the bitmap of starting code units contains only 1 or 2 bits, replace it +with a single starting code unit (1 bit) or a caseless single starting code +unit if the two relevant characters are case-partners. This is particularly +relevant to the 8-bit library, though it applies to all. It can give a +performance boost for patterns such as [Ww]ord and (word|WORD). However, this +optimization doesn't happen if there is a "required" code unit of the same +value (because the search for a "required" code unit starts at the match start +for non-unique first code unit patterns, but after a unique first code unit, +and patterns such as a*a need the former action). + +36. Small patch to pcre2posix.c to set the erroroffset field to -1 immediately +after a successful compile, instead of at the start of matching to avoid a +sanitizer complaint (regexec is supposed to be thread safe). + +37. Add NEON vectorization to JIT to speed up matching of first character and +pairs of characters on ARM64 CPUs. + +38. If a non-ASCII character was the first in a starting assertion in a +caseless match, the "first code unit" optimization did not get the casing +right, and the assertion failed to match a character in the other case if it +did not start with the same code unit. + +39. Fixed the incorrect computation of jump sizes on x86 CPUs in JIT. A masking +operation was incorrectly removed in r1136. Reported by Ralf Junker. + + +Version 10.33 16-April-2019 +--------------------------- + +1. Added "allvector" to pcre2test to make it easy to check the part of the +ovector that shouldn't be changed, in particular after substitute and failed or +partial matches. + +2. Fix subject buffer overread in JIT when UTF is disabled and \X or \R has +a greater than 1 fixed quantifier. This issue was found by Yunho Kim. + +3. Added support for callouts from pcre2_substitute(). After 10.33-RC1, but +prior to release, fixed a bug that caused a crash if pcre2_substitute() was +called with a NULL match context. + +4. The POSIX functions are now all called pcre2_regcomp() etc., with wrapper +functions that use the standard POSIX names. However, in pcre2posix.h the POSIX +names are defined as macros. This should help avoid linking with the wrong +library in some environments while still exporting the POSIX names for +pre-existing programs that use them. (The Debian alternative names are also +defined as macros, but not documented.) + +5. Fix an xclass matching issue in JIT. + +6. Implement PCRE2_EXTRA_ESCAPED_CR_IS_LF (see Bugzilla 2315). + +7. Implement the Perl 5.28 experimental alphabetic names for atomic groups and +lookaround assertions, for example, (*pla:...) and (*atomic:...). These are +characterized by a lower case letter following (* and to simplify coding for +this, the character tables created by pcre2_maketables() were updated to add a +new "is lower case letter" bit. At the same time, the now unused "is +hexadecimal digit" bit was removed. The default tables in +src/pcre2_chartables.c.dist are updated. + +8. Implement the new Perl "script run" features (*script_run:...) and +(*atomic_script_run:...) aka (*sr:...) and (*asr:...). + +9. Fixed two typos in change 22 for 10.21, which added special handling for +ranges such as a-z in EBCDIC environments. The original code probably never +worked, though there were no bug reports. + +10. Implement PCRE2_COPY_MATCHED_SUBJECT for pcre2_match() (including JIT via +pcre2_match()) and pcre2_dfa_match(), but *not* the pcre2_jit_match() fast +path. Also, when a match fails, set the subject field in the match data to NULL +for tidiness - none of the substring extractors should reference this after +match failure. + +11. If a pattern started with a subroutine call that had a quantifier with a +minimum of zero, an incorrect "match must start with this character" could be +recorded. Example: /(?&xxx)*ABC(?XYZ)/ would (incorrectly) expect 'A' to +be the first character of a match. + +12. The heap limit checking code in pcre2_dfa_match() could suffer from +overflow if the heap limit was set very large. This could cause incorrect "heap +limit exceeded" errors. + +13. Add "kibibytes" to the heap limit output from pcre2test -C to make the +units clear. + +14. Add a call to pcre2_jit_free_unused_memory() in pcre2grep, for tidiness. + +15. Updated the VMS-specific code in pcre2test on the advice of a VMS user. + +16. Removed the unnecessary inclusion of stdint.h (or inttypes.h) from +pcre2_internal.h as it is now included by pcre2.h. Also, change 17 for 10.32 +below was unnecessarily complicated, as inttypes.h is a Standard C header, +which is defined to be a superset of stdint.h. Instead of conditionally +including stdint.h or inttypes.h, pcre2.h now unconditionally includes +inttypes.h. This supports environments that do not have stdint.h but do have +inttypes.h, which are known to exist. A note in the autotools documentation +says (November 2018) that there are none known that are the other way round. + +17. Added --disable-percent-zt to "configure" (and equivalent to CMake) to +forcibly disable the use of %zu and %td in formatting strings because there is +at least one version of VMS that claims to be C99 but does not support these +modifiers. + +18. Added --disable-pcre2grep-callout-fork, which restricts the callout support +in pcre2grep to the inbuilt echo facility. This may be useful in environments +that do not support fork(). + +19. Fix two instances of <= 0 being applied to unsigned integers (the VMS +compiler complains). + +20. Added "fork" support for VMS to pcre2grep, for running an external program +via a string callout. + +21. Improve MAP_JIT flag usage on MacOS. Patch by Rich Siegel. + +22. If a pattern started with (*MARK), (*COMMIT), (*PRUNE), (*SKIP), or (*THEN) +followed by ^ it was not recognized as anchored. + +23. The RunGrepTest script used to cut out the test of NUL characters for +Solaris and MacOS as printf and sed can't handle them. It seems that the *BSD +systems can't either. I've inverted the test so that only those OS that are +known to work (currently only Linux) try to run this test. + +24. Some tests in RunGrepTest appended to testtrygrep from two different file +descriptors instead of redirecting stderr to stdout. This worked on Linux, but +it was reported not to on other systems, causing the tests to fail. + +25. In the RunTest script, make the test for stack setting use the same value +for the stack as it needs for -bigstack. + +26. Insert a cast in pcre2_dfa_match.c to suppress a compiler warning. + +26. With PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL set, escape sequences such as \s +which are valid in character classes, but not as the end of ranges, were being +treated as literals. An example is [_-\s] (but not [\s-_] because that gave an +error at the *start* of a range). Now an "invalid range" error is given +independently of PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL. + +27. Related to 26 above, PCRE2_BAD_ESCAPE_IS_LITERAL was affecting known escape +sequences such as \eX when they appeared invalidly in a character class. Now +the option applies only to unrecognized or malformed escape sequences. + +28. Fix word boundary in JIT compiler. Patch by Mike Munday. + +29. The pcre2_dfa_match() function was incorrectly handling conditional version +tests such as (?(VERSION>=0)...) when the version test was true. Incorrect +processing or a crash could result. + +30. When PCRE2_UTF is set, allow non-ASCII letters and decimal digits in group +names, as Perl does. There was a small bug in this new code, found by +ClusterFuzz 12950, fixed before release. + +31. Implemented PCRE2_EXTRA_ALT_BSUX to support ECMAScript 6's \u{hhh} +construct. + +32. Compile \p{Any} to be the same as . in DOTALL mode, so that it benefits +from auto-anchoring if \p{Any}* starts a pattern. + +33. Compile invalid UTF check in JIT test when only pcre32 is enabled. + +34. For some time now, CMake has been warning about the setting of policy +CMP0026 to "OLD" in CmakeLists.txt, and hinting that the feature might be +removed in a future version. A request for CMake expertise on the list produced +no result, so I have now hacked CMakeLists.txt along the lines of some changes +I found on the Internet. The new code no longer needs the policy setting, and +it appears to work fine on Linux. + +35. Setting --enable-jit=auto for an out-of-tree build failed because the +source directory wasn't in the search path for AC_TRY_COMPILE always. Patch +from Ross Burton. + +36. Disable SSE2 JIT optimizations in x86 CPUs when SSE2 is not available. +Patch by Guillem Jover. + +37. Changed expressions such as 1<<10 to 1u<<10 in many places because compiler +warnings were reported. + +38. Using the clang compiler with sanitizing options causes runtime complaints +about truncation for statements such as x = ~x when x is an 8-bit value; it +seems to compute ~x as a 32-bit value. Changing such statements to x = 255 ^ x +gets rid of the warnings. There were also two missing casts in pcre2test. + + +Version 10.32 10-September-2018 +------------------------------- + +1. When matching using the REG_STARTEND feature of the POSIX API with a +non-zero starting offset, unset capturing groups with lower numbers than a +group that did capture something were not being correctly returned as "unset" +(that is, with offset values of -1). + +2. When matching using the POSIX API, pcre2test used to omit listing unset +groups altogether. Now it shows those that come before any actual captures as +"", as happens for non-POSIX matching. + +3. Running "pcre2test -C" always stated "\R matches CR, LF, or CRLF only", +whatever the build configuration was. It now correctly says "\R matches all +Unicode newlines" in the default case when --enable-bsr-anycrlf has not been +specified. Similarly, running "pcre2test -C bsr" never produced the result +ANY. + +4. Matching the pattern /(*UTF)\C[^\v]+\x80/ against an 8-bit string containing +multi-code-unit characters caused bad behaviour and possibly a crash. This +issue was fixed for other kinds of repeat in release 10.20 by change 19, but +repeating character classes were overlooked. + +5. pcre2grep now supports the inclusion of binary zeros in patterns that are +read from files via the -f option. + +6. A small fix to pcre2grep to avoid compiler warnings for -Wformat-overflow=2. + +7. Added --enable-jit=auto support to configure.ac. + +8. Added some dummy variables to the heapframe structure in 16-bit and 32-bit +modes for the benefit of m68k, where pointers can be 16-bit aligned. The +dummies force 32-bit alignment and this ensures that the structure is a +multiple of PCRE2_SIZE, a requirement that is tested at compile time. In other +architectures, alignment requirements take care of this automatically. + +9. When returning an error from pcre2_pattern_convert(), ensure the error +offset is set zero for early errors. + +10. A number of patches for Windows support from Daniel Richard G: + + (a) List of error numbers in Runtest.bat corrected (it was not the same as in + Runtest). + + (b) pcre2grep snprintf() workaround as used elsewhere in the tree. + + (c) Support for non-C99 snprintf() that returns -1 in the overflow case. + +11. Minor tidy of pcre2_dfa_match() code. + +12. Refactored pcre2_dfa_match() so that the internal recursive calls no longer +use the stack for local workspace and local ovectors. Instead, an initial block +of stack is reserved, but if this is insufficient, heap memory is used. The +heap limit parameter now applies to pcre2_dfa_match(). + +13. If a "find limits" test of DFA matching in pcre2test resulted in too many +matches for the ovector, no matches were displayed. + +14. Removed an occurrence of ctrl/Z from test 6 because Windows treats it as +EOF. The test looks to have come from a fuzzer. + +15. If PCRE2 was built with a default match limit a lot greater than the +default default of 10 000 000, some JIT tests of the match limit no longer +failed. All such tests now set 10 000 000 as the upper limit. + +16. Another Windows related patch for pcregrep to ensure that WIN32 is +undefined under Cygwin. + +17. Test for the presence of stdint.h and inttypes.h in configure and CMake and +include whichever exists (stdint preferred) instead of unconditionally +including stdint. This makes life easier for old and non-standard systems. + +18. Further changes to improve portability, especially to old and or non- +standard systems: + + (a) Put all printf arguments in RunGrepTest into single, not double, quotes, + and use \0 not \x00 for binary zero. + + (b) Avoid the use of C++ (i.e. BCPL) // comments. + + (c) Parameterize the use of %zu in pcre2test to make it like %td. For both of + these now, if using MSVC or a standard C before C99, %lu is used with a + cast if necessary. + +19. Applied a contributed patch to CMakeLists.txt to increase the stack size +when linking pcre2test with MSVC. This gets rid of a stack overflow error in +the standard set of tests. + +20. Output a warning in pcre2test when ignoring the "altglobal" modifier when +it is given with the "replace" modifier. + +21. In both pcre2test and pcre2_substitute(), with global matching, a pattern +that matched an empty string, but never at the starting match offset, was not +handled in a Perl-compatible way. The pattern /(a(*:1))(?>b)(*SKIP:1)x|.*/ matched against "abc", where the *SKIP +shouldn't find a MARK (because is in an atomic group), but it did. + +26. Upgraded the perltest.sh script: (1) #pattern lines can now be used to set +a list of modifiers for all subsequent patterns - only those that the script +recognizes are meaningful; (2) #subject lines can be used to set or unset a +default "mark" modifier; (3) Unsupported #command lines give a warning when +they are ignored; (4) Mark data is output only if the "mark" modifier is +present. + +27. (*ACCEPT:ARG), (*FAIL:ARG), and (*COMMIT:ARG) are now supported. + +28. A (*MARK) name was not being passed back for positive assertions that were +terminated by (*ACCEPT). + +29. Add support for \N{U+dddd}, but only in Unicode mode. + +30. Add support for (?^) for unsetting all imnsx options. + +31. The PCRE2_EXTENDED (/x) option only ever discarded space characters whose +code point was less than 256 and that were recognized by the lookup table +generated by pcre2_maketables(), which uses isspace() to identify white space. +Now, when Unicode support is compiled, PCRE2_EXTENDED also discards U+0085, +U+200E, U+200F, U+2028, and U+2029, which are additional characters defined by +Unicode as "Pattern White Space". This makes PCRE2 compatible with Perl. + +32. In certain circumstances, option settings within patterns were not being +correctly processed. For example, the pattern /((?i)A)(?m)B/ incorrectly +matched "ab". (The (?m) setting lost the fact that (?i) should be reset at the +end of its group during the parse process, but without another setting such as +(?m) the compile phase got it right.) This bug was introduced by the +refactoring in release 10.23. + +33. PCRE2 uses bcopy() if available when memmove() is not, and it used just to +define memmove() as function call to bcopy(). This hasn't been tested for a +long time because in pcre2test the result of memmove() was being used, whereas +bcopy() doesn't return a result. This feature is now refactored always to call +an emulation function when there is no memmove(). The emulation makes use of +bcopy() when available. + +34. When serializing a pattern, set the memctl, executable_jit, and tables +fields (that is, all the fields that contain pointers) to zeros so that the +result of serializing is always the same. These fields are re-set when the +pattern is deserialized. + +35. In a pattern such as /[^\x{100}-\x{ffff}]*[\x80-\xff]/ which has a repeated +negative class with no characters less than 0x100 followed by a positive class +with only characters less than 0x100, the first class was incorrectly being +auto-possessified, causing incorrect match failures. + +36. Removed the character type bit ctype_meta, which dates from PCRE1 and is +not used in PCRE2. + +37. Tidied up unnecessarily complicated macros used in the escapes table. + +38. Since 10.21, the new testoutput8-16-4 file has accidentally been omitted +from distribution tarballs, owing to a typo in Makefile.am which had +testoutput8-16-3 twice. Now fixed. + +39. If the only branch in a conditional subpattern was anchored, the whole +subpattern was treated as anchored, when it should not have been, since the +assumed empty second branch cannot be anchored. Demonstrated by test patterns +such as /(?(1)^())b/ or /(?(?=^))b/. + +40. A repeated conditional subpattern that could match an empty string was +always assumed to be unanchored. Now it is checked just like any other +repeated conditional subpattern, and can be found to be anchored if the minimum +quantifier is one or more. I can't see much use for a repeated anchored +pattern, but the behaviour is now consistent. + +41. Minor addition to pcre2_jit_compile.c to avoid static analyzer complaint +(for an event that could never occur but you had to have external information +to know that). + +42. If before the first match in a file that was being searched by pcre2grep +there was a line that was sufficiently long to cause the input buffer to be +expanded, the variable holding the location of the end of the previous match +was being adjusted incorrectly, and could cause an overflow warning from a code +sanitizer. However, as the value is used only to print pending "after" lines +when the next match is reached (and there are no such lines in this case) this +bug could do no damage. + + +Version 10.31 12-February-2018 +------------------------------ + +1. Fix typo (missing ]) in VMS code in pcre2test.c. + +2. Replace the replicated code for matching extended Unicode grapheme sequences +(which got a lot more complicated by change 10.30/49) by a single subroutine +that is called by both pcre2_match() and pcre2_dfa_match(). + +3. Add idempotent guard to pcre2_internal.h. + +4. Add new pcre2_config() options: PCRE2_CONFIG_NEVER_BACKSLASH_C and +PCRE2_CONFIG_COMPILED_WIDTHS. + +5. Cut out \C tests in the JIT regression tests when NEVER_BACKSLASH_C is +defined (e.g. by --enable-never-backslash-C). + +6. Defined public names for all the pcre2_compile() error numbers, and used +the public names in pcre2_convert.c. + +7. Fixed a small memory leak in pcre2test (convert contexts). + +8. Added two casts to compile.c and one to match.c to avoid compiler warnings. + +9. Added code to pcre2grep when compiled under VMS to set the symbol +PCRE2GREP_RC to the exit status, because VMS does not distinguish between +exit(0) and exit(1). + +10. Added the -LM (list modifiers) option to pcre2test. Also made -C complain +about a bad option only if the following argument item does not start with a +hyphen. + +11. pcre2grep was truncating components of file names to 128 characters when +processing files with the -r option, and also (some very odd code) truncating +path names to 512 characters. There is now a check on the absolute length of +full path file names, which may be up to 2047 characters long. + +12. When an assertion contained (*ACCEPT) it caused all open capturing groups +to be closed (as for a non-assertion ACCEPT), which was wrong and could lead to +misbehaviour for subsequent references to groups that started outside the +assertion. ACCEPT in an assertion now closes only those groups that were +started within that assertion. Fixes oss-fuzz issues 3852 and 3891. + +13. Multiline matching in pcre2grep was misbehaving if the pattern matched +within a line, and then matched again at the end of the line and over into +subsequent lines. Behaviour was different with and without colouring, and +sometimes context lines were incorrectly printed and/or line endings were lost. +All these issues should now be fixed. + +14. If --line-buffered was specified for pcre2grep when input was from a +compressed file (.gz or .bz2) a segfault occurred. (Line buffering should be +ignored for compressed files.) + +15. Although pcre2_jit_match checks whether the pattern is compiled +in a given mode, it was also expected that at least one mode is available. +This is fixed and pcre2_jit_match returns with PCRE2_ERROR_JIT_BADOPTION +when the pattern is not optimized by JIT at all. + +16. The line number and related variables such as match counts in pcre2grep +were all int variables, causing overflow when files with more than 2147483647 +lines were processed (assuming 32-bit ints). They have all been changed to +unsigned long ints. + +17. If a backreference with a minimum repeat count of zero was first in a +pattern, apart from assertions, an incorrect first matching character could be +recorded. For example, for the pattern /(?=(a))\1?b/, "b" was incorrectly set +as the first character of a match. + +18. Characters in a leading positive assertion are considered for recording a +first character of a match when the rest of the pattern does not provide one. +However, a character in a non-assertive group within a leading assertion such +as in the pattern /(?=(a))\1?b/ caused this process to fail. This was an +infelicity rather than an outright bug, because it did not affect the result of +a match, just its speed. (In fact, in this case, the starting 'a' was +subsequently picked up in the study.) + +19. A minor tidy in pcre2_match(): making all PCRE2_ERROR_ returns use "return" +instead of "RRETURN" saves unwinding the backtracks in these cases (only one +didn't). + +20. Allocate a single callout block on the stack at the start of pcre2_match() +and set its never-changing fields once only. Do the same for pcre2_dfa_match(). + +21. Save the extra compile options (set in the compile context) with the +compiled pattern (they were not previously saved), add PCRE2_INFO_EXTRAOPTIONS +to retrieve them, and update pcre2test to show them. + +22. Added PCRE2_CALLOUT_STARTMATCH and PCRE2_CALLOUT_BACKTRACK bits to a new +field callout_flags in callout blocks. The bits are set by pcre2_match(), but +not by JIT or pcre2_dfa_match(). Their settings are shown in pcre2test callouts +if the callout_extra subject modifier is set. These bits are provided to help +with tracking how a backtracking match is proceeding. + +23. Updated the pcre2demo.c demonstration program, which was missing the extra +code for -g that handles the case when \K in an assertion causes the match to +end at the original start point. Also arranged for it to detect when \K causes +the end of a match to be before its start. + +24. Similar to 23 above, strange things (including loops) could happen in +pcre2grep when \K was used in an assertion when --colour was used or in +multiline mode. The "end at original start point" bug is fixed, and if the end +point is found to be before the start point, they are swapped. + +25. When PCRE2_FIRSTLINE without PCRE2_NO_START_OPTIMIZE was used in non-JIT +matching (both pcre2_match() and pcre2_dfa_match()) and the matched string +started with the first code unit of a newline sequence, matching failed because +it was not tried at the newline. + +26. Code for giving up a non-partial match after failing to find a starting +code unit anywhere in the subject was missing when searching for one of a +number of code units (the bitmap case) in both pcre2_match() and +pcre2_dfa_match(). This was a missing optimization rather than a bug. + +27. Tidied up the ACROSSCHAR macro to be like FORWARDCHAR and BACKCHAR, using a +pointer argument rather than a code unit value. This should not have affected +the generated code. + +28. The JIT compiler has been updated. + +29. Avoid pointer overflow for unset captures in pcre2_substring_list_get(). +This could not actually cause a crash because it was always used in a memcpy() +call with zero length. + +30. Some internal structures have a variable-length ovector[] as their last +element. Their actual memory is obtained dynamically, giving an ovector of +appropriate length. However, they are defined in the structure as +ovector[NUMBER], where NUMBER is large so that array bound checkers don't +grumble. The value of NUMBER was 10000, but a fuzzer exceeded 5000 capturing +groups, making the ovector larger than this. The number has been increased to +131072, which allows for the maximum number of captures (65535) plus the +overall match. This fixes oss-fuzz issue 5415. + +31. Auto-possessification at the end of a capturing group was dependent on what +follows the group (e.g. /(a+)b/ would auto-possessify the a+) but this caused +incorrect behaviour when the group was called recursively from elsewhere in the +pattern where something different might follow. This bug is an unforseen +consequence of change #1 for 10.30 - the implementation of backtracking into +recursions. Iterators at the ends of capturing groups are no longer considered +for auto-possessification if the pattern contains any recursions. Fixes +Bugzilla #2232. + + +Version 10.30 14-August-2017 +---------------------------- + +1. The main interpreter, pcre2_match(), has been refactored into a new version +that does not use recursive function calls (and therefore the stack) for +remembering backtracking positions. This makes --disable-stack-for-recursion a +NOOP. The new implementation allows backtracking into recursive group calls in +patterns, making it more compatible with Perl, and also fixes some other +hard-to-do issues such as #1887 in Bugzilla. The code is also cleaner because +the old code had a number of fudges to try to reduce stack usage. It seems to +run no slower than the old code. + +A number of bugs in the refactored code were subsequently fixed during testing +before release, but after the code was made available in the repository. These +bugs were never in fully released code, but are noted here for the record. + + (a) If a pattern had fewer capturing parentheses than the ovector supplied in + the match data block, a memory error (detectable by ASAN) occurred after + a match, because the external block was being set from non-existent + internal ovector fields. Fixes oss-fuzz issue 781. + + (b) A pattern with very many capturing parentheses (when the internal frame + size was greater than the initial frame vector on the stack) caused a + crash. A vector on the heap is now set up at the start of matching if the + vector on the stack is not big enough to handle at least 10 frames. + Fixes oss-fuzz issue 783. + + (c) Handling of (*VERB)s in recursions was wrong in some cases. + + (d) Captures in negative assertions that were used as conditions were not + happening if the assertion matched via (*ACCEPT). + + (e) Mark values were not being passed out of recursions. + + (f) Refactor some code in do_callout() to avoid picky compiler warnings about + negative indices. Fixes oss-fuzz issue 1454. + + (g) Similarly refactor the way the variable length ovector is addressed for + similar reasons. Fixes oss-fuzz issue 1465. + +2. Now that pcre2_match() no longer uses recursive function calls (see above), +the "match limit recursion" value seems misnamed. It still exists, and limits +the depth of tree that is searched. To avoid future confusion, it has been +renamed as "depth limit" in all relevant places (--with-depth-limit, +(*LIMIT_DEPTH), pcre2_set_depth_limit(), etc) but the old names are still +available for backwards compatibility. + +3. Hardened pcre2test so as to reduce the number of bugs reported by fuzzers: + + (a) Check for malloc failures when getting memory for the ovector (POSIX) or + the match data block (non-POSIX). + +4. In the 32-bit library in non-UTF mode, an attempt to find a Unicode property +for a character with a code point greater than 0x10ffff (the Unicode maximum) +caused a crash. + +5. If a lookbehind assertion that contained a back reference to a group +appearing later in the pattern was compiled with the PCRE2_ANCHORED option, +undefined actions (often a segmentation fault) could occur, depending on what +other options were set. An example assertion is (?" should be ">=" in opcode check in pcre2_auto_possess.c. + (b) Added some casts to avoid "suspicious implicit sign extension". + (c) Resource leaks in pcre2test in rare error cases. + (d) Avoid warning for never-use case OP_TABLE_LENGTH which is just a fudge + for checking at compile time that tables are the right size. + (e) Add missing "fall through" comment. + +29. Implemented PCRE2_EXTENDED_MORE and related /xx and (?xx) features. + +30. Implement (?n: for PCRE2_NO_AUTO_CAPTURE, because Perl now has this. + +31. If more than one of "push", "pushcopy", or "pushtablescopy" were set in +pcre2test, a crash could occur. + +32. Make -bigstack in RunTest allocate a 64MiB stack (instead of 16MiB) so +that all the tests can run with clang's sanitizing options. + +33. Implement extra compile options in the compile context and add the first +one: PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES. + +34. Implement newline type PCRE2_NEWLINE_NUL. + +35. A lookbehind assertion that had a zero-length branch caused undefined +behaviour when processed by pcre2_dfa_match(). This is oss-fuzz issue 1859. + +36. The match limit value now also applies to pcre2_dfa_match() as there are +patterns that can use up a lot of resources without necessarily recursing very +deeply. (Compare item 10.23/36.) This should fix oss-fuzz #1761. + +37. Implement PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL. + +38. Fix returned offsets from regexec() when REG_STARTEND is used with a +starting offset greater than zero. + +39. Implement REG_PEND (GNU extension) for the POSIX wrapper. + +40. Implement the subject_literal modifier in pcre2test, and allow jitstack on +pattern lines. + +41. Implement PCRE2_LITERAL and use it to support REG_NOSPEC. + +42. Implement PCRE2_EXTRA_MATCH_LINE and PCRE2_EXTRA_MATCH_WORD for the benefit +of pcre2grep. + +43. Re-implement pcre2grep's -F, -w, and -x options using PCRE2_LITERAL, +PCRE2_EXTRA_MATCH_WORD, and PCRE2_EXTRA_MATCH_LINE. This fixes two bugs: + + (a) The -F option did not work for fixed strings containing \E. + (b) The -w option did not work for patterns with multiple branches. + +44. Added configuration options for the SELinux compatible execmem allocator in +JIT. + +45. Increased the limit for searching for a "must be present" code unit in +subjects from 1000 to 2000 for 8-bit searches, since they use memchr() and are +much faster. + +46. Arrange for anchored patterns to record and use "first code unit" data, +because this can give a fast "no match" without searching for a "required code +unit". Previously only non-anchored patterns did this. + +47. Upgraded the Unicode tables from Unicode 8.0.0 to Unicode 10.0.0. + +48. Add the callout_no_where modifier to pcre2test. + +49. Update extended grapheme breaking rules to the latest set that are in +Unicode Standard Annex #29. + +50. Added experimental foreign pattern conversion facilities +(pcre2_pattern_convert() and friends). + +51. Change the macro FWRITE, used in pcre2grep, to FWRITE_IGNORE because FWRITE +is defined in a system header in cygwin. Also modified some of the #ifdefs in +pcre2grep related to Windows and Cygwin support. + +52. Change 3(g) for 10.23 was a bit too zealous. If a hyphen that follows a +character class is the last character in the class, Perl does not give a +warning. PCRE2 now also treats this as a literal. + +53. Related to 52, though PCRE2 was throwing an error for [[:digit:]-X] it was +not doing so for [\d-X] (and similar escapes), as is documented. + +54. Fixed a MIPS issue in the JIT compiler reported by Joshua Kinard. + +55. Fixed a "maybe uninitialized" warning for class_uchardata in \p handling in +pcre2_compile() which could never actually trigger (code should have been cut +out when Unicode support is disabled). + + +Version 10.23 14-February-2017 +------------------------------ + +1. Extended pcre2test with the utf8_input modifier so that it is able to +generate all possible 16-bit and 32-bit code unit values in non-UTF modes. + +2. In any wide-character mode (8-bit UTF or any 16-bit or 32-bit mode), without +PCRE2_UCP set, a negative character type such as \D in a positive class should +cause all characters greater than 255 to match, whatever else is in the class. +There was a bug that caused this not to happen if a Unicode property item was +added to such a class, for example [\D\P{Nd}] or [\W\pL]. + +3. There has been a major re-factoring of the pcre2_compile.c file. Most syntax +checking is now done in the pre-pass that identifies capturing groups. This has +reduced the amount of duplication and made the code tidier. While doing this, +some minor bugs and Perl incompatibilities were fixed, including: + + (a) \Q\E in the middle of a quantifier such as A+\Q\E+ is now ignored instead + of giving an invalid quantifier error. + + (b) {0} can now be used after a group in a lookbehind assertion; previously + this caused an "assertion is not fixed length" error. + + (c) Perl always treats (?(DEFINE) as a "define" group, even if a group with + the name "DEFINE" exists. PCRE2 now does likewise. + + (d) A recursion condition test such as (?(R2)...) must now refer to an + existing subpattern. + + (e) A conditional recursion test such as (?(R)...) misbehaved if there was a + group whose name began with "R". + + (f) When testing zero-terminated patterns under valgrind, the terminating + zero is now marked "no access". This catches bugs that would otherwise + show up only with non-zero-terminated patterns. + + (g) A hyphen appearing immediately after a POSIX character class (for example + /[[:ascii:]-z]/) now generates an error. Perl does accept this as a + literal, but gives a warning, so it seems best to fail it in PCRE. + + (h) An empty \Q\E sequence may appear after a callout that precedes an + assertion condition (it is, of course, ignored). + +One effect of the refactoring is that some error numbers and messages have +changed, and the pattern offset given for compiling errors is not always the +right-most character that has been read. In particular, for a variable-length +lookbehind assertion it now points to the start of the assertion. Another +change is that when a callout appears before a group, the "length of next +pattern item" that is passed now just gives the length of the opening +parenthesis item, not the length of the whole group. A length of zero is now +given only for a callout at the end of the pattern. Automatic callouts are no +longer inserted before and after explicit callouts in the pattern. + +A number of bugs in the refactored code were subsequently fixed during testing +before release, but after the code was made available in the repository. Many +of the bugs were discovered by fuzzing testing. Several of them were related to +the change from assuming a zero-terminated pattern (which previously had +required non-zero terminated strings to be copied). These bugs were never in +fully released code, but are noted here for the record. + + (a) An overall recursion such as (?0) inside a lookbehind assertion was not + being diagnosed as an error. + + (b) In utf mode, the length of a *MARK (or other verb) name was being checked + in characters instead of code units, which could lead to bad code being + compiled, leading to unpredictable behaviour. + + (c) In extended /x mode, characters whose code was greater than 255 caused + a lookup outside one of the global tables. A similar bug existed for wide + characters in *VERB names. + + (d) The amount of memory needed for a compiled pattern was miscalculated if a + lookbehind contained more than one toplevel branch and the first branch + was of length zero. + + (e) In UTF-8 or UTF-16 modes with PCRE2_EXTENDED (/x) set and a non-zero- + terminated pattern, if a # comment ran on to the end of the pattern, one + or more code units past the end were being read. + + (f) An unterminated repeat at the end of a non-zero-terminated pattern (e.g. + "{2,2") could cause reading beyond the pattern. + + (g) When reading a callout string, if the end delimiter was at the end of the + pattern one further code unit was read. + + (h) An unterminated number after \g' could cause reading beyond the pattern. + + (i) An insufficient memory size was being computed for compiling with + PCRE2_AUTO_CALLOUT. + + (j) A conditional group with an assertion condition used more memory than was + allowed for it during parsing, so too many of them could therefore + overrun a buffer. + + (k) If parsing a pattern exactly filled the buffer, the internal test for + overrun did not check when the final META_END item was added. + + (l) If a lookbehind contained a subroutine call, and the called group + contained an option setting such as (?s), and the PCRE2_ANCHORED option + was set, unpredictable behaviour could occur. The underlying bug was + incorrect code and insufficient checking while searching for the end of + the called subroutine in the parsed pattern. + + (m) Quantifiers following (*VERB)s were not being diagnosed as errors. + + (n) The use of \Q...\E in a (*VERB) name when PCRE2_ALT_VERBNAMES and + PCRE2_AUTO_CALLOUT were both specified caused undetermined behaviour. + + (o) If \Q was preceded by a quantified item, and the following \E was + followed by '?' or '+', and there was at least one literal character + between them, an internal error "unexpected repeat" occurred (example: + /.+\QX\E+/). + + (p) A buffer overflow could occur while sorting the names in the group name + list (depending on the order in which the names were seen). + + (q) A conditional group that started with a callout was not doing the right + check for a following assertion, leading to compiling bad code. Example: + /(?(C'XX))?!XX/ + + (r) If a character whose code point was greater than 0xffff appeared within + a lookbehind that was within another lookbehind, the calculation of the + lookbehind length went wrong and could provoke an internal error. + + (t) The sequence \E- or \Q\E- after a POSIX class in a character class caused + an internal error. Now the hyphen is treated as a literal. + +4. Back references are now permitted in lookbehind assertions when there are +no duplicated group numbers (that is, (?| has not been used), and, if the +reference is by name, there is only one group of that name. The referenced +group must, of course be of fixed length. + +5. pcre2test has been upgraded so that, when run under valgrind with valgrind +support enabled, reading past the end of the pattern is detected, both when +compiling and during callout processing. + +6. \g{+} (e.g. \g{+2} ) is now supported. It is a "forward back +reference" and can be useful in repetitions (compare \g{-} ). Perl does +not recognize this syntax. + +7. Automatic callouts are no longer generated before and after callouts in the +pattern. + +8. When pcre2test was outputting information from a callout, the caret indicator +for the current position in the subject line was incorrect if it was after an +escape sequence for a character whose code point was greater than \x{ff}. + +9. Change 19 for 10.22 had a typo (PCRE_STATIC_RUNTIME should be +PCRE2_STATIC_RUNTIME). Fix from David Gaussmann. + +10. Added --max-buffer-size to pcre2grep, to allow for automatic buffer +expansion when long lines are encountered. Original patch by Dmitry +Cherniachenko. + +11. If pcre2grep was compiled with JIT support, but the library was compiled +without it (something that neither ./configure nor CMake allow, but it can be +done by editing config.h), pcre2grep was giving a JIT error. Now it detects +this situation and does not try to use JIT. + +12. Added some "const" qualifiers to variables in pcre2grep. + +13. Added Dmitry Cherniachenko's patch for colouring output in Windows +(untested by me). Also, look for GREP_COLOUR or GREP_COLOR if the environment +variables PCRE2GREP_COLOUR and PCRE2GREP_COLOR are not found. + +14. Add the -t (grand total) option to pcre2grep. + +15. A number of bugs have been mended relating to match start-up optimizations +when the first thing in a pattern is a positive lookahead. These all applied +only when PCRE2_NO_START_OPTIMIZE was *not* set: + + (a) A pattern such as (?=.*X)X$ was incorrectly optimized as if it needed + both an initial 'X' and a following 'X'. + (b) Some patterns starting with an assertion that started with .* were + incorrectly optimized as having to match at the start of the subject or + after a newline. There are cases where this is not true, for example, + (?=.*[A-Z])(?=.{8,16})(?!.*[\s]) matches after the start in lines that + start with spaces. Starting .* in an assertion is no longer taken as an + indication of matching at the start (or after a newline). + +16. The "offset" modifier in pcre2test was not being ignored (as documented) +when the POSIX API was in use. + +17. Added --enable-fuzz-support to "configure", causing an non-installed +library containing a test function that can be called by fuzzers to be +compiled. A non-installed binary to run the test function locally, called +pcre2fuzzcheck is also compiled. + +18. A pattern with PCRE2_DOTALL (/s) set but not PCRE2_NO_DOTSTAR_ANCHOR, and +which started with .* inside a positive lookahead was incorrectly being +compiled as implicitly anchored. + +19. Removed all instances of "register" declarations, as they are considered +obsolete these days and in any case had become very haphazard. + +20. Add strerror() to pcre2test for failed file opening. + +21. Make pcre2test -C list valgrind support when it is enabled. + +22. Add the use_length modifier to pcre2test. + +23. Fix an off-by-one bug in pcre2test for the list of names for 'get' and +'copy' modifiers. + +24. Add PCRE2_CALL_CONVENTION into the prototype declarations in pcre2.h as it +is apparently needed there as well as in the function definitions. (Why did +nobody ask for this in PCRE1?) + +25. Change the _PCRE2_H and _PCRE2_UCP_H guard macros in the header files to +PCRE2_H_IDEMPOTENT_GUARD and PCRE2_UCP_H_IDEMPOTENT_GUARD to be more standard +compliant and unique. + +26. pcre2-config --libs-posix was listing -lpcre2posix instead of +-lpcre2-posix. Also, the CMake build process was building the library with the +wrong name. + +27. In pcre2test, give some offset information for errors in hex patterns. +This uses the C99 formatting sequence %td, except for MSVC which doesn't +support it - %lu is used instead. + +28. Implemented pcre2_code_copy_with_tables(), and added pushtablescopy to +pcre2test for testing it. + +29. Fix small memory leak in pcre2test. + +30. Fix out-of-bounds read for partial matching of /./ against an empty string +when the newline type is CRLF. + +31. Fix a bug in pcre2test that caused a crash when a locale was set either in +the current pattern or a previous one and a wide character was matched. + +32. The appearance of \p, \P, or \X in a substitution string when +PCRE2_SUBSTITUTE_EXTENDED was set caused a segmentation fault (NULL +dereference). + +33. If the starting offset was specified as greater than the subject length in +a call to pcre2_substitute() an out-of-bounds memory reference could occur. + +34. When PCRE2 was compiled to use the heap instead of the stack for recursive +calls to match(), a repeated minimizing caseless back reference, or a +maximizing one where the two cases had different numbers of code units, +followed by a caseful back reference, could lose the caselessness of the first +repeated back reference (example: /(Z)(a)\2{1,2}?(?-i)\1X/i should match ZaAAZX +but didn't). + +35. When a pattern is too complicated, PCRE2 gives up trying to find a minimum +matching length and just records zero. Typically this happens when there are +too many nested or recursive back references. If the limit was reached in +certain recursive cases it failed to be triggered and an internal error could +be the result. + +36. The pcre2_dfa_match() function now takes note of the recursion limit for +the internal recursive calls that are used for lookrounds and recursions within +the pattern. + +37. More refactoring has got rid of the internal could_be_empty_branch() +function (around 400 lines of code, including comments) by keeping track of +could-be-emptiness as the pattern is compiled instead of scanning compiled +groups. (This would have been much harder before the refactoring of #3 above.) +This lifts a restriction on the number of branches in a group (more than about +1100 would give "pattern is too complicated"). + +38. Add the "-ac" command line option to pcre2test as a synonym for "-pattern +auto_callout". + +39. In a library with Unicode support, incorrect data was compiled for a +pattern with PCRE2_UCP set without PCRE2_UTF if a class required all wide +characters to match (for example, /[\s[:^ascii:]]/). + +40. The callout_error modifier has been added to pcre2test to make it possible +to return PCRE2_ERROR_CALLOUT from a callout. + +41. A minor change to pcre2grep: colour reset is now "[0m" instead of +"[00m". + +42. The limit in the auto-possessification code that was intended to catch +overly-complicated patterns and not spend too much time auto-possessifying was +being reset too often, resulting in very long compile times for some patterns. +Now such patterns are no longer completely auto-possessified. + +43. Applied Jason Hood's revised patch for RunTest.bat. + +44. Added a new Windows script RunGrepTest.bat, courtesy of Jason Hood. + +45. Minor cosmetic fix to pcre2test: move a variable that is not used under +Windows into the "not Windows" code. + +46. Applied Jason Hood's patches to upgrade pcre2grep under Windows and tidy +some of the code: + + * normalised the Windows condition by ensuring WIN32 is defined; + * enables the callout feature under Windows; + * adds globbing (Microsoft's implementation expands quoted args), + using a tweaked opendirectory; + * implements the is_*_tty functions for Windows; + * --color=always will write the ANSI sequences to file; + * add sequences 4 (underline works on Win10) and 5 (blink as bright + background, relatively standard on DOS/Win); + * remove the (char *) casts for the now-const strings; + * remove GREP_COLOUR (grep's command line allowed the 'u', but not + the environment), parsing GREP_COLORS instead; + * uses the current colour if not set, rather than black; + * add print_match for the undefined case; + * fixes a typo. + +In addition, colour settings containing anything other than digits and +semicolon are ignored, and the colour controls are no longer output for empty +strings. + +47. Detecting patterns that are too large inside the length-measuring loop +saves processing ridiculously long patterns to their end. + +48. Ignore PCRE2_CASELESS when processing \h, \H, \v, and \V in classes as it +just wastes time. In the UTF case it can also produce redundant entries in +XCLASS lists caused by characters with multiple other cases and pairs of +characters in the same "not-x" sublists. + +49. A pattern such as /(?=(a\K))/ can report the end of the match being before +its start; pcre2test was not handling this correctly when using the POSIX +interface (it was OK with the native interface). + +50. In pcre2grep, ignore all JIT compile errors. This means that pcre2grep will +continue to work, falling back to interpretation if anything goes wrong with +JIT. + +51. Applied patches from Christian Persch to configure.ac to make use of the +AC_USE_SYSTEM_EXTENSIONS macro and to test for functions used by the JIT +modules. + +52. Minor fixes to pcre2grep from Jason Hood: + * fixed some spacing; + * Windows doesn't usually use single quotes, so I've added a define + to use appropriate quotes [in an example]; + * LC_ALL was displayed as "LCC_ALL"; + * numbers 11, 12 & 13 should end in "th"; + * use double quotes in usage message. + +53. When autopossessifying, skip empty branches without recursion, to reduce +stack usage for the benefit of clang with -fsanitize-address, which uses huge +stack frames. Example pattern: /X?(R||){3335}/. Fixes oss-fuzz issue 553. + +54. A pattern with very many explicit back references to a group that is a long +way from the start of the pattern could take a long time to compile because +searching for the referenced group in order to find the minimum length was +being done repeatedly. Now up to 128 group minimum lengths are cached and the +attempt to find a minimum length is abandoned if there is a back reference to a +group whose number is greater than 128. (In that case, the pattern is so +complicated that this optimization probably isn't worth it.) This fixes +oss-fuzz issue 557. + +55. Issue 32 for 10.22 below was not correctly fixed. If pcre2grep in multiline +mode with --only-matching matched several lines, it restarted scanning at the +next line instead of moving on to the end of the matched string, which can be +several lines after the start. + +56. Applied Jason Hood's new patch for RunGrepTest.bat that updates it in line +with updates to the non-Windows version. + + + +Version 10.22 29-July-2016 +-------------------------- + +1. Applied Jason Hood's patches to RunTest.bat and testdata/wintestoutput3 +to fix problems with running the tests under Windows. + +2. Implemented a facility for quoting literal characters within hexadecimal +patterns in pcre2test, to make it easier to create patterns with just a few +non-printing characters. + +3. Binary zeros are not supported in pcre2test input files. It now detects them +and gives an error. + +4. Updated the valgrind parameters in RunTest: (a) changed smc-check=all to +smc-check=all-non-file; (b) changed obj:* in the suppression file to obj:??? so +that it matches only unknown objects. + +5. Updated the maintenance script maint/ManyConfigTests to make it easier to +select individual groups of tests. + +6. When the POSIX wrapper function regcomp() is called, the REG_NOSUB option +used to set PCRE2_NO_AUTO_CAPTURE when calling pcre2_compile(). However, this +disables the use of back references (and subroutine calls), which are supported +by other implementations of regcomp() with RE_NOSUB. Therefore, REG_NOSUB no +longer causes PCRE2_NO_AUTO_CAPTURE to be set, though it still ignores nmatch +and pmatch when regexec() is called. + +7. Because of 6 above, pcre2test has been modified with a new modifier called +posix_nosub, to call regcomp() with REG_NOSUB. Previously the no_auto_capture +modifier had this effect. That option is now ignored when the POSIX API is in +use. + +8. Minor tidies to the pcre2demo.c sample program, including more comments +about its 8-bit-ness. + +9. Detect unmatched closing parentheses and give the error in the pre-scan +instead of later. Previously the pre-scan carried on and could give a +misleading incorrect error message. For example, /(?J)(?'a'))(?'a')/ gave a +message about invalid duplicate group names. + +10. It has happened that pcre2test was accidentally linked with another POSIX +regex library instead of libpcre2-posix. In this situation, a call to regcomp() +(in the other library) may succeed, returning zero, but of course putting its +own data into the regex_t block. In one example the re_pcre2_code field was +left as NULL, which made pcre2test think it had not got a compiled POSIX regex, +so it treated the next line as another pattern line, resulting in a confusing +error message. A check has been added to pcre2test to see if the data returned +from a successful call of regcomp() are valid for PCRE2's regcomp(). If they +are not, an error message is output and the pcre2test run is abandoned. The +message points out the possibility of a mis-linking. Hopefully this will avoid +some head-scratching the next time this happens. + +11. A pattern such as /(?<=((?C)0))/, which has a callout inside a lookbehind +assertion, caused pcre2test to output a very large number of spaces when the +callout was taken, making the program appearing to loop. + +12. A pattern that included (*ACCEPT) in the middle of a sufficiently deeply +nested set of parentheses of sufficient size caused an overflow of the +compiling workspace (which was diagnosed, but of course is not desirable). + +13. Detect missing closing parentheses during the pre-pass for group +identification. + +14. Changed some integer variable types and put in a number of casts, following +a report of compiler warnings from Visual Studio 2013 and a few tests with +gcc's -Wconversion (which still throws up a lot). + +15. Implemented pcre2_code_copy(), and added pushcopy and #popcopy to pcre2test +for testing it. + +16. Change 66 for 10.21 introduced the use of snprintf() in PCRE2's version of +regerror(). When the error buffer is too small, my version of snprintf() puts a +binary zero in the final byte. Bug #1801 seems to show that other versions do +not do this, leading to bad output from pcre2test when it was checking for +buffer overflow. It no longer assumes a binary zero at the end of a too-small +regerror() buffer. + +17. Fixed typo ("&&" for "&") in pcre2_study(). Fortunately, this could not +actually affect anything, by sheer luck. + +18. Two minor fixes for MSVC compilation: (a) removal of apparently incorrect +"const" qualifiers in pcre2test and (b) defining snprintf as _snprintf for +older MSVC compilers. This has been done both in src/pcre2_internal.h for most +of the library, and also in src/pcre2posix.c, which no longer includes +pcre2_internal.h (see 24 below). + +19. Applied Chris Wilson's patch (Bugzilla #1681) to CMakeLists.txt for MSVC +static compilation. Subsequently applied Chris Wilson's second patch, putting +the first patch under a new option instead of being unconditional when +PCRE_STATIC is set. + +20. Updated pcre2grep to set stdout as binary when run under Windows, so as not +to convert \r\n at the ends of reflected lines into \r\r\n. This required +ensuring that other output that is written to stdout (e.g. file names) uses the +appropriate line terminator: \r\n for Windows, \n otherwise. + +21. When a line is too long for pcre2grep's internal buffer, show the maximum +length in the error message. + +22. Added support for string callouts to pcre2grep (Zoltan's patch with PH +additions). + +23. RunTest.bat was missing a "set type" line for test 22. + +24. The pcre2posix.c file was including pcre2_internal.h, and using some +"private" knowledge of the data structures. This is unnecessary; the code has +been re-factored and no longer includes pcre2_internal.h. + +25. A racing condition is fixed in JIT reported by Mozilla. + +26. Minor code refactor to avoid "array subscript is below array bounds" +compiler warning. + +27. Minor code refactor to avoid "left shift of negative number" warning. + +28. Add a bit more sanity checking to pcre2_serialize_decode() and document +that it expects trusted data. + +29. Fix typo in pcre2_jit_test.c + +30. Due to an oversight, pcre2grep was not making use of JIT when available. +This is now fixed. + +31. The RunGrepTest script is updated to use the valgrind suppressions file +when testing with JIT under valgrind (compare 10.21/51 below). The suppressions +file is updated so that is now the same as for PCRE1: it suppresses the +Memcheck warnings Addr16 and Cond in unknown objects (that is, JIT-compiled +code). Also changed smc-check=all to smc-check=all-non-file as was done for +RunTest (see 4 above). + +32. Implemented the PCRE2_NO_JIT option for pcre2_match(). + +33. Fix typo that gave a compiler error when JIT not supported. + +34. Fix comment describing the returns from find_fixedlength(). + +35. Fix potential negative index in pcre2test. + +36. Calls to pcre2_get_error_message() with error numbers that are never +returned by PCRE2 functions were returning empty strings. Now the error code +PCRE2_ERROR_BADDATA is returned. A facility has been added to pcre2test to +show the texts for given error numbers (i.e. to call pcre2_get_error_message() +and display what it returns) and a few representative error codes are now +checked in RunTest. + +37. Added "&& !defined(__INTEL_COMPILER)" to the test for __GNUC__ in +pcre2_match.c, in anticipation that this is needed for the same reason it was +recently added to pcrecpp.cc in PCRE1. + +38. Using -o with -M in pcre2grep could cause unnecessary repeated output when +the match extended over a line boundary, as it tried to find more matches "on +the same line" - but it was already over the end. + +39. Allow \C in lookbehinds and DFA matching in UTF-32 mode (by converting it +to the same code as '.' when PCRE2_DOTALL is set). + +40. Fix two clang compiler warnings in pcre2test when only one code unit width +is supported. + +41. Upgrade RunTest to automatically re-run test 2 with a large (64MiB) stack +if it fails when running the interpreter with a 16MiB stack (and if changing +the stack size via pcre2test is possible). This avoids having to manually set a +large stack size when testing with clang. + +42. Fix register overwrite in JIT when SSE2 acceleration is enabled. + +43. Detect integer overflow in pcre2test pattern and data repetition counts. + +44. In pcre2test, ignore "allcaptures" after DFA matching. + +45. Fix unaligned accesses on x86. Patch by Marc Mutz. + +46. Fix some more clang compiler warnings. + + +Version 10.21 12-January-2016 +----------------------------- + +1. Improve matching speed of patterns starting with + or * in JIT. + +2. Use memchr() to find the first character in an unanchored match in 8-bit +mode in the interpreter. This gives a significant speed improvement. + +3. Removed a redundant copy of the opcode_possessify table in the +pcre2_auto_possessify.c source. + +4. Fix typos in dftables.c for z/OS. + +5. Change 36 for 10.20 broke the handling of [[:>:]] and [[:<:]] in that +processing them could involve a buffer overflow if the following character was +an opening parenthesis. + +6. Change 36 for 10.20 also introduced a bug in processing this pattern: +/((?x)(*:0))#(?'/. Specifically: if a setting of (?x) was followed by a (*MARK) +setting (which (*:0) is), then (?x) did not get unset at the end of its group +during the scan for named groups, and hence the external # was incorrectly +treated as a comment and the invalid (?' at the end of the pattern was not +diagnosed. This caused a buffer overflow during the real compile. This bug was +discovered by Karl Skomski with the LLVM fuzzer. + +7. Moved the pcre2_find_bracket() function from src/pcre2_compile.c into its +own source module to avoid a circular dependency between src/pcre2_compile.c +and src/pcre2_study.c + +8. A callout with a string argument containing an opening square bracket, for +example /(?C$[$)(?<]/, was incorrectly processed and could provoke a buffer +overflow. This bug was discovered by Karl Skomski with the LLVM fuzzer. + +9. The handling of callouts during the pre-pass for named group identification +has been tightened up. + +10. The quantifier {1} can be ignored, whether greedy, non-greedy, or +possessive. This is a very minor optimization. + +11. A possessively repeated conditional group that could match an empty string, +for example, /(?(R))*+/, was incorrectly compiled. + +12. The Unicode tables have been updated to Unicode 8.0.0 (thanks to Christian +Persch). + +13. An empty comment (?#) in a pattern was incorrectly processed and could +provoke a buffer overflow. This bug was discovered by Karl Skomski with the +LLVM fuzzer. + +14. Fix infinite recursion in the JIT compiler when certain patterns such as +/(?:|a|){100}x/ are analysed. + +15. Some patterns with character classes involving [: and \\ were incorrectly +compiled and could cause reading from uninitialized memory or an incorrect +error diagnosis. Examples are: /[[:\\](?<[::]/ and /[[:\\](?'abc')[a:]. The +first of these bugs was discovered by Karl Skomski with the LLVM fuzzer. + +16. Pathological patterns containing many nested occurrences of [: caused +pcre2_compile() to run for a very long time. This bug was found by the LLVM +fuzzer. + +17. A missing closing parenthesis for a callout with a string argument was not +being diagnosed, possibly leading to a buffer overflow. This bug was found by +the LLVM fuzzer. + +18. A conditional group with only one branch has an implicit empty alternative +branch and must therefore be treated as potentially matching an empty string. + +19. If (?R was followed by - or + incorrect behaviour happened instead of a +diagnostic. This bug was discovered by Karl Skomski with the LLVM fuzzer. + +20. Another bug that was introduced by change 36 for 10.20: conditional groups +whose condition was an assertion preceded by an explicit callout with a string +argument might be incorrectly processed, especially if the string contained \Q. +This bug was discovered by Karl Skomski with the LLVM fuzzer. + +21. Compiling PCRE2 with the sanitize options of clang showed up a number of +very pedantic coding infelicities and a buffer overflow while checking a UTF-8 +string if the final multi-byte UTF-8 character was truncated. + +22. For Perl compatibility in EBCDIC environments, ranges such as a-z in a +class, where both values are literal letters in the same case, omit the +non-letter EBCDIC code points within the range. + +23. Finding the minimum matching length of complex patterns with back +references and/or recursions can take a long time. There is now a cut-off that +gives up trying to find a minimum length when things get too complex. + +24. An optimization has been added that speeds up finding the minimum matching +length for patterns containing repeated capturing groups or recursions. + +25. If a pattern contained a back reference to a group whose number was +duplicated as a result of appearing in a (?|...) group, the computation of the +minimum matching length gave a wrong result, which could cause incorrect "no +match" errors. For such patterns, a minimum matching length cannot at present +be computed. + +26. Added a check for integer overflow in conditions (?() and +(?(R). This omission was discovered by Karl Skomski with the LLVM +fuzzer. + +27. Fixed an issue when \p{Any} inside an xclass did not read the current +character. + +28. If pcre2grep was given the -q option with -c or -l, or when handling a +binary file, it incorrectly wrote output to stdout. + +29. The JIT compiler did not restore the control verb head in case of *THEN +control verbs. This issue was found by Karl Skomski with a custom LLVM fuzzer. + +30. The way recursive references such as (?3) are compiled has been re-written +because the old way was the cause of many issues. Now, conversion of the group +number into a pattern offset does not happen until the pattern has been +completely compiled. This does mean that detection of all infinitely looping +recursions is postponed till match time. In the past, some easy ones were +detected at compile time. This re-writing was done in response to yet another +bug found by the LLVM fuzzer. + +31. A test for a back reference to a non-existent group was missing for items +such as \987. This caused incorrect code to be compiled. This issue was found +by Karl Skomski with a custom LLVM fuzzer. + +32. Error messages for syntax errors following \g and \k were giving inaccurate +offsets in the pattern. + +33. Improve the performance of starting single character repetitions in JIT. + +34. (*LIMIT_MATCH=) now gives an error instead of setting the value to 0. + +35. Error messages for syntax errors in *LIMIT_MATCH and *LIMIT_RECURSION now +give the right offset instead of zero. + +36. The JIT compiler should not check repeats after a {0,1} repeat byte code. +This issue was found by Karl Skomski with a custom LLVM fuzzer. + +37. The JIT compiler should restore the control chain for empty possessive +repeats. This issue was found by Karl Skomski with a custom LLVM fuzzer. + +38. A bug which was introduced by the single character repetition optimization +was fixed. + +39. Match limit check added to recursion. This issue was found by Karl Skomski +with a custom LLVM fuzzer. + +40. Arrange for the UTF check in pcre2_match() and pcre2_dfa_match() to look +only at the part of the subject that is relevant when the starting offset is +non-zero. + +41. Improve first character match in JIT with SSE2 on x86. + +42. Fix two assertion fails in JIT. These issues were found by Karl Skomski +with a custom LLVM fuzzer. + +43. Correct the setting of CMAKE_C_FLAGS in CMakeLists.txt (patch from Roy Ivy +III). + +44. Fix bug in RunTest.bat for new test 14, and adjust the script for the added +test (there are now 20 in total). + +45. Fixed a corner case of range optimization in JIT. + +46. Add the ${*MARK} facility to pcre2_substitute(). + +47. Modifier lists in pcre2test were splitting at spaces without the required +commas. + +48. Implemented PCRE2_ALT_VERBNAMES. + +49. Fixed two issues in JIT. These were found by Karl Skomski with a custom +LLVM fuzzer. + +50. The pcre2test program has been extended by adding the #newline_default +command. This has made it possible to run the standard tests when PCRE2 is +compiled with either CR or CRLF as the default newline convention. As part of +this work, the new command was added to several test files and the testing +scripts were modified. The pcre2grep tests can now also be run when there is no +LF in the default newline convention. + +51. The RunTest script has been modified so that, when JIT is used and valgrind +is specified, a valgrind suppressions file is set up to ignore "Invalid read of +size 16" errors because these are false positives when the hardware supports +the SSE2 instruction set. + +52. It is now possible to have comment lines amid the subject strings in +pcre2test (and perltest.sh) input. + +53. Implemented PCRE2_USE_OFFSET_LIMIT and pcre2_set_offset_limit(). + +54. Add the null_context modifier to pcre2test so that calling pcre2_compile() +and the matching functions with NULL contexts can be tested. + +55. Implemented PCRE2_SUBSTITUTE_EXTENDED. + +56. In a character class such as [\W\p{Any}] where both a negative-type escape +("not a word character") and a property escape were present, the property +escape was being ignored. + +57. Fixed integer overflow for patterns whose minimum matching length is very, +very large. + +58. Implemented --never-backslash-C. + +59. Change 55 above introduced a bug by which certain patterns provoked the +erroneous error "\ at end of pattern". + +60. The special sequences [[:<:]] and [[:>:]] gave rise to incorrect compiling +errors or other strange effects if compiled in UCP mode. Found with libFuzzer +and AddressSanitizer. + +61. Whitespace at the end of a pcre2test pattern line caused a spurious error +message if there were only single-character modifiers. It should be ignored. + +62. The use of PCRE2_NO_AUTO_CAPTURE could cause incorrect compilation results +or segmentation errors for some patterns. Found with libFuzzer and +AddressSanitizer. + +63. Very long names in (*MARK) or (*THEN) etc. items could provoke a buffer +overflow. + +64. Improve error message for overly-complicated patterns. + +65. Implemented an optional replication feature for patterns in pcre2test, to +make it easier to test long repetitive patterns. The tests for 63 above are +converted to use the new feature. + +66. In the POSIX wrapper, if regerror() was given too small a buffer, it could +misbehave. + +67. In pcre2_substitute() in UTF mode, the UTF validity check on the +replacement string was happening before the length setting when the replacement +string was zero-terminated. + +68. In pcre2_substitute() in UTF mode, PCRE2_NO_UTF_CHECK can be set for the +second and subsequent calls to pcre2_match(). + +69. There was no check for integer overflow for a replacement group number in +pcre2_substitute(). An added check for a number greater than the largest group +number in the pattern means this is not now needed. + +70. The PCRE2-specific VERSION condition didn't work correctly if only one +digit was given after the decimal point, or if more than two digits were given. +It now works with one or two digits, and gives a compile time error if more are +given. + +71. In pcre2_substitute() there was the possibility of reading one code unit +beyond the end of the replacement string. + +72. The code for checking a subject's UTF-32 validity for a pattern with a +lookbehind involved an out-of-bounds pointer, which could potentially cause +trouble in some environments. + +73. The maximum lookbehind length was incorrectly calculated for patterns such +as /(?<=(a)(?-1))x/ which have a recursion within a backreference. + +74. Give an error if a lookbehind assertion is longer than 65535 code units. + +75. Give an error in pcre2_substitute() if a match ends before it starts (as a +result of the use of \K). + +76. Check the length of subpattern names and the names in (*MARK:xx) etc. +dynamically to avoid the possibility of integer overflow. + +77. Implement pcre2_set_max_pattern_length() so that programs can restrict the +size of patterns that they are prepared to handle. + +78. (*NO_AUTO_POSSESS) was not working. + +79. Adding group information caching improves the speed of compiling when +checking whether a group has a fixed length and/or could match an empty string, +especially when recursion or subroutine calls are involved. However, this +cannot be used when (?| is present in the pattern because the same number may +be used for groups of different sizes. To catch runaway patterns in this +situation, counts have been introduced to the functions that scan for empty +branches or compute fixed lengths. + +80. Allow for the possibility of the size of the nest_save structure not being +a factor of the size of the compiling workspace (it currently is). + +81. Check for integer overflow in minimum length calculation and cap it at +65535. + +82. Small optimizations in code for finding the minimum matching length. + +83. Lock out configuring for EBCDIC with non-8-bit libraries. + +84. Test for error code <= 0 in regerror(). + +85. Check for too many replacements (more than INT_MAX) in pcre2_substitute(). + +86. Avoid the possibility of computing with an out-of-bounds pointer (though +not dereferencing it) while handling lookbehind assertions. + +87. Failure to get memory for the match data in regcomp() is now given as a +regcomp() error instead of waiting for regexec() to pick it up. + +88. In pcre2_substitute(), ensure that CRLF is not split when it is a valid +newline sequence. + +89. Paranoid check in regcomp() for bad error code from pcre2_compile(). + +90. Run test 8 (internal offsets and code sizes) for link sizes 3 and 4 as well +as for link size 2. + +91. Document that JIT has a limit on pattern size, and give more information +about JIT compile failures in pcre2test. + +92. Implement PCRE2_INFO_HASBACKSLASHC. + +93. Re-arrange valgrind support code in pcre2test to avoid spurious reports +with JIT (possibly caused by SSE2?). + +94. Support offset_limit in JIT. + +95. A sequence such as [[:punct:]b] that is, a POSIX character class followed +by a single ASCII character in a class item, was incorrectly compiled in UCP +mode. The POSIX class got lost, but only if the single character followed it. + +96. [:punct:] in UCP mode was matching some characters in the range 128-255 +that should not have been matched. + +97. If [:^ascii:] or [:^xdigit:] are present in a non-negated class, all +characters with code points greater than 255 are in the class. When a Unicode +property was also in the class (if PCRE2_UCP is set, escapes such as \w are +turned into Unicode properties), wide characters were not correctly handled, +and could fail to match. + +98. In pcre2test, make the "startoffset" modifier a synonym of "offset", +because it sets the "startoffset" parameter for pcre2_match(). + +99. If PCRE2_AUTO_CALLOUT was set on a pattern that had a (?# comment between +an item and its qualifier (for example, A(?#comment)?B) pcre2_compile() +misbehaved. This bug was found by the LLVM fuzzer. + +100. The error for an invalid UTF pattern string always gave the code unit +offset as zero instead of where the invalidity was found. + +101. Further to 97 above, negated classes such as [^[:^ascii:]\d] were also not +working correctly in UCP mode. + +102. Similar to 99 above, if an isolated \E was present between an item and its +qualifier when PCRE2_AUTO_CALLOUT was set, pcre2_compile() misbehaved. This bug +was found by the LLVM fuzzer. + +103. The POSIX wrapper function regexec() crashed if the option REG_STARTEND +was set when the pmatch argument was NULL. It now returns REG_INVARG. + +104. Allow for up to 32-bit numbers in the ordin() function in pcre2grep. + +105. An empty \Q\E sequence between an item and its qualifier caused +pcre2_compile() to misbehave when auto callouts were enabled. This bug +was found by the LLVM fuzzer. + +106. If both PCRE2_ALT_VERBNAMES and PCRE2_EXTENDED were set, and a (*MARK) or +other verb "name" ended with whitespace immediately before the closing +parenthesis, pcre2_compile() misbehaved. Example: /(*:abc )/, but only when +both those options were set. + +107. In a number of places pcre2_compile() was not handling NULL characters +correctly, and pcre2test with the "bincode" modifier was not always correctly +displaying fields containing NULLS: + + (a) Within /x extended #-comments + (b) Within the "name" part of (*MARK) and other *verbs + (c) Within the text argument of a callout + +108. If a pattern that was compiled with PCRE2_EXTENDED started with white +space or a #-type comment that was followed by (?-x), which turns off +PCRE2_EXTENDED, and there was no subsequent (?x) to turn it on again, +pcre2_compile() assumed that (?-x) applied to the whole pattern and +consequently mis-compiled it. This bug was found by the LLVM fuzzer. The fix +for this bug means that a setting of any of the (?imsxJU) options at the start +of a pattern is no longer transferred to the options that are returned by +PCRE2_INFO_ALLOPTIONS. In fact, this was an anachronism that should have +changed when the effects of those options were all moved to compile time. + +109. An escaped closing parenthesis in the "name" part of a (*verb) when +PCRE2_ALT_VERBNAMES was set caused pcre2_compile() to malfunction. This bug +was found by the LLVM fuzzer. + +110. Implemented PCRE2_SUBSTITUTE_UNSET_EMPTY, and updated pcre2test to make it +possible to test it. + +111. "Harden" pcre2test against ridiculously large values in modifiers and +command line arguments. + +112. Implemented PCRE2_SUBSTITUTE_UNKNOWN_UNSET and PCRE2_SUBSTITUTE_OVERFLOW_ +LENGTH. + +113. Fix printing of *MARK names that contain binary zeroes in pcre2test. + + +Version 10.20 30-June-2015 +-------------------------- + +1. Callouts with string arguments have been added. + +2. Assertion code generator in JIT has been optimized. + +3. The invalid pattern (?(?C) has a missing assertion condition at the end. The +pcre2_compile() function read past the end of the input before diagnosing an +error. This bug was discovered by the LLVM fuzzer. + +4. Implemented pcre2_callout_enumerate(). + +5. Fix JIT compilation of conditional blocks whose assertion is converted to +(*FAIL). E.g: /(?(?!))/. + +6. The pattern /(?(?!)^)/ caused references to random memory. This bug was +discovered by the LLVM fuzzer. + +7. The assertion (?!) is optimized to (*FAIL). This was not handled correctly +when this assertion was used as a condition, for example (?(?!)a|b). In +pcre2_match() it worked by luck; in pcre2_dfa_match() it gave an incorrect +error about an unsupported item. + +8. For some types of pattern, for example /Z*(|d*){216}/, the auto- +possessification code could take exponential time to complete. A recursion +depth limit of 1000 has been imposed to limit the resources used by this +optimization. This infelicity was discovered by the LLVM fuzzer. + +9. A pattern such as /(*UTF)[\S\V\H]/, which contains a negated special class +such as \S in non-UCP mode, explicit wide characters (> 255) can be ignored +because \S ensures they are all in the class. The code for doing this was +interacting badly with the code for computing the amount of space needed to +compile the pattern, leading to a buffer overflow. This bug was discovered by +the LLVM fuzzer. + +10. A pattern such as /((?2)+)((?1))/ which has mutual recursion nested inside +other kinds of group caused stack overflow at compile time. This bug was +discovered by the LLVM fuzzer. + +11. A pattern such as /(?1)(?#?'){8}(a)/ which had a parenthesized comment +between a subroutine call and its quantifier was incorrectly compiled, leading +to buffer overflow or other errors. This bug was discovered by the LLVM fuzzer. + +12. The illegal pattern /(?(?.*!.*)?)/ was not being diagnosed as missing an +assertion after (?(. The code was failing to check the character after (?(?< +for the ! or = that would indicate a lookbehind assertion. This bug was +discovered by the LLVM fuzzer. + +13. A pattern such as /X((?2)()*+){2}+/ which has a possessive quantifier with +a fixed maximum following a group that contains a subroutine reference was +incorrectly compiled and could trigger buffer overflow. This bug was discovered +by the LLVM fuzzer. + +14. Negative relative recursive references such as (?-7) to non-existent +subpatterns were not being diagnosed and could lead to unpredictable behaviour. +This bug was discovered by the LLVM fuzzer. + +15. The bug fixed in 14 was due to an integer variable that was unsigned when +it should have been signed. Some other "int" variables, having been checked, +have either been changed to uint32_t or commented as "must be signed". + +16. A mutual recursion within a lookbehind assertion such as (?<=((?2))((?1))) +caused a stack overflow instead of the diagnosis of a non-fixed length +lookbehind assertion. This bug was discovered by the LLVM fuzzer. + +17. The use of \K in a positive lookbehind assertion in a non-anchored pattern +(e.g. /(?<=\Ka)/) could make pcre2grep loop. + +18. There was a similar problem to 17 in pcre2test for global matches, though +the code there did catch the loop. + +19. If a greedy quantified \X was preceded by \C in UTF mode (e.g. \C\X*), +and a subsequent item in the pattern caused a non-match, backtracking over the +repeated \X did not stop, but carried on past the start of the subject, causing +reference to random memory and/or a segfault. There were also some other cases +where backtracking after \C could crash. This set of bugs was discovered by the +LLVM fuzzer. + +20. The function for finding the minimum length of a matching string could take +a very long time if mutual recursion was present many times in a pattern, for +example, /((?2){73}(?2))((?1))/. A better mutual recursion detection method has +been implemented. This infelicity was discovered by the LLVM fuzzer. + +21. Implemented PCRE2_NEVER_BACKSLASH_C. + +22. The feature for string replication in pcre2test could read from freed +memory if the replication required a buffer to be extended, and it was not +working properly in 16-bit and 32-bit modes. This issue was discovered by a +fuzzer: see http://lcamtuf.coredump.cx/afl/. + +23. Added the PCRE2_ALT_CIRCUMFLEX option. + +24. Adjust the treatment of \8 and \9 to be the same as the current Perl +behaviour. + +25. Static linking against the PCRE2 library using the pkg-config module was +failing on missing pthread symbols. + +26. If a group that contained a recursive back reference also contained a +forward reference subroutine call followed by a non-forward-reference +subroutine call, for example /.((?2)(?R)\1)()/, pcre2_compile() failed to +compile correct code, leading to undefined behaviour or an internally detected +error. This bug was discovered by the LLVM fuzzer. + +27. Quantification of certain items (e.g. atomic back references) could cause +incorrect code to be compiled when recursive forward references were involved. +For example, in this pattern: /(?1)()((((((\1++))\x85)+)|))/. This bug was +discovered by the LLVM fuzzer. + +28. A repeated conditional group whose condition was a reference by name caused +a buffer overflow if there was more than one group with the given name. This +bug was discovered by the LLVM fuzzer. + +29. A recursive back reference by name within a group that had the same name as +another group caused a buffer overflow. For example: /(?J)(?'d'(?'d'\g{d}))/. +This bug was discovered by the LLVM fuzzer. + +30. A forward reference by name to a group whose number is the same as the +current group, for example in this pattern: /(?|(\k'Pm')|(?'Pm'))/, caused a +buffer overflow at compile time. This bug was discovered by the LLVM fuzzer. + +31. Fix -fsanitize=undefined warnings for left shifts of 1 by 31 (it treats 1 +as an int; fixed by writing it as 1u). + +32. Fix pcre2grep compile when -std=c99 is used with gcc, though it still gives +a warning for "fileno" unless -std=gnu99 us used. + +33. A lookbehind assertion within a set of mutually recursive subpatterns could +provoke a buffer overflow. This bug was discovered by the LLVM fuzzer. + +34. Give an error for an empty subpattern name such as (?''). + +35. Make pcre2test give an error if a pattern that follows #forbud_utf contains +\P, \p, or \X. + +36. The way named subpatterns are handled has been refactored. There is now a +pre-pass over the regex which does nothing other than identify named +subpatterns and count the total captures. This means that information about +named patterns is known before the rest of the compile. In particular, it means +that forward references can be checked as they are encountered. Previously, the +code for handling forward references was contorted and led to several errors in +computing the memory requirements for some patterns, leading to buffer +overflows. + +37. There was no check for integer overflow in subroutine calls such as (?123). + +38. The table entry for \l in EBCDIC environments was incorrect, leading to its +being treated as a literal 'l' instead of causing an error. + +39. If a non-capturing group containing a conditional group that could match +an empty string was repeated, it was not identified as matching an empty string +itself. For example: /^(?:(?(1)x|)+)+$()/. + +40. In an EBCDIC environment, pcretest was mishandling the escape sequences +\a and \e in test subject lines. + +41. In an EBCDIC environment, \a in a pattern was converted to the ASCII +instead of the EBCDIC value. + +42. The handling of \c in an EBCDIC environment has been revised so that it is +now compatible with the specification in Perl's perlebcdic page. + +43. Single character repetition in JIT has been improved. 20-30% speedup +was achieved on certain patterns. + +44. The EBCDIC character 0x41 is a non-breaking space, equivalent to 0xa0 in +ASCII/Unicode. This has now been added to the list of characters that are +recognized as white space in EBCDIC. + +45. When PCRE2 was compiled without Unicode support, the use of \p and \P gave +an error (correctly) when used outside a class, but did not give an error +within a class. + +46. \h within a class was incorrectly compiled in EBCDIC environments. + +47. JIT should return with error when the compiled pattern requires +more stack space than the maximum. + +48. Fixed a memory leak in pcre2grep when a locale is set. + + +Version 10.10 06-March-2015 +--------------------------- + +1. When a pattern is compiled, it remembers the highest back reference so that +when matching, if the ovector is too small, extra memory can be obtained to +use instead. A conditional subpattern whose condition is a check on a capture +having happened, such as, for example in the pattern /^(?:(a)|b)(?(1)A|B)/, is +another kind of back reference, but it was not setting the highest +backreference number. This mattered only if pcre2_match() was called with an +ovector that was too small to hold the capture, and there was no other kind of +back reference (a situation which is probably quite rare). The effect of the +bug was that the condition was always treated as FALSE when the capture could +not be consulted, leading to a incorrect behaviour by pcre2_match(). This bug +has been fixed. + +2. Functions for serialization and deserialization of sets of compiled patterns +have been added. + +3. The value that is returned by PCRE2_INFO_SIZE has been corrected to remove +excess code units at the end of the data block that may occasionally occur if +the code for calculating the size over-estimates. This change stops the +serialization code copying uninitialized data, to which valgrind objects. The +documentation of PCRE2_INFO_SIZE was incorrect in stating that the size did not +include the general overhead. This has been corrected. + +4. All code units in every slot in the table of group names are now set, again +in order to avoid accessing uninitialized data when serializing. + +5. The (*NO_JIT) feature is implemented. + +6. If a bug that caused pcre2_compile() to use more memory than allocated was +triggered when using valgrind, the code in (3) above passed a stupidly large +value to valgrind. This caused a crash instead of an "internal error" return. + +7. A reference to a duplicated named group (either a back reference or a test +for being set in a conditional) that occurred in a part of the pattern where +PCRE2_DUPNAMES was not set caused the amount of memory needed for the pattern +to be incorrectly calculated, leading to overwriting. + +8. A mutually recursive set of back references such as (\2)(\1) caused a +segfault at compile time (while trying to find the minimum matching length). +The infinite loop is now broken (with the minimum length unset, that is, zero). + +9. If an assertion that was used as a condition was quantified with a minimum +of zero, matching went wrong. In particular, if the whole group had unlimited +repetition and could match an empty string, a segfault was likely. The pattern +(?(?=0)?)+ is an example that caused this. Perl allows assertions to be +quantified, but not if they are being used as conditions, so the above pattern +is faulted by Perl. PCRE2 has now been changed so that it also rejects such +patterns. + +10. The error message for an invalid quantifier has been changed from "nothing +to repeat" to "quantifier does not follow a repeatable item". + +11. If a bad UTF string is compiled with NO_UTF_CHECK, it may succeed, but +scanning the compiled pattern in subsequent auto-possessification can get out +of step and lead to an unknown opcode. Previously this could have caused an +infinite loop. Now it generates an "internal error" error. This is a tidyup, +not a bug fix; passing bad UTF with NO_UTF_CHECK is documented as having an +undefined outcome. + +12. A UTF pattern containing a "not" match of a non-ASCII character and a +subroutine reference could loop at compile time. Example: /[^\xff]((?1))/. + +13. The locale test (RunTest 3) has been upgraded. It now checks that a locale +that is found in the output of "locale -a" can actually be set by pcre2test +before it is accepted. Previously, in an environment where a locale was listed +but would not set (an example does exist), the test would "pass" without +actually doing anything. Also the fr_CA locale has been added to the list of +locales that can be used. + +14. Fixed a bug in pcre2_substitute(). If a replacement string ended in a +capturing group number without parentheses, the last character was incorrectly +literally included at the end of the replacement string. + +15. A possessive capturing group such as (a)*+ with a minimum repeat of zero +failed to allow the zero-repeat case if pcre2_match() was called with an +ovector too small to capture the group. + +16. Improved error message in pcre2test when setting the stack size (-S) fails. + +17. Fixed two bugs in CMakeLists.txt: (1) Some lines had got lost in the +transfer from PCRE1, meaning that CMake configuration failed if "build tests" +was selected. (2) The file src/pcre2_serialize.c had not been added to the list +of PCRE2 sources, which caused a failure to build pcre2test. + +18. Fixed typo in pcre2_serialize.c (DECL instead of DEFN) that causes problems +only on Windows. + +19. Use binary input when reading back saved serialized patterns in pcre2test. + +20. Added RunTest.bat for running the tests under Windows. + +21. "make distclean" was not removing config.h, a file that may be created for +use with CMake. + +22. A pattern such as "((?2){0,1999}())?", which has a group containing a +forward reference repeated a large (but limited) number of times within a +repeated outer group that has a zero minimum quantifier, caused incorrect code +to be compiled, leading to the error "internal error: previously-checked +referenced subpattern not found" when an incorrect memory address was read. +This bug was reported as "heap overflow", discovered by Kai Lu of Fortinet's +FortiGuard Labs. (Added 24-March-2015: CVE-2015-2325 was given to this.) + +23. A pattern such as "((?+1)(\1))/" containing a forward reference subroutine +call within a group that also contained a recursive back reference caused +incorrect code to be compiled. This bug was reported as "heap overflow", +discovered by Kai Lu of Fortinet's FortiGuard Labs. (Added 24-March-2015: +CVE-2015-2326 was given to this.) + +24. Computing the size of the JIT read-only data in advance has been a source +of various issues, and new ones are still appear unfortunately. To fix +existing and future issues, size computation is eliminated from the code, +and replaced by on-demand memory allocation. + +25. A pattern such as /(?i)[A-`]/, where characters in the other case are +adjacent to the end of the range, and the range contained characters with more +than one other case, caused incorrect behaviour when compiled in UTF mode. In +that example, the range a-j was left out of the class. + + +Version 10.00 05-January-2015 +----------------------------- + +Version 10.00 is the first release of PCRE2, a revised API for the PCRE +library. Changes prior to 10.00 are logged in the ChangeLog file for the old +API, up to item 20 for release 8.36. + +The code of the library was heavily revised as part of the new API +implementation. Details of each and every modification were not individually +logged. In addition to the API changes, the following changes were made. They +are either new functionality, or bug fixes and other noticeable changes of +behaviour that were implemented after the code had been forked. + +1. Including Unicode support at build time is now enabled by default, but it +can optionally be disabled. It is not enabled by default at run time (no +change). + +2. The test program, now called pcre2test, was re-specified and almost +completely re-written. Its input is not compatible with input for pcretest. + +3. Patterns may start with (*NOTEMPTY) or (*NOTEMPTY_ATSTART) to set the +PCRE2_NOTEMPTY or PCRE2_NOTEMPTY_ATSTART options for every subject line that is +matched by that pattern. + +4. For the benefit of those who use PCRE2 via some other application, that is, +not writing the function calls themselves, it is possible to check the PCRE2 +version by matching a pattern such as /(?(VERSION>=10)yes|no)/ against a +string such as "yesno". + +5. There are case-equivalent Unicode characters whose encodings use different +numbers of code units in UTF-8. U+023A and U+2C65 are one example. (It is +theoretically possible for this to happen in UTF-16 too.) If a backreference to +a group containing one of these characters was greedily repeated, and during +the match a backtrack occurred, the subject might be backtracked by the wrong +number of code units. For example, if /^(\x{23a})\1*(.)/ is matched caselessly +(and in UTF-8 mode) against "\x{23a}\x{2c65}\x{2c65}\x{2c65}", group 2 should +capture the final character, which is the three bytes E2, B1, and A5 in UTF-8. +Incorrect backtracking meant that group 2 captured only the last two bytes. +This bug has been fixed; the new code is slower, but it is used only when the +strings matched by the repetition are not all the same length. + +6. A pattern such as /()a/ was not setting the "first character must be 'a'" +information. This applied to any pattern with a group that matched no +characters, for example: /(?:(?=.)|(? and $ + backreferences; $& $` $' and $_; new function + pcre2_set_substitute_case_callout() to allow locale-aware case transformation. + + +Version 10.44 07-June-2024 +-------------------------- + +This is mostly a bug-fix and tidying release. There is one new function, to set +a maximum size for a compiled pattern. The maximum name length for groups is +increased to 128. Some auxiliary files for building under VMS are added. + + +Version 10.43 16-February-2024 +------------------------------ + +There are quite a lot of changes in this release (see ChangeLog and Git log for +a list). Those that are not bugfixes or code tidies are: + +* The JIT code no longer supports ARMv5 architecture. + +* A new function pcre2_get_match_data_heapframes_size() for finer heap control. + +* New option flags to restrict the interaction between ASCII and non-ASCII + characters for caseless matching and \d and friends. There are also new + pattern constructs to control these flags from within a pattern. + +* Upgrade to Unicode 15.0.0. + +* Treat a NULL pattern with zero length as an empty string. + +* Added support for limited-length variable-length lookbehind assertions, with + a default maximum length of 255 characters (same as Perl) but with a function + to adjust the limit. + +* Support for LoongArch in JIT. + +* Perl changed the meaning of (for example) {,3} which did not used to be + recognized as a quantifier. Now it means {0,3} and PCRE2 has also changed. + Note that {,} is still not a quantifier. + +* Following Perl, allow spaces and tabs after { and before } in all Perl- + compatible items that use braces, and also around commas in quantifiers. The + one exception in PCRE2 is \u{...}, which is from ECMAScript, not Perl, and + PCRE2 follows ECMAScript usage. + +* Changed the meaning of \w and its synonyms and derivatives (\b and \B) in UCP + mode to follow Perl. It now matches characters whose general categories are L + or N or whose particular categories are Mn (non-spacing mark) or Pc + (combining punctuation). + +* Changed the default meaning of [:xdigit:] in UCP mode to follow Perl. It now + matches the "fullwidth" versions of hex digits. PCRE2_EXTRA_ASCII_DIGIT can + be used to keep it ASCII only. + +* Make PCRE2_UCP the default in UTF mode in pcre2grep and add --no-ucp, + --case-restrict and --posix-digit. + +* Add --group-separator and --no-group-separator to pcre2grep. + + +Version 10.42 11-December-2022 +------------------------------ + +This is an unexpectedly early release to fix a problem that was introduced in +10.41. ChangeLog number 19 (GitHub #139) added the default definition of +PCRE2_CALL_CONVENTION to pcre2posix.c instead of pcre2posix.h, which meant that +programs including pcre2posix.h but not pcre2.h couldn't compile. A new test +that checks this case has been added. + +A couple of other minor issues are also fixed, and a patch for an intermittent +JIT fault is also included. See ChangeLog and the Git log. + + +Version 10.41 06-December-2022 +------------------------------ + +This is another mainly bug-fixing and code-tidying release. There is one +significant upgrade to pcre2grep: it now behaves like GNU grep when matching +more than one pattern and a later pattern matches at an earlier point in the +subject when the matched substrings are being identified by colour or by +offsets. + + +Version 10.40 15-April-2022 +--------------------------- + +This is mostly a bug-fixing and code-tidying release. However, there are some +extensions to Unicode property handling: + +* Added support for Bidi_Class and a number of binary Unicode properties, +including Bidi_Control. + +* A number of changes to script matching for \p and \P: + + (a) Script extensions for a character are now coded as a bitmap instead of + a list of script numbers, which should be faster and does not need a + loop. + + (b) Added the syntax \p{script:xxx} and \p{script_extensions:xxx} (synonyms + sc and scx). + + (c) Changed \p{scriptname} from being the same as \p{sc:scriptname} to being + the same as \p{scx:scriptname} because this change happened in Perl at + release 5.26. + + (d) The standard Unicode 4-letter abbreviations for script names are now + recognized. + + (e) In accordance with Unicode and Perl's "loose matching" rules, spaces, + hyphens, and underscores are ignored in property names, which are then + matched independent of case. + +As always, see ChangeLog for a list of all changes (also the Git log). + + +Version 10.39 29-October-2021 +----------------------------- + +This release is happening soon after 10.38 because the bug fix is important. + +1. Fix incorrect detection of alternatives in first character search in JIT. + +2. Update to Unicode 14.0.0. + +3. Some code cleanups (see ChangeLog). + + +Version 10.38 01-October-2021 +----------------------------- + +As well as some bug fixes and tidies (as always, see ChangeLog for details), +the documentation is updated to list the new URLs, following the move of the +source repository to GitHub and the mailing list to Google Groups. + +* The CMake build system can now build both static and shared libraries in one +go. + +* Following Perl's lead, \K is now locked out in lookaround assertions by +default, but an option is provided to re-enable the previous behaviour. + + +Version 10.37 26-May-2021 +------------------------- + +A few more bug fixes and tidies. The only change of real note is the removal of +the actual POSIX names regcomp etc. from the POSIX wrapper library because +these have caused issues for some applications (see 10.33 #2 below). + + +Version 10.36 04-December-2020 +------------------------------ + +Again, mainly bug fixes and tidies. The only enhancements are the addition of +GNU grep's -m (aka --max-count) option to pcre2grep, and also unifying the +handling of substitution strings for both -O and callouts in pcre2grep, with +the addition of $x{...} and $o{...} to allow for characters whose code points +are greater than 255 in Unicode mode. + +NOTE: there is an outstanding issue with JIT support for MacOS on arm64 +hardware. For details, please see Bugzilla issue #2618. + + +Version 10.35 15-April-2020 +--------------------------- + +Bugfixes, tidies, and a few new enhancements. + +1. Capturing groups that contain recursive backreferences to themselves are no +longer automatically atomic, because the restriction is no longer necessary +as a result of the 10.30 restructuring. + +2. Several new options for pcre2_substitute(). + +3. When Unicode is supported and PCRE2_UCP is set without PCRE2_UTF, Unicode +character properties are used for upper/lower case computations on characters +whose code points are greater than 127. + +4. The character tables (for low-valued characters) can now more easily be +saved and restored in binary. + +5. Updated to Unicode 13.0.0. + + +Version 10.34 21-November-2019 +------------------------------ + +Another release with a few enhancements as well as bugfixes and tidies. The +main new features are: + +1. There is now some support for matching in invalid UTF strings. + +2. Non-atomic positive lookarounds are implemented in the pcre2_match() +interpreter, but not in JIT. + +3. Added two new functions: pcre2_get_match_data_size() and +pcre2_maketables_free(). + +4. Upgraded to Unicode 12.1.0. + + +Version 10.33 16-April-2019 +--------------------------- + +Yet more bugfixes, tidies, and a few enhancements, summarized here (see +ChangeLog for the full list): + +1. Callouts from pcre2_substitute() are now available. + +2. The POSIX functions are now all called pcre2_regcomp() etc., with wrapper +functions that use the standard POSIX names. However, in pcre2posix.h the POSIX +names are defined as macros. This should help avoid linking with the wrong +library in some environments, while still exporting the POSIX names for +pre-existing programs that use them. + +3. Some new options: + + (a) PCRE2_EXTRA_ESCAPED_CR_IS_LF makes \r behave as \n. + + (b) PCRE2_EXTRA_ALT_BSUX enables support for ECMAScript 6's \u{hh...} + construct. + + (c) PCRE2_COPY_MATCHED_SUBJECT causes a copy of a matched subject to be + made, instead of just remembering a pointer. + +4. Some new Perl features: + + (a) Perl 5.28's experimental alphabetic names for atomic groups and + lookaround assertions, for example, (*pla:...) and (*atomic:...). + + (b) The new Perl "script run" features (*script_run:...) and + (*atomic_script_run:...) aka (*sr:...) and (*asr:...). + + (c) When PCRE2_UTF is set, allow non-ASCII letters and decimal digits in + capture group names. + +5. --disable-percent-zt disables the use of %zu and %td in formatting strings +in pcre2test. They were already automatically disabled for VC and older C +compilers. + +6. Some changes related to callouts in pcre2grep: + + (a) Support for running an external program under VMS has been added, in + addition to Windows and fork() support. + + (b) --disable-pcre2grep-callout-fork restricts the callout support in + to the inbuilt echo facility. + + +Version 10.32 10-September-2018 +------------------------------- + +This is another mainly bugfix and tidying release with a few minor +enhancements. These are the main ones: + +1. pcre2grep now supports the inclusion of binary zeros in patterns that are +read from files via the -f option. + +2. ./configure now supports --enable-jit=auto, which automatically enables JIT +if the hardware supports it. + +3. In pcre2_dfa_match(), internal recursive calls no longer use the stack for +local workspace and local ovectors. Instead, an initial block of stack is +reserved, but if this is insufficient, heap memory is used. The heap limit +parameter now applies to pcre2_dfa_match(). + +4. Updated to Unicode version 11.0.0. + +5. (*ACCEPT:ARG), (*FAIL:ARG), and (*COMMIT:ARG) are now supported. + +6. Added support for \N{U+dddd}, but only in Unicode mode. + +7. Added support for (?^) to unset all imnsx options. + + +Version 10.31 12-February-2018 +------------------------------ + +This is mainly a bugfix and tidying release (see ChangeLog for full details). +However, there are some minor enhancements. + +1. New pcre2_config() options: PCRE2_CONFIG_NEVER_BACKSLASH_C and +PCRE2_CONFIG_COMPILED_WIDTHS. + +2. New pcre2_pattern_info() option PCRE2_INFO_EXTRAOPTIONS to retrieve the +extra compile time options. + +3. There are now public names for all the pcre2_compile() error numbers. + +4. Added PCRE2_CALLOUT_STARTMATCH and PCRE2_CALLOUT_BACKTRACK bits to a new +field callout_flags in callout blocks. + + +Version 10.30 14-August-2017 +---------------------------- + +The full list of changes that includes bugfixes and tidies is, as always, in +ChangeLog. These are the most important new features: + +1. The main interpreter, pcre2_match(), has been refactored into a new version +that does not use recursive function calls (and therefore the system stack) for +remembering backtracking positions. This makes --disable-stack-for-recursion a +NOOP. The new implementation allows backtracking into recursive group calls in +patterns, making it more compatible with Perl, and also fixes some other +previously hard-to-do issues. For patterns that have a lot of backtracking, the +heap is now used, and there is an explicit limit on the amount, settable by +pcre2_set_heap_limit() or (*LIMIT_HEAP=xxx). The "recursion limit" is retained, +but is renamed as "depth limit" (though the old names remain for +compatibility). + +There is also a change in the way callouts from pcre2_match() are handled. The +offset_vector field in the callout block is no longer a pointer to the +actual ovector that was passed to the matching function in the match data +block. Instead it points to an internal ovector of a size large enough to hold +all possible captured substrings in the pattern. + +2. The new option PCRE2_ENDANCHORED insists that a pattern match must end at +the end of the subject. + +3. The new option PCRE2_EXTENDED_MORE implements Perl's /xx feature, and +pcre2test is upgraded to support it. Setting within the pattern by (?xx) is +also supported. + +4. (?n) can be used to set PCRE2_NO_AUTO_CAPTURE, because Perl now has this. + +5. Additional compile options in the compile context are now available, and the +first two are: PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES and +PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL. + +6. The newline type PCRE2_NEWLINE_NUL is now available. + +7. The match limit value now also applies to pcre2_dfa_match() as there are +patterns that can use up a lot of resources without necessarily recursing very +deeply. + +8. The option REG_PEND (a GNU extension) is now available for the POSIX +wrapper. Also there is a new option PCRE2_LITERAL which is used to support +REG_NOSPEC. + +9. PCRE2_EXTRA_MATCH_LINE and PCRE2_EXTRA_MATCH_WORD are implemented for the +benefit of pcre2grep, and pcre2grep's -F, -w, and -x options are re-implemented +using PCRE2_LITERAL, PCRE2_EXTRA_MATCH_WORD, and PCRE2_EXTRA_MATCH_LINE. This +is tidier and also fixes some bugs. + +10. The Unicode tables are upgraded from Unicode 8.0.0 to Unicode 10.0.0. + +11. There are some experimental functions for converting foreign patterns +(globs and POSIX patterns) into PCRE2 patterns. + + +Version 10.23 14-February-2017 +------------------------------ + +1. ChangeLog has the details of a lot of bug fixes and tidies. + +2. There has been a major re-factoring of the pcre2_compile.c file. Most syntax +checking is now done in the pre-pass that identifies capturing groups. This has +reduced the amount of duplication and made the code tidier. While doing this, +some minor bugs and Perl incompatibilities were fixed (see ChangeLog for +details.) + +3. Back references are now permitted in lookbehind assertions when there are +no duplicated group numbers (that is, (?| has not been used), and, if the +reference is by name, there is only one group of that name. The referenced +group must, of course be of fixed length. + +4. \g{+} (e.g. \g{+2} ) is now supported. It is a "forward back +reference" and can be useful in repetitions (compare \g{-} ). Perl does +not recognize this syntax. + +5. pcre2grep now automatically expands its buffer up to a maximum set by +--max-buffer-size. + +6. The -t option (grand total) has been added to pcre2grep. + +7. A new function called pcre2_code_copy_with_tables() exists to copy a +compiled pattern along with a private copy of the character tables that is +uses. + +8. A user supplied a number of patches to upgrade pcre2grep under Windows and +tidy the code. + +9. Several updates have been made to pcre2test and test scripts (see +ChangeLog). + + +Version 10.22 29-July-2016 +-------------------------- + +1. ChangeLog has the details of a number of bug fixes. + +2. The POSIX wrapper function regcomp() did not used to support back references +and subroutine calls if called with the REG_NOSUB option. It now does. + +3. A new function, pcre2_code_copy(), is added, to make a copy of a compiled +pattern. + +4. Support for string callouts is added to pcre2grep. + +5. Added the PCRE2_NO_JIT option to pcre2_match(). + +6. The pcre2_get_error_message() function now returns with a negative error +code if the error number it is given is unknown. + +7. Several updates have been made to pcre2test and test scripts (see +ChangeLog). + + +Version 10.21 12-January-2016 +----------------------------- + +1. Many bugs have been fixed. A large number of them were provoked only by very +strange pattern input, and were discovered by fuzzers. Some others were +discovered by code auditing. See ChangeLog for details. + +2. The Unicode tables have been updated to Unicode version 8.0.0. + +3. For Perl compatibility in EBCDIC environments, ranges such as a-z in a +class, where both values are literal letters in the same case, omit the +non-letter EBCDIC code points within the range. + +4. There have been a number of enhancements to the pcre2_substitute() function, +giving more flexibility to replacement facilities. It is now also possible to +cause the function to return the needed buffer size if the one given is too +small. + +5. The PCRE2_ALT_VERBNAMES option causes the "name" parts of special verbs such +as (*THEN:name) to be processed for backslashes and to take note of +PCRE2_EXTENDED. + +6. PCRE2_INFO_HASBACKSLASHC makes it possible for a client to find out if a +pattern uses \C, and --never-backslash-C makes it possible to compile a version +PCRE2 in which the use of \C is always forbidden. + +7. A limit to the length of pattern that can be handled can now be set by +calling pcre2_set_max_pattern_length(). + +8. When matching an unanchored pattern, a match can be required to begin within +a given number of code units after the start of the subject by calling +pcre2_set_offset_limit(). + +9. The pcre2test program has been extended to test new facilities, and it can +now run the tests when LF on its own is not a valid newline sequence. + +10. The RunTest script has also been updated to enable more tests to be run. + +11. There have been some minor performance enhancements. + + +Version 10.20 30-June-2015 +-------------------------- + +1. Callouts with string arguments and the pcre2_callout_enumerate() function +have been implemented. + +2. The PCRE2_NEVER_BACKSLASH_C option, which locks out the use of \C, is added. + +3. The PCRE2_ALT_CIRCUMFLEX option lets ^ match after a newline at the end of a +subject in multiline mode. + +4. The way named subpatterns are handled has been refactored. The previous +approach had several bugs. + +5. The handling of \c in EBCDIC environments has been changed to conform to the +perlebcdic document. This is an incompatible change. + +6. Bugs have been mended, many of them discovered by fuzzers. + + +Version 10.10 06-March-2015 +--------------------------- + +1. Serialization and de-serialization functions have been added to the API, +making it possible to save and restore sets of compiled patterns, though +restoration must be done in the same environment that was used for compilation. + +2. The (*NO_JIT) feature has been added; this makes it possible for a pattern +creator to specify that JIT is not to be used. + +3. A number of bugs have been fixed. In particular, bugs that caused building +on Windows using CMake to fail have been mended. + + +Version 10.00 05-January-2015 +----------------------------- + +Version 10.00 is the first release of PCRE2, a revised API for the PCRE +library. Changes prior to 10.00 are logged in the ChangeLog file for the old +API, up to item 20 for release 8.36. New programs are recommended to use the +new library. Programs that use the original (PCRE1) API will need changing +before linking with the new library. + +**** diff --git a/miniconda3/share/doc/pcre2/README b/miniconda3/share/doc/pcre2/README new file mode 100644 index 0000000000000000000000000000000000000000..5a50f7f11b57533abe55598b612e4ba2350b4c82 --- /dev/null +++ b/miniconda3/share/doc/pcre2/README @@ -0,0 +1,970 @@ +README file for PCRE2 (Perl-compatible regular expression library) +------------------------------------------------------------------ + +PCRE2 is a re-working of the original PCRE1 library to provide an entirely new +API. Since its initial release in 2015, there has been further development of +the code and it now differs from PCRE1 in more than just the API. There are new +features, and the internals have been improved. The original PCRE1 library is +now obsolete and no longer maintained. The latest release of PCRE2 is available +in .tar.gz, tar.bz2, or .zip form from this GitHub repository: + +https://github.com/PCRE2Project/pcre2/releases + +There is a mailing list for discussion about the development of PCRE2 at +pcre2-dev@googlegroups.com. You can subscribe by sending an email to +pcre2-dev+subscribe@googlegroups.com. + +You can access the archives and also subscribe or manage your subscription +here: + +https://groups.google.com/g/pcre2-dev + +Please read the NEWS file if you are upgrading from a previous release. The +contents of this README file are: + + The PCRE2 APIs + Documentation for PCRE2 + Building PCRE2 on non-Unix-like systems + Building PCRE2 without using autotools + Building PCRE2 using autotools + Retrieving configuration information + Shared libraries + Cross-compiling using autotools + Making new tarballs + Testing PCRE2 + Character tables + File manifest + + +The PCRE2 APIs +-------------- + +PCRE2 is written in C, and it has its own API. There are three sets of +functions, one for the 8-bit library, which processes strings of bytes, one for +the 16-bit library, which processes strings of 16-bit values, and one for the +32-bit library, which processes strings of 32-bit values. Unlike PCRE1, there +are no C++ wrappers. + +The distribution does contain a set of C wrapper functions for the 8-bit +library that are based on the POSIX regular expression API (see the pcre2posix +man page). These are built into a library called libpcre2-posix. Note that this +just provides a POSIX calling interface to PCRE2; the regular expressions +themselves still follow Perl syntax and semantics. The POSIX API is restricted, +and does not give full access to all of PCRE2's facilities. + +The header file for the POSIX-style functions is called pcre2posix.h. The +official POSIX name is regex.h, but I did not want to risk possible problems +with existing files of that name by distributing it that way. To use PCRE2 with +an existing program that uses the POSIX API, pcre2posix.h will have to be +renamed or pointed at by a link (or the program modified, of course). See the +pcre2posix documentation for more details. + + +Documentation for PCRE2 +----------------------- + +If you install PCRE2 in the normal way on a Unix-like system, you will end up +with a set of man pages whose names all start with "pcre2". The one that is +just called "pcre2" lists all the others. In addition to these man pages, the +PCRE2 documentation is supplied in two other forms: + + 1. There are files called doc/pcre2.txt, doc/pcre2grep.txt, and + doc/pcre2test.txt in the source distribution. The first of these is a + concatenation of the text forms of all the section 3 man pages except the + listing of pcre2demo.c and those that summarize individual functions. The + other two are the text forms of the section 1 man pages for the pcre2grep + and pcre2test commands. These text forms are provided for ease of scanning + with text editors or similar tools. They are installed in + /share/doc/pcre2, where is the installation prefix + (defaulting to /usr/local). + + 2. A set of files containing all the documentation in HTML form, hyperlinked + in various ways, and rooted in a file called index.html, is distributed in + doc/html and installed in /share/doc/pcre2/html. + + +Building PCRE2 on non-Unix-like systems +--------------------------------------- + +For a non-Unix-like system, please read the file NON-AUTOTOOLS-BUILD, though if +your system supports the use of "configure" and "make" you may be able to build +PCRE2 using autotools in the same way as for many Unix-like systems. + +PCRE2 can also be configured using CMake, which can be run in various ways +(command line, GUI, etc). This creates Makefiles, solution files, etc. The file +NON-AUTOTOOLS-BUILD has information about CMake. + +PCRE2 has been compiled on many different operating systems. It should be +straightforward to build PCRE2 on any system that has a Standard C compiler and +library, because it uses only Standard C functions. + + +Building PCRE2 without using autotools +-------------------------------------- + +The use of autotools (in particular, libtool) is problematic in some +environments, even some that are Unix or Unix-like. See the NON-AUTOTOOLS-BUILD +file for ways of building PCRE2 without using autotools. + + +Building PCRE2 using autotools +------------------------------ + +The following instructions assume the use of the widely used "configure; make; +make install" (autotools) process. + +If you have downloaded and unpacked a PCRE2 release tarball, run the +"configure" command from the PCRE2 directory, with your current directory set +to the directory where you want the files to be created. This command is a +standard GNU "autoconf" configuration script, for which generic instructions +are supplied in the file INSTALL. + +The files in the GitHub repository do not contain "configure". If you have +downloaded the PCRE2 source files from GitHub, before you can run "configure" +you must run the shell script called autogen.sh. This runs a number of +autotools to create a "configure" script (you must of course have the autotools +commands installed in order to do this). + +Most commonly, people build PCRE2 within its own distribution directory, and in +this case, on many systems, just running "./configure" is sufficient. However, +the usual methods of changing standard defaults are available. For example: + +CFLAGS='-O2 -Wall' ./configure --prefix=/opt/local + +This command specifies that the C compiler should be run with the flags '-O2 +-Wall' instead of the default, and that "make install" should install PCRE2 +under /opt/local instead of the default /usr/local. + +If you want to build in a different directory, just run "configure" with that +directory as current. For example, suppose you have unpacked the PCRE2 source +into /source/pcre2/pcre2-xxx, but you want to build it in +/build/pcre2/pcre2-xxx: + +cd /build/pcre2/pcre2-xxx +/source/pcre2/pcre2-xxx/configure + +PCRE2 is written in C and is normally compiled as a C library. However, it is +possible to build it as a C++ library, though the provided building apparatus +does not have any features to support this. + +There are some optional features that can be included or omitted from the PCRE2 +library. They are also documented in the pcre2build man page. + +. By default, both shared and static libraries are built. You can change this + by adding one of these options to the "configure" command: + + --disable-shared + --disable-static + + Setting --disable-shared ensures that PCRE2 libraries are built as static + libraries. The binaries that are then created as part of the build process + (for example, pcre2test and pcre2grep) are linked statically with one or more + PCRE2 libraries, but may also be dynamically linked with other libraries such + as libc. If you want these binaries to be fully statically linked, you can + set LDFLAGS like this: + + LDFLAGS=--static ./configure --disable-shared + + Note the two hyphens in --static. Of course, this works only if static + versions of all the relevant libraries are available for linking. See also + "Shared libraries" below. + +. By default, only the 8-bit library is built. If you add --enable-pcre2-16 to + the "configure" command, the 16-bit library is also built. If you add + --enable-pcre2-32 to the "configure" command, the 32-bit library is also + built. If you want only the 16-bit or 32-bit library, use --disable-pcre2-8 + to disable building the 8-bit library. + +. If you want to include support for just-in-time (JIT) compiling, which can + give large performance improvements on certain platforms, add --enable-jit to + the "configure" command. This support is available only for certain hardware + architectures. If you try to enable it on an unsupported architecture, there + will be a compile time error. If in doubt, use --enable-jit=auto, which + enables JIT only if the current hardware is supported. + +. If you are enabling JIT under SELinux environment you may also want to add + --enable-jit-sealloc, which enables the use of an executable memory allocator + that is compatible with SELinux. Warning: this allocator is experimental! + It does not support fork() operation and may crash when no disk space is + available. This option has no effect if JIT is disabled. + +. If you do not want to make use of the default support for UTF-8 Unicode + character strings in the 8-bit library, UTF-16 Unicode character strings in + the 16-bit library, or UTF-32 Unicode character strings in the 32-bit + library, you can add --disable-unicode to the "configure" command. This + reduces the size of the libraries. It is not possible to configure one + library with Unicode support, and another without, in the same configuration. + It is also not possible to use --enable-ebcdic (see below) with Unicode + support, so if this option is set, you must also use --disable-unicode. + + When Unicode support is available, the use of a UTF encoding still has to be + enabled by setting the PCRE2_UTF option at run time or starting a pattern + with (*UTF). When PCRE2 is compiled with Unicode support, its input can only + either be ASCII or UTF-8/16/32, even when running on EBCDIC platforms. + + As well as supporting UTF strings, Unicode support includes support for the + \P, \p, and \X sequences that recognize Unicode character properties. + However, only a subset of Unicode properties are supported; see the + pcre2pattern man page for details. Escape sequences such as \d and \w in + patterns do not by default make use of Unicode properties, but can be made to + do so by setting the PCRE2_UCP option or starting a pattern with (*UCP). + +. You can build PCRE2 to recognize either CR or LF or the sequence CRLF, or any + of the preceding, or any of the Unicode newline sequences, or the NUL (zero) + character as indicating the end of a line. Whatever you specify at build time + is the default; the caller of PCRE2 can change the selection at run time. The + default newline indicator is a single LF character (the Unix standard). You + can specify the default newline indicator by adding --enable-newline-is-cr, + --enable-newline-is-lf, --enable-newline-is-crlf, + --enable-newline-is-anycrlf, --enable-newline-is-any, or + --enable-newline-is-nul to the "configure" command, respectively. + +. By default, the sequence \R in a pattern matches any Unicode line ending + sequence. This is independent of the option specifying what PCRE2 considers + to be the end of a line (see above). However, the caller of PCRE2 can + restrict \R to match only CR, LF, or CRLF. You can make this the default by + adding --enable-bsr-anycrlf to the "configure" command (bsr = "backslash R"). + +. In a pattern, the escape sequence \C matches a single code unit, even in a + UTF mode. This can be dangerous because it breaks up multi-code-unit + characters. You can build PCRE2 with the use of \C permanently locked out by + adding --enable-never-backslash-C (note the upper case C) to the "configure" + command. When \C is allowed by the library, individual applications can lock + it out by calling pcre2_compile() with the PCRE2_NEVER_BACKSLASH_C option. + +. PCRE2 has a counter that limits the depth of nesting of parentheses in a + pattern. This limits the amount of system stack that a pattern uses when it + is compiled. The default is 250, but you can change it by setting, for + example, + + --with-parens-nest-limit=500 + +. PCRE2 has a counter that can be set to limit the amount of computing resource + it uses when matching a pattern. If the limit is exceeded during a match, the + match fails. The default is ten million. You can change the default by + setting, for example, + + --with-match-limit=500000 + + on the "configure" command. This is just the default; individual calls to + pcre2_match() or pcre2_dfa_match() can supply their own value. There is more + discussion in the pcre2api man page (search for pcre2_set_match_limit). + +. There is a separate counter that limits the depth of nested backtracking + (pcre2_match()) or nested function calls (pcre2_dfa_match()) during a + matching process, which indirectly limits the amount of heap memory that is + used, and in the case of pcre2_dfa_match() the amount of stack as well. This + counter also has a default of ten million, which is essentially "unlimited". + You can change the default by setting, for example, + + --with-match-limit-depth=5000 + + There is more discussion in the pcre2api man page (search for + pcre2_set_depth_limit). + +. You can also set an explicit limit on the amount of heap memory used by + the pcre2_match() and pcre2_dfa_match() interpreters: + + --with-heap-limit=500 + + The units are kibibytes (units of 1024 bytes). This limit does not apply when + the JIT optimization (which has its own memory control features) is used. + There is more discussion on the pcre2api man page (search for + pcre2_set_heap_limit). + +. In the 8-bit library, the default maximum compiled pattern size is around + 64 kibibytes. You can increase this by adding --with-link-size=3 to the + "configure" command. PCRE2 then uses three bytes instead of two for offsets + to different parts of the compiled pattern. In the 16-bit library, + --with-link-size=3 is the same as --with-link-size=4, which (in both + libraries) uses four-byte offsets. Increasing the internal link size reduces + performance in the 8-bit and 16-bit libraries. In the 32-bit library, the + link size setting is ignored, as 4-byte offsets are always used. + +. Lookbehind assertions in which one or more branches can match a variable + number of characters are supported only if there is a maximum matching length + for each top-level branch. There is a limit to this maximum that defaults to + 255 characters. You can alter this default by a setting such as + + --with-max-varlookbehind=100 + + The limit can be changed at runtime by calling pcre2_set_max_varlookbehind(). + Lookbehind assertions in which every branch matches a fixed number of + characters (not necessarily all the same) are not constrained by this limit. + +. For speed, PCRE2 uses four tables for manipulating and identifying characters + whose code point values are less than 256. By default, it uses a set of + tables for ASCII encoding that is part of the distribution. If you specify + + --enable-rebuild-chartables + + a program called pcre2_dftables is compiled and run in the default C locale + when you obey "make". It builds a source file called pcre2_chartables.c. If + you do not specify this option, pcre2_chartables.c is created as a copy of + pcre2_chartables.c.dist. See "Character tables" below for further + information. + +. It is possible to compile PCRE2 for use on systems that use EBCDIC as their + character code (as opposed to ASCII/Unicode) by specifying + + --enable-ebcdic --disable-unicode + + This automatically implies --enable-rebuild-chartables (see above). However, + when PCRE2 is built this way, it always operates in EBCDIC. It cannot support + both EBCDIC and UTF-8/16/32. There is a second option, --enable-ebcdic-nl25, + which specifies that the code value for the EBCDIC NL character is 0x25 + instead of the default 0x15. + +. If you specify --enable-debug, additional debugging code is included in the + build. This option is intended for use by the PCRE2 maintainers. + +. In environments where valgrind is installed, if you specify + + --enable-valgrind + + PCRE2 will use valgrind annotations to mark certain memory regions as + unaddressable. This allows it to detect invalid memory accesses, and is + mostly useful for debugging PCRE2 itself. + +. In environments where the gcc compiler is used and lcov is installed, if you + specify + + --enable-coverage + + the build process implements a code coverage report for the test suite. The + report is generated by running "make coverage". If ccache is installed on + your system, it must be disabled when building PCRE2 for coverage reporting. + You can do this by setting the environment variable CCACHE_DISABLE=1 before + running "make" to build PCRE2. There is more information about coverage + reporting in the "pcre2build" documentation. + +. When JIT support is enabled, pcre2grep automatically makes use of it, unless + you add --disable-pcre2grep-jit to the "configure" command. + +. There is support for calling external programs during matching in the + pcre2grep command, using PCRE2's callout facility with string arguments. This + support can be disabled by adding --disable-pcre2grep-callout to the + "configure" command. There are two kinds of callout: one that generates + output from inbuilt code, and another that calls an external program. The + latter has special support for Windows and VMS; otherwise it assumes the + existence of the fork() function. This facility can be disabled by adding + --disable-pcre2grep-callout-fork to the "configure" command. + +. The pcre2grep program currently supports only 8-bit data files, and so + requires the 8-bit PCRE2 library. It is possible to compile pcre2grep to use + libz and/or libbz2, in order to read .gz and .bz2 files (respectively), by + specifying one or both of + + --enable-pcre2grep-libz + --enable-pcre2grep-libbz2 + + Of course, the relevant libraries must be installed on your system. + +. The default starting size (in bytes) of the internal buffer used by pcre2grep + can be set by, for example: + + --with-pcre2grep-bufsize=51200 + + The value must be a plain integer. The default is 20480. The amount of memory + used by pcre2grep is actually three times this number, to allow for "before" + and "after" lines. If very long lines are encountered, the buffer is + automatically enlarged, up to a fixed maximum size. + +. The default maximum size of pcre2grep's internal buffer can be set by, for + example: + + --with-pcre2grep-max-bufsize=2097152 + + The default is either 1048576 or the value of --with-pcre2grep-bufsize, + whichever is the larger. + +. It is possible to compile pcre2test so that it links with the libreadline + or libedit libraries, by specifying, respectively, + + --enable-pcre2test-libreadline or --enable-pcre2test-libedit + + If this is done, when pcre2test's input is from a terminal, it reads it using + the readline() function. This provides line-editing and history facilities. + Note that libreadline is GPL-licensed, so if you distribute a binary of + pcre2test linked in this way, there may be licensing issues. These can be + avoided by linking with libedit (which has a BSD licence) instead. + + Enabling libreadline causes the -lreadline option to be added to the + pcre2test build. In many operating environments with a system-installed + readline library this is sufficient. However, in some environments (e.g. if + an unmodified distribution version of readline is in use), it may be + necessary to specify something like LIBS="-lncurses" as well. This is + because, to quote the readline INSTALL, "Readline uses the termcap functions, + but does not link with the termcap or curses library itself, allowing + applications which link with readline the option to choose an appropriate + library." If you get error messages about missing functions tgetstr, tgetent, + tputs, tgetflag, or tgoto, this is the problem, and linking with the ncurses + library should fix it. + +. The C99 standard defines formatting modifiers z and t for size_t and + ptrdiff_t values, respectively. By default, PCRE2 uses these modifiers in + environments other than Microsoft Visual Studio versions earlier than 2013 + when __STDC_VERSION__ is defined and has a value greater than or equal to + 199901L (indicating C99). However, there is at least one environment that + claims to be C99 but does not support these modifiers. If + --disable-percent-zt is specified, no use is made of the z or t modifiers. + Instead of %td or %zu, %lu is used, with a cast for size_t values. + +. There is a special option called --enable-fuzz-support for use by people who + want to run fuzzing tests on PCRE2. If set, it causes an extra library + called libpcre2-fuzzsupport.a to be built, but not installed. This contains + a single function called LLVMFuzzerTestOneInput() whose arguments are a + pointer to a string and the length of the string. When called, this function + tries to compile the string as a pattern, and if that succeeds, to match + it. This is done both with no options and with some random options bits that + are generated from the string. Setting --enable-fuzz-support also causes an + executable called pcre2fuzzcheck-{8,16,32} to be created. This is normally + run under valgrind or used when PCRE2 is compiled with address sanitizing + enabled. It calls the fuzzing function and outputs information about what it + is doing. The input strings are specified by arguments: if an argument + starts with "=" the rest of it is a literal input string. Otherwise, it is + assumed to be a file name, and the contents of the file are the test string. + +. Releases before 10.30 could be compiled with --disable-stack-for-recursion, + which caused pcre2_match() to use individual blocks on the heap for + backtracking instead of recursive function calls (which use the stack). This + is now obsolete because pcre2_match() was refactored always to use the heap + (in a much more efficient way than before). This option is retained for + backwards compatibility, but has no effect other than to output a warning. + +The "configure" script builds the following files for the basic C library: + +. Makefile the makefile that builds the library +. src/config.h build-time configuration options for the library +. src/pcre2.h the public PCRE2 header file +. pcre2-config script that shows the building settings such as CFLAGS + that were set for "configure" +. libpcre2-8.pc ) +. libpcre2-16.pc ) data for the pkg-config command +. libpcre2-32.pc ) +. libpcre2-posix.pc ) +. libtool script that builds shared and/or static libraries + +Versions of config.h and pcre2.h are distributed in the src directory of PCRE2 +tarballs under the names config.h.generic and pcre2.h.generic. These are +provided for those who have to build PCRE2 without using "configure" or CMake. +If you use "configure" or CMake, the .generic versions are not used. + +The "configure" script also creates config.status, which is an executable +script that can be run to recreate the configuration, and config.log, which +contains compiler output from tests that "configure" runs. + +Once "configure" has run, you can run "make". This builds whichever of the +libraries libpcre2-8, libpcre2-16 and libpcre2-32 are configured, and a test +program called pcre2test. If you enabled JIT support with --enable-jit, another +test program called pcre2_jit_test is built as well. If the 8-bit library is +built, libpcre2-posix, pcre2posix_test, and the pcre2grep command are also +built. Running "make" with the -j option may speed up compilation on +multiprocessor systems. + +The command "make check" runs all the appropriate tests. Details of the PCRE2 +tests are given below in a separate section of this document. The -j option of +"make" can also be used when running the tests. + +You can use "make install" to install PCRE2 into live directories on your +system. The following are installed (file names are all relative to the + that is set when "configure" is run): + + Commands (bin): + pcre2test + pcre2grep (if 8-bit support is enabled) + pcre2-config + + Libraries (lib): + libpcre2-8 (if 8-bit support is enabled) + libpcre2-16 (if 16-bit support is enabled) + libpcre2-32 (if 32-bit support is enabled) + libpcre2-posix (if 8-bit support is enabled) + + Configuration information (lib/pkgconfig): + libpcre2-8.pc + libpcre2-16.pc + libpcre2-32.pc + libpcre2-posix.pc + + Header files (include): + pcre2.h + pcre2posix.h + + Man pages (share/man/man{1,3}): + pcre2grep.1 + pcre2test.1 + pcre2-config.1 + pcre2.3 + pcre2*.3 (lots more pages, all starting "pcre2") + + HTML documentation (share/doc/pcre2/html): + index.html + *.html (lots more pages, hyperlinked from index.html) + + Text file documentation (share/doc/pcre2): + AUTHORS + COPYING + ChangeLog + LICENCE + NEWS + README + SECURITY + pcre2.txt (a concatenation of the man(3) pages) + pcre2test.txt the pcre2test man page + pcre2grep.txt the pcre2grep man page + pcre2-config.txt the pcre2-config man page + +If you want to remove PCRE2 from your system, you can run "make uninstall". +This removes all the files that "make install" installed. However, it does not +remove any directories, because these are often shared with other programs. + + +Retrieving configuration information +------------------------------------ + +Running "make install" installs the command pcre2-config, which can be used to +recall information about the PCRE2 configuration and installation. For example: + + pcre2-config --version + +prints the version number, and + + pcre2-config --libs8 + +outputs information about where the 8-bit library is installed. This command +can be included in makefiles for programs that use PCRE2, saving the programmer +from having to remember too many details. Run pcre2-config with no arguments to +obtain a list of possible arguments. + +The pkg-config command is another system for saving and retrieving information +about installed libraries. Instead of separate commands for each library, a +single command is used. For example: + + pkg-config --libs libpcre2-16 + +The data is held in *.pc files that are installed in a directory called +/lib/pkgconfig. + + +Shared libraries +---------------- + +The default distribution builds PCRE2 as shared libraries and static libraries, +as long as the operating system supports shared libraries. Shared library +support relies on the "libtool" script which is built as part of the +"configure" process. + +The libtool script is used to compile and link both shared and static +libraries. They are placed in a subdirectory called .libs when they are newly +built. The programs pcre2test and pcre2grep are built to use these uninstalled +libraries (by means of wrapper scripts in the case of shared libraries). When +you use "make install" to install shared libraries, pcre2grep and pcre2test are +automatically re-built to use the newly installed shared libraries before being +installed themselves. However, the versions left in the build directory still +use the uninstalled libraries. + +To build PCRE2 using static libraries only you must use --disable-shared when +configuring it. For example: + +./configure --prefix=/usr/gnu --disable-shared + +Then run "make" in the usual way. Similarly, you can use --disable-static to +build only shared libraries. Note, however, that when you build only static +libraries, binary programs such as pcre2test and pcre2grep may still be +dynamically linked with other libraries (for example, libc) unless you set +LDFLAGS to --static when running "configure". + + +Cross-compiling using autotools +------------------------------- + +You can specify CC and CFLAGS in the normal way to the "configure" command, in +order to cross-compile PCRE2 for some other host. However, you should NOT +specify --enable-rebuild-chartables, because if you do, the pcre2_dftables.c +source file is compiled and run on the local host, in order to generate the +inbuilt character tables (the pcre2_chartables.c file). This will probably not +work, because pcre2_dftables.c needs to be compiled with the local compiler, +not the cross compiler. + +When --enable-rebuild-chartables is not specified, pcre2_chartables.c is +created by making a copy of pcre2_chartables.c.dist, which is a default set of +tables that assumes ASCII code. Cross-compiling with the default tables should +not be a problem. + +If you need to modify the character tables when cross-compiling, you should +move pcre2_chartables.c.dist out of the way, then compile pcre2_dftables.c by +hand and run it on the local host to make a new version of +pcre2_chartables.c.dist. See the pcre2build section "Creating character tables +at build time" for more details. + + +Making new tarballs +------------------- + +The command "make dist" creates three PCRE2 tarballs, in tar.gz, tar.bz2, and +zip formats. The command "make distcheck" does the same, but then does a trial +build of the new distribution to ensure that it works. + +If you have modified any of the man page sources in the doc directory, you +should first run the maint/PrepareRelease script before making a distribution. +This script creates the .txt and HTML forms of the documentation from the man +pages. + + +Testing PCRE2 +------------- + +To test the basic PCRE2 library on a Unix-like system, run the RunTest script. +There is another script called RunGrepTest that tests the pcre2grep command. +When the 8-bit library is built, a test program for the POSIX wrapper, called +pcre2posix_test, is compiled, and when JIT support is enabled, a test program +called pcre2_jit_test is built. The scripts and the program tests are all run +when you obey "make check". For other environments, see the instructions in +NON-AUTOTOOLS-BUILD. + +The RunTest script runs the pcre2test test program (which is documented in its +own man page) on each of the relevant testinput files in the testdata +directory, and compares the output with the contents of the corresponding +testoutput files. RunTest uses a file called testtry to hold the main output +from pcre2test. Other files whose names begin with "test" are used as working +files in some tests. + +Some tests are relevant only when certain build-time options were selected. For +example, the tests for UTF-8/16/32 features are run only when Unicode support +is available. RunTest outputs a comment when it skips a test. + +Many (but not all) of the tests that are not skipped are run twice if JIT +support is available. On the second run, JIT compilation is forced. This +testing can be suppressed by putting "-nojit" on the RunTest command line. + +The entire set of tests is run once for each of the 8-bit, 16-bit and 32-bit +libraries that are enabled. If you want to run just one set of tests, call +RunTest with either the -8, -16 or -32 option. + +If valgrind is installed, you can run the tests under it by putting "-valgrind" +on the RunTest command line. To run pcre2test on just one or more specific test +files, give their numbers as arguments to RunTest, for example: + + RunTest 2 7 11 + +You can also specify ranges of tests such as 3-6 or 3- (meaning 3 to the +end), or a number preceded by ~ to exclude a test. For example: + + Runtest 3-15 ~10 + +This runs tests 3 to 15, excluding test 10, and just ~13 runs all the tests +except test 13. Whatever order the arguments are in, the tests are always run +in numerical order. + +You can also call RunTest with the single argument "list" to cause it to output +a list of tests. + +The test sequence starts with "test 0", which is a special test that has no +input file, and whose output is not checked. This is because it will be +different on different hardware and with different configurations. The test +exists in order to exercise some of pcre2test's code that would not otherwise +be run. + +Tests 1 and 2 can always be run, as they expect only plain text strings (not +UTF) and make no use of Unicode properties. The first test file can be fed +directly into the perltest.sh script to check that Perl gives the same results. +The only difference you should see is in the first few lines, where the Perl +version is given instead of the PCRE2 version. The second set of tests check +auxiliary functions, error detection, and run-time flags that are specific to +PCRE2. It also uses the debugging flags to check some of the internals of +pcre2_compile(). + +If you build PCRE2 with a locale setting that is not the standard C locale, the +character tables may be different (see next paragraph). In some cases, this may +cause failures in the second set of tests. For example, in a locale where the +isprint() function yields TRUE for characters in the range 128-255, the use of +[:isascii:] inside a character class defines a different set of characters, and +this shows up in this test as a difference in the compiled code, which is being +listed for checking. For example, where the comparison test output contains +[\x00-\x7f] the test might contain [\x00-\xff], and similarly in some other +cases. This is not a bug in PCRE2. + +Test 3 checks pcre2_maketables(), the facility for building a set of character +tables for a specific locale and using them instead of the default tables. The +script uses the "locale" command to check for the availability of the "fr_FR", +"french", or "fr" locale, and uses the first one that it finds. If the "locale" +command fails, or if its output doesn't include "fr_FR", "french", or "fr" in +the list of available locales, the third test cannot be run, and a comment is +output to say why. If running this test produces an error like this: + + ** Failed to set locale "fr_FR" + +it means that the given locale is not available on your system, despite being +listed by "locale". This does not mean that PCRE2 is broken. There are three +alternative output files for the third test, because three different versions +of the French locale have been encountered. The test passes if its output +matches any one of them. + +Tests 4 and 5 check UTF and Unicode property support, test 4 being compatible +with the perltest.sh script, and test 5 checking PCRE2-specific things. + +Tests 6 and 7 check the pcre2_dfa_match() alternative matching function, in +non-UTF mode and UTF-mode with Unicode property support, respectively. + +Test 8 checks some internal offsets and code size features, but it is run only +when Unicode support is enabled. The output is different in 8-bit, 16-bit, and +32-bit modes and for different link sizes, so there are different output files +for each mode and link size. + +Tests 9 and 10 are run only in 8-bit mode, and tests 11 and 12 are run only in +16-bit and 32-bit modes. These are tests that generate different output in +8-bit mode. Each pair are for general cases and Unicode support, respectively. + +Test 13 checks the handling of non-UTF characters greater than 255 by +pcre2_dfa_match() in 16-bit and 32-bit modes. + +Test 14 contains some special UTF and UCP tests that give different output for +different code unit widths. + +Test 15 contains a number of tests that must not be run with JIT. They check, +among other non-JIT things, the match-limiting features of the interpretive +matcher. + +Test 16 is run only when JIT support is not available. It checks that an +attempt to use JIT has the expected behaviour. + +Test 17 is run only when JIT support is available. It checks JIT complete and +partial modes, match-limiting under JIT, and other JIT-specific features. + +Tests 18 and 19 are run only in 8-bit mode. They check the POSIX interface to +the 8-bit library, without and with Unicode support, respectively. + +Test 20 checks the serialization functions by writing a set of compiled +patterns to a file, and then reloading and checking them. + +Tests 21 and 22 test \C support when the use of \C is not locked out, without +and with UTF support, respectively. Test 23 tests \C when it is locked out. + +Tests 24 and 25 test the experimental pattern conversion functions, without and +with UTF support, respectively. + +Test 26 checks Unicode property support using tests that are generated +automatically from the Unicode data tables. + + +Character tables +---------------- + +For speed, PCRE2 uses four tables for manipulating and identifying characters +whose code point values are less than 256. By default, a set of tables that is +built into the library is used. The pcre2_maketables() function can be called +by an application to create a new set of tables in the current locale. This are +passed to PCRE2 by calling pcre2_set_character_tables() to put a pointer into a +compile context. + +The source file called pcre2_chartables.c contains the default set of tables. +By default, this is created as a copy of pcre2_chartables.c.dist, which +contains tables for ASCII coding. However, if --enable-rebuild-chartables is +specified for ./configure, a new version of pcre2_chartables.c is built by the +program pcre2_dftables (compiled from pcre2_dftables.c), which uses the ANSI C +character handling functions such as isalnum(), isalpha(), isupper(), +islower(), etc. to build the table sources. This means that the default C +locale that is set for your system will control the contents of these default +tables. You can change the default tables by editing pcre2_chartables.c and +then re-building PCRE2. If you do this, you should take care to ensure that the +file does not get automatically re-generated. The best way to do this is to +move pcre2_chartables.c.dist out of the way and replace it with your customized +tables. + +When the pcre2_dftables program is run as a result of specifying +--enable-rebuild-chartables, it uses the default C locale that is set on your +system. It does not pay attention to the LC_xxx environment variables. In other +words, it uses the system's default locale rather than whatever the compiling +user happens to have set. If you really do want to build a source set of +character tables in a locale that is specified by the LC_xxx variables, you can +run the pcre2_dftables program by hand with the -L option. For example: + + ./pcre2_dftables -L pcre2_chartables.c.special + +The second argument names the file where the source code for the tables is +written. The first two 256-byte tables provide lower casing and case flipping +functions, respectively. The next table consists of a number of 32-byte bit +maps which identify certain character classes such as digits, "word" +characters, white space, etc. These are used when building 32-byte bit maps +that represent character classes for code points less than 256. The final +256-byte table has bits indicating various character types, as follows: + + 1 white space character + 2 letter + 4 lower case letter + 8 decimal digit + 16 alphanumeric or '_' + +You can also specify -b (with or without -L) when running pcre2_dftables. This +causes the tables to be written in binary instead of as source code. A set of +binary tables can be loaded into memory by an application and passed to +pcre2_compile() in the same way as tables created dynamically by calling +pcre2_maketables(). The tables are just a string of bytes, independent of +hardware characteristics such as endianness. This means they can be bundled +with an application that runs in different environments, to ensure consistent +behaviour. + +See also the pcre2build section "Creating character tables at build time". + + +File manifest +------------- + +The distribution should contain the files listed below. + +(A) Source files for the PCRE2 library functions and their headers are found in + the src directory: + + src/pcre2_dftables.c auxiliary program for building pcre2_chartables.c + when --enable-rebuild-chartables is specified + + src/pcre2_chartables.c.dist a default set of character tables that assume + ASCII coding; unless --enable-rebuild-chartables is + specified, used by copying to pcre2_chartables.c + + src/pcre2posix.c ) + src/pcre2_auto_possess.c ) + src/pcre2_chkdint.c ) + src/pcre2_compile.c ) + src/pcre2_compile_class.c ) + src/pcre2_config.c ) + src/pcre2_context.c ) + src/pcre2_convert.c ) + src/pcre2_dfa_match.c ) + src/pcre2_error.c ) + src/pcre2_extuni.c ) + src/pcre2_find_bracket.c ) + src/pcre2_jit_compile.c ) + src/pcre2_jit_match.c ) sources for the functions in the library, + src/pcre2_jit_misc.c ) and some internal functions that they use + src/pcre2_maketables.c ) + src/pcre2_match.c ) + src/pcre2_match_data.c ) + src/pcre2_newline.c ) + src/pcre2_ord2utf.c ) + src/pcre2_pattern_info.c ) + src/pcre2_script_run.c ) + src/pcre2_serialize.c ) + src/pcre2_string_utils.c ) + src/pcre2_study.c ) + src/pcre2_substitute.c ) + src/pcre2_substring.c ) + src/pcre2_tables.c ) + src/pcre2_ucd.c ) + src/pcre2_ucptables.c ) + src/pcre2_valid_utf.c ) + src/pcre2_xclass.c ) + + src/pcre2_printint.c debugging function that is used by pcre2test, + src/pcre2_fuzzsupport.c function for (optional) fuzzing support + + src/config.h.in template for config.h, when built by "configure" + src/pcre2.h.in template for pcre2.h when built by "configure" + src/pcre2posix.h header for the external POSIX wrapper API + src/pcre2_compile.h header for internal use + src/pcre2_internal.h header for internal use + src/pcre2_intmodedep.h a mode-specific internal header + src/pcre2_jit_char_inc.h header used by JIT + src/pcre2_jit_neon_inc.h header used by JIT + src/pcre2_jit_simd_inc.h header used by JIT + src/pcre2_ucp.h header for Unicode property handling + src/pcre2_util.h header for internal utils + + deps/sljit/sljit_src/* source files for the JIT compiler + +(B) Source files for programs that use PCRE2: + + src/pcre2demo.c simple demonstration of coding calls to PCRE2 + src/pcre2grep.c source of a grep utility that uses PCRE2 + src/pcre2test.c comprehensive test program + src/pcre2_jit_test.c JIT test program + src/pcre2posix_test.c POSIX wrapper API test program + +(C) Auxiliary files: + + AUTHORS.md information about the authors of PCRE2 + ChangeLog log of changes to the code + HACKING some notes about the internals of PCRE2 + INSTALL generic installation instructions + LICENCE.md conditions for the use of PCRE2 + COPYING the same, using GNU's standard name + SECURITY.md information on reporting vulnerabilities + Makefile.in ) template for Unix Makefile, which is built by + ) "configure" + Makefile.am ) the automake input that was used to create + ) Makefile.in + NEWS important changes in this release + NON-AUTOTOOLS-BUILD notes on building PCRE2 without using autotools + README this file + RunTest a Unix shell script for running tests + RunGrepTest a Unix shell script for pcre2grep tests + RunTest.bat a Windows batch file for running tests + RunGrepTest.bat a Windows batch file for pcre2grep tests + aclocal.m4 m4 macros (generated by "aclocal") + m4/* m4 macros (used by autoconf) + configure a configuring shell script (built by autoconf) + configure.ac ) the autoconf input that was used to build + ) "configure" and config.h + doc/*.3 man page sources for PCRE2 + doc/*.1 man page sources for pcre2grep and pcre2test + doc/html/* HTML documentation + doc/pcre2.txt plain text version of the man pages + doc/pcre2-config.txt plain text documentation of pcre2-config script + doc/pcre2grep.txt plain text documentation of grep utility program + doc/pcre2test.txt plain text documentation of test program + libpcre2-8.pc.in template for libpcre2-8.pc for pkg-config + libpcre2-16.pc.in template for libpcre2-16.pc for pkg-config + libpcre2-32.pc.in template for libpcre2-32.pc for pkg-config + libpcre2-posix.pc.in template for libpcre2-posix.pc for pkg-config + ar-lib ) + config.guess ) + config.sub ) + depcomp ) helper tools generated by libtool and + compile ) automake, used internally by ./configure + install-sh ) + ltmain.sh ) + missing ) + test-driver ) + perltest.sh Script for running a Perl test program + pcre2-config.in source of script which retains PCRE2 information + testdata/testinput* test data for main library tests + testdata/testoutput* expected test results + testdata/grep* input and output for pcre2grep tests + testdata/* other supporting test files + +(D) Auxiliary files for CMake support + + cmake/COPYING-CMAKE-SCRIPTS + cmake/FindEditline.cmake + cmake/FindReadline.cmake + cmake/pcre2-config-version.cmake.in + cmake/pcre2-config.cmake.in + CMakeLists.txt + config-cmake.h.in + +(E) Auxiliary files for building PCRE2 "by hand" + + src/pcre2.h.generic ) a version of the public PCRE2 header file + ) for use in non-"configure" environments + src/config.h.generic ) a version of config.h for use in non-"configure" + ) environments + +(F) Auxiliary files for building PCRE2 using other build systems + + BUILD.bazel ) + MODULE.bazel ) files used by the Bazel build system + WORKSPACE.bazel ) + build.zig file used by zig's build system + +(G) Auxiliary files for building PCRE2 under OpenVMS + + vms/configure.com ) + vms/openvms_readme.txt ) These files were contributed by a PCRE2 user. + vms/pcre2.h_patch ) + vms/stdint.h ) + +============================== +Last updated: 18 December 2024 +============================== + diff --git a/miniconda3/share/doc/pcre2/SECURITY.md b/miniconda3/share/doc/pcre2/SECURITY.md new file mode 100644 index 0000000000000000000000000000000000000000..b39ddb77c714c52f25ef564a2749b504005b1efa --- /dev/null +++ b/miniconda3/share/doc/pcre2/SECURITY.md @@ -0,0 +1,55 @@ +# Security policies + +## Release security + +The PCRE2 project provides source-only releases, with no binaries. + +These source releases can be downloaded from the +[GitHub Releases](https://github.com/PCRE2Project/pcre2/releases) page. Each +release file is GPG-signed. + +* Releases up to and including 10.44 are signed by Philip Hazel (GPG key: + 45F68D54BBE23FB3039B46E59766E084FB0F43D8) +* Releases from 10.45 onwards will be signed by Nicholas Wilson (GPG key: + A95536204A3BB489715231282A98E77EB6F24CA8, cross-signed by Philip + Hazel's key for release continuity) + +From releases 10.45 onwards, the source code will additionally be provided via +Git checkout of the (GPG-signed) release tag. + +Please contact the maintainers for any queries about release integrity or the +project's supply-chain. + +## Previous vulnerabilities + +* CVE-2025-58050 (August 2025). Affects 10.45 only (not earlier), and is fixed + in 10.46. + +## Reporting vulnerabilities + +The PCRE2 project prioritises security. We appreciate third-party testing and +security research, and would be grateful if you could responsibly disclose your +findings to us. We will make every effort to acknowledge your contributions. + +To report a security issue, please use the GitHub Security Advisory +["Report a Vulnerability"](https://github.com/PCRE2Project/pcre2/security/advisories/new) +tab. (Alternatively, if you prefer you may send a GPG-encrypted email to one of +the maintainers.) + +### Timeline + +As a very small volunteer team, we cannot guarantee rapid response, but would +aim to respond within 1 week, or perhaps 2 during holidays. + +### Response procedure + +PCRE2 has in the past made at least one rapid release in response to +security incidents. + +We have never produced an embargoed release, or provided preferential +access to security fixes to any clients. + +We would aim to notify security managers from trusted downstream distributors, +such as major Linux distributions, via the `pcre2-dev` mailing list, by +publicly signalling an upcoming security release before disclosing the +vulnerability publicly, where advance notification is possible. diff --git a/miniconda3/share/doc/pcre2/html/NON-AUTOTOOLS-BUILD.txt b/miniconda3/share/doc/pcre2/html/NON-AUTOTOOLS-BUILD.txt new file mode 100644 index 0000000000000000000000000000000000000000..bb687f7d040dc9bbe0c05ad795a2e539d2e3f2ea --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/NON-AUTOTOOLS-BUILD.txt @@ -0,0 +1,442 @@ +Building PCRE2 without using autotools +-------------------------------------- + +This document contains the following sections: + + General + Generic instructions for the PCRE2 C libraries + Stack size in Windows environments + Linking programs in Windows environments + Calling conventions in Windows environments + Comments about Win32 builds + Building PCRE2 on Windows with CMake + Building PCRE2 on Windows with Visual Studio + Testing with RunTest.bat + Building PCRE2 on native z/OS and z/VM + Building PCRE2 under VMS + + +GENERAL + +The source of the PCRE2 libraries consists entirely of code written in Standard +C, and so should compile successfully on any system that has a Standard C +compiler and library. + +The PCRE2 distribution includes a "configure" file for use by the +configure/make (autotools) build system, as found in many Unix-like +environments. The README file contains information about the options for +"configure". + +There is also support for CMake, which some users prefer, especially in Windows +environments, though it can also be run in Unix-like environments. See the +section entitled "Building PCRE2 on Windows with CMake" below. + +Versions of src/config.h and src/pcre2.h are distributed in the PCRE2 tarballs +under the names src/config.h.generic and src/pcre2.h.generic. These are +provided for those who build PCRE2 without using "configure" or CMake. If you +use "configure" or CMake, the .generic versions are not used. + + +GENERIC INSTRUCTIONS FOR THE PCRE2 C LIBRARIES + +There are three possible PCRE2 libraries, each handling data with a specific +code unit width: 8, 16, or 32 bits. You can build any combination of them. The +following are generic instructions for building a PCRE2 C library "by hand". If +you are going to use CMake, this section does not apply to you; you can skip +ahead to the CMake section. Note that the settings concerned with 8-bit, +16-bit, and 32-bit code units relate to the type of data string that PCRE2 +processes. They are NOT referring to the underlying operating system bit width. +You do not have to do anything special to compile in a 64-bit environment, for +example. + + (1) Copy or rename the file src/config.h.generic as src/config.h, and edit the + macro settings that it contains to whatever is appropriate for your + environment. In particular, you can alter the definition of the NEWLINE + macro to specify what character(s) you want to be interpreted as line + terminators by default. You need to #define at least one of + SUPPORT_PCRE2_8, SUPPORT_PCRE2_16, or SUPPORT_PCRE2_32, depending on which + libraries you are going to build. You must set all that apply. + + When you subsequently compile any of the PCRE2 modules, you must specify + -DHAVE_CONFIG_H to your compiler so that src/config.h is included in the + sources. + + An alternative approach is not to edit src/config.h, but to use -D on the + compiler command line to make any changes that you need to the + configuration options. In this case -DHAVE_CONFIG_H must not be set. + + NOTE: There have been occasions when the way in which certain parameters + in src/config.h are used has changed between releases. (In the + configure/make world, this is handled automatically.) When upgrading to a + new release, you are strongly advised to review src/config.h.generic + before re-using what you had previously. + + Note also that the src/config.h.generic file is created from a config.h + that was generated by Autotools, which automatically includes settings of + a number of macros that are not actually used by PCRE2 (for example, + HAVE_DLFCN_H). + + (2) Copy or rename the file src/pcre2.h.generic as src/pcre2.h. + + (3) EITHER: + Copy or rename file src/pcre2_chartables.c.dist as + src/pcre2_chartables.c. + + OR: + Compile src/pcre2_dftables.c as a stand-alone program (using + -DHAVE_CONFIG_H if you have set up src/config.h), and then run it with + the single argument "src/pcre2_chartables.c". This generates a set of + standard character tables and writes them to that file. The tables are + generated using the default C locale for your system. If you want to use + a locale that is specified by LC_xxx environment variables, add the -L + option to the pcre2_dftables command. You must use this method if you + are building on a system that uses EBCDIC code. + + The tables in src/pcre2_chartables.c are defaults. The caller of PCRE2 can + specify alternative tables at run time. + + (4) For a library that supports 8-bit code units in the character strings that + it processes, compile the following source files from the src directory, + setting -DPCRE2_CODE_UNIT_WIDTH=8 as a compiler option. Also set + -DHAVE_CONFIG_H if you have set up src/config.h with your configuration, + or else use other -D settings to change the configuration as required. + + pcre2_auto_possess.c + pcre2_chkdint.c + pcre2_chartables.c + pcre2_compile.c + pcre2_compile_class.c + pcre2_config.c + pcre2_context.c + pcre2_convert.c + pcre2_dfa_match.c + pcre2_error.c + pcre2_extuni.c + pcre2_find_bracket.c + pcre2_jit_compile.c + pcre2_maketables.c + pcre2_match.c + pcre2_match_data.c + pcre2_newline.c + pcre2_ord2utf.c + pcre2_pattern_info.c + pcre2_script_run.c + pcre2_serialize.c + pcre2_string_utils.c + pcre2_study.c + pcre2_substitute.c + pcre2_substring.c + pcre2_tables.c + pcre2_ucd.c + pcre2_valid_utf.c + pcre2_xclass.c + + Make sure that you include -I. in the compiler command (or equivalent for + an unusual compiler) so that all included PCRE2 header files are first + sought in the src directory under the current directory. Otherwise you run + the risk of picking up a previously-installed file from somewhere else. + + Note that you must compile pcre2_jit_compile.c, even if you have not + defined SUPPORT_JIT in src/config.h, because when JIT support is not + configured, dummy functions are compiled. When JIT support IS configured, + pcre2_jit_compile.c #includes other files from the sljit dependency, + all of whose names begin with "sljit". It also #includes + src/pcre2_jit_match.c and src/pcre2_jit_misc.c, so you should not compile + those yourself. + + Note also that the pcre2_fuzzsupport.c file contains special code that is + useful to those who want to run fuzzing tests on the PCRE2 library. Unless + you are doing that, you can ignore it. + + (5) Now link all the compiled code into an object library in whichever form + your system keeps such libraries. This is the PCRE2 C 8-bit library, + typically called something like libpcre2-8. If your system has static and + shared libraries, you may have to do this once for each type. + + (6) If you want to build a library that supports 16-bit or 32-bit code units, + set 16 or 32 as the value of -DPCRE2_CODE_UNIT_WIDTH when obeying step 4 + above. If you want to build more than one PCRE2 library, repeat steps 4 + and 5 as necessary. + + (7) If you want to build the POSIX wrapper functions (which apply only to the + 8-bit library), ensure that you have the src/pcre2posix.h file and then + compile src/pcre2posix.c. Link the result (on its own) as the pcre2posix + library. If targeting a DLL in Windows, make sure to include + -DPCRE2POSIX_SHARED with your compiler flags. + + (8) The pcre2test program can be linked with any combination of the 8-bit, + 16-bit and 32-bit libraries (depending on what you specfied in + src/config.h) . Compile src/pcre2test.c; don't forget -DHAVE_CONFIG_H if + necessary, but do NOT define PCRE2_CODE_UNIT_WIDTH. Then link with the + appropriate library/ies. If you compiled an 8-bit library, pcre2test also + needs the pcre2posix wrapper library. + + (9) Run pcre2test on the testinput files in the testdata directory, and check + that the output matches the corresponding testoutput files. There are + comments about what each test does in the section entitled "Testing PCRE2" + in the README file. If you compiled more than one of the 8-bit, 16-bit and + 32-bit libraries, you need to run pcre2test with the -16 option to do + 16-bit tests and with the -32 option to do 32-bit tests. + + Some tests are relevant only when certain build-time options are selected. + For example, test 4 is for Unicode support, and will not run if you have + built PCRE2 without it. See the comments at the start of each testinput + file. If you have a suitable Unix-like shell, the RunTest script will run + the appropriate tests for you. The command "RunTest list" will output a + list of all the tests. + + Note that the supplied files are in Unix format, with just LF characters + as line terminators. You may need to edit them to change this if your + system uses a different convention. + +(10) If you have built PCRE2 with SUPPORT_JIT, the JIT features can be tested + by running pcre2test with the -jit option. This is done automatically by + the RunTest script. You might also like to build and run the freestanding + JIT test program, src/pcre2_jit_test.c. + +(11) The pcre2test program tests the POSIX wrapper library, but there is also a + freestanding test program in src/pcre2posix_test.c. It must be linked with + both the pcre2posix library and the 8-bit PCRE2 library. + +(12) If you want to use the pcre2grep command, compile and link + src/pcre2grep.c; it uses only the 8-bit PCRE2 library (it does not need + the pcre2posix library). If you have built the PCRE2 library with JIT + support by defining SUPPORT_JIT in src/config.h, you can also define + SUPPORT_PCRE2GREP_JIT, which causes pcre2grep to make use of JIT (unless + it is run with --no-jit). If you define SUPPORT_PCRE2GREP_JIT without + defining SUPPORT_JIT, pcre2grep does not try to make use of JIT. + + +STACK SIZE IN WINDOWS ENVIRONMENTS + +Prior to release 10.30 the default system stack size of 1MiB in some Windows +environments caused issues with some tests. This should no longer be the case +for 10.30 and later releases. + + +LINKING PROGRAMS IN WINDOWS ENVIRONMENTS + +If you want to statically link a program against a PCRE2 library in the form of +a non-dll .a file, you must define PCRE2_STATIC before including src/pcre2.h. + + +CALLING CONVENTIONS IN WINDOWS ENVIRONMENTS + +It is possible to compile programs to use different calling conventions using +MSVC. Search the web for "calling conventions" for more information. To make it +easier to change the calling convention for the exported functions in a +PCRE2 library, the macro PCRE2_CALL_CONVENTION is present in all the external +definitions. It can be set externally when compiling (e.g. in CFLAGS). If it is +not set, it defaults to empty; the default calling convention is then used +(which is what is wanted most of the time). + + +COMMENTS ABOUT WIN32 BUILDS (see also "BUILDING PCRE2 ON WINDOWS WITH CMAKE") + +There are two ways of building PCRE2 using the "configure, make, make install" +paradigm on Windows systems: using MinGW or using Cygwin. These are not at all +the same thing; they are completely different from each other. There is also +support for building using CMake, which some users find a more straightforward +way of building PCRE2 under Windows. + +The MinGW home page (http://www.mingw.org/) says this: + + MinGW: A collection of freely available and freely distributable Windows + specific header files and import libraries combined with GNU toolsets that + allow one to produce native Windows programs that do not rely on any + 3rd-party C runtime DLLs. + +The Cygwin home page (http://www.cygwin.com/) says this: + + Cygwin is a Linux-like environment for Windows. It consists of two parts: + + . A DLL (cygwin1.dll) which acts as a Linux API emulation layer providing + substantial Linux API functionality + + . A collection of tools which provide Linux look and feel. + +On both MinGW and Cygwin, PCRE2 should build correctly using: + + ./configure && make && make install + +This should create two libraries called libpcre2-8 and libpcre2-posix. These +are independent libraries: when you link with libpcre2-posix you must also link +with libpcre2-8, which contains the basic functions. + +Using Cygwin's compiler generates libraries and executables that depend on +cygwin1.dll. If a library that is generated this way is distributed, +cygwin1.dll has to be distributed as well. Since cygwin1.dll is under the GPL +licence, this forces not only PCRE2 to be under the GPL, but also the entire +application. A distributor who wants to keep their own code proprietary must +purchase an appropriate Cygwin licence. + +MinGW has no such restrictions. The MinGW compiler generates a library or +executable that can run standalone on Windows without any third party dll or +licensing issues. + +But there is more complication: + +If a Cygwin user uses the -mno-cygwin Cygwin gcc flag, what that really does is +to tell Cygwin's gcc to use the MinGW gcc. Cygwin's gcc is only acting as a +front end to MinGW's gcc (if you install Cygwin's gcc, you get both Cygwin's +gcc and MinGW's gcc). So, a user can: + +. Build native binaries by using MinGW or by getting Cygwin and using + -mno-cygwin. + +. Build binaries that depend on cygwin1.dll by using Cygwin with the normal + compiler flags. + +The test files that are supplied with PCRE2 are in UNIX format, with LF +characters as line terminators. Unless your PCRE2 library uses a default +newline option that includes LF as a valid newline, it may be necessary to +change the line terminators in the test files to get some of the tests to work. + + +BUILDING PCRE2 ON WINDOWS WITH CMAKE + +CMake is an alternative configuration facility that can be used instead of +"configure". CMake creates project files (make files, solution files, etc.) +tailored to numerous development environments, including Visual Studio, +Borland, Msys, MinGW, NMake, and Unix. If possible, use short paths with no +spaces in the names for your CMake installation and your PCRE2 source and build +directories. + +If you are using CMake and encounter errors, deleting the CMake cache and +restarting from a fresh build may fix the error. In the CMake GUI, the cache can +be deleted by selecting "File > Delete Cache"; or the folder "CMakeCache" can +be deleted. + +1. Install the latest CMake version available from http://www.cmake.org/, and + ensure that cmake\bin is on your path. + +2. Unzip (retaining folder structure) the PCRE2 source tree into a source + directory such as C:\pcre2. You should ensure your local date and time + is not earlier than the file dates in your source dir if the release is + very new. + +3. Create a new, empty build directory, preferably a subdirectory of the + source dir. For example, C:\pcre2\pcre2-xx\build. + +4. Run CMake. + + - Using the CLI, simply run `cmake ..` inside the `build/` directory. You can + use the `ccmake` ncurses GUI to select and configure PCRE2 features. + + - Using the CMake GUI: + + a) Run cmake-gui from the Shell environment of your build tool, for + example, Msys for Msys/MinGW or Visual Studio Command Prompt for + VC/VC++. + + b) Enter C:\pcre2\pcre2-xx and C:\pcre2\pcre2-xx\build for the source and + build directories, respectively. + + c) Press the "Configure" button. + + d) Select the particular IDE / build tool that you are using (Visual + Studio, MSYS makefiles, MinGW makefiles, etc.) + + e) The GUI will then list several configuration options. This is where + you can disable Unicode support or select other PCRE2 optional features. + + f) Press "Configure" again. The adjacent "Generate" button should now be + active. + + g) Press "Generate". + +5. The build directory should now contain a usable build system, be it a + solution file for Visual Studio, makefiles for MinGW, etc. Exit from + cmake-gui and use the generated build system with your compiler or IDE. + E.g., for MinGW you can run "make", or for Visual Studio, open the PCRE2 + solution, select the desired configuration (Debug, or Release, etc.) and + build the ALL_BUILD project. + + Regardless of build system used, `cmake --build .` will build it. + +6. If during configuration with cmake-gui you've elected to build the test + programs, you can execute them by building the test project. E.g., for + MinGW: "make test"; for Visual Studio build the RUN_TESTS project. The + most recent build configuration is targeted by the tests. A summary of + test results is presented. Complete test output is subsequently + available for review in Testing\Temporary under your build dir. + + Regardless of build system used, `ctest` will run the tests. + + +BUILDING PCRE2 ON WINDOWS WITH VISUAL STUDIO + +The code currently cannot be compiled without an inttypes.h header, which is +available only with Visual Studio 2013 or newer. However, this portable and +permissively-licensed implementation of the stdint.h header could be used as an +alternative: + + http://www.azillionmonkeys.com/qed/pstdint.h + +Just rename it and drop it into the top level of the build tree. + + +TESTING WITH RUNTEST.BAT + +If configured with CMake, building the test project ("make test" or building +ALL_TESTS in Visual Studio) creates (and runs) pcre2_test.bat (and depending +on your configuration options, possibly other test programs) in the build +directory. The pcre2_test.bat script runs RunTest.bat with correct source and +exe paths. + +For manual testing with RunTest.bat, provided the build dir is a subdirectory +of the source directory: Open command shell window. Chdir to the location +of your pcre2test.exe and pcre2grep.exe programs. Call RunTest.bat with +"..\RunTest.Bat" or "..\..\RunTest.bat" as appropriate. + +To run only a particular test with RunTest.Bat provide a test number argument. + +Otherwise: + +1. Copy RunTest.bat into the directory where pcre2test.exe and pcre2grep.exe + have been created. + +2. Edit RunTest.bat to identify the full or relative location of + the pcre2 source (wherein which the testdata folder resides), e.g.: + + set srcdir=C:\pcre2\pcre2-10.00 + +3. In a Windows command environment, chdir to the location of your bat and + exe programs. + +4. Run RunTest.bat. Test outputs will automatically be compared to expected + results, and discrepancies will be identified in the console output. + +To independently test the just-in-time compiler, run pcre2_jit_test.exe. + + +BUILDING PCRE2 ON NATIVE Z/OS AND Z/VM + +z/OS and z/VM are operating systems for mainframe computers, produced by IBM. +The character code used is EBCDIC, not ASCII or Unicode. In z/OS, UNIX APIs and +applications can be supported through UNIX System Services, and in such an +environment it should be possible to build PCRE2 in the same way as in other +systems, with the EBCDIC related configuration settings, but it is not known if +anybody has tried this. + +In native z/OS (without UNIX System Services) and in z/VM, special ports are +required. For details, please see file 939 on this web site: + + http://www.cbttape.org + +Everything in that location, source and executable, is in EBCDIC and native +z/OS file formats. The port provides an API for LE languages such as COBOL and +for the z/OS and z/VM versions of the Rexx languages. + + +BUILDING PCRE2 UNDER VMS + +Alexey Chuphin has contributed some auxiliary files for building PCRE2 under +OpenVMS. They are in the "vms" directory in the distribution tarball. Please +read the file called vms/openvms_readme.txt. The pcre2test and pcre2grep +programs contain some VMS-specific code. + +============================== +Last updated: 26 December 2024 +============================== + diff --git a/miniconda3/share/doc/pcre2/html/README.txt b/miniconda3/share/doc/pcre2/html/README.txt new file mode 100644 index 0000000000000000000000000000000000000000..5a50f7f11b57533abe55598b612e4ba2350b4c82 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/README.txt @@ -0,0 +1,970 @@ +README file for PCRE2 (Perl-compatible regular expression library) +------------------------------------------------------------------ + +PCRE2 is a re-working of the original PCRE1 library to provide an entirely new +API. Since its initial release in 2015, there has been further development of +the code and it now differs from PCRE1 in more than just the API. There are new +features, and the internals have been improved. The original PCRE1 library is +now obsolete and no longer maintained. The latest release of PCRE2 is available +in .tar.gz, tar.bz2, or .zip form from this GitHub repository: + +https://github.com/PCRE2Project/pcre2/releases + +There is a mailing list for discussion about the development of PCRE2 at +pcre2-dev@googlegroups.com. You can subscribe by sending an email to +pcre2-dev+subscribe@googlegroups.com. + +You can access the archives and also subscribe or manage your subscription +here: + +https://groups.google.com/g/pcre2-dev + +Please read the NEWS file if you are upgrading from a previous release. The +contents of this README file are: + + The PCRE2 APIs + Documentation for PCRE2 + Building PCRE2 on non-Unix-like systems + Building PCRE2 without using autotools + Building PCRE2 using autotools + Retrieving configuration information + Shared libraries + Cross-compiling using autotools + Making new tarballs + Testing PCRE2 + Character tables + File manifest + + +The PCRE2 APIs +-------------- + +PCRE2 is written in C, and it has its own API. There are three sets of +functions, one for the 8-bit library, which processes strings of bytes, one for +the 16-bit library, which processes strings of 16-bit values, and one for the +32-bit library, which processes strings of 32-bit values. Unlike PCRE1, there +are no C++ wrappers. + +The distribution does contain a set of C wrapper functions for the 8-bit +library that are based on the POSIX regular expression API (see the pcre2posix +man page). These are built into a library called libpcre2-posix. Note that this +just provides a POSIX calling interface to PCRE2; the regular expressions +themselves still follow Perl syntax and semantics. The POSIX API is restricted, +and does not give full access to all of PCRE2's facilities. + +The header file for the POSIX-style functions is called pcre2posix.h. The +official POSIX name is regex.h, but I did not want to risk possible problems +with existing files of that name by distributing it that way. To use PCRE2 with +an existing program that uses the POSIX API, pcre2posix.h will have to be +renamed or pointed at by a link (or the program modified, of course). See the +pcre2posix documentation for more details. + + +Documentation for PCRE2 +----------------------- + +If you install PCRE2 in the normal way on a Unix-like system, you will end up +with a set of man pages whose names all start with "pcre2". The one that is +just called "pcre2" lists all the others. In addition to these man pages, the +PCRE2 documentation is supplied in two other forms: + + 1. There are files called doc/pcre2.txt, doc/pcre2grep.txt, and + doc/pcre2test.txt in the source distribution. The first of these is a + concatenation of the text forms of all the section 3 man pages except the + listing of pcre2demo.c and those that summarize individual functions. The + other two are the text forms of the section 1 man pages for the pcre2grep + and pcre2test commands. These text forms are provided for ease of scanning + with text editors or similar tools. They are installed in + /share/doc/pcre2, where is the installation prefix + (defaulting to /usr/local). + + 2. A set of files containing all the documentation in HTML form, hyperlinked + in various ways, and rooted in a file called index.html, is distributed in + doc/html and installed in /share/doc/pcre2/html. + + +Building PCRE2 on non-Unix-like systems +--------------------------------------- + +For a non-Unix-like system, please read the file NON-AUTOTOOLS-BUILD, though if +your system supports the use of "configure" and "make" you may be able to build +PCRE2 using autotools in the same way as for many Unix-like systems. + +PCRE2 can also be configured using CMake, which can be run in various ways +(command line, GUI, etc). This creates Makefiles, solution files, etc. The file +NON-AUTOTOOLS-BUILD has information about CMake. + +PCRE2 has been compiled on many different operating systems. It should be +straightforward to build PCRE2 on any system that has a Standard C compiler and +library, because it uses only Standard C functions. + + +Building PCRE2 without using autotools +-------------------------------------- + +The use of autotools (in particular, libtool) is problematic in some +environments, even some that are Unix or Unix-like. See the NON-AUTOTOOLS-BUILD +file for ways of building PCRE2 without using autotools. + + +Building PCRE2 using autotools +------------------------------ + +The following instructions assume the use of the widely used "configure; make; +make install" (autotools) process. + +If you have downloaded and unpacked a PCRE2 release tarball, run the +"configure" command from the PCRE2 directory, with your current directory set +to the directory where you want the files to be created. This command is a +standard GNU "autoconf" configuration script, for which generic instructions +are supplied in the file INSTALL. + +The files in the GitHub repository do not contain "configure". If you have +downloaded the PCRE2 source files from GitHub, before you can run "configure" +you must run the shell script called autogen.sh. This runs a number of +autotools to create a "configure" script (you must of course have the autotools +commands installed in order to do this). + +Most commonly, people build PCRE2 within its own distribution directory, and in +this case, on many systems, just running "./configure" is sufficient. However, +the usual methods of changing standard defaults are available. For example: + +CFLAGS='-O2 -Wall' ./configure --prefix=/opt/local + +This command specifies that the C compiler should be run with the flags '-O2 +-Wall' instead of the default, and that "make install" should install PCRE2 +under /opt/local instead of the default /usr/local. + +If you want to build in a different directory, just run "configure" with that +directory as current. For example, suppose you have unpacked the PCRE2 source +into /source/pcre2/pcre2-xxx, but you want to build it in +/build/pcre2/pcre2-xxx: + +cd /build/pcre2/pcre2-xxx +/source/pcre2/pcre2-xxx/configure + +PCRE2 is written in C and is normally compiled as a C library. However, it is +possible to build it as a C++ library, though the provided building apparatus +does not have any features to support this. + +There are some optional features that can be included or omitted from the PCRE2 +library. They are also documented in the pcre2build man page. + +. By default, both shared and static libraries are built. You can change this + by adding one of these options to the "configure" command: + + --disable-shared + --disable-static + + Setting --disable-shared ensures that PCRE2 libraries are built as static + libraries. The binaries that are then created as part of the build process + (for example, pcre2test and pcre2grep) are linked statically with one or more + PCRE2 libraries, but may also be dynamically linked with other libraries such + as libc. If you want these binaries to be fully statically linked, you can + set LDFLAGS like this: + + LDFLAGS=--static ./configure --disable-shared + + Note the two hyphens in --static. Of course, this works only if static + versions of all the relevant libraries are available for linking. See also + "Shared libraries" below. + +. By default, only the 8-bit library is built. If you add --enable-pcre2-16 to + the "configure" command, the 16-bit library is also built. If you add + --enable-pcre2-32 to the "configure" command, the 32-bit library is also + built. If you want only the 16-bit or 32-bit library, use --disable-pcre2-8 + to disable building the 8-bit library. + +. If you want to include support for just-in-time (JIT) compiling, which can + give large performance improvements on certain platforms, add --enable-jit to + the "configure" command. This support is available only for certain hardware + architectures. If you try to enable it on an unsupported architecture, there + will be a compile time error. If in doubt, use --enable-jit=auto, which + enables JIT only if the current hardware is supported. + +. If you are enabling JIT under SELinux environment you may also want to add + --enable-jit-sealloc, which enables the use of an executable memory allocator + that is compatible with SELinux. Warning: this allocator is experimental! + It does not support fork() operation and may crash when no disk space is + available. This option has no effect if JIT is disabled. + +. If you do not want to make use of the default support for UTF-8 Unicode + character strings in the 8-bit library, UTF-16 Unicode character strings in + the 16-bit library, or UTF-32 Unicode character strings in the 32-bit + library, you can add --disable-unicode to the "configure" command. This + reduces the size of the libraries. It is not possible to configure one + library with Unicode support, and another without, in the same configuration. + It is also not possible to use --enable-ebcdic (see below) with Unicode + support, so if this option is set, you must also use --disable-unicode. + + When Unicode support is available, the use of a UTF encoding still has to be + enabled by setting the PCRE2_UTF option at run time or starting a pattern + with (*UTF). When PCRE2 is compiled with Unicode support, its input can only + either be ASCII or UTF-8/16/32, even when running on EBCDIC platforms. + + As well as supporting UTF strings, Unicode support includes support for the + \P, \p, and \X sequences that recognize Unicode character properties. + However, only a subset of Unicode properties are supported; see the + pcre2pattern man page for details. Escape sequences such as \d and \w in + patterns do not by default make use of Unicode properties, but can be made to + do so by setting the PCRE2_UCP option or starting a pattern with (*UCP). + +. You can build PCRE2 to recognize either CR or LF or the sequence CRLF, or any + of the preceding, or any of the Unicode newline sequences, or the NUL (zero) + character as indicating the end of a line. Whatever you specify at build time + is the default; the caller of PCRE2 can change the selection at run time. The + default newline indicator is a single LF character (the Unix standard). You + can specify the default newline indicator by adding --enable-newline-is-cr, + --enable-newline-is-lf, --enable-newline-is-crlf, + --enable-newline-is-anycrlf, --enable-newline-is-any, or + --enable-newline-is-nul to the "configure" command, respectively. + +. By default, the sequence \R in a pattern matches any Unicode line ending + sequence. This is independent of the option specifying what PCRE2 considers + to be the end of a line (see above). However, the caller of PCRE2 can + restrict \R to match only CR, LF, or CRLF. You can make this the default by + adding --enable-bsr-anycrlf to the "configure" command (bsr = "backslash R"). + +. In a pattern, the escape sequence \C matches a single code unit, even in a + UTF mode. This can be dangerous because it breaks up multi-code-unit + characters. You can build PCRE2 with the use of \C permanently locked out by + adding --enable-never-backslash-C (note the upper case C) to the "configure" + command. When \C is allowed by the library, individual applications can lock + it out by calling pcre2_compile() with the PCRE2_NEVER_BACKSLASH_C option. + +. PCRE2 has a counter that limits the depth of nesting of parentheses in a + pattern. This limits the amount of system stack that a pattern uses when it + is compiled. The default is 250, but you can change it by setting, for + example, + + --with-parens-nest-limit=500 + +. PCRE2 has a counter that can be set to limit the amount of computing resource + it uses when matching a pattern. If the limit is exceeded during a match, the + match fails. The default is ten million. You can change the default by + setting, for example, + + --with-match-limit=500000 + + on the "configure" command. This is just the default; individual calls to + pcre2_match() or pcre2_dfa_match() can supply their own value. There is more + discussion in the pcre2api man page (search for pcre2_set_match_limit). + +. There is a separate counter that limits the depth of nested backtracking + (pcre2_match()) or nested function calls (pcre2_dfa_match()) during a + matching process, which indirectly limits the amount of heap memory that is + used, and in the case of pcre2_dfa_match() the amount of stack as well. This + counter also has a default of ten million, which is essentially "unlimited". + You can change the default by setting, for example, + + --with-match-limit-depth=5000 + + There is more discussion in the pcre2api man page (search for + pcre2_set_depth_limit). + +. You can also set an explicit limit on the amount of heap memory used by + the pcre2_match() and pcre2_dfa_match() interpreters: + + --with-heap-limit=500 + + The units are kibibytes (units of 1024 bytes). This limit does not apply when + the JIT optimization (which has its own memory control features) is used. + There is more discussion on the pcre2api man page (search for + pcre2_set_heap_limit). + +. In the 8-bit library, the default maximum compiled pattern size is around + 64 kibibytes. You can increase this by adding --with-link-size=3 to the + "configure" command. PCRE2 then uses three bytes instead of two for offsets + to different parts of the compiled pattern. In the 16-bit library, + --with-link-size=3 is the same as --with-link-size=4, which (in both + libraries) uses four-byte offsets. Increasing the internal link size reduces + performance in the 8-bit and 16-bit libraries. In the 32-bit library, the + link size setting is ignored, as 4-byte offsets are always used. + +. Lookbehind assertions in which one or more branches can match a variable + number of characters are supported only if there is a maximum matching length + for each top-level branch. There is a limit to this maximum that defaults to + 255 characters. You can alter this default by a setting such as + + --with-max-varlookbehind=100 + + The limit can be changed at runtime by calling pcre2_set_max_varlookbehind(). + Lookbehind assertions in which every branch matches a fixed number of + characters (not necessarily all the same) are not constrained by this limit. + +. For speed, PCRE2 uses four tables for manipulating and identifying characters + whose code point values are less than 256. By default, it uses a set of + tables for ASCII encoding that is part of the distribution. If you specify + + --enable-rebuild-chartables + + a program called pcre2_dftables is compiled and run in the default C locale + when you obey "make". It builds a source file called pcre2_chartables.c. If + you do not specify this option, pcre2_chartables.c is created as a copy of + pcre2_chartables.c.dist. See "Character tables" below for further + information. + +. It is possible to compile PCRE2 for use on systems that use EBCDIC as their + character code (as opposed to ASCII/Unicode) by specifying + + --enable-ebcdic --disable-unicode + + This automatically implies --enable-rebuild-chartables (see above). However, + when PCRE2 is built this way, it always operates in EBCDIC. It cannot support + both EBCDIC and UTF-8/16/32. There is a second option, --enable-ebcdic-nl25, + which specifies that the code value for the EBCDIC NL character is 0x25 + instead of the default 0x15. + +. If you specify --enable-debug, additional debugging code is included in the + build. This option is intended for use by the PCRE2 maintainers. + +. In environments where valgrind is installed, if you specify + + --enable-valgrind + + PCRE2 will use valgrind annotations to mark certain memory regions as + unaddressable. This allows it to detect invalid memory accesses, and is + mostly useful for debugging PCRE2 itself. + +. In environments where the gcc compiler is used and lcov is installed, if you + specify + + --enable-coverage + + the build process implements a code coverage report for the test suite. The + report is generated by running "make coverage". If ccache is installed on + your system, it must be disabled when building PCRE2 for coverage reporting. + You can do this by setting the environment variable CCACHE_DISABLE=1 before + running "make" to build PCRE2. There is more information about coverage + reporting in the "pcre2build" documentation. + +. When JIT support is enabled, pcre2grep automatically makes use of it, unless + you add --disable-pcre2grep-jit to the "configure" command. + +. There is support for calling external programs during matching in the + pcre2grep command, using PCRE2's callout facility with string arguments. This + support can be disabled by adding --disable-pcre2grep-callout to the + "configure" command. There are two kinds of callout: one that generates + output from inbuilt code, and another that calls an external program. The + latter has special support for Windows and VMS; otherwise it assumes the + existence of the fork() function. This facility can be disabled by adding + --disable-pcre2grep-callout-fork to the "configure" command. + +. The pcre2grep program currently supports only 8-bit data files, and so + requires the 8-bit PCRE2 library. It is possible to compile pcre2grep to use + libz and/or libbz2, in order to read .gz and .bz2 files (respectively), by + specifying one or both of + + --enable-pcre2grep-libz + --enable-pcre2grep-libbz2 + + Of course, the relevant libraries must be installed on your system. + +. The default starting size (in bytes) of the internal buffer used by pcre2grep + can be set by, for example: + + --with-pcre2grep-bufsize=51200 + + The value must be a plain integer. The default is 20480. The amount of memory + used by pcre2grep is actually three times this number, to allow for "before" + and "after" lines. If very long lines are encountered, the buffer is + automatically enlarged, up to a fixed maximum size. + +. The default maximum size of pcre2grep's internal buffer can be set by, for + example: + + --with-pcre2grep-max-bufsize=2097152 + + The default is either 1048576 or the value of --with-pcre2grep-bufsize, + whichever is the larger. + +. It is possible to compile pcre2test so that it links with the libreadline + or libedit libraries, by specifying, respectively, + + --enable-pcre2test-libreadline or --enable-pcre2test-libedit + + If this is done, when pcre2test's input is from a terminal, it reads it using + the readline() function. This provides line-editing and history facilities. + Note that libreadline is GPL-licensed, so if you distribute a binary of + pcre2test linked in this way, there may be licensing issues. These can be + avoided by linking with libedit (which has a BSD licence) instead. + + Enabling libreadline causes the -lreadline option to be added to the + pcre2test build. In many operating environments with a system-installed + readline library this is sufficient. However, in some environments (e.g. if + an unmodified distribution version of readline is in use), it may be + necessary to specify something like LIBS="-lncurses" as well. This is + because, to quote the readline INSTALL, "Readline uses the termcap functions, + but does not link with the termcap or curses library itself, allowing + applications which link with readline the option to choose an appropriate + library." If you get error messages about missing functions tgetstr, tgetent, + tputs, tgetflag, or tgoto, this is the problem, and linking with the ncurses + library should fix it. + +. The C99 standard defines formatting modifiers z and t for size_t and + ptrdiff_t values, respectively. By default, PCRE2 uses these modifiers in + environments other than Microsoft Visual Studio versions earlier than 2013 + when __STDC_VERSION__ is defined and has a value greater than or equal to + 199901L (indicating C99). However, there is at least one environment that + claims to be C99 but does not support these modifiers. If + --disable-percent-zt is specified, no use is made of the z or t modifiers. + Instead of %td or %zu, %lu is used, with a cast for size_t values. + +. There is a special option called --enable-fuzz-support for use by people who + want to run fuzzing tests on PCRE2. If set, it causes an extra library + called libpcre2-fuzzsupport.a to be built, but not installed. This contains + a single function called LLVMFuzzerTestOneInput() whose arguments are a + pointer to a string and the length of the string. When called, this function + tries to compile the string as a pattern, and if that succeeds, to match + it. This is done both with no options and with some random options bits that + are generated from the string. Setting --enable-fuzz-support also causes an + executable called pcre2fuzzcheck-{8,16,32} to be created. This is normally + run under valgrind or used when PCRE2 is compiled with address sanitizing + enabled. It calls the fuzzing function and outputs information about what it + is doing. The input strings are specified by arguments: if an argument + starts with "=" the rest of it is a literal input string. Otherwise, it is + assumed to be a file name, and the contents of the file are the test string. + +. Releases before 10.30 could be compiled with --disable-stack-for-recursion, + which caused pcre2_match() to use individual blocks on the heap for + backtracking instead of recursive function calls (which use the stack). This + is now obsolete because pcre2_match() was refactored always to use the heap + (in a much more efficient way than before). This option is retained for + backwards compatibility, but has no effect other than to output a warning. + +The "configure" script builds the following files for the basic C library: + +. Makefile the makefile that builds the library +. src/config.h build-time configuration options for the library +. src/pcre2.h the public PCRE2 header file +. pcre2-config script that shows the building settings such as CFLAGS + that were set for "configure" +. libpcre2-8.pc ) +. libpcre2-16.pc ) data for the pkg-config command +. libpcre2-32.pc ) +. libpcre2-posix.pc ) +. libtool script that builds shared and/or static libraries + +Versions of config.h and pcre2.h are distributed in the src directory of PCRE2 +tarballs under the names config.h.generic and pcre2.h.generic. These are +provided for those who have to build PCRE2 without using "configure" or CMake. +If you use "configure" or CMake, the .generic versions are not used. + +The "configure" script also creates config.status, which is an executable +script that can be run to recreate the configuration, and config.log, which +contains compiler output from tests that "configure" runs. + +Once "configure" has run, you can run "make". This builds whichever of the +libraries libpcre2-8, libpcre2-16 and libpcre2-32 are configured, and a test +program called pcre2test. If you enabled JIT support with --enable-jit, another +test program called pcre2_jit_test is built as well. If the 8-bit library is +built, libpcre2-posix, pcre2posix_test, and the pcre2grep command are also +built. Running "make" with the -j option may speed up compilation on +multiprocessor systems. + +The command "make check" runs all the appropriate tests. Details of the PCRE2 +tests are given below in a separate section of this document. The -j option of +"make" can also be used when running the tests. + +You can use "make install" to install PCRE2 into live directories on your +system. The following are installed (file names are all relative to the + that is set when "configure" is run): + + Commands (bin): + pcre2test + pcre2grep (if 8-bit support is enabled) + pcre2-config + + Libraries (lib): + libpcre2-8 (if 8-bit support is enabled) + libpcre2-16 (if 16-bit support is enabled) + libpcre2-32 (if 32-bit support is enabled) + libpcre2-posix (if 8-bit support is enabled) + + Configuration information (lib/pkgconfig): + libpcre2-8.pc + libpcre2-16.pc + libpcre2-32.pc + libpcre2-posix.pc + + Header files (include): + pcre2.h + pcre2posix.h + + Man pages (share/man/man{1,3}): + pcre2grep.1 + pcre2test.1 + pcre2-config.1 + pcre2.3 + pcre2*.3 (lots more pages, all starting "pcre2") + + HTML documentation (share/doc/pcre2/html): + index.html + *.html (lots more pages, hyperlinked from index.html) + + Text file documentation (share/doc/pcre2): + AUTHORS + COPYING + ChangeLog + LICENCE + NEWS + README + SECURITY + pcre2.txt (a concatenation of the man(3) pages) + pcre2test.txt the pcre2test man page + pcre2grep.txt the pcre2grep man page + pcre2-config.txt the pcre2-config man page + +If you want to remove PCRE2 from your system, you can run "make uninstall". +This removes all the files that "make install" installed. However, it does not +remove any directories, because these are often shared with other programs. + + +Retrieving configuration information +------------------------------------ + +Running "make install" installs the command pcre2-config, which can be used to +recall information about the PCRE2 configuration and installation. For example: + + pcre2-config --version + +prints the version number, and + + pcre2-config --libs8 + +outputs information about where the 8-bit library is installed. This command +can be included in makefiles for programs that use PCRE2, saving the programmer +from having to remember too many details. Run pcre2-config with no arguments to +obtain a list of possible arguments. + +The pkg-config command is another system for saving and retrieving information +about installed libraries. Instead of separate commands for each library, a +single command is used. For example: + + pkg-config --libs libpcre2-16 + +The data is held in *.pc files that are installed in a directory called +/lib/pkgconfig. + + +Shared libraries +---------------- + +The default distribution builds PCRE2 as shared libraries and static libraries, +as long as the operating system supports shared libraries. Shared library +support relies on the "libtool" script which is built as part of the +"configure" process. + +The libtool script is used to compile and link both shared and static +libraries. They are placed in a subdirectory called .libs when they are newly +built. The programs pcre2test and pcre2grep are built to use these uninstalled +libraries (by means of wrapper scripts in the case of shared libraries). When +you use "make install" to install shared libraries, pcre2grep and pcre2test are +automatically re-built to use the newly installed shared libraries before being +installed themselves. However, the versions left in the build directory still +use the uninstalled libraries. + +To build PCRE2 using static libraries only you must use --disable-shared when +configuring it. For example: + +./configure --prefix=/usr/gnu --disable-shared + +Then run "make" in the usual way. Similarly, you can use --disable-static to +build only shared libraries. Note, however, that when you build only static +libraries, binary programs such as pcre2test and pcre2grep may still be +dynamically linked with other libraries (for example, libc) unless you set +LDFLAGS to --static when running "configure". + + +Cross-compiling using autotools +------------------------------- + +You can specify CC and CFLAGS in the normal way to the "configure" command, in +order to cross-compile PCRE2 for some other host. However, you should NOT +specify --enable-rebuild-chartables, because if you do, the pcre2_dftables.c +source file is compiled and run on the local host, in order to generate the +inbuilt character tables (the pcre2_chartables.c file). This will probably not +work, because pcre2_dftables.c needs to be compiled with the local compiler, +not the cross compiler. + +When --enable-rebuild-chartables is not specified, pcre2_chartables.c is +created by making a copy of pcre2_chartables.c.dist, which is a default set of +tables that assumes ASCII code. Cross-compiling with the default tables should +not be a problem. + +If you need to modify the character tables when cross-compiling, you should +move pcre2_chartables.c.dist out of the way, then compile pcre2_dftables.c by +hand and run it on the local host to make a new version of +pcre2_chartables.c.dist. See the pcre2build section "Creating character tables +at build time" for more details. + + +Making new tarballs +------------------- + +The command "make dist" creates three PCRE2 tarballs, in tar.gz, tar.bz2, and +zip formats. The command "make distcheck" does the same, but then does a trial +build of the new distribution to ensure that it works. + +If you have modified any of the man page sources in the doc directory, you +should first run the maint/PrepareRelease script before making a distribution. +This script creates the .txt and HTML forms of the documentation from the man +pages. + + +Testing PCRE2 +------------- + +To test the basic PCRE2 library on a Unix-like system, run the RunTest script. +There is another script called RunGrepTest that tests the pcre2grep command. +When the 8-bit library is built, a test program for the POSIX wrapper, called +pcre2posix_test, is compiled, and when JIT support is enabled, a test program +called pcre2_jit_test is built. The scripts and the program tests are all run +when you obey "make check". For other environments, see the instructions in +NON-AUTOTOOLS-BUILD. + +The RunTest script runs the pcre2test test program (which is documented in its +own man page) on each of the relevant testinput files in the testdata +directory, and compares the output with the contents of the corresponding +testoutput files. RunTest uses a file called testtry to hold the main output +from pcre2test. Other files whose names begin with "test" are used as working +files in some tests. + +Some tests are relevant only when certain build-time options were selected. For +example, the tests for UTF-8/16/32 features are run only when Unicode support +is available. RunTest outputs a comment when it skips a test. + +Many (but not all) of the tests that are not skipped are run twice if JIT +support is available. On the second run, JIT compilation is forced. This +testing can be suppressed by putting "-nojit" on the RunTest command line. + +The entire set of tests is run once for each of the 8-bit, 16-bit and 32-bit +libraries that are enabled. If you want to run just one set of tests, call +RunTest with either the -8, -16 or -32 option. + +If valgrind is installed, you can run the tests under it by putting "-valgrind" +on the RunTest command line. To run pcre2test on just one or more specific test +files, give their numbers as arguments to RunTest, for example: + + RunTest 2 7 11 + +You can also specify ranges of tests such as 3-6 or 3- (meaning 3 to the +end), or a number preceded by ~ to exclude a test. For example: + + Runtest 3-15 ~10 + +This runs tests 3 to 15, excluding test 10, and just ~13 runs all the tests +except test 13. Whatever order the arguments are in, the tests are always run +in numerical order. + +You can also call RunTest with the single argument "list" to cause it to output +a list of tests. + +The test sequence starts with "test 0", which is a special test that has no +input file, and whose output is not checked. This is because it will be +different on different hardware and with different configurations. The test +exists in order to exercise some of pcre2test's code that would not otherwise +be run. + +Tests 1 and 2 can always be run, as they expect only plain text strings (not +UTF) and make no use of Unicode properties. The first test file can be fed +directly into the perltest.sh script to check that Perl gives the same results. +The only difference you should see is in the first few lines, where the Perl +version is given instead of the PCRE2 version. The second set of tests check +auxiliary functions, error detection, and run-time flags that are specific to +PCRE2. It also uses the debugging flags to check some of the internals of +pcre2_compile(). + +If you build PCRE2 with a locale setting that is not the standard C locale, the +character tables may be different (see next paragraph). In some cases, this may +cause failures in the second set of tests. For example, in a locale where the +isprint() function yields TRUE for characters in the range 128-255, the use of +[:isascii:] inside a character class defines a different set of characters, and +this shows up in this test as a difference in the compiled code, which is being +listed for checking. For example, where the comparison test output contains +[\x00-\x7f] the test might contain [\x00-\xff], and similarly in some other +cases. This is not a bug in PCRE2. + +Test 3 checks pcre2_maketables(), the facility for building a set of character +tables for a specific locale and using them instead of the default tables. The +script uses the "locale" command to check for the availability of the "fr_FR", +"french", or "fr" locale, and uses the first one that it finds. If the "locale" +command fails, or if its output doesn't include "fr_FR", "french", or "fr" in +the list of available locales, the third test cannot be run, and a comment is +output to say why. If running this test produces an error like this: + + ** Failed to set locale "fr_FR" + +it means that the given locale is not available on your system, despite being +listed by "locale". This does not mean that PCRE2 is broken. There are three +alternative output files for the third test, because three different versions +of the French locale have been encountered. The test passes if its output +matches any one of them. + +Tests 4 and 5 check UTF and Unicode property support, test 4 being compatible +with the perltest.sh script, and test 5 checking PCRE2-specific things. + +Tests 6 and 7 check the pcre2_dfa_match() alternative matching function, in +non-UTF mode and UTF-mode with Unicode property support, respectively. + +Test 8 checks some internal offsets and code size features, but it is run only +when Unicode support is enabled. The output is different in 8-bit, 16-bit, and +32-bit modes and for different link sizes, so there are different output files +for each mode and link size. + +Tests 9 and 10 are run only in 8-bit mode, and tests 11 and 12 are run only in +16-bit and 32-bit modes. These are tests that generate different output in +8-bit mode. Each pair are for general cases and Unicode support, respectively. + +Test 13 checks the handling of non-UTF characters greater than 255 by +pcre2_dfa_match() in 16-bit and 32-bit modes. + +Test 14 contains some special UTF and UCP tests that give different output for +different code unit widths. + +Test 15 contains a number of tests that must not be run with JIT. They check, +among other non-JIT things, the match-limiting features of the interpretive +matcher. + +Test 16 is run only when JIT support is not available. It checks that an +attempt to use JIT has the expected behaviour. + +Test 17 is run only when JIT support is available. It checks JIT complete and +partial modes, match-limiting under JIT, and other JIT-specific features. + +Tests 18 and 19 are run only in 8-bit mode. They check the POSIX interface to +the 8-bit library, without and with Unicode support, respectively. + +Test 20 checks the serialization functions by writing a set of compiled +patterns to a file, and then reloading and checking them. + +Tests 21 and 22 test \C support when the use of \C is not locked out, without +and with UTF support, respectively. Test 23 tests \C when it is locked out. + +Tests 24 and 25 test the experimental pattern conversion functions, without and +with UTF support, respectively. + +Test 26 checks Unicode property support using tests that are generated +automatically from the Unicode data tables. + + +Character tables +---------------- + +For speed, PCRE2 uses four tables for manipulating and identifying characters +whose code point values are less than 256. By default, a set of tables that is +built into the library is used. The pcre2_maketables() function can be called +by an application to create a new set of tables in the current locale. This are +passed to PCRE2 by calling pcre2_set_character_tables() to put a pointer into a +compile context. + +The source file called pcre2_chartables.c contains the default set of tables. +By default, this is created as a copy of pcre2_chartables.c.dist, which +contains tables for ASCII coding. However, if --enable-rebuild-chartables is +specified for ./configure, a new version of pcre2_chartables.c is built by the +program pcre2_dftables (compiled from pcre2_dftables.c), which uses the ANSI C +character handling functions such as isalnum(), isalpha(), isupper(), +islower(), etc. to build the table sources. This means that the default C +locale that is set for your system will control the contents of these default +tables. You can change the default tables by editing pcre2_chartables.c and +then re-building PCRE2. If you do this, you should take care to ensure that the +file does not get automatically re-generated. The best way to do this is to +move pcre2_chartables.c.dist out of the way and replace it with your customized +tables. + +When the pcre2_dftables program is run as a result of specifying +--enable-rebuild-chartables, it uses the default C locale that is set on your +system. It does not pay attention to the LC_xxx environment variables. In other +words, it uses the system's default locale rather than whatever the compiling +user happens to have set. If you really do want to build a source set of +character tables in a locale that is specified by the LC_xxx variables, you can +run the pcre2_dftables program by hand with the -L option. For example: + + ./pcre2_dftables -L pcre2_chartables.c.special + +The second argument names the file where the source code for the tables is +written. The first two 256-byte tables provide lower casing and case flipping +functions, respectively. The next table consists of a number of 32-byte bit +maps which identify certain character classes such as digits, "word" +characters, white space, etc. These are used when building 32-byte bit maps +that represent character classes for code points less than 256. The final +256-byte table has bits indicating various character types, as follows: + + 1 white space character + 2 letter + 4 lower case letter + 8 decimal digit + 16 alphanumeric or '_' + +You can also specify -b (with or without -L) when running pcre2_dftables. This +causes the tables to be written in binary instead of as source code. A set of +binary tables can be loaded into memory by an application and passed to +pcre2_compile() in the same way as tables created dynamically by calling +pcre2_maketables(). The tables are just a string of bytes, independent of +hardware characteristics such as endianness. This means they can be bundled +with an application that runs in different environments, to ensure consistent +behaviour. + +See also the pcre2build section "Creating character tables at build time". + + +File manifest +------------- + +The distribution should contain the files listed below. + +(A) Source files for the PCRE2 library functions and their headers are found in + the src directory: + + src/pcre2_dftables.c auxiliary program for building pcre2_chartables.c + when --enable-rebuild-chartables is specified + + src/pcre2_chartables.c.dist a default set of character tables that assume + ASCII coding; unless --enable-rebuild-chartables is + specified, used by copying to pcre2_chartables.c + + src/pcre2posix.c ) + src/pcre2_auto_possess.c ) + src/pcre2_chkdint.c ) + src/pcre2_compile.c ) + src/pcre2_compile_class.c ) + src/pcre2_config.c ) + src/pcre2_context.c ) + src/pcre2_convert.c ) + src/pcre2_dfa_match.c ) + src/pcre2_error.c ) + src/pcre2_extuni.c ) + src/pcre2_find_bracket.c ) + src/pcre2_jit_compile.c ) + src/pcre2_jit_match.c ) sources for the functions in the library, + src/pcre2_jit_misc.c ) and some internal functions that they use + src/pcre2_maketables.c ) + src/pcre2_match.c ) + src/pcre2_match_data.c ) + src/pcre2_newline.c ) + src/pcre2_ord2utf.c ) + src/pcre2_pattern_info.c ) + src/pcre2_script_run.c ) + src/pcre2_serialize.c ) + src/pcre2_string_utils.c ) + src/pcre2_study.c ) + src/pcre2_substitute.c ) + src/pcre2_substring.c ) + src/pcre2_tables.c ) + src/pcre2_ucd.c ) + src/pcre2_ucptables.c ) + src/pcre2_valid_utf.c ) + src/pcre2_xclass.c ) + + src/pcre2_printint.c debugging function that is used by pcre2test, + src/pcre2_fuzzsupport.c function for (optional) fuzzing support + + src/config.h.in template for config.h, when built by "configure" + src/pcre2.h.in template for pcre2.h when built by "configure" + src/pcre2posix.h header for the external POSIX wrapper API + src/pcre2_compile.h header for internal use + src/pcre2_internal.h header for internal use + src/pcre2_intmodedep.h a mode-specific internal header + src/pcre2_jit_char_inc.h header used by JIT + src/pcre2_jit_neon_inc.h header used by JIT + src/pcre2_jit_simd_inc.h header used by JIT + src/pcre2_ucp.h header for Unicode property handling + src/pcre2_util.h header for internal utils + + deps/sljit/sljit_src/* source files for the JIT compiler + +(B) Source files for programs that use PCRE2: + + src/pcre2demo.c simple demonstration of coding calls to PCRE2 + src/pcre2grep.c source of a grep utility that uses PCRE2 + src/pcre2test.c comprehensive test program + src/pcre2_jit_test.c JIT test program + src/pcre2posix_test.c POSIX wrapper API test program + +(C) Auxiliary files: + + AUTHORS.md information about the authors of PCRE2 + ChangeLog log of changes to the code + HACKING some notes about the internals of PCRE2 + INSTALL generic installation instructions + LICENCE.md conditions for the use of PCRE2 + COPYING the same, using GNU's standard name + SECURITY.md information on reporting vulnerabilities + Makefile.in ) template for Unix Makefile, which is built by + ) "configure" + Makefile.am ) the automake input that was used to create + ) Makefile.in + NEWS important changes in this release + NON-AUTOTOOLS-BUILD notes on building PCRE2 without using autotools + README this file + RunTest a Unix shell script for running tests + RunGrepTest a Unix shell script for pcre2grep tests + RunTest.bat a Windows batch file for running tests + RunGrepTest.bat a Windows batch file for pcre2grep tests + aclocal.m4 m4 macros (generated by "aclocal") + m4/* m4 macros (used by autoconf) + configure a configuring shell script (built by autoconf) + configure.ac ) the autoconf input that was used to build + ) "configure" and config.h + doc/*.3 man page sources for PCRE2 + doc/*.1 man page sources for pcre2grep and pcre2test + doc/html/* HTML documentation + doc/pcre2.txt plain text version of the man pages + doc/pcre2-config.txt plain text documentation of pcre2-config script + doc/pcre2grep.txt plain text documentation of grep utility program + doc/pcre2test.txt plain text documentation of test program + libpcre2-8.pc.in template for libpcre2-8.pc for pkg-config + libpcre2-16.pc.in template for libpcre2-16.pc for pkg-config + libpcre2-32.pc.in template for libpcre2-32.pc for pkg-config + libpcre2-posix.pc.in template for libpcre2-posix.pc for pkg-config + ar-lib ) + config.guess ) + config.sub ) + depcomp ) helper tools generated by libtool and + compile ) automake, used internally by ./configure + install-sh ) + ltmain.sh ) + missing ) + test-driver ) + perltest.sh Script for running a Perl test program + pcre2-config.in source of script which retains PCRE2 information + testdata/testinput* test data for main library tests + testdata/testoutput* expected test results + testdata/grep* input and output for pcre2grep tests + testdata/* other supporting test files + +(D) Auxiliary files for CMake support + + cmake/COPYING-CMAKE-SCRIPTS + cmake/FindEditline.cmake + cmake/FindReadline.cmake + cmake/pcre2-config-version.cmake.in + cmake/pcre2-config.cmake.in + CMakeLists.txt + config-cmake.h.in + +(E) Auxiliary files for building PCRE2 "by hand" + + src/pcre2.h.generic ) a version of the public PCRE2 header file + ) for use in non-"configure" environments + src/config.h.generic ) a version of config.h for use in non-"configure" + ) environments + +(F) Auxiliary files for building PCRE2 using other build systems + + BUILD.bazel ) + MODULE.bazel ) files used by the Bazel build system + WORKSPACE.bazel ) + build.zig file used by zig's build system + +(G) Auxiliary files for building PCRE2 under OpenVMS + + vms/configure.com ) + vms/openvms_readme.txt ) These files were contributed by a PCRE2 user. + vms/pcre2.h_patch ) + vms/stdint.h ) + +============================== +Last updated: 18 December 2024 +============================== + diff --git a/miniconda3/share/doc/pcre2/html/index.html b/miniconda3/share/doc/pcre2/html/index.html new file mode 100644 index 0000000000000000000000000000000000000000..2d81b678fef19751484b778c8f4384228e1b5fc6 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/index.html @@ -0,0 +1,327 @@ + + + +PCRE2 specification + + +

Perl-compatible Regular Expressions (revised API: PCRE2)

+

+The HTML documentation for PCRE2 consists of a number of pages that are listed +below in alphabetical order. If you are new to PCRE2, please read the first one +first. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
pcre2  Introductory page
pcre2-config  Information about the installation configuration
pcre2api  PCRE2's native API
pcre2build  Building PCRE2
pcre2callout  The callout facility
pcre2compat  Compability with Perl
pcre2convert  Experimental foreign pattern conversion functions
pcre2demo  A demonstration C program that uses the PCRE2 library
pcre2grep  The pcre2grep command
pcre2jit  Discussion of the just-in-time optimization support
pcre2limits  Details of size and other limits
pcre2matching  Discussion of the two matching algorithms
pcre2partial  Using PCRE2 for partial matching
pcre2pattern  Specification of the regular expressions supported by PCRE2
pcre2perform  Some comments on performance
pcre2posix  The POSIX API to the PCRE2 8-bit library
pcre2sample  Discussion of the pcre2demo program
pcre2serialize  Serializing functions for saving precompiled patterns
pcre2syntax  Syntax quick-reference summary
pcre2test  The pcre2test command for testing PCRE2
pcre2unicode  Discussion of Unicode and UTF-8/UTF-16/UTF-32 support
+ +

+There are also individual pages that summarize the interface for each function +in the library. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
pcre2_callout_enumerate  Enumerate callouts in a compiled pattern
pcre2_code_copy  Copy a compiled pattern
pcre2_code_copy_with_tables  Copy a compiled pattern and its character tables
pcre2_code_free  Free a compiled pattern
pcre2_compile  Compile a regular expression pattern
pcre2_compile_context_copy  Copy a compile context
pcre2_compile_context_create  Create a compile context
pcre2_compile_context_free  Free a compile context
pcre2_config  Show build-time configuration options
pcre2_convert_context_copy  Copy a convert context
pcre2_convert_context_create  Create a convert context
pcre2_convert_context_free  Free a convert context
pcre2_converted_pattern_free  Free converted foreign pattern
pcre2_dfa_match  Match a compiled pattern to a subject string + (DFA algorithm; not Perl compatible)
pcre2_general_context_copy  Copy a general context
pcre2_general_context_create  Create a general context
pcre2_general_context_free  Free a general context
pcre2_get_error_message  Get textual error message for error number
pcre2_get_mark  Get a (*MARK) name
pcre2_get_match_data_size  Get the size of a match data block
pcre2_get_ovector_count  Get the ovector count
pcre2_get_ovector_pointer  Get a pointer to the ovector
pcre2_get_startchar  Get the starting character offset
pcre2_jit_compile  Process a compiled pattern with the JIT compiler
pcre2_jit_free_unused_memory  Free unused JIT memory
pcre2_jit_match  Fast path interface to JIT matching
pcre2_jit_stack_assign  Assign stack for JIT matching
pcre2_jit_stack_create  Create a stack for JIT matching
pcre2_jit_stack_free  Free a JIT matching stack
pcre2_maketables  Build character tables in current locale
pcre2_maketables_free  Free character tables
pcre2_match  Match a compiled pattern to a subject string + (Perl compatible)
pcre2_match_context_copy  Copy a match context
pcre2_match_context_create  Create a match context
pcre2_match_context_free  Free a match context
pcre2_match_data_create  Create a match data block
pcre2_match_data_create_from_pattern  Create a match data block getting size from pattern
pcre2_match_data_free  Free a match data block
pcre2_pattern_convert  Experimental foreign pattern converter
pcre2_pattern_info  Extract information about a pattern
pcre2_serialize_decode  Decode serialized compiled patterns
pcre2_serialize_encode  Serialize compiled patterns for save/restore
pcre2_serialize_free  Free serialized compiled patterns
pcre2_serialize_get_number_of_codes  Get number of serialized compiled patterns
pcre2_set_bsr  Set \R convention
pcre2_set_callout  Set up a callout function
pcre2_set_character_tables  Set character tables
pcre2_set_compile_extra_options  Set compile time extra options
pcre2_set_compile_recursion_guard  Set up a compile recursion guard function
pcre2_set_depth_limit  Set the match backtracking depth limit
pcre2_set_glob_escape  Set glob escape character
pcre2_set_glob_separator  Set glob separator character
pcre2_set_heap_limit  Set the match backtracking heap limit
pcre2_set_match_limit  Set the match limit
pcre2_set_max_pattern_compiled_length  Set the maximum length of a compiled pattern
pcre2_set_max_pattern_length  Set the maximum length of a pattern
pcre2_set_max_varlookbehind  Set the maximum match length for a variable-length lookbehind
pcre2_set_newline  Set the newline convention
pcre2_set_offset_limit  Set the offset limit
pcre2_set_optimize  Set an optimization directive
pcre2_set_parens_nest_limit  Set the parentheses nesting limit
pcre2_set_recursion_limit  Obsolete: use pcre2_set_depth_limit
pcre2_set_recursion_memory_management  Obsolete function that (from 10.30 onwards) does nothing
pcre2_set_substitute_callout  Set a substitution callout function
pcre2_set_substitute_case_callout  Set a substitution case callout function
pcre2_substitute  Match a compiled pattern to a subject string and do + substitutions
pcre2_substring_copy_byname  Extract named substring into given buffer
pcre2_substring_copy_bynumber  Extract numbered substring into given buffer
pcre2_substring_free  Free extracted substring
pcre2_substring_get_byname  Extract named substring into new memory
pcre2_substring_get_bynumber  Extract numbered substring into new memory
pcre2_substring_length_byname  Find length of named substring
pcre2_substring_length_bynumber  Find length of numbered substring
pcre2_substring_list_free  Free list of extracted substrings
pcre2_substring_list_get  Extract all substrings into new memory
pcre2_substring_nametable_scan  Find table entries for given string name
pcre2_substring_number_from_name  Convert captured string name to number
+ + + diff --git a/miniconda3/share/doc/pcre2/html/pcre2-config.html b/miniconda3/share/doc/pcre2/html/pcre2-config.html new file mode 100644 index 0000000000000000000000000000000000000000..b71d76026860dab2b0c0426f77ef8674ace80f10 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2-config.html @@ -0,0 +1,102 @@ + + +pcre2-config specification + + +

pcre2-config man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+

+
SYNOPSIS
+

+pcre2-config [--prefix] [--exec-prefix] [--version] + [--libs8] [--libs16] [--libs32] [--libs-posix] + [--cflags] [--cflags-posix] +

+
DESCRIPTION
+

+pcre2-config returns the configuration of the installed PCRE2 libraries +and the options required to compile a program to use them. Some of the options +apply only to the 8-bit, or 16-bit, or 32-bit libraries, respectively, and are +not available for libraries that have not been built. If an unavailable option +is encountered, the "usage" information is output. +

+
OPTIONS
+

+--prefix +Writes the directory prefix used in the PCRE2 installation for architecture +independent files (/usr on many systems, /usr/local on some +systems) to the standard output. +

+

+--exec-prefix +Writes the directory prefix used in the PCRE2 installation for architecture +dependent files (normally the same as --prefix) to the standard output. +

+

+--version +Writes the version number of the installed PCRE2 libraries to the standard +output. +

+

+--libs8 +Writes to the standard output the command line options required to link +with the 8-bit PCRE2 library (-lpcre2-8 on many systems). +

+

+--libs16 +Writes to the standard output the command line options required to link +with the 16-bit PCRE2 library (-lpcre2-16 on many systems). +

+

+--libs32 +Writes to the standard output the command line options required to link +with the 32-bit PCRE2 library (-lpcre2-32 on many systems). +

+

+--libs-posix +Writes to the standard output the command line options required to link with +PCRE2's POSIX API wrapper library (-lpcre2-posix -lpcre2-8 on many +systems). +

+

+--cflags +Writes to the standard output the command line options required to compile +files that use PCRE2 (this may include some -I options, but is blank on +many systems). +

+

+--cflags-posix +Writes to the standard output the command line options required to compile +files that use PCRE2's POSIX API wrapper library (this may include some +-I options, but is blank on many systems). +

+
SEE ALSO
+

+pcre2(3) +

+
AUTHOR
+

+This manual page was originally written by Mark Baker for the Debian GNU/Linux +system. It has been subsequently revised as a generic PCRE2 man page. +

+
REVISION
+

+Last updated: 28 September 2014 +
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2.html b/miniconda3/share/doc/pcre2/html/pcre2.html new file mode 100644 index 0000000000000000000000000000000000000000..e72b6b1cb1d156308436b15d7e9e038733b02a90 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2.html @@ -0,0 +1,214 @@ + + +pcre2 specification + + +

pcre2 man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+

+
INTRODUCTION
+

+PCRE2 is the name used for a revised API for the PCRE library, which is a set +of functions, written in C, that implement regular expression pattern matching +using the same syntax and semantics as Perl, with just a few differences. After +nearly two decades, the limitations of the original API were making development +increasingly difficult. The new API is more extensible, and it was simplified +by abolishing the separate "study" optimizing function; in PCRE2, patterns are +automatically optimized where possible. Since forking from PCRE1, the code has +been extensively refactored and new features introduced. The old library is now +obsolete and is no longer maintained. +

+

+As well as Perl-style regular expression patterns, some features that appeared +in Python and the original PCRE before they appeared in Perl are available +using the Python syntax. There is also some support for one or two .NET and +Oniguruma syntax items, and there are options for requesting some minor changes +that give better ECMAScript (aka JavaScript) compatibility. +

+

+The source code for PCRE2 can be compiled to support strings of 8-bit, 16-bit, +or 32-bit code units, which means that up to three separate libraries may be +installed, one for each code unit size. The size of code unit is not related to +the bit size of the underlying hardware. In a 64-bit environment that also +supports 32-bit applications, versions of PCRE2 that are compiled in both +64-bit and 32-bit modes may be needed. +

+

+The original work to extend PCRE to 16-bit and 32-bit code units was done by +Zoltan Herczeg and Christian Persch, respectively. In all three cases, strings +can be interpreted either as one character per code unit, or as UTF-encoded +Unicode, with support for Unicode general category properties. Unicode support +is optional at build time (but is the default). However, processing strings as +UTF code units must be enabled explicitly at run time. The version of Unicode +in use can be discovered by running +

+  pcre2test -C
+
+

+

+The three libraries contain identical sets of functions, with names ending in +_8, _16, or _32, respectively (for example, pcre2_compile_8()). However, +by defining PCRE2_CODE_UNIT_WIDTH to be 8, 16, or 32, a program that uses just +one code unit width can be written using generic names such as +pcre2_compile(), and the documentation is written assuming that this is +the case. +

+

+In addition to the Perl-compatible matching function, PCRE2 contains an +alternative function that matches the same compiled patterns in a different +way. In certain circumstances, the alternative function has some advantages. +For a discussion of the two matching algorithms, see the +pcre2matching +page. +

+

+Details of exactly which Perl regular expression features are and are not +supported by PCRE2 are given in separate documents. See the +pcre2pattern +and +pcre2compat +pages. There is a syntax summary in the +pcre2syntax +page. +

+

+Some features of PCRE2 can be included, excluded, or changed when the library +is built. The +pcre2_config() +function makes it possible for a client to discover which features are +available. The features themselves are described in the +pcre2build +page. Documentation about building PCRE2 for various operating systems can be +found in the +README +and +NON-AUTOTOOLS_BUILD +files in the source distribution. +

+

+The libraries contains a number of undocumented internal functions and data +tables that are used by more than one of the exported external functions, but +which are not intended for use by external callers. Their names all begin with +"_pcre2", which hopefully will not provoke any name clashes. In some +environments, it is possible to control which external symbols are exported +when a shared library is built, and in these cases the undocumented symbols are +not exported. +

+
SECURITY CONSIDERATIONS
+

+If you are using PCRE2 in a non-UTF application that permits users to supply +arbitrary patterns for compilation, you should be aware of a feature that +allows users to turn on UTF support from within a pattern. For example, an +8-bit pattern that begins with "(*UTF)" turns on UTF-8 mode, which interprets +patterns and subjects as strings of UTF-8 code units instead of individual +8-bit characters. This causes both the pattern and any data against which it is +matched to be checked for UTF-8 validity. If the data string is very long, such +a check might use sufficiently many resources as to cause your application to +lose performance. +

+

+One way of guarding against this possibility is to use the +pcre2_pattern_info() function to check the compiled pattern's options for +PCRE2_UTF. Alternatively, you can set the PCRE2_NEVER_UTF option when calling +pcre2_compile(). This causes a compile time error if the pattern contains +a UTF-setting sequence. +

+

+The use of Unicode properties for character types such as \d can also be +enabled from within the pattern, by specifying "(*UCP)". This feature can be +disallowed by setting the PCRE2_NEVER_UCP option. +

+

+If your application is one that supports UTF, be aware that validity checking +can take time. If the same data string is to be matched many times, you can use +the PCRE2_NO_UTF_CHECK option for the second and subsequent matches to avoid +running redundant checks. +

+

+The use of the \C escape sequence in a UTF-8 or UTF-16 pattern can lead to +problems, because it may leave the current matching point in the middle of a +multi-code-unit character. The PCRE2_NEVER_BACKSLASH_C option can be used by an +application to lock out the use of \C, causing a compile-time error if it is +encountered. It is also possible to build PCRE2 with the use of \C permanently +disabled. +

+

+Another way that performance can be hit is by running a pattern that has a very +large search tree against a string that will never match. Nested unlimited +repeats in a pattern are a common example. PCRE2 provides some protection +against this: see the pcre2_set_match_limit() function in the +pcre2api +page. There is a similar function called pcre2_set_depth_limit() that can +be used to restrict the amount of memory that is used. +

+
USER DOCUMENTATION
+

+The user documentation for PCRE2 comprises a number of different sections. In +the "man" format, each of these is a separate "man page". In the HTML format, +each is a separate page, linked from the index page. In the plain text format, +the descriptions of the pcre2grep and pcre2test programs are in +files called pcre2grep.txt and pcre2test.txt, respectively. The +remaining sections, except for the pcre2demo section (which is a program +listing), and the short pages for individual functions, are concatenated in +pcre2.txt, for ease of searching. The sections are as follows: +

+  pcre2              this document
+  pcre2-config       show PCRE2 installation configuration information
+  pcre2api           details of PCRE2's native C API
+  pcre2build         building PCRE2
+  pcre2callout       details of the pattern callout feature
+  pcre2compat        discussion of Perl compatibility
+  pcre2convert       details of pattern conversion functions
+  pcre2demo          a demonstration C program that uses PCRE2
+  pcre2grep          description of the pcre2grep command (8-bit only)
+  pcre2jit           discussion of just-in-time optimization support
+  pcre2limits        details of size and other limits
+  pcre2matching      discussion of the two matching algorithms
+  pcre2partial       details of the partial matching facility
+  pcre2pattern       syntax and semantics of supported regular expression patterns
+  pcre2perform       discussion of performance issues
+  pcre2posix         the POSIX-compatible C API for the 8-bit library
+  pcre2sample        discussion of the pcre2demo program
+  pcre2serialize     details of pattern serialization
+  pcre2syntax        quick syntax reference
+  pcre2test          description of the pcre2test command
+  pcre2unicode       discussion of Unicode and UTF support
+
+In the "man" and HTML formats, there is also a short page for each C library +function, listing its arguments and results. +

+
AUTHORS
+

+The current maintainers of PCRE2 are Nicholas Wilson and Zoltan Herczeg. +

+

+PCRE2 was written by Philip Hazel, of the University Computing Service, +Cambridge, England. Many others have also contributed. +

+

+To contact the maintainers, please use the GitHub issues tracker or PCRE2 +mailing list, as described at the project page: +https://github.com/PCRE2Project/pcre2 +

+
REVISION
+

+Last updated: 18 December 2024 +
+Copyright © 1997-2021 University of Cambridge. +
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_callout_enumerate.html b/miniconda3/share/doc/pcre2/html/pcre2_callout_enumerate.html new file mode 100644 index 0000000000000000000000000000000000000000..505ea7b250bd9f884ac0885d4ba4120bab502a43 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_callout_enumerate.html @@ -0,0 +1,63 @@ + + +pcre2_callout_enumerate specification + + +

pcre2_callout_enumerate man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_callout_enumerate(const pcre2_code *code, + int (*callback)(pcre2_callout_enumerate_block *, void *), + void *callout_data); +

+
+DESCRIPTION +
+

+This function scans a compiled regular expression and calls the callback() +function for each callout within the pattern. The yield of the function is zero +for success and non-zero otherwise. The arguments are: +

+  code           Points to the compiled pattern
+  callback       The callback function
+  callout_data   User data that is passed to the callback
+
+The callback() function is passed a pointer to a data block containing +the following fields (not necessarily in this order): +
+  uint32_t   version                Block version number
+  uint32_t   callout_number         Number for numbered callouts
+  PCRE2_SIZE pattern_position       Offset to next item in pattern
+  PCRE2_SIZE next_item_length       Length of next item in pattern
+  PCRE2_SIZE callout_string_offset  Offset to string within pattern
+  PCRE2_SIZE callout_string_length  Length of callout string
+  PCRE2_SPTR callout_string         Points to callout string or is NULL
+
+The second argument passed to the callback() function is the callout data +that was passed to pcre2_callout_enumerate(). The callback() +function must return zero for success. Any other value causes the pattern scan +to stop, with the value being passed back as the result of +pcre2_callout_enumerate(). +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_code_copy.html b/miniconda3/share/doc/pcre2/html/pcre2_code_copy.html new file mode 100644 index 0000000000000000000000000000000000000000..667d7b7ff88b55e3c6786e90b47e880cc2c6c4ea --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_code_copy.html @@ -0,0 +1,43 @@ + + +pcre2_code_copy specification + + +

pcre2_code_copy man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+pcre2_code *pcre2_code_copy(const pcre2_code *code); +

+
+DESCRIPTION +
+

+This function makes a copy of the memory used for a compiled pattern, excluding +any memory used by the JIT compiler. Without a subsequent call to +pcre2_jit_compile(), the copy can be used only for non-JIT matching. The +pointer to the character tables is copied, not the tables themselves (see +pcre2_code_copy_with_tables()). The yield of the function is NULL if +code is NULL or if sufficient memory cannot be obtained. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_code_copy_with_tables.html b/miniconda3/share/doc/pcre2/html/pcre2_code_copy_with_tables.html new file mode 100644 index 0000000000000000000000000000000000000000..67b2e1ffd6e871ae61e2c037c375ee34cff610e6 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_code_copy_with_tables.html @@ -0,0 +1,44 @@ + + +pcre2_code_copy_with_tables specification + + +

pcre2_code_copy_with_tables man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+pcre2_code *pcre2_code_copy_with_tables(const pcre2_code *code); +

+
+DESCRIPTION +
+

+This function makes a copy of the memory used for a compiled pattern, excluding +any memory used by the JIT compiler. Without a subsequent call to +pcre2_jit_compile(), the copy can be used only for non-JIT matching. +Unlike pcre2_code_copy(), a separate copy of the character tables is also +made, with the new code pointing to it. This memory will be automatically freed +when pcre2_code_free() is called. The yield of the function is NULL if +code is NULL or if sufficient memory cannot be obtained. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_code_free.html b/miniconda3/share/doc/pcre2/html/pcre2_code_free.html new file mode 100644 index 0000000000000000000000000000000000000000..ff302fcdfcc4d769e922efc78f25c697ebcca8db --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_code_free.html @@ -0,0 +1,42 @@ + + +pcre2_code_free specification + + +

pcre2_code_free man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+void pcre2_code_free(pcre2_code *code); +

+
+DESCRIPTION +
+

+If code is NULL, this function does nothing. Otherwise, code must +point to a compiled pattern. This function frees its memory, including any +memory used by the JIT compiler. If the compiled pattern was created by a call +to pcre2_code_copy_with_tables(), the memory for the character tables is +also freed. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_compile.html b/miniconda3/share/doc/pcre2/html/pcre2_compile.html new file mode 100644 index 0000000000000000000000000000000000000000..ee933f38983cc2ff5c361749123573f55d19eab2 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_compile.html @@ -0,0 +1,120 @@ + + +pcre2_compile specification + + +

pcre2_compile man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+pcre2_code *pcre2_compile(PCRE2_SPTR pattern, PCRE2_SIZE length, + uint32_t options, int *errorcode, PCRE2_SIZE *erroroffset, + pcre2_compile_context *ccontext); +

+
+DESCRIPTION +
+

+This function compiles a regular expression pattern into an internal form. Its +arguments are: +

+  pattern       A string containing expression to be compiled
+  length        The length of the string or PCRE2_ZERO_TERMINATED
+  options       Primary option bits
+  errorcode     Where to put an error code
+  erroffset     Where to put an error offset
+  ccontext      Pointer to a compile context or NULL
+
+The length of the pattern and any error offset that is returned are in code +units, not characters. A NULL pattern with zero length is treated as an empty +string. A compile context is needed only if you want to provide custom memory +allocation functions, or to provide an external function for system stack size +checking (see pcre2_set_compile_recursion_guard()), or to change one or +more of these parameters: +
+  What \R matches (Unicode newlines, or CR, LF, CRLF only);
+  PCRE2's character tables;
+  The newline character sequence;
+  The compile time nested parentheses limit;
+  The maximum pattern length (in code units) that is allowed;
+  The additional options bits.
+
+The primary option bits are: +
+  PCRE2_ANCHORED           Force pattern anchoring
+  PCRE2_ALLOW_EMPTY_CLASS  Allow empty classes
+  PCRE2_ALT_BSUX           Alternative handling of \u, \U, and \x
+  PCRE2_ALT_CIRCUMFLEX     Alternative handling of ^ in multiline mode
+  PCRE2_ALT_EXTENDED_CLASS Alternative extended character class syntax
+  PCRE2_ALT_VERBNAMES      Process backslashes in verb names
+  PCRE2_AUTO_CALLOUT       Compile automatic callouts
+  PCRE2_CASELESS           Do caseless matching
+  PCRE2_DOLLAR_ENDONLY     $ not to match newline at end
+  PCRE2_DOTALL             . matches anything including NL
+  PCRE2_DUPNAMES           Allow duplicate names for subpatterns
+  PCRE2_ENDANCHORED        Pattern can match only at end of subject
+  PCRE2_EXTENDED           Ignore white space and # comments
+  PCRE2_FIRSTLINE          Force matching to be before newline
+  PCRE2_LITERAL            Pattern characters are all literal
+  PCRE2_MATCH_INVALID_UTF  Enable support for matching invalid UTF
+  PCRE2_MATCH_UNSET_BACKREF  Match unset backreferences
+  PCRE2_MULTILINE          ^ and $ match newlines within data
+  PCRE2_NEVER_BACKSLASH_C  Lock out the use of \C in patterns
+  PCRE2_NEVER_UCP          Lock out PCRE2_UCP, e.g. via (*UCP)
+  PCRE2_NEVER_UTF          Lock out PCRE2_UTF, e.g. via (*UTF)
+  PCRE2_NO_AUTO_CAPTURE    Disable numbered capturing paren-
+                            theses (named ones available)
+  PCRE2_NO_AUTO_POSSESS    Disable auto-possessification
+  PCRE2_NO_DOTSTAR_ANCHOR  Disable automatic anchoring for .*
+  PCRE2_NO_START_OPTIMIZE  Disable match-time start optimizations
+  PCRE2_NO_UTF_CHECK       Do not check the pattern for UTF validity
+                             (only relevant if PCRE2_UTF is set)
+  PCRE2_UCP                Use Unicode properties for \d, \w, etc.
+  PCRE2_UNGREEDY           Invert greediness of quantifiers
+  PCRE2_USE_OFFSET_LIMIT   Enable offset limit for unanchored matching
+  PCRE2_UTF                Treat pattern and subjects as UTF strings
+
+PCRE2 must be built with Unicode support (the default) in order to use +PCRE2_UTF, PCRE2_UCP and related options. +

+

+Additional options may be set in the compile context via the +pcre2_set_compile_extra_options +function. +

+

+If either of errorcode or erroroffset is NULL, the function returns +NULL immediately. Otherwise, the yield of this function is a pointer to a +private data structure that contains the compiled pattern, or NULL if an error +was detected. In the error case, a text error message can be obtained by +passing the value returned via the errorcode argument to the +pcre2_get_error_message() function. The offset (in code units) where the +error was encountered is returned via the erroroffset argument. +

+

+If there is no error, the value passed via errorcode returns the message +"no error" if passed to pcre2_get_error_message(), and the value passed +via erroroffset is zero. +

+

+There is a complete description of the PCRE2 native API, with more detail on +each option, in the +pcre2api +page, and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_compile_context_copy.html b/miniconda3/share/doc/pcre2/html/pcre2_compile_context_copy.html new file mode 100644 index 0000000000000000000000000000000000000000..9e9884b83e6c7ee1c8ded301e64cd0aaf0c4276d --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_compile_context_copy.html @@ -0,0 +1,41 @@ + + +pcre2_compile_context_copy specification + + +

pcre2_compile_context_copy man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+pcre2_compile_context *pcre2_compile_context_copy( + pcre2_compile_context *ccontext); +

+
+DESCRIPTION +
+

+This function makes a new copy of a compile context, using the memory +allocation function that was used for the original context. The result is NULL +if the memory cannot be obtained. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_compile_context_create.html b/miniconda3/share/doc/pcre2/html/pcre2_compile_context_create.html new file mode 100644 index 0000000000000000000000000000000000000000..5eacd4ec77ca15ad706caaf0db599a00b5cc770b --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_compile_context_create.html @@ -0,0 +1,42 @@ + + +pcre2_compile_context_create specification + + +

pcre2_compile_context_create man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+pcre2_compile_context *pcre2_compile_context_create( + pcre2_general_context *gcontext); +

+
+DESCRIPTION +
+

+This function creates and initializes a new compile context. If its argument is +NULL, malloc() is used to get the necessary memory; otherwise the memory +allocation function within the general context is used. The result is NULL if +the memory could not be obtained. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_compile_context_free.html b/miniconda3/share/doc/pcre2/html/pcre2_compile_context_free.html new file mode 100644 index 0000000000000000000000000000000000000000..b4159b111a695574aeb98681af5b863da52e4536 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_compile_context_free.html @@ -0,0 +1,41 @@ + + +pcre2_compile_context_free specification + + +

pcre2_compile_context_free man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+void pcre2_compile_context_free(pcre2_compile_context *ccontext); +

+
+DESCRIPTION +
+

+This function frees the memory occupied by a compile context, using the memory +freeing function from the general context with which it was created, or +free() if that was not set. If the argument is NULL, the function returns +immediately without doing anything. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_config.html b/miniconda3/share/doc/pcre2/html/pcre2_config.html new file mode 100644 index 0000000000000000000000000000000000000000..f05bd0627c32e2b1ce2577e24654ddf2104f0bb7 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_config.html @@ -0,0 +1,84 @@ + + +pcre2_config specification + + +

pcre2_config man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_config(uint32_t what, void *where); +

+
+DESCRIPTION +
+

+This function makes it possible for a client program to find out which optional +features are available in the version of the PCRE2 library it is using. The +arguments are as follows: +

+  what     A code specifying what information is required
+  where    Points to where to put the information
+
+If where is NULL, the function returns the amount of memory needed for +the requested information. When the information is a string, the value is in +code units; for other types of data it is in bytes. +

+

+If where is not NULL, for PCRE2_CONFIG_JITTARGET, +PCRE2_CONFIG_UNICODE_VERSION, and PCRE2_CONFIG_VERSION it must point to a +buffer that is large enough to hold the string. For all other codes it must +point to a uint32_t integer variable. The available codes are: +

+  PCRE2_CONFIG_BSR             Indicates what \R matches by default:
+                                 PCRE2_BSR_UNICODE
+                                 PCRE2_BSR_ANYCRLF
+  PCRE2_CONFIG_COMPILED_WIDTHS Which of 8/16/32 support was compiled
+  PCRE2_CONFIG_DEPTHLIMIT      Default backtracking depth limit
+  PCRE2_CONFIG_HEAPLIMIT       Default heap memory limit
+  PCRE2_CONFIG_JIT             Availability of just-in-time compiler support (1=yes 0=no)
+  PCRE2_CONFIG_JITTARGET       Information (a string) about the target architecture for the JIT compiler
+  PCRE2_CONFIG_LINKSIZE        Configured internal link size (2, 3, 4)
+  PCRE2_CONFIG_MATCHLIMIT      Default internal resource limit
+  PCRE2_CONFIG_NEVER_BACKSLASH_C  Whether or not \C is disabled
+  PCRE2_CONFIG_NEWLINE         Code for the default newline sequence:
+                                 PCRE2_NEWLINE_CR
+                                 PCRE2_NEWLINE_LF
+                                 PCRE2_NEWLINE_CRLF
+                                 PCRE2_NEWLINE_ANY
+                                 PCRE2_NEWLINE_ANYCRLF
+                                 PCRE2_NEWLINE_NUL
+  PCRE2_CONFIG_PARENSLIMIT     Default parentheses nesting limit
+  PCRE2_CONFIG_RECURSIONLIMIT  Obsolete: use PCRE2_CONFIG_DEPTHLIMIT
+  PCRE2_CONFIG_STACKRECURSE    Obsolete: always returns 0
+  PCRE2_CONFIG_UNICODE         Availability of Unicode support (1=yes 0=no)
+  PCRE2_CONFIG_UNICODE_VERSION The Unicode version (a string)
+  PCRE2_CONFIG_VERSION         The PCRE2 version (a string)
+
+The function yields a non-negative value on success or the negative value +PCRE2_ERROR_BADOPTION otherwise. This is also the result for the +PCRE2_CONFIG_JITTARGET code if JIT support is not available. When a string is +requested, the function returns the number of code units used, including the +terminating zero. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_convert_context_copy.html b/miniconda3/share/doc/pcre2/html/pcre2_convert_context_copy.html new file mode 100644 index 0000000000000000000000000000000000000000..3c44ac6db3c2085d12b33cec18e6211df7b98549 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_convert_context_copy.html @@ -0,0 +1,40 @@ + + +pcre2_convert_context_copy specification + + +

pcre2_convert_context_copy man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+pcre2_convert_context *pcre2_convert_context_copy( + pcre2_convert_context *cvcontext); +

+
+DESCRIPTION +
+

+This function is part of an experimental set of pattern conversion functions. +It makes a new copy of a convert context, using the memory allocation function +that was used for the original context. The result is NULL if the memory cannot +be obtained. +

+

+The pattern conversion functions are described in the +pcre2convert +documentation. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_convert_context_create.html b/miniconda3/share/doc/pcre2/html/pcre2_convert_context_create.html new file mode 100644 index 0000000000000000000000000000000000000000..256478095a51649a76e433a41ae7dd1667aea518 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_convert_context_create.html @@ -0,0 +1,41 @@ + + +pcre2_convert_context_create specification + + +

pcre2_convert_context_create man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+pcre2_convert_context *pcre2_convert_context_create( + pcre2_general_context *gcontext); +

+
+DESCRIPTION +
+

+This function is part of an experimental set of pattern conversion functions. +It creates and initializes a new convert context. If its argument is +NULL, malloc() is used to get the necessary memory; otherwise the memory +allocation function within the general context is used. The result is NULL if +the memory could not be obtained. +

+

+The pattern conversion functions are described in the +pcre2convert +documentation. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_convert_context_free.html b/miniconda3/share/doc/pcre2/html/pcre2_convert_context_free.html new file mode 100644 index 0000000000000000000000000000000000000000..e9b142bf75df64520024737668f9ae2aef231f98 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_convert_context_free.html @@ -0,0 +1,40 @@ + + +pcre2_convert_context_free specification + + +

pcre2_convert_context_free man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+void pcre2_convert_context_free(pcre2_convert_context *cvcontext); +

+
+DESCRIPTION +
+

+This function is part of an experimental set of pattern conversion functions. +It frees the memory occupied by a convert context, using the memory +freeing function from the general context with which it was created, or +free() if that was not set. If the argument is NULL, the function returns +immediately without doing anything. +

+

+The pattern conversion functions are described in the +pcre2convert +documentation. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_converted_pattern_free.html b/miniconda3/share/doc/pcre2/html/pcre2_converted_pattern_free.html new file mode 100644 index 0000000000000000000000000000000000000000..01d28d7a67fd6f60256be289263fb4584be2f2bc --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_converted_pattern_free.html @@ -0,0 +1,40 @@ + + +pcre2_converted_pattern_free specification + + +

pcre2_converted_pattern_free man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+void pcre2_converted_pattern_free(PCRE2_UCHAR *converted_pattern); +

+
+DESCRIPTION +
+

+This function is part of an experimental set of pattern conversion functions. +It frees the memory occupied by a converted pattern that was obtained by +calling pcre2_pattern_convert() with arguments that caused it to place +the converted pattern into newly obtained heap memory. If the argument is NULL, +the function returns immediately without doing anything. +

+

+The pattern conversion functions are described in the +pcre2convert +documentation. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_dfa_match.html b/miniconda3/share/doc/pcre2/html/pcre2_dfa_match.html new file mode 100644 index 0000000000000000000000000000000000000000..0ae428c1fb6a7b2beb8a9aa2679e9d18c64afd78 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_dfa_match.html @@ -0,0 +1,86 @@ + + +pcre2_dfa_match specification + + +

pcre2_dfa_match man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_dfa_match(const pcre2_code *code, PCRE2_SPTR subject, + PCRE2_SIZE length, PCRE2_SIZE startoffset, + uint32_t options, pcre2_match_data *match_data, + pcre2_match_context *mcontext, + int *workspace, PCRE2_SIZE wscount); +

+
+DESCRIPTION +
+

+This function matches a compiled regular expression against a given subject +string, using an alternative matching algorithm that scans the subject string +just once (except when processing lookaround assertions). This function is +not Perl-compatible (the Perl-compatible matching function is +pcre2_match()). The arguments for this function are: +

+  code         Points to the compiled pattern
+  subject      Points to the subject string
+  length       Length of the subject string
+  startoffset  Offset in the subject at which to start matching
+  options      Option bits
+  match_data   Points to a match data block, for results
+  mcontext     Points to a match context, or is NULL
+  workspace    Points to a vector of ints used as working space
+  wscount      Number of elements in the vector
+
+The size of output vector needed to contain all the results depends on the +number of simultaneous matches, not on the number of parentheses in the +pattern. Using pcre2_match_data_create_from_pattern() to create the match +data block is therefore not advisable when using this function. +

+

+A match context is needed only if you want to set up a callout function or +specify the heap limit or the match or the recursion depth limits. The +length and startoffset values are code units, not characters. The +options are: +

+  PCRE2_ANCHORED          Match only at the first position
+  PCRE2_COPY_MATCHED_SUBJECT
+                          On success, make a private subject copy
+  PCRE2_ENDANCHORED       Pattern can match only at end of subject
+  PCRE2_NOTBOL            Subject is not the beginning of a line
+  PCRE2_NOTEOL            Subject is not the end of a line
+  PCRE2_NOTEMPTY          An empty string is not a valid match
+  PCRE2_NOTEMPTY_ATSTART  An empty string at the start of the subject is not a valid match
+  PCRE2_NO_UTF_CHECK      Do not check the subject for UTF validity (only relevant if PCRE2_UTF
+                           was set at compile time)
+  PCRE2_PARTIAL_HARD      Return PCRE2_ERROR_PARTIAL for a partial match even if there is a full match
+  PCRE2_PARTIAL_SOFT      Return PCRE2_ERROR_PARTIAL for a partial match if no full matches are found
+  PCRE2_DFA_RESTART       Restart after a partial match
+  PCRE2_DFA_SHORTEST      Return only the shortest match
+
+There are restrictions on what may appear in a pattern when using this matching +function. Details are given in the +pcre2matching +documentation. For details of partial matching, see the +pcre2partial +page. There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_general_context_copy.html b/miniconda3/share/doc/pcre2/html/pcre2_general_context_copy.html new file mode 100644 index 0000000000000000000000000000000000000000..001853468351b2fa29c579b723f2fb32298bb640 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_general_context_copy.html @@ -0,0 +1,42 @@ + + +pcre2_general_context_copy specification + + +

pcre2_general_context_copy man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+pcre2_general_context *pcre2_general_context_copy( + pcre2_general_context *gcontext); +

+
+DESCRIPTION +
+

+This function makes a new copy of a general context, using the memory +allocation functions in the context, if set, to get the necessary memory. +Otherwise malloc() is used. The result is NULL if the memory cannot be +obtained. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_general_context_create.html b/miniconda3/share/doc/pcre2/html/pcre2_general_context_create.html new file mode 100644 index 0000000000000000000000000000000000000000..a1a165d7d5bc5365f55d10916b474cc511c8c274 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_general_context_create.html @@ -0,0 +1,44 @@ + + +pcre2_general_context_create specification + + +

pcre2_general_context_create man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+pcre2_general_context *pcre2_general_context_create( + void *(*private_malloc)(size_t, void *), + void (*private_free)(void *, void *), void *memory_data); +

+
+DESCRIPTION +
+

+This function creates and initializes a general context. The arguments define +custom memory management functions and a data value that is passed to them when +they are called. The private_malloc() function is used to get memory for +the context. If either of the first two arguments is NULL, the system memory +management function is used. The result is NULL if no memory could be obtained. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_general_context_free.html b/miniconda3/share/doc/pcre2/html/pcre2_general_context_free.html new file mode 100644 index 0000000000000000000000000000000000000000..9f335f5780deaa9827fa1ef2bdf99a4f407026df --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_general_context_free.html @@ -0,0 +1,40 @@ + + +pcre2_general_context_free specification + + +

pcre2_general_context_free man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+void pcre2_general_context_free(pcre2_general_context *gcontext); +

+
+DESCRIPTION +
+

+This function frees the memory occupied by a general context, using the memory +freeing function within the context, if set. If the argument is NULL, the +function returns immediately without doing anything. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_get_error_message.html b/miniconda3/share/doc/pcre2/html/pcre2_get_error_message.html new file mode 100644 index 0000000000000000000000000000000000000000..70057600dd3dc811916f0cbb03fb95adb0931bdb --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_get_error_message.html @@ -0,0 +1,51 @@ + + +pcre2_get_error_message specification + + +

pcre2_get_error_message man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_get_error_message(int errorcode, PCRE2_UCHAR *buffer, + PCRE2_SIZE bufflen); +

+
+DESCRIPTION +
+

+This function provides a textual error message for each PCRE2 error code. +Compilation errors are positive numbers; UTF formatting errors and matching +errors are negative numbers. The arguments are: +

+  errorcode   an error code (positive or negative)
+  buffer      where to put the message
+  bufflen     the length of the buffer (code units)
+
+The function returns the length of the message in code units, excluding the +trailing zero, or the negative error code PCRE2_ERROR_NOMEMORY if the buffer is +too small. In this case, the returned message is truncated (but still with a +trailing zero). If errorcode does not contain a recognized error code +number, the negative value PCRE2_ERROR_BADDATA is returned. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_get_mark.html b/miniconda3/share/doc/pcre2/html/pcre2_get_mark.html new file mode 100644 index 0000000000000000000000000000000000000000..88e63269699011e3e05f9fc790677855a371b342 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_get_mark.html @@ -0,0 +1,47 @@ + + +pcre2_get_mark specification + + +

pcre2_get_mark man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+PCRE2_SPTR pcre2_get_mark(pcre2_match_data *match_data); +

+
+DESCRIPTION +
+

+After a call of pcre2_match() that was passed the match block that is +this function's argument, this function returns a pointer to the last (*MARK), +(*PRUNE), or (*THEN) name that was encountered during the matching process. The +name is zero-terminated, and is within the compiled pattern. The length of the +name is in the preceding code unit. If no name is available, NULL is returned. +

+

+After a successful match, the name that is returned is the last one on the +matching path. After a failed match or a partial match, the last encountered +name is returned. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_get_match_data_heapframes_size.html b/miniconda3/share/doc/pcre2/html/pcre2_get_match_data_heapframes_size.html new file mode 100644 index 0000000000000000000000000000000000000000..3c705c61228394171e3bcd0bed29068a5aae8f57 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_get_match_data_heapframes_size.html @@ -0,0 +1,40 @@ + + +pcre2_get_match_data_heapframes_size specification + + +

pcre2_get_match_data_heapframes_size man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+PCRE2_SIZE pcre2_get_match_data_heapframes_size( + pcre2_match_data *match_data); +

+
+DESCRIPTION +
+

+This function returns the size, in bytes, of the heapframes data block that is +owned by its argument. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_get_match_data_size.html b/miniconda3/share/doc/pcre2/html/pcre2_get_match_data_size.html new file mode 100644 index 0000000000000000000000000000000000000000..113ecaab89fe35c57768e84e87e21e9fabce0aaa --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_get_match_data_size.html @@ -0,0 +1,39 @@ + + +pcre2_get_match_data_size specification + + +

pcre2_get_match_data_size man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+PCRE2_SIZE pcre2_get_match_data_size(pcre2_match_data *match_data); +

+
+DESCRIPTION +
+

+This function returns the size, in bytes, of the match data block that is its +argument. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_get_ovector_count.html b/miniconda3/share/doc/pcre2/html/pcre2_get_ovector_count.html new file mode 100644 index 0000000000000000000000000000000000000000..05aacb6de832376f1f86efeff5e2ffda0f0f446a --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_get_ovector_count.html @@ -0,0 +1,39 @@ + + +pcre2_get_ovector_count specification + + +

pcre2_get_ovector_count man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+uint32_t pcre2_get_ovector_count(pcre2_match_data *match_data); +

+
+DESCRIPTION +
+

+This function returns the number of pairs of offsets in the ovector that forms +part of the given match data block. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_get_ovector_pointer.html b/miniconda3/share/doc/pcre2/html/pcre2_get_ovector_pointer.html new file mode 100644 index 0000000000000000000000000000000000000000..ff6317efc28c9798fd2aaea3494f267b1c7798e1 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_get_ovector_pointer.html @@ -0,0 +1,40 @@ + + +pcre2_get_ovector_pointer specification + + +

pcre2_get_ovector_pointer man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+PCRE2_SIZE *pcre2_get_ovector_pointer(pcre2_match_data *match_data); +

+
+DESCRIPTION +
+

+This function returns a pointer to the vector of offsets that forms part of the +given match data block. The number of pairs can be found by calling +pcre2_get_ovector_count(). +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_get_startchar.html b/miniconda3/share/doc/pcre2/html/pcre2_get_startchar.html new file mode 100644 index 0000000000000000000000000000000000000000..d2c28b2abcfc864ee0b6559fd0faef074ade2b90 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_get_startchar.html @@ -0,0 +1,44 @@ + + +pcre2_get_startchar specification + + +

pcre2_get_startchar man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+PCRE2_SIZE pcre2_get_startchar(pcre2_match_data *match_data); +

+
+DESCRIPTION +
+

+After a successful call of pcre2_match() that was passed the match block +that is this function's argument, this function returns the code unit offset of +the character at which the successful match started. For a non-partial match, +this can be different to the value of ovector[0] if the pattern contains +the \K escape sequence. After a partial match, however, this value is always +the same as ovector[0] because \K does not affect the result of a +partial match. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_jit_compile.html b/miniconda3/share/doc/pcre2/html/pcre2_jit_compile.html new file mode 100644 index 0000000000000000000000000000000000000000..791dd0c3d781bbc25e87610e92a033981049f2e8 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_jit_compile.html @@ -0,0 +1,74 @@ + + +pcre2_jit_compile specification + + +

pcre2_jit_compile man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_jit_compile(pcre2_code *code, uint32_t options); +

+
+DESCRIPTION +
+

+This function requests JIT compilation, which, if the just-in-time compiler is +available, further processes a compiled pattern into machine code that executes +much faster than the pcre2_match() interpretive matching function. Full +details are given in the +pcre2jit +documentation. +

+

+The availability of JIT support can be tested by calling +pcre2_compile_jit() with a single option PCRE2_JIT_TEST_ALLOC (the +code argument is ignored, so a NULL value is accepted). Such a call +returns zero if JIT is available and has a working allocator. Otherwise +it returns PCRE2_ERROR_NOMEMORY if JIT is available but cannot allocate +executable memory, or PCRE2_ERROR_JIT_UNSUPPORTED if JIT support is not +compiled. +

+

+Otherwise, the first argument must be a pointer that was returned by a +successful call to pcre2_compile(), and the second must contain one or +more of the following bits: +

+  PCRE2_JIT_COMPLETE      compile code for full matching
+  PCRE2_JIT_PARTIAL_SOFT  compile code for soft partial matching
+  PCRE2_JIT_PARTIAL_HARD  compile code for hard partial matching
+
+There is also an obsolete option called PCRE2_JIT_INVALID_UTF, which has been +superseded by the pcre2_compile() option PCRE2_MATCH_INVALID_UTF. The old +option is deprecated and may be removed in the future. +

+

+The yield of the function when called with any of the three options above is 0 +for success, or a negative error code otherwise. In particular, +PCRE2_ERROR_JIT_BADOPTION is returned if JIT is not supported or if an unknown +bit is set in options. The function can also return PCRE2_ERROR_NOMEMORY +if JIT is unable to allocate executable memory for the compiler, even if it was +because of a system security restriction. In a few cases, the function may +return with PCRE2_ERROR_JIT_UNSUPPORTED for unsupported features. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_jit_free_unused_memory.html b/miniconda3/share/doc/pcre2/html/pcre2_jit_free_unused_memory.html new file mode 100644 index 0000000000000000000000000000000000000000..7f37e583a9d761f3c0ba485745e46f0dbedf502f --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_jit_free_unused_memory.html @@ -0,0 +1,43 @@ + + +pcre2_jit_free_unused_memory specification + + +

pcre2_jit_free_unused_memory man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+void pcre2_jit_free_unused_memory(pcre2_general_context *gcontext); +

+
+DESCRIPTION +
+

+This function frees unused JIT executable memory. The argument is a general +context, for custom memory management, or NULL for standard memory management. +JIT memory allocation retains some memory in order to improve future JIT +compilation speed. In low memory conditions, +pcre2_jit_free_unused_memory() can be used to cause this memory to be +freed. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_jit_match.html b/miniconda3/share/doc/pcre2/html/pcre2_jit_match.html new file mode 100644 index 0000000000000000000000000000000000000000..56144ff9ab255612173ed6832a1d5b867b7b3d3a --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_jit_match.html @@ -0,0 +1,70 @@ + + +pcre2_jit_match specification + + +

pcre2_jit_match man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_jit_match(const pcre2_code *code, PCRE2_SPTR subject, + PCRE2_SIZE length, PCRE2_SIZE startoffset, + uint32_t options, pcre2_match_data *match_data, + pcre2_match_context *mcontext); +

+
+DESCRIPTION +
+

+This function matches a compiled regular expression that has been successfully +processed by the JIT compiler against a given subject string, using a matching +algorithm that is similar to Perl's. It is a "fast path" interface to JIT, and +it bypasses some of the sanity checks that pcre2_match() applies. +

+

+In UTF mode, the subject string is not checked for UTF validity. Unless +PCRE2_MATCH_INVALID_UTF was set when the pattern was compiled, passing an +invalid UTF string results in undefined behaviour. Your program may crash or +loop or give wrong results. In the absence of PCRE2_MATCH_INVALID_UTF you +should only call pcre2_jit_match() in UTF mode if you are sure the +subject is valid. +

+

+The arguments for pcre2_jit_match() are exactly the same as for +pcre2_match(), +except that the subject string must be specified with a length; +PCRE2_ZERO_TERMINATED is not supported. +

+

+The supported options are PCRE2_NOTBOL, PCRE2_NOTEOL, PCRE2_NOTEMPTY, +PCRE2_NOTEMPTY_ATSTART, PCRE2_PARTIAL_HARD, and PCRE2_PARTIAL_SOFT. Unsupported +options are ignored. +

+

+The return values are the same as for pcre2_match() plus +PCRE2_ERROR_JIT_BADOPTION if a matching mode (partial or complete) is requested +that was not compiled. For details of partial matching, see the +pcre2partial +page. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the JIT API in the +pcre2jit +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_jit_stack_assign.html b/miniconda3/share/doc/pcre2/html/pcre2_jit_stack_assign.html new file mode 100644 index 0000000000000000000000000000000000000000..4b3abb90aa304054153a0b4e3fafeb017c7e6bdc --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_jit_stack_assign.html @@ -0,0 +1,75 @@ + + +pcre2_jit_stack_assign specification + + +

pcre2_jit_stack_assign man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+void pcre2_jit_stack_assign(pcre2_match_context *mcontext, + pcre2_jit_callback callback_function, void *callback_data); +

+
+DESCRIPTION +
+

+This function provides control over the memory used by JIT as a run-time stack +when pcre2_match() or pcre2_jit_match() is called with a pattern +that has been successfully processed by the JIT compiler. The information that +determines which stack is used is put into a match context that is subsequently +passed to a matching function. The arguments of this function are: +

+  mcontext       a pointer to a match context
+  callback       a callback function
+  callback_data  a JIT stack or a value to be passed to the callback
+
+

+

+If mcontext is NULL, the function returns immediately, without doing +anything. +

+

+If callback is NULL and callback_data is NULL, an internal 32KiB +block on the machine stack is used. +

+

+If callback is NULL and callback_data is not NULL, +callback_data must be a valid JIT stack, the result of calling +pcre2_jit_stack_create(). +

+

+If callback not NULL, it is called with callback_data as an +argument at the start of matching, in order to set up a JIT stack. If the +result is NULL, the internal 32KiB stack is used; otherwise the return value +must be a valid JIT stack, the result of calling +pcre2_jit_stack_create(). +

+

+You may safely use the same JIT stack for multiple patterns, as long as they +are all matched in the same thread. In a multithread application, each thread +must use its own JIT stack. For more details, see the +pcre2jit +page. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_jit_stack_create.html b/miniconda3/share/doc/pcre2/html/pcre2_jit_stack_create.html new file mode 100644 index 0000000000000000000000000000000000000000..b9dc59d66fcdf69255eba2bcb512816025b1cd21 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_jit_stack_create.html @@ -0,0 +1,50 @@ + + +pcre2_jit_stack_create specification + + +

pcre2_jit_stack_create man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+pcre2_jit_stack *pcre2_jit_stack_create(size_t startsize, + size_t maxsize, pcre2_general_context *gcontext); +

+
+DESCRIPTION +
+

+This function is used to create a stack for use by the code compiled by the JIT +compiler. The first two arguments are a starting size for the stack, and a +maximum size to which it is allowed to grow. The final argument is a general +context, for memory allocation functions, or NULL for standard memory +allocation. The result can be passed to the JIT run-time code by calling +pcre2_jit_stack_assign() to associate the stack with a compiled pattern, +which can then be processed by pcre2_match() or pcre2_jit_match(). +A maximum stack size of 512KiB to 1MiB should be more than enough for any +pattern. If the stack couldn't be allocated or the values passed were not +reasonable, NULL will be returned. For more details, see the +pcre2jit +page. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_jit_stack_free.html b/miniconda3/share/doc/pcre2/html/pcre2_jit_stack_free.html new file mode 100644 index 0000000000000000000000000000000000000000..1d078d74ecf9be4c5ed17f32c4585d2a3641d335 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_jit_stack_free.html @@ -0,0 +1,43 @@ + + +pcre2_jit_stack_free specification + + +

pcre2_jit_stack_free man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+void pcre2_jit_stack_free(pcre2_jit_stack *jit_stack); +

+
+DESCRIPTION +
+

+This function is used to free a JIT stack that was created by +pcre2_jit_stack_create() when it is no longer needed. If the argument is +NULL, the function returns immediately without doing anything. For more +details, see the +pcre2jit +page. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_maketables.html b/miniconda3/share/doc/pcre2/html/pcre2_maketables.html new file mode 100644 index 0000000000000000000000000000000000000000..196365453a9a9f9dda4c6c85c4217c6d5e3fd6a4 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_maketables.html @@ -0,0 +1,48 @@ + + +pcre2_maketables specification + + +

pcre2_maketables man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+const uint8_t *pcre2_maketables(pcre2_general_context *gcontext); +

+
+DESCRIPTION +
+

+This function builds a set of character tables for character code points that +are less than 256. These can be passed to pcre2_compile() in a compile +context in order to override the internal, built-in tables (which were either +defaulted or made by pcre2_maketables() when PCRE2 was compiled). See the +pcre2_set_character_tables() +page. You might want to do this if you are using a non-standard locale. +

+

+If the argument is NULL, malloc() is used to get memory for the tables. +Otherwise it must point to a general context, which can supply pointers to a +custom memory manager. The function yields a pointer to the tables. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_maketables_free.html b/miniconda3/share/doc/pcre2/html/pcre2_maketables_free.html new file mode 100644 index 0000000000000000000000000000000000000000..7316ab25bfbd89df0adf82371807075253d085f4 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_maketables_free.html @@ -0,0 +1,44 @@ + + +pcre2_maketables_free specification + + +

pcre2_maketables_free man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+void pcre2_maketables_free(pcre2_general_context *gcontext, + const uint8_t *tables); +

+
+DESCRIPTION +
+

+This function discards a set of character tables that were created by a call +to +pcre2_maketables(). +

+

+The gcontext parameter should match what was used in that call to +account for any custom allocators that might be in use; if it is NULL +the system free() is used. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_match.html b/miniconda3/share/doc/pcre2/html/pcre2_match.html new file mode 100644 index 0000000000000000000000000000000000000000..5584ae3d07689f79214be0cd27549dff5d433e0d --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_match.html @@ -0,0 +1,87 @@ + + +pcre2_match specification + + +

pcre2_match man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_match(const pcre2_code *code, PCRE2_SPTR subject, + PCRE2_SIZE length, PCRE2_SIZE startoffset, + uint32_t options, pcre2_match_data *match_data, + pcre2_match_context *mcontext); +

+
+DESCRIPTION +
+

+This function matches a compiled regular expression against a given subject +string, using a matching algorithm that is similar to Perl's. It returns +offsets to what it has matched and to captured substrings via the +match_data block, which can be processed by functions with names that +start with pcre2_get_ovector_...() or pcre2_substring_...(). The +return from pcre2_match() is one more than the highest numbered capturing +pair that has been set (for example, 1 if there are no captures), zero if the +vector of offsets is too small, or a negative error code for no match and other +errors. The function arguments are: +

+  code         Points to the compiled pattern
+  subject      Points to the subject string
+  length       Length of the subject string
+  startoffset  Offset in the subject at which to start matching
+  options      Option bits
+  match_data   Points to a match data block, for results
+  mcontext     Points to a match context, or is NULL
+
+A match context is needed only if you want to: +
+  Set up a callout function
+  Set a matching offset limit
+  Change the heap memory limit
+  Change the backtracking match limit
+  Change the backtracking depth limit
+  Set custom memory management specifically for the match
+
+The length and startoffset values are code units, not characters. +The length may be given as PCRE2_ZERO_TERMINATED for a subject that is +terminated by a binary zero code unit. The options are: +
+  PCRE2_ANCHORED          Match only at the first position
+  PCRE2_COPY_MATCHED_SUBJECT
+                          On success, make a private subject copy
+  PCRE2_DISABLE_RECURSELOOP_CHECK
+                          Only useful in rare cases; use with care
+  PCRE2_ENDANCHORED       Pattern can match only at end of subject
+  PCRE2_NOTBOL            Subject string is not the beginning of a line
+  PCRE2_NOTEOL            Subject string is not the end of a line
+  PCRE2_NOTEMPTY          An empty string is not a valid match
+  PCRE2_NOTEMPTY_ATSTART  An empty string at the start of the subject is not a valid match
+  PCRE2_NO_JIT            Do not use JIT matching
+  PCRE2_NO_UTF_CHECK      Do not check the subject for UTF validity (only relevant if PCRE2_UTF
+                           was set at compile time)
+  PCRE2_PARTIAL_HARD      Return PCRE2_ERROR_PARTIAL for a partial match even if there is a full match
+  PCRE2_PARTIAL_SOFT      Return PCRE2_ERROR_PARTIAL for a partial match if no full matches are found
+
+For details of partial matching, see the +pcre2partial +page. There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_match_context_copy.html b/miniconda3/share/doc/pcre2/html/pcre2_match_context_copy.html new file mode 100644 index 0000000000000000000000000000000000000000..4a719d6918d87aeda45a84f658b5973a79fd62ee --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_match_context_copy.html @@ -0,0 +1,41 @@ + + +pcre2_match_context_copy specification + + +

pcre2_match_context_copy man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+pcre2_match_context *pcre2_match_context_copy( + pcre2_match_context *mcontext); +

+
+DESCRIPTION +
+

+This function makes a new copy of a match context, using the memory +allocation function that was used for the original context. The result is NULL +if the memory cannot be obtained. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_match_context_create.html b/miniconda3/share/doc/pcre2/html/pcre2_match_context_create.html new file mode 100644 index 0000000000000000000000000000000000000000..f7f273513017802703edb097998cf89159cafb1b --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_match_context_create.html @@ -0,0 +1,42 @@ + + +pcre2_match_context_create specification + + +

pcre2_match_context_create man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+pcre2_match_context *pcre2_match_context_create( + pcre2_general_context *gcontext); +

+
+DESCRIPTION +
+

+This function creates and initializes a new match context. If its argument is +NULL, malloc() is used to get the necessary memory; otherwise the memory +allocation function within the general context is used. The result is NULL if +the memory could not be obtained. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_match_context_free.html b/miniconda3/share/doc/pcre2/html/pcre2_match_context_free.html new file mode 100644 index 0000000000000000000000000000000000000000..7f00ea9b29d25d6284f1cfd691e67e9f4b1d89b6 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_match_context_free.html @@ -0,0 +1,41 @@ + + +pcre2_match_context_free specification + + +

pcre2_match_context_free man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+void pcre2_match_context_free(pcre2_match_context *mcontext); +

+
+DESCRIPTION +
+

+This function frees the memory occupied by a match context, using the memory +freeing function from the general context with which it was created, or +free() if that was not set. If the argument is NULL, the function returns +immediately without doing anything. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_match_data_create.html b/miniconda3/share/doc/pcre2/html/pcre2_match_data_create.html new file mode 100644 index 0000000000000000000000000000000000000000..c26c3b324bf5958bdac861af44165ae8ae24e378 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_match_data_create.html @@ -0,0 +1,50 @@ + + +pcre2_match_data_create specification + + +

pcre2_match_data_create man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+pcre2_match_data *pcre2_match_data_create(uint32_t ovecsize, + pcre2_general_context *gcontext); +

+
+DESCRIPTION +
+

+This function creates a new match data block, which is used for holding the +result of a match. The first argument specifies the number of pairs of offsets +that are required. These form the "output vector" (ovector) within the match +data block, and are used to identify the matched string and any captured +substrings when matching with pcre2_match(), or a number of different +matches at the same point when used with pcre2_dfa_match(). There is +always one pair of offsets; if ovecsize is zero, it is treated as one. +

+

+The second argument points to a general context, for custom memory management, +or is NULL for system memory management. The result of the function is NULL if +the memory for the block could not be obtained. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_match_data_create_from_pattern.html b/miniconda3/share/doc/pcre2/html/pcre2_match_data_create_from_pattern.html new file mode 100644 index 0000000000000000000000000000000000000000..db58ab9146f4c3732d0dbeb9276dd4907d5a4d14 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_match_data_create_from_pattern.html @@ -0,0 +1,53 @@ + + +pcre2_match_data_create_from_pattern specification + + +

pcre2_match_data_create_from_pattern man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+pcre2_match_data *pcre2_match_data_create_from_pattern( + const pcre2_code *code, pcre2_general_context *gcontext); +

+
+DESCRIPTION +
+

+This function creates a new match data block for holding the result of a match. +The first argument points to a compiled pattern. The number of capturing +parentheses within the pattern is used to compute the number of pairs of +offsets that are required in the match data block. These form the "output +vector" (ovector) within the match data block, and are used to identify the +matched string and any captured substrings when matching with +pcre2_match(). If you are using pcre2_dfa_match(), which uses the +output vector in a different way, you should use pcre2_match_data_create() +instead of this function. +

+

+The second argument points to a general context, for custom memory management, +or is NULL to use the same memory allocator as was used for the compiled +pattern. The result of the function is NULL if the memory for the block could +not be obtained. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_match_data_free.html b/miniconda3/share/doc/pcre2/html/pcre2_match_data_free.html new file mode 100644 index 0000000000000000000000000000000000000000..1c2520b9d5762aa68fa4312095a012aef02768d1 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_match_data_free.html @@ -0,0 +1,48 @@ + + +pcre2_match_data_free specification + + +

pcre2_match_data_free man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+void pcre2_match_data_free(pcre2_match_data *match_data); +

+
+DESCRIPTION +
+

+If match_data is NULL, this function does nothing. Otherwise, +match_data must point to a match data block, which this function frees, +using the memory freeing function from the general context or compiled pattern +with which it was created, or free() if that was not set. If the match +data block was previously passed to pcre2_match(), it will have an +attached heapframe vector; this is also freed. +

+

+If the PCRE2_COPY_MATCHED_SUBJECT was used for a successful match using this +match data block, the copy of the subject that was referenced within the block +is also freed. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_pattern_convert.html b/miniconda3/share/doc/pcre2/html/pcre2_pattern_convert.html new file mode 100644 index 0000000000000000000000000000000000000000..2fcd7cc08d57b400e9fc0bcfd22e5e33c8950010 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_pattern_convert.html @@ -0,0 +1,70 @@ + + +pcre2_pattern_convert specification + + +

pcre2_pattern_convert man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_pattern_convert(PCRE2_SPTR pattern, PCRE2_SIZE length, + uint32_t options, PCRE2_UCHAR **buffer, + PCRE2_SIZE *blength, pcre2_convert_context *cvcontext); +

+
+DESCRIPTION +
+

+This function is part of an experimental set of pattern conversion functions. +It converts a foreign pattern (for example, a glob) into a PCRE2 regular +expression pattern. Its arguments are: +

+  pattern     The foreign pattern
+  length      The length of the input pattern or PCRE2_ZERO_TERMINATED
+  options     Option bits
+  buffer      Pointer to pointer to output buffer, or NULL
+  blength     Pointer to output length field
+  cvcontext   Pointer to a convert context or NULL
+
+The length of the converted pattern (excluding the terminating zero) is +returned via blength. If buffer is NULL, the function just returns +the output length. If buffer points to a NULL pointer, heap memory is +obtained for the converted pattern, using the allocator in the context if +present (or else malloc()), and the field pointed to by buffer is +updated. If buffer points to a non-NULL field, that must point to a +buffer whose size is in the variable pointed to by blength. This value is +updated. +

+

+The option bits are: +

+  PCRE2_CONVERT_UTF                     Input is UTF
+  PCRE2_CONVERT_NO_UTF_CHECK            Do not check UTF validity
+  PCRE2_CONVERT_POSIX_BASIC             Convert POSIX basic pattern
+  PCRE2_CONVERT_POSIX_EXTENDED          Convert POSIX extended pattern
+  PCRE2_CONVERT_GLOB                    ) Convert
+  PCRE2_CONVERT_GLOB_NO_WILD_SEPARATOR  )   various types
+  PCRE2_CONVERT_GLOB_NO_STARSTAR        )     of glob
+
+The return value from pcre2_pattern_convert() is zero on success or a +non-zero PCRE2 error code. +

+

+The pattern conversion functions are described in the +pcre2convert +documentation. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_pattern_info.html b/miniconda3/share/doc/pcre2/html/pcre2_pattern_info.html new file mode 100644 index 0000000000000000000000000000000000000000..eaaac6c0d39f53cfa572bdc0d6484113144dff6c --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_pattern_info.html @@ -0,0 +1,109 @@ + + +pcre2_pattern_info specification + + +

pcre2_pattern_info man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_pattern_info(const pcre2_code *code, uint32_t what, + void *where); +

+
+DESCRIPTION +
+

+This function returns information about a compiled pattern. Its arguments are: +

+  code     Pointer to a compiled regular expression pattern
+  what     What information is required
+  where    Where to put the information
+
+The recognized values for the what argument, and the information they +request are as follows: +
+  PCRE2_INFO_ALLOPTIONS      Final options after compiling
+  PCRE2_INFO_ARGOPTIONS      Options passed to pcre2_compile()
+  PCRE2_INFO_BACKREFMAX      Number of highest backreference
+  PCRE2_INFO_BSR             What \R matches:
+                               PCRE2_BSR_UNICODE: Unicode line endings
+                               PCRE2_BSR_ANYCRLF: CR, LF, or CRLF only
+  PCRE2_INFO_CAPTURECOUNT    Number of capturing subpatterns
+  PCRE2_INFO_DEPTHLIMIT      Backtracking depth limit if set, otherwise PCRE2_ERROR_UNSET
+  PCRE2_INFO_EXTRAOPTIONS    Extra options that were passed in the
+                               compile context
+  PCRE2_INFO_FIRSTBITMAP     Bitmap of first code units, or NULL
+  PCRE2_INFO_FIRSTCODETYPE   Type of start-of-match information
+                               0 nothing set
+                               1 first code unit is set
+                               2 start of string or after newline
+  PCRE2_INFO_FIRSTCODEUNIT   First code unit when type is 1
+  PCRE2_INFO_FRAMESIZE       Size of backtracking frame
+  PCRE2_INFO_HASBACKSLASHC   Return 1 if pattern contains \C
+  PCRE2_INFO_HASCRORLF       Return 1 if explicit CR or LF matches exist in the pattern
+  PCRE2_INFO_HEAPLIMIT       Heap memory limit if set, otherwise PCRE2_ERROR_UNSET
+  PCRE2_INFO_JCHANGED        Return 1 if (?J) or (?-J) was used
+  PCRE2_INFO_JITSIZE         Size of JIT compiled code, or 0
+  PCRE2_INFO_LASTCODETYPE    Type of must-be-present information
+                               0 nothing set
+                               1 code unit is set
+  PCRE2_INFO_LASTCODEUNIT    Last code unit when type is 1
+  PCRE2_INFO_MATCHEMPTY      1 if the pattern can match an empty string, 0 otherwise
+  PCRE2_INFO_MATCHLIMIT      Match limit if set, otherwise PCRE2_ERROR_UNSET
+  PCRE2_INFO_MAXLOOKBEHIND   Length (in characters) of the longest lookbehind assertion
+  PCRE2_INFO_MINLENGTH       Lower bound length of matching strings
+  PCRE2_INFO_NAMECOUNT       Number of named subpatterns
+  PCRE2_INFO_NAMEENTRYSIZE   Size of name table entries
+  PCRE2_INFO_NAMETABLE       Pointer to name table
+  PCRE2_CONFIG_NEWLINE       Code for the newline sequence:
+                               PCRE2_NEWLINE_CR
+                               PCRE2_NEWLINE_LF
+                               PCRE2_NEWLINE_CRLF
+                               PCRE2_NEWLINE_ANY
+                               PCRE2_NEWLINE_ANYCRLF
+                               PCRE2_NEWLINE_NUL
+  PCRE2_INFO_RECURSIONLIMIT  Obsolete synonym for PCRE2_INFO_DEPTHLIMIT
+  PCRE2_INFO_SIZE            Size of compiled pattern
+
+If where is NULL, the function returns the amount of memory needed for +the requested information, in bytes. Otherwise, the where argument must +point to an unsigned 32-bit integer (uint32_t variable), except for the +following what values, when it must point to a variable of the type +shown: +
+  PCRE2_INFO_FIRSTBITMAP     const uint8_t *
+  PCRE2_INFO_JITSIZE         size_t
+  PCRE2_INFO_NAMETABLE       PCRE2_SPTR
+  PCRE2_INFO_SIZE            size_t
+
+The yield of the function is zero on success or: +
+  PCRE2_ERROR_NULL           the argument code is NULL
+  PCRE2_ERROR_BADMAGIC       the "magic number" was not found
+  PCRE2_ERROR_BADOPTION      the value of what is invalid
+  PCRE2_ERROR_BADMODE        the pattern was compiled in the wrong mode
+  PCRE2_ERROR_UNSET          the requested information is not set
+
+

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_serialize_decode.html b/miniconda3/share/doc/pcre2/html/pcre2_serialize_decode.html new file mode 100644 index 0000000000000000000000000000000000000000..618ffa9294a3210d19668c18a97dfaa946204dd7 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_serialize_decode.html @@ -0,0 +1,65 @@ + + +pcre2_serialize_decode specification + + +

pcre2_serialize_decode man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int32_t pcre2_serialize_decode(pcre2_code **codes, + int32_t number_of_codes, const uint8_t *bytes, + pcre2_general_context *gcontext); +

+
+DESCRIPTION +
+

+This function decodes a serialized set of compiled patterns back into a list of +individual patterns. This is possible only on a host that is running the same +version of PCRE2, with the same code unit width, and the host must also have +the same endianness, pointer width and PCRE2_SIZE type. The arguments for +pcre2_serialize_decode() are: +

+  codes            pointer to a vector in which to build the list
+  number_of_codes  number of slots in the vector
+  bytes            the serialized byte stream
+  gcontext         pointer to a general context or NULL
+
+The bytes argument must point to a block of data that was originally +created by pcre2_serialize_encode(), though it may have been saved on +disc or elsewhere in the meantime. If there are more codes in the serialized +data than slots in the list, only those compiled patterns that will fit are +decoded. The yield of the function is the number of decoded patterns, or one of +the following negative error codes: +
+  PCRE2_ERROR_BADDATA   number_of_codes is zero or less
+  PCRE2_ERROR_BADMAGIC  mismatch of id bytes in bytes
+  PCRE2_ERROR_BADMODE   mismatch of variable unit size or PCRE version
+  PCRE2_ERROR_NOMEMORY  memory allocation failed
+  PCRE2_ERROR_NULL      codes or bytes is NULL
+
+PCRE2_ERROR_BADMAGIC may mean that the data is corrupt, or that it was compiled +on a system with different endianness. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the serialization functions in the +pcre2serialize +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_serialize_encode.html b/miniconda3/share/doc/pcre2/html/pcre2_serialize_encode.html new file mode 100644 index 0000000000000000000000000000000000000000..f1532700dfdf8c57f8b37478d76b1a0775f83692 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_serialize_encode.html @@ -0,0 +1,66 @@ + + +pcre2_serialize_encode specification + + +

pcre2_serialize_encode man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int32_t pcre2_serialize_encode(const pcre2_code **codes, + int32_t number_of_codes, uint8_t **serialized_bytes, + PCRE2_SIZE *serialized_size, pcre2_general_context *gcontext); +

+
+DESCRIPTION +
+

+This function encodes a list of compiled patterns into a byte stream that can +be saved on disc or elsewhere. Note that this is not an abstract format like +Java or .NET. Conversion of the byte stream back into usable compiled patterns +can only happen on a host that is running the same version of PCRE2, with the +same code unit width, and the host must also have the same endianness, pointer +width and PCRE2_SIZE type. The arguments for pcre2_serialize_encode() +are: +

+  codes             pointer to a vector containing the list
+  number_of_codes   number of slots in the vector
+  serialized_bytes  set to point to the serialized byte stream
+  serialized_size   set to the number of bytes in the byte stream
+  gcontext          pointer to a general context or NULL
+
+The context argument is used to obtain memory for the byte stream. When the +serialized data is no longer needed, it must be freed by calling +pcre2_serialize_free(). The yield of the function is the number of +serialized patterns, or one of the following negative error codes: +
+  PCRE2_ERROR_BADDATA      number_of_codes is zero or less
+  PCRE2_ERROR_BADMAGIC     mismatch of id bytes in one of the patterns
+  PCRE2_ERROR_MEMORY       memory allocation failed
+  PCRE2_ERROR_MIXEDTABLES  the patterns do not all use the same tables
+  PCRE2_ERROR_NULL         an argument other than gcontext is NULL
+
+PCRE2_ERROR_BADMAGIC means either that a pattern's code has been corrupted, or +that a slot in the vector does not point to a compiled pattern. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the serialization functions in the +pcre2serialize +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_serialize_free.html b/miniconda3/share/doc/pcre2/html/pcre2_serialize_free.html new file mode 100644 index 0000000000000000000000000000000000000000..26b435bc702017107d2f2acb2415d9cbcd162f6f --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_serialize_free.html @@ -0,0 +1,41 @@ + + +pcre2_serialize_free specification + + +

pcre2_serialize_free man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+void pcre2_serialize_free(uint8_t *bytes); +

+
+DESCRIPTION +
+

+This function frees the memory that was obtained by +pcre2_serialize_encode() to hold a serialized byte stream. The argument +must point to such a byte stream or be NULL, in which case the function returns +without doing anything. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the serialization functions in the +pcre2serialize +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_serialize_get_number_of_codes.html b/miniconda3/share/doc/pcre2/html/pcre2_serialize_get_number_of_codes.html new file mode 100644 index 0000000000000000000000000000000000000000..fdd2429462773f73977d755b8ec6c20f5d5d66a1 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_serialize_get_number_of_codes.html @@ -0,0 +1,49 @@ + + +pcre2_serialize_get_number_of_codes specification + + +

pcre2_serialize_get_number_of_codes man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int32_t pcre2_serialize_get_number_of_codes(const uint8_t *bytes); +

+
+DESCRIPTION +
+

+The bytes argument must point to a serialized byte stream that was +originally created by pcre2_serialize_encode() (though it may have been +saved on disc or elsewhere in the meantime). The function returns the number of +serialized patterns in the byte stream, or one of the following negative error +codes: +

+  PCRE2_ERROR_BADMAGIC  mismatch of id bytes in bytes
+  PCRE2_ERROR_BADMODE   mismatch of variable unit size or PCRE version
+  PCRE2_ERROR_NULL      the argument is NULL
+
+PCRE2_ERROR_BADMAGIC may mean that the data is corrupt, or that it was compiled +on a system with different endianness. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the serialization functions in the +pcre2serialize +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_bsr.html b/miniconda3/share/doc/pcre2/html/pcre2_set_bsr.html new file mode 100644 index 0000000000000000000000000000000000000000..8a62f18a6ed1b649ec83425967638fb6b361ba97 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_bsr.html @@ -0,0 +1,42 @@ + + +pcre2_set_bsr specification + + +

pcre2_set_bsr man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_bsr(pcre2_compile_context *ccontext, + uint32_t value); +

+
+DESCRIPTION +
+

+This function sets the convention for processing \R within a compile context. +The second argument must be one of PCRE2_BSR_ANYCRLF or PCRE2_BSR_UNICODE. The +result is zero for success or PCRE2_ERROR_BADDATA if the second argument is +invalid. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_callout.html b/miniconda3/share/doc/pcre2/html/pcre2_set_callout.html new file mode 100644 index 0000000000000000000000000000000000000000..4e7aca6c46f9ee558ea57a725f94a6e7cc3bafc8 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_callout.html @@ -0,0 +1,43 @@ + + +pcre2_set_callout specification + + +

pcre2_set_callout man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_callout(pcre2_match_context *mcontext, + int (*callout_function)(pcre2_callout_block *), + void *callout_data); +

+
+DESCRIPTION +
+

+This function sets the callout fields in a match context (the first argument). +The second argument specifies a callout function, and the third argument is an +opaque data item that is passed to it. The result of this function is always +zero. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_character_tables.html b/miniconda3/share/doc/pcre2/html/pcre2_set_character_tables.html new file mode 100644 index 0000000000000000000000000000000000000000..8564eea69c7eb128375646522257e32f32b0c175 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_character_tables.html @@ -0,0 +1,45 @@ + + +pcre2_set_character_tables specification + + +

pcre2_set_character_tables man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_character_tables(pcre2_compile_context *ccontext, + const uint8_t *tables); +

+
+DESCRIPTION +
+

+This function sets a pointer to custom character tables within a compile +context. The second argument must point to a set of PCRE2 character tables or +be NULL to request the default tables. The result is always zero. Character +tables can be created by calling pcre2_maketables() or by running the +pcre2_dftables maintenance command in binary mode (see the +pcre2build +documentation). +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_compile_extra_options.html b/miniconda3/share/doc/pcre2/html/pcre2_set_compile_extra_options.html new file mode 100644 index 0000000000000000000000000000000000000000..cb62022a22ee4c0d65e0ee8698da2a41a1d351f2 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_compile_extra_options.html @@ -0,0 +1,58 @@ + + +pcre2_set_compile_extra_options specification + + +

pcre2_set_compile_extra_options man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_compile_extra_options(pcre2_compile_context *ccontext, + uint32_t extra_options); +

+
+DESCRIPTION +
+

+This function sets additional option bits for pcre2_compile() that are +housed in a compile context. It completely replaces all the bits. The extra +options are: +

+  PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK     Allow \K in lookarounds
+  PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES  Allow \x{d800} to \x{dfff} in UTF-8 and UTF-32 modes
+  PCRE2_EXTRA_ALT_BSUX                 Extended alternate \u, \U, and \x handling
+  PCRE2_EXTRA_ASCII_BSD                \d remains ASCII in UCP mode
+  PCRE2_EXTRA_ASCII_BSS                \s remains ASCII in UCP mode
+  PCRE2_EXTRA_ASCII_BSW                \w remains ASCII in UCP mode
+  PCRE2_EXTRA_ASCII_DIGIT              [:digit:] and [:xdigit:] POSIX classes remain ASCII in UCP mode
+  PCRE2_EXTRA_ASCII_POSIX              POSIX classes remain ASCII in UCP mode
+  PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL    Treat all invalid escapes as a literal following character
+  PCRE2_EXTRA_CASELESS_RESTRICT        Disable mixed ASCII/non-ASCII case folding
+  PCRE2_EXTRA_ESCAPED_CR_IS_LF         Interpret \r as \n
+  PCRE2_EXTRA_MATCH_LINE               Pattern matches whole lines
+  PCRE2_EXTRA_MATCH_WORD               Pattern matches "words"
+  PCRE2_EXTRA_NEVER_CALLOUT            Disallow callouts in pattern
+  PCRE2_EXTRA_NO_BS0                   Disallow \0 (but not \00 or \000)
+  PCRE2_EXTRA_PYTHON_OCTAL             Use Python rules for octal
+  PCRE2_EXTRA_TURKISH_CASING           Use Turkish I case folding
+
+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_compile_recursion_guard.html b/miniconda3/share/doc/pcre2/html/pcre2_set_compile_recursion_guard.html new file mode 100644 index 0000000000000000000000000000000000000000..c09942ce2277edaf74b4283ac2971adf54c3423e --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_compile_recursion_guard.html @@ -0,0 +1,46 @@ + + +pcre2_set_compile_recursion_guard specification + + +

pcre2_set_compile_recursion_guard man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_compile_recursion_guard(pcre2_compile_context *ccontext, + int (*guard_function)(uint32_t, void *), void *user_data); +

+
+DESCRIPTION +
+

+This function defines, within a compile context, a function that is called +whenever pcre2_compile() starts to compile a parenthesized part of a +pattern. The first argument to the function gives the current depth of +parenthesis nesting, and the second is user data that is supplied when the +function is set up. The callout function should return zero if all is well, or +non-zero to force an error. This feature is provided so that applications can +check the available system stack space, in order to avoid running out. The +result of pcre2_set_compile_recursion_guard() is always zero. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_depth_limit.html b/miniconda3/share/doc/pcre2/html/pcre2_set_depth_limit.html new file mode 100644 index 0000000000000000000000000000000000000000..a1cf7062c6ac8aec5fa9778293ebfae9974a04b7 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_depth_limit.html @@ -0,0 +1,40 @@ + + +pcre2_set_depth_limit specification + + +

pcre2_set_depth_limit man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_depth_limit(pcre2_match_context *mcontext, + uint32_t value); +

+
+DESCRIPTION +
+

+This function sets the backtracking depth limit field in a match context. The +result is always zero. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_glob_escape.html b/miniconda3/share/doc/pcre2/html/pcre2_set_glob_escape.html new file mode 100644 index 0000000000000000000000000000000000000000..2b55627118759f72909d95baa96d7bf3a376b06b --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_glob_escape.html @@ -0,0 +1,43 @@ + + +pcre2_set_glob_escape specification + + +

pcre2_set_glob_escape man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_glob_escape(pcre2_convert_context *cvcontext, + uint32_t escape_char); +

+
+DESCRIPTION +
+

+This function is part of an experimental set of pattern conversion functions. +It sets the escape character that is used when converting globs. The second +argument must either be zero (meaning there is no escape character) or a +punctuation character whose code point is less than 256. The default is grave +accent if running under Windows, otherwise backslash. The result of the +function is zero for success or PCRE2_ERROR_BADDATA if the second argument is +invalid. +

+

+The pattern conversion functions are described in the +pcre2convert +documentation. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_glob_separator.html b/miniconda3/share/doc/pcre2/html/pcre2_set_glob_separator.html new file mode 100644 index 0000000000000000000000000000000000000000..283648ea1ba600c9a95b6ff86701fe3b4863ca17 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_glob_separator.html @@ -0,0 +1,42 @@ + + +pcre2_set_glob_separator specification + + +

pcre2_set_glob_separator man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_glob_separator(pcre2_convert_context *cvcontext, + uint32_t separator_char); +

+
+DESCRIPTION +
+

+This function is part of an experimental set of pattern conversion functions. +It sets the component separator character that is used when converting globs. +The second argument must be one of the characters forward slash, backslash, or +dot. The default is backslash when running under Windows, otherwise forward +slash. The result of the function is zero for success or PCRE2_ERROR_BADDATA if +the second argument is invalid. +

+

+The pattern conversion functions are described in the +pcre2convert +documentation. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_heap_limit.html b/miniconda3/share/doc/pcre2/html/pcre2_set_heap_limit.html new file mode 100644 index 0000000000000000000000000000000000000000..3631ef6fdcf880749085b4ac2b9aa79b3ea11169 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_heap_limit.html @@ -0,0 +1,40 @@ + + +pcre2_set_heap_limit specification + + +

pcre2_set_heap_limit man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_heap_limit(pcre2_match_context *mcontext, + uint32_t value); +

+
+DESCRIPTION +
+

+This function sets the backtracking heap limit field in a match context. The +result is always zero. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_match_limit.html b/miniconda3/share/doc/pcre2/html/pcre2_set_match_limit.html new file mode 100644 index 0000000000000000000000000000000000000000..e840c744e7531dce914a27beec863beaebfeba27 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_match_limit.html @@ -0,0 +1,40 @@ + + +pcre2_set_match_limit specification + + +

pcre2_set_match_limit man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_match_limit(pcre2_match_context *mcontext, + uint32_t value); +

+
+DESCRIPTION +
+

+This function sets the match limit field in a match context. The result is +always zero. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_max_pattern_compiled_length.html b/miniconda3/share/doc/pcre2/html/pcre2_set_max_pattern_compiled_length.html new file mode 100644 index 0000000000000000000000000000000000000000..a40f41e450c72b64cd8b38f585f6c4351266a358 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_max_pattern_compiled_length.html @@ -0,0 +1,44 @@ + + +pcre2_set_max_pattern_compiled_length specification + + +

pcre2_set_max_pattern_compiled_length man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_max_pattern_compiled_length( + pcre2_compile_context *ccontext, PCRE2_SIZE value); +

+
+DESCRIPTION +
+

+This function sets, in a compile context, the maximum size (in bytes) for the +memory needed to hold the compiled version of a pattern that is using this +context. The result is always zero. If a pattern that is passed to +pcre2_compile() referencing this context needs more memory, an error is +generated. The default is the largest number that a PCRE2_SIZE variable can +hold, which is effectively unlimited. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_max_pattern_length.html b/miniconda3/share/doc/pcre2/html/pcre2_set_max_pattern_length.html new file mode 100644 index 0000000000000000000000000000000000000000..f6e422aa5425b63cc6cd6d97300d15857d5ca595 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_max_pattern_length.html @@ -0,0 +1,43 @@ + + +pcre2_set_max_pattern_length specification + + +

pcre2_set_max_pattern_length man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_max_pattern_length(pcre2_compile_context *ccontext, + PCRE2_SIZE value); +

+
+DESCRIPTION +
+

+This function sets, in a compile context, the maximum text length (in code +units) of the pattern that can be compiled. The result is always zero. If a +longer pattern is passed to pcre2_compile() there is an immediate error +return. The default is effectively unlimited, being the largest value a +PCRE2_SIZE variable can hold. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_max_varlookbehind.html b/miniconda3/share/doc/pcre2/html/pcre2_set_max_varlookbehind.html new file mode 100644 index 0000000000000000000000000000000000000000..1c03def2262b3321f8fcfb8b9bf03c9a9d044dfb --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_max_varlookbehind.html @@ -0,0 +1,42 @@ + + +pcre2_set_max_varlookbehind specification + + +

pcre2_set_max_varlookbehind man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_max_varlookbehind(pcre2_compile_context *ccontext, + uint32_t value); +

+
+DESCRIPTION +
+

+This sets a maximum length for the number of characters matched by a +variable-length lookbehind assertion. The default is set when PCRE2 is built, +with the ultimate default being 255, the same as Perl. Lookbehind assertions +without a bounding length are not supported. The result is always zero. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_newline.html b/miniconda3/share/doc/pcre2/html/pcre2_set_newline.html new file mode 100644 index 0000000000000000000000000000000000000000..ba8130014dc480e0458f6013a39208287c4f7739 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_newline.html @@ -0,0 +1,51 @@ + + +pcre2_set_newline specification + + +

pcre2_set_newline man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_newline(pcre2_compile_context *ccontext, + uint32_t value); +

+
+DESCRIPTION +
+

+This function sets the newline convention within a compile context. This +specifies which character(s) are recognized as newlines when compiling and +matching patterns. The second argument must be one of: +

+  PCRE2_NEWLINE_CR        Carriage return only
+  PCRE2_NEWLINE_LF        Linefeed only
+  PCRE2_NEWLINE_CRLF      CR followed by LF only
+  PCRE2_NEWLINE_ANYCRLF   Any of the above
+  PCRE2_NEWLINE_ANY       Any Unicode newline sequence
+  PCRE2_NEWLINE_NUL       The NUL character (binary zero)
+
+The result is zero for success or PCRE2_ERROR_BADDATA if the second argument is +invalid. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_offset_limit.html b/miniconda3/share/doc/pcre2/html/pcre2_set_offset_limit.html new file mode 100644 index 0000000000000000000000000000000000000000..6d9a85c64212daa6ad44d8fc1255cb4f0cb53485 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_offset_limit.html @@ -0,0 +1,40 @@ + + +pcre2_set_offset_limit specification + + +

pcre2_set_offset_limit man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_offset_limit(pcre2_match_context *mcontext, + PCRE2_SIZE value); +

+
+DESCRIPTION +
+

+This function sets the offset limit field in a match context. The result is +always zero. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_optimize.html b/miniconda3/share/doc/pcre2/html/pcre2_set_optimize.html new file mode 100644 index 0000000000000000000000000000000000000000..47caeb267ae54ffcc4d0c16a74791330eaca7dcc --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_optimize.html @@ -0,0 +1,57 @@ + + +pcre2_set_optimize specification + + +

pcre2_set_optimize man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_optimize(pcre2_compile_context *ccontext, + uint32_t directive); +

+
+DESCRIPTION +
+

+This function controls which performance optimizations will be applied +by pcre2_compile(). It can be called multiple times with the same compile +context; the effects are cumulative, with the effects of later calls taking +precedence over earlier ones. +

+

+The result is zero for success, PCRE2_ERROR_NULL if ccontext is NULL, +or PCRE2_ERROR_BADOPTION if directive is unknown. The latter could be +useful to detect if a certain optimization is available. +

+

+The list of possible values for the directive parameter are: +

+  PCRE2_OPTIMIZATION_FULL   Enable all optimizations (default)
+  PCRE2_OPTIMIZATION_NONE   Disable all optimizations
+  PCRE2_AUTO_POSSESS        Enable auto-possessification
+  PCRE2_AUTO_POSSESS_OFF    Disable auto-possessification
+  PCRE2_DOTSTAR_ANCHOR      Enable implicit dotstar anchoring
+  PCRE2_DOTSTAR_ANCHOR_OFF  Disable implicit dotstar anchoring
+  PCRE2_START_OPTIMIZE      Enable start-up optimizations at match time
+  PCRE2_START_OPTIMIZE_OFF  Disable start-up optimizations at match time
+
+There is a complete description of the PCRE2 native API, including detailed +descriptions directive parameter values in the +pcre2api +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_parens_nest_limit.html b/miniconda3/share/doc/pcre2/html/pcre2_set_parens_nest_limit.html new file mode 100644 index 0000000000000000000000000000000000000000..95fd31c33a3a86b4b2adb660166df61695c7990c --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_parens_nest_limit.html @@ -0,0 +1,40 @@ + + +pcre2_set_parens_nest_limit specification + + +

pcre2_set_parens_nest_limit man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_parens_nest_limit(pcre2_compile_context *ccontext, + uint32_t value); +

+
+DESCRIPTION +
+

+This function sets, in a compile context, the maximum depth of nested +parentheses in a pattern. The result is always zero. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_recursion_limit.html b/miniconda3/share/doc/pcre2/html/pcre2_set_recursion_limit.html new file mode 100644 index 0000000000000000000000000000000000000000..9ff68c2f09bb76a13fd58e8f32f22b14a72bcdca --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_recursion_limit.html @@ -0,0 +1,40 @@ + + +pcre2_set_recursion_limit specification + + +

pcre2_set_recursion_limit man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_recursion_limit(pcre2_match_context *mcontext, + uint32_t value); +

+
+DESCRIPTION +
+

+This function is obsolete and should not be used in new code. Use +pcre2_set_depth_limit() instead. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_recursion_memory_management.html b/miniconda3/share/doc/pcre2/html/pcre2_set_recursion_memory_management.html new file mode 100644 index 0000000000000000000000000000000000000000..37af73ca3756a561be4140ec37602f3ca94eac78 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_recursion_memory_management.html @@ -0,0 +1,42 @@ + + +pcre2_set_recursion_memory_management specification + + +

pcre2_set_recursion_memory_management man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_recursion_memory_management( + pcre2_match_context *mcontext, + void *(*private_malloc)(size_t, void *), + void (*private_free)(void *, void *), void *memory_data); +

+
+DESCRIPTION +
+

+From release 10.30 onwards, this function is obsolete and does nothing. The +result is always zero. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_substitute_callout.html b/miniconda3/share/doc/pcre2/html/pcre2_set_substitute_callout.html new file mode 100644 index 0000000000000000000000000000000000000000..8640728fdc4202028ed6f1ce96abc79535fb9bb4 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_substitute_callout.html @@ -0,0 +1,43 @@ + + +pcre2_set_substitute_callout specification + + +

pcre2_set_substitute_callout man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_substitute_callout(pcre2_match_context *mcontext, + int (*callout_function)(pcre2_substitute_callout_block *, void *), + void *callout_data); +

+
+DESCRIPTION +
+

+This function sets the substitute callout fields in a match context (the first +argument). The second argument specifies a callout function, and the third +argument is an opaque data item that is passed to it. The result of this +function is always zero. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_set_substitute_case_callout.html b/miniconda3/share/doc/pcre2/html/pcre2_set_substitute_case_callout.html new file mode 100644 index 0000000000000000000000000000000000000000..ab506879f1f929ff660d66af3b5d9493a8bbc66f --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_set_substitute_case_callout.html @@ -0,0 +1,45 @@ + + +pcre2_set_substitute_case_callout specification + + +

pcre2_set_substitute_case_callout man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_set_substitute_case_callout(pcre2_match_context *mcontext, + PCRE2_SIZE (*callout_function)(PCRE2_SPTR, PCRE2_SIZE, + PCRE2_UCHAR *, PCRE2_SIZE, + int, void *), + void *callout_data); +

+
+DESCRIPTION +
+

+This function sets the substitute case callout fields in a match context (the +first argument). The second argument specifies a callout function, and the third +argument is an opaque data item that is passed to it. The result of this +function is always zero. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_substitute.html b/miniconda3/share/doc/pcre2/html/pcre2_substitute.html new file mode 100644 index 0000000000000000000000000000000000000000..abf0a703044f9829dbeea051ef790dd97d3850ed --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_substitute.html @@ -0,0 +1,111 @@ + + +pcre2_substitute specification + + +

pcre2_substitute man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_substitute(const pcre2_code *code, PCRE2_SPTR subject, + PCRE2_SIZE length, PCRE2_SIZE startoffset, + uint32_t options, pcre2_match_data *match_data, + pcre2_match_context *mcontext, PCRE2_SPTR replacement, + PCRE2_SIZE rlength, PCRE2_UCHAR *outputbuffer, + PCRE2_SIZE *outlengthptr); +

+
+DESCRIPTION +
+

+This function matches a compiled regular expression against a given subject +string, using a matching algorithm that is similar to Perl's. It then makes a +copy of the subject, substituting a replacement string for what was matched. +Its arguments are: +

+  code          Points to the compiled pattern
+  subject       Points to the subject string
+  length        Length of the subject string
+  startoffset   Offset in the subject at which to start matching
+  options       Option bits
+  match_data    Points to a match data block, or is NULL
+  mcontext      Points to a match context, or is NULL
+  replacement   Points to the replacement string
+  rlength       Length of the replacement string
+  outputbuffer  Points to the output buffer
+  outlengthptr  Points to the length of the output buffer
+
+A match data block is needed only if you want to inspect the data from the +final match that is returned in that block or if PCRE2_SUBSTITUTE_MATCHED is +set. A match context is needed only if you want to: +
+  Set up a callout function
+  Set a matching offset limit
+  Change the backtracking match limit
+  Change the backtracking depth limit
+  Set custom memory management in the match context
+
+The length, startoffset and rlength values are code units, +not characters, as is the contents of the variable pointed at by +outlengthptr. This variable must contain the length of the output buffer +when the function is called. If the function is successful, the value is +changed to the length of the new string, excluding the trailing zero that is +automatically added. +

+

+The subject and replacement lengths can be given as PCRE2_ZERO_TERMINATED for +zero-terminated strings. The options are: +

+  PCRE2_ANCHORED                     Match only at the first position
+  PCRE2_ENDANCHORED                  Match only at end of subject
+  PCRE2_NOTBOL                       Subject is not the beginning of a line
+  PCRE2_NOTEOL                       Subject is not the end of a line
+  PCRE2_NOTEMPTY                     An empty string is not a valid match
+  PCRE2_NOTEMPTY_ATSTART             An empty string at the start of the subject is not a valid match
+  PCRE2_NO_JIT                       Do not use JIT matching
+  PCRE2_NO_UTF_CHECK                 Do not check for UTF validity in the subject or replacement
+                                      (only relevant if PCRE2_UTF was set at compile time)
+  PCRE2_SUBSTITUTE_EXTENDED          Do extended replacement processing
+  PCRE2_SUBSTITUTE_GLOBAL            Replace all occurrences in the subject
+  PCRE2_SUBSTITUTE_LITERAL           The replacement string is literal
+  PCRE2_SUBSTITUTE_MATCHED           Use pre-existing match data for first match
+  PCRE2_SUBSTITUTE_OVERFLOW_LENGTH   If overflow, compute needed length
+  PCRE2_SUBSTITUTE_REPLACEMENT_ONLY  Return only replacement string(s)
+  PCRE2_SUBSTITUTE_UNKNOWN_UNSET     Treat unknown group as unset
+  PCRE2_SUBSTITUTE_UNSET_EMPTY       Simple unset insert = empty string
+
+If PCRE2_SUBSTITUTE_LITERAL is set, PCRE2_SUBSTITUTE_EXTENDED, +PCRE2_SUBSTITUTE_UNKNOWN_UNSET, and PCRE2_SUBSTITUTE_UNSET_EMPTY are ignored. +

+

+If PCRE2_SUBSTITUTE_MATCHED is set, match_data must be non-NULL; its +contents must be the result of a call to pcre2_match() using the same +pattern and subject. +

+

+The function returns the number of substitutions, which may be zero if there +are no matches. The result may be greater than one only when +PCRE2_SUBSTITUTE_GLOBAL is set. In the event of an error, a negative error code +is returned. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_substring_copy_byname.html b/miniconda3/share/doc/pcre2/html/pcre2_substring_copy_byname.html new file mode 100644 index 0000000000000000000000000000000000000000..fd01805e8dce9920eb7c84d949c240699577033f --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_substring_copy_byname.html @@ -0,0 +1,58 @@ + + +pcre2_substring_copy_byname specification + + +

pcre2_substring_copy_byname man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_substring_copy_byname(pcre2_match_data *match_data, + PCRE2_SPTR name, PCRE2_UCHAR *buffer, PCRE2_SIZE *bufflen); +

+
+DESCRIPTION +
+

+This is a convenience function for extracting a captured substring, identified +by name, into a given buffer. The arguments are: +

+  match_data    The match data block for the match
+  name          Name of the required substring
+  buffer        Buffer to receive the string
+  bufflen       Length of buffer (code units)
+
+The bufflen variable is updated to contain the length of the extracted +string, excluding the trailing zero. The yield of the function is zero for +success or one of the following error numbers: +
+  PCRE2_ERROR_NOSUBSTRING   there are no groups of that name
+  PCRE2_ERROR_UNAVAILBLE    the ovector was too small for that group
+  PCRE2_ERROR_UNSET         the group did not participate in the match
+  PCRE2_ERROR_NOMEMORY      the buffer is not big enough
+
+If there is more than one group with the given name, the first one that is set +is returned. In this situation PCRE2_ERROR_UNSET means that no group with the +given name was set. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_substring_copy_bynumber.html b/miniconda3/share/doc/pcre2/html/pcre2_substring_copy_bynumber.html new file mode 100644 index 0000000000000000000000000000000000000000..83e1a2720ff89cfca0a9ec24855cbad9dd004906 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_substring_copy_bynumber.html @@ -0,0 +1,57 @@ + + +pcre2_substring_copy_bynumber specification + + +

pcre2_substring_copy_bynumber man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_substring_copy_bynumber(pcre2_match_data *match_data, + uint32_t number, PCRE2_UCHAR *buffer, + PCRE2_SIZE *bufflen); +

+
+DESCRIPTION +
+

+This is a convenience function for extracting a captured substring into a given +buffer. The arguments are: +

+  match_data    The match data block for the match
+  number        Number of the required substring
+  buffer        Buffer to receive the string
+  bufflen       Length of buffer
+
+The bufflen variable is updated with the length of the extracted string, +excluding the terminating zero. The yield of the function is zero for success +or one of the following error numbers: +
+  PCRE2_ERROR_NOSUBSTRING   there are no groups of that number
+  PCRE2_ERROR_UNAVAILBLE    the ovector was too small for that group
+  PCRE2_ERROR_UNSET         the group did not participate in the match
+  PCRE2_ERROR_NOMEMORY      the buffer is too small
+
+
+

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_substring_free.html b/miniconda3/share/doc/pcre2/html/pcre2_substring_free.html new file mode 100644 index 0000000000000000000000000000000000000000..e0d0fbda4c39fbb6fc8aff2e51795dcbade1d731 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_substring_free.html @@ -0,0 +1,41 @@ + + +pcre2_substring_free specification + + +

pcre2_substring_free man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+void pcre2_substring_free(PCRE2_UCHAR *buffer); +

+
+DESCRIPTION +
+

+This is a convenience function for freeing the memory obtained by a previous +call to pcre2_substring_get_byname() or +pcre2_substring_get_bynumber(). Its only argument is a pointer to the +string. If the argument is NULL, the function does nothing. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_substring_get_byname.html b/miniconda3/share/doc/pcre2/html/pcre2_substring_get_byname.html new file mode 100644 index 0000000000000000000000000000000000000000..a4b8771ded6813fe4d4d7dc86645b2730c0bbc14 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_substring_get_byname.html @@ -0,0 +1,60 @@ + + +pcre2_substring_get_byname specification + + +

pcre2_substring_get_byname man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_substring_get_byname(pcre2_match_data *match_data, + PCRE2_SPTR name, PCRE2_UCHAR **bufferptr, PCRE2_SIZE *bufflen); +

+
+DESCRIPTION +
+

+This is a convenience function for extracting a captured substring by name into +newly acquired memory. The arguments are: +

+  match_data    The match data for the match
+  name          Name of the required substring
+  bufferptr     Where to put the string pointer
+  bufflen       Where to put the string length
+
+The memory in which the substring is placed is obtained by calling the same +memory allocation function that was used for the match data block. The +convenience function pcre2_substring_free() can be used to free it when +it is no longer needed. The yield of the function is zero for success or one of +the following error numbers: +
+  PCRE2_ERROR_NOSUBSTRING   there are no groups of that name
+  PCRE2_ERROR_UNAVAILBLE    the ovector was too small for that group
+  PCRE2_ERROR_UNSET         the group did not participate in the match
+  PCRE2_ERROR_NOMEMORY      memory could not be obtained
+
+If there is more than one group with the given name, the first one that is set +is returned. In this situation PCRE2_ERROR_UNSET means that no group with the +given name was set. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_substring_get_bynumber.html b/miniconda3/share/doc/pcre2/html/pcre2_substring_get_bynumber.html new file mode 100644 index 0000000000000000000000000000000000000000..391bc82b06f6c3d3acd52e2644cfd539e3383453 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_substring_get_bynumber.html @@ -0,0 +1,58 @@ + + +pcre2_substring_get_bynumber specification + + +

pcre2_substring_get_bynumber man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_substring_get_bynumber(pcre2_match_data *match_data, + uint32_t number, PCRE2_UCHAR **bufferptr, PCRE2_SIZE *bufflen); +

+
+DESCRIPTION +
+

+This is a convenience function for extracting a captured substring by number +into newly acquired memory. The arguments are: +

+  match_data    The match data for the match
+  number        Number of the required substring
+  bufferptr     Where to put the string pointer
+  bufflen       Where to put the string length
+
+The memory in which the substring is placed is obtained by calling the same +memory allocation function that was used for the match data block. The +convenience function pcre2_substring_free() can be used to free it when +it is no longer needed. The yield of the function is zero for success or one of +the following error numbers: +
+  PCRE2_ERROR_NOSUBSTRING   there are no groups of that number
+  PCRE2_ERROR_UNAVAILBLE    the ovector was too small for that group
+  PCRE2_ERROR_UNSET         the group did not participate in the match
+  PCRE2_ERROR_NOMEMORY      memory could not be obtained
+
+
+

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_substring_length_byname.html b/miniconda3/share/doc/pcre2/html/pcre2_substring_length_byname.html new file mode 100644 index 0000000000000000000000000000000000000000..213bc949d77f0a16ce0e6495f8bdea8a94c5e994 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_substring_length_byname.html @@ -0,0 +1,46 @@ + + +pcre2_substring_length_byname specification + + +

pcre2_substring_length_byname man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_substring_length_byname(pcre2_match_data *match_data, + PCRE2_SPTR name, PCRE2_SIZE *length); +

+
+DESCRIPTION +
+

+This function returns the length of a matched substring, identified by name. +The arguments are: +

+  match_data   The match data block for the match
+  name         The substring name
+  length       Where to return the length
+
+The yield is zero on success, or an error code if the substring is not found. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_substring_length_bynumber.html b/miniconda3/share/doc/pcre2/html/pcre2_substring_length_bynumber.html new file mode 100644 index 0000000000000000000000000000000000000000..db01cca41507fedb7f2e3e81f140dab00e43d535 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_substring_length_bynumber.html @@ -0,0 +1,48 @@ + + +pcre2_substring_length_bynumber specification + + +

pcre2_substring_length_bynumber man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_substring_length_bynumber(pcre2_match_data *match_data, + uint32_t number, PCRE2_SIZE *length); +

+
+DESCRIPTION +
+

+This function returns the length of a matched substring, identified by number. +The arguments are: +

+  match_data   The match data block for the match
+  number       The substring number
+  length       Where to return the length, or NULL
+
+The third argument may be NULL if all you want to know is whether or not a +substring is set. The yield is zero on success, or a negative error code +otherwise. After a partial match, only substring 0 is available. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_substring_list_free.html b/miniconda3/share/doc/pcre2/html/pcre2_substring_list_free.html new file mode 100644 index 0000000000000000000000000000000000000000..dea8bc5880af9129547daf6e2677511c61ce318b --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_substring_list_free.html @@ -0,0 +1,41 @@ + + +pcre2_substring_list_free specification + + +

pcre2_substring_list_free man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+void pcre2_substring_list_free(PCRE2_UCHAR **list); +

+
+DESCRIPTION +
+

+This is a convenience function for freeing the store obtained by a previous +call to pcre2substring_list_get(). Its only argument is a pointer to +the list of string pointers. If the argument is NULL, the function returns +immediately, without doing anything. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_substring_list_get.html b/miniconda3/share/doc/pcre2/html/pcre2_substring_list_get.html new file mode 100644 index 0000000000000000000000000000000000000000..fd4362740c4f08ff067406d5bb37fb6da4645b93 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_substring_list_get.html @@ -0,0 +1,56 @@ + + +pcre2_substring_list_get specification + + +

pcre2_substring_list_get man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_substring_list_get(pcre2_match_data *match_data, +" PCRE2_UCHAR ***listptr, PCRE2_SIZE **lengthsptr); +

+
+DESCRIPTION +
+

+This is a convenience function for extracting all the captured substrings after +a pattern match. It builds a list of pointers to the strings, and (optionally) +a second list that contains their lengths (in code units), excluding a +terminating zero that is added to each of them. All this is done in a single +block of memory that is obtained using the same memory allocation function that +was used to get the match data block. The convenience function +pcre2_substring_list_free() can be used to free it when it is no longer +needed. The arguments are: +

+  match_data    The match data block
+  listptr       Where to put a pointer to the list
+  lengthsptr    Where to put a pointer to the lengths, or NULL
+
+A pointer to a list of pointers is put in the variable whose address is in +listptr. The list is terminated by a NULL pointer. If lengthsptr is +not NULL, a matching list of lengths is created, and its address is placed in +lengthsptr. The yield of the function is zero on success or +PCRE2_ERROR_NOMEMORY if sufficient memory could not be obtained. +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_substring_nametable_scan.html b/miniconda3/share/doc/pcre2/html/pcre2_substring_nametable_scan.html new file mode 100644 index 0000000000000000000000000000000000000000..277affae01144fa5550d3589fd067bf4f77c5d65 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_substring_nametable_scan.html @@ -0,0 +1,53 @@ + + +pcre2_substring_nametable_scan specification + + +

pcre2_substring_nametable_scan man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_substring_nametable_scan(const pcre2_code *code, + PCRE2_SPTR name, PCRE2_SPTR *first, PCRE2_SPTR *last); +

+
+DESCRIPTION +
+

+This convenience function finds, for a compiled pattern, the first and last +entries for a given name in the table that translates capture group names into +numbers. +

+  code    Compiled regular expression
+  name    Name whose entries required
+  first   Where to return a pointer to the first entry
+  last    Where to return a pointer to the last entry
+
+When the name is found in the table, if first is NULL, the function +returns a group number, but if there is more than one matching entry, it is not +defined which one. Otherwise, when both pointers have been set, the yield of +the function is the length of each entry in code units. If the name is not +found, PCRE2_ERROR_NOSUBSTRING is returned. +

+

+There is a complete description of the PCRE2 native API, including the format of +the table entries, in the +pcre2api +page, and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2_substring_number_from_name.html b/miniconda3/share/doc/pcre2/html/pcre2_substring_number_from_name.html new file mode 100644 index 0000000000000000000000000000000000000000..160fbda66fcf9892edce4662f14ea89340dad5f2 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2_substring_number_from_name.html @@ -0,0 +1,50 @@ + + +pcre2_substring_number_from_name specification + + +

pcre2_substring_number_from_name man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SYNOPSIS +
+

+#include <pcre2.h> +

+

+int pcre2_substring_number_from_name(const pcre2_code *code, + PCRE2_SPTR name); +

+
+DESCRIPTION +
+

+This convenience function finds the number of a named substring capturing +parenthesis in a compiled pattern, provided that it is a unique name. The +function arguments are: +

+  code    Compiled regular expression
+  name    Name whose number is required
+
+The yield of the function is the number of the parenthesis if the name is +found, or PCRE2_ERROR_NOSUBSTRING if it is not found. When duplicate names are +allowed (PCRE2_DUPNAMES is set), if the name is not unique, +PCRE2_ERROR_NOUNIQUESUBSTRING is returned. You can obtain the list of numbers +with the same name by calling pcre2_substring_nametable_scan(). +

+

+There is a complete description of the PCRE2 native API in the +pcre2api +page and a description of the POSIX API in the +pcre2posix +page. +

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2api.html b/miniconda3/share/doc/pcre2/html/pcre2api.html new file mode 100644 index 0000000000000000000000000000000000000000..079cf176daac59b1a3fa0d0b30db4fd13de59345 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2api.html @@ -0,0 +1,4496 @@ + + +pcre2api specification + + +

pcre2api man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+

+

+#include <pcre2.h> +
+
+PCRE2 is a new API for PCRE, starting at release 10.0. This document contains a +description of all its native functions. See the +pcre2 +document for an overview of all the PCRE2 documentation. +

+
PCRE2 NATIVE API BASIC FUNCTIONS
+

+pcre2_code *pcre2_compile(PCRE2_SPTR pattern, PCRE2_SIZE length, + uint32_t options, int *errorcode, PCRE2_SIZE *erroroffset, + pcre2_compile_context *ccontext); +
+
+void pcre2_code_free(pcre2_code *code); +
+
+pcre2_match_data *pcre2_match_data_create(uint32_t ovecsize, + pcre2_general_context *gcontext); +
+
+pcre2_match_data *pcre2_match_data_create_from_pattern( + const pcre2_code *code, pcre2_general_context *gcontext); +
+
+int pcre2_match(const pcre2_code *code, PCRE2_SPTR subject, + PCRE2_SIZE length, PCRE2_SIZE startoffset, + uint32_t options, pcre2_match_data *match_data, + pcre2_match_context *mcontext); +
+
+int pcre2_dfa_match(const pcre2_code *code, PCRE2_SPTR subject, + PCRE2_SIZE length, PCRE2_SIZE startoffset, + uint32_t options, pcre2_match_data *match_data, + pcre2_match_context *mcontext, + int *workspace, PCRE2_SIZE wscount); +
+
+void pcre2_match_data_free(pcre2_match_data *match_data); +

+
PCRE2 NATIVE API AUXILIARY MATCH FUNCTIONS
+

+PCRE2_SPTR pcre2_get_mark(pcre2_match_data *match_data); +
+
+PCRE2_SIZE pcre2_get_match_data_size(pcre2_match_data *match_data); +
+
+PCRE2_SIZE pcre2_get_match_data_heapframes_size( + pcre2_match_data *match_data); +
+
+uint32_t pcre2_get_ovector_count(pcre2_match_data *match_data); +
+
+PCRE2_SIZE *pcre2_get_ovector_pointer(pcre2_match_data *match_data); +
+
+PCRE2_SIZE pcre2_get_startchar(pcre2_match_data *match_data); +

+
PCRE2 NATIVE API GENERAL CONTEXT FUNCTIONS
+

+pcre2_general_context *pcre2_general_context_create( + void *(*private_malloc)(PCRE2_SIZE, void *), + void (*private_free)(void *, void *), void *memory_data); +
+
+pcre2_general_context *pcre2_general_context_copy( + pcre2_general_context *gcontext); +
+
+void pcre2_general_context_free(pcre2_general_context *gcontext); +

+
PCRE2 NATIVE API COMPILE CONTEXT FUNCTIONS
+

+pcre2_compile_context *pcre2_compile_context_create( + pcre2_general_context *gcontext); +
+
+pcre2_compile_context *pcre2_compile_context_copy( + pcre2_compile_context *ccontext); +
+
+void pcre2_compile_context_free(pcre2_compile_context *ccontext); +
+
+int pcre2_set_bsr(pcre2_compile_context *ccontext, + uint32_t value); +
+
+int pcre2_set_character_tables(pcre2_compile_context *ccontext, + const uint8_t *tables); +
+
+int pcre2_set_compile_extra_options(pcre2_compile_context *ccontext, + uint32_t extra_options); +
+
+int pcre2_set_max_pattern_length(pcre2_compile_context *ccontext, + PCRE2_SIZE value); +
+
+int pcre2_set_max_pattern_compiled_length( + pcre2_compile_context *ccontext, PCRE2_SIZE value); +
+
+int pcre2_set_max_varlookbehind(pcre2_compile_contest *ccontext, +" uint32_t value); +
+
+int pcre2_set_newline(pcre2_compile_context *ccontext, + uint32_t value); +
+
+int pcre2_set_parens_nest_limit(pcre2_compile_context *ccontext, + uint32_t value); +
+
+int pcre2_set_compile_recursion_guard(pcre2_compile_context *ccontext, + int (*guard_function)(uint32_t, void *), void *user_data); +
+
+int pcre2_set_optimize(pcre2_compile_context *ccontext, + uint32_t directive); +

+
PCRE2 NATIVE API MATCH CONTEXT FUNCTIONS
+

+pcre2_match_context *pcre2_match_context_create( + pcre2_general_context *gcontext); +
+
+pcre2_match_context *pcre2_match_context_copy( + pcre2_match_context *mcontext); +
+
+void pcre2_match_context_free(pcre2_match_context *mcontext); +
+
+int pcre2_set_callout(pcre2_match_context *mcontext, + int (*callout_function)(pcre2_callout_block *, void *), + void *callout_data); +
+
+int pcre2_set_substitute_callout(pcre2_match_context *mcontext, + int (*callout_function)(pcre2_substitute_callout_block *, void *), + void *callout_data); +
+
+int pcre2_set_substitute_case_callout(pcre2_match_context *mcontext, + PCRE2_SIZE (*callout_function)(PCRE2_SPTR, PCRE2_SIZE, + PCRE2_UCHAR *, PCRE2_SIZE, + int, void *), + void *callout_data); +
+
+int pcre2_set_offset_limit(pcre2_match_context *mcontext, + PCRE2_SIZE value); +
+
+int pcre2_set_heap_limit(pcre2_match_context *mcontext, + uint32_t value); +
+
+int pcre2_set_match_limit(pcre2_match_context *mcontext, + uint32_t value); +
+
+int pcre2_set_depth_limit(pcre2_match_context *mcontext, + uint32_t value); +

+
PCRE2 NATIVE API STRING EXTRACTION FUNCTIONS
+

+int pcre2_substring_copy_byname(pcre2_match_data *match_data, + PCRE2_SPTR name, PCRE2_UCHAR *buffer, PCRE2_SIZE *bufflen); +
+
+int pcre2_substring_copy_bynumber(pcre2_match_data *match_data, + uint32_t number, PCRE2_UCHAR *buffer, + PCRE2_SIZE *bufflen); +
+
+void pcre2_substring_free(PCRE2_UCHAR *buffer); +
+
+int pcre2_substring_get_byname(pcre2_match_data *match_data, + PCRE2_SPTR name, PCRE2_UCHAR **bufferptr, PCRE2_SIZE *bufflen); +
+
+int pcre2_substring_get_bynumber(pcre2_match_data *match_data, + uint32_t number, PCRE2_UCHAR **bufferptr, + PCRE2_SIZE *bufflen); +
+
+int pcre2_substring_length_byname(pcre2_match_data *match_data, + PCRE2_SPTR name, PCRE2_SIZE *length); +
+
+int pcre2_substring_length_bynumber(pcre2_match_data *match_data, + uint32_t number, PCRE2_SIZE *length); +
+
+int pcre2_substring_nametable_scan(const pcre2_code *code, + PCRE2_SPTR name, PCRE2_SPTR *first, PCRE2_SPTR *last); +
+
+int pcre2_substring_number_from_name(const pcre2_code *code, + PCRE2_SPTR name); +
+
+void pcre2_substring_list_free(PCRE2_UCHAR **list); +
+
+int pcre2_substring_list_get(pcre2_match_data *match_data, +" PCRE2_UCHAR ***listptr, PCRE2_SIZE **lengthsptr); +

+
PCRE2 NATIVE API STRING SUBSTITUTION FUNCTION
+

+int pcre2_substitute(const pcre2_code *code, PCRE2_SPTR subject, + PCRE2_SIZE length, PCRE2_SIZE startoffset, + uint32_t options, pcre2_match_data *match_data, + pcre2_match_context *mcontext, PCRE2_SPTR replacementz, + PCRE2_SIZE rlength, PCRE2_UCHAR *outputbuffer, + PCRE2_SIZE *outlengthptr); +

+
PCRE2 NATIVE API JIT FUNCTIONS
+

+int pcre2_jit_compile(pcre2_code *code, uint32_t options); +
+
+int pcre2_jit_match(const pcre2_code *code, PCRE2_SPTR subject, + PCRE2_SIZE length, PCRE2_SIZE startoffset, + uint32_t options, pcre2_match_data *match_data, + pcre2_match_context *mcontext); +
+
+void pcre2_jit_free_unused_memory(pcre2_general_context *gcontext); +
+
+pcre2_jit_stack *pcre2_jit_stack_create(size_t startsize, + size_t maxsize, pcre2_general_context *gcontext); +
+
+void pcre2_jit_stack_assign(pcre2_match_context *mcontext, + pcre2_jit_callback callback_function, void *callback_data); +
+
+void pcre2_jit_stack_free(pcre2_jit_stack *jit_stack); +

+
PCRE2 NATIVE API SERIALIZATION FUNCTIONS
+

+int32_t pcre2_serialize_decode(pcre2_code **codes, + int32_t number_of_codes, const uint8_t *bytes, + pcre2_general_context *gcontext); +
+
+int32_t pcre2_serialize_encode(const pcre2_code **codes, + int32_t number_of_codes, uint8_t **serialized_bytes, + PCRE2_SIZE *serialized_size, pcre2_general_context *gcontext); +
+
+void pcre2_serialize_free(uint8_t *bytes); +
+
+int32_t pcre2_serialize_get_number_of_codes(const uint8_t *bytes); +

+
PCRE2 NATIVE API AUXILIARY FUNCTIONS
+

+pcre2_code *pcre2_code_copy(const pcre2_code *code); +
+
+pcre2_code *pcre2_code_copy_with_tables(const pcre2_code *code); +
+
+int pcre2_get_error_message(int errorcode, PCRE2_UCHAR *buffer, + PCRE2_SIZE bufflen); +
+
+const uint8_t *pcre2_maketables(pcre2_general_context *gcontext); +
+
+void pcre2_maketables_free(pcre2_general_context *gcontext, + const uint8_t *tables); +
+
+int pcre2_pattern_info(const pcre2_code *code, uint32_t what, + void *where); +
+
+int pcre2_callout_enumerate(const pcre2_code *code, + int (*callback)(pcre2_callout_enumerate_block *, void *), + void *user_data); +
+
+int pcre2_config(uint32_t what, void *where); +

+
PCRE2 NATIVE API OBSOLETE FUNCTIONS
+

+int pcre2_set_recursion_limit(pcre2_match_context *mcontext, + uint32_t value); +
+
+int pcre2_set_recursion_memory_management( + pcre2_match_context *mcontext, + void *(*private_malloc)(size_t, void *), + void (*private_free)(void *, void *), void *memory_data); +
+
+These functions became obsolete at release 10.30 and are retained only for +backward compatibility. They should not be used in new code. The first is +replaced by pcre2_set_depth_limit(); the second is no longer needed and +has no effect (it always returns zero). +

+
PCRE2 EXPERIMENTAL PATTERN CONVERSION FUNCTIONS
+

+pcre2_convert_context *pcre2_convert_context_create( + pcre2_general_context *gcontext); +
+
+pcre2_convert_context *pcre2_convert_context_copy( + pcre2_convert_context *cvcontext); +
+
+void pcre2_convert_context_free(pcre2_convert_context *cvcontext); +
+
+int pcre2_set_glob_escape(pcre2_convert_context *cvcontext, + uint32_t escape_char); +
+
+int pcre2_set_glob_separator(pcre2_convert_context *cvcontext, + uint32_t separator_char); +
+
+int pcre2_pattern_convert(PCRE2_SPTR pattern, PCRE2_SIZE length, + uint32_t options, PCRE2_UCHAR **buffer, + PCRE2_SIZE *blength, pcre2_convert_context *cvcontext); +
+
+void pcre2_converted_pattern_free(PCRE2_UCHAR *converted_pattern); +
+
+These functions provide a way of converting non-PCRE2 patterns into +patterns that can be processed by pcre2_compile(). This facility is +experimental and may be changed in future releases. At present, "globs" and +POSIX basic and extended patterns can be converted. Details are given in the +pcre2convert +documentation. +

+
PCRE2 8-BIT, 16-BIT, AND 32-BIT LIBRARIES
+

+There are three PCRE2 libraries, supporting 8-bit, 16-bit, and 32-bit code +units, respectively. However, there is just one header file, pcre2.h. +This contains the function prototypes and other definitions for all three +libraries. One, two, or all three can be installed simultaneously. On Unix-like +systems the libraries are called libpcre2-8, libpcre2-16, and +libpcre2-32, and they can also co-exist with the original PCRE libraries. +Every PCRE2 function comes in three different forms, one for each library, for +example: +

+  pcre2_compile_8()
+  pcre2_compile_16()
+  pcre2_compile_32()
+
+There are also three different sets of data types: +
+  PCRE2_UCHAR8, PCRE2_UCHAR16, PCRE2_UCHAR32
+  PCRE2_SPTR8,  PCRE2_SPTR16,  PCRE2_SPTR32
+
+The UCHAR types define unsigned code units of the appropriate widths. +For example, PCRE2_UCHAR16 is usually defined as `uint16_t'. +The SPTR types are pointers to constants of the equivalent UCHAR types, +that is, they are pointers to vectors of unsigned code units. +

+

+Character strings are passed to a PCRE2 library as sequences of unsigned +integers in code units of the appropriate width. The length of a string may +be given as a number of code units, or the string may be specified as +zero-terminated. +

+

+Many applications use only one code unit width. For their convenience, macros +are defined whose names are the generic forms such as pcre2_compile() and +PCRE2_SPTR. These macros use the value of the macro PCRE2_CODE_UNIT_WIDTH to +generate the appropriate width-specific function and macro names. +PCRE2_CODE_UNIT_WIDTH is not defined by default. An application must define it +to be 8, 16, or 32 before including pcre2.h in order to make use of the +generic names. +

+

+Applications that use more than one code unit width can be linked with more +than one PCRE2 library, but must define PCRE2_CODE_UNIT_WIDTH to be 0 before +including pcre2.h, and then use the real function names. Any code that is +to be included in an environment where the value of PCRE2_CODE_UNIT_WIDTH is +unknown should also use the real function names. (Unfortunately, it is not +possible in C code to save and restore the value of a macro.) +

+

+If PCRE2_CODE_UNIT_WIDTH is not defined before including pcre2.h, a +compiler error occurs. +

+

+When using multiple libraries in an application, you must take care when +processing any particular pattern to use only functions from a single library. +For example, if you want to run a match using a pattern that was compiled with +pcre2_compile_16(), you must do so with pcre2_match_16(), not +pcre2_match_8() or pcre2_match_32(). +

+

+In the function summaries above, and in the rest of this document and other +PCRE2 documents, functions and data types are described using their generic +names, without the _8, _16, or _32 suffix. +

+
PCRE2 API OVERVIEW
+

+PCRE2 has its own native API, which is described in this document. There are +also some wrapper functions for the 8-bit library that correspond to the +POSIX regular expression API, but they do not give access to all the +functionality of PCRE2 and they are not thread-safe. They are described in the +pcre2posix +documentation. Both these APIs define a set of C function calls. +

+

+The native API C data types, function prototypes, option values, and error +codes are defined in the header file pcre2.h, which also contains +definitions of PCRE2_MAJOR and PCRE2_MINOR, the major and minor release numbers +for the library. Applications can use these to include support for different +releases of PCRE2. +

+

+In a Windows environment, if you want to statically link an application program +against a non-dll PCRE2 library, you must define PCRE2_STATIC before including +pcre2.h. +

+

+The functions pcre2_compile() and pcre2_match() are used for +compiling and matching regular expressions in a Perl-compatible manner. A +sample program that demonstrates the simplest way of using them is provided in +the file called pcre2demo.c in the PCRE2 source distribution. A listing +of this program is given in the +pcre2demo +documentation, and the +pcre2sample +documentation describes how to compile and run it. +

+

+The compiling and matching functions recognize various options that are passed +as bits in an options argument. There are also some more complicated parameters +such as custom memory management functions and resource limits that are passed +in "contexts" (which are just memory blocks, described below). Simple +applications do not need to make use of contexts. +

+

+Just-in-time (JIT) compiler support is an optional feature of PCRE2 that can be +built in appropriate hardware environments. It greatly speeds up the matching +performance of many patterns. Programs can request that it be used if +available by calling pcre2_jit_compile() after a pattern has been +successfully compiled by pcre2_compile(). This does nothing if JIT +support is not available. +

+

+More complicated programs might need to make use of the specialist functions +pcre2_jit_stack_create(), pcre2_jit_stack_free(), and +pcre2_jit_stack_assign() in order to control the JIT code's memory usage. +

+

+JIT matching is automatically used by pcre2_match() if it is available, +unless the PCRE2_NO_JIT option is set. There is also a direct interface for JIT +matching, which gives improved performance at the expense of less sanity +checking. The JIT-specific functions are discussed in the +pcre2jit +documentation. +

+

+A second matching function, pcre2_dfa_match(), which is not +Perl-compatible, is also provided. This uses a different algorithm for the +matching. The alternative algorithm finds all possible matches (at a given +point in the subject), and scans the subject just once (unless there are +lookaround assertions). However, this algorithm does not return captured +substrings. A description of the two matching algorithms and their advantages +and disadvantages is given in the +pcre2matching +documentation. There is no JIT support for pcre2_dfa_match(). +

+

+In addition to the main compiling and matching functions, there are convenience +functions for extracting captured substrings from a subject string that has +been matched by pcre2_match(). They are: +

+  pcre2_substring_copy_byname()
+  pcre2_substring_copy_bynumber()
+  pcre2_substring_get_byname()
+  pcre2_substring_get_bynumber()
+  pcre2_substring_list_get()
+  pcre2_substring_length_byname()
+  pcre2_substring_length_bynumber()
+  pcre2_substring_nametable_scan()
+  pcre2_substring_number_from_name()
+
+pcre2_substring_free() and pcre2_substring_list_free() are also +provided, to free memory used for extracted strings. If either of these +functions is called with a NULL argument, the function returns immediately +without doing anything. +

+

+The function pcre2_substitute() can be called to match a pattern and +return a copy of the subject string with substitutions for parts that were +matched. +

+

+Functions whose names begin with pcre2_serialize_ are used for saving +compiled patterns on disc or elsewhere, and reloading them later. +

+

+Finally, there are functions for finding out information about a compiled +pattern (pcre2_pattern_info()) and about the configuration with which +PCRE2 was built (pcre2_config()). +

+

+Functions with names ending with _free() are used for freeing memory +blocks of various sorts. In all cases, if one of these functions is called with +a NULL argument, it does nothing. +

+
STRING LENGTHS AND OFFSETS
+

+The PCRE2 API uses string lengths and offsets into strings of code units in +several places. These values are always of type PCRE2_SIZE, which is an +unsigned integer type, currently always defined as size_t. The largest +value that can be stored in such a type (that is ~(PCRE2_SIZE)0) is reserved +as a special indicator for zero-terminated strings and unset offsets. +Therefore, the longest string that can be handled is one less than this +maximum. Note that string lengths are always given in code units. Only in the +8-bit library is such a length the same as the number of bytes in the string. +

+
NEWLINES
+

+PCRE2 supports five different conventions for indicating line breaks in +strings: a single CR (carriage return) character, a single LF (linefeed) +character, the two-character sequence CRLF, any of the three preceding, or any +Unicode newline sequence. The Unicode newline sequences are the three just +mentioned, plus the single characters VT (vertical tab, U+000B), FF (form feed, +U+000C), NEL (next line, U+0085), LS (line separator, U+2028), and PS +(paragraph separator, U+2029). +

+

+Each of the first three conventions is used by at least one operating system as +its standard newline sequence. When PCRE2 is built, a default can be specified. +If it is not, the default is set to LF, which is the Unix standard. However, +the newline convention can be changed by an application when calling +pcre2_compile(), or it can be specified by special text at the start of +the pattern itself; this overrides any other settings. See the +pcre2pattern +page for details of the special character sequences. +

+

+In the PCRE2 documentation the word "newline" is used to mean "the character or +pair of characters that indicate a line break". The choice of newline +convention affects the handling of the dot, circumflex, and dollar +metacharacters, the handling of #-comments in /x mode, and, when CRLF is a +recognized line ending sequence, the match position advancement for a +non-anchored pattern. There is more detail about this in the +section on pcre2_match() options +below. +

+

+The choice of newline convention does not affect the interpretation of +the \n or \r escape sequences, nor does it affect what \R matches; this has +its own separate convention. +

+
MULTITHREADING
+

+In a multithreaded application it is important to keep thread-specific data +separate from data that can be shared between threads. The PCRE2 library code +itself is thread-safe: it contains no static or global variables. The API is +designed to be fairly simple for non-threaded applications while at the same +time ensuring that multithreaded applications can use it. +

+

+There are several different blocks of data that are used to pass information +between the application and the PCRE2 libraries. +

+
+The compiled pattern +
+

+A pointer to the compiled form of a pattern is returned to the user when +pcre2_compile() is successful. The data in the compiled pattern is fixed, +and does not change when the pattern is matched. Therefore, it is thread-safe, +that is, the same compiled pattern can be used by more than one thread +simultaneously. For example, an application can compile all its patterns at the +start, before forking off multiple threads that use them. However, if the +just-in-time (JIT) optimization feature is being used, it needs separate memory +stack areas for each thread. See the +pcre2jit +documentation for more details. +

+

+In a more complicated situation, where patterns are compiled only when they are +first needed, but are still shared between threads, pointers to compiled +patterns must be protected from simultaneous writing by multiple threads. This +is somewhat tricky to do correctly. If you know that writing to a pointer is +atomic in your environment, you can use logic like this: +

+  Get a read-only (shared) lock (mutex) for pointer
+  if (pointer == NULL)
+    {
+    Get a write (unique) lock for pointer
+    if (pointer == NULL) pointer = pcre2_compile(...
+    }
+  Release the lock
+  Use pointer in pcre2_match()
+
+Of course, testing for compilation errors should also be included in the code. +

+

+The reason for checking the pointer a second time is as follows: Several +threads may have acquired the shared lock and tested the pointer for being +NULL, but only one of them will be given the write lock, with the rest kept +waiting. The winning thread will compile the pattern and store the result. +After this thread releases the write lock, another thread will get it, and if +it does not retest pointer for being NULL, will recompile the pattern and +overwrite the pointer, creating a memory leak and possibly causing other +issues. +

+

+In an environment where writing to a pointer may not be atomic, the above logic +is not sufficient. The thread that is doing the compiling may be descheduled +after writing only part of the pointer, which could cause other threads to use +an invalid value. Instead of checking the pointer itself, a separate "pointer +is valid" flag (that can be updated atomically) must be used: +

+  Get a read-only (shared) lock (mutex) for pointer
+  if (!pointer_is_valid)
+    {
+    Get a write (unique) lock for pointer
+    if (!pointer_is_valid)
+      {
+      pointer = pcre2_compile(...
+      pointer_is_valid = TRUE
+      }
+    }
+  Release the lock
+  Use pointer in pcre2_match()
+
+If JIT is being used, but the JIT compilation is not being done immediately +(perhaps waiting to see if the pattern is used often enough), similar logic is +required. JIT compilation updates a value within the compiled code block, so a +thread must gain unique write access to the pointer before calling +pcre2_jit_compile(). Alternatively, pcre2_code_copy() or +pcre2_code_copy_with_tables() can be used to obtain a private copy of the +compiled code before calling the JIT compiler. +

+
+Context blocks +
+

+The next main section below introduces the idea of "contexts" in which PCRE2 +functions are called. A context is nothing more than a collection of parameters +that control the way PCRE2 operates. Grouping a number of parameters together +in a context is a convenient way of passing them to a PCRE2 function without +using lots of arguments. The parameters that are stored in contexts are in some +sense "advanced features" of the API. Many straightforward applications will +not need to use contexts. +

+

+In a multithreaded application, if the parameters in a context are values that +are never changed, the same context can be used by all the threads. However, if +any thread needs to change any value in a context, it must make its own +thread-specific copy. +

+
+Match blocks +
+

+The matching functions need a block of memory for storing the results of a +match. This includes details of what was matched, as well as additional +information such as the name of a (*MARK) setting. Each thread must provide its +own copy of this memory. +

+
PCRE2 CONTEXTS
+

+Some PCRE2 functions have a lot of parameters, many of which are used only by +specialist applications, for example, those that use custom memory management +or non-standard character tables. To keep function argument lists at a +reasonable size, and at the same time to keep the API extensible, "uncommon" +parameters are passed to certain functions in a context instead of +directly. A context is just a block of memory that holds the parameter values. +Applications that do not need to adjust any of the context parameters can pass +NULL when a context pointer is required. +

+

+There are three different types of context: a general context that is relevant +for several PCRE2 operations, a compile-time context, and a match-time context. +

+
+The general context +
+

+At present, this context just contains pointers to (and data for) external +memory management functions that are called from several places in the PCRE2 +library. The context is named `general' rather than specifically `memory' +because in future other fields may be added. If you do not want to supply your +own custom memory management functions, you do not need to bother with a +general context. A general context is created by: +
+
+pcre2_general_context *pcre2_general_context_create( + void *(*private_malloc)(PCRE2_SIZE, void *), + void (*private_free)(void *, void *), void *memory_data); +
+
+The two function pointers specify custom memory management functions, whose +prototypes are: +

+  void *private_malloc(PCRE2_SIZE, void *);
+  void  private_free(void *, void *);
+
+Whenever code in PCRE2 calls these functions, the final argument is the value +of memory_data. Either of the first two arguments of the creation +function may be NULL, in which case the system memory management functions +malloc() and free() are used. (This is not currently useful, as +there are no other fields in a general context, but in future there might be.) +The private_malloc() function is used (if supplied) to obtain memory for +storing the context, and all three values are saved as part of the context. +

+

+Whenever PCRE2 creates a data block of any kind, the block contains a pointer +to the free() function that matches the malloc() function that was +used. When the time comes to free the block, this function is called. +

+

+A general context can be copied by calling: +
+
+pcre2_general_context *pcre2_general_context_copy( + pcre2_general_context *gcontext); +
+
+The memory used for a general context should be freed by calling: +
+
+void pcre2_general_context_free(pcre2_general_context *gcontext); +
+
+If this function is passed a NULL argument, it returns immediately without +doing anything. +

+
+The compile context +
+

+A compile context is required if you want to provide an external function for +stack checking during compilation or to change the default values of any of the +following compile-time parameters: +

+  What \R matches (Unicode newlines or CR, LF, CRLF only)
+  PCRE2's character tables
+  The newline character sequence
+  The compile time nested parentheses limit
+  The maximum length of the pattern string
+  The extra options bits (none set by default)
+  Which performance optimizations the compiler should apply
+
+A compile context is also required if you are using custom memory management. +If none of these apply, just pass NULL as the context argument of +pcre2_compile(). +

+

+A compile context is created, copied, and freed by the following functions: +
+
+pcre2_compile_context *pcre2_compile_context_create( + pcre2_general_context *gcontext); +
+
+pcre2_compile_context *pcre2_compile_context_copy( + pcre2_compile_context *ccontext); +
+
+void pcre2_compile_context_free(pcre2_compile_context *ccontext); +
+
+A compile context is created with default values for its parameters. These can +be changed by calling the following functions, which return 0 on success, or +PCRE2_ERROR_BADDATA if invalid data is detected. +
+
+int pcre2_set_bsr(pcre2_compile_context *ccontext, + uint32_t value); +
+
+The value must be PCRE2_BSR_ANYCRLF, to specify that \R matches only CR, LF, +or CRLF, or PCRE2_BSR_UNICODE, to specify that \R matches any Unicode line +ending sequence. The value is used by the JIT compiler and by the two +interpreted matching functions, pcre2_match() and +pcre2_dfa_match(). +
+
+int pcre2_set_character_tables(pcre2_compile_context *ccontext, + const uint8_t *tables); +
+
+The value must be the result of a call to pcre2_maketables(), whose only +argument is a general context. This function builds a set of character tables +in the current locale. +
+
+int pcre2_set_compile_extra_options(pcre2_compile_context *ccontext, + uint32_t extra_options); +
+
+As PCRE2 has developed, almost all the 32 option bits that are available in +the options argument of pcre2_compile() have been used up. To avoid +running out, the compile context contains a set of extra option bits which are +used for some newer, assumed rarer, options. This function sets those bits. It +always sets all the bits (either on or off). It does not modify any existing +setting. The available options are defined in the section entitled "Extra +compile options" +below. +
+
+int pcre2_set_max_pattern_length(pcre2_compile_context *ccontext, + PCRE2_SIZE value); +
+
+This sets a maximum length, in code units, for any pattern string that is +compiled with this context. If the pattern is longer, an error is generated. +This facility is provided so that applications that accept patterns from +external sources can limit their size. The default is the largest number that a +PCRE2_SIZE variable can hold, which is effectively unlimited. +
+
+int pcre2_set_max_pattern_compiled_length( + pcre2_compile_context *ccontext, PCRE2_SIZE value); +
+
+This sets a maximum size, in bytes, for the memory needed to hold the compiled +version of a pattern that is compiled with this context. If the pattern needs +more memory, an error is generated. This facility is provided so that +applications that accept patterns from external sources can limit the amount of +memory they use. The default is the largest number that a PCRE2_SIZE variable +can hold, which is effectively unlimited. +
+
+int pcre2_set_max_varlookbehind(pcre2_compile_contest *ccontext, +" uint32_t value); +
+
+This sets a maximum length for the number of characters matched by a +variable-length lookbehind assertion. The default is set when PCRE2 is built, +with the ultimate default being 255, the same as Perl. Lookbehind assertions +without a bounding length are not supported. +
+
+int pcre2_set_newline(pcre2_compile_context *ccontext, + uint32_t value); +
+
+This specifies which characters or character sequences are to be recognized as +newlines. The value must be one of PCRE2_NEWLINE_CR (carriage return only), +PCRE2_NEWLINE_LF (linefeed only), PCRE2_NEWLINE_CRLF (the two-character +sequence CR followed by LF), PCRE2_NEWLINE_ANYCRLF (any of the above), +PCRE2_NEWLINE_ANY (any Unicode newline sequence), or PCRE2_NEWLINE_NUL (the +NUL character, that is a binary zero). +

+

+A pattern can override the value set in the compile context by starting with a +sequence such as (*CRLF). See the +pcre2pattern +page for details. +

+

+When a pattern is compiled with the PCRE2_EXTENDED or PCRE2_EXTENDED_MORE +option, the newline convention affects the recognition of the end of internal +comments starting with #. The value is saved with the compiled pattern for +subsequent use by the JIT compiler and by the two interpreted matching +functions, pcre2_match() and pcre2_dfa_match(). +
+
+int pcre2_set_parens_nest_limit(pcre2_compile_context *ccontext, + uint32_t value); +
+
+This parameter adjusts the limit, set when PCRE2 is built (default 250), on the +depth of parenthesis nesting in a pattern. This limit stops rogue patterns +using up too much system stack when being compiled. The limit applies to +parentheses of all kinds, not just capturing parentheses. +
+
+int pcre2_set_compile_recursion_guard(pcre2_compile_context *ccontext, + int (*guard_function)(uint32_t, void *), void *user_data); +
+
+There is at least one application that runs PCRE2 in threads with very limited +system stack, where running out of stack is to be avoided at all costs. The +parenthesis limit above cannot take account of how much stack is actually +available during compilation. For a finer control, you can supply a function +that is called whenever pcre2_compile() starts to compile a parenthesized +part of a pattern. This function can check the actual stack size (or anything +else that it wants to, of course). +

+

+The first argument to the callout function gives the current depth of +nesting, and the second is user data that is set up by the last argument of +pcre2_set_compile_recursion_guard(). The callout function should return +zero if all is well, or non-zero to force an error. +
+
+int pcre2_set_optimize(pcre2_compile_context *ccontext, + uint32_t directive); +
+
+PCRE2 can apply various performance optimizations during compilation, in order +to make matching faster. For example, the compiler might convert some regex +constructs into an equivalent construct which pcre2_match() can execute +faster. By default, all available optimizations are enabled. However, in rare +cases, one might wish to disable specific optimizations. For example, if it is +known that some optimizations cannot benefit a certain regex, it might be +desirable to disable them, in order to speed up compilation. +

+

+The permitted values of directive are as follows: +

+  PCRE2_OPTIMIZATION_FULL
+
+Enable all optional performance optimizations. This is the default value. +
+  PCRE2_OPTIMIZATION_NONE
+
+Disable all optional performance optimizations. +
+  PCRE2_AUTO_POSSESS
+  PCRE2_AUTO_POSSESS_OFF
+
+Enable/disable "auto-possessification" of variable quantifiers such as * and +. +This optimization, for example, turns a+b into a++b in order to avoid +backtracks into a+ that can never be successful. However, if callouts are in +use, auto-possessification means that some callouts are never taken. You can +disable this optimization if you want the matching functions to do a full, +unoptimized search and run all the callouts. +
+  PCRE2_DOTSTAR_ANCHOR
+  PCRE2_DOTSTAR_ANCHOR_OFF
+
+Enable/disable an optimization that is applied when .* is the first significant +item in a top-level branch of a pattern, and all the other branches also start +with .* or with \A or \G or ^. Such a pattern is automatically anchored if +PCRE2_DOTALL is set for all the .* items and PCRE2_MULTILINE is not set for any +^ items. Otherwise, the fact that any match must start either at the start of +the subject or following a newline is remembered. Like other optimizations, +this can cause callouts to be skipped. +

+

+Dotstar anchor optimization is automatically disabled for .* if it is inside an +atomic group or a capture group that is the subject of a backreference, or if +the pattern contains (*PRUNE) or (*SKIP). +

+  PCRE2_START_OPTIMIZE
+  PCRE2_START_OPTIMIZE_OFF
+
+Enable/disable optimizations which cause matching functions to scan the subject +string for specific code unit values before attempting a match. For example, if +it is known that an unanchored match must start with a specific value, the +matching code searches the subject for that value, and fails immediately if it +cannot find it, without actually running the main matching function. This means +that a special item such as (*COMMIT) at the start of a pattern is not +considered until after a suitable starting point for the match has been found. +Also, when callouts or (*MARK) items are in use, these "start-up" optimizations +can cause them to be skipped if the pattern is never actually used. The start-up +optimizations are in effect a pre-scan of the subject that takes place before +the pattern is run. +

+

+Disabling start-up optimizations ensures that in cases where the result is "no +match", the callouts do occur, and that items such as (*COMMIT) and (*MARK) are +considered at every possible starting position in the subject string. +

+

+Disabling start-up optimizations may change the outcome of a matching operation. +Consider the pattern +

+  (*COMMIT)ABC
+
+When this is compiled, PCRE2 records the fact that a match must start with the +character "A". Suppose the subject string is "DEFABC". The start-up +optimization scans along the subject, finds "A" and runs the first match +attempt from there. The (*COMMIT) item means that the pattern must match the +current starting position, which in this case, it does. However, if the same +match is run without start-up optimizations, the initial scan along the subject +string does not happen. The first match attempt is run starting from "D" and +when this fails, (*COMMIT) prevents any further matches being tried, so the +overall result is "no match". +

+

+Another start-up optimization makes use of a minimum length for a matching +subject, which is recorded when possible. Consider the pattern +

+  (*MARK:1)B(*MARK:2)(X|Y)
+
+The minimum length for a match is two characters. If the subject is "XXBB", the +"starting character" optimization skips "XX", then tries to match "BB", which +is long enough. In the process, (*MARK:2) is encountered and remembered. When +the match attempt fails, the next "B" is found, but there is only one character +left, so there are no more attempts, and "no match" is returned with the "last +mark seen" set to "2". Without start-up optimizations, however, matches are +tried at every possible starting position, including at the end of the subject, +where (*MARK:1) is encountered, but there is no "B", so the "last mark seen" +that is returned is "1". In this case, the optimizations do not affect the +overall match result, which is still "no match", but they do affect the +auxiliary information that is returned. +

+
+The match context +
+

+A match context is required if you want to: +

+  Set up a callout function
+  Set an offset limit for matching an unanchored pattern
+  Change the limit on the amount of heap used when matching
+  Change the backtracking match limit
+  Change the backtracking depth limit
+  Set custom memory management specifically for the match
+
+If none of these apply, just pass NULL as the context argument of +pcre2_match(), pcre2_dfa_match(), or pcre2_jit_match(). +

+

+A match context is created, copied, and freed by the following functions: +
+
+pcre2_match_context *pcre2_match_context_create( + pcre2_general_context *gcontext); +
+
+pcre2_match_context *pcre2_match_context_copy( + pcre2_match_context *mcontext); +
+
+void pcre2_match_context_free(pcre2_match_context *mcontext); +
+
+A match context is created with default values for its parameters. These can +be changed by calling the following functions, which return 0 on success, or +PCRE2_ERROR_BADDATA if invalid data is detected. +
+
+int pcre2_set_callout(pcre2_match_context *mcontext, + int (*callout_function)(pcre2_callout_block *, void *), + void *callout_data); +
+
+This sets up a callout function for PCRE2 to call at specified points +during a matching operation. Details are given in the +pcre2callout +documentation. +
+
+int pcre2_set_substitute_callout(pcre2_match_context *mcontext, + int (*callout_function)(pcre2_substitute_callout_block *, void *), + void *callout_data); +
+
+This sets up a callout function for PCRE2 to call after each substitution +made by pcre2_substitute(). Details are given in the section entitled +"Creating a new string with substitutions" +below. +
+
+int pcre2_set_substitute_case_callout(pcre2_match_context *mcontext, + PCRE2_SIZE (*callout_function)(PCRE2_SPTR, PCRE2_SIZE, + PCRE2_UCHAR *, PCRE2_SIZE, + int, void *), + void *callout_data); +
+
+This sets up a callout function for PCRE2 to call when performing case +transformations inside pcre2_substitute(). Details are given in the +section entitled "Creating a new string with substitutions" +below. +
+
+int pcre2_set_offset_limit(pcre2_match_context *mcontext, + PCRE2_SIZE value); +
+
+The offset_limit parameter limits how far an unanchored search can +advance in the subject string. The default value is PCRE2_UNSET. The +pcre2_match() and pcre2_dfa_match() functions return +PCRE2_ERROR_NOMATCH if a match with a starting point before or at the given +offset is not found. The pcre2_substitute() function makes no more +substitutions. +

+

+For example, if the pattern /abc/ is matched against "123abc" with an offset +limit less than 3, the result is PCRE2_ERROR_NOMATCH. A match can never be +found if the startoffset argument of pcre2_match(), +pcre2_dfa_match(), or pcre2_substitute() is greater than the offset +limit set in the match context. +

+

+When using this facility, you must set the PCRE2_USE_OFFSET_LIMIT option when +calling pcre2_compile() so that when JIT is in use, different code can be +compiled. If a match is started with a non-default match limit when +PCRE2_USE_OFFSET_LIMIT is not set, an error is generated. +

+

+The offset limit facility can be used to track progress when searching large +subject strings or to limit the extent of global substitutions. See also the +PCRE2_FIRSTLINE option, which requires a match to start before or at the first +newline that follows the start of matching in the subject. If this is set with +an offset limit, a match must occur in the first line and also within the +offset limit. In other words, whichever limit comes first is used. +
+
+int pcre2_set_heap_limit(pcre2_match_context *mcontext, + uint32_t value); +
+
+The heap_limit parameter specifies, in units of kibibytes (1024 bytes), +the maximum amount of heap memory that pcre2_match() may use to hold +backtracking information when running an interpretive match. This limit also +applies to pcre2_dfa_match(), which may use the heap when processing +patterns with a lot of nested pattern recursion or lookarounds or atomic +groups. This limit does not apply to matching with the JIT optimization, which +has its own memory control arrangements (see the +pcre2jit +documentation for more details). If the limit is reached, the negative error +code PCRE2_ERROR_HEAPLIMIT is returned. The default limit can be set when PCRE2 +is built; if it is not, the default is set very large and is essentially +unlimited. +

+

+A value for the heap limit may also be supplied by an item at the start of a +pattern of the form +

+  (*LIMIT_HEAP=ddd)
+
+where ddd is a decimal number. However, such a setting is ignored unless ddd is +less than the limit set by the caller of pcre2_match() or, if no such +limit is set, less than the default. +

+

+The pcre2_match() function always needs some heap memory, so setting a +value of zero guarantees a "heap limit exceeded" error. Details of how +pcre2_match() uses the heap are given in the +pcre2perform +documentation. +

+

+For pcre2_dfa_match(), a vector on the system stack is used when +processing pattern recursions, lookarounds, or atomic groups, and only if this +is not big enough is heap memory used. In this case, setting a value of zero +disables the use of the heap. +
+
+int pcre2_set_match_limit(pcre2_match_context *mcontext, + uint32_t value); +
+
+The match_limit parameter provides a means of preventing PCRE2 from using +up too many computing resources when processing patterns that are not going to +match, but which have a very large number of possibilities in their search +trees. The classic example is a pattern that uses nested unlimited repeats. +

+

+There is an internal counter in pcre2_match() that is incremented each +time round its main matching loop. If this value reaches the match limit, +pcre2_match() returns the negative value PCRE2_ERROR_MATCHLIMIT. This has +the effect of limiting the amount of backtracking that can take place. For +patterns that are not anchored, the count restarts from zero for each position +in the subject string. This limit also applies to pcre2_dfa_match(), +though the counting is done in a different way. +

+

+When pcre2_match() is called with a pattern that was successfully +processed by pcre2_jit_compile(), the way in which matching is executed +is entirely different. However, there is still the possibility of runaway +matching that goes on for a very long time, and so the match_limit value +is also used in this case (but in a different way) to limit how long the +matching can continue. +

+

+The default value for the limit can be set when PCRE2 is built; the default is +10 million, which handles all but the most extreme cases. A value for the match +limit may also be supplied by an item at the start of a pattern of the form +

+  (*LIMIT_MATCH=ddd)
+
+where ddd is a decimal number. However, such a setting is ignored unless ddd is +less than the limit set by the caller of pcre2_match() or +pcre2_dfa_match() or, if no such limit is set, less than the default. +
+
+int pcre2_set_depth_limit(pcre2_match_context *mcontext, + uint32_t value); +
+
+This parameter limits the depth of nested backtracking in pcre2_match(). +Each time a nested backtracking point is passed, a new memory frame is used +to remember the state of matching at that point. Thus, this parameter +indirectly limits the amount of memory that is used in a match. However, +because the size of each memory frame depends on the number of capturing +parentheses, the actual memory limit varies from pattern to pattern. This limit +was more useful in versions before 10.30, where function recursion was used for +backtracking. +

+

+The depth limit is not relevant, and is ignored, when matching is done using +JIT compiled code. However, it is supported by pcre2_dfa_match(), which +uses it to limit the depth of nested internal recursive function calls that +implement atomic groups, lookaround assertions, and pattern recursions. This +limits, indirectly, the amount of system stack that is used. It was more useful +in versions before 10.32, when stack memory was used for local workspace +vectors for recursive function calls. From version 10.32, only local variables +are allocated on the stack and as each call uses only a few hundred bytes, even +a small stack can support quite a lot of recursion. +

+

+If the depth of internal recursive function calls is great enough, local +workspace vectors are allocated on the heap from version 10.32 onwards, so the +depth limit also indirectly limits the amount of heap memory that is used. A +recursive pattern such as /(.(?2))((?1)|)/, when matched to a very long string +using pcre2_dfa_match(), can use a great deal of memory. However, it is +probably better to limit heap usage directly by calling +pcre2_set_heap_limit(). +

+

+The default value for the depth limit can be set when PCRE2 is built; if it is +not, the default is set to the same value as the default for the match limit. +If the limit is exceeded, pcre2_match() or pcre2_dfa_match() +returns PCRE2_ERROR_DEPTHLIMIT. A value for the depth limit may also be +supplied by an item at the start of a pattern of the form +

+  (*LIMIT_DEPTH=ddd)
+
+where ddd is a decimal number. However, such a setting is ignored unless ddd is +less than the limit set by the caller of pcre2_match() or +pcre2_dfa_match() or, if no such limit is set, less than the default. +

+
CHECKING BUILD-TIME OPTIONS
+

+int pcre2_config(uint32_t what, void *where); +

+

+The function pcre2_config() makes it possible for a PCRE2 client to find +the value of certain configuration parameters and to discover which optional +features have been compiled into the PCRE2 library. The +pcre2build +documentation has more details about these features. +

+

+The first argument for pcre2_config() specifies which information is +required. The second argument is a pointer to memory into which the information +is placed. If NULL is passed, the function returns the amount of memory that is +needed for the requested information. For calls that return numerical values, +the value is in bytes; when requesting these values, where should point +to appropriately aligned memory. For calls that return strings, the required +length is given in code units, not counting the terminating zero. +

+

+When requesting information, the returned value from pcre2_config() is +non-negative on success, or the negative error code PCRE2_ERROR_BADOPTION if +the value in the first argument is not recognized. The following information is +available: +

+  PCRE2_CONFIG_BSR
+
+The output is a uint32_t integer whose value indicates what character +sequences the \R escape sequence matches by default. A value of +PCRE2_BSR_UNICODE means that \R matches any Unicode line ending sequence; a +value of PCRE2_BSR_ANYCRLF means that \R matches only CR, LF, or CRLF. The +default can be overridden when a pattern is compiled. +
+  PCRE2_CONFIG_COMPILED_WIDTHS
+
+The output is a uint32_t integer whose lower bits indicate which code unit +widths were selected when PCRE2 was built. The 1-bit indicates 8-bit support, +and the 2-bit and 4-bit indicate 16-bit and 32-bit support, respectively. +
+  PCRE2_CONFIG_DEPTHLIMIT
+
+The output is a uint32_t integer that gives the default limit for the depth of +nested backtracking in pcre2_match() or the depth of nested recursions, +lookarounds, and atomic groups in pcre2_dfa_match(). Further details are +given with pcre2_set_depth_limit() above. +
+  PCRE2_CONFIG_HEAPLIMIT
+
+The output is a uint32_t integer that gives, in kibibytes, the default limit +for the amount of heap memory used by pcre2_match() or +pcre2_dfa_match(). Further details are given with +pcre2_set_heap_limit() above. +
+  PCRE2_CONFIG_JIT
+
+The output is a uint32_t integer that is set to one if support for just-in-time +compiling is included in the library; otherwise it is set to zero. Note that +having the support in the library does not guarantee that JIT will be used for +any given match, and neither does it guarantee that JIT will actually be able +to function, because it may not be able to allocate executable memory in some +environments. There is a special call to pcre2_jit_compile() that can be +used to check this. See the +pcre2jit +documentation for more details. +
+  PCRE2_CONFIG_JITTARGET
+
+The where argument should point to a buffer that is at least 48 code +units long. (The exact length required can be found by calling +pcre2_config() with where set to NULL.) The buffer is filled with a +string that contains the name of the architecture for which the JIT compiler is +configured, for example "x86 32bit (little endian + unaligned)". If JIT support +is not available, PCRE2_ERROR_BADOPTION is returned, otherwise the number of +code units used is returned. This is the length of the string, plus one unit +for the terminating zero. +
+  PCRE2_CONFIG_LINKSIZE
+
+The output is a uint32_t integer that contains the number of bytes used for +internal linkage in compiled regular expressions. When PCRE2 is configured, the +value can be set to 2, 3, or 4, with the default being 2. This is the value +that is returned by pcre2_config(). However, when the 16-bit library is +compiled, a value of 3 is rounded up to 4, and when the 32-bit library is +compiled, internal linkages always use 4 bytes, so the configured value is not +relevant. +

+

+The default value of 2 for the 8-bit and 16-bit libraries is sufficient for all +but the most massive patterns, since it allows the size of the compiled pattern +to be up to 65535 code units. Larger values allow larger regular expressions to +be compiled by those two libraries, but at the expense of slower matching. +

+  PCRE2_CONFIG_MATCHLIMIT
+
+The output is a uint32_t integer that gives the default match limit for +pcre2_match(). Further details are given with +pcre2_set_match_limit() above. +
+  PCRE2_CONFIG_NEWLINE
+
+The output is a uint32_t integer whose value specifies the default character +sequence that is recognized as meaning "newline". The values are: +
+  PCRE2_NEWLINE_CR       Carriage return (CR)
+  PCRE2_NEWLINE_LF       Linefeed (LF)
+  PCRE2_NEWLINE_CRLF     Carriage return, linefeed (CRLF)
+  PCRE2_NEWLINE_ANY      Any Unicode line ending
+  PCRE2_NEWLINE_ANYCRLF  Any of CR, LF, or CRLF
+  PCRE2_NEWLINE_NUL      The NUL character (binary zero)
+
+The default should normally correspond to the standard sequence for your +operating system. +
+  PCRE2_CONFIG_NEVER_BACKSLASH_C
+
+The output is a uint32_t integer that is set to one if the use of \C was +permanently disabled when PCRE2 was built; otherwise it is set to zero. +
+  PCRE2_CONFIG_PARENSLIMIT
+
+The output is a uint32_t integer that gives the maximum depth of nesting +of parentheses (of any kind) in a pattern. This limit is imposed to cap the +amount of system stack used when a pattern is compiled. It is specified when +PCRE2 is built; the default is 250. This limit does not take into account the +stack that may already be used by the calling application. For finer control +over compilation stack usage, see pcre2_set_compile_recursion_guard(). +
+  PCRE2_CONFIG_STACKRECURSE
+
+This parameter is obsolete and should not be used in new code. The output is a +uint32_t integer that is always set to zero. +
+  PCRE2_CONFIG_TABLES_LENGTH
+
+The output is a uint32_t integer that gives the length of PCRE2's character +processing tables in bytes. For details of these tables see the +section on locale support +below. +
+  PCRE2_CONFIG_UNICODE_VERSION
+
+The where argument should point to a buffer that is at least 24 code +units long. (The exact length required can be found by calling +pcre2_config() with where set to NULL.) If PCRE2 has been compiled +without Unicode support, the buffer is filled with the text "Unicode not +supported". Otherwise, the Unicode version string (for example, "8.0.0") is +inserted. The number of code units used is returned. This is the length of the +string plus one unit for the terminating zero. +
+  PCRE2_CONFIG_UNICODE
+
+The output is a uint32_t integer that is set to one if Unicode support is +available; otherwise it is set to zero. Unicode support implies UTF support. +
+  PCRE2_CONFIG_VERSION
+
+The where argument should point to a buffer that is at least 24 code +units long. (The exact length required can be found by calling +pcre2_config() with where set to NULL.) The buffer is filled with +the PCRE2 version string, zero-terminated. The number of code units used is +returned. This is the length of the string plus one unit for the terminating +zero. +

+
COMPILING A PATTERN
+

+pcre2_code *pcre2_compile(PCRE2_SPTR pattern, PCRE2_SIZE length, + uint32_t options, int *errorcode, PCRE2_SIZE *erroroffset, + pcre2_compile_context *ccontext); +
+
+void pcre2_code_free(pcre2_code *code); +
+
+pcre2_code *pcre2_code_copy(const pcre2_code *code); +
+
+pcre2_code *pcre2_code_copy_with_tables(const pcre2_code *code); +

+

+The pcre2_compile() function compiles a pattern into an internal form. +The pattern is defined by a pointer to a string of code units and a length in +code units. If the pattern is zero-terminated, the length can be specified as +PCRE2_ZERO_TERMINATED. A NULL pattern pointer with a length of zero is treated +as an empty string (NULL with a non-zero length causes an error return). The +function returns a pointer to a block of memory that contains the compiled +pattern and related data, or NULL if an error occurred. +

+

+If the compile context argument ccontext is NULL, memory for the compiled +pattern is obtained by calling malloc(). Otherwise, it is obtained from +the same memory function that was used for the compile context. The caller must +free the memory by calling pcre2_code_free() when it is no longer needed. +If pcre2_code_free() is called with a NULL argument, it returns +immediately, without doing anything. +

+

+The function pcre2_code_copy() makes a copy of the compiled code in new +memory, using the same memory allocator as was used for the original. However, +if the code has been processed by the JIT compiler (see +below), +the JIT information cannot be copied (because it is position-dependent). +The new copy can initially be used only for non-JIT matching, though it can be +passed to pcre2_jit_compile() if required. If pcre2_code_copy() is +called with a NULL argument, it returns NULL. +

+

+The pcre2_code_copy() function provides a way for individual threads in a +multithreaded application to acquire a private copy of shared compiled code. +However, it does not make a copy of the character tables used by the compiled +pattern; the new pattern code points to the same tables as the original code. +(See +"Locale Support" +below for details of these character tables.) In many applications the same +tables are used throughout, so this behaviour is appropriate. Nevertheless, +there are occasions when a copy of a compiled pattern and the relevant tables +are needed. The pcre2_code_copy_with_tables() provides this facility. +Copies of both the code and the tables are made, with the new code pointing to +the new tables. The memory for the new tables is automatically freed when +pcre2_code_free() is called for the new copy of the compiled code. If +pcre2_code_copy_with_tables() is called with a NULL argument, it returns +NULL. +

+

+NOTE: When one of the matching functions is called, pointers to the compiled +pattern and the subject string are set in the match data block so that they can +be referenced by the substring extraction functions after a successful match. +After running a match, you must not free a compiled pattern or a subject string +until after all operations on the +match data block +have taken place, unless, in the case of the subject string, you have used the +PCRE2_COPY_MATCHED_SUBJECT option, which is described in the section entitled +"Option bits for pcre2_match()" +below. +

+

+The options argument for pcre2_compile() contains various bit +settings that affect the compilation. It should be zero if none of them are +required. The available options are described below. Some of them (in +particular, those that are compatible with Perl, but some others as well) can +also be set and unset from within the pattern (see the detailed description in +the +pcre2pattern +documentation). +

+

+For those options that can be different in different parts of the pattern, the +contents of the options argument specifies their settings at the start of +compilation. The PCRE2_ANCHORED, PCRE2_ENDANCHORED, and PCRE2_NO_UTF_CHECK +options can be set at the time of matching as well as at compile time. +

+

+Some additional options and less frequently required compile-time parameters +(for example, the newline setting) can be provided in a compile context (as +described +above). +

+

+If errorcode or erroroffset is NULL, pcre2_compile() returns +NULL immediately. Otherwise, the variables to which these point are set to an +error code and an offset (number of code units) within the pattern, +respectively, when pcre2_compile() returns NULL because a compilation +error has occurred. +

+

+There are over 100 positive error codes that pcre2_compile() may return +if it finds an error in the pattern. There are also some negative error codes +that are used for invalid UTF strings when validity checking is in force. These +are the same as given by pcre2_match() and pcre2_dfa_match(), and +are described in the +pcre2unicode +documentation. There is no separate documentation for the positive error codes, +because the textual error messages that are obtained by calling the +pcre2_get_error_message() function (see "Obtaining a textual error +message" +below) +should be self-explanatory. Macro names starting with PCRE2_ERROR_ are defined +for both positive and negative error codes in pcre2.h. When compilation +is successful errorcode is set to a value that returns the message "no +error" if passed to pcre2_get_error_message(). +

+

+The value returned in erroroffset is an indication of where in the +pattern an error occurred. When there is no error, zero is returned. A non-zero +value is not necessarily the furthest point in the pattern that was read. For +example, after the error "lookbehind assertion is not fixed length", the error +offset points to the start of the failing assertion. For an invalid UTF-8 or +UTF-16 string, the offset is that of the first code unit of the failing +character. +

+

+Some errors are not detected until the whole pattern has been scanned; in these +cases, the offset passed back is the length of the pattern. Note that the +offset is in code units, not characters, even in a UTF mode. It may sometimes +point into the middle of a UTF-8 or UTF-16 character. +

+

+This code fragment shows a typical straightforward call to +pcre2_compile(): +

+  pcre2_code *re;
+  PCRE2_SIZE erroffset;
+  int errorcode;
+  re = pcre2_compile(
+    "^A.*Z",                /* the pattern */
+    PCRE2_ZERO_TERMINATED,  /* the pattern is zero-terminated */
+    0,                      /* default options */
+    &errorcode,             /* for error code */
+    &erroffset,             /* for error offset */
+    NULL);                  /* no compile context */
+
+
+

+
+Main compile options +
+

+The following names for option bits are defined in the pcre2.h header +file: +

+  PCRE2_ANCHORED
+
+If this bit is set, the pattern is forced to be "anchored", that is, it is +constrained to match only at the first matching point in the string that is +being searched (the "subject string"). This effect can also be achieved by +appropriate constructs in the pattern itself, which is the only way to do it in +Perl. +
+  PCRE2_ALLOW_EMPTY_CLASS
+
+By default, for compatibility with Perl, a closing square bracket that +immediately follows an opening one is treated as a data character for the +class. When PCRE2_ALLOW_EMPTY_CLASS is set, it terminates the class, which +therefore contains no characters and so can never match. +
+  PCRE2_ALT_BSUX
+
+This option request alternative handling of three escape sequences, which +makes PCRE2's behaviour more like ECMAscript (aka JavaScript). When it is set: +

+

+(1) \U matches an upper case "U" character; by default \U causes a compile +time error (Perl uses \U to upper case subsequent characters). +

+

+(2) \u matches a lower case "u" character unless it is followed by four +hexadecimal digits, in which case the hexadecimal number defines the code point +to match. By default, \u causes a compile time error (Perl uses it to upper +case the following character). +

+

+(3) \x matches a lower case "x" character unless it is followed by two +hexadecimal digits, in which case the hexadecimal number defines the code point +to match. By default, as in Perl, a hexadecimal number is always expected after +\x, but it may have zero, one, or two digits (so, for example, \xz matches a +binary zero character followed by z). +

+

+ECMAscript 6 added additional functionality to \u. This can be accessed using +the PCRE2_EXTRA_ALT_BSUX extra option (see "Extra compile options" +below). +Note that this alternative escape handling applies only to patterns. Neither of +these options affects the processing of replacement strings passed to +pcre2_substitute(). +

+  PCRE2_ALT_CIRCUMFLEX
+
+In multiline mode (when PCRE2_MULTILINE is set), the circumflex metacharacter +matches at the start of the subject (unless PCRE2_NOTBOL is set), and also +after any internal newline. However, it does not match after a newline at the +end of the subject, for compatibility with Perl. If you want a multiline +circumflex also to match after a terminating newline, you must set +PCRE2_ALT_CIRCUMFLEX. +
+  PCRE2_ALT_EXTENDED_CLASS
+
+Alters the parsing of character classes to follow the extended syntax +described by Unicode UTS#18. The PCRE2_ALT_EXTENDED_CLASS option has no impact +on the behaviour of the Perl-specific "(?[...])" syntax for extended classes, +but instead enables the alternative syntax of extended class behaviour inside +ordinary "[...]" character classes. See the +pcre2pattern +documentation for details of the character classes supported. +
+  PCRE2_ALT_VERBNAMES
+
+By default, for compatibility with Perl, the name in any verb sequence such as +(*MARK:NAME) is any sequence of characters that does not include a closing +parenthesis. The name is not processed in any way, and it is not possible to +include a closing parenthesis in the name. However, if the PCRE2_ALT_VERBNAMES +option is set, normal backslash processing is applied to verb names and only an +unescaped closing parenthesis terminates the name. A closing parenthesis can be +included in a name either as \) or between \Q and \E. If the PCRE2_EXTENDED +or PCRE2_EXTENDED_MORE option is set with PCRE2_ALT_VERBNAMES, unescaped +whitespace in verb names is skipped and #-comments are recognized, exactly as +in the rest of the pattern. +
+  PCRE2_AUTO_CALLOUT
+
+If this bit is set, pcre2_compile() automatically inserts callout items, +all with number 255, before each pattern item, except immediately before or +after an explicit callout in the pattern. For discussion of the callout +facility, see the +pcre2callout +documentation. +
+  PCRE2_CASELESS
+
+If this bit is set, letters in the pattern match both upper and lower case +letters in the subject. It is equivalent to Perl's /i option, and it can be +changed within a pattern by a (?i) option setting. If either PCRE2_UTF or +PCRE2_UCP is set, Unicode properties are used for all characters with more than +one other case, and for all characters whose code points are greater than +U+007F. +

+

+Note that there are two ASCII characters, K and S, that, in addition to +their lower case ASCII equivalents, are case-equivalent with U+212A (Kelvin +sign) and U+017F (long S) respectively. If you do not want this case +equivalence, you can suppress it by setting PCRE2_EXTRA_CASELESS_RESTRICT. +

+

+One language family, Turkish and Azeri, has its own case-insensitivity rules, +which can be selected by setting PCRE2_EXTRA_TURKISH_CASING. This alters the +behaviour of the 'i', 'I', U+0130 (capital I with dot above), and U+0131 +(small dotless i) characters. +

+

+For lower valued characters with only one other case, a lookup table is used +for speed. When neither PCRE2_UTF nor PCRE2_UCP is set, a lookup table is used +for all code points less than 256, and higher code points (available only in +16-bit or 32-bit mode) are treated as not having another case. +

+

+From release 10.45 PCRE2_CASELESS also affects what some of the letter-related +Unicode property escapes (\p and \P) match. The properties Lu (upper case +letter), Ll (lower case letter), and Lt (title case letter) are all treated as +LC (cased letter) when PCRE2_CASELESS is set. +

+  PCRE2_DOLLAR_ENDONLY
+
+If this bit is set, a dollar metacharacter in the pattern matches only at the +end of the subject string. Without this option, a dollar also matches +immediately before a newline at the end of the string (but not before any other +newlines). The PCRE2_DOLLAR_ENDONLY option is ignored if PCRE2_MULTILINE is +set. There is no equivalent to this option in Perl, and no way to set it within +a pattern. +
+  PCRE2_DOTALL
+
+If this bit is set, a dot metacharacter in the pattern matches any character, +including one that indicates a newline. However, it only ever matches one +character, even if newlines are coded as CRLF. Without this option, a dot does +not match when the current position in the subject is at a newline. This option +is equivalent to Perl's /s option, and it can be changed within a pattern by a +(?s) option setting. A negative class such as [^a] always matches newline +characters, and the \N escape sequence always matches a non-newline character, +independent of the setting of PCRE2_DOTALL. +
+  PCRE2_DUPNAMES
+
+If this bit is set, names used to identify capture groups need not be unique. +This can be helpful for certain types of pattern when it is known that only one +instance of the named group can ever be matched. There are more details of +named capture groups below; see also the +pcre2pattern +documentation. +
+  PCRE2_ENDANCHORED
+
+If this bit is set, the end of any pattern match must be right at the end of +the string being searched (the "subject string"). If the pattern match +succeeds by reaching (*ACCEPT), but does not reach the end of the subject, the +match fails at the current starting point. For unanchored patterns, a new match +is then tried at the next starting point. However, if the match succeeds by +reaching the end of the pattern, but not the end of the subject, backtracking +occurs and an alternative match may be found. Consider these two patterns: +
+  .(*ACCEPT)|..
+  .|..
+
+If matched against "abc" with PCRE2_ENDANCHORED set, the first matches "c" +whereas the second matches "bc". The effect of PCRE2_ENDANCHORED can also be +achieved by appropriate constructs in the pattern itself, which is the only way +to do it in Perl. +

+

+For DFA matching with pcre2_dfa_match(), PCRE2_ENDANCHORED applies only +to the first (that is, the longest) matched string. Other parallel matches, +which are necessarily substrings of the first one, must obviously end before +the end of the subject. +

+  PCRE2_EXTENDED
+
+If this bit is set, most white space characters in the pattern are totally +ignored except when escaped, inside a character class, or inside a \Q...\E +sequence. However, white space is not allowed within sequences such as (?> that +introduce various parenthesized groups, nor within numerical quantifiers such +as {1,3}. Ignorable white space is permitted between an item and a following +quantifier and between a quantifier and a following + that indicates +possessiveness. PCRE2_EXTENDED is equivalent to Perl's /x option, and it can be +changed within a pattern by a (?x) option setting. +

+

+When PCRE2 is compiled without Unicode support, PCRE2_EXTENDED recognizes as +white space only those characters with code points less than 256 that are +flagged as white space in its low-character table. The table is normally +created by +pcre2_maketables(), +which uses the isspace() function to identify space characters. In most +ASCII environments, the relevant characters are those with code points 0x0009 +(tab), 0x000A (linefeed), 0x000B (vertical tab), 0x000C (formfeed), 0x000D +(carriage return), and 0x0020 (space). +

+

+When PCRE2 is compiled with Unicode support, in addition to these characters, +five more Unicode "Pattern White Space" characters are recognized by +PCRE2_EXTENDED. These are U+0085 (next line), U+200E (left-to-right mark), +U+200F (right-to-left mark), U+2028 (line separator), and U+2029 (paragraph +separator). This set of characters is the same as recognized by Perl's /x +option. Note that the horizontal and vertical space characters that are matched +by the \h and \v escapes in patterns are a much bigger set. +

+

+As well as ignoring most white space, PCRE2_EXTENDED also causes characters +between an unescaped # outside a character class and the next newline, +inclusive, to be ignored, which makes it possible to include comments inside +complicated patterns. Note that the end of this type of comment is a literal +newline sequence in the pattern; escape sequences that happen to represent a +newline do not count. +

+

+Which characters are interpreted as newlines can be specified by a setting in +the compile context that is passed to pcre2_compile() or by a special +sequence at the start of the pattern, as described in the section entitled +"Newline conventions" +in the pcre2pattern documentation. A default is defined when PCRE2 is +built. +

+  PCRE2_EXTENDED_MORE
+
+This option has the effect of PCRE2_EXTENDED, but, in addition, unescaped space +and horizontal tab characters are ignored inside a character class. Note: only +these two characters are ignored, not the full set of pattern white space +characters that are ignored outside a character class. PCRE2_EXTENDED_MORE is +equivalent to Perl's /xx option, and it can be changed within a pattern by a +(?xx) option setting. +
+  PCRE2_FIRSTLINE
+
+If this option is set, the start of an unanchored pattern match must be before +or at the first newline in the subject string following the start of matching, +though the matched text may continue over the newline. If startoffset is +non-zero, the limiting newline is not necessarily the first newline in the +subject. For example, if the subject string is "abc\nxyz" (where \n +represents a single-character newline) a pattern match for "yz" succeeds with +PCRE2_FIRSTLINE if startoffset is greater than 3. See also +PCRE2_USE_OFFSET_LIMIT, which provides a more general limiting facility. If +PCRE2_FIRSTLINE is set with an offset limit, a match must occur in the first +line and also within the offset limit. In other words, whichever limit comes +first is used. This option has no effect for anchored patterns. +
+  PCRE2_LITERAL
+
+If this option is set, all meta-characters in the pattern are disabled, and it +is treated as a literal string. Matching literal strings with a regular +expression engine is not the most efficient way of doing it. If you are doing a +lot of literal matching and are worried about efficiency, you should consider +using other approaches. The only other main options that are allowed with +PCRE2_LITERAL are: PCRE2_ANCHORED, PCRE2_ENDANCHORED, PCRE2_AUTO_CALLOUT, +PCRE2_CASELESS, PCRE2_FIRSTLINE, PCRE2_MATCH_INVALID_UTF, +PCRE2_NO_START_OPTIMIZE, PCRE2_NO_UTF_CHECK, PCRE2_UTF, and +PCRE2_USE_OFFSET_LIMIT. The extra options PCRE2_EXTRA_MATCH_LINE and +PCRE2_EXTRA_MATCH_WORD are also supported. Any other options cause an error. +
+  PCRE2_MATCH_INVALID_UTF
+
+This option forces PCRE2_UTF (see below) and also enables support for matching +by pcre2_match() in subject strings that contain invalid UTF sequences. +Note, however, that the 16-bit and 32-bit PCRE2 libraries process strings as +sequences of uint16_t or uint32_t code points. They cannot find valid UTF +sequences within an arbitrary string of bytes unless such sequences are +suitably aligned. This facility is not supported for DFA matching. For details, +see the +pcre2unicode +documentation. +
+  PCRE2_MATCH_UNSET_BACKREF
+
+If this option is set, a backreference to an unset capture group matches an +empty string (by default this causes the current matching alternative to fail). +A pattern such as (\1)(a) succeeds when this option is set (assuming it can +find an "a" in the subject), whereas it fails by default, for Perl +compatibility. Setting this option makes PCRE2 behave more like ECMAscript (aka +JavaScript). +
+  PCRE2_MULTILINE
+
+By default, for the purposes of matching "start of line" and "end of line", +PCRE2 treats the subject string as consisting of a single line of characters, +even if it actually contains newlines. The "start of line" metacharacter (^) +matches only at the start of the string, and the "end of line" metacharacter +($) matches only at the end of the string, or before a terminating newline +(except when PCRE2_DOLLAR_ENDONLY is set). Note, however, that unless +PCRE2_DOTALL is set, the "any character" metacharacter (.) does not match at a +newline. This behaviour (for ^, $, and dot) is the same as Perl. +

+

+When PCRE2_MULTILINE it is set, the "start of line" and "end of line" +constructs match immediately following or immediately before internal newlines +in the subject string, respectively, as well as at the very start and end. This +is equivalent to Perl's /m option, and it can be changed within a pattern by a +(?m) option setting. Note that the "start of line" metacharacter does not match +after a newline at the end of the subject, for compatibility with Perl. +However, you can change this by setting the PCRE2_ALT_CIRCUMFLEX option. If +there are no newlines in a subject string, or no occurrences of ^ or $ in a +pattern, setting PCRE2_MULTILINE has no effect. +

+  PCRE2_NEVER_BACKSLASH_C
+
+This option locks out the use of \C in the pattern that is being compiled. +This escape can cause unpredictable behaviour in UTF-8 or UTF-16 modes, because +it may leave the current matching point in the middle of a multi-code-unit +character. This option may be useful in applications that process patterns from +external sources. Note that there is also a build-time option that permanently +locks out the use of \C. +
+  PCRE2_NEVER_UCP
+
+This option locks out the use of Unicode properties for handling \B, \b, \D, +\d, \S, \s, \W, \w, and some of the POSIX character classes, as described +for the PCRE2_UCP option below. In particular, it prevents the creator of the +pattern from enabling this facility by starting the pattern with (*UCP). This +option may be useful in applications that process patterns from external +sources. The option combination PCRE2_UCP and PCRE2_NEVER_UCP causes an error. +
+  PCRE2_NEVER_UTF
+
+This option locks out interpretation of the pattern as UTF-8, UTF-16, or +UTF-32, depending on which library is in use. In particular, it prevents the +creator of the pattern from switching to UTF interpretation by starting the +pattern with (*UTF). This option may be useful in applications that process +patterns from external sources. The combination of PCRE2_UTF and +PCRE2_NEVER_UTF causes an error. +
+  PCRE2_NO_AUTO_CAPTURE
+
+If this option is set, it disables the use of numbered capturing parentheses in +the pattern. Any opening parenthesis that is not followed by ? behaves as if it +were followed by ?: but named parentheses can still be used for capturing (and +they acquire numbers in the usual way). This is the same as Perl's /n option. +Note that, when this option is set, references to capture groups +(backreferences or recursion/subroutine calls) may only refer to named groups, +though the reference can be by name or by number. +
+  PCRE2_NO_AUTO_POSSESS
+
+If this (deprecated) option is set, it disables "auto-possessification", which +is an optimization that, for example, turns a+b into a++b in order to avoid +backtracks into a+ that can never be successful. However, if callouts are in +use, auto-possessification means that some callouts are never taken. You can +set this option if you want the matching functions to do a full unoptimized +search and run all the callouts, but it is mainly provided for testing +purposes. +

+

+If a compile context is available, it is recommended to use +pcre2_set_optimize() with the directive PCRE2_AUTO_POSSESS_OFF rather +than the compile option PCRE2_NO_AUTO_POSSESS. Note that PCRE2_NO_AUTO_POSSESS +takes precedence over the pcre2_set_optimize() optimization directives +PCRE2_AUTO_POSSESS and PCRE2_AUTO_POSSESS_OFF. +

+  PCRE2_NO_DOTSTAR_ANCHOR
+
+If this (deprecated) option is set, it disables an optimization that is applied +when .* is the first significant item in a top-level branch of a pattern, and +all the other branches also start with .* or with \A or \G or ^. The +optimization is automatically disabled for .* if it is inside an atomic group +or a capture group that is the subject of a backreference, or if the pattern +contains (*PRUNE) or (*SKIP). When the optimization is not disabled, such a +pattern is automatically anchored if PCRE2_DOTALL is set for all the .* items +and PCRE2_MULTILINE is not set for any ^ items. Otherwise, the fact that any +match must start either at the start of the subject or following a newline is +remembered. Like other optimizations, this can cause callouts to be skipped. +(If a compile context is available, it is recommended to use +pcre2_set_optimize() with the directive PCRE2_DOTSTAR_ANCHOR_OFF +instead.) +
+  PCRE2_NO_START_OPTIMIZE
+
+This is an option whose main effect is at matching time. It does not change +what pcre2_compile() generates, but it does affect the output of the JIT +compiler. Setting this option is equivalent to calling pcre2_set_optimize() +with the directive parameter set to PCRE2_START_OPTIMIZE_OFF. +

+

+There are a number of optimizations that may occur at the start of a match, in +order to speed up the process. For example, if it is known that an unanchored +match must start with a specific code unit value, the matching code searches +the subject for that value, and fails immediately if it cannot find it, without +actually running the main matching function. The start-up optimizations are +in effect a pre-scan of the subject that takes place before the pattern is run. +

+

+Disabling the start-up optimizations may cause performance to suffer. However, +this may be desirable for patterns which contain callouts or items such as +(*COMMIT) and (*MARK). See the above description of PCRE2_START_OPTIMIZE_OFF +for further details. +

+  PCRE2_NO_UTF_CHECK
+
+When PCRE2_UTF is set, the validity of the pattern as a UTF string is +automatically checked. There are discussions about the validity of +UTF-8 strings, +UTF-16 strings, +and +UTF-32 strings +in the +pcre2unicode +document. If an invalid UTF sequence is found, pcre2_compile() returns a +negative error code. +

+

+If you know that your pattern is a valid UTF string, and you want to skip this +check for performance reasons, you can set the PCRE2_NO_UTF_CHECK option. When +it is set, the effect of passing an invalid UTF string as a pattern is +undefined. It may cause your program to crash or loop. +

+

+Note that this option can also be passed to pcre2_match() and +pcre2_dfa_match(), to suppress UTF validity checking of the subject +string. +

+

+Note also that setting PCRE2_NO_UTF_CHECK at compile time does not disable the +error that is given if an escape sequence for an invalid Unicode code point is +encountered in the pattern. In particular, the so-called "surrogate" code +points (0xd800 to 0xdfff) are invalid. If you want to allow escape sequences +such as \x{d800} you can set the PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES extra +option, as described in the section entitled "Extra compile options" +below. +However, this is possible only in UTF-8 and UTF-32 modes, because these values +are not representable in UTF-16. +

+  PCRE2_UCP
+
+This option has two effects. Firstly, it change the way PCRE2 processes \B, +\b, \D, \d, \S, \s, \W, \w, and some of the POSIX character classes. By +default, only ASCII characters are recognized, but if PCRE2_UCP is set, Unicode +properties are used to classify characters. There are some PCRE2_EXTRA +options (see below) that add finer control to this behaviour. More details are +given in the section on +generic character types +in the +pcre2pattern +page. +

+

+The second effect of PCRE2_UCP is to force the use of Unicode properties for +upper/lower casing operations, even when PCRE2_UTF is not set. This makes it +possible to process strings in the 16-bit UCS-2 code. This option is available +only if PCRE2 has been compiled with Unicode support (which is the default). +

+

+The PCRE2_EXTRA_CASELESS_RESTRICT option (see above) restricts caseless +matching such that ASCII characters match only ASCII characters and non-ASCII +characters match only non-ASCII characters. The PCRE2_EXTRA_TURKISH_CASING option +(see above) alters the matching of the 'i' characters to follow their behaviour +in Turkish and Azeri languages. For further details on +PCRE2_EXTRA_CASELESS_RESTRICT and PCRE2_EXTRA_TURKISH_CASING, see the +pcre2unicode +page. +

+  PCRE2_UNGREEDY
+
+This option inverts the "greediness" of the quantifiers so that they are not +greedy by default, but become greedy if followed by "?". It is not compatible +with Perl. It can also be set by a (?U) option setting within the pattern. +
+  PCRE2_USE_OFFSET_LIMIT
+
+This option must be set for pcre2_compile() if +pcre2_set_offset_limit() is going to be used to set a non-default offset +limit in a match context for matches that use this pattern. An error is +generated if an offset limit is set without this option. For more details, see +the description of pcre2_set_offset_limit() in the +section +that describes match contexts. See also the PCRE2_FIRSTLINE +option above. +
+  PCRE2_UTF
+
+This option causes PCRE2 to regard both the pattern and the subject strings +that are subsequently processed as strings of UTF characters instead of +single-code-unit strings. It is available when PCRE2 is built to include +Unicode support (which is the default). If Unicode support is not available, +the use of this option provokes an error. Details of how PCRE2_UTF changes the +behaviour of PCRE2 are given in the +pcre2unicode +page. In particular, note that it changes the way PCRE2_CASELESS works. +

+
+Extra compile options +
+

+The option bits that can be set in a compile context by calling the +pcre2_set_compile_extra_options() function are as follows: +

+  PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK
+
+Since release 10.38 PCRE2 has forbidden the use of \K within lookaround +assertions, following Perl's lead. This option is provided to re-enable the +previous behaviour (act in positive lookarounds, ignore in negative ones) in +case anybody is relying on it. +
+  PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES
+
+This option applies when compiling a pattern in UTF-8 or UTF-32 mode. It is +forbidden in UTF-16 mode, and ignored in non-UTF modes. Unicode "surrogate" +code points in the range 0xd800 to 0xdfff are used in pairs in UTF-16 to encode +code points with values in the range 0x10000 to 0x10ffff. The surrogates cannot +therefore be represented in UTF-16. They can be represented in UTF-8 and +UTF-32, but are defined as invalid code points, and cause errors if encountered +in a UTF-8 or UTF-32 string that is being checked for validity by PCRE2. +

+

+These values also cause errors if encountered in escape sequences such as +\x{d912} within a pattern. However, it seems that some applications, when +using PCRE2 to check for unwanted characters in UTF-8 strings, explicitly test +for the surrogates using escape sequences. The PCRE2_NO_UTF_CHECK option does +not disable the error that occurs, because it applies only to the testing of +input strings for UTF validity. +

+

+If the extra option PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES is set, surrogate code +point values in UTF-8 and UTF-32 patterns no longer provoke errors and are +incorporated in the compiled pattern. However, they can only match subject +characters if the matching function is called with PCRE2_NO_UTF_CHECK set. +

+  PCRE2_EXTRA_ALT_BSUX
+
+The original option PCRE2_ALT_BSUX causes PCRE2 to process \U, \u, and \x in +the way that ECMAscript (aka JavaScript) does. Additional functionality was +defined by ECMAscript 6; setting PCRE2_EXTRA_ALT_BSUX has the effect of +PCRE2_ALT_BSUX, but in addition it recognizes \u{hhh..} as a hexadecimal +character code, where hhh.. is any number of hexadecimal digits. +
+  PCRE2_EXTRA_ASCII_BSD
+
+This option forces \d to match only ASCII digits, even when PCRE2_UCP is set. +It can be changed within a pattern by means of the (?aD) option setting. +
+  PCRE2_EXTRA_ASCII_BSS
+
+This option forces \s to match only ASCII space characters, even when +PCRE2_UCP is set. It can be changed within a pattern by means of the (?aS) +option setting. +
+  PCRE2_EXTRA_ASCII_BSW
+
+This option forces \w to match only ASCII word characters, even when PCRE2_UCP +is set. It can be changed within a pattern by means of the (?aW) option +setting. +
+  PCRE2_EXTRA_ASCII_DIGIT
+
+This option forces the POSIX character classes [:digit:] and [:xdigit:] to +match only ASCII digits, even when PCRE2_UCP is set. It can be changed within +a pattern by means of the (?aT) option setting. +
+  PCRE2_EXTRA_ASCII_POSIX
+
+This option forces all the POSIX character classes, including [:digit:] and +[:xdigit:], to match only ASCII characters, even when PCRE2_UCP is set. It can +be changed within a pattern by means of the (?aP) option setting, but note that +this also sets PCRE2_EXTRA_ASCII_DIGIT in order to ensure that (?-aP) unsets +all ASCII restrictions for POSIX classes. +
+  PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL
+
+This is a dangerous option. Use with care. By default, an unrecognized escape +such as \j or a malformed one such as \x{2z} causes a compile-time error when +detected by pcre2_compile(). Perl is somewhat inconsistent in handling +such items: for example, \j is treated as a literal "j", and non-hexadecimal +digits in \x{} are just ignored, though warnings are given in both cases if +Perl's warning switch is enabled. However, a malformed octal number after \o{ +always causes an error in Perl. +

+

+If the PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL extra option is passed to +pcre2_compile(), all unrecognized or malformed escape sequences are +treated as single-character escapes. For example, \j is a literal "j" and +\x{2z} is treated as the literal string "x{2z}". Setting this option means +that typos in patterns may go undetected and have unexpected results. Also note +that a sequence such as [\N{] is interpreted as a malformed attempt at +[\N{...}] and so is treated as [N{] whereas [\N] gives an error because an +unqualified \N is a valid escape sequence but is not supported in a character +class. To reiterate: this is a dangerous option. Use with great care. +

+  PCRE2_EXTRA_CASELESS_RESTRICT
+
+When either PCRE2_UCP or PCRE2_UTF is set, caseless matching follows Unicode +rules, which allow for more than two cases per character. There are two +case-equivalent character sets that contain both ASCII and non-ASCII +characters. The ASCII letter S is case-equivalent to U+017f (long S) and the +ASCII letter K is case-equivalent to U+212a (Kelvin sign). This option disables +recognition of case-equivalences that cross the ASCII/non-ASCII boundary. In a +caseless match, both characters must either be ASCII or non-ASCII. The option +can be changed within a pattern by the (*CASELESS_RESTRICT) or (?r) option +settings. +
+  PCRE2_EXTRA_ESCAPED_CR_IS_LF
+
+There are some legacy applications where the escape sequence \r in a pattern +is expected to match a newline. If this option is set, \r in a pattern is +converted to \n so that it matches a LF (linefeed) instead of a CR (carriage +return) character. The option does not affect a literal CR in the pattern, nor +does it affect CR specified as an explicit code point such as \x{0D}. +
+  PCRE2_EXTRA_MATCH_LINE
+
+This option is provided for use by the -x option of pcre2grep. It +causes the pattern only to match complete lines. This is achieved by +automatically inserting the code for "^(?:" at the start of the compiled +pattern and ")$" at the end. Thus, when PCRE2_MULTILINE is set, the matched +line may be in the middle of the subject string. This option can be used with +PCRE2_LITERAL. +
+  PCRE2_EXTRA_MATCH_WORD
+
+This option is provided for use by the -w option of pcre2grep. It +causes the pattern only to match strings that have a word boundary at the start +and the end. This is achieved by automatically inserting the code for "\b(?:" +at the start of the compiled pattern and ")\b" at the end. The option may be +used with PCRE2_LITERAL. However, it is ignored if PCRE2_EXTRA_MATCH_LINE is +also set. +
+  PCRE2_EXTRA_NO_BS0
+
+If this option is set (note that its final character is the digit 0) it locks +out the use of the sequence \0 unless at least one more octal digit follows. +
+  PCRE2_EXTRA_PYTHON_OCTAL
+
+If this option is set, PCRE2 follows Python's rules for interpreting octal +escape sequences. The rules for handling sequences such as \14, which could +be an octal number or a back reference are different. Details are given in the +pcre2pattern +documentation. +
+  PCRE2_EXTRA_NEVER_CALLOUT
+
+If this option is set, PCRE2 treats callouts in the pattern as a syntax error, +returning PCRE2_ERROR_CALLOUT_CALLER_DISABLED. This is useful if the application +knows that a callout will not be provided to pcre2_match(), so that +callouts in the pattern are not silently ignored. +
+  PCRE2_EXTRA_TURKISH_CASING
+
+This option alters case-equivalence of the 'i' letters to follow the +alphabet used by Turkish and Azeri languages. The option can be changed within +a pattern by the (*TURKISH_CASING) start-of-pattern setting. Either the UTF or +UCP options must be set. In the 8-bit library, UTF must be set. This option +cannot be combined with PCRE2_EXTRA_CASELESS_RESTRICT. +

+
JUST-IN-TIME (JIT) COMPILATION
+

+int pcre2_jit_compile(pcre2_code *code, uint32_t options); +
+
+int pcre2_jit_match(const pcre2_code *code, PCRE2_SPTR subject, + PCRE2_SIZE length, PCRE2_SIZE startoffset, + uint32_t options, pcre2_match_data *match_data, + pcre2_match_context *mcontext); +
+
+void pcre2_jit_free_unused_memory(pcre2_general_context *gcontext); +
+
+pcre2_jit_stack *pcre2_jit_stack_create(size_t startsize, + size_t maxsize, pcre2_general_context *gcontext); +
+
+void pcre2_jit_stack_assign(pcre2_match_context *mcontext, + pcre2_jit_callback callback_function, void *callback_data); +
+
+void pcre2_jit_stack_free(pcre2_jit_stack *jit_stack); +

+

+These functions provide support for JIT compilation, which, if the just-in-time +compiler is available, further processes a compiled pattern into machine code +that executes much faster than the pcre2_match() interpretive matching +function. Full details are given in the +pcre2jit +documentation. +

+

+JIT compilation is a heavyweight optimization. It can take some time for +patterns to be analyzed, and for one-off matches and simple patterns the +benefit of faster execution might be offset by a much slower compilation time. +Most (but not all) patterns can be optimized by the JIT compiler. +

+
LOCALE SUPPORT
+

+const uint8_t *pcre2_maketables(pcre2_general_context *gcontext); +
+
+void pcre2_maketables_free(pcre2_general_context *gcontext, + const uint8_t *tables); +

+

+PCRE2 handles caseless matching, and determines whether characters are letters, +digits, or whatever, by reference to a set of tables, indexed by character code +point. However, this applies only to characters whose code points are less than +256. By default, higher-valued code points never match escapes such as \w or +\d. +

+

+When PCRE2 is built with Unicode support (the default), certain Unicode +character properties can be tested with \p and \P, or, alternatively, the +PCRE2_UCP option can be set when a pattern is compiled; this causes \w and +friends to use Unicode property support instead of the built-in tables. +PCRE2_UCP also causes upper/lower casing operations on characters with code +points greater than 127 to use Unicode properties. These effects apply even +when PCRE2_UTF is not set. There are, however, some PCRE2_EXTRA options (see +above) that can be used to modify or suppress them. +

+

+The use of locales with Unicode is discouraged. If you are handling characters +with code points greater than 127, you should either use Unicode support, or +use locales, but not try to mix the two. +

+

+PCRE2 contains a built-in set of character tables that are used by default. +These are sufficient for many applications. Normally, the internal tables +recognize only ASCII characters. However, when PCRE2 is built, it is possible +to cause the internal tables to be rebuilt in the default "C" locale of the +local system, which may cause them to be different. +

+

+The built-in tables can be overridden by tables supplied by the application +that calls PCRE2. These may be created in a different locale from the default. +As more and more applications change to using Unicode, the need for this locale +support is expected to die away. +

+

+External tables are built by calling the pcre2_maketables() function, in +the relevant locale. The only argument to this function is a general context, +which can be used to pass a custom memory allocator. If the argument is NULL, +the system malloc() is used. The result can be passed to +pcre2_compile() as often as necessary, by creating a compile context and +calling pcre2_set_character_tables() to set the tables pointer therein. +

+

+For example, to build and use tables that are appropriate for the French locale +(where accented characters with values greater than 127 are treated as +letters), the following code could be used: +

+  setlocale(LC_CTYPE, "fr_FR");
+  tables = pcre2_maketables(NULL);
+  ccontext = pcre2_compile_context_create(NULL);
+  pcre2_set_character_tables(ccontext, tables);
+  re = pcre2_compile(..., ccontext);
+
+The locale name "fr_FR" is used on Linux and other Unix-like systems; if you +are using Windows, the name for the French locale is "french". +

+

+The pointer that is passed (via the compile context) to pcre2_compile() +is saved with the compiled pattern, and the same tables are used by the +matching functions. Thus, for any single pattern, compilation and matching both +happen in the same locale, but different patterns can be processed in different +locales. +

+

+It is the caller's responsibility to ensure that the memory containing the +tables remains available while they are still in use. When they are no longer +needed, you can discard them using pcre2_maketables_free(), which should +pass as its first parameter the same global context that was used to create the +tables. +

+
+Saving locale tables +
+

+The tables described above are just a sequence of binary bytes, which makes +them independent of hardware characteristics such as endianness or whether the +processor is 32-bit or 64-bit. A copy of the result of pcre2_maketables() +can therefore be saved in a file or elsewhere and re-used later, even in a +different program or on another computer. The size of the tables (number of +bytes) must be obtained by calling pcre2_config() with the +PCRE2_CONFIG_TABLES_LENGTH option because pcre2_maketables() does not +return this value. Note that the pcre2_dftables program, which is part of +the PCRE2 build system, can be used stand-alone to create a file that contains +a set of binary tables. See the +pcre2build +documentation for details. +

+
INFORMATION ABOUT A COMPILED PATTERN
+

+int pcre2_pattern_info(const pcre2 *code, uint32_t what, void *where); +

+

+The pcre2_pattern_info() function returns general information about a +compiled pattern. For information about callouts, see the +next section. +The first argument for pcre2_pattern_info() is a pointer to the compiled +pattern. The second argument specifies which piece of information is required, +and the third argument is a pointer to a variable to receive the data. If the +third argument is NULL, the first argument is ignored, and the function returns +the size in bytes of the variable that is required for the information +requested. Otherwise, the yield of the function is zero for success, or one of +the following negative numbers: +

+  PCRE2_ERROR_NULL           the argument code was NULL
+  PCRE2_ERROR_BADMAGIC       the "magic number" was not found
+  PCRE2_ERROR_BADOPTION      the value of what was invalid
+  PCRE2_ERROR_UNSET          the requested field is not set
+
+The "magic number" is placed at the start of each compiled pattern as a simple +check against passing an arbitrary memory pointer. Here is a typical call of +pcre2_pattern_info(), to obtain the length of the compiled pattern: +
+  int rc;
+  size_t length;
+  rc = pcre2_pattern_info(
+    re,               /* result of pcre2_compile() */
+    PCRE2_INFO_SIZE,  /* what is required */
+    &length);         /* where to put the data */
+
+The possible values for the second argument are defined in pcre2.h, and +are as follows: +
+  PCRE2_INFO_ALLOPTIONS
+  PCRE2_INFO_ARGOPTIONS
+  PCRE2_INFO_EXTRAOPTIONS
+
+Return copies of the pattern's options. The third argument should point to a +uint32_t variable. PCRE2_INFO_ARGOPTIONS returns exactly the options that +were passed to pcre2_compile(), whereas PCRE2_INFO_ALLOPTIONS returns +the compile options as modified by any top-level (*XXX) option settings such as +(*UTF) at the start of the pattern itself. PCRE2_INFO_EXTRAOPTIONS returns the +extra options that were set in the compile context by calling the +pcre2_set_compile_extra_options() function. +

+

+For example, if the pattern /(*UTF)abc/ is compiled with the PCRE2_EXTENDED +option, the result for PCRE2_INFO_ALLOPTIONS is PCRE2_EXTENDED and PCRE2_UTF. +Option settings such as (?i) that can change within a pattern do not affect the +result of PCRE2_INFO_ALLOPTIONS, even if they appear right at the start of the +pattern. (This was different in some earlier releases.) +

+

+A pattern compiled without PCRE2_ANCHORED is automatically anchored by PCRE2 if +the first significant item in every top-level branch is one of the following: +

+  ^     unless PCRE2_MULTILINE is set
+  \A    always
+  \G    always
+  .*    sometimes - see below
+
+When .* is the first significant item, anchoring is possible only when all the +following are true: +
+  .* is not in an atomic group
+  .* is not in a capture group that is the subject of a backreference
+  PCRE2_DOTALL is in force for .*
+  Neither (*PRUNE) nor (*SKIP) appears in the pattern
+  PCRE2_NO_DOTSTAR_ANCHOR is not set
+  Dotstar anchoring has not been disabled with PCRE2_DOTSTAR_ANCHOR_OFF
+
+For patterns that are auto-anchored, the PCRE2_ANCHORED bit is set in the +options returned for PCRE2_INFO_ALLOPTIONS. +
+  PCRE2_INFO_BACKREFMAX
+
+Return the number of the highest backreference in the pattern. The third +argument should point to a uint32_t variable. Named capture groups +acquire numbers as well as names, and these count towards the highest +backreference. Backreferences such as \4 or \g{12} match the captured +characters of the given group, but in addition, the check that a capture +group is set in a conditional group such as (?(3)a|b) is also a backreference. +Zero is returned if there are no backreferences. +
+  PCRE2_INFO_BSR
+
+The output is a uint32_t integer whose value indicates what character sequences +the \R escape sequence matches. A value of PCRE2_BSR_UNICODE means that \R +matches any Unicode line ending sequence; a value of PCRE2_BSR_ANYCRLF means +that \R matches only CR, LF, or CRLF. +
+  PCRE2_INFO_CAPTURECOUNT
+
+Return the highest capture group number in the pattern. In patterns where (?| +is not used, this is also the total number of capture groups. The third +argument should point to a uint32_t variable. +
+  PCRE2_INFO_DEPTHLIMIT
+
+If the pattern set a backtracking depth limit by including an item of the form +(*LIMIT_DEPTH=nnnn) at the start, the value is returned. The third argument +should point to a uint32_t integer. If no such value has been set, the call to +pcre2_pattern_info() returns the error PCRE2_ERROR_UNSET. Note that this +limit will only be used during matching if it is less than the limit set or +defaulted by the caller of the match function. +
+  PCRE2_INFO_FIRSTBITMAP
+
+In the absence of a single first code unit for a non-anchored pattern, +pcre2_compile() may construct a 256-bit table that defines a fixed set of +values for the first code unit in any match. For example, a pattern that starts +with [abc] results in a table with three bits set. When code unit values +greater than 255 are supported, the flag bit for 255 means "any code unit of +value 255 or above". If such a table was constructed, a pointer to it is +returned. Otherwise NULL is returned. The third argument should point to a +const uint8_t * variable. +
+  PCRE2_INFO_FIRSTCODETYPE
+
+Return information about the first code unit of any matched string, for a +non-anchored pattern. The third argument should point to a uint32_t +variable. If there is a fixed first value, for example, the letter "c" from a +pattern such as (cat|cow|coyote), 1 is returned, and the value can be retrieved +using PCRE2_INFO_FIRSTCODEUNIT. If there is no fixed first value, but it is +known that a match can occur only at the start of the subject or following a +newline in the subject, 2 is returned. Otherwise, and for anchored patterns, 0 +is returned. +
+  PCRE2_INFO_FIRSTCODEUNIT
+
+Return the value of the first code unit of any matched string for a pattern +where PCRE2_INFO_FIRSTCODETYPE returns 1; otherwise return 0. The third +argument should point to a uint32_t variable. In the 8-bit library, the +value is always less than 256. In the 16-bit library the value can be up to +0xffff. In the 32-bit library in UTF-32 mode the value can be up to 0x10ffff, +and up to 0xffffffff when not using UTF-32 mode. +
+  PCRE2_INFO_FRAMESIZE
+
+Return the size (in bytes) of the data frames that are used to remember +backtracking positions when the pattern is processed by pcre2_match() +without the use of JIT. The third argument should point to a size_t +variable. The frame size depends on the number of capturing parentheses in the +pattern. Each additional capture group adds two PCRE2_SIZE variables. +
+  PCRE2_INFO_HASBACKSLASHC
+
+Return 1 if the pattern contains any instances of \C, otherwise 0. The third +argument should point to a uint32_t variable. +
+  PCRE2_INFO_HASCRORLF
+
+Return 1 if the pattern contains any explicit matches for CR or LF characters, +otherwise 0. The third argument should point to a uint32_t variable. An +explicit match is either a literal CR or LF character, or \r or \n or one of +the equivalent hexadecimal or octal escape sequences. +
+  PCRE2_INFO_HEAPLIMIT
+
+If the pattern set a heap memory limit by including an item of the form +(*LIMIT_HEAP=nnnn) at the start, the value is returned. The third argument +should point to a uint32_t integer. If no such value has been set, the call to +pcre2_pattern_info() returns the error PCRE2_ERROR_UNSET. Note that this +limit will only be used during matching if it is less than the limit set or +defaulted by the caller of the match function. +
+  PCRE2_INFO_JCHANGED
+
+Return 1 if the (?J) or (?-J) option setting is used in the pattern, otherwise +0. The third argument should point to a uint32_t variable. (?J) and +(?-J) set and unset the local PCRE2_DUPNAMES option, respectively. +
+  PCRE2_INFO_JITSIZE
+
+If the compiled pattern was successfully processed by +pcre2_jit_compile(), return the size of the JIT compiled code, otherwise +return zero. The third argument should point to a size_t variable. +
+  PCRE2_INFO_LASTCODETYPE
+
+Returns 1 if there is a rightmost literal code unit that must exist in any +matched string, other than at its start. The third argument should point to a +uint32_t variable. If there is no such value, 0 is returned. When 1 is +returned, the code unit value itself can be retrieved using +PCRE2_INFO_LASTCODEUNIT. For anchored patterns, a last literal value is +recorded only if it follows something of variable length. For example, for the +pattern /^a\d+z\d+/ the returned value is 1 (with "z" returned from +PCRE2_INFO_LASTCODEUNIT), but for /^a\dz\d/ the returned value is 0. +
+  PCRE2_INFO_LASTCODEUNIT
+
+Return the value of the rightmost literal code unit that must exist in any +matched string, other than at its start, for a pattern where +PCRE2_INFO_LASTCODETYPE returns 1. Otherwise, return 0. The third argument +should point to a uint32_t variable. +
+  PCRE2_INFO_MATCHEMPTY
+
+Return 1 if the pattern might match an empty string, otherwise 0. The third +argument should point to a uint32_t variable. When a pattern contains +recursive subroutine calls it is not always possible to determine whether or +not it can match an empty string. PCRE2 takes a cautious approach and returns 1 +in such cases. +
+  PCRE2_INFO_MATCHLIMIT
+
+If the pattern set a match limit by including an item of the form +(*LIMIT_MATCH=nnnn) at the start, the value is returned. The third argument +should point to a uint32_t integer. If no such value has been set, the call to +pcre2_pattern_info() returns the error PCRE2_ERROR_UNSET. Note that this +limit will only be used during matching if it is less than the limit set or +defaulted by the caller of the match function. +
+  PCRE2_INFO_MAXLOOKBEHIND
+
+A lookbehind assertion moves back a certain number of characters (not code +units) when it starts to process each of its branches. This request returns the +largest of these backward moves. The third argument should point to a uint32_t +integer. The simple assertions \b and \B require a one-character lookbehind +and cause PCRE2_INFO_MAXLOOKBEHIND to return 1 in the absence of anything +longer. \A also registers a one-character lookbehind, though it does not +actually inspect the previous character. +

+

+Note that this information is useful for multi-segment matching only +if the pattern contains no nested lookbehinds. For example, the pattern +(?<=a(?<=ba)c) returns a maximum lookbehind of 2, but when it is processed, the +first lookbehind moves back by two characters, matches one character, then the +nested lookbehind also moves back by two characters. This puts the matching +point three characters earlier than it was at the start. +PCRE2_INFO_MAXLOOKBEHIND is really only useful as a debugging tool. See the +pcre2partial +documentation for a discussion of multi-segment matching. +

+  PCRE2_INFO_MINLENGTH
+
+If a minimum length for matching subject strings was computed, its value is +returned. Otherwise the returned value is 0. This value is not computed when +PCRE2_NO_START_OPTIMIZE is set. The value is a number of characters, which in +UTF mode may be different from the number of code units. The third argument +should point to a uint32_t variable. The value is a lower bound to the +length of any matching string. There may not be any strings of that length that +do actually match, but every string that does match is at least that long. +
+  PCRE2_INFO_NAMECOUNT
+  PCRE2_INFO_NAMEENTRYSIZE
+  PCRE2_INFO_NAMETABLE
+
+PCRE2 supports the use of named as well as numbered capturing parentheses. The +names are just an additional way of identifying the parentheses, which still +acquire numbers. Several convenience functions such as +pcre2_substring_get_byname() are provided for extracting captured +substrings by name. It is also possible to extract the data directly, by first +converting the name to a number in order to access the correct pointers in the +output vector (described with pcre2_match() below). To do the conversion, +you need to use the name-to-number map, which is described by these three +values. +

+

+The map consists of a number of fixed-size entries. PCRE2_INFO_NAMECOUNT gives +the number of entries, and PCRE2_INFO_NAMEENTRYSIZE gives the size of each +entry in code units; both of these return a uint32_t value. The entry +size depends on the length of the longest name. +

+

+PCRE2_INFO_NAMETABLE returns a pointer to the first entry of the table. This is +a PCRE2_SPTR pointer to a block of code units. In the 8-bit library, the first +two bytes of each entry are the number of the capturing parenthesis, most +significant byte first. In the 16-bit library, the pointer points to 16-bit +code units, the first of which contains the parenthesis number. In the 32-bit +library, the pointer points to 32-bit code units, the first of which contains +the parenthesis number. The rest of the entry is the corresponding name, zero +terminated. +

+

+The names are in alphabetical order. If (?| is used to create multiple capture +groups with the same number, as described in the +section on duplicate group numbers +in the +pcre2pattern +page, the groups may be given the same name, but there is only one entry in the +table. Different names for groups of the same number are not permitted. +

+

+Duplicate names for capture groups with different numbers are permitted, but +only if PCRE2_DUPNAMES is set. They appear in the table in the order in which +they were found in the pattern. In the absence of (?| this is the order of +increasing number; when (?| is used this is not necessarily the case because +later capture groups may have lower numbers. +

+

+As a simple example of the name/number table, consider the following pattern +after compilation by the 8-bit library (assume PCRE2_EXTENDED is set, so white +space - including newlines - is ignored): +

+  (?<date> (?<year>(\d\d)?\d\d) - (?<month>\d\d) - (?<day>\d\d) )
+
+There are four named capture groups, so the table has four entries, and each +entry in the table is eight bytes long. The table is as follows, with +non-printing bytes shows in hexadecimal, and undefined bytes shown as ??: +
+  00 01 d  a  t  e  00 ??
+  00 05 d  a  y  00 ?? ??
+  00 04 m  o  n  t  h  00
+  00 02 y  e  a  r  00 ??
+
+When writing code to extract data from named capture groups using the +name-to-number map, remember that the length of the entries is likely to be +different for each compiled pattern. +
+  PCRE2_INFO_NEWLINE
+
+The output is one of the following uint32_t values: +
+  PCRE2_NEWLINE_CR       Carriage return (CR)
+  PCRE2_NEWLINE_LF       Linefeed (LF)
+  PCRE2_NEWLINE_CRLF     Carriage return, linefeed (CRLF)
+  PCRE2_NEWLINE_ANY      Any Unicode line ending
+  PCRE2_NEWLINE_ANYCRLF  Any of CR, LF, or CRLF
+  PCRE2_NEWLINE_NUL      The NUL character (binary zero)
+
+This identifies the character sequence that will be recognized as meaning +"newline" while matching. +
+  PCRE2_INFO_SIZE
+
+Return the size of the compiled pattern in bytes (for all three libraries). The +third argument should point to a size_t variable. This value includes the +size of the general data block that precedes the code units of the compiled +pattern itself. The value that is used when pcre2_compile() is getting +memory in which to place the compiled pattern may be slightly larger than the +value returned by this option, because there are cases where the code that +calculates the size has to over-estimate. Processing a pattern with the JIT +compiler does not alter the value returned by this option. +

+
INFORMATION ABOUT A PATTERN'S CALLOUTS
+

+int pcre2_callout_enumerate(const pcre2_code *code, + int (*callback)(pcre2_callout_enumerate_block *, void *), + void *user_data); +
+
+A script language that supports the use of string arguments in callouts might +like to scan all the callouts in a pattern before running the match. This can +be done by calling pcre2_callout_enumerate(). The first argument is a +pointer to a compiled pattern, the second points to a callback function, and +the third is arbitrary user data. The callback function is called for every +callout in the pattern in the order in which they appear. Its first argument is +a pointer to a callout enumeration block, and its second argument is the +user_data value that was passed to pcre2_callout_enumerate(). The +contents of the callout enumeration block are described in the +pcre2callout +documentation, which also gives further details about callouts. +

+
SERIALIZATION AND PRECOMPILING
+

+It is possible to save compiled patterns on disc or elsewhere, and reload them +later, subject to a number of restrictions. The host on which the patterns are +reloaded must be running the same version of PCRE2, with the same code unit +width, and must also have the same endianness, pointer width, and PCRE2_SIZE +type. Before compiled patterns can be saved, they must be converted to a +"serialized" form, which in the case of PCRE2 is really just a bytecode dump. +The functions whose names begin with pcre2_serialize_ are used for +converting to and from the serialized form. They are described in the +pcre2serialize +documentation. Note that PCRE2 serialization does not convert compiled patterns +to an abstract format like Java or .NET serialization. +

+
THE MATCH DATA BLOCK
+

+pcre2_match_data *pcre2_match_data_create(uint32_t ovecsize, + pcre2_general_context *gcontext); +
+
+pcre2_match_data *pcre2_match_data_create_from_pattern( + const pcre2_code *code, pcre2_general_context *gcontext); +
+
+void pcre2_match_data_free(pcre2_match_data *match_data); +

+

+Information about a successful or unsuccessful match is placed in a match +data block, which is an opaque structure that is accessed by function calls. In +particular, the match data block contains a vector of offsets into the subject +string that define the matched parts of the subject. This is known as the +ovector. +

+

+Before calling pcre2_match(), pcre2_dfa_match(), or +pcre2_jit_match() you must create a match data block by calling one of +the creation functions above. For pcre2_match_data_create(), the first +argument is the number of pairs of offsets in the ovector. +

+

+When using pcre2_match(), one pair of offsets is required to identify the +string that matched the whole pattern, with an additional pair for each +captured substring. For example, a value of 4 creates enough space to record +the matched portion of the subject plus three captured substrings. +

+

+When using pcre2_dfa_match() there may be multiple matched substrings of +different lengths at the same point in the subject. The ovector should be made +large enough to hold as many as are expected. +

+

+A minimum of at least 1 pair is imposed by pcre2_match_data_create(), so +it is always possible to return the overall matched string in the case of +pcre2_match() or the longest match in the case of +pcre2_dfa_match(). The maximum number of pairs is 65535; if the first +argument of pcre2_match_data_create() is greater than this, 65535 is +used. +

+

+The second argument of pcre2_match_data_create() is a pointer to a +general context, which can specify custom memory management for obtaining the +memory for the match data block. If you are not using custom memory management, +pass NULL, which causes malloc() to be used. +

+

+For pcre2_match_data_create_from_pattern(), the first argument is a +pointer to a compiled pattern. The ovector is created to be exactly the right +size to hold all the substrings a pattern might capture when matched using +pcre2_match(). You should not use this call when matching with +pcre2_dfa_match(). The second argument is again a pointer to a general +context, but in this case if NULL is passed, the memory is obtained using the +same allocator that was used for the compiled pattern (custom or default). +

+

+A match data block can be used many times, with the same or different compiled +patterns. You can extract information from a match data block after a match +operation has finished, using functions that are described in the sections on +matched strings +and +other match data +below. +

+

+When a call of pcre2_match() fails, valid data is available in the match +block only when the error is PCRE2_ERROR_NOMATCH, PCRE2_ERROR_PARTIAL, or one +of the error codes for an invalid UTF string. Exactly what is available depends +on the error, and is detailed below. +

+

+When one of the matching functions is called, pointers to the compiled pattern +and the subject string are set in the match data block so that they can be +referenced by the extraction functions after a successful match. After running +a match, you must not free a compiled pattern or a subject string until after +all operations on the match data block (for that match) have taken place, +unless, in the case of the subject string, you have used the +PCRE2_COPY_MATCHED_SUBJECT option, which is described in the section entitled +"Option bits for pcre2_match()" +below. +

+

+When a match data block itself is no longer needed, it should be freed by +calling pcre2_match_data_free(). If this function is called with a NULL +argument, it returns immediately, without doing anything. +

+
MEMORY USE FOR MATCH DATA BLOCKS
+

+PCRE2_SIZE pcre2_get_match_data_size(pcre2_match_data *match_data); +
+
+PCRE2_SIZE pcre2_get_match_data_heapframes_size( + pcre2_match_data *match_data); +

+

+The size of a match data block depends on the size of the ovector that it +contains. The function pcre2_get_match_data_size() returns the size, in +bytes, of the block that is its argument. +

+

+When pcre2_match() runs interpretively (that is, without using JIT), it +makes use of a vector of data frames for remembering backtracking positions. +The size of each individual frame depends on the number of capturing +parentheses in the pattern and can be obtained by calling +pcre2_pattern_info() with the PCRE2_INFO_FRAMESIZE option (see the +section entitled "Information about a compiled pattern" +above). +

+

+Heap memory is used for the frames vector; if the initial memory block turns +out to be too small during matching, it is automatically expanded. When +pcre2_match() returns, the memory is not freed, but remains attached to +the match data block, for use by any subsequent matches that use the same +block. It is automatically freed when the match data block itself is freed. +

+

+You can find the current size of the frames vector that a match data block owns +by calling pcre2_get_match_data_heapframes_size(). For a newly created +match data block the size will be zero. Some types of match may require a lot +of frames and thus a large vector; applications that run in environments where +memory is constrained can check this and free the match data block if the heap +frames vector has become too big. +

+
MATCHING A PATTERN: THE TRADITIONAL FUNCTION
+

+int pcre2_match(const pcre2_code *code, PCRE2_SPTR subject, + PCRE2_SIZE length, PCRE2_SIZE startoffset, + uint32_t options, pcre2_match_data *match_data, + pcre2_match_context *mcontext); +

+

+The function pcre2_match() is called to match a subject string against a +compiled pattern, which is passed in the code argument. You can call +pcre2_match() with the same code argument as many times as you +like, in order to find multiple matches in the subject string or to match +different subject strings with the same pattern. +

+

+This function is the main matching facility of the library, and it operates in +a Perl-like manner. For specialist use there is also an alternative matching +function, which is described +below +in the section about the pcre2_dfa_match() function. +

+

+Here is an example of a simple call to pcre2_match(): +

+  pcre2_match_data *md = pcre2_match_data_create(4, NULL);
+  int rc = pcre2_match(
+    re,             /* result of pcre2_compile() */
+    "some string",  /* the subject string */
+    11,             /* the length of the subject string */
+    0,              /* start at offset 0 in the subject */
+    0,              /* default options */
+    md,             /* the match data block */
+    NULL);          /* a match context; NULL means use defaults */
+
+If the subject string is zero-terminated, the length can be given as +PCRE2_ZERO_TERMINATED. A match context must be provided if certain less common +matching parameters are to be changed. For details, see the section on +the match context +above. +

+
+The string to be matched by pcre2_match() +
+

+The subject string is passed to pcre2_match() as a pointer in +subject, a length in length, and a starting offset in +startoffset. The length and offset are in code units, not characters. +That is, they are in bytes for the 8-bit library, 16-bit code units for the +16-bit library, and 32-bit code units for the 32-bit library, whether or not +UTF processing is enabled. As a special case, if subject is NULL and +length is zero, the subject is assumed to be an empty string. If +length is non-zero, an error occurs if subject is NULL. +

+

+If startoffset is greater than the length of the subject, +pcre2_match() returns PCRE2_ERROR_BADOFFSET. When the starting offset is +zero, the search for a match starts at the beginning of the subject, and this +is by far the most common case. In UTF-8 or UTF-16 mode, the starting offset +must point to the start of a character, or to the end of the subject (in UTF-32 +mode, one code unit equals one character, so all offsets are valid). Like the +pattern string, the subject may contain binary zeros. +

+

+A non-zero starting offset is useful when searching for another match in the +same subject by calling pcre2_match() again after a previous success. +Setting startoffset differs from passing over a shortened string and +setting PCRE2_NOTBOL in the case of a pattern that begins with any kind of +lookbehind. For example, consider the pattern +

+  \Biss\B
+
+which finds occurrences of "iss" in the middle of words. (\B matches only if +the current position in the subject is not a word boundary.) When applied to +the string "Mississippi" the first call to pcre2_match() finds the first +occurrence. If pcre2_match() is called again with just the remainder of +the subject, namely "issippi", it does not match, because \B is always false +at the start of the subject, which is deemed to be a word boundary. However, if +pcre2_match() is passed the entire string again, but with +startoffset set to 4, it finds the second occurrence of "iss" because it +is able to look behind the starting point to discover that it is preceded by a +letter. +

+

+Finding all the matches in a subject is tricky when the pattern can match an +empty string. It is possible to emulate Perl's /g behaviour by first trying the +match again at the same offset, with the PCRE2_NOTEMPTY_ATSTART and +PCRE2_ANCHORED options, and then if that fails, advancing the starting offset +and trying an ordinary match again. There is some code that demonstrates how to +do this in the +pcre2demo +sample program. In the most general case, you have to check to see if the +newline convention recognizes CRLF as a newline, and if so, and the current +character is CR followed by LF, advance the starting offset by two characters +instead of one. +

+

+If a non-zero starting offset is passed when the pattern is anchored, a single +attempt to match at the given offset is made. This can only succeed if the +pattern does not require the match to be at the start of the subject. In other +words, the anchoring must be the result of setting the PCRE2_ANCHORED option or +the use of .* with PCRE2_DOTALL, not by starting the pattern with ^ or \A. +

+
+Option bits for pcre2_match() +
+

+The unused bits of the options argument for pcre2_match() must be +zero. The only bits that may be set are PCRE2_ANCHORED, +PCRE2_COPY_MATCHED_SUBJECT, PCRE2_DISABLE_RECURSELOOP_CHECK, PCRE2_ENDANCHORED, +PCRE2_NOTBOL, PCRE2_NOTEOL, PCRE2_NOTEMPTY, PCRE2_NOTEMPTY_ATSTART, +PCRE2_NO_JIT, PCRE2_NO_UTF_CHECK, PCRE2_PARTIAL_HARD, and PCRE2_PARTIAL_SOFT. +Their action is described below. +

+

+Setting PCRE2_ANCHORED or PCRE2_ENDANCHORED at match time is not supported by +the just-in-time (JIT) compiler. If it is set, JIT matching is disabled and the +interpretive code in pcre2_match() is run. +PCRE2_DISABLE_RECURSELOOP_CHECK is ignored by JIT, but apart from PCRE2_NO_JIT +(obviously), the remaining options are supported for JIT matching. +

+  PCRE2_ANCHORED
+
+The PCRE2_ANCHORED option limits pcre2_match() to matching at the first +matching position. If a pattern was compiled with PCRE2_ANCHORED, or turned out +to be anchored by virtue of its contents, it cannot be made unachored at +matching time. Note that setting the option at match time disables JIT +matching. +
+  PCRE2_COPY_MATCHED_SUBJECT
+
+By default, a pointer to the subject is remembered in the match data block so +that, after a successful match, it can be referenced by the substring +extraction functions. This means that the subject's memory must not be freed +until all such operations are complete. For some applications where the +lifetime of the subject string is not guaranteed, it may be necessary to make a +copy of the subject string, but it is wasteful to do this unless the match is +successful. After a successful match, if PCRE2_COPY_MATCHED_SUBJECT is set, the +subject is copied and the new pointer is remembered in the match data block +instead of the original subject pointer. The memory allocator that was used for +the match block itself is used. The copy is automatically freed when +pcre2_match_data_free() is called to free the match data block. It is also +automatically freed if the match data block is re-used for another match +operation. +
+  PCRE2_DISABLE_RECURSELOOP_CHECK
+
+This option is relevant only to pcre2_match() for interpretive matching. +It is ignored when JIT is used, and is forbidden for pcre2_dfa_match(). +

+

+The use of recursion in patterns can lead to infinite loops. In the +interpretive matcher these would be eventually caught by the match or heap +limits, but this could take a long time and/or use a lot of memory if the +limits are large. There is therefore a check at the start of each recursion. +If the same group is still active from a previous call, and the current subject +pointer is the same as it was at the start of that group, and the furthest +inspected character of the subject has not changed, an error is generated. +

+

+There are rare cases of matches that would complete, but nevertheless trigger +this error. This option disables the check. It is provided mainly for testing +when comparing JIT and interpretive behaviour. +

+  PCRE2_ENDANCHORED
+
+If the PCRE2_ENDANCHORED option is set, any string that pcre2_match() +matches must be right at the end of the subject string. Note that setting the +option at match time disables JIT matching. +
+  PCRE2_NOTBOL
+
+This option specifies that first character of the subject string is not the +beginning of a line, so the circumflex metacharacter should not match before +it. Setting this without having set PCRE2_MULTILINE at compile time causes +circumflex never to match. This option affects only the behaviour of the +circumflex metacharacter. It does not affect \A. +
+  PCRE2_NOTEOL
+
+This option specifies that the end of the subject string is not the end of a +line, so the dollar metacharacter should not match it nor (except in multiline +mode) a newline immediately before it. Setting this without having set +PCRE2_MULTILINE at compile time causes dollar never to match. This option +affects only the behaviour of the dollar metacharacter. It does not affect \Z +or \z. +
+  PCRE2_NOTEMPTY
+
+An empty string is not considered to be a valid match if this option is set. If +there are alternatives in the pattern, they are tried. If all the alternatives +match the empty string, the entire match fails. For example, if the pattern +
+  a?b?
+
+is applied to a string not beginning with "a" or "b", it matches an empty +string at the start of the subject. With PCRE2_NOTEMPTY set, this match is not +valid, so pcre2_match() searches further into the string for occurrences +of "a" or "b". +
+  PCRE2_NOTEMPTY_ATSTART
+
+This is like PCRE2_NOTEMPTY, except that it locks out an empty string match +only at the first matching position, that is, at the start of the subject plus +the starting offset. An empty string match later in the subject is permitted. +If the pattern is anchored, such a match can occur only if the pattern contains +\K. +
+  PCRE2_NO_JIT
+
+By default, if a pattern has been successfully processed by +pcre2_jit_compile(), JIT is automatically used when pcre2_match() +is called with options that JIT supports. Setting PCRE2_NO_JIT disables the use +of JIT; it forces matching to be done by the interpreter. +
+  PCRE2_NO_UTF_CHECK
+
+When PCRE2_UTF is set at compile time, the validity of the subject as a UTF +string is checked unless PCRE2_NO_UTF_CHECK is passed to pcre2_match() or +PCRE2_MATCH_INVALID_UTF was passed to pcre2_compile(). The latter special +case is discussed in detail in the +pcre2unicode +documentation. +

+

+In the default case, if a non-zero starting offset is given, the check is +applied only to that part of the subject that could be inspected during +matching, and there is a check that the starting offset points to the first +code unit of a character or to the end of the subject. If there are no +lookbehind assertions in the pattern, the check starts at the starting offset. +Otherwise, it starts at the length of the longest lookbehind before the +starting offset, or at the start of the subject if there are not that many +characters before the starting offset. Note that the sequences \b and \B are +one-character lookbehinds. +

+

+The check is carried out before any other processing takes place, and a +negative error code is returned if the check fails. There are several UTF error +codes for each code unit width, corresponding to different problems with the +code unit sequence. There are discussions about the validity of +UTF-8 strings, +UTF-16 strings, +and +UTF-32 strings +in the +pcre2unicode +documentation. +

+

+If you know that your subject is valid, and you want to skip this check for +performance reasons, you can set the PCRE2_NO_UTF_CHECK option when calling +pcre2_match(). You might want to do this for the second and subsequent +calls to pcre2_match() if you are making repeated calls to find multiple +matches in the same subject string. +

+

+Warning: Unless PCRE2_MATCH_INVALID_UTF was set at compile time, when +PCRE2_NO_UTF_CHECK is set at match time the effect of passing an invalid +string as a subject, or an invalid value of startoffset, is undefined. +Your program may crash or loop indefinitely or give wrong results. +

+  PCRE2_PARTIAL_HARD
+  PCRE2_PARTIAL_SOFT
+
+These options turn on the partial matching feature. A partial match occurs if +the end of the subject string is reached successfully, but there are not enough +subject characters to complete the match. In addition, either at least one +character must have been inspected or the pattern must contain a lookbehind, or +the pattern must be one that could match an empty string. +

+

+If this situation arises when PCRE2_PARTIAL_SOFT (but not PCRE2_PARTIAL_HARD) +is set, matching continues by testing any remaining alternatives. Only if no +complete match can be found is PCRE2_ERROR_PARTIAL returned instead of +PCRE2_ERROR_NOMATCH. In other words, PCRE2_PARTIAL_SOFT specifies that the +caller is prepared to handle a partial match, but only if no complete match can +be found. +

+

+If PCRE2_PARTIAL_HARD is set, it overrides PCRE2_PARTIAL_SOFT. In this case, if +a partial match is found, pcre2_match() immediately returns +PCRE2_ERROR_PARTIAL, without considering any other alternatives. In other +words, when PCRE2_PARTIAL_HARD is set, a partial match is considered to be more +important that an alternative complete match. +

+

+There is a more detailed discussion of partial and multi-segment matching, with +examples, in the +pcre2partial +documentation. +

+
NEWLINE HANDLING WHEN MATCHING
+

+When PCRE2 is built, a default newline convention is set; this is usually the +standard convention for the operating system. The default can be overridden in +a +compile context +by calling pcre2_set_newline(). It can also be overridden by starting a +pattern string with, for example, (*CRLF), as described in the +section on newline conventions +in the +pcre2pattern +page. During matching, the newline choice affects the behaviour of the dot, +circumflex, and dollar metacharacters. It may also alter the way the match +starting position is advanced after a match failure for an unanchored pattern. +

+

+When PCRE2_NEWLINE_CRLF, PCRE2_NEWLINE_ANYCRLF, or PCRE2_NEWLINE_ANY is set as +the newline convention, and a match attempt for an unanchored pattern fails +when the current starting position is at a CRLF sequence, and the pattern +contains no explicit matches for CR or LF characters, the match position is +advanced by two characters instead of one, in other words, to after the CRLF. +

+

+The above rule is a compromise that makes the most common cases work as +expected. For example, if the pattern is .+A (and the PCRE2_DOTALL option is +not set), it does not match the string "\r\nA" because, after failing at the +start, it skips both the CR and the LF before retrying. However, the pattern +[\r\n]A does match that string, because it contains an explicit CR or LF +reference, and so advances only by one character after the first failure. +

+

+An explicit match for CR of LF is either a literal appearance of one of those +characters in the pattern, or one of the \r or \n or equivalent octal or +hexadecimal escape sequences. Implicit matches such as [^X] do not count, nor +does \s, even though it includes CR and LF in the characters that it matches. +

+

+Notwithstanding the above, anomalous effects may still occur when CRLF is a +valid newline sequence and explicit \r or \n escapes appear in the pattern. +

+
HOW PCRE2_MATCH() RETURNS A STRING AND CAPTURED SUBSTRINGS
+

+uint32_t pcre2_get_ovector_count(pcre2_match_data *match_data); +
+
+PCRE2_SIZE *pcre2_get_ovector_pointer(pcre2_match_data *match_data); +

+

+In general, a pattern matches a certain portion of the subject, and in +addition, further substrings from the subject may be picked out by +parenthesized parts of the pattern. Following the usage in Jeffrey Friedl's +book, this is called "capturing" in what follows, and the phrase "capture +group" (Perl terminology) is used for a fragment of a pattern that picks out a +substring. PCRE2 supports several other kinds of parenthesized group that do +not cause substrings to be captured. The pcre2_pattern_info() function +can be used to find out how many capture groups there are in a compiled +pattern. +

+

+You can use auxiliary functions for accessing captured substrings +by number +or +by name, +as described in sections below. +

+

+Alternatively, you can make direct use of the vector of PCRE2_SIZE values, +called the ovector, which contains the offsets of captured strings. It is +part of the +match data block. +The function pcre2_get_ovector_pointer() returns the address of the +ovector, and pcre2_get_ovector_count() returns the number of pairs of +values it contains. +

+

+Within the ovector, the first in each pair of values is set to the offset of +the first code unit of a substring, and the second is set to the offset of the +first code unit after the end of a substring. These values are always code unit +offsets, not character offsets. That is, they are byte offsets in the 8-bit +library, 16-bit offsets in the 16-bit library, and 32-bit offsets in the 32-bit +library. +

+

+After a partial match (error return PCRE2_ERROR_PARTIAL), only the first pair +of offsets (that is, ovector[0] and ovector[1]) are set. They +identify the part of the subject that was partially matched. See the +pcre2partial +documentation for details of partial matching. +

+

+After a fully successful match, the first pair of offsets identifies the +portion of the subject string that was matched by the entire pattern. The next +pair is used for the first captured substring, and so on. The value returned by +pcre2_match() is one more than the highest numbered pair that has been +set. For example, if two substrings have been captured, the returned value is +3. If there are no captured substrings, the return value from a successful +match is 1, indicating that just the first pair of offsets has been set. +

+

+If a pattern uses the \K escape sequence within a positive assertion, the +reported start of a successful match can be greater than the end of the match. +For example, if the pattern (?=ab\K) is matched against "ab", the start and +end offset values for the match are 2 and 0. +

+

+If a capture group is matched repeatedly within a single match operation, it is +the last portion of the subject that it matched that is returned. +

+

+If the ovector is too small to hold all the captured substring offsets, as much +as possible is filled in, and the function returns a value of zero. If captured +substrings are not of interest, pcre2_match() may be called with a match +data block whose ovector is of minimum length (that is, one pair). +

+

+It is possible for capture group number n+1 to match some part of the +subject when group n has not been used at all. For example, if the string +"abc" is matched against the pattern (a|(z))(bc) the return from the function +is 4, and groups 1 and 3 are matched, but 2 is not. When this happens, both +values in the offset pairs corresponding to unused groups are set to +PCRE2_UNSET. +

+

+Offset values that correspond to unused groups at the end of the expression are +also set to PCRE2_UNSET. For example, if the string "abc" is matched against +the pattern (abc)(x(yz)?)? groups 2 and 3 are not matched. The return from the +function is 2, because the highest used capture group number is 1. The offsets +for the second and third capture groups (assuming the vector is large enough, +of course) are set to PCRE2_UNSET. +

+

+Elements in the ovector that do not correspond to capturing parentheses in the +pattern are never changed. That is, if a pattern contains n capturing +parentheses, no more than ovector[0] to ovector[2n+1] are set by +pcre2_match(). The other elements retain whatever values they previously +had. After a failed match attempt, the contents of the ovector are unchanged. +

+
OTHER INFORMATION ABOUT A MATCH
+

+PCRE2_SPTR pcre2_get_mark(pcre2_match_data *match_data); +
+
+PCRE2_SIZE pcre2_get_startchar(pcre2_match_data *match_data); +

+

+As well as the offsets in the ovector, other information about a match is +retained in the match data block and can be retrieved by the above functions in +appropriate circumstances. If they are called at other times, the result is +undefined. +

+

+After a successful match, a partial match (PCRE2_ERROR_PARTIAL), or a failure +to match (PCRE2_ERROR_NOMATCH), a mark name may be available. The function +pcre2_get_mark() can be called to access this name, which can be +specified in the pattern by any of the backtracking control verbs, not just +(*MARK). The same function applies to all the verbs. It returns a pointer to +the zero-terminated name, which is within the compiled pattern. If no name is +available, NULL is returned. The length of the name (excluding the terminating +zero) is stored in the code unit that precedes the name. You should use this +length instead of relying on the terminating zero if the name might contain a +binary zero. +

+

+After a successful match, the name that is returned is the last mark name +encountered on the matching path through the pattern. Instances of backtracking +verbs without names do not count. Thus, for example, if the matching path +contains (*MARK:A)(*PRUNE), the name "A" is returned. After a "no match" or a +partial match, the last encountered name is returned. For example, consider +this pattern: +

+  ^(*MARK:A)((*MARK:B)a|b)c
+
+When it matches "bc", the returned name is A. The B mark is "seen" in the first +branch of the group, but it is not on the matching path. On the other hand, +when this pattern fails to match "bx", the returned name is B. +

+

+Warning: By default, certain start-of-match optimizations are used to +give a fast "no match" result in some situations. For example, if the anchoring +is removed from the pattern above, there is an initial check for the presence +of "c" in the subject before running the matching engine. This check fails for +"bx", causing a match failure without seeing any marks. You can disable the +start-of-match optimizations by setting the PCRE2_NO_START_OPTIMIZE option for +pcre2_compile() or by starting the pattern with (*NO_START_OPT). +

+

+After a successful match, a partial match, or one of the invalid UTF errors +(for example, PCRE2_ERROR_UTF8_ERR5), pcre2_get_startchar() can be +called. After a successful or partial match it returns the code unit offset of +the character at which the match started. For a non-partial match, this can be +different to the value of ovector[0] if the pattern contains the \K +escape sequence. After a partial match, however, this value is always the same +as ovector[0] because \K does not affect the result of a partial match. +

+

+After a UTF check failure, pcre2_get_startchar() can be used to obtain +the code unit offset of the invalid UTF character. Details are given in the +pcre2unicode +page. +

+
ERROR RETURNS FROM pcre2_match()
+

+If pcre2_match() fails, it returns a negative number. This can be +converted to a text string by calling the pcre2_get_error_message() +function (see "Obtaining a textual error message" +below). +Negative error codes are also returned by other functions, and are documented +with them. The codes are given names in the header file. If UTF checking is in +force and an invalid UTF subject string is detected, one of a number of +UTF-specific negative error codes is returned. Details are given in the +pcre2unicode +page. The following are the other errors that may be returned by +pcre2_match(): +

+  PCRE2_ERROR_NOMATCH
+
+The subject string did not match the pattern. +
+  PCRE2_ERROR_PARTIAL
+
+The subject string did not match, but it did match partially. See the +pcre2partial +documentation for details of partial matching. +
+  PCRE2_ERROR_BADMAGIC
+
+PCRE2 stores a 4-byte "magic number" at the start of the compiled code, to +catch the case when it is passed a junk pointer. This is the error that is +returned when the magic number is not present. +
+  PCRE2_ERROR_BADMODE
+
+This error is given when a compiled pattern is passed to a function in a +library of a different code unit width, for example, a pattern compiled by +the 8-bit library is passed to a 16-bit or 32-bit library function. +
+  PCRE2_ERROR_BADOFFSET
+
+The value of startoffset was greater than the length of the subject. +
+  PCRE2_ERROR_BADOPTION
+
+An unrecognized bit was set in the options argument. +
+  PCRE2_ERROR_BADUTFOFFSET
+
+The UTF code unit sequence that was passed as a subject was checked and found +to be valid (the PCRE2_NO_UTF_CHECK option was not set), but the value of +startoffset did not point to the beginning of a UTF character or the end +of the subject. +
+  PCRE2_ERROR_CALLOUT
+
+This error is never generated by pcre2_match() itself. It is provided for +use by callout functions that want to cause pcre2_match() or +pcre2_callout_enumerate() to return a distinctive error code. See the +pcre2callout +documentation for details. +
+  PCRE2_ERROR_DEPTHLIMIT
+
+The nested backtracking depth limit was reached. +
+  PCRE2_ERROR_HEAPLIMIT
+
+The heap limit was reached. +
+  PCRE2_ERROR_INTERNAL
+
+An unexpected internal error has occurred. This error could be caused by a bug +in PCRE2 or by overwriting of the compiled pattern. +
+  PCRE2_ERROR_JIT_STACKLIMIT
+
+This error is returned when a pattern that was successfully studied using JIT +is being matched, but the memory available for the just-in-time processing +stack is not large enough. See the +pcre2jit +documentation for more details. +
+  PCRE2_ERROR_MATCHLIMIT
+
+The backtracking match limit was reached. +
+  PCRE2_ERROR_NOMEMORY
+
+Heap memory is used to remember backtracking points. This error is given when +the memory allocation function (default or custom) fails. Note that a different +error, PCRE2_ERROR_HEAPLIMIT, is given if the amount of memory needed exceeds +the heap limit. PCRE2_ERROR_NOMEMORY is also returned if +PCRE2_COPY_MATCHED_SUBJECT is set and memory allocation fails. +
+  PCRE2_ERROR_NULL
+
+Either the code, subject, or match_data argument was passed +as NULL. +
+  PCRE2_ERROR_RECURSELOOP
+
+This error is returned when pcre2_match() detects a recursion loop within +the pattern. Specifically, it means that either the whole pattern or a +capture group has been called recursively for the second time at the same +position in the subject string. Some simple patterns that might do this are +detected and faulted at compile time, but more complicated cases, in particular +mutual recursions between two different groups, cannot be detected until +matching is attempted. +

+
OBTAINING A TEXTUAL ERROR MESSAGE
+

+int pcre2_get_error_message(int errorcode, PCRE2_UCHAR *buffer, + PCRE2_SIZE bufflen); +

+

+A text message for an error code from any PCRE2 function (compile, match, or +auxiliary) can be obtained by calling pcre2_get_error_message(). The code +is passed as the first argument, with the remaining two arguments specifying a +code unit buffer and its length in code units, into which the text message is +placed. The message is returned in code units of the appropriate width for the +library that is being used. +

+

+The returned message is terminated with a trailing zero, and the function +returns the number of code units used, excluding the trailing zero. If the +error number is unknown, the negative error code PCRE2_ERROR_BADDATA is +returned. If the buffer is too small, the message is truncated (but still with +a trailing zero), and the negative error code PCRE2_ERROR_NOMEMORY is returned. +None of the messages are very long; a buffer size of 120 code units is ample. +

+
EXTRACTING CAPTURED SUBSTRINGS BY NUMBER
+

+int pcre2_substring_length_bynumber(pcre2_match_data *match_data, + uint32_t number, PCRE2_SIZE *length); +
+
+int pcre2_substring_copy_bynumber(pcre2_match_data *match_data, + uint32_t number, PCRE2_UCHAR *buffer, + PCRE2_SIZE *bufflen); +
+
+int pcre2_substring_get_bynumber(pcre2_match_data *match_data, + uint32_t number, PCRE2_UCHAR **bufferptr, + PCRE2_SIZE *bufflen); +
+
+void pcre2_substring_free(PCRE2_UCHAR *buffer); +

+

+Captured substrings can be accessed directly by using the ovector as described +above. +For convenience, auxiliary functions are provided for extracting captured +substrings as new, separate, zero-terminated strings. A substring that contains +a binary zero is correctly extracted and has a further zero added on the end, +but the result is not, of course, a C string. +

+

+The functions in this section identify substrings by number. The number zero +refers to the entire matched substring, with higher numbers referring to +substrings captured by parenthesized groups. After a partial match, only +substring zero is available. An attempt to extract any other substring gives +the error PCRE2_ERROR_PARTIAL. The next section describes similar functions for +extracting captured substrings by name. +

+

+If a pattern uses the \K escape sequence within a positive assertion, the +reported start of a successful match can be greater than the end of the match. +For example, if the pattern (?=ab\K) is matched against "ab", the start and +end offset values for the match are 2 and 0. In this situation, calling these +functions with a zero substring number extracts a zero-length empty string. +

+

+You can find the length in code units of a captured substring without +extracting it by calling pcre2_substring_length_bynumber(). The first +argument is a pointer to the match data block, the second is the group number, +and the third is a pointer to a variable into which the length is placed. If +you just want to know whether or not the substring has been captured, you can +pass the third argument as NULL. +

+

+The pcre2_substring_copy_bynumber() function copies a captured substring +into a supplied buffer, whereas pcre2_substring_get_bynumber() copies it +into new memory, obtained using the same memory allocation function that was +used for the match data block. The first two arguments of these functions are a +pointer to the match data block and a capture group number. +

+

+The final arguments of pcre2_substring_copy_bynumber() are a pointer to +the buffer and a pointer to a variable that contains its length in code units. +This is updated to contain the actual number of code units used for the +extracted substring, excluding the terminating zero. +

+

+For pcre2_substring_get_bynumber() the third and fourth arguments point +to variables that are updated with a pointer to the new memory and the number +of code units that comprise the substring, again excluding the terminating +zero. When the substring is no longer needed, the memory should be freed by +calling pcre2_substring_free(). +

+

+The return value from all these functions is zero for success, or a negative +error code. If the pattern match failed, the match failure code is returned. +If a substring number greater than zero is used after a partial match, +PCRE2_ERROR_PARTIAL is returned. Other possible error codes are: +

+  PCRE2_ERROR_NOMEMORY
+
+The buffer was too small for pcre2_substring_copy_bynumber(), or the +attempt to get memory failed for pcre2_substring_get_bynumber(). +
+  PCRE2_ERROR_NOSUBSTRING
+
+There is no substring with that number in the pattern, that is, the number is +greater than the number of capturing parentheses. +
+  PCRE2_ERROR_UNAVAILABLE
+
+The substring number, though not greater than the number of captures in the +pattern, is greater than the number of slots in the ovector, so the substring +could not be captured. +
+  PCRE2_ERROR_UNSET
+
+The substring did not participate in the match. For example, if the pattern is +(abc)|(def) and the subject is "def", and the ovector contains at least two +capturing slots, substring number 1 is unset. +

+
EXTRACTING A LIST OF ALL CAPTURED SUBSTRINGS
+

+int pcre2_substring_list_get(pcre2_match_data *match_data, +" PCRE2_UCHAR ***listptr, PCRE2_SIZE **lengthsptr); +
+
+void pcre2_substring_list_free(PCRE2_UCHAR **list); +

+

+The pcre2_substring_list_get() function extracts all available substrings +and builds a list of pointers to them. It also (optionally) builds a second +list that contains their lengths (in code units), excluding a terminating zero +that is added to each of them. All this is done in a single block of memory +that is obtained using the same memory allocation function that was used to get +the match data block. +

+

+This function must be called only after a successful match. If called after a +partial match, the error code PCRE2_ERROR_PARTIAL is returned. +

+

+The address of the memory block is returned via listptr, which is also +the start of the list of string pointers. The end of the list is marked by a +NULL pointer. The address of the list of lengths is returned via +lengthsptr. If your strings do not contain binary zeros and you do not +therefore need the lengths, you may supply NULL as the lengthsptr +argument to disable the creation of a list of lengths. The yield of the +function is zero if all went well, or PCRE2_ERROR_NOMEMORY if the memory block +could not be obtained. When the list is no longer needed, it should be freed by +calling pcre2_substring_list_free(). +

+

+If this function encounters a substring that is unset, which can happen when +capture group number n+1 matches some part of the subject, but group +n has not been used at all, it returns an empty string. This can be +distinguished from a genuine zero-length substring by inspecting the +appropriate offset in the ovector, which contain PCRE2_UNSET for unset +substrings, or by calling pcre2_substring_length_bynumber(). +

+
EXTRACTING CAPTURED SUBSTRINGS BY NAME
+

+int pcre2_substring_number_from_name(const pcre2_code *code, + PCRE2_SPTR name); +
+
+int pcre2_substring_length_byname(pcre2_match_data *match_data, + PCRE2_SPTR name, PCRE2_SIZE *length); +
+
+int pcre2_substring_copy_byname(pcre2_match_data *match_data, + PCRE2_SPTR name, PCRE2_UCHAR *buffer, PCRE2_SIZE *bufflen); +
+
+int pcre2_substring_get_byname(pcre2_match_data *match_data, + PCRE2_SPTR name, PCRE2_UCHAR **bufferptr, PCRE2_SIZE *bufflen); +
+
+void pcre2_substring_free(PCRE2_UCHAR *buffer); +

+

+To extract a substring by name, you first have to find associated number. +For example, for this pattern: +

+  (a+)b(?<xxx>\d+)...
+
+the number of the capture group called "xxx" is 2. If the name is known to be +unique (PCRE2_DUPNAMES was not set), you can find the number from the name by +calling pcre2_substring_number_from_name(). The first argument is the +compiled pattern, and the second is the name. The yield of the function is the +group number, PCRE2_ERROR_NOSUBSTRING if there is no group with that name, or +PCRE2_ERROR_NOUNIQUESUBSTRING if there is more than one group with that name. +Given the number, you can extract the substring directly from the ovector, or +use one of the "bynumber" functions described above. +

+

+For convenience, there are also "byname" functions that correspond to the +"bynumber" functions, the only difference being that the second argument is a +name instead of a number. If PCRE2_DUPNAMES is set and there are duplicate +names, these functions scan all the groups with the given name, and return the +captured substring from the first named group that is set. +

+

+If there are no groups with the given name, PCRE2_ERROR_NOSUBSTRING is +returned. If all groups with the name have numbers that are greater than the +number of slots in the ovector, PCRE2_ERROR_UNAVAILABLE is returned. If there +is at least one group with a slot in the ovector, but no group is found to be +set, PCRE2_ERROR_UNSET is returned. +

+

+Warning: If the pattern uses the (?| feature to set up multiple +capture groups with the same number, as described in the +section on duplicate group numbers +in the +pcre2pattern +page, you cannot use names to distinguish the different capture groups, because +names are not included in the compiled code. The matching process uses only +numbers. For this reason, the use of different names for groups with the +same number causes an error at compile time. +

+
CREATING A NEW STRING WITH SUBSTITUTIONS
+

+int pcre2_substitute(const pcre2_code *code, PCRE2_SPTR subject, + PCRE2_SIZE length, PCRE2_SIZE startoffset, + uint32_t options, pcre2_match_data *match_data, + pcre2_match_context *mcontext, PCRE2_SPTR replacement, + PCRE2_SIZE rlength, PCRE2_UCHAR *outputbuffer, + PCRE2_SIZE *outlengthptr); +

+

+This function optionally calls pcre2_match() and then makes a copy of the +subject string in outputbuffer, replacing parts that were matched with +the replacement string, whose length is supplied in rlength, which +can be given as PCRE2_ZERO_TERMINATED for a zero-terminated string. As a +special case, if replacement is NULL and rlength is zero, the +replacement is assumed to be an empty string. If rlength is non-zero, an +error occurs if replacement is NULL. +

+

+There is an option (see PCRE2_SUBSTITUTE_REPLACEMENT_ONLY below) to return just +the replacement string(s). The default action is to perform just one +replacement if the pattern matches, but there is an option that requests +multiple replacements (see PCRE2_SUBSTITUTE_GLOBAL below). +

+

+If successful, pcre2_substitute() returns the number of substitutions +that were carried out. This may be zero if no match was found, and is never +greater than one unless PCRE2_SUBSTITUTE_GLOBAL is set. A negative value is +returned if an error is detected. +

+

+Matches in which a \K item in a lookahead in the pattern causes the match to +end before it starts are not supported, and give rise to an error return. For +global replacements, matches in which \K in a lookbehind causes the match to +start earlier than the point that was reached in the previous iteration are +also not supported. +

+

+The first seven arguments of pcre2_substitute() are the same as for +pcre2_match(), except that the partial matching options are not +permitted, and match_data may be passed as NULL, in which case a match +data block is obtained and freed within this function, using memory management +functions from the match context, if provided, or else those that were used to +allocate memory for the compiled code. +

+

+If match_data is not NULL and PCRE2_SUBSTITUTE_MATCHED is not set, the +provided block is used for all calls to pcre2_match(), and its contents +afterwards are the result of the final call. For global changes, this will +always be a no-match error. The contents of the ovector within the match data +block may or may not have been changed. +

+

+As well as the usual options for pcre2_match(), a number of additional +options can be set in the options argument of pcre2_substitute(). +One such option is PCRE2_SUBSTITUTE_MATCHED. When this is set, an external +match_data block must be provided, and it must have already been used for +an external call to pcre2_match() with the same pattern and subject +arguments. The data in the match_data block (return code, offset vector) +is then used for the first substitution instead of calling pcre2_match() +from within pcre2_substitute(). This allows an application to check for a +match before choosing to substitute, without having to repeat the match. +

+

+The contents of the externally supplied match data block are not changed when +PCRE2_SUBSTITUTE_MATCHED is set. If PCRE2_SUBSTITUTE_GLOBAL is also set, +pcre2_match() is called after the first substitution to check for further +matches, but this is done using an internally obtained match data block, thus +always leaving the external block unchanged. +

+

+The code argument is not used for matching before the first substitution +when PCRE2_SUBSTITUTE_MATCHED is set, but it must be provided, even when +PCRE2_SUBSTITUTE_GLOBAL is not set, because it contains information such as the +UTF setting and the number of capturing parentheses in the pattern. +

+

+The default action of pcre2_substitute() is to return a copy of the +subject string with matched substrings replaced. However, if +PCRE2_SUBSTITUTE_REPLACEMENT_ONLY is set, only the replacement substrings are +returned. In the global case, multiple replacements are concatenated in the +output buffer. Substitution callouts (see +below) +can be used to separate them if necessary. +

+

+The outlengthptr argument of pcre2_substitute() must point to a +variable that contains the length, in code units, of the output buffer. If the +function is successful, the value is updated to contain the length in code +units of the new string, excluding the trailing zero that is automatically +added. +

+

+If the function is not successful, the value set via outlengthptr depends +on the type of error. For syntax errors in the replacement string, the value is +the offset in the replacement string where the error was detected. For other +errors, the value is PCRE2_UNSET by default. This includes the case of the +output buffer being too small, unless PCRE2_SUBSTITUTE_OVERFLOW_LENGTH is set. +

+

+PCRE2_SUBSTITUTE_OVERFLOW_LENGTH changes what happens when the output buffer is +too small. The default action is to return PCRE2_ERROR_NOMEMORY immediately. If +this option is set, however, pcre2_substitute() continues to go through +the motions of matching and substituting (without, of course, writing anything) +in order to compute the size of buffer that is needed, which will include the +extra space for the terminating NUL. This value is passed back via the +outlengthptr variable, with the result of the function still being +PCRE2_ERROR_NOMEMORY. +

+

+Passing a buffer size of zero is a permitted way of finding out how much memory +is needed for given substitution. However, this does mean that the entire +operation is carried out twice. Depending on the application, it may be more +efficient to allocate a large buffer and free the excess afterwards, instead of +using PCRE2_SUBSTITUTE_OVERFLOW_LENGTH. +

+

+The replacement string, which is interpreted as a UTF string in UTF mode, is +checked for UTF validity unless PCRE2_NO_UTF_CHECK is set. An invalid UTF +replacement string causes an immediate return with the relevant UTF error code. +

+

+If PCRE2_SUBSTITUTE_LITERAL is set, the replacement string is not interpreted +in any way. By default, however, a dollar character is an escape character that +can specify the insertion of characters from capture groups and names from +(*MARK) or other control verbs in the pattern. Dollar is the only escape +character (backslash is treated as literal). The following forms are +recognized: +

+  $$                  insert a dollar character
+  $n or ${n}          insert the contents of group n
+  $0 or $&            insert the entire matched substring
+  $`                  insert the substring that precedes the match
+  $'                  insert the substring that follows the match
+  $_                  insert the entire input string
+  $*MARK or ${*MARK}  insert a control verb name
+
+Either a group number or a group name can be given for n, for example $2 or +$NAME. Curly brackets are required only if the following character would be +interpreted as part of the number or name. The number may be zero to include +the entire matched string. For example, if the pattern a(b)c is matched with +"=abc=" and the replacement string "+$1$0$1+", the result is "=+babcb+=". +

+

+The JavaScript form $<name>, where the angle brackets are part of the syntax, +is also recognized for group names, but not for group numbers or *MARK. +

+

+$*MARK inserts the name from the last encountered backtracking control verb on +the matching path that has a name. (*MARK) must always include a name, but the +other verbs need not. For example, in the case of (*MARK:A)(*PRUNE) the name +inserted is "A", but for (*MARK:A)(*PRUNE:B) the relevant name is "B". This +facility can be used to perform simple simultaneous substitutions, as this +pcre2test example shows: +

+  /(*MARK:pear)apple|(*MARK:orange)lemon/g,replace=${*MARK}
+      apple lemon
+   2: pear orange
+
+PCRE2_SUBSTITUTE_GLOBAL causes the function to iterate over the subject string, +replacing every matching substring. If this option is not set, only the first +matching substring is replaced. The search for matches takes place in the +original subject string (that is, previous replacements do not affect it). +Iteration is implemented by advancing the startoffset value for each +search, which is always passed the entire subject string. If an offset limit is +set in the match context, searching stops when that limit is reached. +

+

+You can restrict the effect of a global substitution to a portion of the +subject string by setting either or both of startoffset and an offset +limit. Here is a pcre2test example: +

+  /B/g,replace=!,use_offset_limit
+  ABC ABC ABC ABC\=offset=3,offset_limit=12
+   2: ABC A!C A!C ABC
+
+When continuing with global substitutions after matching a substring with zero +length, an attempt to find a non-empty match at the same offset is performed. +If this is not successful, the offset is advanced by one character except when +CRLF is a valid newline sequence and the next two characters are CR, LF. In +this case, the offset is advanced by two characters. +

+

+PCRE2_SUBSTITUTE_UNKNOWN_UNSET causes references to capture groups that do +not appear in the pattern to be treated as unset groups. This option should be +used with care, because it means that a typo in a group name or number no +longer causes the PCRE2_ERROR_NOSUBSTRING error. +

+

+PCRE2_SUBSTITUTE_UNSET_EMPTY causes unset capture groups (including unknown +groups when PCRE2_SUBSTITUTE_UNKNOWN_UNSET is set) to be treated as empty +strings when inserted as described above. If this option is not set, an attempt +to insert an unset group causes the PCRE2_ERROR_UNSET error. This option does +not influence the extended substitution syntax described below. +

+

+PCRE2_SUBSTITUTE_EXTENDED causes extra processing to be applied to the +replacement string. Without this option, only the dollar character is special, +and only the group insertion forms listed above are valid. When +PCRE2_SUBSTITUTE_EXTENDED is set, several things change: +

+

+Firstly, backslash in a replacement string is interpreted as an escape +character. The usual forms such as \x{ddd} can be used to specify particular +character codes, and backslash followed by any non-alphanumeric character +quotes that character. Extended quoting can be coded using \Q...\E, exactly +as in pattern strings. The escapes \b and \v are interpreted as the +characters backspace and vertical tab, respectively. +

+

+The interpretation of backslash followed by one or more digits is the same as +in a pattern, which in Perl has some ambiguities. Details are given in the +pcre2pattern +page. +

+

+The Python form \g<n>, where the angle brackets are part of the syntax and n +is either a group name or number, is recognized as an altertive way of +inserting the contents of a group, for example \g<3>. +

+

+There are also four escape sequences for forcing the case of inserted letters. +Case forcing applies to all inserted characters, including those from capture +groups and letters within \Q...\E quoted sequences. The insertion mechanism +has three states: no case forcing, force upper case, and force lower case. The +escape sequences change the current state: \U and \L change to upper or lower +case forcing, respectively, and \E (when not terminating a \Q quoted +sequence) reverts to no case forcing. The sequences \u and \l force the next +character (if it is a letter) to upper or lower case, respectively, and then +the state automatically reverts to no case forcing. +

+

+However, if \u is immediately followed by \L or \l is immediately followed +by \U, the next character's case is forced by the first escape sequence, and +subsequent characters by the second. This provides a "title casing" facility +that can be applied to group captures. For example, if group 1 has captured +"heLLo", the replacement string "\u\L$1" becomes "Hello". +

+

+If either PCRE2_UTF or PCRE2_UCP was set when the pattern was compiled, Unicode +properties are used for case forcing characters whose code points are greater +than 127. However, only simple case folding, as determined by the Unicode file +CaseFolding.txt is supported. PCRE2 does not support language-specific +special casing rules such as using different lower case Greek sigmas in the +middle and ends of words (as defined in the Unicode file +SpecialCasing.txt). +

+

+Note that case forcing sequences such as \U...\E do not nest. For example, +the result of processing "\Uaa\LBB\Ecc\E" is "AAbbcc"; the final \E has no +effect. Note also that the PCRE2_ALT_BSUX and PCRE2_EXTRA_ALT_BSUX options do +not apply to replacement strings. +

+

+The final effect of setting PCRE2_SUBSTITUTE_EXTENDED is to add more +flexibility to capture group substitution. The syntax is similar to that used +by Bash: +

+  ${n:-string}
+  ${n:+string1:string2}
+
+As in the simple case, n may be a group number or a name. The first form +specifies a default value. If group n is set, its value is inserted; if +not, the string is expanded and the result inserted. The second form specifies +strings that are expanded and inserted when group n is set or unset, +respectively. The first form is just a convenient shorthand for +
+  ${n:+${n}:string}
+
+Backslash can be used to escape colons and closing curly brackets in the +replacement strings. A change of the case forcing state within a replacement +string remains in force afterwards, as shown in this pcre2test example: +
+  /(some)?(body)/substitute_extended,replace=${1:+\U:\L}HeLLo
+      body
+   1: hello
+      somebody
+   1: HELLO
+
+The PCRE2_SUBSTITUTE_UNSET_EMPTY option does not affect these extended +substitutions. However, PCRE2_SUBSTITUTE_UNKNOWN_UNSET does cause unknown +groups in the extended syntax forms to be treated as unset. +

+

+If PCRE2_SUBSTITUTE_LITERAL is set, PCRE2_SUBSTITUTE_UNKNOWN_UNSET, +PCRE2_SUBSTITUTE_UNSET_EMPTY, and PCRE2_SUBSTITUTE_EXTENDED are irrelevant and +are ignored. +

+
+Substitution errors +
+

+In the event of an error, pcre2_substitute() returns a negative error +code. Except for PCRE2_ERROR_NOMATCH (which is never returned), errors from +pcre2_match() are passed straight back. +

+

+PCRE2_ERROR_NOSUBSTRING is returned for a non-existent substring insertion, +unless PCRE2_SUBSTITUTE_UNKNOWN_UNSET is set. +

+

+PCRE2_ERROR_UNSET is returned for an unset substring insertion (including an +unknown substring when PCRE2_SUBSTITUTE_UNKNOWN_UNSET is set) when the simple +(non-extended) syntax is used and PCRE2_SUBSTITUTE_UNSET_EMPTY is not set. +

+

+PCRE2_ERROR_NOMEMORY is returned if the output buffer is not big enough. If the +PCRE2_SUBSTITUTE_OVERFLOW_LENGTH option is set, the size of buffer that is +needed is returned via outlengthptr. Note that this does not happen by +default. +

+

+PCRE2_ERROR_NULL is returned if PCRE2_SUBSTITUTE_MATCHED is set but the +match_data argument is NULL or if the subject or replacement +arguments are NULL. For backward compatibility reasons an exception is made for +the replacement argument if the rlength argument is also 0. +

+

+PCRE2_ERROR_BADREPLACEMENT is used for miscellaneous syntax errors in the +replacement string, with more particular errors being PCRE2_ERROR_BADREPESCAPE +(invalid escape sequence), PCRE2_ERROR_REPMISSINGBRACE (closing curly bracket +not found), PCRE2_ERROR_BADSUBSTITUTION (syntax error in extended group +substitution), and PCRE2_ERROR_BADSUBSPATTERN (the pattern match ended before +it started or the match started earlier than the current position in the +subject, which can happen if \K is used in an assertion). +

+

+As for all PCRE2 errors, a text message that describes the error can be +obtained by calling the pcre2_get_error_message() function (see +"Obtaining a textual error message" +above). +

+
+Substitution callouts +
+

+int pcre2_set_substitute_callout(pcre2_match_context *mcontext, + int (*callout_function)(pcre2_substitute_callout_block *, void *), + void *callout_data); +
+
+The pcre2_set_substitution_callout() function can be used to specify a +callout function for pcre2_substitute(). This information is passed in +a match context. The callout function is called after each substitution has +been processed, but it can cause the replacement not to happen. +

+

+The callout function is not called for simulated substitutions that happen as a +result of the PCRE2_SUBSTITUTE_OVERFLOW_LENGTH option. In this mode, when +substitution processing exceeds the buffer space provided by the caller, +processing continues by counting code units. The simulation is unable to +populate the callout block, and so the simulation is pessimistic about the +required buffer size. Whichever is larger of accepted or rejected substitution +is reported as the required size. Therefore, the returned buffer length may be +an overestimate (without a substitution callout, it is normally an exact +measurement). +

+

+The first argument of the callout function is a pointer to a substitute callout +block structure, which contains the following fields, not necessarily in this +order: +

+  uint32_t    version;
+  uint32_t    subscount;
+  PCRE2_SPTR  input;
+  PCRE2_SPTR  output;
+  PCRE2_SIZE *ovector;
+  uint32_t    oveccount;
+  PCRE2_SIZE  output_offsets[2];
+
+The version field contains the version number of the block format. The +current version is 0. The version number will increase in future if more fields +are added, but the intention is never to remove any of the existing fields. +

+

+The subscount field is the number of the current match. It is 1 for the +first callout, 2 for the second, and so on. The input and output +pointers are copies of the values passed to pcre2_substitute(). +

+

+The ovector field points to the ovector, which contains the result of the +most recent match. The oveccount field contains the number of pairs that +are set in the ovector, and is always greater than zero. +

+

+The output_offsets vector contains the offsets of the replacement in the +output string. This has already been processed for dollar and (if requested) +backslash substitutions as described above. +

+

+The second argument of the callout function is the value passed as +callout_data when the function was registered. The value returned by the +callout function is interpreted as follows: +

+

+If the value is zero, the replacement is accepted, and, if +PCRE2_SUBSTITUTE_GLOBAL is set, processing continues with a search for the next +match. If the value is not zero, the current replacement is not accepted. If +the value is greater than zero, processing continues when +PCRE2_SUBSTITUTE_GLOBAL is set. Otherwise (the value is less than zero or +PCRE2_SUBSTITUTE_GLOBAL is not set), the rest of the input is copied to the +output and the call to pcre2_substitute() exits, returning the number of +matches so far. +

+
+Substitution case callouts +
+

+int pcre2_set_substitute_case_callout(pcre2_match_context *mcontext, + PCRE2_SIZE (*callout_function)(PCRE2_SPTR, PCRE2_SIZE, + PCRE2_UCHAR *, PCRE2_SIZE, + int, void *), + void *callout_data); +
+
+The pcre2_set_substitution_case_callout() function can be used to specify +a callout function for pcre2_substitute() to use when performing case +transformations. This does not affect any case insensitivity behaviour when +performing a match, but only the user-visible transformations performed when +processing a substitution such as: +

+    pcre2_substitute(..., "\\U$1", ...)
+
+

+

+The default case transformations applied by PCRE2 are reasonably complete, and, +in UTF or UCP mode, perform the simple locale-invariant case transformations as +specified by Unicode. This is suitable for the internal (invisible) +case-equivalence procedures used during pattern matching, but an application +may wish to use more sophisticated locale-aware processing for the user-visible +substitution transformations. +

+

+One example implementation of the callout_function using the ICU +library would be: +
+
+

+    PCRE2_SIZE
+    icu_case_callout(
+      PCRE2_SPTR input, PCRE2_SIZE input_len,
+      PCRE2_UCHAR *output, PCRE2_SIZE output_cap,
+      int to_case, void *data_ptr)
+    {
+      UErrorCode err = U_ZERO_ERROR;
+      int32_t r = to_case == PCRE2_SUBSTITUTE_CASE_LOWER
+        ? u_strToLower(output, output_cap, input, input_len, NULL, &err)
+        : to_case == PCRE2_SUBSTITUTE_CASE_UPPER
+        ? u_strToUpper(output, output_cap, input, input_len, NULL, &err)
+        : u_strToTitle(output, output_cap, input, input_len, &first_char_only,
+                       NULL, &err);
+      if (U_FAILURE(err)) return (~(PCRE2_SIZE)0);
+      return r;
+    }
+
+

+

+The first and second arguments of the case callout function are the Unicode +string to transform. +

+

+The third and fourth arguments are the output buffer and its capacity. +

+

+The fifth is one of the constants PCRE2_SUBSTITUTE_CASE_LOWER, +PCRE2_SUBSTITUTE_CASE_UPPER, or PCRE2_SUBSTITUTE_CASE_TITLE_FIRST. +PCRE2_SUBSTITUTE_CASE_LOWER and PCRE2_SUBSTITUTE_CASE_UPPER are passed to the +callout to indicate that the case of the entire callout input should be +case-transformed. PCRE2_SUBSTITUTE_CASE_TITLE_FIRST is passed to indicate that +only the first character or glyph should be transformed to Unicode titlecase +and the rest to Unicode lowercase (note that titlecasing sometimes uses Unicode +properties to titlecase each word in a string; but PCRE2 is requesting that only +the single leading character is to be titlecased). +

+

+The sixth argument is the callout_data supplied to +pcre2_set_substitute_case_callout(). +

+

+The resulting string in the destination buffer may be larger or smaller than the +input, if the casing rules merge or split characters. The return value is the +length required for the output string. If a buffer of sufficient size was +provided to the callout, then the result must be written to the buffer and the +number of code units returned. If the result does not fit in the provided +buffer, then the required capacity must be returned and PCRE2 will not make use +of the output buffer. PCRE2 provides input and output buffers which overlap, so +the callout must support this by suitable internal buffering. +

+

+Alternatively, if the callout wishes to indicate an error, then it may return +(~(PCRE2_SIZE)0). In this case pcre2_substitute() will immediately fail with +error PCRE2_ERROR_REPLACECASE. +

+

+When a case callout is combined with the PCRE2_SUBSTITUTE_OVERFLOW_LENGTH +option, there are situations when pcre2_substitute() will return an +underestimate of the required buffer size. If you call pcre2_substitute() once +with PCRE2_SUBSTITUTE_OVERFLOW_LENGTH, and the input buffer is too small for +the replacement string to be constructed, then instead of calling the case +callout, pcre2_substitute() will make an estimate of the required buffer size. +The second call should also pass PCRE2_SUBSTITUTE_OVERFLOW_LENGTH, because that +second call is not guaranteed to succeed either, if the case callout requires +more buffer space than expected. The caller must make repeated attempts in a +loop. +

+
DUPLICATE CAPTURE GROUP NAMES
+

+int pcre2_substring_nametable_scan(const pcre2_code *code, + PCRE2_SPTR name, PCRE2_SPTR *first, PCRE2_SPTR *last); +

+

+When a pattern is compiled with the PCRE2_DUPNAMES option, names for capture +groups are not required to be unique. Duplicate names are always allowed for +groups with the same number, created by using the (?| feature. Indeed, if such +groups are named, they are required to use the same names. +

+

+Normally, patterns that use duplicate names are such that in any one match, +only one of each set of identically-named groups participates. An example is +shown in the +pcre2pattern +documentation. +

+

+When duplicates are present, pcre2_substring_copy_byname() and +pcre2_substring_get_byname() return the first substring corresponding to +the given name that is set. Only if none are set is PCRE2_ERROR_UNSET is +returned. The pcre2_substring_number_from_name() function returns the +error PCRE2_ERROR_NOUNIQUESUBSTRING when there are duplicate names. +

+

+If you want to get full details of all captured substrings for a given name, +you must use the pcre2_substring_nametable_scan() function. The first +argument is the compiled pattern, and the second is the name. If the third and +fourth arguments are NULL, the function returns a group number for a unique +name, or PCRE2_ERROR_NOUNIQUESUBSTRING otherwise. +

+

+When the third and fourth arguments are not NULL, they must be pointers to +variables that are updated by the function. After it has run, they point to the +first and last entries in the name-to-number table for the given name, and the +function returns the length of each entry in code units. In both cases, +PCRE2_ERROR_NOSUBSTRING is returned if there are no entries for the given name. +

+

+The format of the name table is described +above +in the section entitled Information about a pattern. Given all the +relevant entries for the name, you can extract each of their numbers, and hence +the captured data. +

+
FINDING ALL POSSIBLE MATCHES AT ONE POSITION
+

+The traditional matching function uses a similar algorithm to Perl, which stops +when it finds the first match at a given point in the subject. If you want to +find all possible matches, or the longest possible match at a given position, +consider using the alternative matching function (see below) instead. If you +cannot use the alternative function, you can kludge it up by making use of the +callout facility, which is described in the +pcre2callout +documentation. +

+

+What you have to do is to insert a callout right at the end of the pattern. +When your callout function is called, extract and save the current matched +substring. Then return 1, which forces pcre2_match() to backtrack and try +other alternatives. Ultimately, when it runs out of matches, +pcre2_match() will yield PCRE2_ERROR_NOMATCH. +

+
MATCHING A PATTERN: THE ALTERNATIVE FUNCTION
+

+int pcre2_dfa_match(const pcre2_code *code, PCRE2_SPTR subject, + PCRE2_SIZE length, PCRE2_SIZE startoffset, + uint32_t options, pcre2_match_data *match_data, + pcre2_match_context *mcontext, + int *workspace, PCRE2_SIZE wscount); +

+

+The function pcre2_dfa_match() is called to match a subject string +against a compiled pattern, using a matching algorithm that scans the subject +string just once (not counting lookaround assertions), and does not backtrack +(except when processing lookaround assertions). This has different +characteristics to the normal algorithm, and is not compatible with Perl. Some +of the features of PCRE2 patterns are not supported. Nevertheless, there are +times when this kind of matching can be useful. For a discussion of the two +matching algorithms, and a list of features that pcre2_dfa_match() does +not support, see the +pcre2matching +documentation. +

+

+The arguments for the pcre2_dfa_match() function are the same as for +pcre2_match(), plus two extras. The ovector within the match data block +is used in a different way, and this is described below. The other common +arguments are used in the same way as for pcre2_match(), so their +description is not repeated here. +

+

+The two additional arguments provide workspace for the function. The workspace +vector should contain at least 20 elements. It is used for keeping track of +multiple paths through the pattern tree. More workspace is needed for patterns +and subjects where there are a lot of potential matches. +

+

+Here is an example of a simple call to pcre2_dfa_match(): +

+  int wspace[20];
+  pcre2_match_data *md = pcre2_match_data_create(4, NULL);
+  int rc = pcre2_dfa_match(
+    re,             /* result of pcre2_compile() */
+    "some string",  /* the subject string */
+    11,             /* the length of the subject string */
+    0,              /* start at offset 0 in the subject */
+    0,              /* default options */
+    md,             /* the match data block */
+    NULL,           /* a match context; NULL means use defaults */
+    wspace,         /* working space vector */
+    20);            /* number of elements (NOT size in bytes) */
+
+

+
+Option bits for pcre2_dfa_match() +
+

+The unused bits of the options argument for pcre2_dfa_match() must +be zero. The only bits that may be set are PCRE2_ANCHORED, +PCRE2_COPY_MATCHED_SUBJECT, PCRE2_ENDANCHORED, PCRE2_NOTBOL, PCRE2_NOTEOL, +PCRE2_NOTEMPTY, PCRE2_NOTEMPTY_ATSTART, PCRE2_NO_UTF_CHECK, PCRE2_PARTIAL_HARD, +PCRE2_PARTIAL_SOFT, PCRE2_DFA_SHORTEST, and PCRE2_DFA_RESTART. All but the last +four of these are exactly the same as for pcre2_match(), so their +description is not repeated here. +

+  PCRE2_PARTIAL_HARD
+  PCRE2_PARTIAL_SOFT
+
+These have the same general effect as they do for pcre2_match(), but the +details are slightly different. When PCRE2_PARTIAL_HARD is set for +pcre2_dfa_match(), it returns PCRE2_ERROR_PARTIAL if the end of the +subject is reached and there is still at least one matching possibility that +requires additional characters. This happens even if some complete matches have +already been found. When PCRE2_PARTIAL_SOFT is set, the return code +PCRE2_ERROR_NOMATCH is converted into PCRE2_ERROR_PARTIAL if the end of the +subject is reached, there have been no complete matches, but there is still at +least one matching possibility. The portion of the string that was inspected +when the longest partial match was found is set as the first matching string in +both cases. There is a more detailed discussion of partial and multi-segment +matching, with examples, in the +pcre2partial +documentation. +
+  PCRE2_DFA_SHORTEST
+
+Setting the PCRE2_DFA_SHORTEST option causes the matching algorithm to stop as +soon as it has found one match. Because of the way the alternative algorithm +works, this is necessarily the shortest possible match at the first possible +matching point in the subject string. +
+  PCRE2_DFA_RESTART
+
+When pcre2_dfa_match() returns a partial match, it is possible to call it +again, with additional subject characters, and have it continue with the same +match. The PCRE2_DFA_RESTART option requests this action; when it is set, the +workspace and wscount options must reference the same vector as +before because data about the match so far is left in them after a partial +match. There is more discussion of this facility in the +pcre2partial +documentation. +

+
+Successful returns from pcre2_dfa_match() +
+

+When pcre2_dfa_match() succeeds, it may have matched more than one +substring in the subject. Note, however, that all the matches from one run of +the function start at the same point in the subject. The shorter matches are +all initial substrings of the longer matches. For example, if the pattern +

+  <.*>
+
+is matched against the string +
+  This is <something> <something else> <something further> no more
+
+the three matched strings are +
+  <something> <something else> <something further>
+  <something> <something else>
+  <something>
+
+On success, the yield of the function is a number greater than zero, which is +the number of matched substrings. The offsets of the substrings are returned in +the ovector, and can be extracted by number in the same way as for +pcre2_match(), but the numbers bear no relation to any capture groups +that may exist in the pattern, because DFA matching does not support capturing. +

+

+Calls to the convenience functions that extract substrings by name +return the error PCRE2_ERROR_DFA_UFUNC (unsupported function) if used after a +DFA match. The convenience functions that extract substrings by number never +return PCRE2_ERROR_NOSUBSTRING. +

+

+The matched strings are stored in the ovector in reverse order of length; that +is, the longest matching string is first. If there were too many matches to fit +into the ovector, the yield of the function is zero, and the vector is filled +with the longest matches. +

+

+NOTE: PCRE2's "auto-possessification" optimization usually applies to character +repeats at the end of a pattern (as well as internally). For example, the +pattern "a\d+" is compiled as if it were "a\d++". For DFA matching, this +means that only one possible match is found. If you really do want multiple +matches in such cases, either use an ungreedy repeat such as "a\d+?" or set +the PCRE2_NO_AUTO_POSSESS option when compiling. +

+
+Error returns from pcre2_dfa_match() +
+

+The pcre2_dfa_match() function returns a negative number when it fails. +Many of the errors are the same as for pcre2_match(), as described +above. +There are in addition the following errors that are specific to +pcre2_dfa_match(): +

+  PCRE2_ERROR_DFA_UITEM
+
+This return is given if pcre2_dfa_match() encounters an item in the +pattern that it does not support, for instance, the use of \C in a UTF mode or +a backreference. +
+  PCRE2_ERROR_DFA_UCOND
+
+This return is given if pcre2_dfa_match() encounters a condition item +that uses a backreference for the condition, or a test for recursion in a +specific capture group. These are not supported. +
+  PCRE2_ERROR_DFA_UINVALID_UTF
+
+This return is given if pcre2_dfa_match() is called for a pattern that +was compiled with PCRE2_MATCH_INVALID_UTF. This is not supported for DFA +matching. +
+  PCRE2_ERROR_DFA_WSSIZE
+
+This return is given if pcre2_dfa_match() runs out of space in the +workspace vector. +
+  PCRE2_ERROR_DFA_RECURSE
+
+When a recursion or subroutine call is processed, the matching function calls +itself recursively, using private memory for the ovector and workspace. +This error is given if the internal ovector is not large enough. This should be +extremely rare, as a vector of size 1000 is used. +
+  PCRE2_ERROR_DFA_BADRESTART
+
+When pcre2_dfa_match() is called with the PCRE2_DFA_RESTART option, +some plausibility checks are made on the contents of the workspace, which +should contain data about the previous partial match. If any of these checks +fail, this error is given. +

+
SEE ALSO
+

+pcre2build(3), pcre2callout(3), pcre2demo(3), +pcre2matching(3), pcre2partial(3), pcre2posix(3), +pcre2sample(3), pcre2unicode(3). +

+
AUTHOR
+

+Philip Hazel +
+Retired from University Computing Service +
+Cambridge, England. +
+

+
REVISION
+

+Last updated: 26 December 2024 +
+Copyright © 1997-2024 University of Cambridge. +
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2build.html b/miniconda3/share/doc/pcre2/html/pcre2build.html new file mode 100644 index 0000000000000000000000000000000000000000..f4e127f14cadee1d3c1e73030cc0462e0934e1fd --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2build.html @@ -0,0 +1,652 @@ + + +pcre2build specification + + +

pcre2build man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+

+
BUILDING PCRE2
+

+PCRE2 is distributed with a configure script that can be used to build +the library in Unix-like environments using the applications known as +Autotools. Also in the distribution are files to support building using +CMake instead of configure. The text file +README +contains general information about building with Autotools (some of which is +repeated below), and also has some comments about building on various operating +systems. The files in the vms directory support building under OpenVMS. +There is a lot more information about building PCRE2 without using +Autotools (including information about using CMake and building "by +hand") in the text file called +NON-AUTOTOOLS-BUILD. +You should consult this file as well as the +README +file if you are building in a non-Unix-like environment. +

+
PCRE2 BUILD-TIME OPTIONS
+

+The rest of this document describes the optional features of PCRE2 that can be +selected when the library is compiled. It assumes use of the configure +script, where the optional features are selected or deselected by providing +options to configure before running the make command. However, the +same options can be selected in both Unix-like and non-Unix-like environments +if you are using CMake instead of configure to build PCRE2. +

+

+If you are not using Autotools or CMake, option selection can be done by +editing the config.h file, or by passing parameter settings to the +compiler, as described in +NON-AUTOTOOLS-BUILD. +

+

+The complete list of options for configure (which includes the standard +ones such as the selection of the installation directory) can be obtained by +running +

+  ./configure --help
+
+The following sections include descriptions of "on/off" options whose names +begin with --enable or --disable. Because of the way that configure +works, --enable and --disable always come in pairs, so the complementary option +always exists as well, but as it specifies the default, it is not described. +Options that specify values have names that start with --with. At the end of a +configure run, a summary of the configuration is output. +

+
BUILDING 8-BIT, 16-BIT AND 32-BIT LIBRARIES
+

+By default, a library called libpcre2-8 is built, containing functions +that take string arguments contained in arrays of bytes, interpreted either as +single-byte characters, or UTF-8 strings. You can also build two other +libraries, called libpcre2-16 and libpcre2-32, which process +strings that are contained in arrays of 16-bit and 32-bit code units, +respectively. These can be interpreted either as single-unit characters or +UTF-16/UTF-32 strings. To build these additional libraries, add one or both of +the following to the configure command: +

+  --enable-pcre2-16
+  --enable-pcre2-32
+
+If you do not want the 8-bit library, add +
+  --disable-pcre2-8
+
+as well. At least one of the three libraries must be built. Note that the POSIX +wrapper is for the 8-bit library only, and that pcre2grep is an 8-bit +program. Neither of these are built if you select only the 16-bit or 32-bit +libraries. +

+
BUILDING SHARED AND STATIC LIBRARIES
+

+The Autotools PCRE2 building process uses libtool to build both shared +and static libraries by default. You can suppress an unwanted library by adding +one of +

+  --disable-shared
+  --disable-static
+
+to the configure command. Setting --disable-shared ensures that PCRE2 +libraries are built as static libraries. The binaries that are then created as +part of the build process (for example, pcre2test and pcre2grep) +are linked statically with one or more PCRE2 libraries, but may also be +dynamically linked with other libraries such as libc. If you want these +binaries to be fully statically linked, you can set LDFLAGS like this: +
+
+LDFLAGS=--static ./configure --disable-shared +
+
+Note the two hyphens in --static. Of course, this works only if static versions +of all the relevant libraries are available for linking. +

+
UNICODE AND UTF SUPPORT
+

+By default, PCRE2 is built with support for Unicode and UTF character strings. +To build it without Unicode support, add +

+  --disable-unicode
+
+to the configure command. This setting applies to all three libraries. It +is not possible to build one library with Unicode support and another without +in the same configuration. +

+

+Of itself, Unicode support does not make PCRE2 treat strings as UTF-8, UTF-16 +or UTF-32. To do that, applications that use the library can set the PCRE2_UTF +option when they call pcre2_compile() to compile a pattern. +Alternatively, patterns may be started with (*UTF) unless the application has +locked this out by setting PCRE2_NEVER_UTF. +

+

+UTF support allows the libraries to process character code points up to +0x10ffff in the strings that they handle. Unicode support also gives access to +the Unicode properties of characters, using pattern escapes such as \P, \p, +and \X. Only the general category properties such as Lu and Nd, +script names, and some bi-directional properties are supported. Details are +given in the +pcre2pattern +documentation. +

+

+Pattern escapes such as \d and \w do not by default make use of Unicode +properties. The application can request that they do by setting the PCRE2_UCP +option. Unless the application has set PCRE2_NEVER_UCP, a pattern may also +request this by starting with (*UCP). +

+
DISABLING THE USE OF \C
+

+The \C escape sequence, which matches a single code unit, even in a UTF mode, +can cause unpredictable behaviour because it may leave the current matching +point in the middle of a multi-code-unit character. The application can lock it +out by setting the PCRE2_NEVER_BACKSLASH_C option when calling +pcre2_compile(). There is also a build-time option +

+  --enable-never-backslash-C
+
+(note the upper case C) which locks out the use of \C entirely. +

+
JUST-IN-TIME COMPILER SUPPORT
+

+Just-in-time (JIT) compiler support is included in the build by specifying +

+  --enable-jit
+
+This support is available only for certain hardware architectures. If this +option is set for an unsupported architecture, a building error occurs. +If in doubt, use +
+  --enable-jit=auto
+
+which enables JIT only if the current hardware is supported. You can check +if JIT is enabled in the configuration summary that is output at the end of a +configure run. If you are enabling JIT under SELinux you may also want to +add +
+  --enable-jit-sealloc
+
+which enables the use of an execmem allocator in JIT that is compatible with +SELinux. This has no effect if JIT is not enabled. See the +pcre2jit +documentation for a discussion of JIT usage. When JIT support is enabled, +pcre2grep automatically makes use of it, unless you add +
+  --disable-pcre2grep-jit
+
+to the configure command. +

+
NEWLINE RECOGNITION
+

+By default, PCRE2 interprets the linefeed (LF) character as indicating the end +of a line. This is the normal newline character on Unix-like systems. You can +compile PCRE2 to use carriage return (CR) instead, by adding +

+  --enable-newline-is-cr
+
+to the configure command. There is also an --enable-newline-is-lf option, +which explicitly specifies linefeed as the newline character. +

+

+Alternatively, you can specify that line endings are to be indicated by the +two-character sequence CRLF (CR immediately followed by LF). If you want this, +add +

+  --enable-newline-is-crlf
+
+to the configure command. There is a fourth option, specified by +
+  --enable-newline-is-anycrlf
+
+which causes PCRE2 to recognize any of the three sequences CR, LF, or CRLF as +indicating a line ending. A fifth option, specified by +
+  --enable-newline-is-any
+
+causes PCRE2 to recognize any Unicode newline sequence. The Unicode newline +sequences are the three just mentioned, plus the single characters VT (vertical +tab, U+000B), FF (form feed, U+000C), NEL (next line, U+0085), LS (line +separator, U+2028), and PS (paragraph separator, U+2029). The final option is +
+  --enable-newline-is-nul
+
+which causes NUL (binary zero) to be set as the default line-ending character. +

+

+Whatever default line ending convention is selected when PCRE2 is built can be +overridden by applications that use the library. At build time it is +recommended to use the standard for your operating system. +

+
WHAT \R MATCHES
+

+By default, the sequence \R in a pattern matches any Unicode newline sequence, +independently of what has been selected as the line ending sequence. If you +specify +

+  --enable-bsr-anycrlf
+
+the default is changed so that \R matches only CR, LF, or CRLF. Whatever is +selected when PCRE2 is built can be overridden by applications that use the +library. +

+
HANDLING VERY LARGE PATTERNS
+

+Within a compiled pattern, offset values are used to point from one part to +another (for example, from an opening parenthesis to an alternation +metacharacter). By default, in the 8-bit and 16-bit libraries, two-byte values +are used for these offsets, leading to a maximum size for a compiled pattern of +around 64 thousand code units. This is sufficient to handle all but the most +gigantic patterns. Nevertheless, some people do want to process truly enormous +patterns, so it is possible to compile PCRE2 to use three-byte or four-byte +offsets by adding a setting such as +

+  --with-link-size=3
+
+to the configure command. The value given must be 2, 3, or 4. For the +16-bit library, a value of 3 is rounded up to 4. In these libraries, using +longer offsets slows down the operation of PCRE2 because it has to load +additional data when handling them. For the 32-bit library the value is always +4 and cannot be overridden; the value of --with-link-size is ignored. +

+
LIMITING PCRE2 RESOURCE USAGE
+

+The pcre2_match() function increments a counter each time it goes round +its main loop. Putting a limit on this counter controls the amount of computing +resource used by a single call to pcre2_match(). The limit can be changed +at run time, as described in the +pcre2api +documentation. The default is 10 million, but this can be changed by adding a +setting such as +

+  --with-match-limit=500000
+
+to the configure command. This setting also applies to the +pcre2_dfa_match() matching function, and to JIT matching (though the +counting is done differently). +

+

+The pcre2_match() function uses heap memory to record backtracking +points. The more nested backtracking points there are (that is, the deeper the +search tree), the more memory is needed. There is an upper limit, specified in +kibibytes (units of 1024 bytes). This limit can be changed at run time, as +described in the +pcre2api +documentation. The default limit (in effect unlimited) is 20 million. You can +change this by a setting such as +

+  --with-heap-limit=500
+
+which limits the amount of heap to 500 KiB. This limit applies only to +interpretive matching in pcre2_match() and pcre2_dfa_match(), which +may also use the heap for internal workspace when processing complicated +patterns. This limit does not apply when JIT (which has its own memory +arrangements) is used. +

+

+You can also explicitly limit the depth of nested backtracking in the +pcre2_match() interpreter. This limit defaults to the value that is set +for --with-match-limit. You can set a lower default limit by adding, for +example, +

+  --with-match-limit-depth=10000
+
+to the configure command. This value can be overridden at run time. This +depth limit indirectly limits the amount of heap memory that is used, but +because the size of each backtracking "frame" depends on the number of +capturing parentheses in a pattern, the amount of heap that is used before the +limit is reached varies from pattern to pattern. This limit was more useful in +versions before 10.30, where function recursion was used for backtracking. +

+

+As well as applying to pcre2_match(), the depth limit also controls +the depth of recursive function calls in pcre2_dfa_match(). These are +used for lookaround assertions, atomic groups, and recursion within patterns. +The limit does not apply to JIT matching. +

+
LIMITING VARIABLE-LENGTH LOOKBEHIND ASSERTIONS
+

+Lookbehind assertions in which one or more branches can match a variable number +of characters are supported only if there is a maximum matching length for each +top-level branch. There is a limit to this maximum that defaults to 255 +characters. You can alter this default by a setting such as +

+  --with-max-varlookbehind=100
+
+The limit can be changed at runtime by calling +pcre2_set_max_varlookbehind(). Lookbehind assertions in which every +branch matches a fixed number of characters (not necessarily all the same) are +not constrained by this limit. +

+
CREATING CHARACTER TABLES AT BUILD TIME
+

+PCRE2 uses fixed tables for processing characters whose code points are less +than 256. By default, PCRE2 is built with a set of tables that are distributed +in the file src/pcre2_chartables.c.dist. These tables are for ASCII codes +only. If you add +

+  --enable-rebuild-chartables
+
+to the configure command, the distributed tables are no longer used. +Instead, a program called pcre2_dftables is compiled and run. This +outputs the source for new set of tables, created in the default locale of your +C run-time system. This method of replacing the tables does not work if you are +cross compiling, because pcre2_dftables needs to be run on the local +host and therefore not compiled with the cross compiler. +

+

+If you need to create alternative tables when cross compiling, you will have to +do so "by hand". There may also be other reasons for creating tables manually. +To cause pcre2_dftables to be built on the local host, run a normal +compiling command, and then run the program with the output file as its +argument, for example: +

+  cc src/pcre2_dftables.c -o pcre2_dftables
+  ./pcre2_dftables src/pcre2_chartables.c
+
+This builds the tables in the default locale of the local host. If you want to +specify a locale, you must use the -L option: +
+  LC_ALL=fr_FR ./pcre2_dftables -L src/pcre2_chartables.c
+
+You can also specify -b (with or without -L). This causes the tables to be +written in binary instead of as source code. A set of binary tables can be +loaded into memory by an application and passed to pcre2_compile() in the +same way as tables created by calling pcre2_maketables(). The tables are +just a string of bytes, independent of hardware characteristics such as +endianness. This means they can be bundled with an application that runs in +different environments, to ensure consistent behaviour. +

+
USING EBCDIC CODE
+

+PCRE2 assumes by default that it will run in an environment where the character +code is ASCII or Unicode, which is a superset of ASCII. This is the case for +most computer operating systems. PCRE2 can, however, be compiled to run in an +8-bit EBCDIC environment by adding +

+  --enable-ebcdic --disable-unicode
+
+to the configure command. This setting implies +--enable-rebuild-chartables. You should only use it if you know that you are in +an EBCDIC environment (for example, an IBM mainframe operating system). +

+

+It is not possible to support both EBCDIC and UTF-8 codes in the same version +of the library. Consequently, --enable-unicode and --enable-ebcdic are mutually +exclusive. +

+

+The EBCDIC character that corresponds to an ASCII LF is assumed to have the +value 0x15 by default. However, in some EBCDIC environments, 0x25 is used. In +such an environment you should use +

+  --enable-ebcdic-nl25
+
+as well as, or instead of, --enable-ebcdic. The EBCDIC character for CR has the +same value as in ASCII, namely, 0x0d. Whichever of 0x15 and 0x25 is not +chosen as LF is made to correspond to the Unicode NEL character (which, in +Unicode, is 0x85). +

+

+The options that select newline behaviour, such as --enable-newline-is-cr, +and equivalent run-time options, refer to these character values in an EBCDIC +environment. +

+
PCRE2GREP SUPPORT FOR EXTERNAL SCRIPTS
+

+By default pcre2grep supports the use of callouts with string arguments +within the patterns it is matching. There are two kinds: one that generates +output using local code, and another that calls an external program or script. +If --disable-pcre2grep-callout-fork is added to the configure command, +only the first kind of callout is supported; if --disable-pcre2grep-callout is +used, all callouts are completely ignored. For more details of pcre2grep +callouts, see the +pcre2grep +documentation. +

+
PCRE2GREP OPTIONS FOR COMPRESSED FILE SUPPORT
+

+By default, pcre2grep reads all files as plain text. You can build it so +that it recognizes files whose names end in .gz or .bz2, and reads +them with libz or libbz2, respectively, by adding one or both of +

+  --enable-pcre2grep-libz
+  --enable-pcre2grep-libbz2
+
+to the configure command. These options naturally require that the +relevant libraries are installed on your system. Configuration will fail if +they are not. +

+
PCRE2GREP BUFFER SIZE
+

+pcre2grep uses an internal buffer to hold a "window" on the file it is +scanning, in order to be able to output "before" and "after" lines when it +finds a match. The default starting size of the buffer is 20KiB. The buffer +itself is three times this size, but because of the way it is used for holding +"before" lines, the longest line that is guaranteed to be processable is the +notional buffer size. If a longer line is encountered, pcre2grep +automatically expands the buffer, up to a specified maximum size, whose default +is 1MiB or the starting size, whichever is the larger. You can change the +default parameter values by adding, for example, +

+  --with-pcre2grep-bufsize=51200
+  --with-pcre2grep-max-bufsize=2097152
+
+to the configure command. The caller of pcre2grep can override +these values by using --buffer-size and --max-buffer-size on the command line. +

+
PCRE2TEST OPTION FOR LIBREADLINE SUPPORT
+

+If you add one of +

+  --enable-pcre2test-libreadline
+  --enable-pcre2test-libedit
+
+to the configure command, pcre2test is linked with the +libreadline orlibedit library, respectively, and when its input is +from a terminal, it reads it using the readline() function. This provides +line-editing and history facilities. Note that libreadline is +GPL-licensed, so if you distribute a binary of pcre2test linked in this +way, there may be licensing issues. These can be avoided by linking instead +with libedit, which has a BSD licence. +

+

+Setting --enable-pcre2test-libreadline causes the -lreadline option to be +added to the pcre2test build. In many operating environments with a +system-installed readline library this is sufficient. However, in some +environments (e.g. if an unmodified distribution version of readline is in +use), some extra configuration may be necessary. The INSTALL file for +libreadline says this: +

+  "Readline uses the termcap functions, but does not link with
+  the termcap or curses library itself, allowing applications
+  which link with readline the to choose an appropriate library."
+
+If your environment has not been set up so that an appropriate library is +automatically included, you may need to add something like +
+  LIBS="-ncurses"
+
+immediately before the configure command. +

+
INCLUDING DEBUGGING CODE
+

+If you add +

+  --enable-debug
+
+to the configure command, additional debugging code is included in the +build. This feature is intended for use by the PCRE2 maintainers. +

+
DEBUGGING WITH VALGRIND SUPPORT
+

+If you add +

+  --enable-valgrind
+
+to the configure command, PCRE2 will use valgrind annotations to mark +certain memory regions as unaddressable. This allows it to detect invalid +memory accesses, and is mostly useful for debugging PCRE2 itself. +

+
CODE COVERAGE REPORTING
+

+If your C compiler is gcc, you can build a version of PCRE2 that can generate a +code coverage report for its test suite. To enable this, you must install +lcov version 1.6 or above. Then specify +

+  --enable-coverage
+
+to the configure command and build PCRE2 in the usual way. +

+

+Note that using ccache (a caching C compiler) is incompatible with code +coverage reporting. If you have configured ccache to run automatically +on your system, you must set the environment variable +

+  CCACHE_DISABLE=1
+
+before running make to build PCRE2, so that ccache is not used. +

+

+When --enable-coverage is used, the following addition targets are added to the +Makefile: +

+  make coverage
+
+This creates a fresh coverage report for the PCRE2 test suite. It is equivalent +to running "make coverage-reset", "make coverage-baseline", "make check", and +then "make coverage-report". +
+  make coverage-reset
+
+This zeroes the coverage counters, but does nothing else. +
+  make coverage-baseline
+
+This captures baseline coverage information. +
+  make coverage-report
+
+This creates the coverage report. +
+  make coverage-clean-report
+
+This removes the generated coverage report without cleaning the coverage data +itself. +
+  make coverage-clean-data
+
+This removes the captured coverage data without removing the coverage files +created at compile time (*.gcno). +
+  make coverage-clean
+
+This cleans all coverage data including the generated coverage report. For more +information about code coverage, see the gcov and lcov +documentation. +

+
DISABLING THE Z AND T FORMATTING MODIFIERS
+

+The C99 standard defines formatting modifiers z and t for size_t and +ptrdiff_t values, respectively. By default, PCRE2 uses these modifiers in +environments other than old versions of Microsoft Visual Studio when +__STDC_VERSION__ is defined and has a value greater than or equal to 199901L +(indicating support for C99). +However, there is at least one environment that claims to be C99 but does not +support these modifiers. If +

+  --disable-percent-zt
+
+is specified, no use is made of the z or t modifiers. Instead of %td or %zu, +a suitable format is used depending in the size of long for the platform. +

+
SUPPORT FOR FUZZERS
+

+There is a special option for use by people who want to run fuzzing tests on +PCRE2: +

+  --enable-fuzz-support
+
+At present this applies only to the 8-bit library. If set, it causes an extra +library called libpcre2-fuzzsupport.a to be built, but not installed. This +contains a single function called LLVMFuzzerTestOneInput() whose arguments are +a pointer to a string and the length of the string. When called, this function +tries to compile the string as a pattern, and if that succeeds, to match it. +This is done both with no options and with some random options bits that are +generated from the string. +

+

+Setting --enable-fuzz-support also causes a binary called pcre2fuzzcheck +to be created. This is normally run under valgrind or used when PCRE2 is +compiled with address sanitizing enabled. It calls the fuzzing function and +outputs information about what it is doing. The input strings are specified by +arguments: if an argument starts with "=" the rest of it is a literal input +string. Otherwise, it is assumed to be a file name, and the contents of the +file are the test string. +

+
OBSOLETE OPTION
+

+In versions of PCRE2 prior to 10.30, there were two ways of handling +backtracking in the pcre2_match() function. The default was to use the +system stack, but if +

+  --disable-stack-for-recursion
+
+was set, memory on the heap was used. From release 10.30 onwards this has +changed (the stack is no longer used) and this option now does nothing except +give a warning. +

+
SEE ALSO
+

+pcre2api(3), pcre2-config(3). +

+
AUTHOR
+

+Philip Hazel +
+Retired from University Computing Service +
+Cambridge, England. +
+

+
REVISION
+

+Last updated: 16 April 2024 +
+Copyright © 1997-2024 University of Cambridge. +
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2callout.html b/miniconda3/share/doc/pcre2/html/pcre2callout.html new file mode 100644 index 0000000000000000000000000000000000000000..cdb65ad63be714772c00a9fa6466f9004a6677f8 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2callout.html @@ -0,0 +1,480 @@ + + +pcre2callout specification + + +

pcre2callout man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+

+
SYNOPSIS
+

+#include <pcre2.h> +

+

+int (*pcre2_callout)(pcre2_callout_block *, void *); +
+
+int pcre2_callout_enumerate(const pcre2_code *code, + int (*callback)(pcre2_callout_enumerate_block *, void *), + void *user_data); +

+
DESCRIPTION
+

+PCRE2 provides a feature called "callout", which is a means of temporarily +passing control to the caller of PCRE2 in the middle of pattern matching. The +caller of PCRE2 provides an external function by putting its entry point in +a match context (see pcre2_set_callout() in the +pcre2api +documentation). +

+

+When using the pcre2_substitute() function, an additional callout feature +is available. This does a callout after each change to the subject string and +is described in the +pcre2api +documentation; the rest of this document is concerned with callouts during +pattern matching. +

+

+Within a regular expression, (?C<arg>) indicates a point at which the external +function is to be called. Different callout points can be identified by putting +a number less than 256 after the letter C. The default value is zero. +Alternatively, the argument may be a delimited string. The starting delimiter +must be one of ` ' " ^ % # $ { and the ending delimiter is the same as the +start, except for {, where the ending delimiter is }. If the ending delimiter +is needed within the string, it must be doubled. For example, this pattern has +two callout points: +

+  (?C1)abc(?C"some ""arbitrary"" text")def
+
+If the PCRE2_AUTO_CALLOUT option bit is set when a pattern is compiled, PCRE2 +automatically inserts callouts, all with number 255, before each item in the +pattern except for immediately before or after an explicit callout. For +example, if PCRE2_AUTO_CALLOUT is used with the pattern +
+  A(?C3)B
+
+it is processed as if it were +
+  (?C255)A(?C3)B(?C255)
+
+Here is a more complicated example: +
+  A(\d{2}|--)
+
+With PCRE2_AUTO_CALLOUT, this pattern is processed as if it were +
+  (?C255)A(?C255)((?C255)\d{2}(?C255)|(?C255)-(?C255)-(?C255))(?C255)
+
+Notice that there is a callout before and after each parenthesis and +alternation bar. If the pattern contains a conditional group whose condition is +an assertion, an automatic callout is inserted immediately before the +condition. Such a callout may also be inserted explicitly, for example: +
+  (?(?C9)(?=a)ab|de)  (?(?C%text%)(?!=d)ab|de)
+
+This applies only to assertion conditions (because they are themselves +independent groups). +

+

+Callouts can be useful for tracking the progress of pattern matching. The +pcre2test +program has a pattern qualifier (/auto_callout) that sets automatic callouts. +When any callouts are present, the output from pcre2test indicates how +the pattern is being matched. This is useful information when you are trying to +optimize the performance of a particular pattern. +

+
MISSING CALLOUTS
+

+You should be aware that, because of optimizations in the way PCRE2 compiles +and matches patterns, callouts sometimes do not happen exactly as you might +expect. +

+
+Auto-possessification +
+

+At compile time, PCRE2 "auto-possessifies" repeated items when it knows that +what follows cannot be part of the repeat. For example, a+[bc] is compiled as +if it were a++[bc]. The pcre2test output when this pattern is compiled +with PCRE2_ANCHORED and PCRE2_AUTO_CALLOUT and then applied to the string +"aaaa" is: +

+  --->aaaa
+   +0 ^        a+
+   +2 ^   ^    [bc]
+  No match
+
+This indicates that when matching [bc] fails, there is no backtracking into a+ +(because it is being treated as a++) and therefore the callouts that would be +taken for the backtracks do not occur. You can disable the auto-possessify +feature by passing PCRE2_NO_AUTO_POSSESS to pcre2_compile(), or starting +the pattern with (*NO_AUTO_POSSESS). In this case, the output changes to this: +
+  --->aaaa
+   +0 ^        a+
+   +2 ^   ^    [bc]
+   +2 ^  ^     [bc]
+   +2 ^ ^      [bc]
+   +2 ^^       [bc]
+  No match
+
+This time, when matching [bc] fails, the matcher backtracks into a+ and tries +again, repeatedly, until a+ itself fails. +

+
+Automatic .* anchoring +
+

+By default, an optimization is applied when .* is the first significant item in +a pattern. If PCRE2_DOTALL is set, so that the dot can match any character, the +pattern is automatically anchored. If PCRE2_DOTALL is not set, a match can +start only after an internal newline or at the beginning of the subject, and +pcre2_compile() remembers this. If a pattern has more than one top-level +branch, automatic anchoring occurs if all branches are anchorable. +

+

+This optimization is disabled, however, if .* is in an atomic group or if there +is a backreference to the capture group in which it appears. It is also +disabled if the pattern contains (*PRUNE) or (*SKIP). However, the presence of +callouts does not affect it. +

+

+For example, if the pattern .*\d is compiled with PCRE2_AUTO_CALLOUT and +applied to the string "aa", the pcre2test output is: +

+  --->aa
+   +0 ^      .*
+   +2 ^ ^    \d
+   +2 ^^     \d
+   +2 ^      \d
+  No match
+
+This shows that all match attempts start at the beginning of the subject. In +other words, the pattern is anchored. You can disable this optimization by +passing PCRE2_NO_DOTSTAR_ANCHOR to pcre2_compile(), or starting the +pattern with (*NO_DOTSTAR_ANCHOR). In this case, the output changes to: +
+  --->aa
+   +0 ^      .*
+   +2 ^ ^    \d
+   +2 ^^     \d
+   +2 ^      \d
+   +0  ^     .*
+   +2  ^^    \d
+   +2  ^     \d
+  No match
+
+This shows more match attempts, starting at the second subject character. +Another optimization, described in the next section, means that there is no +subsequent attempt to match with an empty subject. +

+
+Other optimizations +
+

+Other optimizations that provide fast "no match" results also affect callouts. +For example, if the pattern is +

+  ab(?C4)cd
+
+PCRE2 knows that any matching string must contain the letter "d". If the +subject string is "abyz", the lack of "d" means that matching doesn't ever +start, and the callout is never reached. However, with "abyd", though the +result is still no match, the callout is obeyed. +

+

+For most patterns PCRE2 also knows the minimum length of a matching string, and +will immediately give a "no match" return without actually running a match if +the subject is not long enough, or, for unanchored patterns, if it has been +scanned far enough. +

+

+You can disable these optimizations by passing the PCRE2_NO_START_OPTIMIZE +option to pcre2_compile(), or by starting the pattern with +(*NO_START_OPT). This slows down the matching process, but does ensure that +callouts such as the example above are obeyed. +

+
THE CALLOUT INTERFACE
+

+During matching, when PCRE2 reaches a callout point, if an external function is +provided in the match context, it is called. This applies to both normal, +DFA, and JIT matching. The first argument to the callout function is a pointer +to a pcre2_callout block. The second argument is the void * callout data +that was supplied when the callout was set up by calling +pcre2_set_callout() (see the +pcre2api +documentation). The callout block structure contains the following fields, not +necessarily in this order: +

+  uint32_t      version;
+  uint32_t      callout_number;
+  uint32_t      capture_top;
+  uint32_t      capture_last;
+  uint32_t      callout_flags;
+  PCRE2_SIZE   *offset_vector;
+  PCRE2_SPTR    mark;
+  PCRE2_SPTR    subject;
+  PCRE2_SIZE    subject_length;
+  PCRE2_SIZE    start_match;
+  PCRE2_SIZE    current_position;
+  PCRE2_SIZE    pattern_position;
+  PCRE2_SIZE    next_item_length;
+  PCRE2_SIZE    callout_string_offset;
+  PCRE2_SIZE    callout_string_length;
+  PCRE2_SPTR    callout_string;
+
+The version field contains the version number of the block format. The +current version is 2; the three callout string fields were added for version 1, +and the callout_flags field for version 2. If you are writing an +application that might use an earlier release of PCRE2, you should check the +version number before accessing any of these fields. The version number will +increase in future if more fields are added, but the intention is never to +remove any of the existing fields. +

+
+Fields for numerical callouts +
+

+For a numerical callout, callout_string is NULL, and callout_number +contains the number of the callout, in the range 0-255. This is the number +that follows (?C for callouts that part of the pattern; it is 255 for +automatically generated callouts. +

+
+Fields for string callouts +
+

+For callouts with string arguments, callout_number is always zero, and +callout_string points to the string that is contained within the compiled +pattern. Its length is given by callout_string_length. Duplicated ending +delimiters that were present in the original pattern string have been turned +into single characters, but there is no other processing of the callout string +argument. An additional code unit containing binary zero is present after the +string, but is not included in the length. The delimiter that was used to start +the string is also stored within the pattern, immediately before the string +itself. You can access this delimiter as callout_string[-1] if you need +it. +

+

+The callout_string_offset field is the code unit offset to the start of +the callout argument string within the original pattern string. This is +provided for the benefit of applications such as script languages that might +need to report errors in the callout string within the pattern. +

+
+Fields for all callouts +
+

+The remaining fields in the callout block are the same for both kinds of +callout. +

+

+The offset_vector field is a pointer to a vector of capturing offsets +(the "ovector"). You may read the elements in this vector, but you must not +change any of them. +

+

+For calls to pcre2_match(), the offset_vector field is not (since +release 10.30) a pointer to the actual ovector that was passed to the matching +function in the match data block. Instead it points to an internal ovector of a +size large enough to hold all possible captured substrings in the pattern. Note +that whenever a recursion or subroutine call within a pattern completes, the +capturing state is reset to what it was before. +

+

+The capture_last field contains the number of the most recently captured +substring, and the capture_top field contains one more than the number of +the highest numbered captured substring so far. If no substrings have yet been +captured, the value of capture_last is 0 and the value of +capture_top is 1. The values of these fields do not always differ by one; +for example, when the callout in the pattern ((a)(b))(?C2) is taken, +capture_last is 1 but capture_top is 4. +

+

+The contents of ovector[2] to ovector[<capture_top>*2-1] can be inspected in +order to extract substrings that have been matched so far, in the same way as +extracting substrings after a match has completed. The values in ovector[0] and +ovector[1] are always PCRE2_UNSET because the match is by definition not +complete. Substrings that have not been captured but whose numbers are less +than capture_top also have both of their ovector slots set to +PCRE2_UNSET. +

+

+For DFA matching, the offset_vector field points to the ovector that was +passed to the matching function in the match data block for callouts at the top +level, but to an internal ovector during the processing of pattern recursions, +lookarounds, and atomic groups. However, these ovectors hold no useful +information because pcre2_dfa_match() does not support substring +capturing. The value of capture_top is always 1 and the value of +capture_last is always 0 for DFA matching. +

+

+The subject and subject_length fields contain copies of the values +that were passed to the matching function. +

+

+The start_match field normally contains the offset within the subject at +which the current match attempt started. However, if the escape sequence \K +has been encountered, this value is changed to reflect the modified starting +point. If the pattern is not anchored, the callout function may be called +several times from the same point in the pattern for different starting points +in the subject. +

+

+The current_position field contains the offset within the subject of the +current match pointer. +

+

+The pattern_position field contains the offset in the pattern string to +the next item to be matched. +

+

+The next_item_length field contains the length of the next item to be +processed in the pattern string. When the callout is at the end of the pattern, +the length is zero. When the callout precedes an opening parenthesis, the +length includes meta characters that follow the parenthesis. For example, in a +callout before an assertion such as (?=ab) the length is 3. For an alternation +bar or a closing parenthesis, the length is one, unless a closing parenthesis +is followed by a quantifier, in which case its length is included. (This +changed in release 10.23. In earlier releases, before an opening parenthesis +the length was that of the entire group, and before an alternation bar or a +closing parenthesis the length was zero.) +

+

+The pattern_position and next_item_length fields are intended to +help in distinguishing between different automatic callouts, which all have the +same callout number. However, they are set for all callouts, and are used by +pcre2test to show the next item to be matched when displaying callout +information. +

+

+In callouts from pcre2_match() the mark field contains a pointer to +the zero-terminated name of the most recently passed (*MARK), (*PRUNE), or +(*THEN) item in the match, or NULL if no such items have been passed. Instances +of (*PRUNE) or (*THEN) without a name do not obliterate a previous (*MARK). In +callouts from the DFA matching function this field always contains NULL. +

+

+The callout_flags field is always zero in callouts from +pcre2_dfa_match() or when JIT is being used. When pcre2_match() +without JIT is used, the following bits may be set: +

+  PCRE2_CALLOUT_STARTMATCH
+
+This is set for the first callout after the start of matching for each new +starting position in the subject. +
+  PCRE2_CALLOUT_BACKTRACK
+
+This is set if there has been a matching backtrack since the previous callout, +or since the start of matching if this is the first callout from a +pcre2_match() run. +

+

+Both bits are set when a backtrack has caused a "bumpalong" to a new starting +position in the subject. Output from pcre2test does not indicate the +presence of these bits unless the callout_extra modifier is set. +

+

+The information in the callout_flags field is provided so that +applications can track and tell their users how matching with backtracking is +done. This can be useful when trying to optimize patterns, or just to +understand how PCRE2 works. There is no support in pcre2_dfa_match() +because there is no backtracking in DFA matching, and there is no support in +JIT because JIT is all about maximimizing matching performance. In both these +cases the callout_flags field is always zero. +

+
RETURN VALUES FROM CALLOUTS
+

+The external callout function returns an integer to PCRE2. If the value is +zero, matching proceeds as normal. If the value is greater than zero, matching +fails at the current point, but the testing of other matching possibilities +goes ahead, just as if a lookahead assertion had failed. If the value is less +than zero, the match is abandoned, and the matching function returns the +negative value. +

+

+Negative values should normally be chosen from the set of PCRE2_ERROR_xxx +values. In particular, PCRE2_ERROR_NOMATCH forces a standard "no match" +failure. The error number PCRE2_ERROR_CALLOUT is reserved for use by callout +functions; it will never be used by PCRE2 itself. +

+
CALLOUT ENUMERATION
+

+int pcre2_callout_enumerate(const pcre2_code *code, + int (*callback)(pcre2_callout_enumerate_block *, void *), + void *user_data); +
+
+A script language that supports the use of string arguments in callouts might +like to scan all the callouts in a pattern before running the match. This can +be done by calling pcre2_callout_enumerate(). The first argument is a +pointer to a compiled pattern, the second points to a callback function, and +the third is arbitrary user data. The callback function is called for every +callout in the pattern in the order in which they appear. Its first argument is +a pointer to a callout enumeration block, and its second argument is the +user_data value that was passed to pcre2_callout_enumerate(). The +data block contains the following fields: +

+  version                Block version number
+  pattern_position       Offset to next item in pattern
+  next_item_length       Length of next item in pattern
+  callout_number         Number for numbered callouts
+  callout_string_offset  Offset to string within pattern
+  callout_string_length  Length of callout string
+  callout_string         Points to callout string or is NULL
+
+The version number is currently 0. It will increase if new fields are ever +added to the block. The remaining fields are the same as their namesakes in the +pcre2_callout block that is used for callouts during matching, as +described +above. +

+

+Note that the value of pattern_position is unique for each callout. +However, if a callout occurs inside a group that is quantified with a non-zero +minimum or a fixed maximum, the group is replicated inside the compiled +pattern. For example, a pattern such as /(a){2}/ is compiled as if it were +/(a)(a)/. This means that the callout will be enumerated more than once, but +with the same value for pattern_position in each case. +

+

+The callback function should normally return zero. If it returns a non-zero +value, scanning the pattern stops, and that value is returned from +pcre2_callout_enumerate(). +

+
AUTHOR
+

+Philip Hazel +
+Retired from University Computing Service +
+Cambridge, England. +
+

+
REVISION
+

+Last updated: 19 January 2024 +
+Copyright © 1997-2024 University of Cambridge. +
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2compat.html b/miniconda3/share/doc/pcre2/html/pcre2compat.html new file mode 100644 index 0000000000000000000000000000000000000000..5f7e280d34f8333497deb2a9d3fbd65e08db0930 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2compat.html @@ -0,0 +1,299 @@ + + +pcre2compat specification + + +

pcre2compat man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+DIFFERENCES BETWEEN PCRE2 AND PERL +
+

+This document describes some of the known differences in the ways that PCRE2 +and Perl handle regular expressions. The differences described here are with +respect to Perl version 5.38.0, but as both Perl and PCRE2 are continually +changing, the information may at times be out of date. +

+

+1. When PCRE2_DOTALL (equivalent to Perl's /s qualifier) is not set, the +behaviour of the '.' metacharacter differs from Perl. In PCRE2, '.' matches the +next character unless it is the start of a newline sequence. This means that, +if the newline setting is CR, CRLF, or NUL, '.' will match the code point LF +(0x0A) in ASCII/Unicode environments, and NL (either 0x15 or 0x25) when using +EBCDIC. In Perl, '.' appears never to match LF, even when 0x0A is not a newline +indicator. +

+

+2. PCRE2 has only a subset of Perl's Unicode support. Details of what it does +have are given in the +pcre2unicode +page. +

+

+3. Like Perl, PCRE2 allows repeat quantifiers on parenthesized assertions, but +they do not mean what you might think. For example, (?!a){3} does not assert +that the next three characters are not "a". It just asserts that the next +character is not "a" three times (in principle; PCRE2 optimizes this to run the +assertion just once). Perl allows some repeat quantifiers on other assertions, +for example, \b* , but these do not seem to have any use. PCRE2 does not allow +any kind of quantifier on non-lookaround assertions. +

+

+4. If a braced quantifier such as {1,2} appears where there is nothing to +repeat (for example, at the start of a branch), PCRE2 raises an error whereas +Perl treats the quantifier characters as literal. +

+

+5. Capture groups that occur inside negative lookaround assertions are counted, +but their entries in the offsets vector are set only when a negative assertion +is a condition that has a matching branch (that is, the condition is false). +Perl may set such capture groups in other circumstances. +

+

+6. The following Perl escape sequences are not supported: \F, \l, \L, \u, +\U, and \N when followed by a character name. \N on its own, matching a +non-newline character, and \N{U+dd..}, matching a Unicode code point, are +supported. The escapes that modify the case of following letters are +implemented by Perl's general string-handling and are not part of its pattern +matching engine. If any of these are encountered by PCRE2, an error is +generated by default. However, if either of the PCRE2_ALT_BSUX or +PCRE2_EXTRA_ALT_BSUX options is set, \U and \u are interpreted as ECMAScript +interprets them. +

+

+7. The Perl escape sequences \p, \P, and \X are supported only if PCRE2 is +built with Unicode support (the default). The properties that can be tested +with \p and \P are limited to the general category properties such as Lu and +Nd, the derived properties Any and Lc (synonym L&), script names such as Greek +or Han, Bidi_Class, Bidi_Control, and a few binary properties. Both PCRE2 and +Perl support the Cs (surrogate) property, but in PCRE2 its use is limited. See +the +pcre2pattern +documentation for details. The long synonyms for property names that Perl +supports (such as \p{Letter}) are not supported by PCRE2, nor is it permitted +to prefix any of these properties with "Is". +

+

+8. PCRE2 supports the \Q...\E escape for quoting substrings. Characters +in between are treated as literals. However, this is slightly different from +Perl in that $ and @ are also handled as literals inside the quotes. In Perl, +they cause variable interpolation (PCRE2 does not have variables). Also, Perl +does "double-quotish backslash interpolation" on any backslashes between \Q +and \E which, its documentation says, "may lead to confusing results". PCRE2 +treats a backslash between \Q and \E just like any other character. Note the +following examples: +

+    Pattern            PCRE2 matches     Perl matches
+
+    \Qabc$xyz\E        abc$xyz           abc followed by the contents of $xyz
+    \Qabc\$xyz\E       abc\$xyz          abc\$xyz
+    \Qabc\E\$\Qxyz\E   abc$xyz           abc$xyz
+    \QA\B\E            A\B               A\B
+    \Q\\E              \                 \\E
+
+The \Q...\E sequence is recognized both inside and outside character classes +by both PCRE2 and Perl. Another difference from Perl is that any appearance of +\Q or \E inside what might otherwise be a quantifier causes PCRE2 not to +recognize the sequence as a quantifier. Perl recognizes a quantifier if +(redundantly) either of the numbers is inside \Q...\E, but not if the +separating comma is. When not recognized as a quantifier a sequence such as +{\Q1\E,2} is treated as the literal string "{1,2}". +

+

+9. Fairly obviously, PCRE2 does not support the (?{code}) and (??{code}) +constructions. However, PCRE2 does have a "callout" feature, which allows an +external function to be called during pattern matching. See the +pcre2callout +documentation for details. +

+

+10. Subroutine calls (whether recursive or not) were treated as atomic groups +up to PCRE2 release 10.23, but from release 10.30 this changed, and +backtracking into subroutine calls is now supported, as in Perl. +

+

+11. In PCRE2, if any of the backtracking control verbs are used in a group that +is called as a subroutine (whether or not recursively), their effect is +confined to that group; it does not extend to the surrounding pattern. This is +not always the case in Perl. In particular, if (*THEN) is present in a group +that is called as a subroutine, its action is limited to that group, even if +the group does not contain any | characters. Note that such groups are +processed as anchored at the point where they are tested. PCRE2 also confines +all control verbs within atomic assertions, again including (*THEN) in +assertions with only one branch. +

+

+12. If a pattern contains more than one backtracking control verb, the first +one that is backtracked onto acts. For example, in the pattern +A(*COMMIT)B(*PRUNE)C a failure in B triggers (*COMMIT), but a failure in C +triggers (*PRUNE). Perl's behaviour is more complex; in many cases it is the +same as PCRE2, but there are cases where it differs. +

+

+13. There are some differences that are concerned with the settings of captured +strings when part of a pattern is repeated. For example, matching "aba" against +the pattern /^(a(b)?)+$/ in Perl leaves $2 unset, but in PCRE2 it is set to +"b". +

+

+14. PCRE2's handling of duplicate capture group numbers and names is not as +general as Perl's. This is a consequence of the fact the PCRE2 works internally +just with numbers, using an external table to translate between numbers and +names. In particular, a pattern such as (?|(?<a>A)|(?<b>B)), where the two +capture groups have the same number but different names, is not supported, and +causes an error at compile time. If it were allowed, it would not be possible +to distinguish which group matched, because both names map to capture group +number 1. To avoid this confusing situation, an error is given at compile time. +

+

+15. Perl used to recognize comments in some places that PCRE2 does not, for +example, between the ( and ? at the start of a group. If the /x modifier is +set, Perl allowed white space between ( and ? though the latest Perls give an +error (for a while it was just deprecated). There may still be some cases where +Perl behaves differently. +

+

+16. Perl, when in warning mode, gives warnings for character classes such as +[A-\d] or [a-[:digit:]]. It then treats the hyphens as literals. PCRE2 has no +warning features, so it gives an error in these cases because they are almost +certainly user mistakes. +

+

+17. In PCRE2, until release 10.45, the upper/lower case character properties Lu +and Ll were not affected when case-independent matching was specified. Perl has +changed in this respect, and PCRE2 has now changed to match. When caseless +matching is in force, Lu, Ll, and Lt (title case) are all treated as Lc (cased +letter). +

+

+18. From release 5.32.0, Perl locks out the use of \K in lookaround +assertions. From release 10.38 PCRE2 does the same by default. However, there +is an option for re-enabling the previous behaviour. When this option is set, +\K is acted on when it occurs in positive assertions, but is ignored in +negative assertions. +

+

+19. PCRE2 provides some extensions to the Perl regular expression facilities. +Perl 5.10 included new features that were not in earlier versions of Perl, some +of which (such as named parentheses) were in PCRE2 for some time before. This +list is with respect to Perl 5.38: +
+
+(a) If PCRE2_DOLLAR_ENDONLY is set and PCRE2_MULTILINE is not set, the $ +meta-character matches only at the very end of the string. +
+
+(b) A backslash followed by a letter with no special meaning is faulted. (Perl +can be made to issue a warning.) +
+
+(c) If PCRE2_UNGREEDY is set, the greediness of the repetition quantifiers is +inverted, that is, by default they are not greedy, but if followed by a +question mark they are. +
+
+(d) PCRE2_ANCHORED can be used at matching time to force a pattern to be tried +only at the first matching position in the subject string. +
+
+(e) The PCRE2_NOTBOL, PCRE2_NOTEOL, PCRE2_NOTEMPTY and PCRE2_NOTEMPTY_ATSTART +options have no Perl equivalents. +
+
+(f) The \R escape sequence can be restricted to match only CR, LF, or CRLF +by the PCRE2_BSR_ANYCRLF option. +
+
+(g) The callout facility is PCRE2-specific. Perl supports codeblocks and +variable interpolation, but not general hooks on every match. +
+
+(h) The partial matching facility is PCRE2-specific. +
+
+(i) The alternative matching function (pcre2_dfa_match() matches in a +different way and is not Perl-compatible. +
+
+(j) PCRE2 recognizes some special sequences such as (*CR) or (*NO_JIT) at +the start of a pattern. These set overall options that cannot be changed within +the pattern. +
+
+(k) PCRE2 supports non-atomic positive lookaround assertions. This is an +extension to the lookaround facilities. The default, Perl-compatible +lookarounds are atomic. +
+
+(l) There are three syntactical items in patterns that can refer to a capturing +group by number: back references such as \g{2}, subroutine calls such as (?3), +and condition references such as (?(4)...). PCRE2 supports relative group +numbers such as +2 and -4 in all three cases. Perl supports both plus and minus +for subroutine calls, but only minus for back references, and no relative +numbering at all for conditions. +
+
+(m) The scan substring assertion (syntax (*scs:(n)...)) is a PCRE2 extension +that is not available in Perl. +

+

+20. Perl has different limits than PCRE2. See the +pcre2limit +documentation for details. Perl went with 5.10 from recursion to iteration +keeping the intermediate matches on the heap, which is ~10% slower but does not +fall into any stack-overflow limit. PCRE2 made a similar change at release +10.30, and also has many build-time and run-time customizable limits. +

+

+21. Unlike Perl, PCRE2 doesn't have character set modifiers and specially no way +to set characters by context just like Perl's "/d". A regular expression using +PCRE2_UTF and PCRE2_UCP will use similar rules to Perl's "/u"; something closer +to "/a" could be selected by adding other PCRE2_EXTRA_ASCII* options on top. +

+

+22. Some recursive patterns that Perl diagnoses as infinite recursions can be +handled by PCRE2, either by the interpreter or the JIT. An example is +/(?:|(?0)abcd)(?(R)|\z)/, which matches a sequence of any number of repeated +"abcd" substrings at the end of the subject. +

+

+23. Both PCRE2 and Perl error when \x{ escapes are invalid, but Perl tries to +recover and prints a warning if the problem was that an invalid hexadecimal +digit was found, since PCRE2 doesn't have warnings it returns an error instead. +Additionally, Perl accepts \x{} and generates NUL unlike PCRE2. +

+

+24. From release 10.45, PCRE2 gives an error if \x is not followed by a +hexadecimal digit or a curly bracket. It used to interpret this as the NUL +character. Perl still generates NUL, but warns when in warning mode in most +cases. +

+
+AUTHOR +
+

+Philip Hazel +
+Retired from University Computing Service +
+Cambridge, England. +
+

+
+REVISION +
+

+Last updated: 02 October 2024 +
+Copyright © 1997-2024 University of Cambridge. +
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2convert.html b/miniconda3/share/doc/pcre2/html/pcre2convert.html new file mode 100644 index 0000000000000000000000000000000000000000..57e8989fb4a93cf92898ad07fdb914695b07812f --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2convert.html @@ -0,0 +1,191 @@ + + +pcre2convert specification + + +

pcre2convert man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+

+
EXPERIMENTAL PATTERN CONVERSION FUNCTIONS
+

+This document describes a set of functions that can be used to convert +"foreign" patterns into PCRE2 regular expressions. This facility is currently +experimental, and may be changed in future releases. Two kinds of pattern, +globs and POSIX patterns, are supported. +

+
THE CONVERT CONTEXT
+

+pcre2_convert_context *pcre2_convert_context_create( + pcre2_general_context *gcontext); +
+
+pcre2_convert_context *pcre2_convert_context_copy( + pcre2_convert_context *cvcontext); +
+
+void pcre2_convert_context_free(pcre2_convert_context *cvcontext); +
+
+int pcre2_set_glob_escape(pcre2_convert_context *cvcontext, + uint32_t escape_char); +
+
+int pcre2_set_glob_separator(pcre2_convert_context *cvcontext, + uint32_t separator_char); +
+
+A convert context is used to hold parameters that affect the way that pattern +conversion works. Like all PCRE2 contexts, you need to use a context only if +you want to override the defaults. There are the usual create, copy, and free +functions. If custom memory management functions are set in a general context +that is passed to pcre2_convert_context_create(), they are used for all +memory management within the conversion functions. +

+

+There are only two parameters in the convert context at present. Both apply +only to glob conversions. The escape character defaults to grave accent under +Windows, otherwise backslash. It can be set to zero, meaning no escape +character, or to any punctuation character with a code point less than 256. +The separator character defaults to backslash under Windows, otherwise forward +slash. It can be set to forward slash, backslash, or dot. +

+

+The two setting functions return zero on success, or PCRE2_ERROR_BADDATA if +their second argument is invalid. +

+
THE CONVERSION FUNCTION
+

+int pcre2_pattern_convert(PCRE2_SPTR pattern, PCRE2_SIZE length, + uint32_t options, PCRE2_UCHAR **buffer, + PCRE2_SIZE *blength, pcre2_convert_context *cvcontext); +
+
+void pcre2_converted_pattern_free(PCRE2_UCHAR *converted_pattern); +
+
+The first two arguments of pcre2_pattern_convert() define the foreign +pattern that is to be converted. The length may be given as +PCRE2_ZERO_TERMINATED. The options argument defines how the pattern is to +be processed. If the input is UTF, the PCRE2_CONVERT_UTF option should be set. +PCRE2_CONVERT_NO_UTF_CHECK may also be set if you are sure the input is valid. +One or more of the glob options, or one of the following POSIX options must be +set to define the type of conversion that is required: +

+  PCRE2_CONVERT_GLOB
+  PCRE2_CONVERT_GLOB_NO_WILD_SEPARATOR
+  PCRE2_CONVERT_GLOB_NO_STARSTAR
+  PCRE2_CONVERT_POSIX_BASIC
+  PCRE2_CONVERT_POSIX_EXTENDED
+
+Details of the conversions are given below. The buffer and blength +arguments define how the output is handled: +

+

+If buffer is NULL, the function just returns the length of the converted +pattern via blength. This is one less than the length of buffer needed, +because a terminating zero is always added to the output. +

+

+If buffer points to a NULL pointer, an output buffer is obtained using +the allocator in the context or malloc() if no context is supplied. A +pointer to this buffer is placed in the variable to which buffer points. +When no longer needed the output buffer must be freed by calling +pcre2_converted_pattern_free(). If this function is called with a NULL +argument, it returns immediately without doing anything. +

+

+If buffer points to a non-NULL pointer, blength must be set to the +actual length of the buffer provided (in code units). +

+

+In all cases, after successful conversion, the variable pointed to by +blength is updated to the length actually used (in code units), excluding +the terminating zero that is always added. +

+

+If an error occurs, the length (via blength) is set to the offset +within the input pattern where the error was detected. Only gross syntax errors +are caught; there are plenty of errors that will get passed on for +pcre2_compile() to discover. +

+

+The return from pcre2_pattern_convert() is zero on success or a non-zero +PCRE2 error code. Note that PCRE2 error codes may be positive or negative: +pcre2_compile() uses mostly positive codes and pcre2_match() +negative ones; pcre2_convert() uses existing codes of both kinds. A +textual error message can be obtained by calling +pcre2_get_error_message(). +

+
CONVERTING GLOBS
+

+Globs are used to match file names, and consequently have the concept of a +"path separator", which defaults to backslash under Windows and forward slash +otherwise. If PCRE2_CONVERT_GLOB is set, the wildcards * and ? are not +permitted to match separator characters, but the double-star (**) feature +(which does match separators) is supported. +

+

+PCRE2_CONVERT_GLOB_NO_WILD_SEPARATOR matches globs with wildcards allowed to +match separator characters. PCRE2_CONVERT_GLOB_NO_STARSTAR matches globs with +the double-star feature disabled. These options may be given together. +

+
CONVERTING POSIX PATTERNS
+

+POSIX defines two kinds of regular expression pattern: basic and extended. +These can be processed by setting PCRE2_CONVERT_POSIX_BASIC or +PCRE2_CONVERT_POSIX_EXTENDED, respectively. +

+

+In POSIX patterns, backslash is not special in a character class. Unmatched +closing parentheses are treated as literals. +

+

+In basic patterns, ? + | {} and () must be escaped to be recognized +as metacharacters outside a character class. If the first character in the +pattern is * it is treated as a literal. ^ is a metacharacter only at the start +of a branch. +

+

+In extended patterns, a backslash not in a character class always +makes the next character literal, whatever it is. There are no backreferences. +

+

+Note: POSIX mandates that the longest possible match at the first matching +position must be found. This is not what pcre2_match() does; it yields +the first match that is found. An application can use pcre2_dfa_match() +to find the longest match, but that does not support backreferences (but then +neither do POSIX extended patterns). +

+
AUTHOR
+

+Philip Hazel +
+Retired from University Computing Service +
+Cambridge, England. +
+

+
REVISION
+

+Last updated: 14 November 2023 +
+Copyright © 1997-2018 University of Cambridge. +
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2demo.html b/miniconda3/share/doc/pcre2/html/pcre2demo.html new file mode 100644 index 0000000000000000000000000000000000000000..1cb7e0a7df4d6b38247000238530f1a8b36589c3 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2demo.html @@ -0,0 +1,518 @@ + + +pcre2demo specification + + +

pcre2demo man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SOURCE CODE +
+

+/*************************************************
+*           PCRE2 DEMONSTRATION PROGRAM          *
+*************************************************/
+
+/* This is a demonstration program to illustrate a straightforward way of
+using the PCRE2 regular expression library from a C program. See the
+pcre2sample documentation for a short discussion ("man pcre2sample" if you have
+the PCRE2 man pages installed). PCRE2 is a revised API for the library, and is
+incompatible with the original PCRE API.
+
+There are actually three libraries, each supporting a different code unit
+width. This demonstration program uses the 8-bit library. The default is to
+process each code unit as a separate character, but if the pattern begins with
+"(*UTF)", both it and the subject are treated as UTF-8 strings, where
+characters may occupy multiple code units.
+
+In Unix-like environments, if PCRE2 is installed in your standard system
+libraries, you should be able to compile this program using this command:
+
+cc -Wall pcre2demo.c -lpcre2-8 -o pcre2demo
+
+If PCRE2 is not installed in a standard place, it is likely to be installed
+with support for the pkg-config mechanism. If you have pkg-config, you can
+compile this program using this command:
+
+cc -Wall pcre2demo.c `pkg-config --cflags --libs libpcre2-8` -o pcre2demo
+
+If you do not have pkg-config, you may have to use something like this:
+
+cc -Wall pcre2demo.c -I/usr/local/include -L/usr/local/lib \
+  -R/usr/local/lib -lpcre2-8 -o pcre2demo
+
+Replace "/usr/local/include" and "/usr/local/lib" with wherever the include and
+library files for PCRE2 are installed on your system. Only some operating
+systems (Solaris is one) use the -R option.
+
+Building under Windows:
+
+If you want to statically link this program against a non-dll .a file, you must
+define PCRE2_STATIC before including pcre2.h, so in this environment, uncomment
+the following line. */
+
+/* #define PCRE2_STATIC */
+
+/* The PCRE2_CODE_UNIT_WIDTH macro must be defined before including pcre2.h.
+For a program that uses only one code unit width, setting it to 8, 16, or 32
+makes it possible to use generic function names such as pcre2_compile(). Note
+that just changing 8 to 16 (for example) is not sufficient to convert this
+program to process 16-bit characters. Even in a fully 16-bit environment, where
+string-handling functions such as strcmp() and printf() work with 16-bit
+characters, the code for handling the table of named substrings will still need
+to be modified. */
+
+#define PCRE2_CODE_UNIT_WIDTH 8
+
+#include <stdio.h>
+#include <string.h>
+#include <pcre2.h>
+
+
+/**************************************************************************
+* Here is the program. The API includes the concept of "contexts" for     *
+* setting up unusual interface requirements for compiling and matching,   *
+* such as custom memory managers and non-standard newline definitions.    *
+* This program does not do any of this, so it makes no use of contexts,   *
+* always passing NULL where a context could be given.                     *
+**************************************************************************/
+
+int main(int argc, char **argv)
+{
+pcre2_code *re;
+PCRE2_SPTR pattern;     /* PCRE2_SPTR is a pointer to unsigned code units of */
+PCRE2_SPTR subject;     /* the appropriate width (in this case, 8 bits). */
+PCRE2_SPTR name_table;
+
+int crlf_is_newline;
+int errornumber;
+int find_all;
+int i;
+int rc;
+int utf8;
+
+uint32_t option_bits;
+uint32_t namecount;
+uint32_t name_entry_size;
+uint32_t newline;
+
+PCRE2_SIZE erroroffset;
+PCRE2_SIZE *ovector;
+PCRE2_SIZE subject_length;
+
+pcre2_match_data *match_data;
+
+
+/**************************************************************************
+* First, sort out the command line. There is only one possible option at  *
+* the moment, "-g" to request repeated matching to find all occurrences,  *
+* like Perl's /g option. We set the variable find_all to a non-zero value *
+* if the -g option is present.                                            *
+**************************************************************************/
+
+find_all = 0;
+for (i = 1; i < argc; i++)
+  {
+  if (strcmp(argv[i], "-g") == 0) find_all = 1;
+  else if (argv[i][0] == '-')
+    {
+    printf("Unrecognised option %s\n", argv[i]);
+    return 1;
+    }
+  else break;
+  }
+
+/* After the options, we require exactly two arguments, which are the pattern,
+and the subject string. */
+
+if (argc - i != 2)
+  {
+  printf("Exactly two arguments required: a regex and a subject string\n");
+  return 1;
+  }
+
+/* Pattern and subject are char arguments, so they can be straightforwardly
+cast to PCRE2_SPTR because we are working in 8-bit code units. The subject
+length is cast to PCRE2_SIZE for completeness, though PCRE2_SIZE is in fact
+defined to be size_t. */
+
+pattern = (PCRE2_SPTR)argv[i];
+subject = (PCRE2_SPTR)argv[i+1];
+subject_length = (PCRE2_SIZE)strlen((char *)subject);
+
+
+/*************************************************************************
+* Now we are going to compile the regular expression pattern, and handle *
+* any errors that are detected.                                          *
+*************************************************************************/
+
+re = pcre2_compile(
+  pattern,               /* the pattern */
+  PCRE2_ZERO_TERMINATED, /* indicates pattern is zero-terminated */
+  0,                     /* default options */
+  &errornumber,          /* for error number */
+  &erroroffset,          /* for error offset */
+  NULL);                 /* use default compile context */
+
+/* Compilation failed: print the error message and exit. */
+
+if (re == NULL)
+  {
+  PCRE2_UCHAR buffer[256];
+  pcre2_get_error_message(errornumber, buffer, sizeof(buffer));
+  printf("PCRE2 compilation failed at offset %d: %s\n", (int)erroroffset,
+    buffer);
+  return 1;
+  }
+
+
+/*************************************************************************
+* If the compilation succeeded, we call PCRE2 again, in order to do a    *
+* pattern match against the subject string. This does just ONE match. If *
+* further matching is needed, it will be done below. Before running the  *
+* match we must set up a match_data block for holding the result. Using  *
+* pcre2_match_data_create_from_pattern() ensures that the block is       *
+* exactly the right size for the number of capturing parentheses in the  *
+* pattern. If you need to know the actual size of a match_data block as  *
+* a number of bytes, you can find it like this:                          *
+*                                                                        *
+* PCRE2_SIZE match_data_size = pcre2_get_match_data_size(match_data);    *
+*************************************************************************/
+
+match_data = pcre2_match_data_create_from_pattern(re, NULL);
+
+/* Now run the match. */
+
+rc = pcre2_match(
+  re,                   /* the compiled pattern */
+  subject,              /* the subject string */
+  subject_length,       /* the length of the subject */
+  0,                    /* start at offset 0 in the subject */
+  0,                    /* default options */
+  match_data,           /* block for storing the result */
+  NULL);                /* use default match context */
+
+/* Matching failed: handle error cases */
+
+if (rc < 0)
+  {
+  switch(rc)
+    {
+    case PCRE2_ERROR_NOMATCH: printf("No match\n"); break;
+    /*
+    Handle other special cases if you like
+    */
+    default: printf("Matching error %d\n", rc); break;
+    }
+  pcre2_match_data_free(match_data);   /* Release memory used for the match */
+  pcre2_code_free(re);                 /*   data and the compiled pattern. */
+  return 1;
+  }
+
+/* Match succeeded. Get a pointer to the output vector, where string offsets
+are stored. */
+
+ovector = pcre2_get_ovector_pointer(match_data);
+printf("Match succeeded at offset %d\n", (int)ovector[0]);
+
+
+/*************************************************************************
+* We have found the first match within the subject string. If the output *
+* vector wasn't big enough, say so. Then output any substrings that were *
+* captured.                                                              *
+*************************************************************************/
+
+/* The output vector wasn't big enough. This should not happen, because we used
+pcre2_match_data_create_from_pattern() above. */
+
+if (rc == 0)
+  printf("ovector was not big enough for all the captured substrings\n");
+
+/* Since release 10.38 PCRE2 has locked out the use of \K in lookaround
+assertions. However, there is an option to re-enable the old behaviour. If that
+is set, it is possible to run patterns such as /(?=.\K)/ that use \K in an
+assertion to set the start of a match later than its end. In this demonstration
+program, we show how to detect this case, but it shouldn't arise because the
+option is never set. */
+
+if (ovector[0] > ovector[1])
+  {
+  printf("\\K was used in an assertion to set the match start after its end.\n"
+    "From end to start the match was: %.*s\n", (int)(ovector[0] - ovector[1]),
+      (char *)(subject + ovector[1]));
+  printf("Run abandoned\n");
+  pcre2_match_data_free(match_data);
+  pcre2_code_free(re);
+  return 1;
+  }
+
+/* Show substrings stored in the output vector by number. Obviously, in a real
+application you might want to do things other than print them. */
+
+for (i = 0; i < rc; i++)
+  {
+  PCRE2_SPTR substring_start = subject + ovector[2*i];
+  PCRE2_SIZE substring_length = ovector[2*i+1] - ovector[2*i];
+  printf("%2d: %.*s\n", i, (int)substring_length, (char *)substring_start);
+  }
+
+
+/**************************************************************************
+* That concludes the basic part of this demonstration program. We have    *
+* compiled a pattern, and performed a single match. The code that follows *
+* shows first how to access named substrings, and then how to code for    *
+* repeated matches on the same subject.                                   *
+**************************************************************************/
+
+/* See if there are any named substrings, and if so, show them by name. First
+we have to extract the count of named parentheses from the pattern. */
+
+(void)pcre2_pattern_info(
+  re,                   /* the compiled pattern */
+  PCRE2_INFO_NAMECOUNT, /* get the number of named substrings */
+  &namecount);          /* where to put the answer */
+
+if (namecount == 0) printf("No named substrings\n"); else
+  {
+  PCRE2_SPTR tabptr;
+  printf("Named substrings\n");
+
+  /* Before we can access the substrings, we must extract the table for
+  translating names to numbers, and the size of each entry in the table. */
+
+  (void)pcre2_pattern_info(
+    re,                       /* the compiled pattern */
+    PCRE2_INFO_NAMETABLE,     /* address of the table */
+    &name_table);             /* where to put the answer */
+
+  (void)pcre2_pattern_info(
+    re,                       /* the compiled pattern */
+    PCRE2_INFO_NAMEENTRYSIZE, /* size of each entry in the table */
+    &name_entry_size);        /* where to put the answer */
+
+  /* Now we can scan the table and, for each entry, print the number, the name,
+  and the substring itself. In the 8-bit library the number is held in two
+  bytes, most significant first. */
+
+  tabptr = name_table;
+  for (i = 0; i < namecount; i++)
+    {
+    int n = (tabptr[0] << 8) | tabptr[1];
+    printf("(%d) %*s: %.*s\n", n, name_entry_size - 3, tabptr + 2,
+      (int)(ovector[2*n+1] - ovector[2*n]), subject + ovector[2*n]);
+    tabptr += name_entry_size;
+    }
+  }
+
+
+/*************************************************************************
+* If the "-g" option was given on the command line, we want to continue  *
+* to search for additional matches in the subject string, in a similar   *
+* way to the /g option in Perl. This turns out to be trickier than you   *
+* might think because of the possibility of matching an empty string.    *
+* What happens is as follows:                                            *
+*                                                                        *
+* If the previous match was NOT for an empty string, we can just start   *
+* the next match at the end of the previous one.                         *
+*                                                                        *
+* If the previous match WAS for an empty string, we can't do that, as it *
+* would lead to an infinite loop. Instead, a call of pcre2_match() is    *
+* made with the PCRE2_NOTEMPTY_ATSTART and PCRE2_ANCHORED flags set. The *
+* first of these tells PCRE2 that an empty string at the start of the    *
+* subject is not a valid match; other possibilities must be tried. The   *
+* second flag restricts PCRE2 to one match attempt at the initial string *
+* position. If this match succeeds, an alternative to the empty string   *
+* match has been found, and we can print it and proceed round the loop,  *
+* advancing by the length of whatever was found. If this match does not  *
+* succeed, we still stay in the loop, advancing by just one character.   *
+* In UTF-8 mode, which can be set by (*UTF) in the pattern, this may be  *
+* more than one byte.                                                    *
+*                                                                        *
+* However, there is a complication concerned with newlines. When the     *
+* newline convention is such that CRLF is a valid newline, we must       *
+* advance by two characters rather than one. The newline convention can  *
+* be set in the regex by (*CR), etc.; if not, we must find the default.  *
+*************************************************************************/
+
+if (!find_all)     /* Check for -g */
+  {
+  pcre2_match_data_free(match_data);  /* Release the memory that was used */
+  pcre2_code_free(re);                /* for the match data and the pattern. */
+  return 0;                           /* Exit the program. */
+  }
+
+/* Before running the loop, check for UTF-8 and whether CRLF is a valid newline
+sequence. First, find the options with which the regex was compiled and extract
+the UTF state. */
+
+(void)pcre2_pattern_info(re, PCRE2_INFO_ALLOPTIONS, &option_bits);
+utf8 = (option_bits & PCRE2_UTF) != 0;
+
+/* Now find the newline convention and see whether CRLF is a valid newline
+sequence. */
+
+(void)pcre2_pattern_info(re, PCRE2_INFO_NEWLINE, &newline);
+crlf_is_newline = newline == PCRE2_NEWLINE_ANY ||
+                  newline == PCRE2_NEWLINE_CRLF ||
+                  newline == PCRE2_NEWLINE_ANYCRLF;
+
+/* Loop for second and subsequent matches */
+
+for (;;)
+  {
+  uint32_t options = 0;                   /* Normally no options */
+  PCRE2_SIZE start_offset = ovector[1];   /* Start at end of previous match */
+
+  /* If the previous match was for an empty string, we are finished if we are
+  at the end of the subject. Otherwise, arrange to run another match at the
+  same point to see if a non-empty match can be found. */
+
+  if (ovector[0] == ovector[1])
+    {
+    if (ovector[0] == subject_length) break;
+    options = PCRE2_NOTEMPTY_ATSTART | PCRE2_ANCHORED;
+    }
+
+  /* If the previous match was not an empty string, there is one tricky case to
+  consider. If a pattern contains \K within a lookbehind assertion at the
+  start, the end of the matched string can be at the offset where the match
+  started. Without special action, this leads to a loop that keeps on matching
+  the same substring. We must detect this case and arrange to move the start on
+  by one character. The pcre2_get_startchar() function returns the starting
+  offset that was passed to pcre2_match(). */
+
+  else
+    {
+    PCRE2_SIZE startchar = pcre2_get_startchar(match_data);
+    if (start_offset <= startchar)
+      {
+      if (startchar >= subject_length) break;   /* Reached end of subject.   */
+      start_offset = startchar + 1;             /* Advance by one character. */
+      if (utf8)                                 /* If UTF-8, it may be more  */
+        {                                       /*   than one code unit.     */
+        for (; start_offset < subject_length; start_offset++)
+          if ((subject[start_offset] & 0xc0) != 0x80) break;
+        }
+      }
+    }
+
+  /* Run the next matching operation */
+
+  rc = pcre2_match(
+    re,                   /* the compiled pattern */
+    subject,              /* the subject string */
+    subject_length,       /* the length of the subject */
+    start_offset,         /* starting offset in the subject */
+    options,              /* options */
+    match_data,           /* block for storing the result */
+    NULL);                /* use default match context */
+
+  /* This time, a result of NOMATCH isn't an error. If the value in "options"
+  is zero, it just means we have found all possible matches, so the loop ends.
+  Otherwise, it means we have failed to find a non-empty-string match at a
+  point where there was a previous empty-string match. In this case, we do what
+  Perl does: advance the matching position by one character, and continue. We
+  do this by setting the "end of previous match" offset, because that is picked
+  up at the top of the loop as the point at which to start again.
+
+  There are two complications: (a) When CRLF is a valid newline sequence, and
+  the current position is just before it, advance by an extra byte. (b)
+  Otherwise we must ensure that we skip an entire UTF character if we are in
+  UTF mode. */
+
+  if (rc == PCRE2_ERROR_NOMATCH)
+    {
+    if (options == 0) break;                    /* All matches found */
+    ovector[1] = start_offset + 1;              /* Advance one code unit */
+    if (crlf_is_newline &&                      /* If CRLF is a newline & */
+        start_offset < subject_length - 1 &&    /* we are at CRLF, */
+        subject[start_offset] == '\r' &&
+        subject[start_offset + 1] == '\n')
+      ovector[1] += 1;                          /* Advance by one more. */
+    else if (utf8)                              /* Otherwise, ensure we */
+      {                                         /* advance a whole UTF-8 */
+      while (ovector[1] < subject_length)       /* character. */
+        {
+        if ((subject[ovector[1]] & 0xc0) != 0x80) break;
+        ovector[1] += 1;
+        }
+      }
+    continue;    /* Go round the loop again */
+    }
+
+  /* Other matching errors are not recoverable. */
+
+  if (rc < 0)
+    {
+    printf("Matching error %d\n", rc);
+    pcre2_match_data_free(match_data);
+    pcre2_code_free(re);
+    return 1;
+    }
+
+  /* Match succeeded */
+
+  printf("\nMatch succeeded again at offset %d\n", (int)ovector[0]);
+
+  /* The match succeeded, but the output vector wasn't big enough. This
+  should not happen. */
+
+  if (rc == 0)
+    printf("ovector was not big enough for all the captured substrings\n");
+
+  /* We must guard against patterns such as /(?=.\K)/ that use \K in an
+  assertion to set the start of a match later than its end. In this
+  demonstration program, we just detect this case and give up. */
+
+  if (ovector[0] > ovector[1])
+    {
+    printf("\\K was used in an assertion to set the match start after its end.\n"
+      "From end to start the match was: %.*s\n", (int)(ovector[0] - ovector[1]),
+        (char *)(subject + ovector[1]));
+    printf("Run abandoned\n");
+    pcre2_match_data_free(match_data);
+    pcre2_code_free(re);
+    return 1;
+    }
+
+  /* As before, show substrings stored in the output vector by number, and then
+  also any named substrings. */
+
+  for (i = 0; i < rc; i++)
+    {
+    PCRE2_SPTR substring_start = subject + ovector[2*i];
+    size_t substring_length = ovector[2*i+1] - ovector[2*i];
+    printf("%2d: %.*s\n", i, (int)substring_length, (char *)substring_start);
+    }
+
+  if (namecount == 0) printf("No named substrings\n"); else
+    {
+    PCRE2_SPTR tabptr = name_table;
+    printf("Named substrings\n");
+    for (i = 0; i < namecount; i++)
+      {
+      int n = (tabptr[0] << 8) | tabptr[1];
+      printf("(%d) %*s: %.*s\n", n, name_entry_size - 3, tabptr + 2,
+        (int)(ovector[2*n+1] - ovector[2*n]), subject + ovector[2*n]);
+      tabptr += name_entry_size;
+      }
+    }
+  }      /* End of loop to find second and subsequent matches */
+
+printf("\n");
+pcre2_match_data_free(match_data);
+pcre2_code_free(re);
+return 0;
+}
+
+/* End of pcre2demo.c */
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2grep.html b/miniconda3/share/doc/pcre2/html/pcre2grep.html new file mode 100644 index 0000000000000000000000000000000000000000..66c56029698ec1558b7b588edcb8e8caf0d55d00 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2grep.html @@ -0,0 +1,1135 @@ + + +pcre2grep specification + + +

pcre2grep man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+

+
SYNOPSIS
+

+pcre2grep [options] [long options] [pattern] [path1 path2 ...] +

+
DESCRIPTION
+

+pcre2grep searches files for character patterns, in the same way as other +grep commands do, but it uses the PCRE2 regular expression library to support +patterns that are compatible with the regular expressions of Perl 5. See +pcre2syntax(3) +for a quick-reference summary of pattern syntax, or +pcre2pattern(3) +for a full description of the syntax and semantics of the regular expressions +that PCRE2 supports. +

+

+Patterns, whether supplied on the command line or in a separate file, are given +without delimiters. For example: +

+  pcre2grep Thursday /etc/motd
+
+If you attempt to use delimiters (for example, by surrounding a pattern with +slashes, as is common in Perl scripts), they are interpreted as part of the +pattern. Quotes can of course be used to delimit patterns on the command line +because they are interpreted by the shell, and indeed quotes are required if a +pattern contains white space or shell metacharacters. +

+

+The first argument that follows any option settings is treated as the single +pattern to be matched when neither -e nor -f is present. +Conversely, when one or both of these options are used to specify patterns, all +arguments are treated as path names. At least one of -e, -f, or an +argument pattern must be provided. +

+

+If no files are specified, pcre2grep reads the standard input. The +standard input can also be referenced by a name consisting of a single hyphen. +For example: +

+  pcre2grep some-pattern file1 - file3
+
+By default, input files are searched line by line, so pattern assertions about +the beginning and end of a subject string (^, $, \A, \Z, and \z) match at +the beginning and end of each line. When a line matches a pattern, it is copied +to the standard output, and if there is more than one file, the file name is +output at the start of each line, followed by a colon. However, there are +options that can change how pcre2grep behaves. For example, the -M +option makes it possible to search for strings that span line boundaries. What +defines a line boundary is controlled by the -N (--newline) option. +The -h and -H options control whether or not file names are shown, +and the -Z option changes the file name terminator to a zero byte. +

+

+The amount of memory used for buffering files that are being scanned is +controlled by parameters that can be set by the --buffer-size and +--max-buffer-size options. The first of these sets the size of buffer +that is obtained at the start of processing. If an input file contains very +long lines, a larger buffer may be needed; this is handled by automatically +extending the buffer, up to the limit specified by --max-buffer-size. The +default values for these parameters can be set when pcre2grep is +built; if nothing is specified, the defaults are set to 20KiB and 1MiB +respectively. An error occurs if a line is too long and the buffer can no +longer be expanded. +

+

+The block of memory that is actually used is three times the "buffer size", to +allow for buffering "before" and "after" lines. If the buffer size is too +small, fewer than requested "before" and "after" lines may be output. +

+

+When matching with a multiline pattern, the size of the buffer must be at least +half of the maximum match expected or the pattern might fail to match. +

+

+Patterns can be no longer than 8KiB or BUFSIZ bytes, whichever is the greater. +BUFSIZ is defined in <stdio.h>. When there is more than one pattern +(specified by the use of -e and/or -f), each pattern is applied to +each line in the order in which they are defined, except that all the -e +patterns are tried before the -f patterns. +

+

+By default, as soon as one pattern matches a line, no further patterns are +considered. However, if --colour (or --color) is used to colour the +matching substrings, or if --only-matching, --file-offsets, +--line-offsets, or --output is used to output only the part of the +line that matched (either shown literally, or as an offset), the behaviour is +different. In this situation, all the patterns are applied to the line. If +there is more than one match, the one that begins nearest to the start of the +subject is processed; if there is more than one match at that position, the one +with the longest matching substring is processed; if the matching substrings +are equal, the first match found is processed. +

+

+Scanning with all the patterns resumes immediately following the match, so that +later matches on the same line can be found. Note, however, that an overlapping +match that starts in the middle of another match will not be processed. +

+

+The above behaviour was changed at release 10.41 to be more compatible with GNU +grep. In earlier releases, pcre2grep did not recognize matches from +later patterns that were earlier in the subject. +

+

+Patterns that can match an empty string are accepted, but empty string +matches are never recognized. An example is the pattern "(super)?(man)?", in +which all components are optional. This pattern finds all occurrences of both +"super" and "man"; the output differs from matching with "super|man" when only +the matching substrings are being shown. +

+

+If the LC_ALL or LC_CTYPE environment variable is set, +pcre2grep uses the value to set a locale when calling the PCRE2 library. +The --locale option can be used to override this. +

+
SUPPORT FOR COMPRESSED FILES
+

+Compile-time options for pcre2grep can set it up to use libz or +libbz2 for reading compressed files whose names end in .gz or +.bz2, respectively. You can find out whether your pcre2grep binary +has support for one or both of these file types by running it with the +--help option. If the appropriate support is not present, all files are +treated as plain text. The standard input is always so treated. If a file with +a .gz or .bz2 extension is not in fact compressed, it is read as a +plain text file. When input is from a compressed .gz or .bz2 file, the +--line-buffered option is ignored. +

+
BINARY FILES
+

+By default, a file that contains a binary zero byte within the first 1024 bytes +is identified as a binary file, and is processed specially. However, if the +newline type is specified as NUL, that is, the line terminator is a binary +zero, the test for a binary file is not applied. See the --binary-files +option for a means of changing the way binary files are handled. +

+
BINARY ZEROS IN PATTERNS
+

+Patterns passed from the command line are strings that are terminated by a +binary zero, so cannot contain internal zeros. However, patterns that are read +from a file via the -f option may contain binary zeros. +

+
OPTIONS
+

+The order in which some of the options appear can affect the output. For +example, both the -H and -l options affect the printing of file +names. Whichever comes later in the command line will be the one that takes +effect. Similarly, except where noted below, if an option is given twice, the +later setting is used. Numerical values for options may be followed by K or M, +to signify multiplication by 1024 or 1024*1024 respectively. +

+

+-- +This terminates the list of options. It is useful if the next item on the +command line starts with a hyphen but is not an option. This allows for the +processing of patterns and file names that start with hyphens. +

+

+-A number, --after-context=number +Output up to number lines of context after each matching line. Fewer +lines are output if the next match or the end of the file is reached, or if the +processing buffer size has been set too small. If file names and/or line +numbers are being output, a hyphen separator is used instead of a colon for the +context lines (the -Z option can be used to change the file name +terminator to a zero byte). A line containing "--" is output between each group +of lines, unless they are in fact contiguous in the input file. The value of +number is expected to be relatively small. When -c is used, +-A is ignored. +

+

+-a, --text +Treat binary files as text. This is equivalent to +--binary-files=text. +

+

+--allow-lookaround-bsk +PCRE2 now forbids the use of \K in lookarounds by default, in line with Perl. +This option causes pcre2grep to set the PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK +option, which enables this somewhat dangerous usage. +

+

+-B number, --before-context=number +Output up to number lines of context before each matching line. Fewer +lines are output if the previous match or the start of the file is within +number lines, or if the processing buffer size has been set too small. If +file names and/or line numbers are being output, a hyphen separator is used +instead of a colon for the context lines (the -Z option can be used to +change the file name terminator to a zero byte). A line containing "--" is +output between each group of lines, unless they are in fact contiguous in the +input file. The value of number is expected to be relatively small. When +-c is used, -B is ignored. +

+

+--binary-files=word +Specify how binary files are to be processed. If the word is "binary" (the +default), pattern matching is performed on binary files, but the only output is +"Binary file <name> matches" when a match succeeds. If the word is "text", +which is equivalent to the -a or --text option, binary files are +processed in the same way as any other file. In this case, when a match +succeeds, the output may be binary garbage, which can have nasty effects if +sent to a terminal. If the word is "without-match", which is equivalent to the +-I option, binary files are not processed at all; they are assumed not to +be of interest and are skipped without causing any output or affecting the +return code. +

+

+--buffer-size=number +Set the parameter that controls how much memory is obtained at the start of +processing for buffering files that are being scanned. See also +--max-buffer-size below. +

+

+-C number, --context=number +Output number lines of context both before and after each matching line. +This is equivalent to setting both -A and -B to the same value. +

+

+-c, --count +Do not output lines from the files that are being scanned; instead output the +number of lines that would have been shown, either because they matched, or, if +-v is set, because they failed to match. By default, this count is +exactly the same as the number of lines that would have been output, but if the +-M (multiline) option is used (without -v), there may be more +suppressed lines than the count (that is, the number of matches). +
+
+If no lines are selected, the number zero is output. If several files are +being scanned, a count is output for each of them and the -t option can +be used to cause a total to be output at the end. However, if the +--files-with-matches option is also used, only those files whose counts +are greater than zero are listed. When -c is used, the -A, +-B, and -C options are ignored. +

+

+--colour, --color +If this option is given without any data, it is equivalent to "--colour=auto". +If data is required, it must be given in the same shell item, separated by an +equals sign. +

+

+--colour=value, --color=value +This option specifies under what circumstances the parts of a line that matched +a pattern should be coloured in the output. It is ignored if +--file-offsets, --line-offsets, or --output is set. By +default, output is not coloured. The value for the --colour option (which +is optional, see above) may be "never", "always", or "auto". In the latter +case, colouring happens only if the standard output is connected to a terminal. +More resources are used when colouring is enabled, because pcre2grep has +to search for all possible matches in a line, not just one, in order to colour +them all. +
+
+The colour that is used can be specified by setting one of the environment +variables PCRE2GREP_COLOUR, PCRE2GREP_COLOR, PCREGREP_COLOUR, or +PCREGREP_COLOR, which are checked in that order. If none of these are set, +pcre2grep looks for GREP_COLORS or GREP_COLOR (in that order). The value +of the variable should be a string of two numbers, separated by a semicolon, +except in the case of GREP_COLORS, which must start with "ms=" or "mt=" +followed by two semicolon-separated colours, terminated by the end of the +string or by a colon. If GREP_COLORS does not start with "ms=" or "mt=" it is +ignored, and GREP_COLOR is checked. +
+
+If the string obtained from one of the above variables contains any characters +other than semicolon or digits, the setting is ignored and the default colour +is used. The string is copied directly into the control string for setting +colour on a terminal, so it is your responsibility to ensure that the values +make sense. If no relevant environment variable is set, the default is "1;31", +which gives red. +

+

+-D action, --devices=action +If an input path is not a regular file or a directory, "action" specifies how +it is to be processed. Valid values are "read" (the default) or "skip" +(silently skip the path). +

+

+-d action, --directories=action +If an input path is a directory, "action" specifies how it is to be processed. +Valid values are "read" (the default in non-Windows environments, for +compatibility with GNU grep), "recurse" (equivalent to the -r option), or +"skip" (silently skip the path, the default in Windows environments). In the +"read" case, directories are read as if they were ordinary files. In some +operating systems the effect of reading a directory like this is an immediate +end-of-file; in others it may provoke an error. +

+

+--depth-limit=number +See --match-limit below. +

+

+-E, --case-restrict +When case distinctions are being ignored in Unicode mode, two ASCII letters (K +and S) will by default match Unicode characters U+212A (Kelvin sign) and U+017F +(long S) respectively, as well as their lower case ASCII counterparts. When +this option is set, case equivalences are restricted such that no ASCII +character matches a non-ASCII character, and vice versa. +

+

+-e pattern, --regex=pattern, --regexp=pattern +Specify a pattern to be matched. This option can be used multiple times in +order to specify several patterns. It can also be used as a way of specifying a +single pattern that starts with a hyphen. When -e is used, no argument +pattern is taken from the command line; all arguments are treated as file +names. There is no limit to the number of patterns. They are applied to each +line in the order in which they are defined. +
+
+If -f is used with -e, the command line patterns are matched first, +followed by the patterns from the file(s), independent of the order in which +these options are specified. +

+

+--exclude=pattern +Files (but not directories) whose names match the pattern are skipped without +being processed. This applies to all files, whether listed on the command line, +obtained from --file-list, or by scanning a directory. The pattern is a +PCRE2 regular expression, and is matched against the final component of the +file name, not the entire path. The -F, -w, and -x options do +not apply to this pattern. The option may be given any number of times in order +to specify multiple patterns. If a file name matches both an --include +and an --exclude pattern, it is excluded. There is no short form for this +option. +

+

+--exclude-from=filename +Treat each non-empty line of the file as the data for an --exclude +option. What constitutes a newline when reading the file is the operating +system's default. The --newline option has no effect on this option. This +option may be given more than once in order to specify a number of files to +read. +

+

+--exclude-dir=pattern +Directories whose names match the pattern are skipped without being processed, +whatever the setting of the --recursive option. This applies to all +directories, whether listed on the command line, obtained from +--file-list, or by scanning a parent directory. The pattern is a PCRE2 +regular expression, and is matched against the final component of the directory +name, not the entire path. The -F, -w, and -x options do not +apply to this pattern. The option may be given any number of times in order to +specify more than one pattern. If a directory matches both --include-dir +and --exclude-dir, it is excluded. There is no short form for this +option. +

+

+-F, --fixed-strings +Interpret each data-matching pattern as a list of fixed strings, separated by +newlines, instead of as a regular expression. What constitutes a newline for +this purpose is controlled by the --newline option. The -w (match +as a word) and -x (match whole line) options can be used with -F. +They apply to each of the fixed strings. A line is selected if any of the fixed +strings are found in it (subject to -w or -x, if present). This +option applies only to the patterns that are matched against the contents of +files; it does not apply to patterns specified by any of the --include or +--exclude options. +

+

+-f filename, --file=filename +Read patterns from the file, one per line. As is the case with patterns on the +command line, no delimiters should be used. What constitutes a newline when +reading the file is the operating system's default interpretation of \n. The +--newline option has no effect on this option. Trailing white space is +removed from each line, and blank lines are ignored unless the +--posix-pattern-file option is also provided. An empty file contains no +patterns and therefore matches nothing. Patterns read from a file in this way +may contain binary zeros, which are treated as ordinary character literals. +
+
+If this option is given more than once, all the specified files are read. A +data line is output if any of the patterns match it. A file name can be given +as "-" to refer to the standard input. When -f is used, patterns +specified on the command line using -e may also be present; they are +matched before the file's patterns. However, no pattern is taken from the +command line; all arguments are treated as the names of paths to be searched. +

+

+--file-list=filename +Read a list of files and/or directories that are to be scanned from the given +file, one per line. What constitutes a newline when reading the file is the +operating system's default. Trailing white space is removed from each line, and +blank lines are ignored. These paths are processed before any that are listed +on the command line. The file name can be given as "-" to refer to the standard +input. If --file and --file-list are both specified as "-", +patterns are read first. This is useful only when the standard input is a +terminal, from which further lines (the list of files) can be read after an +end-of-file indication. If this option is given more than once, all the +specified files are read. +

+

+--file-offsets +Instead of showing lines or parts of lines that match, show each match as an +offset from the start of the file and a length, separated by a comma. In this +mode, --colour has no effect, and no context is shown. That is, the +-A, -B, and -C options are ignored. If there is more than one +match in a line, each of them is shown separately. This option is mutually +exclusive with --output, --line-offsets, and --only-matching. +

+

+--group-separator=text +Output this text string instead of two hyphens between groups of lines when +-A, -B, or -C is in use. See also --no-group-separator. +

+

+-H, --with-filename +Force the inclusion of the file name at the start of output lines when +searching a single file. The file name is not normally shown in this case. +By default, for matching lines, the file name is followed by a colon; for +context lines, a hyphen separator is used. The -Z option can be used to +change the terminator to a zero byte. If a line number is also being output, +it follows the file name. When the -M option causes a pattern to match +more than one line, only the first is preceded by the file name. This option +overrides any previous -h, -l, or -L options. +

+

+-h, --no-filename +Suppress the output file names when searching multiple files. File names are +normally shown when multiple files are searched. By default, for matching +lines, the file name is followed by a colon; for context lines, a hyphen +separator is used. The -Z option can be used to change the terminator to +a zero byte. If a line number is also being output, it follows the file name. +This option overrides any previous -H, -L, or -l options. +

+

+--heap-limit=number +See --match-limit below. +

+

+--help +Output a help message, giving brief details of the command options and file +type support, and then exit. Anything else on the command line is +ignored. +

+

+-I +Ignore binary files. This is equivalent to +--binary-files=without-match. +

+

+-i, --ignore-case +Ignore upper/lower case distinctions when pattern matching. This applies when +matching path names for inclusion or exclusion as well as when matching lines +in files. +

+

+--include=pattern +If any --include patterns are specified, the only files that are +processed are those whose names match one of the patterns and do not match an +--exclude pattern. This option does not affect directories, but it +applies to all files, whether listed on the command line, obtained from +--file-list, or by scanning a directory. The pattern is a PCRE2 regular +expression, and is matched against the final component of the file name, not +the entire path. The -F, -w, and -x options do not apply to +this pattern. The option may be given any number of times. If a file name +matches both an --include and an --exclude pattern, it is excluded. +There is no short form for this option. +

+

+--include-from=filename +Treat each non-empty line of the file as the data for an --include +option. What constitutes a newline for this purpose is the operating system's +default. The --newline option has no effect on this option. This option +may be given any number of times; all the files are read. +

+

+--include-dir=pattern +If any --include-dir patterns are specified, the only directories that +are processed are those whose names match one of the patterns and do not match +an --exclude-dir pattern. This applies to all directories, whether listed +on the command line, obtained from --file-list, or by scanning a parent +directory. The pattern is a PCRE2 regular expression, and is matched against +the final component of the directory name, not the entire path. The -F, +-w, and -x options do not apply to this pattern. The option may be +given any number of times. If a directory matches both --include-dir and +--exclude-dir, it is excluded. There is no short form for this option. +

+

+-L, --files-without-match +Instead of outputting lines from the files, just output the names of the files +that do not contain any lines that would have been output. Each file name is +output once, on a separate line by default, but if the -Z option is set, +they are separated by zero bytes instead of newlines. This option overrides any +previous -H, -h, or -l options. +

+

+-l, --files-with-matches +Instead of outputting lines from the files, just output the names of the files +containing lines that would have been output. Each file name is output once, on +a separate line, but if the -Z option is set, they are separated by zero +bytes instead of newlines. Searching normally stops as soon as a matching line +is found in a file. However, if the -c (count) option is also used, +matching continues in order to obtain the correct count, and those files that +have at least one match are listed along with their counts. Using this option +with -c is a way of suppressing the listing of files with no matches that +occurs with -c on its own. This option overrides any previous -H, +-h, or -L options. +

+

+--label=name +This option supplies a name to be used for the standard input when file names +are being output. If not supplied, "(standard input)" is used. There is no +short form for this option. +

+

+--line-buffered +When this option is given, non-compressed input is read and processed line by +line, and the output is flushed after each write. By default, input is read in +large chunks, unless pcre2grep can determine that it is reading from a +terminal, which is currently possible only in Unix-like environments or +Windows. Output to terminal is normally automatically flushed by the operating +system. This option can be useful when the input or output is attached to a +pipe and you do not want pcre2grep to buffer up large amounts of data. +However, its use will affect performance, and the -M (multiline) option +ceases to work. When input is from a compressed .gz or .bz2 file, +--line-buffered is ignored. +

+

+--line-offsets +Instead of showing lines or parts of lines that match, show each match as a +line number, the offset from the start of the line, and a length. The line +number is terminated by a colon (as usual; see the -n option), and the +offset and length are separated by a comma. In this mode, --colour has no +effect, and no context is shown. That is, the -A, -B, and -C +options are ignored. If there is more than one match in a line, each of them is +shown separately. This option is mutually exclusive with --output, +--file-offsets, and --only-matching. +

+

+--locale=locale-name +This option specifies a locale to be used for pattern matching. It overrides +the value in the LC_ALL or LC_CTYPE environment variables. If no +locale is specified, the PCRE2 library's default (usually the "C" locale) is +used. There is no short form for this option. +

+

+-M, --multiline +Allow patterns to match more than one line. When this option is set, the PCRE2 +library is called in "multiline" mode, and a match is allowed to continue past +the end of the initial line and onto one or more subsequent lines. +
+
+Patterns used with -M may usefully contain literal newline characters and +internal occurrences of ^ and $ characters, because in multiline mode these can +match at internal newlines. Because pcre2grep is scanning multiple lines, +the \Z and \z assertions match only at the end of the last line in the file. +The \A assertion matches at the start of the first line of a match. This can +be any line in the file; it is not anchored to the first line. +
+
+The output for a successful match may consist of more than one line. The first +line is the line in which the match started, and the last line is the line in +which the match ended. If the matched string ends with a newline sequence, the +output ends at the end of that line. If -v is set, none of the lines in a +multi-line match are output. Once a match has been handled, scanning restarts +at the beginning of the line after the one in which the match ended. +
+
+The newline sequence that separates multiple lines must be matched as part of +the pattern. For example, to find the phrase "regular expression" in a file +where "regular" might be at the end of a line and "expression" at the start of +the next line, you could use this command: +

+  pcre2grep -M 'regular\s+expression' <file>
+
+The \s escape sequence matches any white space character, including newlines, +and is followed by + so as to match trailing white space on the first line as +well as possibly handling a two-character newline sequence. +
+
+There is a limit to the number of lines that can be matched, imposed by the way +that pcre2grep buffers the input file as it scans it. With a sufficiently +large processing buffer, this should not be a problem. +
+
+The -M option does not work when input is read line by line (see +--line-buffered.) +

+

+-m number, --max-count=number +Stop processing after finding number matching lines, or non-matching +lines if -v is also set. Any trailing context lines are output after the +final match. In multiline mode, each multiline match counts as just one line +for this purpose. If this limit is reached when reading the standard input from +a regular file, the file is left positioned just after the last matching line. +If -c is also set, the count that is output is never greater than +number. This option has no effect if used with -L, -l, or +-q, or when just checking for a match in a binary file. +

+

+--match-limit=number +Processing some regular expression patterns may take a very long time to search +for all possible matching strings. Others may require a very large amount of +memory. There are three options that set resource limits for matching. +
+
+The --match-limit option provides a means of limiting computing resource +usage when processing patterns that are not going to match, but which have a +very large number of possibilities in their search trees. The classic example +is a pattern that uses nested unlimited repeats. Internally, PCRE2 has a +counter that is incremented each time around its main processing loop. If the +value set by --match-limit is reached, an error occurs. +
+
+The --heap-limit option specifies, as a number of kibibytes (units of +1024 bytes), the maximum amount of heap memory that may be used for matching. +
+
+The --depth-limit option limits the depth of nested backtracking points, +which indirectly limits the amount of memory that is used. The amount of memory +needed for each backtracking point depends on the number of capturing +parentheses in the pattern, so the amount of memory that is used before this +limit acts varies from pattern to pattern. This limit is of use only if it is +set smaller than --match-limit. +
+
+There are no short forms for these options. The default limits can be set +when the PCRE2 library is compiled; if they are not specified, the defaults +are very large and so effectively unlimited. +

+

+--max-buffer-size=number +This limits the expansion of the processing buffer, whose initial size can be +set by --buffer-size. The maximum buffer size is silently forced to be no +smaller than the starting buffer size. +

+

+-N newline-type, --newline=newline-type +Six different conventions for indicating the ends of lines in scanned files are +supported. For example: +

+  pcre2grep -N CRLF 'some pattern' <file>
+
+The newline type may be specified in upper, lower, or mixed case. If the +newline type is NUL, lines are separated by binary zero characters. The other +types are the single-character sequences CR (carriage return) and LF +(linefeed), the two-character sequence CRLF, an "anycrlf" type, which +recognizes any of the preceding three types, and an "any" type, for which any +Unicode line ending sequence is assumed to end a line. The Unicode sequences +are the three just mentioned, plus VT (vertical tab, U+000B), FF (form feed, +U+000C), NEL (next line, U+0085), LS (line separator, U+2028), and PS +(paragraph separator, U+2029). +
+
+When the PCRE2 library is built, a default line-ending sequence is specified. +This is normally the standard sequence for the operating system. Unless +otherwise specified by this option, pcre2grep uses the library's default. +
+
+This option makes it possible to use pcre2grep to scan files that have +come from other environments without having to modify their line endings. If +the data that is being scanned does not agree with the convention set by this +option, pcre2grep may behave in strange ways. Note that this option does +not apply to files specified by the -f, --exclude-from, or +--include-from options, which are expected to use the operating system's +standard newline sequence. +

+

+-n, --line-number +Precede each output line by its line number in the file, followed by a colon +for matching lines or a hyphen for context lines. If the file name is also +being output, it precedes the line number. When the -M option causes a +pattern to match more than one line, only the first is preceded by its line +number. This option is forced if --line-offsets is used. +

+

+--no-group-separator +Do not output a separator between groups of lines when -A, -B, or +-C is in use. The default is to output a line containing two hyphens. See +also --group-separator. +

+

+--no-jit +If the PCRE2 library is built with support for just-in-time compiling (which +speeds up matching), pcre2grep automatically makes use of this, unless it +was explicitly disabled at build time. This option can be used to disable the +use of JIT at run time. It is provided for testing and working around problems. +It should never be needed in normal use. +

+

+-O text, --output=text +When there is a match, instead of outputting the line that matched, output just +the text specified in this option, followed by an operating-system standard +newline. In this mode, --colour has no effect, and no context is shown. +That is, the -A, -B, and -C options are ignored. The +--newline option has no effect on this option, which is mutually +exclusive with --only-matching, --file-offsets, and +--line-offsets. However, like --only-matching, if there is more +than one match in a line, each of them causes a line of output. +
+
+Escape sequences starting with a dollar character may be used to insert the +contents of the matched part of the line and/or captured substrings into the +text. +
+
+$<digits> or ${<digits>} is replaced by the captured substring of the given +decimal number; $& (or the legacy $0) substitutes the whole match. If the +number is greater than the number of capturing substrings, or if the capture +is unset, the replacement is empty. +
+
+$a is replaced by bell; $b by backspace; $e by escape; $f by form feed; $n by +newline; $r by carriage return; $t by tab; $v by vertical tab. +
+
+$o<digits> or $o{<digits>} is replaced by the character whose code point is the +given octal number. In the first form, up to three octal digits are processed. +When more digits are needed in Unicode mode to specify a wide character, the +second form must be used. +
+
+$x<digits> or $x{<digits>} is replaced by the character represented by the +given hexadecimal number. In the first form, up to two hexadecimal digits are +processed. When more digits are needed in Unicode mode to specify a wide +character, the second form must be used. +
+
+Any other character is substituted by itself. In particular, $$ is replaced by +a single dollar. +

+

+-o, --only-matching +Show only the part of the line that matched a pattern instead of the whole +line. In this mode, no context is shown. That is, the -A, -B, and +-C options are ignored. If there is more than one match in a line, each +of them is shown separately, on a separate line of output. If -o is +combined with -v (invert the sense of the match to find non-matching +lines), no output is generated, but the return code is set appropriately. If +the matched portion of the line is empty, nothing is output unless the file +name or line number are being printed, in which case they are shown on an +otherwise empty line. This option is mutually exclusive with --output, +--file-offsets and --line-offsets. +

+

+-onumber, --only-matching=number +Show only the part of the line that matched the capturing parentheses of the +given number. Up to 50 capturing parentheses are supported by default. This +limit can be changed via the --om-capture option. A pattern may contain +any number of capturing parentheses, but only those whose number is within the +limit can be accessed by -o. An error occurs if the number specified by +-o is greater than the limit. +
+
+-o0 is the same as -o without a number. Because these options can be +given without an argument (see above), if an argument is present, it must be +given in the same shell item, for example, -o3 or --only-matching=2. The +comments given for the non-argument case above also apply to this option. If +the specified capturing parentheses do not exist in the pattern, or were not +set in the match, nothing is output unless the file name or line number are +being output. +
+
+If this option is given multiple times, multiple substrings are output for each +match, in the order the options are given, and all on one line. For example, +-o3 -o1 -o3 causes the substrings matched by capturing parentheses 3 and 1 and +then 3 again to be output. By default, there is no separator (but see the next +but one option). +

+

+--om-capture=number +Set the number of capturing parentheses that can be accessed by -o. The +default is 50. +

+

+--om-separator=text +Specify a separating string for multiple occurrences of -o. The default +is an empty string. Separating strings are never coloured. +

+

+-P, --no-ucp +Starting from release 10.43, when UTF/Unicode mode is specified with -u +or -U, the PCRE2_UCP option is used by default. This means that the +POSIX classes in patterns match more than just ASCII characters. For example, +[:digit:] matches any Unicode decimal digit. The --no-ucp option +suppresses PCRE2_UCP, thus restricting the POSIX classes to ASCII characters, +as was the case in earlier releases. Note that there are now more fine-grained +option settings within patterns that affect individual classes. For example, +when in UCP mode, the sequence (?aP) restricts [:word:] to ASCII letters, while +allowing \w to match Unicode letters and digits. +

+

+--posix-pattern-file +When patterns are provided with the -f option, do not trim trailing +spaces or ignore empty lines in a similar way than other grep tools. To keep +the behaviour consistent with older versions, if the pattern read was +terminated with CRLF (as character literals) then both characters won't be +included as part of it, so if you really need to have pattern ending in '\r', +use a escape sequence or provide it by a different method. +

+

+-q, --quiet +Work quietly, that is, display nothing except error messages. The exit +status indicates whether or not any matches were found. +

+

+-r, --recursive +If any given path is a directory, recursively scan the files it contains, +taking note of any --include and --exclude settings. By default, a +directory is read as a normal file; in some operating systems this gives an +immediate end-of-file. This option is a shorthand for setting the -d +option to "recurse". +

+

+--recursion-limit=number +This is an obsolete synonym for --depth-limit. See --match-limit +above for details. +

+

+-s, --no-messages +Suppress error messages about non-existent or unreadable files. Such files are +quietly skipped. However, the return code is still 2, even if matches were +found in other files. +

+

+-t, --total-count +This option is useful when scanning more than one file. If used on its own, +-t suppresses all output except for a grand total number of matching +lines (or non-matching lines if -v is used) in all the files. If -t +is used with -c, a grand total is output except when the previous output +is just one line. In other words, it is not output when just one file's count +is listed. If file names are being output, the grand total is preceded by +"TOTAL:". Otherwise, it appears as just another number. The -t option is +ignored when used with -L (list files without matches), because the grand +total would always be zero. +

+

+-u, --utf +Operate in UTF/Unicode mode. This option is available only if PCRE2 has been +compiled with UTF-8 support. All patterns (including those for any +--exclude and --include options) and all lines that are scanned +must be valid strings of UTF-8 characters. If an invalid UTF-8 string is +encountered, an error occurs. +

+

+-U, --utf-allow-invalid +As --utf, but in addition subject lines may contain invalid UTF-8 code +unit sequences. These can never form part of any pattern match. Patterns +themselves, however, must still be valid UTF-8 strings. This facility allows +valid UTF-8 strings to be sought within arbitrary byte sequences in executable +or other binary files. For more details about matching in non-valid UTF-8 +strings, see the +pcre2unicode(3) +documentation. +

+

+-V, --version +Write the version numbers of pcre2grep and the PCRE2 library to the +standard output and then exit. Anything else on the command line is +ignored. +

+

+-v, --invert-match +Invert the sense of the match, so that lines which do not match any of +the patterns are the ones that are found. When this option is set, options such +as --only-matching and --output, which specify parts of a match +that are to be output, are ignored. +

+

+-w, --word-regex, --word-regexp +Force the patterns only to match "words". That is, there must be a word +boundary at the start and end of each matched string. This is equivalent to +having "\b(?:" at the start of each pattern, and ")\b" at the end. This +option applies only to the patterns that are matched against the contents of +files; it does not apply to patterns specified by any of the --include or +--exclude options. +

+

+-x, --line-regex, --line-regexp +Force the patterns to start matching only at the beginnings of lines, and in +addition, require them to match entire lines. In multiline mode the match may +be more than one line. This is equivalent to having "^(?:" at the start of each +pattern and ")$" at the end. This option applies only to the patterns that are +matched against the contents of files; it does not apply to patterns specified +by any of the --include or --exclude options. +

+

+-Z, --null +Terminate files names in the regular output with a zero byte (the NUL +character) instead of what would normally appear. This is useful when file +names contain unusual characters such as colons, hyphens, or even newlines. The +option does not apply to file names in error messages. +

+
ENVIRONMENT VARIABLES
+

+The environment variables LC_ALL and LC_CTYPE are examined, in that +order, for a locale. The first one that is set is used. This can be overridden +by the --locale option. If no locale is set, the PCRE2 library's default +(usually the "C" locale) is used. +

+
NEWLINES
+

+The -N (--newline) option allows pcre2grep to scan files with +newline conventions that differ from the default. This option affects only the +way scanned files are processed. It does not affect the interpretation of files +specified by the -f, --file-list, --exclude-from, or +--include-from options. +

+

+Any parts of the scanned input files that are written to the standard output +are copied with whatever newline sequences they have in the input. However, if +the final line of a file is output, and it does not end with a newline +sequence, a newline sequence is added. If the newline setting is CR, LF, CRLF +or NUL, that line ending is output; for the other settings (ANYCRLF or ANY) a +single NL is used. +

+

+The newline setting does not affect the way in which pcre2grep writes +newlines in informational messages to the standard output and error streams. +Under Windows, the standard output is set to be binary, so that "\r\n" at the +ends of output lines that are copied from the input is not converted to +"\r\r\n" by the C I/O library. This means that any messages written to the +standard output must end with "\r\n". For all other operating systems, and +for all messages to the standard error stream, "\n" is used. +

+
OPTIONS COMPATIBILITY WITH GNU GREP
+

+Many of the short and long forms of pcre2grep's options are the same as +in the GNU grep program. Any long option of the form --xxx-regexp +(GNU terminology) is also available as --xxx-regex (PCRE2 terminology). +However, the --case-restrict, --depth-limit, -E, +--file-list, --file-offsets, --heap-limit, +--include-dir, --line-offsets, --locale, --match-limit, +-M, --multiline, -N, --newline, --no-ucp, +--om-separator, --output, -P, -u, --utf, +-U, and --utf-allow-invalid options are specific to +pcre2grep, as is the use of the --only-matching option with a +capturing parentheses number. +

+

+Although most of the common options work the same way, a few are different in +pcre2grep. For example, the --include option's argument is a glob +for GNU grep, but in pcre2grep it is a regular expression to which +the -i option applies. If both the -c and -l options are +given, GNU grep lists only file names, without counts, but pcre2grep +gives the counts as well. +

+
OPTIONS WITH DATA
+

+There are four different ways in which an option with data can be specified. +If a short form option is used, the data may follow immediately, or (with one +exception) in the next command line item. For example: +

+  -f/some/file
+  -f /some/file
+
+The exception is the -o option, which may appear with or without data. +Because of this, if data is present, it must follow immediately in the same +item, for example -o3. +

+

+If a long form option is used, the data may appear in the same command line +item, separated by an equals character, or (with two exceptions) it may appear +in the next command line item. For example: +

+  --file=/some/file
+  --file /some/file
+
+Note, however, that if you want to supply a file name beginning with ~ as data +in a shell command, and have the shell expand ~ to a home directory, you must +separate the file name from the option, because the shell does not treat ~ +specially unless it is at the start of an item. +

+

+The exceptions to the above are the --colour (or --color) and +--only-matching options, for which the data is optional. If one of these +options does have data, it must be given in the first form, using an equals +character. Otherwise pcre2grep will assume that it has no data. +

+
USING PCRE2'S CALLOUT FACILITY
+

+pcre2grep has, by default, support for calling external programs or +scripts or echoing specific strings during matching by making use of PCRE2's +callout facility. However, this support can be completely or partially disabled +when pcre2grep is built. You can find out whether your binary has support +for callouts by running it with the --help option. If callout support is +completely disabled, callouts in patterns are forbidden by pcre2grep. +If the facility is partially disabled, calling external programs is not +supported, and callouts that request it are ignored. +

+

+A callout in a PCRE2 pattern is of the form (?C<arg>) where the argument is +either a number or a quoted string (see the +pcre2callout +documentation for details). Numbered callouts are ignored by pcre2grep; +only callouts with string arguments are useful. +

+
+Echoing a specific string +
+

+Starting the callout string with a pipe character invokes an echoing facility +that avoids calling an external program or script. This facility is always +available, provided that callouts were not completely disabled when +pcre2grep was built. The rest of the callout string is processed as a +zero-terminated string, which means it should not contain any internal binary +zeros. It is written to the output, having first been passed through the same +escape processing as text from the --output (-O) option (see +above). However, $0 or $& cannot be used to insert a matched substring because +the match is still in progress. Instead, the single character '0' is inserted. +Any syntax errors in the string (for example, a dollar not followed by another +character) causes the callout to be ignored. No terminator is added to the +output string, so if you want a newline, you must include it explicitly using +the escape $n. For example: +

+  pcre2grep '(.)(..(.))(?C"|[$1] [$2] [$3]$n")' <some file>
+
+Matching continues normally after the string is output. If you want to see only +the callout output but not any output from an actual match, you should end the +pattern with (*FAIL). +

+
+Calling external programs or scripts +
+

+This facility can be independently disabled when pcre2grep is built. It +is supported for Windows, where a call to _spawnvp() is used, for VMS, +where lib$spawn() is used, and for any Unix-like environment where +fork() and execv() are available. +

+

+If the callout string does not start with a pipe (vertical bar) character, it +is parsed into a list of substrings separated by pipe characters. The first +substring must be an executable name, with the following substrings specifying +arguments: +

+  executable_name|arg1|arg2|...
+
+Any substring (including the executable name) may contain escape sequences +started by a dollar character. These are the same as for the --output +(-O) option documented above, except that $0 or $& cannot insert the +matched string because the match is still in progress. Instead, the character +'0' is inserted. If you need a literal dollar or pipe character in any +substring, use $$ or $| respectively. Here is an example: +
+  echo -e "abcde\n12345" | pcre2grep \
+    '(?x)(.)(..(.))
+    (?C"/bin/echo|Arg1: [$1] [$2] [$3]|Arg2: $|${1}$| ($4)")()' -
+
+  Output:
+
+    Arg1: [a] [bcd] [d] Arg2: |a| ()
+    abcde
+    Arg1: [1] [234] [4] Arg2: |1| ()
+    12345
+
+The parameters for the system call that is used to run the program or script +are zero-terminated strings. This means that binary zero characters in the +callout argument will cause premature termination of their substrings, and +therefore should not be present. Any syntax errors in the string (for example, +a dollar not followed by another character) causes the callout to be ignored. +If running the program fails for any reason (including the non-existence of the +executable), a local matching failure occurs and the matcher backtracks in the +normal way. +

+
MATCHING ERRORS
+

+It is possible to supply a regular expression that takes a very long time to +fail to match certain lines. Such patterns normally involve nested indefinite +repeats, for example: (a+)*\d when matched against a line of a's with no final +digit. The PCRE2 matching function has a resource limit that causes it to abort +in these circumstances. If this happens, pcre2grep outputs an error +message and the line that caused the problem to the standard error stream. If +there are more than 20 such errors, pcre2grep gives up. +

+

+The --match-limit option of pcre2grep can be used to set the +overall resource limit. There are also other limits that affect the amount of +memory used during matching; see the discussion of --heap-limit and +--depth-limit above. +

+
DIAGNOSTICS
+

+Exit status is 0 if any matches were found, 1 if no matches were found, and 2 +for syntax errors, overlong lines, non-existent or inaccessible files (even if +matches were found in other files) or too many matching errors. Using the +-s option to suppress error messages about inaccessible files does not +affect the return code. +

+

+When run under VMS, the return code is placed in the symbol PCRE2GREP_RC +because VMS does not distinguish between exit(0) and exit(1). +

+
SEE ALSO
+

+pcre2pattern(3), pcre2syntax(3), pcre2callout(3), +pcre2unicode(3). +

+
AUTHOR
+

+Philip Hazel +
+Retired from University Computing Service +
+Cambridge, England. +
+

+
REVISION
+

+Last updated: 04 February 2025 +
+Copyright © 1997-2023 University of Cambridge. +
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2jit.html b/miniconda3/share/doc/pcre2/html/pcre2jit.html new file mode 100644 index 0000000000000000000000000000000000000000..6835cd8898a7347d29442a3e2254c66c7413570c --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2jit.html @@ -0,0 +1,505 @@ + + +pcre2jit specification + + +

pcre2jit man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+

+
PCRE2 JUST-IN-TIME COMPILER SUPPORT
+

+Just-in-time compiling is a heavyweight optimization that can greatly speed up +pattern matching. However, it comes at the cost of extra processing before the +match is performed, so it is of most benefit when the same pattern is going to +be matched many times. This does not necessarily mean many calls of a matching +function; if the pattern is not anchored, matching attempts may take place many +times at various positions in the subject, even for a single call. Therefore, +if the subject string is very long, it may still pay to use JIT even for +one-off matches. JIT support is available for all of the 8-bit, 16-bit and +32-bit PCRE2 libraries. +

+

+JIT support applies only to the traditional Perl-compatible matching function. +It does not apply when the DFA matching function is being used. The code for +JIT support was written by Zoltan Herczeg. +

+
AVAILABILITY OF JIT SUPPORT
+

+JIT support is an optional feature of PCRE2. The "configure" option +--enable-jit (or equivalent CMake option) must be set when PCRE2 is built if +you want to use JIT. The support is limited to the following hardware +platforms: +

+  ARM 32-bit (v7, and Thumb2)
+  ARM 64-bit
+  IBM s390x 64 bit
+  Intel x86 32-bit and 64-bit
+  LoongArch 64 bit
+  MIPS 32-bit and 64-bit
+  Power PC 32-bit and 64-bit
+  RISC-V 32-bit and 64-bit
+
+If --enable-jit is set on an unsupported platform, compilation fails. +

+

+A client program can tell if JIT support has been compiled by calling +pcre2_config() with the PCRE2_CONFIG_JIT option. The result is one if +PCRE2 was built with JIT support, and zero otherwise. However, having the JIT +code available does not guarantee that it will be used for any particular +match. One reason for this is that there are a number of options and pattern +items that are +not supported by JIT +(see below). Another reason is that in some environments JIT is unable to get +executable memory in which to build its compiled code. The only guarantee from +pcre2_config() is that if it returns zero, JIT will definitely not +be used. +

+

+As of release 10.45 there is a more informative way to test for JIT support. If +pcre2_compile_jit() is called with the single option PCRE2_JIT_TEST_ALLOC +it returns zero if JIT is available and has a working allocator. Otherwise it +returns PCRE2_ERROR_NOMEMORY if JIT is available but cannot allocate executable +memory, or PCRE2_ERROR_JIT_UNSUPPORTED if JIT support is not compiled. The +code argument is ignored, so it can be a NULL value. +

+

+A simple program does not need to check availability in order to use JIT when +possible. The API is implemented in a way that falls back to the interpretive +code if JIT is not available or cannot be used for a given match. For programs +that need the best possible performance, there is a +"fast path" +API that is JIT-specific. +

+
SIMPLE USE OF JIT
+

+To make use of the JIT support in the simplest way, all you have to do is to +call pcre2_jit_compile() after successfully compiling a pattern with +pcre2_compile(). This function has two arguments: the first is the +compiled pattern pointer that was returned by pcre2_compile(), and the +second is zero or more of the following option bits: PCRE2_JIT_COMPLETE, +PCRE2_JIT_PARTIAL_HARD, or PCRE2_JIT_PARTIAL_SOFT. +

+

+If JIT support is not available, a call to pcre2_jit_compile() does +nothing and returns PCRE2_ERROR_JIT_BADOPTION. Otherwise, the compiled pattern +is passed to the JIT compiler, which turns it into machine code that executes +much faster than the normal interpretive code, but yields exactly the same +results. The returned value from pcre2_jit_compile() is zero on success, +or a negative error code. +

+

+There is a limit to the size of pattern that JIT supports, imposed by the size +of machine stack that it uses. The exact rules are not documented because they +may change at any time, in particular, when new optimizations are introduced. +If a pattern is too big, a call to pcre2_jit_compile() returns +PCRE2_ERROR_NOMEMORY. +

+

+PCRE2_JIT_COMPLETE requests the JIT compiler to generate code for complete +matches. If you want to run partial matches using the PCRE2_PARTIAL_HARD or +PCRE2_PARTIAL_SOFT options of pcre2_match(), you should set one or both +of the other options as well as, or instead of PCRE2_JIT_COMPLETE. The JIT +compiler generates different optimized code for each of the three modes +(normal, soft partial, hard partial). When pcre2_match() is called, the +appropriate code is run if it is available. Otherwise, the pattern is matched +using interpretive code. +

+

+You can call pcre2_jit_compile() multiple times for the same compiled +pattern. It does nothing if it has previously compiled code for any of the +option bits. For example, you can call it once with PCRE2_JIT_COMPLETE and +(perhaps later, when you find you need partial matching) again with +PCRE2_JIT_COMPLETE and PCRE2_JIT_PARTIAL_HARD. This time it will ignore +PCRE2_JIT_COMPLETE and just compile code for partial matching. If +pcre2_jit_compile() is called with no option bits set, it immediately +returns zero. This is an alternative way of testing whether JIT support has +been compiled. +

+

+At present, it is not possible to free JIT compiled code except when the entire +compiled pattern is freed by calling pcre2_code_free(). +

+

+In some circumstances you may need to call additional functions. These are +described in the section entitled +"Controlling the JIT stack" +below. +

+

+There are some pcre2_match() options that are not supported by JIT, and +there are also some pattern items that JIT cannot handle. Details are given +below. +In both cases, matching automatically falls back to the interpretive code. If +you want to know whether JIT was actually used for a particular match, you +should arrange for a JIT callback function to be set up as described in the +section entitled +"Controlling the JIT stack" +below, even if you do not need to supply a non-default JIT stack. Such a +callback function is called whenever JIT code is about to be obeyed. If the +match-time options are not right for JIT execution, the callback function is +not obeyed. +

+

+If the JIT compiler finds an unsupported item, no JIT data is generated. You +can find out if JIT compilation was successful for a compiled pattern by +calling pcre2_pattern_info() with the PCRE2_INFO_JITSIZE option. A +non-zero result means that JIT compilation was successful. A result of 0 means +that JIT support is not available, or the pattern was not processed by +pcre2_jit_compile(), or the JIT compiler was not able to handle the +pattern. Successful JIT compilation does not, however, guarantee the use of JIT +at match time because there are some match time options that are not supported +by JIT. +

+
MATCHING SUBJECTS CONTAINING INVALID UTF
+

+When a pattern is compiled with the PCRE2_UTF option, subject strings are +normally expected to be a valid sequence of UTF code units. By default, this is +checked at the start of matching and an error is generated if invalid UTF is +detected. The PCRE2_NO_UTF_CHECK option can be passed to pcre2_match() to +skip the check (for improved performance) if you are sure that a subject string +is valid. If this option is used with an invalid string, the result is +undefined. The calling program may crash or loop or otherwise misbehave. +

+

+However, a way of running matches on strings that may contain invalid UTF +sequences is available. Calling pcre2_compile() with the +PCRE2_MATCH_INVALID_UTF option has two effects: it tells the interpreter in +pcre2_match() to support invalid UTF, and, if pcre2_jit_compile() +is subsequently called, the compiled JIT code also supports invalid UTF. +Details of how this support works, in both the JIT and the interpretive cases, +is given in the +pcre2unicode +documentation. +

+

+There is also an obsolete option for pcre2_jit_compile() called +PCRE2_JIT_INVALID_UTF, which currently exists only for backward compatibility. +It is superseded by the pcre2_compile() option PCRE2_MATCH_INVALID_UTF +and should no longer be used. It may be removed in future. +

+
UNSUPPORTED OPTIONS AND PATTERN ITEMS
+

+The pcre2_match() options that are supported for JIT matching are +PCRE2_COPY_MATCHED_SUBJECT, PCRE2_NOTBOL, PCRE2_NOTEOL, PCRE2_NOTEMPTY, +PCRE2_NOTEMPTY_ATSTART, PCRE2_NO_UTF_CHECK, PCRE2_PARTIAL_HARD, and +PCRE2_PARTIAL_SOFT. The PCRE2_ANCHORED and PCRE2_ENDANCHORED options are not +supported at match time. +

+

+If the PCRE2_NO_JIT option is passed to pcre2_match() it disables the +use of JIT, forcing matching by the interpreter code. +

+

+The only unsupported pattern items are \C (match a single data unit) when +running in a UTF mode, and a callout immediately before an assertion condition +in a conditional group. +

+
RETURN VALUES FROM JIT MATCHING
+

+When a pattern is matched using JIT, the return values are the same as those +given by the interpretive pcre2_match() code, with the addition of one +new error code: PCRE2_ERROR_JIT_STACKLIMIT. This means that the memory used for +the JIT stack was insufficient. See +"Controlling the JIT stack" +below for a discussion of JIT stack usage. +

+

+The error code PCRE2_ERROR_MATCHLIMIT is returned by the JIT code if searching +a very large pattern tree goes on for too long, as it is in the same +circumstance when JIT is not used, but the details of exactly what is counted +are not the same. The PCRE2_ERROR_DEPTHLIMIT error code is never returned +when JIT matching is used. +

+
CONTROLLING THE JIT STACK
+

+When the compiled JIT code runs, it needs a block of memory to use as a stack. +By default, it uses 32KiB on the machine stack. However, some large or +complicated patterns need more than this. The error PCRE2_ERROR_JIT_STACKLIMIT +is given when there is not enough stack. Three functions are provided for +managing blocks of memory for use as JIT stacks. There is further discussion +about the use of JIT stacks in the section entitled +"JIT stack FAQ" +below. +

+

+The pcre2_jit_stack_create() function creates a JIT stack. Its arguments +are a starting size, a maximum size, and a general context (for memory +allocation functions, or NULL for standard memory allocation). It returns a +pointer to an opaque structure of type pcre2_jit_stack, or NULL if there +is an error. The pcre2_jit_stack_free() function is used to free a stack +that is no longer needed. If its argument is NULL, this function returns +immediately, without doing anything. (For the technically minded: the address +space is allocated by mmap or VirtualAlloc.) A maximum stack size of 512KiB to +1MiB should be more than enough for any pattern. +

+

+The pcre2_jit_stack_assign() function specifies which stack JIT code +should use. Its arguments are as follows: +

+  pcre2_match_context  *mcontext
+  pcre2_jit_callback    callback
+  void                 *data
+
+The first argument is a pointer to a match context. When this is subsequently +passed to a matching function, its information determines which JIT stack is +used. If this argument is NULL, the function returns immediately, without doing +anything. There are three cases for the values of the other two options: +
+  (1) If callback is NULL and data is NULL, an internal 32KiB block
+      on the machine stack is used. This is the default when a match
+      context is created.
+
+  (2) If callback is NULL and data is not NULL, data must be
+      a pointer to a valid JIT stack, the result of calling
+      pcre2_jit_stack_create().
+
+  (3) If callback is not NULL, it must point to a function that is
+      called with data as an argument at the start of matching, in
+      order to set up a JIT stack. If the return from the callback
+      function is NULL, the internal 32KiB stack is used; otherwise the
+      return value must be a valid JIT stack, the result of calling
+      pcre2_jit_stack_create().
+
+A callback function is obeyed whenever JIT code is about to be run; it is not +obeyed when pcre2_match() is called with options that are incompatible +for JIT matching. A callback function can therefore be used to determine +whether a match operation was executed by JIT or by the interpreter. +

+

+You may safely use the same JIT stack for more than one pattern (either by +assigning directly or by callback), as long as the patterns are matched +sequentially in the same thread. Currently, the only way to set up +non-sequential matches in one thread is to use callouts: if a callout function +starts another match, that match must use a different JIT stack to the one used +for currently suspended match(es). +

+

+In a multithread application, if you do not specify a JIT stack, or if you +assign or pass back NULL from a callback, that is thread-safe, because each +thread has its own machine stack. However, if you assign or pass back a +non-NULL JIT stack, this must be a different stack for each thread so that the +application is thread-safe. +

+

+Strictly speaking, even more is allowed. You can assign the same non-NULL stack +to a match context that is used by any number of patterns, as long as they are +not used for matching by multiple threads at the same time. For example, you +could use the same stack in all compiled patterns, with a global mutex in the +callback to wait until the stack is available for use. However, this is an +inefficient solution, and not recommended. +

+

+This is a suggestion for how a multithreaded program that needs to set up +non-default JIT stacks might operate: +

+  During thread initialization
+    thread_local_var = pcre2_jit_stack_create(...)
+
+  During thread exit
+    pcre2_jit_stack_free(thread_local_var)
+
+  Use a one-line callback function
+    return thread_local_var
+
+All the functions described in this section do nothing if JIT is not available. +

+
JIT STACK FAQ
+

+(1) Why do we need JIT stacks? +
+
+PCRE2 (and JIT) is a recursive, depth-first engine, so it needs a stack where +the local data of the current node is pushed before checking its child nodes. +Allocating real machine stack on some platforms is difficult. For example, the +stack chain needs to be updated every time if we extend the stack on PowerPC. +Although it is possible, its updating time overhead decreases performance. So +we do the recursion in memory. +

+

+(2) Why don't we simply allocate blocks of memory with malloc()? +
+
+Modern operating systems have a nice feature: they can reserve an address space +instead of allocating memory. We can safely allocate memory pages inside this +address space, so the stack could grow without moving memory data (this is +important because of pointers). Thus we can allocate 1MiB address space, and +use only a single memory page (usually 4KiB) if that is enough. However, we can +still grow up to 1MiB anytime if needed. +

+

+(3) Who "owns" a JIT stack? +
+
+The owner of the stack is the user program, not the JIT studied pattern or +anything else. The user program must ensure that if a stack is being used by +pcre2_match(), (that is, it is assigned to a match context that is passed +to the pattern currently running), that stack must not be used by any other +threads (to avoid overwriting the same memory area). The best practice for +multithreaded programs is to allocate a stack for each thread, and return this +stack through the JIT callback function. +

+

+(4) When should a JIT stack be freed? +
+
+You can free a JIT stack at any time, as long as it will not be used by +pcre2_match() again. When you assign the stack to a match context, only a +pointer is set. There is no reference counting or any other magic. You can free +compiled patterns, contexts, and stacks in any order, anytime. +Just do not call pcre2_match() with a match context pointing to an +already freed stack, as that will cause SEGFAULT. (Also, do not free a stack +currently used by pcre2_match() in another thread). You can also replace +the stack in a context at any time when it is not in use. You should free the +previous stack before assigning a replacement. +

+

+(5) Should I allocate/free a stack every time before/after calling +pcre2_match()? +
+
+No, because this is too costly in terms of resources. However, you could +implement some clever idea which release the stack if it is not used in let's +say two minutes. The JIT callback can help to achieve this without keeping a +list of patterns. +

+

+(6) OK, the stack is for long term memory allocation. But what happens if a +pattern causes stack overflow with a stack of 1MiB? Is that 1MiB kept until the +stack is freed? +
+
+Especially on embedded systems, it might be a good idea to release memory +sometimes without freeing the stack. There is no API for this at the moment. +Probably a function call which returns with the currently allocated memory for +any stack and another which allows releasing memory (shrinking the stack) would +be a good idea if someone needs this. +

+

+(7) This is too much of a headache. Isn't there any better solution for JIT +stack handling? +
+
+No, thanks to Windows. If POSIX threads were used everywhere, we could throw +out this complicated API. +

+
FREEING JIT SPECULATIVE MEMORY
+

+void pcre2_jit_free_unused_memory(pcre2_general_context *gcontext); +

+

+The JIT executable allocator does not free all memory when it is possible. It +expects new allocations, and keeps some free memory around to improve +allocation speed. However, in low memory conditions, it might be better to free +all possible memory. You can cause this to happen by calling +pcre2_jit_free_unused_memory(). Its argument is a general context, for custom +memory management, or NULL for standard memory management. +

+
EXAMPLE CODE
+

+This is a single-threaded example that specifies a JIT stack without using a +callback. A real program should include error checking after all the function +calls. +

+  int rc;
+  pcre2_code *re;
+  pcre2_match_data *match_data;
+  pcre2_match_context *mcontext;
+  pcre2_jit_stack *jit_stack;
+
+  re = pcre2_compile(pattern, PCRE2_ZERO_TERMINATED, 0,
+    &errornumber, &erroffset, NULL);
+  rc = pcre2_jit_compile(re, PCRE2_JIT_COMPLETE);
+  mcontext = pcre2_match_context_create(NULL);
+  jit_stack = pcre2_jit_stack_create(32*1024, 512*1024, NULL);
+  pcre2_jit_stack_assign(mcontext, NULL, jit_stack);
+  match_data = pcre2_match_data_create(re, 10);
+  rc = pcre2_match(re, subject, length, 0, 0, match_data, mcontext);
+  /* Process result */
+
+  pcre2_code_free(re);
+  pcre2_match_data_free(match_data);
+  pcre2_match_context_free(mcontext);
+  pcre2_jit_stack_free(jit_stack);
+
+
+

+
JIT FAST PATH API
+

+Because the API described above falls back to interpreted matching when JIT is +not available, it is convenient for programs that are written for general use +in many environments. However, calling JIT via pcre2_match() does have a +performance impact. Programs that are written for use where JIT is known to be +available, and which need the best possible performance, can instead use a +"fast path" API to call JIT matching directly instead of calling +pcre2_match() (obviously only for patterns that have been successfully +processed by pcre2_jit_compile()). +

+

+The fast path function is called pcre2_jit_match(), and it takes exactly +the same arguments as pcre2_match(). However, the subject string must be +specified with a length; PCRE2_ZERO_TERMINATED is not supported. Unsupported +option bits (for example, PCRE2_ANCHORED and PCRE2_ENDANCHORED) are ignored, as +is the PCRE2_NO_JIT option. The return values are also the same as for +pcre2_match(), plus PCRE2_ERROR_JIT_BADOPTION if a matching mode (partial +or complete) is requested that was not compiled. +

+

+When you call pcre2_match(), as well as testing for invalid options, a +number of other sanity checks are performed on the arguments. For example, if +the subject pointer is NULL but the length is non-zero, an immediate error is +given. Also, unless PCRE2_NO_UTF_CHECK is set, a UTF subject string is tested +for validity. In the interests of speed, these checks do not happen on the JIT +fast path. If invalid UTF data is passed when PCRE2_MATCH_INVALID_UTF was not +set for pcre2_compile(), the result is undefined. The program may crash +or loop or give wrong results. In the absence of PCRE2_MATCH_INVALID_UTF you +should call pcre2_jit_match() in UTF mode only if you are sure the +subject is valid. +

+

+Bypassing the sanity checks and the pcre2_match() wrapping can give +speedups of more than 10%. +

+
SEE ALSO
+

+pcre2api(3), pcre2unicode(3) +

+
AUTHOR
+

+Philip Hazel (FAQ by Zoltan Herczeg) +
+Retired from University Computing Service +
+Cambridge, England. +
+

+
REVISION
+

+Last updated: 22 August 2024 +
+Copyright © 1997-2024 University of Cambridge. +
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2limits.html b/miniconda3/share/doc/pcre2/html/pcre2limits.html new file mode 100644 index 0000000000000000000000000000000000000000..514c50b2396876852c5f054d66e0c091540aeb36 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2limits.html @@ -0,0 +1,105 @@ + + +pcre2limits specification + + +

pcre2limits man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+SIZE AND OTHER LIMITATIONS +
+

+There are some size limitations in PCRE2 but it is hoped that they will never +in practice be relevant. +

+

+The maximum size of a compiled pattern is approximately 64 thousand code units +for the 8-bit and 16-bit libraries if PCRE2 is compiled with the default +internal linkage size, which is 2 bytes for these libraries. If you want to +process regular expressions that are truly enormous, you can compile PCRE2 with +an internal linkage size of 3 or 4 (when building the 16-bit library, 3 is +rounded up to 4). See the README file in the source distribution and the +pcre2build +documentation for details. In these cases the limit is substantially larger. +However, the speed of execution is slower. In the 32-bit library, the internal +linkage size is always 4. +

+

+The maximum length of a source pattern string is essentially unlimited; it is +the largest number a PCRE2_SIZE variable can hold. However, the program that +calls pcre2_compile() can specify a smaller limit. +

+

+The maximum length (in code units) of a subject string is one less than the +largest number a PCRE2_SIZE variable can hold. PCRE2_SIZE is an unsigned +integer type, usually defined as size_t. Its maximum value (that is +~(PCRE2_SIZE)0) is reserved as a special indicator for zero-terminated strings +and unset offsets. +

+

+All values in repeating quantifiers must be less than 65536. +

+

+There are two different limits that apply to branches of lookbehind assertions. +If every branch in such an assertion matches a fixed number of characters, +the maximum length of any branch is 65535 characters. If any branch matches a +variable number of characters, then the maximum matching length for every +branch is limited. The default limit is set at compile time, defaulting to 255, +but can be changed by the calling program. +

+

+There is no limit to the number of parenthesized groups, but there can be no +more than 65535 capture groups, and there is a limit to the depth of nesting of +parenthesized subpatterns of all kinds. This is imposed in order to limit the +amount of system stack used at compile time. The default limit can be specified +when PCRE2 is built; if not, the default is set to 250. An application can +change this limit by calling pcre2_set_parens_nest_limit() to set the limit in +a compile context. +

+

+The maximum length of name for a named capture group is 32 code units, and the +maximum number of such groups is 10000. +

+

+The maximum length of a name in a (*MARK), (*PRUNE), (*SKIP), or (*THEN) verb +is 255 code units for the 8-bit library and 65535 code units for the 16-bit and +32-bit libraries. +

+

+The maximum length of a string argument to a callout is the largest number a +32-bit unsigned integer can hold. +

+

+The maximum amount of heap memory used for matching is controlled by the heap +limit, which can be set in a pattern or in a match context. The default is a +very large number, effectively unlimited. +

+
+AUTHOR +
+

+Philip Hazel +
+Retired from University Computing Service +
+Cambridge, England. +
+

+
+REVISION +
+

+Last updated: 16 August 2023 +
+Copyright © 1997-2023 University of Cambridge. +
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2matching.html b/miniconda3/share/doc/pcre2/html/pcre2matching.html new file mode 100644 index 0000000000000000000000000000000000000000..4d0232507b65f1defd9449423f5cac71fccf68dc --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2matching.html @@ -0,0 +1,262 @@ + + +pcre2matching specification + + +

pcre2matching man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+

+
PCRE2 MATCHING ALGORITHMS
+

+This document describes the two different algorithms that are available in +PCRE2 for matching a compiled regular expression against a given subject +string. The "standard" algorithm is the one provided by the pcre2_match() +function. This works in the same as Perl's matching function, and provides a +Perl-compatible matching operation. The just-in-time (JIT) optimization that is +described in the +pcre2jit +documentation is compatible with this function. +

+

+An alternative algorithm is provided by the pcre2_dfa_match() function; +it operates in a different way, and is not Perl-compatible. This alternative +has advantages and disadvantages compared with the standard algorithm, and +these are described below. +

+

+When there is only one possible way in which a given subject string can match a +pattern, the two algorithms give the same answer. A difference arises, however, +when there are multiple possibilities. For example, if the anchored pattern +

+  ^<.*>
+
+is matched against the string +
+  <something> <something else> <something further>
+
+there are three possible answers. The standard algorithm finds only one of +them, whereas the alternative algorithm finds all three. +

+
REGULAR EXPRESSIONS AS TREES
+

+The set of strings that are matched by a regular expression can be represented +as a tree structure. An unlimited repetition in the pattern makes the tree of +infinite size, but it is still a tree. Matching the pattern to a given subject +string (from a given starting point) can be thought of as a search of the tree. +There are two ways to search a tree: depth-first and breadth-first, and these +correspond to the two matching algorithms provided by PCRE2. +

+
THE STANDARD MATCHING ALGORITHM
+

+In the terminology of Jeffrey Friedl's book "Mastering Regular Expressions", +the standard algorithm is an "NFA algorithm". It conducts a depth-first search +of the pattern tree. That is, it proceeds along a single path through the tree, +checking that the subject matches what is required. When there is a mismatch, +the algorithm tries any alternatives at the current point, and if they all +fail, it backs up to the previous branch point in the tree, and tries the next +alternative branch at that level. This often involves backing up (moving to the +left) in the subject string as well. The order in which repetition branches are +tried is controlled by the greedy or ungreedy nature of the quantifier. +

+

+If a leaf node is reached, a matching string has been found, and at that point +the algorithm stops. Thus, if there is more than one possible match, this +algorithm returns the first one that it finds. Whether this is the shortest, +the longest, or some intermediate length depends on the way the alternations +and the greedy or ungreedy repetition quantifiers are specified in the +pattern. +

+

+Because it ends up with a single path through the tree, it is relatively +straightforward for this algorithm to keep track of the substrings that are +matched by portions of the pattern in parentheses. This provides support for +capturing parentheses and backreferences. +

+
THE ALTERNATIVE MATCHING ALGORITHM
+

+This algorithm conducts a breadth-first search of the tree. Starting from the +first matching point in the subject, it scans the subject string from left to +right, once, character by character, and as it does this, it remembers all the +paths through the tree that represent valid matches. In Friedl's terminology, +this is a kind of "DFA algorithm", though it is not implemented as a +traditional finite state machine (it keeps multiple states active +simultaneously). +

+

+Although the general principle of this matching algorithm is that it scans the +subject string only once, without backtracking, there is one exception: when a +lookaround assertion is encountered, the characters following or preceding the +current point have to be independently inspected. +

+

+The scan continues until either the end of the subject is reached, or there are +no more unterminated paths. At this point, terminated paths represent the +different matching possibilities (if there are none, the match has failed). +Thus, if there is more than one possible match, this algorithm finds all of +them, and in particular, it finds the longest. The matches are returned in +the output vector in decreasing order of length. There is an option to stop the +algorithm after the first match (which is necessarily the shortest) is found. +

+

+Note that the size of vector needed to contain all the results depends on the +number of simultaneous matches, not on the number of capturing parentheses in +the pattern. Using pcre2_match_data_create_from_pattern() to create the +match data block is therefore not advisable when doing DFA matching. +

+

+Note also that all the matches that are found start at the same point in the +subject. If the pattern +

+  cat(er(pillar)?)?
+
+is matched against the string "the caterpillar catchment", the result is the +three strings "caterpillar", "cater", and "cat" that start at the fifth +character of the subject. The algorithm does not automatically move on to find +matches that start at later positions. +

+

+PCRE2's "auto-possessification" optimization usually applies to character +repeats at the end of a pattern (as well as internally). For example, the +pattern "a\d+" is compiled as if it were "a\d++" because there is no point +even considering the possibility of backtracking into the repeated digits. For +DFA matching, this means that only one possible match is found. If you really +do want multiple matches in such cases, either use an ungreedy repeat +("a\d+?") or set the PCRE2_NO_AUTO_POSSESS option when compiling. +

+

+There are a number of features of PCRE2 regular expressions that are not +supported or behave differently in the alternative matching function. Those +that are not supported cause an error if encountered. +

+

+1. Because the algorithm finds all possible matches, the greedy or ungreedy +nature of repetition quantifiers is not relevant (though it may affect +auto-possessification, as just described). During matching, greedy and ungreedy +quantifiers are treated in exactly the same way. However, possessive +quantifiers can make a difference when what follows could also match what is +quantified, for example in a pattern like this: +

+  ^a++\w!
+
+This pattern matches "aaab!" but not "aaa!", which would be matched by a +non-possessive quantifier. Similarly, if an atomic group is present, it is +matched as if it were a standalone pattern at the current point, and the +longest match is then "locked in" for the rest of the overall pattern. +

+

+2. When dealing with multiple paths through the tree simultaneously, it is not +straightforward to keep track of captured substrings for the different matching +possibilities, and PCRE2's implementation of this algorithm does not attempt to +do this. This means that no captured substrings are available. +

+

+3. Because no substrings are captured, a number of related features are not +available: +
+
+(a) Backreferences; +
+
+(b) Conditional expressions that use a backreference as the condition or test +for a specific group recursion; +
+
+(c) Script runs; +
+
+(d) Scan substring assertions. +

+

+4. Because many paths through the tree may be active, the \K escape sequence, +which resets the start of the match when encountered (but may be on some paths +and not on others), is not supported. +

+

+5. Callouts are supported, but the value of the capture_top field is +always 1, and the value of the capture_last field is always 0. +

+

+6. The \C escape sequence, which (in the standard algorithm) always matches a +single code unit, even in a UTF mode, is not supported in UTF modes because +the alternative algorithm moves through the subject string one character (not +code unit) at a time, for all active paths through the tree. +

+

+7. Except for (*FAIL), the backtracking control verbs such as (*PRUNE) are not +supported. (*FAIL) is supported, and behaves like a failing negative assertion. +

+

+8. The PCRE2_MATCH_INVALID_UTF option for pcre2_compile() is not +supported by pcre2_dfa_match(). +

+
ADVANTAGES OF THE ALTERNATIVE ALGORITHM
+

+The main advantage of the alternative algorithm is that all possible matches +(at a single point in the subject) are automatically found, and in particular, +the longest match is found. To find more than one match at the same point using +the standard algorithm, you have to do kludgy things with callouts. +

+

+Partial matching is possible with this algorithm, though it has some +limitations. The +pcre2partial +documentation gives details of partial matching and discusses multi-segment +matching. +

+
DISADVANTAGES OF THE ALTERNATIVE ALGORITHM
+

+The alternative algorithm suffers from a number of disadvantages: +

+

+1. It is substantially slower than the standard algorithm. This is partly +because it has to search for all possible matches, but is also because it is +less susceptible to optimization. +

+

+2. Capturing parentheses and other features such as backreferences that rely on +them are not supported. +

+

+3. Matching within invalid UTF strings is not supported. +

+

+4. Although atomic groups are supported, their use does not provide the +performance advantage that it does for the standard algorithm. +

+

+5. JIT optimization is not supported. +

+
AUTHOR
+

+Philip Hazel +
+Retired from University Computing Service +
+Cambridge, England. +
+

+
REVISION
+

+Last updated: 30 August 2024 +
+Copyright © 1997-2024 University of Cambridge. +
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2partial.html b/miniconda3/share/doc/pcre2/html/pcre2partial.html new file mode 100644 index 0000000000000000000000000000000000000000..067064d90a10c2f5c2972d98dc78fc44d0786680 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2partial.html @@ -0,0 +1,408 @@ + + +pcre2partial specification + + +

pcre2partial man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+

+
PARTIAL MATCHING IN PCRE2
+

+In normal use of PCRE2, if there is a match up to the end of a subject string, +but more characters are needed to match the entire pattern, PCRE2_ERROR_NOMATCH +is returned, just like any other failing match. There are circumstances where +it might be helpful to distinguish this "partial match" case. +

+

+One example is an application where the subject string is very long, and not +all available at once. The requirement here is to be able to do the matching +segment by segment, but special action is needed when a matched substring spans +the boundary between two segments. +

+

+Another example is checking a user input string as it is typed, to ensure that +it conforms to a required format. Invalid characters can be immediately +diagnosed and rejected, giving instant feedback. +

+

+Partial matching is a PCRE2-specific feature; it is not Perl-compatible. It is +requested by setting one of the PCRE2_PARTIAL_HARD or PCRE2_PARTIAL_SOFT +options when calling a matching function. The difference between the two +options is whether or not a partial match is preferred to an alternative +complete match, though the details differ between the two types of matching +function. If both options are set, PCRE2_PARTIAL_HARD takes precedence. +

+

+If you want to use partial matching with just-in-time optimized code, as well +as setting a partial match option for the matching function, you must also call +pcre2_jit_compile() with one or both of these options: +

+  PCRE2_JIT_PARTIAL_HARD
+  PCRE2_JIT_PARTIAL_SOFT
+
+PCRE2_JIT_COMPLETE should also be set if you are going to run non-partial +matches on the same pattern. Separate code is compiled for each mode. If the +appropriate JIT mode has not been compiled, interpretive matching code is used. +

+

+Setting a partial matching option disables two of PCRE2's standard +optimization hints. PCRE2 remembers the last literal code unit in a pattern, +and abandons matching immediately if it is not present in the subject string. +This optimization cannot be used for a subject string that might match only +partially. PCRE2 also remembers a minimum length of a matching string, and does +not bother to run the matching function on shorter strings. This optimization +is also disabled for partial matching. +

+
REQUIREMENTS FOR A PARTIAL MATCH
+

+A possible partial match occurs during matching when the end of the subject +string is reached successfully, but either more characters are needed to +complete the match, or the addition of more characters might change what is +matched. +

+

+Example 1: if the pattern is /abc/ and the subject is "ab", more characters are +definitely needed to complete a match. In this case both hard and soft matching +options yield a partial match. +

+

+Example 2: if the pattern is /ab+/ and the subject is "ab", a complete match +can be found, but the addition of more characters might change what is +matched. In this case, only PCRE2_PARTIAL_HARD returns a partial match; +PCRE2_PARTIAL_SOFT returns the complete match. +

+

+On reaching the end of the subject, when PCRE2_PARTIAL_HARD is set, if the next +pattern item is \z, \Z, \b, \B, or $ there is always a partial match. +Otherwise, for both options, the next pattern item must be one that inspects a +character, and at least one of the following must be true: +

+

+(1) At least one character has already been inspected. An inspected character +need not form part of the final matched string; lookbehind assertions and the +\K escape sequence provide ways of inspecting characters before the start of a +matched string. +

+

+(2) The pattern contains one or more lookbehind assertions. This condition +exists in case there is a lookbehind that inspects characters before the start +of the match. +

+

+(3) There is a special case when the whole pattern can match an empty string. +When the starting point is at the end of the subject, the empty string match is +a possibility, and if PCRE2_PARTIAL_SOFT is set and neither of the above +conditions is true, it is returned. However, because adding more characters +might result in a non-empty match, PCRE2_PARTIAL_HARD returns a partial match, +which in this case means "there is going to be a match at this point, but until +some more characters are added, we do not know if it will be an empty string or +something longer". +

+
PARTIAL MATCHING USING pcre2_match()
+

+When a partial matching option is set, the result of calling +pcre2_match() can be one of the following: +

+

+A successful match +A complete match has been found, starting and ending within this subject. +

+

+PCRE2_ERROR_NOMATCH +No match can start anywhere in this subject. +

+

+PCRE2_ERROR_PARTIAL +Adding more characters may result in a complete match that uses one or more +characters from the end of this subject. +

+

+When a partial match is returned, the first two elements in the ovector point +to the portion of the subject that was matched, but the values in the rest of +the ovector are undefined. The appearance of \K in the pattern has no effect +for a partial match. Consider this pattern: +

+  /abc\K123/
+
+If it is matched against "456abc123xyz" the result is a complete match, and the +ovector defines the matched string as "123", because \K resets the "start of +match" point. However, if a partial match is requested and the subject string +is "456abc12", a partial match is found for the string "abc12", because all +these characters are needed for a subsequent re-match with additional +characters. +

+

+If there is more than one partial match, the first one that was found provides +the data that is returned. Consider this pattern: +

+  /123\w+X|dogY/
+
+If this is matched against the subject string "abc123dog", both alternatives +fail to match, but the end of the subject is reached during matching, so +PCRE2_ERROR_PARTIAL is returned. The offsets are set to 3 and 9, identifying +"123dog" as the first partial match. (In this example, there are two partial +matches, because "dog" on its own partially matches the second alternative.) +

+
+How a partial match is processed by pcre2_match() +
+

+What happens when a partial match is identified depends on which of the two +partial matching options is set. +

+

+If PCRE2_PARTIAL_HARD is set, PCRE2_ERROR_PARTIAL is returned as soon as a +partial match is found, without continuing to search for possible complete +matches. This option is "hard" because it prefers an earlier partial match over +a later complete match. For this reason, the assumption is made that the end of +the supplied subject string is not the true end of the available data, which is +why \z, \Z, \b, \B, and $ always give a partial match. +

+

+If PCRE2_PARTIAL_SOFT is set, the partial match is remembered, but matching +continues as normal, and other alternatives in the pattern are tried. If no +complete match can be found, PCRE2_ERROR_PARTIAL is returned instead of +PCRE2_ERROR_NOMATCH. This option is "soft" because it prefers a complete match +over a partial match. All the various matching items in a pattern behave as if +the subject string is potentially complete; \z, \Z, and $ match at the end of +the subject, as normal, and for \b and \B the end of the subject is treated +as a non-alphanumeric. +

+

+The difference between the two partial matching options can be illustrated by a +pattern such as: +

+  /dog(sbody)?/
+
+This matches either "dog" or "dogsbody", greedily (that is, it prefers the +longer string if possible). If it is matched against the string "dog" with +PCRE2_PARTIAL_SOFT, it yields a complete match for "dog". However, if +PCRE2_PARTIAL_HARD is set, the result is PCRE2_ERROR_PARTIAL. On the other +hand, if the pattern is made ungreedy the result is different: +
+  /dog(sbody)??/
+
+In this case the result is always a complete match because that is found first, +and matching never continues after finding a complete match. It might be easier +to follow this explanation by thinking of the two patterns like this: +
+  /dog(sbody)?/    is the same as  /dogsbody|dog/
+  /dog(sbody)??/   is the same as  /dog|dogsbody/
+
+The second pattern will never match "dogsbody", because it will always find the +shorter match first. +

+
+Example of partial matching using pcre2test +
+

+The pcre2test data modifiers partial_hard (or ph) and +partial_soft (or ps) set PCRE2_PARTIAL_HARD and PCRE2_PARTIAL_SOFT, +respectively, when calling pcre2_match(). Here is a run of +pcre2test using a pattern that matches the whole subject in the form of a +date: +

+    re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
+  data> 25dec3\=ph
+  Partial match: 23dec3
+  data> 3ju\=ph
+  Partial match: 3ju
+  data> 3juj\=ph
+  No match
+
+This example gives the same results for both hard and soft partial matching +options. Here is an example where there is a difference: +
+    re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
+  data> 25jun04\=ps
+   0: 25jun04
+   1: jun
+  data> 25jun04\=ph
+  Partial match: 25jun04
+
+With PCRE2_PARTIAL_SOFT, the subject is matched completely. For +PCRE2_PARTIAL_HARD, however, the subject is assumed not to be complete, so +there is only a partial match. +

+
MULTI-SEGMENT MATCHING WITH pcre2_match()
+

+PCRE was not originally designed with multi-segment matching in mind. However, +over time, features (including partial matching) that make multi-segment +matching possible have been added. A very long string can be searched segment +by segment by calling pcre2_match() repeatedly, with the aim of achieving +the same results that would happen if the entire string was available for +searching all the time. Normally, the strings that are being sought are much +shorter than each individual segment, and are in the middle of very long +strings, so the pattern is normally not anchored. +

+

+Special logic must be implemented to handle a matched substring that spans a +segment boundary. PCRE2_PARTIAL_HARD should be used, because it returns a +partial match at the end of a segment whenever there is the possibility of +changing the match by adding more characters. The PCRE2_NOTBOL option should +also be set for all but the first segment. +

+

+When a partial match occurs, the next segment must be added to the current +subject and the match re-run, using the startoffset argument of +pcre2_match() to begin at the point where the partial match started. +For example: +

+    re> /\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d/
+  data> ...the date is 23ja\=ph
+  Partial match: 23ja
+  data> ...the date is 23jan19 and on that day...\=offset=15
+   0: 23jan19
+   1: jan
+
+Note the use of the offset modifier to start the new match where the +partial match was found. In this example, the next segment was added to the one +in which the partial match was found. This is the most straightforward +approach, typically using a memory buffer that is twice the size of each +segment. After a partial match, the first half of the buffer is discarded, the +second half is moved to the start of the buffer, and a new segment is added +before repeating the match as in the example above. After a no match, the +entire buffer can be discarded. +

+

+If there are memory constraints, you may want to discard text that precedes a +partial match before adding the next segment. Unfortunately, this is not at +present straightforward. In cases such as the above, where the pattern does not +contain any lookbehinds, it is sufficient to retain only the partially matched +substring. However, if the pattern contains a lookbehind assertion, characters +that precede the start of the partial match may have been inspected during the +matching process. When pcre2test displays a partial match, it indicates +these characters with '<' if the allusedtext modifier is set: +

+    re> "(?<=123)abc"
+  data> xx123ab\=ph,allusedtext
+  Partial match: 123ab
+                 <<<
+
+However, the allusedtext modifier is not available for JIT matching, +because JIT matching does not record the first (or last) consulted characters. +For this reason, this information is not available via the API. It is therefore +not possible in general to obtain the exact number of characters that must be +retained in order to get the right match result. If you cannot retain the +entire segment, you must find some heuristic way of choosing. +

+

+If you know the approximate length of the matching substrings, you can use that +to decide how much text to retain. The only lookbehind information that is +currently available via the API is the length of the longest individual +lookbehind in a pattern, but this can be misleading if there are nested +lookbehinds. The value returned by calling pcre2_pattern_info() with the +PCRE2_INFO_MAXLOOKBEHIND option is the maximum number of characters (not code +units) that any individual lookbehind moves back when it is processed. A +pattern such as "(?<=(?<!b)a)" has a maximum lookbehind value of one, but +inspects two characters before its starting point. +

+

+In a non-UTF or a 32-bit case, moving back is just a subtraction, but in +UTF-8 or UTF-16 you have to count characters while moving back through the code +units. +

+
PARTIAL MATCHING USING pcre2_dfa_match()
+

+The DFA function moves along the subject string character by character, without +backtracking, searching for all possible matches simultaneously. If the end of +the subject is reached before the end of the pattern, there is the possibility +of a partial match. +

+

+When PCRE2_PARTIAL_SOFT is set, PCRE2_ERROR_PARTIAL is returned only if there +have been no complete matches. Otherwise, the complete matches are returned. +If PCRE2_PARTIAL_HARD is set, a partial match takes precedence over any +complete matches. The portion of the string that was matched when the longest +partial match was found is set as the first matching string. +

+

+Because the DFA function always searches for all possible matches, and there is +no difference between greedy and ungreedy repetition, its behaviour is +different from the pcre2_match(). Consider the string "dog" matched +against this ungreedy pattern: +

+  /dog(sbody)??/
+
+Whereas the standard function stops as soon as it finds the complete match for +"dog", the DFA function also finds the partial match for "dogsbody", and so +returns that when PCRE2_PARTIAL_HARD is set. +

+
MULTI-SEGMENT MATCHING WITH pcre2_dfa_match()
+

+When a partial match has been found using the DFA matching function, it is +possible to continue the match by providing additional subject data and calling +the function again with the same compiled regular expression, this time setting +the PCRE2_DFA_RESTART option. You must pass the same working space as before, +because this is where details of the previous partial match are stored. You can +set the PCRE2_PARTIAL_SOFT or PCRE2_PARTIAL_HARD options with PCRE2_DFA_RESTART +to continue partial matching over multiple segments. Here is an example using +pcre2test: +

+    re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
+  data> 23ja\=dfa,ps
+  Partial match: 23ja
+  data> n05\=dfa,dfa_restart
+   0: n05
+
+The first call has "23ja" as the subject, and requests partial matching; the +second call has "n05" as the subject for the continued (restarted) match. +Notice that when the match is complete, only the last part is shown; PCRE2 does +not retain the previously partially-matched string. It is up to the calling +program to do that if it needs to. This means that, for an unanchored pattern, +if a continued match fails, it is not possible to try again at a new starting +point. All this facility is capable of doing is continuing with the previous +match attempt. For example, consider this pattern: +
+  1234|3789
+
+If the first part of the subject is "ABC123", a partial match of the first +alternative is found at offset 3. There is no partial match for the second +alternative, because such a match does not start at the same point in the +subject string. Attempting to continue with the string "7890" does not yield a +match because only those alternatives that match at one point in the subject +are remembered. Depending on the application, this may or may not be what you +want. +

+

+If you do want to allow for starting again at the next character, one way of +doing it is to retain some or all of the segment and try a new complete match, +as described for pcre2_match() above. Another possibility is to work with +two buffers. If a partial match at offset n in the first buffer is +followed by "no match" when PCRE2_DFA_RESTART is used on the second buffer, you +can then try a new match starting at offset n+1 in the first buffer. +

+
AUTHOR
+

+Philip Hazel +
+Retired from University Computing Service +
+Cambridge, England. +
+

+
REVISION
+

+Last updated: 27 November 2024 +
+Copyright © 1997-2019 University of Cambridge. +
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2pattern.html b/miniconda3/share/doc/pcre2/html/pcre2pattern.html new file mode 100644 index 0000000000000000000000000000000000000000..84eb0aa17c5b62cfba806e002fc295d798f4e781 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2pattern.html @@ -0,0 +1,4140 @@ + + +pcre2pattern specification + + +

pcre2pattern man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+

+
PCRE2 REGULAR EXPRESSION DETAILS
+

+The syntax and semantics of the regular expressions that are supported by PCRE2 +are described in detail below. There is a quick-reference syntax summary in the +pcre2syntax +page. PCRE2 tries to match Perl syntax and semantics as closely as it can. +PCRE2 also supports some alternative regular expression syntax that does not +conflict with the Perl syntax in order to provide some compatibility with +regular expressions in Python, .NET, and Oniguruma. There are in addition some +options that enable alternative syntax and semantics that are not the same as +in Perl. +

+

+Perl's regular expressions are described in its own documentation, and regular +expressions in general are covered in a number of books, some of which have +copious examples. Jeffrey Friedl's "Mastering Regular Expressions", published +by O'Reilly, covers regular expressions in great detail. This description of +PCRE2's regular expressions is intended as reference material. +

+

+This document discusses the regular expression patterns that are supported by +PCRE2 when its main matching function, pcre2_match(), is used. PCRE2 also +has an alternative matching function, pcre2_dfa_match(), which matches +using a different algorithm that is not Perl-compatible. Some of the features +discussed below are not available when DFA matching is used. The advantages and +disadvantages of the alternative function, and how it differs from the normal +function, are discussed in the +pcre2matching +page. +

+
EBCDIC CHARACTER CODES
+

+Most computers use ASCII or Unicode for encoding characters, and PCRE2 assumes +this by default. However, it can be compiled to run in an environment that uses +the EBCDIC code, which is the case for some IBM mainframe operating systems. In +the sections below, character code values are ASCII or Unicode; in an EBCDIC +environment these characters may have different code values, and there are no +code points greater than 255. Differences in behaviour when PCRE2 is running in +an EBCDIC environment are described in the section +"EBCDIC environments" +below, which you can ignore unless you really are in an EBCDIC environment. +

+
SPECIAL START-OF-PATTERN ITEMS
+

+A number of options that can be passed to pcre2_compile() can also be set +by special items at the start of a pattern. These are not Perl-compatible, but +are provided to make these options accessible to pattern writers who are not +able to change the program that processes the pattern. Any number of these +items may appear, but they must all be together right at the start of the +pattern string, and the letters must be in upper case. +

+
+UTF support +
+

+In the 8-bit and 16-bit PCRE2 libraries, characters may be coded either as +single code units, or as multiple UTF-8 or UTF-16 code units. UTF-32 can be +specified for the 32-bit library, in which case it constrains the character +values to valid Unicode code points. To process UTF strings, PCRE2 must be +built to include Unicode support (which is the default). When using UTF strings +you must either call the compiling function with one or both of the PCRE2_UTF +or PCRE2_MATCH_INVALID_UTF options, or the pattern must start with the special +sequence (*UTF), which is equivalent to setting the relevant PCRE2_UTF. How +setting a UTF mode affects pattern matching is mentioned in several places +below. There is also a summary of features in the +pcre2unicode +page. +

+

+Some applications that allow their users to supply patterns may wish to +restrict them to non-UTF data for security reasons. If the PCRE2_NEVER_UTF +option is passed to pcre2_compile(), (*UTF) is not allowed, and its +appearance in a pattern causes an error. +

+
+Unicode property support +
+

+Another special sequence that may appear at the start of a pattern is (*UCP). +This has the same effect as setting the PCRE2_UCP option: it causes sequences +such as \d and \w to use Unicode properties to determine character types, +instead of recognizing only characters with codes less than 256 via a lookup +table. If also causes upper/lower casing operations to use Unicode properties +for characters with code points greater than 127, even when UTF is not set. +These behaviours can be changed within the pattern; see the section entitled +"Internal Option Setting" +below. +

+

+Some applications that allow their users to supply patterns may wish to +restrict them for security reasons. If the PCRE2_NEVER_UCP option is passed to +pcre2_compile(), (*UCP) is not allowed, and its appearance in a pattern +causes an error. +

+
+Locking out empty string matching +
+

+Starting a pattern with (*NOTEMPTY) or (*NOTEMPTY_ATSTART) has the same effect +as passing the PCRE2_NOTEMPTY or PCRE2_NOTEMPTY_ATSTART option to whichever +matching function is subsequently called to match the pattern. These options +lock out the matching of empty strings, either entirely, or only at the start +of the subject. +

+
+Disabling auto-possessification +
+

+If a pattern starts with (*NO_AUTO_POSSESS), it has the same effect as setting +the PCRE2_NO_AUTO_POSSESS option, or calling pcre2_set_optimize() with +a PCRE2_AUTO_POSSESS_OFF directive. This stops PCRE2 from making quantifiers +possessive when what follows cannot match the repeated item. For example, by +default a+b is treated as a++b. For more details, see the +pcre2api +documentation. +

+
+Disabling start-up optimizations +
+

+If a pattern starts with (*NO_START_OPT), it has the same effect as setting the +PCRE2_NO_START_OPTIMIZE option, or calling pcre2_set_optimize() with +a PCRE2_START_OPTIMIZE_OFF directive. This disables several optimizations for +quickly reaching "no match" results. For more details, see the +pcre2api +documentation. +

+
+Disabling automatic anchoring +
+

+If a pattern starts with (*NO_DOTSTAR_ANCHOR), it has the same effect as +setting the PCRE2_NO_DOTSTAR_ANCHOR option, or calling pcre2_set_optimize() +with a PCRE2_DOTSTAR_ANCHOR_OFF directive. This disables optimizations that +apply to patterns whose top-level branches all start with .* (match any number +of arbitrary characters). For more details, see the +pcre2api +documentation. +

+
+Disabling JIT compilation +
+

+If a pattern that starts with (*NO_JIT) is successfully compiled, an attempt by +the application to apply the JIT optimization by calling +pcre2_jit_compile() is ignored. +

+
+Setting match resource limits +
+

+The pcre2_match() function contains a counter that is incremented every +time it goes round its main loop. The caller of pcre2_match() can set a +limit on this counter, which therefore limits the amount of computing resource +used for a match. The maximum depth of nested backtracking can also be limited; +this indirectly restricts the amount of heap memory that is used, but there is +also an explicit memory limit that can be set. +

+

+These facilities are provided to catch runaway matches that are provoked by +patterns with huge matching trees. A common example is a pattern with nested +unlimited repeats applied to a long string that does not match. When one of +these limits is reached, pcre2_match() gives an error return. The limits +can also be set by items at the start of the pattern of the form +

+  (*LIMIT_HEAP=d)
+  (*LIMIT_MATCH=d)
+  (*LIMIT_DEPTH=d)
+
+where d is any number of decimal digits. However, the value of the setting must +be less than the value set (or defaulted) by the caller of pcre2_match() +for it to have any effect. In other words, the pattern writer can lower the +limits set by the programmer, but not raise them. If there is more than one +setting of one of these limits, the lower value is used. The heap limit is +specified in kibibytes (units of 1024 bytes). +

+

+Prior to release 10.30, LIMIT_DEPTH was called LIMIT_RECURSION. This name is +still recognized for backwards compatibility. +

+

+The heap limit applies only when the pcre2_match() or +pcre2_dfa_match() interpreters are used for matching. It does not apply +to JIT. The match limit is used (but in a different way) when JIT is being +used, or when pcre2_dfa_match() is called, to limit computing resource +usage by those matching functions. The depth limit is ignored by JIT but is +relevant for DFA matching, which uses function recursion for recursions within +the pattern and for lookaround assertions and atomic groups. In this case, the +depth limit controls the depth of such recursion. +

+
+Newline conventions +
+

+PCRE2 supports six different conventions for indicating line breaks in +strings: a single CR (carriage return) character, a single LF (linefeed) +character, the two-character sequence CRLF, any of the three preceding, any +Unicode newline sequence, or the NUL character (binary zero). The +pcre2api +page has +further discussion +about newlines, and shows how to set the newline convention when calling +pcre2_compile(). +

+

+It is also possible to specify a newline convention by starting a pattern +string with one of the following sequences: +

+  (*CR)        carriage return
+  (*LF)        linefeed
+  (*CRLF)      carriage return, followed by linefeed
+  (*ANYCRLF)   any of the three above
+  (*ANY)       all Unicode newline sequences
+  (*NUL)       the NUL character (binary zero)
+
+These override the default and the options given to the compiling function. For +example, on a Unix system where LF is the default newline sequence, the pattern +
+  (*CR)a.b
+
+changes the convention to CR. That pattern matches "a\nb" because LF is no +longer a newline. If more than one of these settings is present, the last one +is used. +

+

+The newline convention affects where the circumflex and dollar assertions are +true. It also affects the interpretation of the dot metacharacter when +PCRE2_DOTALL is not set, and the behaviour of \N when not followed by an +opening brace. However, it does not affect what the \R escape sequence +matches. By default, this is any Unicode newline sequence, for Perl +compatibility. However, this can be changed; see the next section and the +description of \R in the section entitled +"Newline sequences" +below. A change of \R setting can be combined with a change of newline +convention. +

+
+Specifying what \R matches +
+

+It is possible to restrict \R to match only CR, LF, or CRLF (instead of the +complete set of Unicode line endings) by setting the option PCRE2_BSR_ANYCRLF +at compile time. This effect can also be achieved by starting a pattern with +(*BSR_ANYCRLF). For completeness, (*BSR_UNICODE) is also recognized, +corresponding to PCRE2_BSR_UNICODE. +

+
CHARACTERS AND METACHARACTERS
+

+A regular expression is a pattern that is matched against a subject string from +left to right. Most characters stand for themselves in a pattern, and match the +corresponding characters in the subject. As a trivial example, the pattern +

+  The quick brown fox
+
+matches a portion of a subject string that is identical to itself. When +caseless matching is specified (the PCRE2_CASELESS option or (?i) within the +pattern), letters are matched independently of case. Note that there are two +ASCII characters, K and S, that, in addition to their lower case ASCII +equivalents, are case-equivalent with Unicode U+212A (Kelvin sign) and U+017F +(long S) respectively when either PCRE2_UTF or PCRE2_UCP is set, unless the +PCRE2_EXTRA_CASELESS_RESTRICT option is in force (either passed to +pcre2_compile() or set by (*CASELESS_RESTRICT) or (?r) within the +pattern). If the PCRE2_EXTRA_TURKISH_CASING option is in force (either passed +to pcre2_compile() or set by (*TURKISH_CASING) within the pattern), then +the 'i' letters are matched according to Turkish and Azeri languages. +

+

+The power of regular expressions comes from the ability to include wild cards, +character classes, alternatives, and repetitions in the pattern. These are +encoded in the pattern by the use of metacharacters, which do not stand +for themselves but instead are interpreted in some special way. +

+

+There are two different sets of metacharacters: those that are recognized +anywhere in the pattern except within square brackets, and those that are +recognized within square brackets. Outside square brackets, the metacharacters +are as follows: +

+  \      general escape character with several uses
+  ^      assert start of string (or line, in multiline mode)
+  $      assert end of string (or line, in multiline mode)
+  .      match any character except newline (by default)
+  [      start character class definition
+  |      start of alternative branch
+  (      start group or control verb
+  )      end group or control verb
+  *      0 or more quantifier
+  +      1 or more quantifier; also "possessive quantifier"
+  ?      0 or 1 quantifier; also quantifier minimizer
+  {      potential start of min/max quantifier
+
+Brace characters { and } are also used to enclose data for constructions such +as \g{2} or \k{name}. In almost all uses of braces, space and/or horizontal +tab characters that follow { or precede } are allowed and are ignored. In the +case of quantifiers, they may also appear before or after the comma. The +exception to this is \u{...} which is an ECMAScript compatibility feature +that is recognized only when the PCRE2_EXTRA_ALT_BSUX option is set. ECMAScript +does not ignore such white space; it causes the item to be interpreted as +literal. +

+

+Part of a pattern that is in square brackets is called a "character class". In +a character class the only metacharacters are: +

+  \      general escape character
+  ^      negate the class, but only if the first character
+  -      indicates character range
+  [      POSIX character class (if followed by POSIX syntax)
+  ]      terminates the character class
+
+If a pattern is compiled with the PCRE2_EXTENDED option, most white space in +the pattern, other than in a character class, within a \Q...\E sequence, or +between a # outside a character class and the next newline, inclusive, is +ignored. An escaping backslash can be used to include a white space or a # +character as part of the pattern. If the PCRE2_EXTENDED_MORE option is set, the +same applies, but in addition unescaped space and horizontal tab characters are +ignored inside a character class. Note: only these two characters are ignored, +not the full set of pattern white space characters that are ignored outside a +character class. Option settings can be changed within a pattern; see the +section entitled +"Internal Option Setting" +below. +

+

+The following sections describe the use of each of the metacharacters. +

+
BACKSLASH
+

+The backslash character has several uses. Firstly, if it is followed by a +character that is not a digit or a letter, it takes away any special meaning +that character may have. This use of backslash as an escape character applies +both inside and outside character classes. +

+

+For example, if you want to match a * character, you must write \* in the +pattern. This escaping action applies whether or not the following character +would otherwise be interpreted as a metacharacter, so it is always safe to +precede a non-alphanumeric with backslash to specify that it stands for itself. +In particular, if you want to match a backslash, you write \\. +

+

+Only ASCII digits and letters have any special meaning after a backslash. All +other characters (in particular, those whose code points are greater than 127) +are treated as literals. +

+

+If you want to treat all characters in a sequence as literals, you can do so by +putting them between \Q and \E. Note that this includes white space even when +the PCRE2_EXTENDED option is set so that most other white space is ignored. The +behaviour is different from Perl in that $ and @ are handled as literals in +\Q...\E sequences in PCRE2, whereas in Perl, $ and @ cause variable +interpolation. Also, Perl does "double-quotish backslash interpolation" on any +backslashes between \Q and \E which, its documentation says, "may lead to +confusing results". PCRE2 treats a backslash between \Q and \E just like any +other character. Note the following examples: +

+  Pattern            PCRE2 matches   Perl matches
+
+  \Qabc$xyz\E        abc$xyz        abc followed by the contents of $xyz
+  \Qabc\$xyz\E       abc\$xyz       abc\$xyz
+  \Qabc\E\$\Qxyz\E   abc$xyz        abc$xyz
+  \QA\B\E            A\B            A\B
+  \Q\\E              \              \\E
+
+The \Q...\E sequence is recognized both inside and outside character classes. +An isolated \E that is not preceded by \Q is ignored. If \Q is not followed +by \E later in the pattern, the literal interpretation continues to the end of +the pattern (that is, \E is assumed at the end). If the isolated \Q is inside +a character class, this causes an error, because the character class is then +not terminated by a closing square bracket. +

+

+Another difference from Perl is that any appearance of \Q or \E inside what +might otherwise be a quantifier causes PCRE2 not to recognize the sequence as a +quantifier. Perl recognizes a quantifier if (redundantly) either of the numbers +is inside \Q...\E, but not if the separating comma is. When not recognized as +a quantifier a sequence such as {\Q1\E,2} is treated as the literal string +"{1,2}". +

+
+Non-printing characters +
+

+A second use of backslash provides a way of encoding non-printing characters +in patterns in a visible manner. There is no restriction on the appearance of +non-printing characters in a pattern, but when a pattern is being prepared by +text editing, it is often easier to use one of the following escape sequences +instead of the binary character it represents. In an ASCII or Unicode +environment, these escapes are as follows: +

+  \a          alarm, that is, the BEL character (hex 07)
+  \cx         "control-x", where x is a non-control ASCII character
+  \e          escape (hex 1B)
+  \f          form feed (hex 0C)
+  \n          linefeed (hex 0A)
+  \r          carriage return (hex 0D) (but see below)
+  \t          tab (hex 09)
+  \0dd        character with octal code 0dd
+  \ddd        character with octal code ddd, or back reference
+  \o{ddd..}   character with octal code ddd..
+  \xhh        character with hex code hh
+  \x{hhh..}   character with hex code hhh..
+  \N{U+hhh..} character with Unicode hex code point hhh..
+
+A description of how back references work is given +later, +following the discussion of +parenthesized groups. +

+

+By default, after \x that is not followed by {, one or two hexadecimal +digits are read (letters can be in upper or lower case). If the character that +follows \x is neither { nor a hexadecimal digit, an error occurs. This is +different from Perl's default behaviour, which generates a NUL character, but +is in line with the behaviour of Perl's 'strict' mode in re. +

+

+Any number of hexadecimal digits may appear between \x{ and }. If a character +other than a hexadecimal digit appears between \x{ and }, or if there is no +terminating }, an error occurs. +

+

+Characters whose code points are less than 256 can be defined by either of the +two syntaxes for \x or by an octal sequence. There is no difference in the way +they are handled. For example, \xdc is exactly the same as \x{dc} or \334. +However, using the braced versions does make such sequences easier to read. +

+

+Support is available for some ECMAScript (aka JavaScript) escape sequences via +two compile-time options. If PCRE2_ALT_BSUX is set, the sequence \x followed +by { is not recognized. Only if \x is followed by two hexadecimal digits is it +recognized as a character escape. Otherwise it is interpreted as a literal "x" +character. In this mode, support for code points greater than 256 is provided +by \u, which must be followed by four hexadecimal digits; otherwise it is +interpreted as a literal "u" character. +

+

+PCRE2_EXTRA_ALT_BSUX has the same effect as PCRE2_ALT_BSUX and, in addition, +\u{hhh..} is recognized as the character specified by hexadecimal code point. +There may be any number of hexadecimal digits, but unlike other places that +also use curly brackets, spaces are not allowed and would result in the string +being interpreted as a literal. This syntax is from ECMAScript 6. +

+

+The \N{U+hhh..} escape sequence is recognized only when PCRE2 is operating in +UTF mode. Perl also uses \N{name} to specify characters by Unicode name; PCRE2 +does not support this. Note that when \N is not followed by an opening brace +(curly bracket) it has an entirely different meaning, matching any character +that is not a newline. +

+

+There are some legacy applications where the escape sequence \r is expected to +match a newline. If the PCRE2_EXTRA_ESCAPED_CR_IS_LF option is set, \r in a +pattern is converted to \n so that it matches a LF (linefeed) instead of a CR +(carriage return) character. +

+

+An error occurs if \c is not followed by a character whose ASCII code point +is in the range 32 to 126. The precise effect of \cx is as follows: if x is a +lower case letter, it is converted to upper case. Then bit 6 of the character +(hex 40) is inverted. Thus \cA to \cZ become hex 01 to hex 1A (A is 41, Z is +5A), but \c{ becomes hex 3B ({ is 7B), and \c; becomes hex 7B (; is 3B). If +the code unit following \c has a code point less than 32 or greater than 126, +a compile-time error occurs. +

+

+For differences in the way some escapes behave in EBCDIC environments, +see section +"EBCDIC environments" +below. +

+
+Octal escapes and back references +
+

+The escape \o must be followed by a sequence of octal digits, enclosed in +braces. An error occurs if this is not the case. This escape provides a way of +specifying character code points as octal numbers greater than 0777, and it +also allows octal numbers and backreferences to be unambiguously distinguished. +

+

+If braces are not used, after \0 up to two further octal digits are read. +However, if the PCRE2_EXTRA_NO_BS0 option is set, at least one more octal digit +must follow \0 (use \00 to generate a NUL character). Make sure you supply +two digits after the initial zero if the pattern character that follows is +itself an octal digit. +

+

+Inside a character class, when a backslash is followed by any octal digit, up +to three octal digits are read to generate a code point. Any subsequent digits +stand for themselves. The sequences \8 and \9 are treated as the literal +characters "8" and "9". +

+

+Outside a character class, Perl's handling of a backslash followed by a digit +other than 0 is complicated by ambiguity, and Perl has changed over time, +causing PCRE2 also to change. From PCRE2 release 10.45 there is an option +called PCRE2_EXTRA_PYTHON_OCTAL that causes PCRE2 to use Python's unambiguous +rules. The next two subsections describe the two sets of rules. +

+

+For greater clarity and unambiguity, it is best to avoid following \ by a +digit greater than zero. Instead, use \o{...} or \x{...} to specify numerical +character code points, and \g{...} to specify backreferences. +

+
+Perl rules for non-class backslash 1-9 +
+

+All the digits that follow the backslash are read as a decimal number. If the +number is less than 10, begins with the digit 8 or 9, or if there are at least +that many previous capture groups in the expression, the entire sequence is +taken as a back reference. Otherwise, up to three octal digits are read to form +a character code. For example: +

+  \040   is another way of writing an ASCII space
+  \40    is the same, provided there are fewer than 40 previous capture groups
+  \7     is always a backreference
+  \11    might be a backreference, or another way of writing a tab
+  \011   is always a tab
+  \0113  is a tab followed by the character "3"
+  \113   might be a backreference, otherwise the character with octal code 113
+  \377   might be a backreference, otherwise the value 255 (decimal)
+  \81    is always a backreference
+
+Note that octal values of 100 or greater that are specified using this syntax +must not be introduced by a leading zero, because no more than three octal +digits are ever read. +

+
+Python rules for non_class backslash 1-9 +
+

+If there are at least three octal digits after the backslash, exactly three are +read as an octal code point number, but the value must be no greater than +\377, even in modes where higher code point values are supported. Any +subsequent digits stand for themselves. If there are fewer than three octal +digits, the sequence is taken as a decimal back reference. Thus, for example, +\12 is always a back reference, independent of how many captures there are in +the pattern. An error is generated for a reference to a non-existent capturing +group. +

+
+Constraints on character values +
+

+Characters that are specified using octal or hexadecimal numbers are +limited to certain values, as follows: +

+  8-bit non-UTF mode    no greater than 0xff
+  16-bit non-UTF mode   no greater than 0xffff
+  32-bit non-UTF mode   no greater than 0xffffffff
+  All UTF modes         no greater than 0x10ffff and a valid code point
+
+Invalid Unicode code points are all those in the range 0xd800 to 0xdfff (the +so-called "surrogate" code points). The check for these can be disabled by the +caller of pcre2_compile() by setting the option +PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES. However, this is possible only in UTF-8 +and UTF-32 modes, because these values are not representable in UTF-16. +

+
+Escape sequences in character classes +
+

+All the sequences that define a single character value can be used both inside +and outside character classes. In addition, inside a character class, \b is +interpreted as the backspace character (hex 08). +

+

+When not followed by an opening brace, \N is not allowed in a character class. +\B, \R, and \X are not special inside a character class. Like other +unrecognized alphabetic escape sequences, they cause an error. Outside a +character class, these sequences have different meanings. +

+
+Unsupported escape sequences +
+

+In Perl, the sequences \F, \l, \L, \u, and \U are recognized by its string +handler and used to modify the case of following characters. By default, PCRE2 +does not support these escape sequences in patterns. However, if either of the +PCRE2_ALT_BSUX or PCRE2_EXTRA_ALT_BSUX options is set, \U matches a "U" +character, and \u can be used to define a character by code point, as +described above. +

+
+Absolute and relative backreferences +
+

+The sequence \g followed by a signed or unsigned number, optionally enclosed +in braces, is an absolute or relative backreference. A named backreference +can be coded as \g{name}. Backreferences are discussed +later, +following the discussion of +parenthesized groups. +

+
+Absolute and relative subroutine calls +
+

+For compatibility with Oniguruma, the non-Perl syntax \g followed by a name or +a number enclosed either in angle brackets or single quotes, is an alternative +syntax for referencing a capture group as a subroutine. Details are discussed +later. +Note that \g{...} (Perl syntax) and \g<...> (Oniguruma syntax) are not +synonymous. The former is a backreference; the latter is a +subroutine +call. +

+
+Generic character types +
+

+Another use of backslash is for specifying generic character types: +

+  \d     any decimal digit
+  \D     any character that is not a decimal digit
+  \h     any horizontal white space character
+  \H     any character that is not a horizontal white space character
+  \N     any character that is not a newline
+  \s     any white space character
+  \S     any character that is not a white space character
+  \v     any vertical white space character
+  \V     any character that is not a vertical white space character
+  \w     any "word" character
+  \W     any "non-word" character
+
+The \N escape sequence has the same meaning as +the "." metacharacter +when PCRE2_DOTALL is not set, but setting PCRE2_DOTALL does not change the +meaning of \N. Note that when \N is followed by an opening brace it has a +different meaning. See the section entitled +"Non-printing characters" +above for details. Perl also uses \N{name} to specify characters by Unicode +name; PCRE2 does not support this. +

+

+Each pair of lower and upper case escape sequences partitions the complete set +of characters into two disjoint sets. Any given character matches one, and only +one, of each pair. The sequences can appear both inside and outside character +classes. They each match one character of the appropriate type. If the current +matching point is at the end of the subject string, all of them fail, because +there is no character to match. +

+

+The default \s characters are HT (9), LF (10), VT (11), FF (12), CR (13), and +space (32), which are defined as white space in the "C" locale. This list may +vary if locale-specific matching is taking place. For example, in some locales +the "non-breaking space" character (\xA0) is recognized as white space, and in +others the VT character is not. +

+

+A "word" character is an underscore or any character that is a letter or digit. +By default, the definition of letters and digits is controlled by PCRE2's +low-valued character tables, and may vary if locale-specific matching is taking +place (see +"Locale support" +in the +pcre2api +page). For example, in a French locale such as "fr_FR" in Unix-like systems, +or "french" in Windows, some character codes greater than 127 are used for +accented letters, and these are then matched by \w. The use of locales with +Unicode is discouraged. +

+

+By default, characters whose code points are greater than 127 never match \d, +\s, or \w, and always match \D, \S, and \W, although this may be different +for characters in the range 128-255 when locale-specific matching is happening. +These escape sequences retain their original meanings from before Unicode +support was available, mainly for efficiency reasons. If the PCRE2_UCP option +is set, the behaviour is changed so that Unicode properties are used to +determine character types, as follows: +

+  \d  any character that matches \p{Nd} (decimal digit)
+  \s  any character that matches \p{Z} or \h or \v
+  \w  any character that matches \p{L}, \p{N}, \p{Mn}, or \p{Pc}
+
+The addition of \p{Mn} (non-spacing mark) and the replacement of an explicit +test for underscore with a test for \p{Pc} (connector punctuation) happened in +PCRE2 release 10.43. This brings PCRE2 into line with Perl. +

+

+The upper case escapes match the inverse sets of characters. Note that \d +matches only decimal digits, whereas \w matches any Unicode digit, as well as +other character categories. Note also that PCRE2_UCP affects \b, and +\B because they are defined in terms of \w and \W. Matching these sequences +is noticeably slower when PCRE2_UCP is set. +

+

+The effect of PCRE2_UCP on any one of these escape sequences can be negated by +the options PCRE2_EXTRA_ASCII_BSD, PCRE2_EXTRA_ASCII_BSS, and +PCRE2_EXTRA_ASCII_BSW, respectively. These options can be set and reset within +a pattern by means of an internal option setting +(see below). +

+

+The sequences \h, \H, \v, and \V, in contrast to the other sequences, which +match only ASCII characters by default, always match a specific list of code +points, whether or not PCRE2_UCP is set. The horizontal space characters are: +

+  U+0009     Horizontal tab (HT)
+  U+0020     Space
+  U+00A0     Non-break space
+  U+1680     Ogham space mark
+  U+180E     Mongolian vowel separator
+  U+2000     En quad
+  U+2001     Em quad
+  U+2002     En space
+  U+2003     Em space
+  U+2004     Three-per-em space
+  U+2005     Four-per-em space
+  U+2006     Six-per-em space
+  U+2007     Figure space
+  U+2008     Punctuation space
+  U+2009     Thin space
+  U+200A     Hair space
+  U+202F     Narrow no-break space
+  U+205F     Medium mathematical space
+  U+3000     Ideographic space
+
+The vertical space characters are: +
+  U+000A     Linefeed (LF)
+  U+000B     Vertical tab (VT)
+  U+000C     Form feed (FF)
+  U+000D     Carriage return (CR)
+  U+0085     Next line (NEL)
+  U+2028     Line separator
+  U+2029     Paragraph separator
+
+In 8-bit, non-UTF-8 mode, only the characters with code points less than 256 +are relevant. +

+
+Newline sequences +
+

+Outside a character class, by default, the escape sequence \R matches any +Unicode newline sequence. In 8-bit non-UTF-8 mode \R is equivalent to the +following: +

+  (?>\r\n|\n|\x0b|\f|\r|\x85)
+
+This is an example of an "atomic group", details of which are given +below. +This particular group matches either the two-character sequence CR followed by +LF, or one of the single characters LF (linefeed, U+000A), VT (vertical tab, +U+000B), FF (form feed, U+000C), CR (carriage return, U+000D), or NEL (next +line, U+0085). Because this is an atomic group, the two-character sequence is +treated as a single unit that cannot be split. +

+

+In other modes, two additional characters whose code points are greater than 255 +are added: LS (line separator, U+2028) and PS (paragraph separator, U+2029). +Unicode support is not needed for these characters to be recognized. +

+

+It is possible to restrict \R to match only CR, LF, or CRLF (instead of the +complete set of Unicode line endings) by setting the option PCRE2_BSR_ANYCRLF +at compile time. (BSR is an abbreviation for "backslash R".) This can be made +the default when PCRE2 is built; if this is the case, the other behaviour can +be requested via the PCRE2_BSR_UNICODE option. It is also possible to specify +these settings by starting a pattern string with one of the following +sequences: +

+  (*BSR_ANYCRLF)   CR, LF, or CRLF only
+  (*BSR_UNICODE)   any Unicode newline sequence
+
+These override the default and the options given to the compiling function. +Note that these special settings, which are not Perl-compatible, are recognized +only at the very start of a pattern, and that they must be in upper case. If +more than one of them is present, the last one is used. They can be combined +with a change of newline convention; for example, a pattern can start with: +
+  (*ANY)(*BSR_ANYCRLF)
+
+They can also be combined with the (*UTF) or (*UCP) special sequences. Inside a +character class, \R is treated as an unrecognized escape sequence, and causes +an error. +

+
+Unicode character properties +
+

+When PCRE2 is built with Unicode support (the default), three additional escape +sequences that match characters with specific properties are available. They +can be used in any mode, though in 8-bit and 16-bit non-UTF modes these +sequences are of course limited to testing characters whose code points are +less than U+0100 or U+10000, respectively. In 32-bit non-UTF mode, code points +greater than 0x10ffff (the Unicode limit) may be encountered. These are all +treated as being in the Unknown script and with an unassigned type. +

+

+Matching characters by Unicode property is not fast, because PCRE2 has to do a +multistage table lookup in order to find a character's property. That is why +the traditional escape sequences such as \d and \w do not use Unicode +properties in PCRE2 by default, though you can make them do so by setting the +PCRE2_UCP option or by starting the pattern with (*UCP). +

+

+The extra escape sequences that provide property support are: +

+  \p{xx}   a character with the xx property
+  \P{xx}   a character without the xx property
+  \X       a Unicode extended grapheme cluster
+
+For compatibility with Perl, negation can be specified by including a +circumflex between the opening brace and the property. For example, \p{^Lu} is +the same as \P{Lu}. +

+

+In accordance with Unicode's "loose matching" rules, ASCII white space +characters, hyphens, and underscores are ignored in the properties represented +by xx above. As well as the space character, ASCII white space can be +tab, linefeed, vertical tab, formfeed, or carriage return. +

+

+Some properties are specified as a name only; others as a name and a value, +separated by a colon or an equals sign. The names and values consist of ASCII +letters and digits (with one Perl-specific exception, see below). They are not +case sensitive. Note, however, that the escapes themselves, \p and \P, +are case sensitive. There are abbreviations for many names. The following +examples are all equivalent: +

+  \p{bidiclass=al}
+  \p{BC=al}
+  \p{ Bidi_Class : AL }
+  \p{ Bi-di class = Al }
+  \P{ ^ Bi-di class = Al }
+
+There is support for Unicode script names, Unicode general category properties, +"Any", which matches any character (including newline), Bidi_Class, a number of +binary (yes/no) properties, and some special PCRE2 properties (described +below). +Certain other Perl properties such as "InMusicalSymbols" are not supported by +PCRE2. Note that \P{Any} does not match any characters, so always causes a +match failure. +

+
+Script properties for \p and \P +
+

+There are three different syntax forms for matching a script. Each Unicode +character has a basic script and, optionally, a list of other scripts ("Script +Extensions") with which it is commonly used. Using the Adlam script as an +example, \p{sc:Adlam} matches characters whose basic script is Adlam, whereas +\p{scx:Adlam} matches, in addition, characters that have Adlam in their +extensions list. The full names "script" and "script extensions" for the +property types are recognized and, as for all property specifications, an +equals sign is an alternative to the colon. If a script name is given without a +property type, for example, \p{Adlam}, it is treated as \p{scx:Adlam}. Perl +changed to this interpretation at release 5.26 and PCRE2 changed at release +10.40. +

+

+Unassigned characters (and in non-UTF 32-bit mode, characters with code points +greater than 0x10FFFF) are assigned the "Unknown" script. Others that are not +part of an identified script are lumped together as "Common". The current list +of recognized script names and their 4-character abbreviations can be obtained +by running this command: +

+  pcre2test -LS
+
+
+

+
+The general category property for \p and \P +
+

+Each character has exactly one Unicode general category property, specified by +a two-letter abbreviation. If only one letter is specified with \p or \P, it +includes all the general category properties that start with that letter. In +this case, in the absence of negation, the curly brackets in the escape +sequence are optional; these two examples have the same effect: +

+  \p{L}
+  \pL
+
+The following general category property codes are supported: +
+  C     Other
+  Cc    Control
+  Cf    Format
+  Cn    Unassigned
+  Co    Private use
+  Cs    Surrogate
+
+  L     Letter
+  Lc    Cased letter
+  Ll    Lower case letter
+  Lm    Modifier letter
+  Lo    Other letter
+  Lt    Title case letter
+  Lu    Upper case letter
+
+  M     Mark
+  Mc    Spacing mark
+  Me    Enclosing mark
+  Mn    Non-spacing mark
+
+  N     Number
+  Nd    Decimal number
+  Nl    Letter number
+  No    Other number
+
+  P     Punctuation
+  Pc    Connector punctuation
+  Pd    Dash punctuation
+  Pe    Close punctuation
+  Pf    Final punctuation
+  Pi    Initial punctuation
+  Po    Other punctuation
+  Ps    Open punctuation
+
+  S     Symbol
+  Sc    Currency symbol
+  Sk    Modifier symbol
+  Sm    Mathematical symbol
+  So    Other symbol
+
+  Z     Separator
+  Zl    Line separator
+  Zp    Paragraph separator
+  Zs    Space separator
+
+Perl originally used the name L& for the Lc property. This is still supported +by Perl, but discouraged. PCRE2 also still supports it. This property matches +any character that has the Lu, Ll, or Lt property, in other words, any letter +that is not classified as a modifier or "other". From release 10.45 of PCRE2 +the properties Lu, Ll, and Lt are all treated as Lc when case-independent +matching is set by the PCRE2_CASELESS option or (?i) within the pattern. The +other properties are not affected by caseless matching. +

+

+The Cs (Surrogate) property applies only to characters whose code points are in +the range U+D800 to U+DFFF. These characters are no different to any other +character when PCRE2 is not in UTF mode (using the 16-bit or 32-bit library). +However, they are not valid in Unicode strings and so cannot be tested by PCRE2 +in UTF mode, unless UTF validity checking has been turned off (see the +discussion of PCRE2_NO_UTF_CHECK in the +pcre2api +page). +

+

+The long synonyms for property names that Perl supports (such as \p{Letter}) +are not supported by PCRE2, nor is it permitted to prefix any of these +properties with "Is". +

+

+No character that is in the Unicode table has the Cn (unassigned) property. +Instead, this property is assumed for any code point that is not in the +Unicode table. +

+
+Binary (yes/no) properties for \p and \P +
+

+Unicode defines a number of binary properties, that is, properties whose only +values are true or false. You can obtain a list of those that are recognized by +\p and \P, along with their abbreviations, by running this command: +

+  pcre2test -LP
+
+
+

+
+The Bidi_Class property for \p and \P +
+

+

+  \p{Bidi_Class:<class>}   matches a character with the given class
+  \p{BC:<class>}           matches a character with the given class
+
+The recognized classes are: +
+  AL          Arabic letter
+  AN          Arabic number
+  B           paragraph separator
+  BN          boundary neutral
+  CS          common separator
+  EN          European number
+  ES          European separator
+  ET          European terminator
+  FSI         first strong isolate
+  L           left-to-right
+  LRE         left-to-right embedding
+  LRI         left-to-right isolate
+  LRO         left-to-right override
+  NSM         non-spacing mark
+  ON          other neutral
+  PDF         pop directional format
+  PDI         pop directional isolate
+  R           right-to-left
+  RLE         right-to-left embedding
+  RLI         right-to-left isolate
+  RLO         right-to-left override
+  S           segment separator
+  WS          white space
+
+As in all property specifications, an equals sign may be used instead of a +colon and the class names are case-insensitive. Only the short names listed +above are recognized; PCRE2 does not at present support any long alternatives. +

+
+Extended grapheme clusters +
+

+The \X escape matches any number of Unicode characters that form an "extended +grapheme cluster", and treats the sequence as an atomic group +(see below). +Unicode supports various kinds of composite character by giving each character +a grapheme breaking property, and having rules that use these properties to +define the boundaries of extended grapheme clusters. The rules are defined in +Unicode Standard Annex 29, "Unicode Text Segmentation". Unicode 11.0.0 +abandoned the use of some previous properties that had been used for emojis. +Instead it introduced various emoji-specific properties. PCRE2 uses only the +Extended Pictographic property. +

+

+\X always matches at least one character. Then it decides whether to add +additional characters according to the following rules for ending a cluster: +

+

+1. End at the end of the subject string. +

+

+2. Do not end between CR and LF; otherwise end after any control character. +

+

+3. Do not break Hangul (a Korean script) syllable sequences. Hangul characters +are of five types: L, V, T, LV, and LVT. An L character may be followed by an +L, V, LV, or LVT character; an LV or V character may be followed by a V or T +character; an LVT or T character may be followed only by a T character. +

+

+4. Do not end before extending characters or spacing marks or the zero-width +joiner (ZWJ) character. Characters with the "mark" property always have the +"extend" grapheme breaking property. +

+

+5. Do not end after prepend characters. +

+

+6. Do not end within emoji modifier sequences or emoji ZWJ (zero-width +joiner) sequences. An emoji ZWJ sequence consists of a character with the +Extended_Pictographic property, optionally followed by one or more characters +with the Extend property, followed by the ZWJ character, followed by another +Extended_Pictographic character. +

+

+7. Do not break within emoji flag sequences. That is, do not break between +regional indicator (RI) characters if there are an odd number of RI characters +before the break point. +

+

+8. Otherwise, end the cluster. +

+
+PCRE2's additional properties +
+

+As well as the standard Unicode properties described above, PCRE2 supports four +more that make it possible to convert traditional escape sequences such as \w +and \s to use Unicode properties. PCRE2 uses these non-standard, non-Perl +properties internally when PCRE2_UCP is set. However, they may also be used +explicitly. These properties are: +

+  Xan   Any alphanumeric character
+  Xps   Any POSIX space character
+  Xsp   Any Perl space character
+  Xwd   Any Perl "word" character
+
+Xan matches characters that have either the L (letter) or the N (number) +property. Xps matches the characters tab, linefeed, vertical tab, form feed, or +carriage return, and any other character that has the Z (separator) property +(this includes the space character). Xsp is the same as Xps; in PCRE1 it used +to exclude vertical tab, for Perl compatibility, but Perl changed. Xwd matches +the same characters as Xan, plus those that match Mn (non-spacing mark) or Pc +(connector punctuation, which includes underscore). +

+

+There is another non-standard property, Xuc, which matches any character that +can be represented by a Universal Character Name in C++ and other programming +languages. These are the characters $, @, ` (grave accent), and all characters +with Unicode code points greater than or equal to U+00A0, except for the +surrogates U+D800 to U+DFFF. Note that most base (ASCII) characters are +excluded. (Universal Character Names are of the form \uHHHH or \UHHHHHHHH +where H is a hexadecimal digit. Note that the Xuc property does not match these +sequences but the characters that they represent.) +

+
+Resetting the match start +
+

+In normal use, the escape sequence \K causes any previously matched characters +not to be included in the final matched sequence that is returned. For example, +the pattern: +

+  foo\Kbar
+
+matches "foobar", but reports that it has matched "bar". \K does not interact +with anchoring in any way. The pattern: +
+  ^foo\Kbar
+
+matches only when the subject begins with "foobar" (in single line mode), +though it again reports the matched string as "bar". This feature is similar to +a lookbehind assertion +(described below), +but the part of the pattern that precedes \K is not constrained to match a +limited number of characters, as is required for a lookbehind assertion. The +use of \K does not interfere with the setting of +captured substrings. +For example, when the pattern +
+  (foo)\Kbar
+
+matches "foobar", the first substring is still set to "foo". +

+

+From version 5.32.0 Perl forbids the use of \K in lookaround assertions. From +release 10.38 PCRE2 also forbids this by default. However, the +PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK option can be used when calling +pcre2_compile() to re-enable the previous behaviour. When this option is +set, \K is acted upon when it occurs inside positive assertions, but is +ignored in negative assertions. Note that when a pattern such as (?=ab\K) +matches, the reported start of the match can be greater than the end of the +match. Using \K in a lookbehind assertion at the start of a pattern can also +lead to odd effects. For example, consider this pattern: +

+  (?<=\Kfoo)bar
+
+If the subject is "foobar", a call to pcre2_match() with a starting +offset of 3 succeeds and reports the matching string as "foobar", that is, the +start of the reported match is earlier than where the match started. +

+
+Simple assertions +
+

+The final use of backslash is for certain simple assertions. An assertion +specifies a condition that has to be met at a particular point in a match, +without consuming any characters from the subject string. The use of +groups for more complicated assertions is described +below. +The backslashed assertions are: +

+  \b     matches at a word boundary
+  \B     matches when not at a word boundary
+  \A     matches at the start of the subject
+  \Z     matches at the end of the subject
+          also matches before a newline at the end of the subject
+  \z     matches only at the end of the subject
+  \G     matches at the first matching position in the subject
+
+Inside a character class, \b has a different meaning; it matches the backspace +character. If any other of these assertions appears in a character class, an +"invalid escape sequence" error is generated. +

+

+A word boundary is a position in the subject string where the current character +and the previous character do not both match \w or \W (i.e. one matches +\w and the other matches \W), or the start or end of the string if the +first or last character matches \w, respectively. When PCRE2 is built with +Unicode support, the meanings of \w and \W can be changed by setting the +PCRE2_UCP option. When this is done, it also affects \b and \B. Neither PCRE2 +nor Perl has a separate "start of word" or "end of word" metasequence. However, +whatever follows \b normally determines which it is. For example, the fragment +\ba matches "a" at the start of a word. +

+

+The \A, \Z, and \z assertions differ from the traditional circumflex and +dollar (described in the next section) in that they only ever match at the very +start and end of the subject string, whatever options are set. Thus, they are +independent of multiline mode. These three assertions are not affected by the +PCRE2_NOTBOL or PCRE2_NOTEOL options, which affect only the behaviour of the +circumflex and dollar metacharacters. However, if the startoffset +argument of pcre2_match() is non-zero, indicating that matching is to +start at a point other than the beginning of the subject, \A can never match. +The difference between \Z and \z is that \Z matches before a newline at the +end of the string as well as at the very end, whereas \z matches only at the +end. +

+

+The \G assertion is true only when the current matching position is at the +start point of the matching process, as specified by the startoffset +argument of pcre2_match(). It differs from \A when the value of +startoffset is non-zero. By calling pcre2_match() multiple times +with appropriate arguments, you can mimic Perl's /g option, and it is in this +kind of implementation where \G can be useful. +

+

+Note, however, that PCRE2's implementation of \G, being true at the starting +character of the matching process, is subtly different from Perl's, which +defines it as true at the end of the previous match. In Perl, these can be +different when the previously matched string was empty. Because PCRE2 does just +one match at a time, it cannot reproduce this behaviour. +

+

+If all the alternatives of a pattern begin with \G, the expression is anchored +to the starting match position, and the "anchored" flag is set in the compiled +regular expression. +

+
CIRCUMFLEX AND DOLLAR
+

+The circumflex and dollar metacharacters are zero-width assertions. That is, +they test for a particular condition being true without consuming any +characters from the subject string. These two metacharacters are concerned with +matching the starts and ends of lines. If the newline convention is set so that +only the two-character sequence CRLF is recognized as a newline, isolated CR +and LF characters are treated as ordinary data characters, and are not +recognized as newlines. +

+

+Outside a character class, in the default matching mode, the circumflex +character is an assertion that is true only if the current matching point is at +the start of the subject string. If the startoffset argument of +pcre2_match() is non-zero, or if PCRE2_NOTBOL is set, circumflex can +never match if the PCRE2_MULTILINE option is unset. Inside a character class, +circumflex has an entirely different meaning +(see below). +

+

+Circumflex need not be the first character of the pattern if a number of +alternatives are involved, but it should be the first thing in each alternative +in which it appears if the pattern is ever to match that branch. If all +possible alternatives start with a circumflex, that is, if the pattern is +constrained to match only at the start of the subject, it is said to be an +"anchored" pattern. (There are also other constructs that can cause a pattern +to be anchored.) +

+

+The dollar character is an assertion that is true only if the current matching +point is at the end of the subject string, or immediately before a newline at +the end of the string (by default), unless PCRE2_NOTEOL is set. Note, however, +that it does not actually match the newline. Dollar need not be the last +character of the pattern if a number of alternatives are involved, but it +should be the last item in any branch in which it appears. Dollar has no +special meaning in a character class. +

+

+The meaning of dollar can be changed so that it matches only at the very end of +the string, by setting the PCRE2_DOLLAR_ENDONLY option at compile time. This +does not affect the \Z assertion. +

+

+The meanings of the circumflex and dollar metacharacters are changed if the +PCRE2_MULTILINE option is set. When this is the case, a dollar character +matches before any newlines in the string, as well as at the very end, and a +circumflex matches immediately after internal newlines as well as at the start +of the subject string. It does not match after a newline that ends the string, +for compatibility with Perl. However, this can be changed by setting the +PCRE2_ALT_CIRCUMFLEX option. +

+

+For example, the pattern /^abc$/ matches the subject string "def\nabc" (where +\n represents a newline) in multiline mode, but not otherwise. Consequently, +patterns that are anchored in single line mode because all branches start with +^ are not anchored in multiline mode, and a match for circumflex is possible +when the startoffset argument of pcre2_match() is non-zero. The +PCRE2_DOLLAR_ENDONLY option is ignored if PCRE2_MULTILINE is set. +

+

+When the newline convention (see +"Newline conventions" +below) recognizes the two-character sequence CRLF as a newline, this is +preferred, even if the single characters CR and LF are also recognized as +newlines. For example, if the newline convention is "any", a multiline mode +circumflex matches before "xyz" in the string "abc\r\nxyz" rather than after +CR, even though CR on its own is a valid newline. (It also matches at the very +start of the string, of course.) +

+

+Note that the sequences \A, \Z, and \z can be used to match the start and +end of the subject in both modes, and if all branches of a pattern start with +\A it is always anchored, whether or not PCRE2_MULTILINE is set. +

+
FULL STOP (PERIOD, DOT) AND \N
+

+Outside a character class, a dot in the pattern matches any one character in +the subject string except (by default) a character that signifies the end of a +line. One or more characters may be specified as line terminators (see +"Newline conventions" +above). +

+

+Dot never matches a single line-ending character. When the two-character +sequence CRLF is the only line ending, dot does not match CR if it is +immediately followed by LF, but otherwise it matches all characters (including +isolated CRs and LFs). When ANYCRLF is selected for line endings, no occurrences +of CR of LF match dot. When all Unicode line endings are being recognized, dot +does not match CR or LF or any of the other line ending characters. +

+

+The behaviour of dot with regard to newlines can be changed. If the +PCRE2_DOTALL option is set, a dot matches any one character, without exception. +If the two-character sequence CRLF is present in the subject string, it takes +two dots to match it. +

+

+The handling of dot is entirely independent of the handling of circumflex and +dollar, the only relationship being that they both involve newlines. Dot has no +special meaning in a character class. +

+

+The escape sequence \N when not followed by an opening brace behaves like a +dot, except that it is not affected by the PCRE2_DOTALL option. In other words, +it matches any character except one that signifies the end of a line. +

+

+When \N is followed by an opening brace it has a different meaning. See the +section entitled +"Non-printing characters" +above for details. Perl also uses \N{name} to specify characters by Unicode +name; PCRE2 does not support this. +

+
MATCHING A SINGLE CODE UNIT
+

+Outside a character class, the escape sequence \C matches any one code unit, +whether or not a UTF mode is set. In the 8-bit library, one code unit is one +byte; in the 16-bit library it is a 16-bit unit; in the 32-bit library it is a +32-bit unit. Unlike a dot, \C always matches line-ending characters. The +feature is provided in Perl in order to match individual bytes in UTF-8 mode, +but it is unclear how it can usefully be used. +

+

+Because \C breaks up characters into individual code units, matching one unit +with \C in UTF-8 or UTF-16 mode means that the rest of the string may start +with a malformed UTF character. This has undefined results, because PCRE2 +assumes that it is matching character by character in a valid UTF string (by +default it checks the subject string's validity at the start of processing +unless the PCRE2_NO_UTF_CHECK or PCRE2_MATCH_INVALID_UTF option is used). +

+

+An application can lock out the use of \C by setting the +PCRE2_NEVER_BACKSLASH_C option when compiling a pattern. It is also possible to +build PCRE2 with the use of \C permanently disabled. +

+

+PCRE2 does not allow \C to appear in lookbehind assertions +(described below) +in UTF-8 or UTF-16 modes, because this would make it impossible to calculate +the length of the lookbehind. Neither the alternative matching function +pcre2_dfa_match() nor the JIT optimizer support \C in these UTF modes. +The former gives a match-time error; the latter fails to optimize and so the +match is always run using the interpreter. +

+

+In the 32-bit library, however, \C is always supported (when not explicitly +locked out) because it always matches a single code unit, whether or not UTF-32 +is specified. +

+

+In general, the \C escape sequence is best avoided. However, one way of using +it that avoids the problem of malformed UTF-8 or UTF-16 characters is to use a +lookahead to check the length of the next character, as in this pattern, which +could be used with a UTF-8 string (ignore white space and line breaks): +

+  (?| (?=[\x00-\x7f])(\C) |
+      (?=[\x80-\x{7ff}])(\C)(\C) |
+      (?=[\x{800}-\x{ffff}])(\C)(\C)(\C) |
+      (?=[\x{10000}-\x{1fffff}])(\C)(\C)(\C)(\C))
+
+In this example, a group that starts with (?| resets the capturing parentheses +numbers in each alternative (see +"Duplicate Group Numbers" +below). The assertions at the start of each branch check the next UTF-8 +character for values whose encoding uses 1, 2, 3, or 4 bytes, respectively. The +character's individual bytes are then captured by the appropriate number of +\C groups. +

+
SQUARE BRACKETS AND CHARACTER CLASSES
+

+An opening square bracket introduces a character class, terminated by a closing +square bracket. A closing square bracket on its own is not special by default. +If a closing square bracket is required as a member of the class, it should be +the first data character in the class (after an initial circumflex, if present) +or escaped with a backslash. This means that, by default, an empty class cannot +be defined. However, if the PCRE2_ALLOW_EMPTY_CLASS option is set, a closing +square bracket at the start does end the (empty) class. +

+

+A character class matches a single character in the subject. A matched +character must be in the set of characters defined by the class, unless the +first character in the class definition is a circumflex, in which case the +subject character must not be in the set defined by the class. If a circumflex +is actually required as a member of the class, ensure it is not the first +character, or escape it with a backslash. +

+

+For example, the character class [aeiou] matches any lower case English vowel, +whereas [^aeiou] matches all other characters. Note that a circumflex is just a +convenient notation for specifying the characters that are in the class by +enumerating those that are not. A class that starts with a circumflex is not an +assertion; it still consumes a character from the subject string, and therefore +it fails to match if the current pointer is at the end of the string. +

+

+Characters in a class may be specified by their code points using \o, \x, or +\N{U+hh..} in the usual way. When caseless matching is set, any letters in a +class represent both their upper case and lower case versions, so for example, +a caseless [aeiou] matches "A" as well as "a", and a caseless [^aeiou] does not +match "A", whereas a caseful version would. Note that there are two ASCII +characters, K and S, that, in addition to their lower case ASCII equivalents, +are case-equivalent with Unicode U+212A (Kelvin sign) and U+017F (long S) +respectively when either PCRE2_UTF or PCRE2_UCP is set. If you do not want +these ASCII/non-ASCII case equivalences, you can suppress them by setting +PCRE2_EXTRA_CASELESS_RESTRICT, either as an option in a compile context, or by +including (*CASELESS_RESTRICT) or (?r) within a pattern. +

+

+Characters that might indicate line breaks are never treated in any special way +when matching character classes, whatever line-ending sequence is in use, and +whatever setting of the PCRE2_DOTALL and PCRE2_MULTILINE options is used. A +class such as [^a] always matches one of these characters. +

+

+The generic character type escape sequences \d, \D, \h, \H, \p, \P, \s, +\S, \v, \V, \w, and \W may appear in a character class, and add the +characters that they match to the class. For example, [\dABCDEF] matches any +hexadecimal digit. In UTF modes, the PCRE2_UCP option affects the meanings of +\d, \s, \w and their upper case partners, just as it does when they appear +outside a character class, as described in the section entitled +"Generic character types" +above. The escape sequence \b has a different meaning inside a character +class; it matches the backspace character. The sequences \B, \R, and \X are +not special inside a character class. Like any other unrecognized escape +sequences, they cause an error. The same is true for \N when not followed by +an opening brace. +

+

+The minus (hyphen) character can be used to specify a range of characters in a +character class. For example, [d-m] matches any letter between d and m, +inclusive. If a minus character is required in a class, it must be escaped with +a backslash or appear in a position where it cannot be interpreted as +indicating a range, typically as the first or last character in the class, +or immediately after a range. For example, [b-d-z] matches letters in the range +b to d, a hyphen character, or z. +

+

+There is some special treatment for alphabetic ranges in EBCDIC environments; +see the section +"EBCDIC environments" +below. +

+

+Perl treats a hyphen as a literal if it appears before or after a POSIX class +(see below) or before or after a character type escape such as \d or \H. +However, unless the hyphen is the last character in the class, Perl outputs a +warning in its warning mode, as this is most likely a user error. As PCRE2 has +no facility for warning, an error is given in these cases. +

+

+It is not possible to have the literal character "]" as the end character of a +range. A pattern such as [W-]46] is interpreted as a class of two characters +("W" and "-") followed by a literal string "46]", so it would match "W46]" or +"-46]". However, if the "]" is escaped with a backslash it is interpreted as +the end of a range, so [W-\]46] is interpreted as a class containing a range +and two other characters. The octal or hexadecimal representation of "]" can +also be used to end a range. +

+

+Ranges normally include all code points between the start and end characters, +inclusive. They can also be used for code points specified numerically, for +example [\000-\037]. Ranges can include any characters that are valid for the +current mode. In any UTF mode, the so-called "surrogate" characters (those +whose code points lie between 0xd800 and 0xdfff inclusive) may not be specified +explicitly by default (the PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES option disables +this check). However, ranges such as [\x{d7ff}-\x{e000}], which include the +surrogates, are always permitted. +

+

+If a range that includes letters is used when caseless matching is set, it +matches the letters in either case. For example, [W-c] is equivalent to +[][\\^_`wxyzabc], matched caselessly, and in a non-UTF mode, if character +tables for a French locale are in use, [\xc8-\xcb] matches accented E +characters in both cases. +

+

+A circumflex can conveniently be used with the upper case character types to +specify a more restricted set of characters than the matching lower case type. +For example, the class [^\W_] matches any letter or digit, but not underscore, +whereas [\w] includes underscore. A positive character class should be read as +"something OR something OR ..." and a negative class as "NOT something AND NOT +something AND NOT ...". +

+

+The metacharacters that are recognized in character classes are backslash, +hyphen (when it can be interpreted as specifying a range), circumflex +(only at the start), and the terminating closing square bracket. An opening +square bracket is also special when it can be interpreted as introducing a +POSIX class (see +"Posix character classes" +below), or a special compatibility feature (see +"Compatibility feature for word boundaries" +below. Escaping any non-alphanumeric character in a class turns it into a +literal, whether or not it would otherwise be a metacharacter. +

+
PERL EXTENDED CHARACTER CLASSES
+

+From release 10.45 PCRE2 supports Perl's (?[...]) extended character class +syntax. This can be used to perform set operations such as intersection on +character classes. +

+

+The syntax permitted within (?[...]) is quite different to ordinary character +classes. Inside the extended class, there is an expression syntax consisting of +"atoms", operators, and ordinary parentheses "()" used for grouping. Such +classes always have the Perl /xx modifier (PCRE2 option PCRE2_EXTENDED_MORE) +turned on within them. This means that literal space and tab characters are +ignored everywhere in the class. +

+

+The allowed atoms are individual characters specified by escape sequences such +as \n or \x{123}, character types such as \d, POSIX classes such as +[:alpha:], and nested ordinary (non-extended) character classes. For example, +in (?[\d & [...]]) the nested class [...] follows the usual rules for ordinary +character classes, in which parentheses are not metacharacters, and character +literals and ranges are permitted. +

+

+Character literals and ranges may not appear outside a nested ordinary +character class because they are not atoms in the extended syntax. The extended +syntax does not introduce any additional escape sequences, so (?[\y]) is an +unknown escape, as it would be in [\y]. +

+

+In the extended syntax, ^ does not negate a class (except within an +ordinary class nested inside an extended class); it is instead a binary +operator. +

+

+The binary operators are "&" (intersection), "|" or "+" (union), "-" +(subtraction) and "^" (symmetric difference). These are left-associative and +"&" has higher (tighter) precedence, while the others have equal lower +precedence. The one prefix unary operator is "!" (complement), with highest +precedence. +

+
UTS#18 EXTENDED CHARACTER CLASSES
+

+The PCRE2_ALT_EXTENDED_CLASS option enables an alternative to Perl's (?[...]) +syntax, allowing instead extended class behaviour inside ordinary [...] +character classes. This altered syntax for [...] classes is loosely described +by the Unicode standard UTS#18. The PCRE2_ALT_EXTENDED_CLASS option does not +prevent use of (?[...]) classes; it just changes the meaning of all +[...] classes that are not nested inside a Perl (?[...]) class. +

+

+Firstly, in ordinary Perl [...] syntax, an expression such as "[a[]" is a +character class with two literal characters "a" and "[", but in UTS#18 extended +classes the "[" character becomes an additional metacharacter within classes, +denoting the start of a nested class, so a literal "[" must be escaped as "\[". +

+

+Secondly, within the UTS#18 extended syntax, there are operators "||", "&&", +"--" and "~~" which denote character class union, intersection, subtraction, +and symmetric difference respectively. In standard Perl syntax, these would +simply be needlessly-repeated literals (except for "--" which could be the +start or end of a range). In UTS#18 extended classes these operators can be used +in constructs such as [\p{L}--[QW]] for "Unicode letters, other than Q and W". +A literal "-" at the start or end of a range must be escaped, so while "[--1]" +in Perl syntax is the range from hyphen to "1", it must be escaped as "[\--1]" +in UTS#18 extended classes. +

+

+Unlike Perl's (?[...]) extended classes, the PCRE2_EXTENDED_MORE option to +ignore space and tab characters is not automatically enabled for UTS#18 +extended classes, but it is honoured if set. +

+

+Extended UTS#18 classes can be nested, and nested classes are themselves +extended classes (unlike Perl, where nested classes must be simple classes). +For example, [\p{L}&&[\p{Thai}||\p{Greek}]] matches any letter that is in +the Thai or Greek scripts. Note that this means that no special grouping +characters (such as the parentheses used in Perl's (?[...]) class syntax) are +needed. +

+

+Individual class items (literal characters, literal ranges, properties such as +\d or \p{...}, and nested classes) can be combined by juxtaposition or by an +operator. Juxtaposition is the implicit union operator, and binds more tightly +than any explicit operator. Thus a sequence of literals and/or ranges behaves +as if it is enclosed in square brackets. For example, [A-Z0-9&&[^E8]] is the +same as [[A-Z0-9]&&[^E8]], which matches any upper case alphanumeric character +except "E" or "8". +

+

+Precedence between the explicit operators is not defined, so mixing operators +is a syntax error. For example, [A&&B--C] is an error, but [A&&[B--C]] is +valid. +

+

+This is an emerging syntax which is being adopted gradually across the regex +ecosystem: for example JavaScript adopted the "/v" flag in ECMAScript 2024; +Python's "re" module reserves the syntax for future use with a FutureWarning +for unescaped use of "[" as a literal within character classes. Due to UTS#18 +providing insufficient guidance, engines interpret the syntax differently. +Rust's "regex" crate and Python's "regex" PyPi module both implement UTS#18 +extended classes, but with slight incompatibilities ([A||B&&C] is parsed as +[A||[B&&C]] in Python's "regex" but as [[A||B]&&C] in Rust's "regex"). +

+

+PCRE2's syntax adds syntax restrictions similar to ECMASCript's /v flag, so +that all the UTS#18 extended classes accepted as valid by PCRE2 have the +property that they are interpreted either with the same behaviour, or as +invalid, by all other major engines. Please file an issue if you are aware of +cross-engine differences in behaviour between PCRE2 and another major engine. +

+
POSIX CHARACTER CLASSES
+

+Perl supports the POSIX notation for character classes. This uses names +enclosed by [: and :] within the enclosing square brackets. PCRE2 also supports +this notation, in both ordinary and extended classes. For example, +

+  [01[:alpha:]%]
+
+matches "0", "1", any alphabetic character, or "%". The supported class names +are: +
+  alnum    letters and digits
+  alpha    letters
+  ascii    character codes 0 - 127
+  blank    space or tab only
+  cntrl    control characters
+  digit    decimal digits (same as \d)
+  graph    printing characters, excluding space
+  lower    lower case letters
+  print    printing characters, including space
+  punct    printing characters, excluding letters and digits and space
+  space    white space (the same as \s from PCRE2 8.34)
+  upper    upper case letters
+  word     "word" characters (same as \w)
+  xdigit   hexadecimal digits
+
+The default "space" characters are HT (9), LF (10), VT (11), FF (12), CR (13), +and space (32). If locale-specific matching is taking place, the list of space +characters may be different; there may be fewer or more of them. "Space" and +\s match the same set of characters, as do "word" and \w. +

+

+The name "word" is a Perl extension, and "blank" is a GNU extension from Perl +5.8. Another Perl extension is negation, which is indicated by a ^ character +after the colon. For example, +

+  [12[:^digit:]]
+
+matches "1", "2", or any non-digit. PCRE2 (and Perl) also recognize the POSIX +syntax [.ch.] and [=ch=] where "ch" is a "collating element", but these are not +supported, and an error is given if they are encountered. +

+

+By default, characters with values greater than 127 do not match any of the +POSIX character classes, although this may be different for characters in the +range 128-255 when locale-specific matching is happening. However, in UCP mode, +unless certain options are set (see below), some of the classes are changed so +that Unicode character properties are used. This is achieved by replacing +POSIX classes with other sequences, as follows: +

+  [:alnum:]  becomes  \p{Xan}
+  [:alpha:]  becomes  \p{L}
+  [:blank:]  becomes  \h
+  [:cntrl:]  becomes  \p{Cc}
+  [:digit:]  becomes  \p{Nd}
+  [:lower:]  becomes  \p{Ll}
+  [:space:]  becomes  \p{Xps}
+  [:upper:]  becomes  \p{Lu}
+  [:word:]   becomes  \p{Xwd}
+
+Negated versions, such as [:^alpha:] use \P instead of \p. Four other POSIX +classes are handled specially in UCP mode: +

+

+[:graph:] +This matches characters that have glyphs that mark the page when printed. In +Unicode property terms, it matches all characters with the L, M, N, P, S, or Cf +properties, except for: +

+  U+061C           Arabic Letter Mark
+  U+180E           Mongolian Vowel Separator
+  U+2066 - U+2069  Various "isolate"s
+
+
+

+

+[:print:] +This matches the same characters as [:graph:] plus space characters that are +not controls, that is, characters with the Zs property. +

+

+[:punct:] +This matches all characters that have the Unicode P (punctuation) property, +plus those characters with code points less than 256 that have the S (Symbol) +property. +

+

+[:xdigit:] +In addition to the ASCII hexadecimal digits, this also matches the "fullwidth" +versions of those characters, whose Unicode code points start at U+FF10. This +is a change that was made in PCRE2 release 10.43 for Perl compatibility. +

+

+The other POSIX classes are unchanged by PCRE2_UCP, and match only characters +with code points less than 256. +

+

+There are two options that can be used to restrict the POSIX classes to ASCII +characters when PCRE2_UCP is set. The option PCRE2_EXTRA_ASCII_DIGIT affects +just [:digit:] and [:xdigit:]. Within a pattern, this can be set and unset by +(?aT) and (?-aT). The PCRE2_EXTRA_ASCII_POSIX option disables UCP processing +for all POSIX classes, including [:digit:] and [:xdigit:]. Within a pattern, +(?aP) and (?-aP) set and unset both these options for consistency. +

+
COMPATIBILITY FEATURE FOR WORD BOUNDARIES
+

+In the POSIX.2 compliant library that was included in 4.4BSD Unix, the ugly +syntax [[:<:]] and [[:>:]] is used for matching "start of word" and "end of +word". PCRE2 treats these items as follows: +

+  [[:<:]]  is converted to  \b(?=\w)
+  [[:>:]]  is converted to  \b(?<=\w)
+
+Only these exact character sequences are recognized. A sequence such as +[a[:<:]b] provokes error for an unrecognized POSIX class name. This support is +not compatible with Perl. It is provided to help migrations from other +environments, and is best not used in any new patterns. Note that \b matches +at the start and the end of a word (see +"Simple assertions" +above), and in a Perl-style pattern the preceding or following character +normally shows which is wanted, without the need for the assertions that are +used above in order to give exactly the POSIX behaviour. Note also that the +PCRE2_UCP option changes the meaning of \w (and therefore \b) by default, so +it also affects these POSIX sequences. +

+
VERTICAL BAR
+

+Vertical bar characters are used to separate alternative patterns. For example, +the pattern +

+  gilbert|sullivan
+
+matches either "gilbert" or "sullivan". Any number of alternatives may appear, +and an empty alternative is permitted (matching the empty string). The matching +process tries each alternative in turn, from left to right, and the first one +that succeeds is used. If the alternatives are within a group +(defined below), +"succeeds" means matching the rest of the main pattern as well as the +alternative in the group. +

+
INTERNAL OPTION SETTING
+

+The settings of several options can be changed within a pattern by a sequence +of letters enclosed between "(?" and ")". The following are Perl-compatible, +and are described in detail in the +pcre2api +documentation. The option letters are: +

+  i  for PCRE2_CASELESS
+  m  for PCRE2_MULTILINE
+  n  for PCRE2_NO_AUTO_CAPTURE
+  s  for PCRE2_DOTALL
+  x  for PCRE2_EXTENDED
+  xx for PCRE2_EXTENDED_MORE
+
+For example, (?im) sets caseless, multiline matching. It is also possible to +unset these options by preceding the relevant letters with a hyphen, for +example (?-im). The two "extended" options are not independent; unsetting +either one cancels the effects of both of them. +

+

+A combined setting and unsetting such as (?im-sx), which sets PCRE2_CASELESS +and PCRE2_MULTILINE while unsetting PCRE2_DOTALL and PCRE2_EXTENDED, is also +permitted. Only one hyphen may appear in the options string. If a letter +appears both before and after the hyphen, the option is unset. An empty options +setting "(?)" is allowed. Needless to say, it has no effect. +

+

+If the first character following (? is a circumflex, it causes all of the above +options to be unset. Letters may follow the circumflex to cause some options to +be re-instated, but a hyphen may not appear. +

+

+Some PCRE2-specific options can be changed by the same mechanism using these +pairs or individual letters: +

+  aD for PCRE2_EXTRA_ASCII_BSD
+  aS for PCRE2_EXTRA_ASCII_BSS
+  aW for PCRE2_EXTRA_ASCII_BSW
+  aP for PCRE2_EXTRA_ASCII_POSIX and PCRE2_EXTRA_ASCII_DIGIT
+  aT for PCRE2_EXTRA_ASCII_DIGIT
+  r  for PCRE2_EXTRA_CASELESS_RESTRICT
+  J  for PCRE2_DUPNAMES
+  U  for PCRE2_UNGREEDY
+
+However, except for 'r', these are not unset by (?^), which is equivalent to +(?-imnrsx). If 'a' is not followed by any of the upper case letters shown +above, it sets (or unsets) all the ASCII options. +

+

+PCRE2_EXTRA_ASCII_DIGIT has no additional effect when PCRE2_EXTRA_ASCII_POSIX +is set, but including it in (?aP) means that (?-aP) suppresses all ASCII +restrictions for POSIX classes. +

+

+When one of these option changes occurs at top level (that is, not inside group +parentheses), the change applies until a subsequent change, or the end of the +pattern. An option change within a group (see below for a description of +groups) affects only that part of the group that follows it. At the end of the +group these options are reset to the state they were before the group. For +example, +

+  (a(?i)b)c
+
+matches abc and aBc and no other strings (assuming PCRE2_CASELESS is not set +externally). Any changes made in one alternative do carry on into subsequent +branches within the same group. For example, +
+  (a(?i)b|c)
+
+matches "ab", "aB", "c", and "C", even though when matching "C" the first +branch is abandoned before the option setting. This is because the effects of +option settings happen at compile time. There would be some very weird +behaviour otherwise. +

+

+As a convenient shorthand, if any option settings are required at the start of +a non-capturing group (see the next section), the option letters may +appear between the "?" and the ":". Thus the two patterns +

+  (?i:saturday|sunday)
+  (?:(?i)saturday|sunday)
+
+match exactly the same set of strings. +

+

+Note: There are other PCRE2-specific options, applying to the whole +pattern, which can be set by the application when the compiling function is +called. In addition, the pattern can contain special leading sequences such as +(*CRLF) to override what the application has set or what has been defaulted. +Details are given in the section entitled +"Newline sequences" +above. There are also the (*UTF) and (*UCP) leading sequences that can be used +to set UTF and Unicode property modes; they are equivalent to setting the +PCRE2_UTF and PCRE2_UCP options, respectively. However, the application can set +the PCRE2_NEVER_UTF or PCRE2_NEVER_UCP options, which lock out the use of the +(*UTF) and (*UCP) sequences. +

+
GROUPS
+

+Groups are delimited by parentheses (round brackets), which can be nested. +Turning part of a pattern into a group does two things: +
+
+1. It localizes a set of alternatives. For example, the pattern +

+  cat(aract|erpillar|)
+
+matches "cataract", "caterpillar", or "cat". Without the parentheses, it would +match "cataract", "erpillar" or an empty string. +
+
+2. It creates a "capture group". This means that, when the whole pattern +matches, the portion of the subject string that matched the group is passed +back to the caller, separately from the portion that matched the whole pattern. +(This applies only to the traditional matching function; the DFA matching +function does not support capturing.) +

+

+Opening parentheses are counted from left to right (starting from 1) to obtain +numbers for capture groups. For example, if the string "the red king" is +matched against the pattern +

+  the ((red|white) (king|queen))
+
+the captured substrings are "red king", "red", and "king", and are numbered 1, +2, and 3, respectively. +

+

+The fact that plain parentheses fulfil two functions is not always helpful. +There are often times when grouping is required without capturing. If an +opening parenthesis is followed by a question mark and a colon, the group +does not do any capturing, and is not counted when computing the number of any +subsequent capture groups. For example, if the string "the white queen" +is matched against the pattern +

+  the ((?:red|white) (king|queen))
+
+the captured substrings are "white queen" and "queen", and are numbered 1 and +2. The maximum number of capture groups is 65535. +

+

+As a convenient shorthand, if any option settings are required at the start of +a non-capturing group, the option letters may appear between the "?" and the +":". Thus the two patterns +

+  (?i:saturday|sunday)
+  (?:(?i)saturday|sunday)
+
+match exactly the same set of strings. Because alternative branches are tried +from left to right, and options are not reset until the end of the group is +reached, an option setting in one branch does affect subsequent branches, so +the above patterns match "SUNDAY" as well as "Saturday". +

+
DUPLICATE GROUP NUMBERS
+

+Perl 5.10 introduced a feature whereby each alternative in a group uses the +same numbers for its capturing parentheses. Such a group starts with (?| and is +itself a non-capturing group. For example, consider this pattern: +

+  (?|(Sat)ur|(Sun))day
+
+Because the two alternatives are inside a (?| group, both sets of capturing +parentheses are numbered one. Thus, when the pattern matches, you can look +at captured substring number one, whichever alternative matched. This construct +is useful when you want to capture part, but not all, of one of a number of +alternatives. Inside a (?| group, parentheses are numbered as usual, but the +number is reset at the start of each branch. The numbers of any capturing +parentheses that follow the whole group start after the highest number used in +any branch. The following example is taken from the Perl documentation. The +numbers underneath show in which buffer the captured content will be stored. +
+  # before  ---------------branch-reset----------- after
+  / ( a )  (?| x ( y ) z | (p (q) r) | (t) u (v) ) ( z ) /x
+  # 1            2         2  3        2     3     4
+
+A backreference to a capture group uses the most recent value that is set for +the group. The following pattern matches "abcabc" or "defdef": +
+  /(?|(abc)|(def))\1/
+
+In contrast, a subroutine call to a capture group always refers to the +first one in the pattern with the given number. The following pattern matches +"abcabc" or "defabc": +
+  /(?|(abc)|(def))(?1)/
+
+A relative reference such as (?-1) is no different: it is just a convenient way +of computing an absolute group number. +

+

+If a +condition test +for a group's having matched refers to a non-unique number, the test is +true if any group with that number has matched. +

+

+An alternative approach to using this "branch reset" feature is to use +duplicate named groups, as described in the next section. +

+
NAMED CAPTURE GROUPS
+

+Identifying capture groups by number is simple, but it can be very hard to keep +track of the numbers in complicated patterns. Furthermore, if an expression is +modified, the numbers may change. To help with this difficulty, PCRE2 supports +the naming of capture groups. This feature was not added to Perl until release +5.10. Python had the feature earlier, and PCRE1 introduced it at release 4.0, +using the Python syntax. PCRE2 supports both the Perl and the Python syntax. +

+

+In PCRE2, a capture group can be named in one of three ways: (?<name>...) or +(?'name'...) as in Perl, or (?P<name>...) as in Python. Names may be up to 128 +code units long. When PCRE2_UTF is not set, they may contain only ASCII +alphanumeric characters and underscores, but must start with a non-digit. When +PCRE2_UTF is set, the syntax of group names is extended to allow any Unicode +letter or Unicode decimal digit. In other words, group names must match one of +these patterns: +

+  ^[_A-Za-z][_A-Za-z0-9]*\z   when PCRE2_UTF is not set
+  ^[_\p{L}][_\p{L}\p{Nd}]*\z  when PCRE2_UTF is set
+
+References to capture groups from other parts of the pattern, such as +backreferences, +recursion, +and +conditions, +can all be made by name as well as by number. +

+

+Named capture groups are allocated numbers as well as names, exactly as +if the names were not present. In both PCRE2 and Perl, capture groups +are primarily identified by numbers; any names are just aliases for these +numbers. The PCRE2 API provides function calls for extracting the complete +name-to-number translation table from a compiled pattern, as well as +convenience functions for extracting captured substrings by name. +

+

+Warning: When more than one capture group has the same number, as +described in the previous section, a name given to one of them applies to all +of them. Perl allows identically numbered groups to have different names. +Consider this pattern, where there are two capture groups, both numbered 1: +

+  (?|(?<AA>aa)|(?<BB>bb))
+
+Perl allows this, with both names AA and BB as aliases of group 1. Thus, after +a successful match, both names yield the same value (either "aa" or "bb"). +

+

+In an attempt to reduce confusion, PCRE2 does not allow the same group number +to be associated with more than one name. The example above provokes a +compile-time error. However, there is still scope for confusion. Consider this +pattern: +

+  (?|(?<AA>aa)|(bb))
+
+Although the second group number 1 is not explicitly named, the name AA is +still an alias for any group 1. Whether the pattern matches "aa" or "bb", a +reference by name to group AA yields the matched string. +

+

+By default, a name must be unique within a pattern, except that duplicate names +are permitted for groups with the same number, for example: +

+  (?|(?<AA>aa)|(?<AA>bb))
+
+The duplicate name constraint can be disabled by setting the PCRE2_DUPNAMES +option at compile time, or by the use of (?J) within the pattern, as described +in the section entitled +"Internal Option Setting" +above. +

+

+Duplicate names can be useful for patterns where only one instance of the named +capture group can match. Suppose you want to match the name of a weekday, +either as a 3-letter abbreviation or as the full name, and in both cases you +want to extract the abbreviation. This pattern (ignoring the line breaks) does +the job: +

+  (?J)
+  (?<DN>Mon|Fri|Sun)(?:day)?|
+  (?<DN>Tue)(?:sday)?|
+  (?<DN>Wed)(?:nesday)?|
+  (?<DN>Thu)(?:rsday)?|
+  (?<DN>Sat)(?:urday)?
+
+There are five capture groups, but only one is ever set after a match. The +convenience functions for extracting the data by name returns the substring for +the first (and in this example, the only) group of that name that matched. This +saves searching to find which numbered group it was. (An alternative way of +solving this problem is to use a "branch reset" group, as described in the +previous section.) +

+

+If you make a backreference to a non-unique named group from elsewhere in the +pattern, the groups to which the name refers are checked in the order in which +they appear in the overall pattern. The first one that is set is used for the +reference. For example, this pattern matches both "foofoo" and "barbar" but not +"foobar" or "barfoo": +

+  (?J)(?:(?<n>foo)|(?<n>bar))\k<n>
+
+
+

+

+If you make a subroutine call to a non-unique named group, the one that +corresponds to the first occurrence of the name is used. In the absence of +duplicate numbers this is the one with the lowest number. +

+

+If you use a named reference in a condition +test (see the +section about conditions +below), either to check whether a capture group has matched, or to check for +recursion, all groups with the same name are tested. If the condition is true +for any one of them, the overall condition is true. This is the same behaviour +as testing by number. For further details of the interfaces for handling named +capture groups, see the +pcre2api +documentation. +

+
REPETITION
+

+Repetition is specified by quantifiers, which may follow any one of these +items: +

+  a literal data character
+  the dot metacharacter
+  the \C escape sequence
+  the \R escape sequence
+  the \X escape sequence
+  any escape sequence that matches a single character
+  a character class
+  a backreference
+  a parenthesized group (including lookaround assertions)
+  a subroutine call (recursive or otherwise)
+
+If a quantifier does not follow a repeatable item, an error occurs. The +general repetition quantifier specifies a minimum and maximum number of +permitted matches by giving two numbers in curly brackets (braces), separated +by a comma. The numbers must be less than 65536, and the first must be less +than or equal to the second. For example, +
+  z{2,4}
+
+matches "zz", "zzz", or "zzzz". A closing brace on its own is not a special +character. If the second number is omitted, but the comma is present, there is +no upper limit; if the second number and the comma are both omitted, the +quantifier specifies an exact number of required matches. Thus +
+  [aeiou]{3,}
+
+matches at least 3 successive vowels, but may match many more, whereas +
+  \d{8}
+
+matches exactly 8 digits. If the first number is omitted, the lower limit is +taken as zero; in this case the upper limit must be present. +
+  X{,4} is interpreted as X{0,4}
+
+This is a change in behaviour that happened in Perl 5.34.0 and PCRE2 10.43. In +earlier versions such a sequence was not interpreted as a quantifier. Other +regular expression engines may behave either way. +

+

+If the characters that follow an opening brace do not match the syntax of a +quantifier, the brace is taken as a literal character. In particular, this +means that {,} is a literal string of three characters. +

+

+Note that not every opening brace is potentially the start of a quantifier +because braces are used in other items such as \N{U+345} or \k{name}. +

+

+In UTF modes, quantifiers apply to characters rather than to individual code +units. Thus, for example, \x{100}{2} matches two characters, each of +which is represented by a two-byte sequence in a UTF-8 string. Similarly, +\X{3} matches three Unicode extended grapheme clusters, each of which may be +several code units long (and they may be of different lengths). +

+

+The quantifier {0} is permitted, causing the expression to behave as if the +previous item and the quantifier were not present. This may be useful for +capture groups that are referenced as +subroutines +from elsewhere in the pattern (but see also the section entitled +"Defining capture groups for use by reference only" +below). Except for parenthesized groups, items that have a {0} quantifier are +omitted from the compiled pattern. +

+

+For convenience, the three most common quantifiers have single-character +abbreviations: +

+  *    is equivalent to {0,}
+  +    is equivalent to {1,}
+  ?    is equivalent to {0,1}
+
+It is possible to construct infinite loops by following a group that can match +no characters with a quantifier that has no upper limit, for example: +
+  (a?)*
+
+Earlier versions of Perl and PCRE1 used to give an error at compile time for +such patterns. However, because there are cases where this can be useful, such +patterns are now accepted, but whenever an iteration of such a group matches no +characters, matching moves on to the next item in the pattern instead of +repeatedly matching an empty string. This does not prevent backtracking into +any of the iterations if a subsequent item fails to match. +

+

+By default, quantifiers are "greedy", that is, they match as much as possible +(up to the maximum number of permitted repetitions), without causing the rest +of the pattern to fail. The classic example of where this gives problems is in +trying to match comments in C programs. These appear between /* and */ and +within the comment, individual * and / characters may appear. An attempt to +match C comments by applying the pattern +

+  /\*.*\*/
+
+to the string +
+  /* first comment */  not comment  /* second comment */
+
+fails, because it matches the entire string owing to the greediness of the .* +item. However, if a quantifier is followed by a question mark, it ceases to be +greedy, and instead matches the minimum number of times possible, so the +pattern +
+  /\*.*?\*/
+
+does the right thing with C comments. The meaning of the various quantifiers is +not otherwise changed, just the preferred number of matches. Do not confuse +this use of question mark with its use as a quantifier in its own right. +Because it has two uses, it can sometimes appear doubled, as in +
+  \d??\d
+
+which matches one digit by preference, but can match two if that is the only +way the rest of the pattern matches. +

+

+If the PCRE2_UNGREEDY option is set (an option that is not available in Perl), +the quantifiers are not greedy by default, but individual ones can be made +greedy by following them with a question mark. In other words, it inverts the +default behaviour. +

+

+When a parenthesized group is quantified with a minimum repeat count that +is greater than 1 or with a limited maximum, more memory is required for the +compiled pattern, in proportion to the size of the minimum or maximum. +

+

+If a pattern starts with .* or .{0,} and the PCRE2_DOTALL option (equivalent +to Perl's /s) is set, thus allowing the dot to match newlines, the pattern is +implicitly anchored, because whatever follows will be tried against every +character position in the subject string, so there is no point in retrying the +overall match at any position after the first. PCRE2 normally treats such a +pattern as though it were preceded by \A. +

+

+In cases where it is known that the subject string contains no newlines, it is +worth setting PCRE2_DOTALL in order to obtain this optimization, or +alternatively, using ^ to indicate anchoring explicitly. +

+

+However, there are some cases where the optimization cannot be used. When .* +is inside capturing parentheses that are the subject of a backreference +elsewhere in the pattern, a match at the start may fail where a later one +succeeds. Consider, for example: +

+  (.*)abc\1
+
+If the subject is "xyz123abc123" the match point is the fourth character. For +this reason, such a pattern is not implicitly anchored. +

+

+Another case where implicit anchoring is not applied is when the leading .* is +inside an atomic group. Once again, a match at the start may fail where a later +one succeeds. Consider this pattern: +

+  (?>.*?a)b
+
+It matches "ab" in the subject "aab". The use of the backtracking control verbs +(*PRUNE) and (*SKIP) also disable this optimization. To do so explicitly, +either pass the compile option PCRE2_NO_DOTSTAR_ANCHOR, or call +pcre2_set_optimize() with a PCRE2_DOTSTAR_ANCHOR_OFF directive. +

+

+When a capture group is repeated, the value captured is the substring that +matched the final iteration. For example, after +

+  (tweedle[dume]{3}\s*)+
+
+has matched "tweedledum tweedledee" the value of the captured substring is +"tweedledee". However, if there are nested capture groups, the corresponding +captured values may have been set in previous iterations. For example, after +
+  (a|(b))+
+
+matches "aba" the value of the second captured substring is "b". +

+
ATOMIC GROUPING AND POSSESSIVE QUANTIFIERS
+

+With both maximizing ("greedy") and minimizing ("ungreedy" or "lazy") +repetition, failure of what follows normally causes the repeated item to be +re-evaluated to see if a different number of repeats allows the rest of the +pattern to match. Sometimes it is useful to prevent this, either to change the +nature of the match, or to cause it fail earlier than it otherwise might, when +the author of the pattern knows there is no point in carrying on. +

+

+Consider, for example, the pattern \d+foo when applied to the subject line +

+  123456bar
+
+After matching all 6 digits and then failing to match "foo", the normal +action of the matcher is to try again with only 5 digits matching the \d+ +item, and then with 4, and so on, before ultimately failing. "Atomic grouping" +(a term taken from Jeffrey Friedl's book) provides the means for specifying +that once a group has matched, it is not to be re-evaluated in this way. +

+

+If we use atomic grouping for the previous example, the matcher gives up +immediately on failing to match "foo" the first time. The notation is a kind of +special parenthesis, starting with (?> as in this example: +

+  (?>\d+)foo
+
+Perl 5.28 introduced an experimental alphabetic form starting with (* which may +be easier to remember: +
+  (*atomic:\d+)foo
+
+This kind of parenthesized group "locks up" the part of the pattern it contains +once it has matched, and a failure further into the pattern is prevented from +backtracking into it. Backtracking past it to previous items, however, works as +normal. +

+

+An alternative description is that a group of this type matches exactly the +string of characters that an identical standalone pattern would match, if +anchored at the current point in the subject string. +

+

+Atomic groups are not capture groups. Simple cases such as the above example +can be thought of as a maximizing repeat that must swallow everything it can. +So, while both \d+ and \d+? are prepared to adjust the number of digits they +match in order to make the rest of the pattern match, (?>\d+) can only match +an entire sequence of digits. +

+

+Atomic groups in general can of course contain arbitrarily complicated +expressions, and can be nested. However, when the contents of an atomic +group is just a single repeated item, as in the example above, a simpler +notation, called a "possessive quantifier" can be used. This consists of an +additional + character following a quantifier. Using this notation, the +previous example can be rewritten as +

+  \d++foo
+
+Note that a possessive quantifier can be used with an entire group, for +example: +
+  (abc|xyz){2,3}+
+
+Possessive quantifiers are always greedy; the setting of the PCRE2_UNGREEDY +option is ignored. They are a convenient notation for the simpler forms of +atomic group. However, there is no difference in the meaning of a possessive +quantifier and the equivalent atomic group, though there may be a performance +difference; possessive quantifiers should be slightly faster. +

+

+The possessive quantifier syntax is an extension to the Perl 5.8 syntax. +Jeffrey Friedl originated the idea (and the name) in the first edition of his +book. Mike McCloskey liked it, so implemented it when he built Sun's Java +package, and PCRE1 copied it from there. It found its way into Perl at release +5.10. +

+

+PCRE2 has an optimization that automatically "possessifies" certain simple +pattern constructs. For example, the sequence A+B is treated as A++B because +there is no point in backtracking into a sequence of A's when B must follow. +This feature can be disabled by the PCRE2_NO_AUTO_POSSESS option, by calling +pcre2_set_optimize() with a PCRE2_AUTO_POSSESS_OFF directive, or by +starting the pattern with (*NO_AUTO_POSSESS). +

+

+When a pattern contains an unlimited repeat inside a group that can itself be +repeated an unlimited number of times, the use of an atomic group is the only +way to avoid some failing matches taking a very long time indeed. The pattern +

+  (\D+|<\d+>)*[!?]
+
+matches an unlimited number of substrings that either consist of non-digits, or +digits enclosed in <>, followed by either ! or ?. When it matches, it runs +quickly. However, if it is applied to +
+  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+
+it takes a long time before reporting failure. This is because the string can +be divided between the internal \D+ repeat and the external * repeat in a +large number of ways, and all have to be tried. (The example uses [!?] rather +than a single character at the end, because both PCRE2 and Perl have an +optimization that allows for fast failure when a single character is used. They +remember the last single character that is required for a match, and fail early +if it is not present in the string.) If the pattern is changed so that it uses +an atomic group, like this: +
+  ((?>\D+)|<\d+>)*[!?]
+
+sequences of non-digits cannot be broken, and failure happens quickly. +

+
BACKREFERENCES
+

+Outside a character class, a backslash followed by a digit greater than 0 (and +possibly further digits) is a backreference to a capture group earlier (that +is, to its left) in the pattern, provided there have been that many previous +capture groups. +

+

+However, if the decimal number following the backslash is less than 8, it is +always taken as a backreference, and causes an error only if there are not that +many capture groups in the entire pattern. In other words, the group that is +referenced need not be to the left of the reference for numbers less than 8. A +"forward backreference" of this type can make sense when a repetition is +involved and the group to the right has participated in an earlier iteration. +

+

+It is not possible to have a numerical "forward backreference" to a group whose +number is 8 or more using this syntax because a sequence such as \50 is +interpreted as a character defined in octal. See the subsection entitled +"Non-printing characters" +above +for further details of the handling of digits following a backslash. Other +forms of backreferencing do not suffer from this restriction. In particular, +there is no problem when named capture groups are used (see below). +

+

+Another way of avoiding the ambiguity inherent in the use of digits following a +backslash is to use the \g escape sequence. This escape must be followed by a +signed or unsigned number, optionally enclosed in braces. These examples are +all identical: +

+  (ring), \1
+  (ring), \g1
+  (ring), \g{1}
+
+An unsigned number specifies an absolute reference without the ambiguity that +is present in the older syntax. It is also useful when literal digits follow +the reference. A signed number is a relative reference. Consider this example: +
+  (abc(def)ghi)\g{-1}
+
+The sequence \g{-1} is a reference to the capture group whose number is one +less than the number of the next group to be started, so in this example (where +the next group would be numbered 3) is it equivalent to \2, and \g{-2} would +be equivalent to \1. Note that if this construct is inside a capture group, +that group is included in the count, so in this example \g{-2} also refers to +group 1: +
+  (A)(\g{-2}B)
+
+The use of relative references can be helpful in long patterns, and also in +patterns that are created by joining together fragments that contain references +within themselves. +

+

+The sequence \g{+1} is a reference to the next capture group that is started +after this item, and \g{+2} refers to the one after that, and so on. This kind +of forward reference can be useful in patterns that repeat. Perl does not +support the use of + in this way. +

+

+A backreference matches whatever actually most recently matched the capture +group in the current subject string, rather than anything at all that matches +the group (see +"Groups as subroutines" +below for a way of doing that). So the pattern +

+  (sens|respons)e and \1ibility
+
+matches "sense and sensibility" and "response and responsibility", but not +"sense and responsibility". If caseful matching is in force at the time of the +backreference, the case of letters is relevant. For example, +
+  ((?i)rah)\s+\1
+
+matches "rah rah" and "RAH RAH", but not "RAH rah", even though the original +capture group is matched caselessly. +

+

+There are several different ways of writing backreferences to named capture +groups. The .NET syntax is \k{name}, the Python syntax is (?=name), and the +original Perl syntax is \k<name> or \k'name'. All of these are now supported +by both Perl and PCRE2. Perl 5.10's unified backreference syntax, in which \g +can be used for both numeric and named references, is also supported by PCRE2. +We could rewrite the above example in any of the following ways: +

+  (?<p1>(?i)rah)\s+\k<p1>
+  (?'p1'(?i)rah)\s+\k{p1}
+  (?P<p1>(?i)rah)\s+(?P=p1)
+  (?<p1>(?i)rah)\s+\g{p1}
+
+A capture group that is referenced by name may appear in the pattern before or +after the reference. +

+

+There may be more than one backreference to the same group. If a group has not +actually been used in a particular match, backreferences to it always fail by +default. For example, the pattern +

+  (a|(bc))\2
+
+always fails if it starts to match "a" rather than "bc". However, if the +PCRE2_MATCH_UNSET_BACKREF option is set at compile time, a backreference to an +unset value matches an empty string. +

+

+Because there may be many capture groups in a pattern, all digits following a +backslash are taken as part of a potential backreference number. If the pattern +continues with a digit character, some delimiter must be used to terminate the +backreference. If the PCRE2_EXTENDED or PCRE2_EXTENDED_MORE option is set, this +can be white space. Otherwise, the \g{} syntax or an empty comment (see +"Comments" +below) can be used. +

+
+Recursive backreferences +
+

+A backreference that occurs inside the group to which it refers fails when the +group is first used, so, for example, (a\1) never matches. However, such +references can be useful inside repeated groups. For example, the pattern +

+  (a|b\1)+
+
+matches any number of "a"s and also "aba", "ababbaa" etc. At each iteration of +the group, the backreference matches the character string corresponding to the +previous iteration. In order for this to work, the pattern must be such that +the first iteration does not need to match the backreference. This can be done +using alternation, as in the example above, or by a quantifier with a minimum +of zero. +

+

+For versions of PCRE2 less than 10.25, backreferences of this type used to +cause the group that they reference to be treated as an +atomic group. +This restriction no longer applies, and backtracking into such groups can occur +as normal. +

+
ASSERTIONS
+

+An assertion is a test that does not consume any characters. The test must +succeed for the match to continue. The simple assertions coded as \b, \B, +\A, \G, \Z, \z, ^ and $ are described +above. +

+

+More complicated assertions are coded as parenthesized groups. If matching such +a group succeeds, matching continues after it, but with the matching position +in the subject string reset to what it was before the assertion was processed. +

+

+A special kind of assertion, called a "scan substring" assertion, matches a +subpattern against a previously captured substring. This is described in the +section entitled +"Scan substring assertions" +below. It is a PCRE2 extension, not compatible with Perl. +

+

+The other goup-based assertions are of two kinds: those that look ahead of the +current position in the subject string, and those that look behind it, and in +each case an assertion may be positive (must match for the assertion to be +true) or negative (must not match for the assertion to be true). +

+

+The Perl-compatible lookaround assertions are atomic. If an assertion is true, +but there is a subsequent matching failure, there is no backtracking into the +assertion. However, there are some cases where non-atomic assertions can be +useful. PCRE2 has some support for these, described in the section entitled +"Non-atomic assertions" +below, but they are not Perl-compatible. +

+

+A lookaround assertion may appear as the condition in a +conditional group +(see below). In this case, the result of matching the assertion determines +which branch of the condition is followed. +

+

+Assertion groups are not capture groups. If an assertion contains capture +groups within it, these are counted for the purposes of numbering the capture +groups in the whole pattern. Within each branch of an assertion, locally +captured substrings may be referenced in the usual way. For example, a sequence +such as (.)\g{-1} can be used to check that two adjacent characters are the +same. +

+

+When a branch within an assertion fails to match, any substrings that were +captured are discarded (as happens with any pattern branch that fails to +match). A negative assertion is true only when all its branches fail to match; +this means that no captured substrings are ever retained after a successful +negative assertion. When an assertion contains a matching branch, what happens +depends on the type of assertion. +

+

+For a positive assertion, internally captured substrings in the successful +branch are retained, and matching continues with the next pattern item after +the assertion. For a negative assertion, a matching branch means that the +assertion is not true. If such an assertion is being used as a condition in a +conditional group +(see below), captured substrings are retained, because matching continues with +the "no" branch of the condition. For other failing negative assertions, +control passes to the previous backtracking point, thus discarding any captured +strings within the assertion. +

+

+Most assertion groups may be repeated; though it makes no sense to assert the +same thing several times, the side effect of capturing in positive assertions +may occasionally be useful. However, an assertion that forms the condition for +a conditional group may not be quantified. PCRE2 used to restrict the +repetition of assertions, but from release 10.35 the only restriction is that +an unlimited maximum repetition is changed to be one more than the minimum. For +example, {3,} is treated as {3,4}. +

+
+Alphabetic assertion names +
+

+Traditionally, symbolic sequences such as (?= and (?<= have been used to +specify lookaround assertions. Perl 5.28 introduced some experimental +alphabetic alternatives which might be easier to remember. They all start with +(* instead of (? and must be written using lower case letters. PCRE2 supports +the following synonyms: +

+  (*positive_lookahead:  or (*pla: is the same as (?=
+  (*negative_lookahead:  or (*nla: is the same as (?!
+  (*positive_lookbehind: or (*plb: is the same as (?<=
+  (*negative_lookbehind: or (*nlb: is the same as (?<!
+
+For example, (*pla:foo) is the same assertion as (?=foo). In the following +sections, the various assertions are described using the original symbolic +forms. +

+
+Lookahead assertions +
+

+Lookahead assertions start with (?= for positive assertions and (?! for +negative assertions. For example, +

+  \w+(?=;)
+
+matches a word followed by a semicolon, but does not include the semicolon in +the match, and +
+  foo(?!bar)
+
+matches any occurrence of "foo" that is not followed by "bar". Note that the +apparently similar pattern +
+  (?!foo)bar
+
+does not find an occurrence of "bar" that is preceded by something other than +"foo"; it finds any occurrence of "bar" whatsoever, because the assertion +(?!foo) is always true when the next three characters are "bar". A +lookbehind assertion is needed to achieve the other effect. +

+

+If you want to force a matching failure at some point in a pattern, the most +convenient way to do it is with (?!) because an empty string always matches, so +an assertion that requires there not to be an empty string must always fail. +The backtracking control verb (*FAIL) or (*F) is a synonym for (?!). +

+
+Lookbehind assertions +
+

+Lookbehind assertions start with (?<= for positive assertions and (?<! for +negative assertions. For example, +

+  (?<!foo)bar
+
+does find an occurrence of "bar" that is not preceded by "foo". The contents of +a lookbehind assertion are restricted such that there must be a known maximum +to the lengths of all the strings it matches. There are two cases: +

+

+If every top-level alternative matches a fixed length, for example +

+  (?<=colour|color)
+
+there is a limit of 65535 characters to the lengths, which do not have to be +the same, as this example demonstrates. This is the only kind of lookbehind +supported by PCRE2 versions earlier than 10.43 and by the alternative matching +function pcre2_dfa_match(). +

+

+In PCRE2 10.43 and later, pcre2_match() supports lookbehind assertions in +which one or more top-level alternatives can match more than one string length, +for example +

+  (?<=colou?r)
+
+The maximum matching length for any branch of the lookbehind is limited to a +value set by the calling program (default 255 characters). Unlimited repetition +(for example \d*) is not supported. In some cases, the escape sequence \K +(see above) +can be used instead of a lookbehind assertion at the start of a pattern to get +round the length limit restriction. +

+

+In UTF-8 and UTF-16 modes, PCRE2 does not allow the \C escape (which matches a +single code unit even in a UTF mode) to appear in lookbehind assertions, +because it makes it impossible to calculate the length of the lookbehind. The +\X and \R escapes, which can match different numbers of code units, are never +permitted in lookbehinds. +

+

+"Subroutine" +calls (see below) such as (?2) or (?&X) are permitted in lookbehinds, as long +as the called capture group matches a limited-length string. However, +recursion, +that is, a "subroutine" call into a group that is already active, +is not supported. +

+

+PCRE2 supports backreferences in lookbehinds, but only if certain conditions +are met. The PCRE2_MATCH_UNSET_BACKREF option must not be set, there must be no +use of (?| in the pattern (it creates duplicate group numbers), and if the +backreference is by name, the name must be unique. Of course, the referenced +group must itself match a limited length substring. The following pattern +matches words containing at least two characters that begin and end with the +same character: +

+   \b(\w)\w++(?<=\1)
+
+

+

+Possessive quantifiers can be used in conjunction with lookbehind assertions to +specify efficient matching at the end of subject strings. Consider a simple +pattern such as +

+  abcd$
+
+when applied to a long string that does not match. Because matching proceeds +from left to right, PCRE2 will look for each "a" in the subject and then see if +what follows matches the rest of the pattern. If the pattern is specified as +
+  ^.*abcd$
+
+the initial .* matches the entire string at first, but when this fails (because +there is no following "a"), it backtracks to match all but the last character, +then all but the last two characters, and so on. Once again the search for "a" +covers the entire string, from right to left, so we are no better off. However, +if the pattern is written as +
+  ^.*+(?<=abcd)
+
+there can be no backtracking for the .*+ item because of the possessive +quantifier; it can match only the entire string. The subsequent lookbehind +assertion does a single test on the last four characters. If it fails, the +match fails immediately. For long strings, this approach makes a significant +difference to the processing time. +

+
+Using multiple assertions +
+

+Several assertions (of any sort) may occur in succession. For example, +

+  (?<=\d{3})(?<!999)foo
+
+matches "foo" preceded by three digits that are not "999". Notice that each of +the assertions is applied independently at the same point in the subject +string. First there is a check that the previous three characters are all +digits, and then there is a check that the same three characters are not "999". +This pattern does not match "foo" preceded by six characters, the first +of which are digits and the last three of which are not "999". For example, it +doesn't match "123abcfoo". A pattern to do that is +
+  (?<=\d{3}...)(?<!999)foo
+
+This time the first assertion looks at the preceding six characters, checking +that the first three are digits, and then the second assertion checks that the +preceding three characters are not "999". +

+

+Assertions can be nested in any combination. For example, +

+  (?<=(?<!foo)bar)baz
+
+matches an occurrence of "baz" that is preceded by "bar" which in turn is not +preceded by "foo", while +
+  (?<=\d{3}(?!999)...)foo
+
+is another pattern that matches "foo" preceded by three digits and any three +characters that are not "999". +

+
NON-ATOMIC ASSERTIONS
+

+Traditional lookaround assertions are atomic. That is, if an assertion is true, +but there is a subsequent matching failure, there is no backtracking into the +assertion. However, there are some cases where non-atomic positive assertions +can be useful. PCRE2 provides these using the following syntax: +

+  (*non_atomic_positive_lookahead:  or (*napla: or (?*
+  (*non_atomic_positive_lookbehind: or (*naplb: or (?<*
+
+Consider the problem of finding the right-most word in a string that also +appears earlier in the string, that is, it must appear at least twice in total. +This pattern returns the required result as captured substring 1: +
+  ^(?x)(*napla: .* \b(\w++)) (?> .*? \b\1\b ){2}
+
+For a subject such as "word1 word2 word3 word2 word3 word4" the result is +"word3". How does it work? At the start, ^(?x) anchors the pattern and sets the +"x" option, which causes white space (introduced for readability) to be +ignored. Inside the assertion, the greedy .* at first consumes the entire +string, but then has to backtrack until the rest of the assertion can match a +word, which is captured by group 1. In other words, when the assertion first +succeeds, it captures the right-most word in the string. +

+

+The current matching point is then reset to the start of the subject, and the +rest of the pattern match checks for two occurrences of the captured word, +using an ungreedy .*? to scan from the left. If this succeeds, we are done, but +if the last word in the string does not occur twice, this part of the pattern +fails. If a traditional atomic lookahead (?= or (*pla: had been used, the +assertion could not be re-entered, and the whole match would fail. The pattern +would succeed only if the very last word in the subject was found twice. +

+

+Using a non-atomic lookahead, however, means that when the last word does not +occur twice in the string, the lookahead can backtrack and find the second-last +word, and so on, until either the match succeeds, or all words have been +tested. +

+

+Two conditions must be met for a non-atomic assertion to be useful: the +contents of one or more capturing groups must change after a backtrack into the +assertion, and there must be a backreference to a changed group later in the +pattern. If this is not the case, the rest of the pattern match fails exactly +as before because nothing has changed, so using a non-atomic assertion just +wastes resources. +

+

+There is one exception to backtracking into a non-atomic assertion. If an +(*ACCEPT) control verb is triggered, the assertion succeeds atomically. That +is, a subsequent match failure cannot backtrack into the assertion. +

+

+Non-atomic assertions are not supported by the alternative matching function +pcre2_dfa_match(). They are supported by JIT, but only if they do not +contain any control verbs such as (*ACCEPT). (This may change in future). Note +that assertions that appear as conditions for +conditional groups +(see below) must be atomic. +

+
SCAN SUBSTRING ASSERTIONS
+

+A special kind of assertion, not compatible with Perl, makes it possible to +check the contents of a captured substring by matching it with a subpattern. +Because this involves capturing, this feature is not supported by +pcre2_dfa_match(). +

+

+A scan substring assertion starts with the sequence (*scan_substring: or +(*scs: which is followed by a list of substring numbers (absolute or relative) +and/or substring names enclosed in single quotes or angle brackets, all within +parentheses. The rest of the item is the subpattern that is applied to the +substring, as shown in these examples: +

+  (*scan_substring:(1)...)
+  (*scs:(-2)...)
+  (*scs:('AB')...)
+  (*scs:(1,'AB',-2)...)
+
+The list of groups is checked in the order they are given, and it is the +contents of the first one that is found to be set that are scanned. When +PCRE2_DUPNAMES is set and there are ambiguous group names, all groups with the +same name are checked in numerical order. A scan substring assertion fails if +none of the groups it references have been set. +

+

+The pattern match on the substring is always anchored, that is, it must match +from the start of the substring. There is no "bumpalong" if it does not match +at the start. The end of the subject is temporarily reset to be the end of the +substring, so \Z, \z, and $ will match there. However, the start of the +subject is not reset. This means that ^ matches only if the substring is +actually at the start of the main subject, but it also means that lookbehind +assertions into what precedes the substring are possible. +

+

+Here is a very simple example: find a word that contains the rare (in English) +sequence of letters "rh" not at the start: +

+  \b(\w++)(*scs:(1).+rh)
+
+The first group captures a word which is then scanned by the second group. +This example does not actually need this heavyweight feature; the same match +can be achieved with: +
+  \b\w+?rh\w*\b
+
+When things are more complicated, however, scanning a captured substring can be +a useful way to describe the required match. For exmple, there is a rather +complicated pattern in the PCRE2 test data that checks an entire subject string +for a palindrome, that is, the sequence of letters is the same in both +directions. Suppose you want to search for individual words of two or more +characters such as "level" that are palindromes: +
+  (\b\w{2,}+\b)(*scs:(1)...palindrome-matching-pattern...)
+
+Within a substring scanning subpattern, references to other groups work as +normal. Capturing groups may appear, and will retain their values during +ongoing matching if the assertion succeeds. +

+
SCRIPT RUNS
+

+In concept, a script run is a sequence of characters that are all from the same +Unicode script such as Latin or Greek. However, because some scripts are +commonly used together, and because some diacritical and other marks are used +with multiple scripts, it is not that simple. There is a full description of +the rules that PCRE2 uses in the section entitled +"Script Runs" +in the +pcre2unicode +documentation. +

+

+If part of a pattern is enclosed between (*script_run: or (*sr: and a closing +parenthesis, it fails if the sequence of characters that it matches are not a +script run. After a failure, normal backtracking occurs. Script runs can be +used to detect spoofing attacks using characters that look the same, but are +from different scripts. The string "paypal.com" is an infamous example, where +the letters could be a mixture of Latin and Cyrillic. This pattern ensures that +the matched characters in a sequence of non-spaces that follow white space are +a script run: +

+  \s+(*sr:\S+)
+
+To be sure that they are all from the Latin script (for example), a lookahead +can be used: +
+  \s+(?=\p{Latin})(*sr:\S+)
+
+This works as long as the first character is expected to be a character in that +script, and not (for example) punctuation, which is allowed with any script. If +this is not the case, a more creative lookahead is needed. For example, if +digits, underscore, and dots are permitted at the start: +
+  \s+(?=[0-9_.]*\p{Latin})(*sr:\S+)
+
+
+

+

+In many cases, backtracking into a script run pattern fragment is not +desirable. The script run can employ an atomic group to prevent this. Because +this is a common requirement, a shorthand notation is provided by +(*atomic_script_run: or (*asr: +

+  (*asr:...) is the same as (*sr:(?>...))
+
+Note that the atomic group is inside the script run. Putting it outside would +not prevent backtracking into the script run pattern. +

+

+Support for script runs is not available if PCRE2 is compiled without Unicode +support. A compile-time error is given if any of the above constructs is +encountered. Script runs are not supported by the alternate matching function, +pcre2_dfa_match() because they use the same mechanism as capturing +parentheses. +

+

+Warning: The (*ACCEPT) control verb +(see below) +should not be used within a script run group, because it causes an immediate +exit from the group, bypassing the script run checking. +

+
CONDITIONAL GROUPS
+

+It is possible to cause the matching process to obey a pattern fragment +conditionally or to choose between two alternative fragments, depending on +the result of an assertion, or whether a specific capture group has +already been matched. The two possible forms of conditional group are: +

+  (?(condition)yes-pattern)
+  (?(condition)yes-pattern|no-pattern)
+
+If the condition is satisfied, the yes-pattern is used; otherwise the +no-pattern (if present) is used. An absent no-pattern is equivalent to an empty +string (it always matches). If there are more than two alternatives in the +group, a compile-time error occurs. Each of the two alternatives may itself +contain nested groups of any form, including conditional groups; the +restriction to two alternatives applies only at the level of the condition +itself. This pattern fragment is an example where the alternatives are complex: +
+  (?(1) (A|B|C) | (D | (?(2)E|F) | E) )
+
+
+

+

+There are five kinds of condition: references to capture groups, references to +recursion, two pseudo-conditions called DEFINE and VERSION, and assertions. +

+
+Checking for a used capture group by number +
+

+If the text between the parentheses consists of a sequence of digits, the +condition is true if a capture group of that number has previously matched. If +there is more than one capture group with the same number (see the earlier +section about duplicate group numbers), +the condition is true if any of them have matched. An alternative notation, +which is a PCRE2 extension, not supported by Perl, is to precede the digits +with a plus or minus sign. In this case, the group number is relative rather +than absolute. The most recently opened capture group (which could be enclosing +this condition) can be referenced by (?(-1), the next most recent by (?(-2), +and so on. Inside loops it can also make sense to refer to subsequent groups. +The next capture group to be opened can be referenced as (?(+1), and so on. The +value zero in any of these forms is not used; it provokes a compile-time error. +

+

+Consider the following pattern, which contains non-significant white space to +make it more readable (assume the PCRE2_EXTENDED option) and to divide it into +three parts for ease of discussion: +

+  ( \( )?    [^()]+    (?(1) \) )
+
+The first part matches an optional opening parenthesis, and if that +character is present, sets it as the first captured substring. The second part +matches one or more characters that are not parentheses. The third part is a +conditional group that tests whether or not the first capture group +matched. If it did, that is, if subject started with an opening parenthesis, +the condition is true, and so the yes-pattern is executed and a closing +parenthesis is required. Otherwise, since no-pattern is not present, the +conditional group matches nothing. In other words, this pattern matches a +sequence of non-parentheses, optionally enclosed in parentheses. +

+

+If you were embedding this pattern in a larger one, you could use a relative +reference: +

+  ...other stuff... ( \( )?    [^()]+    (?(-1) \) ) ...
+
+This makes the fragment independent of the parentheses in the larger pattern. +

+
+Checking for a used capture group by name +
+

+Perl uses the syntax (?(<name>)...) or (?('name')...) to test for a used +capture group by name. For compatibility with earlier versions of PCRE1, which +had this facility before Perl, the syntax (?(name)...) is also recognized. +Note, however, that undelimited names consisting of the letter R followed by +digits are ambiguous (see the following section). Rewriting the above example +to use a named group gives this: +

+  (?<OPEN> \( )?    [^()]+    (?(<OPEN>) \) )
+
+If the name used in a condition of this kind is a duplicate, the test is +applied to all groups of the same name, and is true if any one of them has +matched. +

+
+Checking for pattern recursion +
+

+"Recursion" in this sense refers to any subroutine-like call from one part of +the pattern to another, whether or not it is actually recursive. See the +sections entitled +"Recursive patterns" +and +"Groups as subroutines" +below for details of recursion and subroutine calls. +

+

+If a condition is the string (R), and there is no capture group with the name +R, the condition is true if matching is currently in a recursion or subroutine +call to the whole pattern or any capture group. If digits follow the letter R, +and there is no group with that name, the condition is true if the most recent +call is into a group with the given number, which must exist somewhere in the +overall pattern. This is a contrived example that is equivalent to a+b: +

+  ((?(R1)a+|(?1)b))
+
+However, in both cases, if there is a capture group with a matching name, the +condition tests for its being set, as described in the section above, instead +of testing for recursion. For example, creating a group with the name R1 by +adding (?<R1>) to the above pattern completely changes its meaning. +

+

+If a name preceded by ampersand follows the letter R, for example: +

+  (?(R&name)...)
+
+the condition is true if the most recent recursion is into a group of that name +(which must exist within the pattern). +

+

+This condition does not check the entire recursion stack. It tests only the +current level. If the name used in a condition of this kind is a duplicate, the +test is applied to all groups of the same name, and is true if any one of +them is the most recent recursion. +

+

+At "top level", all these recursion test conditions are false. +

+
+Defining capture groups for use by reference only +
+

+If the condition is the string (DEFINE), the condition is always false, even if +there is a group with the name DEFINE. In this case, there may be only one +alternative in the rest of the conditional group. It is always skipped if +control reaches this point in the pattern; the idea of DEFINE is that it can be +used to define subroutines that can be referenced from elsewhere. (The use of +subroutines +is described below.) For example, a pattern to match an IPv4 address such as +"192.168.23.245" could be written like this (ignore white space and line +breaks): +

+  (?(DEFINE) (?<byte> 2[0-4]\d | 25[0-5] | 1\d\d | [1-9]?\d) )
+  \b (?&byte) (\.(?&byte)){3} \b
+
+The first part of the pattern is a DEFINE group inside which another group +named "byte" is defined. This matches an individual component of an IPv4 +address (a number less than 256). When matching takes place, this part of the +pattern is skipped because DEFINE acts like a false condition. The rest of the +pattern uses references to the named group to match the four dot-separated +components of an IPv4 address, insisting on a word boundary at each end. +

+
+Checking the PCRE2 version +
+

+Programs that link with a PCRE2 library can check the version by calling +pcre2_config() with appropriate arguments. Users of applications that do +not have access to the underlying code cannot do this. A special "condition" +called VERSION exists to allow such users to discover which version of PCRE2 +they are dealing with by using this condition to match a string such as +"yesno". VERSION must be followed either by "=" or ">=" and a version number. +For example: +

+  (?(VERSION>=10.4)yes|no)
+
+This pattern matches "yes" if the PCRE2 version is greater or equal to 10.4, or +"no" otherwise. The fractional part of the version number may not contain more +than two digits. +

+
+Assertion conditions +
+

+If the condition is not in any of the above formats, it must be a parenthesized +assertion. This may be a positive or negative lookahead or lookbehind +assertion. However, it must be a traditional atomic assertion, not one of the +non-atomic assertions. +

+

+Consider this pattern, again containing non-significant white space, and with +the two alternatives on the second line: +

+  (?(?=[^a-z]*[a-z])
+  \d{2}-[a-z]{3}-\d{2}  |  \d{2}-\d{2}-\d{2} )
+
+The condition is a positive lookahead assertion that matches an optional +sequence of non-letters followed by a letter. In other words, it tests for the +presence of at least one letter in the subject. If a letter is found, the +subject is matched against the first alternative; otherwise it is matched +against the second. This pattern matches strings in one of the two forms +dd-aaa-dd or dd-dd-dd, where aaa are letters and dd are digits. +

+

+When an assertion that is a condition contains capture groups, any +capturing that occurs in a matching branch is retained afterwards, for both +positive and negative assertions, because matching always continues after the +assertion, whether it succeeds or fails. (Compare non-conditional assertions, +for which captures are retained only for positive assertions that succeed.) +

+
COMMENTS
+

+There are two ways of including comments in patterns that are processed by +PCRE2. In both cases, the start of the comment must not be in a character +class, nor in the middle of any other sequence of related characters such as +(?: or a group name or number or a Unicode property name. The characters that +make up a comment play no part in the pattern matching. +

+

+The sequence (?# marks the start of a comment that continues up to the next +closing parenthesis. Nested parentheses are not permitted. If the +PCRE2_EXTENDED or PCRE2_EXTENDED_MORE option is set, an unescaped # character +also introduces a comment, which in this case continues to immediately after +the next newline character or character sequence in the pattern. Which +characters are interpreted as newlines is controlled by an option passed to the +compiling function or by a special sequence at the start of the pattern, as +described in the section entitled +"Newline conventions" +above. Note that the end of this type of comment is a literal newline sequence +in the pattern; escape sequences that happen to represent a newline do not +count. For example, consider this pattern when PCRE2_EXTENDED is set, and the +default newline convention (a single linefeed character) is in force: +

+  abc #comment \n still comment
+
+On encountering the # character, pcre2_compile() skips along, looking for +a newline in the pattern. The sequence \n is still literal at this stage, so +it does not terminate the comment. Only an actual character with the code value +0x0a (the default newline) does so. +

+
RECURSIVE PATTERNS
+

+Consider the problem of matching a string in parentheses, allowing for +unlimited nested parentheses. Without the use of recursion, the best that can +be done is to use a pattern that matches up to some fixed depth of nesting. It +is not possible to handle an arbitrary nesting depth. +

+

+For some time, Perl has provided a facility that allows regular expressions to +recurse (amongst other things). It does this by interpolating Perl code in the +expression at run time, and the code can refer to the expression itself. A Perl +pattern using code interpolation to solve the parentheses problem can be +created like this: +

+  $re = qr{\( (?: (?>[^()]+) | (?p{$re}) )* \)}x;
+
+The (?p{...}) item interpolates Perl code at run time, and in this case refers +recursively to the pattern in which it appears. +

+

+Obviously, PCRE2 cannot support the interpolation of Perl code. Instead, it +supports special syntax for recursion of the entire pattern, and also for +individual capture group recursion. After its introduction in PCRE1 and Python, +this kind of recursion was subsequently introduced into Perl at release 5.10. +

+

+A special item that consists of (? followed by a number greater than zero and a +closing parenthesis is a recursive subroutine call of the capture group of the +given number, provided that it occurs inside that group. (If not, it is a +non-recursive subroutine +call, which is described in the next section.) The special item (?R) or (?0) is +a recursive call of the entire regular expression. +

+

+This PCRE2 pattern solves the nested parentheses problem (assume the +PCRE2_EXTENDED option is set so that white space is ignored): +

+  \( ( [^()]++ | (?R) )* \)
+
+First it matches an opening parenthesis. Then it matches any number of +substrings which can either be a sequence of non-parentheses, or a recursive +match of the pattern itself (that is, a correctly parenthesized substring). +Finally there is a closing parenthesis. Note the use of a possessive quantifier +to avoid backtracking into sequences of non-parentheses. +

+

+If this were part of a larger pattern, you would not want to recurse the entire +pattern, so instead you could use this: +

+  ( \( ( [^()]++ | (?1) )* \) )
+
+We have put the pattern into parentheses, and caused the recursion to refer to +them instead of the whole pattern. +

+

+In a larger pattern, keeping track of parenthesis numbers can be tricky. This +is made easier by the use of relative references. Instead of (?1) in the +pattern above you can write (?-2) to refer to the second most recently opened +parentheses preceding the recursion. In other words, a negative number counts +capturing parentheses leftwards from the point at which it is encountered. +

+

+Be aware however, that if +duplicate capture group numbers +are in use, relative references refer to the earliest group with the +appropriate number. Consider, for example: +

+  (?|(a)|(b)) (c) (?-2)
+
+The first two capture groups (a) and (b) are both numbered 1, and group (c) +is number 2. When the reference (?-2) is encountered, the second most recently +opened parentheses has the number 1, but it is the first such group (the (a) +group) to which the recursion refers. This would be the same if an absolute +reference (?1) was used. In other words, relative references are just a +shorthand for computing a group number. +

+

+It is also possible to refer to subsequent capture groups, by writing +references such as (?+2). However, these cannot be recursive because the +reference is not inside the parentheses that are referenced. They are always +non-recursive subroutine +calls, as described in the next section. +

+

+An alternative approach is to use named parentheses. The Perl syntax for this +is (?&name); PCRE1's earlier syntax (?P>name) is also supported. We could +rewrite the above example as follows: +

+  (?<pn> \( ( [^()]++ | (?&pn) )* \) )
+
+If there is more than one group with the same name, the earliest one is +used. +

+

+The example pattern that we have been looking at contains nested unlimited +repeats, and so the use of a possessive quantifier for matching strings of +non-parentheses is important when applying the pattern to strings that do not +match. For example, when this pattern is applied to +

+  (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()
+
+it yields "no match" quickly. However, if a possessive quantifier is not used, +the match runs for a very long time indeed because there are so many different +ways the + and * repeats can carve up the subject, and all have to be tested +before failure can be reported. +

+

+At the end of a match, the values of capturing parentheses are those from +the outermost level. If you want to obtain intermediate values, a callout +function can be used (see below and the +pcre2callout +documentation). If the pattern above is matched against +

+  (ab(cd)ef)
+
+the value for the inner capturing parentheses (numbered 2) is "ef", which is +the last value taken on at the top level. If a capture group is not matched at +the top level, its final captured value is unset, even if it was (temporarily) +set at a deeper level during the matching process. +

+

+Do not confuse the (?R) item with the condition (R), which tests for recursion. +Consider this pattern, which matches text in angle brackets, allowing for +arbitrary nesting. Only digits are allowed in nested brackets (that is, when +recursing), whereas any characters are permitted at the outer level. +

+  < (?: (?(R) \d++  | [^<>]*+) | (?R)) * >
+
+In this pattern, (?(R) is the start of a conditional group, with two different +alternatives for the recursive and non-recursive cases. The (?R) item is the +actual recursive call. +

+
+Differences in recursion processing between PCRE2 and Perl +
+

+Some former differences between PCRE2 and Perl no longer exist. +

+

+Before release 10.30, recursion processing in PCRE2 differed from Perl in that +a recursive subroutine call was always treated as an atomic group. That is, +once it had matched some of the subject string, it was never re-entered, even +if it contained untried alternatives and there was a subsequent matching +failure. (Historical note: PCRE implemented recursion before Perl did.) +

+

+Starting with release 10.30, recursive subroutine calls are no longer treated +as atomic. That is, they can be re-entered to try unused alternatives if there +is a matching failure later in the pattern. This is now compatible with the way +Perl works. If you want a subroutine call to be atomic, you must explicitly +enclose it in an atomic group. +

+

+Supporting backtracking into recursions simplifies certain types of recursive +pattern. For example, this pattern matches palindromic strings: +

+  ^((.)(?1)\2|.?)$
+
+The second branch in the group matches a single central character in the +palindrome when there are an odd number of characters, or nothing when there +are an even number of characters, but in order to work it has to be able to try +the second case when the rest of the pattern match fails. If you want to match +typical palindromic phrases, the pattern has to ignore all non-word characters, +which can be done like this: +
+  ^\W*+((.)\W*+(?1)\W*+\2|\W*+.?)\W*+$
+
+If run with the PCRE2_CASELESS option, this pattern matches phrases such as "A +man, a plan, a canal: Panama!". Note the use of the possessive quantifier *+ to +avoid backtracking into sequences of non-word characters. Without this, PCRE2 +takes a great deal longer (ten times or more) to match typical phrases, and +Perl takes so long that you think it has gone into a loop. +

+

+Another way in which PCRE2 and Perl used to differ in their recursion +processing is in the handling of captured values. Formerly in Perl, when a +group was called recursively or as a subroutine (see the next section), it +had no access to any values that were captured outside the recursion, whereas +in PCRE2 these values can be referenced. Consider this pattern: +

+  ^(.)(\1|a(?2))
+
+This pattern matches "bab". The first capturing parentheses match "b", then in +the second group, when the backreference \1 fails to match "b", the second +alternative matches "a" and then recurses. In the recursion, \1 does now match +"b" and so the whole match succeeds. This match used to fail in Perl, but in +later versions (I tried 5.024) it now works. +

+
GROUPS AS SUBROUTINES
+

+If the syntax for a recursive group call (either by number or by name) is used +outside the parentheses to which it refers, it operates a bit like a subroutine +in a programming language. More accurately, PCRE2 treats the referenced group +as an independent subpattern which it tries to match at the current matching +position. The called group may be defined before or after the reference. A +numbered reference can be absolute or relative, as in these examples: +

+  (...(absolute)...)...(?2)...
+  (...(relative)...)...(?-1)...
+  (...(?+1)...(relative)...
+
+An earlier example pointed out that the pattern +
+  (sens|respons)e and \1ibility
+
+matches "sense and sensibility" and "response and responsibility", but not +"sense and responsibility". If instead the pattern +
+  (sens|respons)e and (?1)ibility
+
+is used, it does match "sense and responsibility" as well as the other two +strings. Another example is given in the discussion of DEFINE above. +

+

+Like recursions, subroutine calls used to be treated as atomic, but this +changed at PCRE2 release 10.30, so backtracking into subroutine calls can now +occur. However, any capturing parentheses that are set during the subroutine +call revert to their previous values afterwards. +

+

+Processing options such as case-independence are fixed when a group is +defined, so if it is used as a subroutine, such options cannot be changed for +different calls. For example, consider this pattern: +

+  (abc)(?i:(?-1))
+
+It matches "abcabc". It does not match "abcABC" because the change of +processing option does not affect the called group. +

+

+The behaviour of +backtracking control verbs +in groups when called as subroutines is described in the section entitled +"Backtracking verbs in subroutines" +below. +

+
ONIGURUMA SUBROUTINE SYNTAX
+

+For compatibility with Oniguruma, the non-Perl syntax \g followed by a name or +a number enclosed either in angle brackets or single quotes, is an alternative +syntax for calling a group as a subroutine, possibly recursively. Here are two +of the examples used above, rewritten using this syntax: +

+  (?<pn> \( ( (?>[^()]+) | \g<pn> )* \) )
+  (sens|respons)e and \g'1'ibility
+
+PCRE2 supports an extension to Oniguruma: if a number is preceded by a +plus or a minus sign it is taken as a relative reference. For example: +
+  (abc)(?i:\g<-1>)
+
+Note that \g{...} (Perl syntax) and \g<...> (Oniguruma syntax) are not +synonymous. The former is a backreference; the latter is a subroutine call. +

+
CALLOUTS
+

+Perl has a feature whereby using the sequence (?{...}) causes arbitrary Perl +code to be obeyed in the middle of matching a regular expression. This makes it +possible, amongst other things, to extract different substrings that match the +same pair of parentheses when there is a repetition. +

+

+PCRE2 provides a similar feature, but of course it cannot obey arbitrary Perl +code. The feature is called "callout". The caller of PCRE2 provides an external +function by putting its entry point in a match context using the function +pcre2_set_callout(), and then passing that context to pcre2_match() +or pcre2_dfa_match(). If no match context is passed, or if the callout +entry point is set to NULL, callout points will be passed over silently during +matching. To disallow callouts in the pattern syntax, you may use the +PCRE2_EXTRA_NEVER_CALLOUT option. +

+

+Within a regular expression, (?C<arg>) indicates a point at which the external +function is to be called. There are two kinds of callout: those with a +numerical argument and those with a string argument. (?C) on its own with no +argument is treated as (?C0). A numerical argument allows the application to +distinguish between different callouts. String arguments were added for release +10.20 to make it possible for script languages that use PCRE2 to embed short +scripts within patterns in a similar way to Perl. +

+

+During matching, when PCRE2 reaches a callout point, the external function is +called. It is provided with the number or string argument of the callout, the +position in the pattern, and one item of data that is also set in the match +block. The callout function may cause matching to proceed, to backtrack, or to +fail. +

+

+By default, PCRE2 implements a number of optimizations at matching time, and +one side-effect is that sometimes callouts are skipped. If you need all +possible callouts to happen, you need to set options that disable the relevant +optimizations. More details, including a complete description of the +programming interface to the callout function, are given in the +pcre2callout +documentation. +

+
+Callouts with numerical arguments +
+

+If you just want to have a means of identifying different callout points, put a +number less than 256 after the letter C. For example, this pattern has two +callout points: +

+  (?C1)abc(?C2)def
+
+If the PCRE2_AUTO_CALLOUT flag is passed to pcre2_compile(), numerical +callouts are automatically installed before each item in the pattern. They are +all numbered 255. If there is a conditional group in the pattern whose +condition is an assertion, an additional callout is inserted just before the +condition. An explicit callout may also be set at this position, as in this +example: +
+  (?(?C9)(?=a)abc|def)
+
+Note that this applies only to assertion conditions, not to other types of +condition. +

+
+Callouts with string arguments +
+

+A delimited string may be used instead of a number as a callout argument. The +starting delimiter must be one of ` ' " ^ % # $ { and the ending delimiter is +the same as the start, except for {, where the ending delimiter is }. If the +ending delimiter is needed within the string, it must be doubled. For +example: +

+  (?C'ab ''c'' d')xyz(?C{any text})pqr
+
+The doubling is removed before the string is passed to the callout function. +

+
BACKTRACKING CONTROL
+

+There are a number of special "Backtracking Control Verbs" (to use Perl's +terminology) that modify the behaviour of backtracking during matching. They +are generally of the form (*VERB) or (*VERB:NAME). Some verbs take either form, +and may behave differently depending on whether or not a name argument is +present. The names are not required to be unique within the pattern. +

+

+By default, for compatibility with Perl, a name is any sequence of characters +that does not include a closing parenthesis. The name is not processed in +any way, and it is not possible to include a closing parenthesis in the name. +This can be changed by setting the PCRE2_ALT_VERBNAMES option, but the result +is no longer Perl-compatible. +

+

+When PCRE2_ALT_VERBNAMES is set, backslash processing is applied to verb names +and only an unescaped closing parenthesis terminates the name. However, the +only backslash items that are permitted are \Q, \E, and sequences such as +\x{100} that define character code points. Character type escapes such as \d +are faulted. +

+

+A closing parenthesis can be included in a name either as \) or between \Q +and \E. In addition to backslash processing, if the PCRE2_EXTENDED or +PCRE2_EXTENDED_MORE option is also set, unescaped whitespace in verb names is +skipped, and #-comments are recognized, exactly as in the rest of the pattern. +PCRE2_EXTENDED and PCRE2_EXTENDED_MORE do not affect verb names unless +PCRE2_ALT_VERBNAMES is also set. +

+

+The maximum length of a name is 255 in the 8-bit library and 65535 in the +16-bit and 32-bit libraries. If the name is empty, that is, if the closing +parenthesis immediately follows the colon, the effect is as if the colon were +not there. Any number of these verbs may occur in a pattern. Except for +(*ACCEPT), they may not be quantified. +

+

+Since these verbs are specifically related to backtracking, most of them can be +used only when the pattern is to be matched using the traditional matching +function or JIT, because they use backtracking algorithms. With the exception +of (*FAIL), which behaves like a failing negative assertion, the backtracking +control verbs cause an error if encountered by the DFA matching function. +

+

+The behaviour of these verbs in +repeated groups, +assertions, +and in +capture groups called as subroutines +(whether or not recursively) is documented below. +

+
+Optimizations that affect backtracking verbs +
+

+PCRE2 contains some optimizations that are used to speed up matching by running +some checks at the start of each match attempt. For example, it may know the +minimum length of matching subject, or that a particular character must be +present. When one of these optimizations bypasses the running of a match, any +included backtracking verbs will not, of course, be processed. You can suppress +the start-of-match optimizations by setting the PCRE2_NO_START_OPTIMIZE option +when calling pcre2_compile(), by calling pcre2_set_optimize() with a +PCRE2_START_OPTIMIZE_OFF directive, or by starting the pattern with +(*NO_START_OPT). There is more discussion of this option in the section +entitled +"Compiling a pattern" +in the +pcre2api +documentation. +

+

+Experiments with Perl suggest that it too has similar optimizations, and like +PCRE2, turning them off can change the result of a match. +

+
+Verbs that act immediately +
+

+The following verbs act as soon as they are encountered. +

+   (*ACCEPT) or (*ACCEPT:NAME)
+
+This verb causes the match to end successfully, skipping the remainder of the +pattern. However, when it is inside a capture group that is called as a +subroutine, only that group is ended successfully. Matching then continues +at the outer level. If (*ACCEPT) in triggered in a positive assertion, the +assertion succeeds; in a negative assertion, the assertion fails. +

+

+If (*ACCEPT) is inside capturing parentheses, the data so far is captured. For +example: +

+  A((?:A|B(*ACCEPT)|C)D)
+
+This matches "AB", "AAD", or "ACD"; when it matches "AB", "B" is captured by +the outer parentheses. +

+

+(*ACCEPT) is the only backtracking verb that is allowed to be quantified +because an ungreedy quantification with a minimum of zero acts only when a +backtrack happens. Consider, for example, +

+  (A(*ACCEPT)??B)C
+
+where A, B, and C may be complex expressions. After matching "A", the matcher +processes "BC"; if that fails, causing a backtrack, (*ACCEPT) is triggered and +the match succeeds. In both cases, all but C is captured. Whereas (*COMMIT) +(see below) means "fail on backtrack", a repeated (*ACCEPT) of this type means +"succeed on backtrack". +

+

+Warning: (*ACCEPT) should not be used within a script run group, because +it causes an immediate exit from the group, bypassing the script run checking. +

+  (*FAIL) or (*FAIL:NAME)
+
+This verb causes a matching failure, forcing backtracking to occur. It may be +abbreviated to (*F). It is equivalent to (?!) but easier to read. The Perl +documentation notes that it is probably useful only when combined with (?{}) or +(??{}). Those are, of course, Perl features that are not present in PCRE2. The +nearest equivalent is the callout feature, as for example in this pattern: +
+  a+(?C)(*FAIL)
+
+A match with the string "aaaa" always fails, but the callout is taken before +each backtrack happens (in this example, 10 times). +

+

+(*ACCEPT:NAME) and (*FAIL:NAME) behave the same as (*MARK:NAME)(*ACCEPT) and +(*MARK:NAME)(*FAIL), respectively, that is, a (*MARK) is recorded just before +the verb acts. +

+
+Recording which path was taken +
+

+There is one verb whose main purpose is to track how a match was arrived at, +though it also has a secondary use in conjunction with advancing the match +starting point (see (*SKIP) below). +

+  (*MARK:NAME) or (*:NAME)
+
+A name is always required with this verb. For all the other backtracking +control verbs, a NAME argument is optional. +

+

+When a match succeeds, the name of the last-encountered mark name on the +matching path is passed back to the caller as described in the section entitled +"Other information about the match" +in the +pcre2api +documentation. This applies to all instances of (*MARK) and other verbs, +including those inside assertions and atomic groups. However, there are +differences in those cases when (*MARK) is used in conjunction with (*SKIP) as +described below. +

+

+The mark name that was last encountered on the matching path is passed back. A +verb without a NAME argument is ignored for this purpose. Here is an example of +pcre2test output, where the "mark" modifier requests the retrieval and +outputting of (*MARK) data: +

+    re> /X(*MARK:A)Y|X(*MARK:B)Z/mark
+  data> XY
+   0: XY
+  MK: A
+  XZ
+   0: XZ
+  MK: B
+
+The (*MARK) name is tagged with "MK:" in this output, and in this example it +indicates which of the two alternatives matched. This is a more efficient way +of obtaining this information than putting each alternative in its own +capturing parentheses. +

+

+If a verb with a name is encountered in a positive assertion that is true, the +name is recorded and passed back if it is the last-encountered. This does not +happen for negative assertions or failing positive assertions. +

+

+After a partial match or a failed match, the last encountered name in the +entire match process is returned. For example: +

+    re> /X(*MARK:A)Y|X(*MARK:B)Z/mark
+  data> XP
+  No match, mark = B
+
+Note that in this unanchored example the mark is retained from the match +attempt that started at the letter "X" in the subject. Subsequent match +attempts starting at "P" and then with an empty string do not get as far as the +(*MARK) item, but nevertheless do not reset it. +

+

+If you are interested in (*MARK) values after failed matches, you should +probably either set the PCRE2_NO_START_OPTIMIZE option or call +pcre2_set_optimize() with a PCRE2_START_OPTIMIZE_OFF directive +(see above) +to ensure that the match is always attempted. +

+
+Verbs that act after backtracking +
+

+The following verbs do nothing when they are encountered. Matching continues +with what follows, but if there is a subsequent match failure, causing a +backtrack to the verb, a failure is forced. That is, backtracking cannot pass +to the left of the verb. However, when one of these verbs appears inside an +atomic group or in an atomic lookaround assertion that is true, its effect is +confined to that group, because once the group has been matched, there is never +any backtracking into it. Backtracking from beyond an atomic assertion or group +ignores the entire group, and seeks a preceding backtracking point. +

+

+These verbs differ in exactly what kind of failure occurs when backtracking +reaches them. The behaviour described below is what happens when the verb is +not in a subroutine or an assertion. Subsequent sections cover these special +cases. +

+  (*COMMIT) or (*COMMIT:NAME)
+
+This verb causes the whole match to fail outright if there is a later matching +failure that causes backtracking to reach it. Even if the pattern is +unanchored, no further attempts to find a match by advancing the starting point +take place. If (*COMMIT) is the only backtracking verb that is encountered, +once it has been passed pcre2_match() is committed to finding a match at +the current starting point, or not at all. For example: +
+  a+(*COMMIT)b
+
+This matches "xxaab" but not "aacaab". It can be thought of as a kind of +dynamic anchor, or "I've started, so I must finish." +

+

+The behaviour of (*COMMIT:NAME) is not the same as (*MARK:NAME)(*COMMIT). It is +like (*MARK:NAME) in that the name is remembered for passing back to the +caller. However, (*SKIP:NAME) searches only for names that are set with +(*MARK), ignoring those set by any of the other backtracking verbs. +

+

+If there is more than one backtracking verb in a pattern, a different one that +follows (*COMMIT) may be triggered first, so merely passing (*COMMIT) during a +match does not always guarantee that a match must be at this starting point. +

+

+Note that (*COMMIT) at the start of a pattern is not the same as an anchor, +unless PCRE2's start-of-match optimizations are turned off, as shown in this +output from pcre2test: +

+    re> /(*COMMIT)abc/
+  data> xyzabc
+   0: abc
+  data>
+  re> /(*COMMIT)abc/no_start_optimize
+  data> xyzabc
+  No match
+
+For the first pattern, PCRE2 knows that any match must start with "a", so the +optimization skips along the subject to "a" before applying the pattern to the +first set of data. The match attempt then succeeds. The second pattern disables +the optimization that skips along to the first character. The pattern is now +applied starting at "x", and so the (*COMMIT) causes the match to fail without +trying any other starting points. +
+  (*PRUNE) or (*PRUNE:NAME)
+
+This verb causes the match to fail at the current starting position in the +subject if there is a later matching failure that causes backtracking to reach +it. If the pattern is unanchored, the normal "bumpalong" advance to the next +starting character then happens. Backtracking can occur as usual to the left of +(*PRUNE), before it is reached, or when matching to the right of (*PRUNE), but +if there is no match to the right, backtracking cannot cross (*PRUNE). In +simple cases, the use of (*PRUNE) is just an alternative to an atomic group or +possessive quantifier, but there are some uses of (*PRUNE) that cannot be +expressed in any other way. In an anchored pattern (*PRUNE) has the same effect +as (*COMMIT). +

+

+The behaviour of (*PRUNE:NAME) is not the same as (*MARK:NAME)(*PRUNE). It is +like (*MARK:NAME) in that the name is remembered for passing back to the +caller. However, (*SKIP:NAME) searches only for names set with (*MARK), +ignoring those set by other backtracking verbs. +

+  (*SKIP)
+
+This verb, when given without a name, is like (*PRUNE), except that if the +pattern is unanchored, the "bumpalong" advance is not to the next character, +but to the position in the subject where (*SKIP) was encountered. (*SKIP) +signifies that whatever text was matched leading up to it cannot be part of a +successful match if there is a later mismatch. Consider: +
+  a+(*SKIP)b
+
+If the subject is "aaaac...", after the first match attempt fails (starting at +the first character in the string), the starting point skips on to start the +next attempt at "c". Note that a possessive quantifier does not have the same +effect as this example; although it would suppress backtracking during the +first match attempt, the second attempt would start at the second character +instead of skipping on to "c". +

+

+If (*SKIP) is used to specify a new starting position that is the same as the +starting position of the current match, or (by being inside a lookbehind) +earlier, the position specified by (*SKIP) is ignored, and instead the normal +"bumpalong" occurs. +

+  (*SKIP:NAME)
+
+When (*SKIP) has an associated name, its behaviour is modified. When such a +(*SKIP) is triggered, the previous path through the pattern is searched for the +most recent (*MARK) that has the same name. If one is found, the "bumpalong" +advance is to the subject position that corresponds to that (*MARK) instead of +to where (*SKIP) was encountered. If no (*MARK) with a matching name is found, +the (*SKIP) is ignored. +

+

+The search for a (*MARK) name uses the normal backtracking mechanism, which +means that it does not see (*MARK) settings that are inside atomic groups or +assertions, because they are never re-entered by backtracking. Compare the +following pcre2test examples: +

+    re> /a(?>(*MARK:X))(*SKIP:X)(*F)|(.)/
+  data: abc
+   0: a
+   1: a
+  data:
+    re> /a(?:(*MARK:X))(*SKIP:X)(*F)|(.)/
+  data: abc
+   0: b
+   1: b
+
+In the first example, the (*MARK) setting is in an atomic group, so it is not +seen when (*SKIP:X) triggers, causing the (*SKIP) to be ignored. This allows +the second branch of the pattern to be tried at the first character position. +In the second example, the (*MARK) setting is not in an atomic group. This +allows (*SKIP:X) to find the (*MARK) when it backtracks, and this causes a new +matching attempt to start at the second character. This time, the (*MARK) is +never seen because "a" does not match "b", so the matcher immediately jumps to +the second branch of the pattern. +

+

+Note that (*SKIP:NAME) searches only for names set by (*MARK:NAME). It ignores +names that are set by other backtracking verbs. +

+  (*THEN) or (*THEN:NAME)
+
+This verb causes a skip to the next innermost alternative when backtracking +reaches it. That is, it cancels any further backtracking within the current +alternative. Its name comes from the observation that it can be used for a +pattern-based if-then-else block: +
+  ( COND1 (*THEN) FOO | COND2 (*THEN) BAR | COND3 (*THEN) BAZ ) ...
+
+If the COND1 pattern matches, FOO is tried (and possibly further items after +the end of the group if FOO succeeds); on failure, the matcher skips to the +second alternative and tries COND2, without backtracking into COND1. If that +succeeds and BAR fails, COND3 is tried. If subsequently BAZ fails, there are no +more alternatives, so there is a backtrack to whatever came before the entire +group. If (*THEN) is not inside an alternation, it acts like (*PRUNE). +

+

+The behaviour of (*THEN:NAME) is not the same as (*MARK:NAME)(*THEN). It is +like (*MARK:NAME) in that the name is remembered for passing back to the +caller. However, (*SKIP:NAME) searches only for names set with (*MARK), +ignoring those set by other backtracking verbs. +

+

+A group that does not contain a | character is just a part of the enclosing +alternative; it is not a nested alternation with only one alternative. The +effect of (*THEN) extends beyond such a group to the enclosing alternative. +Consider this pattern, where A, B, etc. are complex pattern fragments that do +not contain any | characters at this level: +

+  A (B(*THEN)C) | D
+
+If A and B are matched, but there is a failure in C, matching does not +backtrack into A; instead it moves to the next alternative, that is, D. +However, if the group containing (*THEN) is given an alternative, it +behaves differently: +
+  A (B(*THEN)C | (*FAIL)) | D
+
+The effect of (*THEN) is now confined to the inner group. After a failure in C, +matching moves to (*FAIL), which causes the whole group to fail because there +are no more alternatives to try. In this case, matching does backtrack into A. +

+

+Note that a conditional group is not considered as having two alternatives, +because only one is ever used. In other words, the | character in a conditional +group has a different meaning. Ignoring white space, consider: +

+  ^.*? (?(?=a) a | b(*THEN)c )
+
+If the subject is "ba", this pattern does not match. Because .*? is ungreedy, +it initially matches zero characters. The condition (?=a) then fails, the +character "b" is matched, but "c" is not. At this point, matching does not +backtrack to .*? as might perhaps be expected from the presence of the | +character. The conditional group is part of the single alternative that +comprises the whole pattern, and so the match fails. (If there was a backtrack +into .*?, allowing it to match "b", the match would succeed.) +

+

+The verbs just described provide four different "strengths" of control when +subsequent matching fails. (*THEN) is the weakest, carrying on the match at the +next alternative. (*PRUNE) comes next, failing the match at the current +starting position, but allowing an advance to the next character (for an +unanchored pattern). (*SKIP) is similar, except that the advance may be more +than one character. (*COMMIT) is the strongest, causing the entire match to +fail. +

+
+More than one backtracking verb +
+

+If more than one backtracking verb is present in a pattern, the one that is +backtracked onto first acts. For example, consider this pattern, where A, B, +etc. are complex pattern fragments: +

+  (A(*COMMIT)B(*THEN)C|ABD)
+
+If A matches but B fails, the backtrack to (*COMMIT) causes the entire match to +fail. However, if A and B match, but C fails, the backtrack to (*THEN) causes +the next alternative (ABD) to be tried. This behaviour is consistent, but is +not always the same as Perl's. It means that if two or more backtracking verbs +appear in succession, all but the last of them has no effect. Consider this +example: +
+  ...(*COMMIT)(*PRUNE)...
+
+If there is a matching failure to the right, backtracking onto (*PRUNE) causes +it to be triggered, and its action is taken. There can never be a backtrack +onto (*COMMIT). +

+
+Backtracking verbs in repeated groups +
+

+PCRE2 sometimes differs from Perl in its handling of backtracking verbs in +repeated groups. For example, consider: +

+  /(a(*COMMIT)b)+ac/
+
+If the subject is "abac", Perl matches unless its optimizations are disabled, +but PCRE2 always fails because the (*COMMIT) in the second repeat of the group +acts. +

+
+Backtracking verbs in assertions +
+

+(*FAIL) in any assertion has its normal effect: it forces an immediate +backtrack. The behaviour of the other backtracking verbs depends on whether or +not the assertion is standalone or acting as the condition in a conditional +group. +

+

+(*ACCEPT) in a standalone positive assertion causes the assertion to succeed +without any further processing; captured strings and a mark name (if set) are +retained. In a standalone negative assertion, (*ACCEPT) causes the assertion to +fail without any further processing; captured substrings and any mark name are +discarded. +

+

+If the assertion is a condition, (*ACCEPT) causes the condition to be true for +a positive assertion and false for a negative one; captured substrings are +retained in both cases. +

+

+The remaining verbs act only when a later failure causes a backtrack to +reach them. This means that, for the Perl-compatible assertions, their effect +is confined to the assertion, because Perl lookaround assertions are atomic. A +backtrack that occurs after such an assertion is complete does not jump back +into the assertion. Note in particular that a (*MARK) name that is set in an +assertion is not "seen" by an instance of (*SKIP:NAME) later in the pattern. +

+

+PCRE2 now supports non-atomic positive assertions and also "scan substring" +assertions, as described in the sections entitled +"Non-atomic assertions" +and +"Scan substring assertions" +above. These assertions must be standalone (not used as conditions). They are +not Perl-compatible. For these assertions, a later backtrack does jump back +into the assertion, and therefore verbs such as (*COMMIT) can be triggered by +backtracks from later in the pattern. +

+

+The effect of (*THEN) is not allowed to escape beyond an assertion. If there +are no more branches to try, (*THEN) causes a positive assertion to be false, +and a negative assertion to be true. This behaviour differs from Perl when the +assertion has only one branch. +

+

+The other backtracking verbs are not treated specially if they appear in a +standalone positive assertion. In a conditional positive assertion, +backtracking (from within the assertion) into (*COMMIT), (*SKIP), or (*PRUNE) +causes the condition to be false. However, for both standalone and conditional +negative assertions, backtracking into (*COMMIT), (*SKIP), or (*PRUNE) causes +the assertion to be true, without considering any further alternative branches. +

+
+Backtracking verbs in subroutines +
+

+These behaviours occur whether or not the group is called recursively. +

+

+(*ACCEPT) in a group called as a subroutine causes the subroutine match to +succeed without any further processing. Matching then continues after the +subroutine call. Perl documents this behaviour. Perl's treatment of the other +verbs in subroutines is different in some cases. +

+

+(*FAIL) in a group called as a subroutine has its normal effect: it forces +an immediate backtrack. +

+

+(*COMMIT), (*SKIP), and (*PRUNE) cause the subroutine match to fail when +triggered by being backtracked to in a group called as a subroutine. There is +then a backtrack at the outer level. +

+

+(*THEN), when triggered, skips to the next alternative in the innermost +enclosing group that has alternatives (its normal behaviour). However, if there +is no such group within the subroutine's group, the subroutine match fails and +there is a backtrack at the outer level. +

+
EBCDIC ENVIRONMENTS
+

+Differences in the way PCRE behaves when it is running in an EBCDIC environment +are covered in this section. +

+
+Escape sequences +
+

+When PCRE2 is compiled in EBCDIC mode, \N{U+hhh..} is not supported. \a, \e, +\f, \n, \r, and \t generate the appropriate EBCDIC code values. The \c +escape is processed as specified for Perl in the perlebcdic document. The +only characters that are allowed after \c are A-Z, a-z, or one of @, [, \, ], +^, _, or ?. Any other character provokes a compile-time error. The sequence +\c@ encodes character code 0; after \c the letters (in either case) encode +characters 1-26 (hex 01 to hex 1A); [, \, ], ^, and _ encode characters 27-31 +(hex 1B to hex 1F), and \c? becomes either 255 (hex FF) or 95 (hex 5F). +

+

+Thus, apart from \c?, these escapes generate the same character code values as +they do in an ASCII or Unicode environment, though the meanings of the values +mostly differ. For example, \cG always generates code value 7, which is BEL in +ASCII but DEL in EBCDIC. +

+

+The sequence \c? generates DEL (127, hex 7F) in an ASCII environment, but +because 127 is not a control character in EBCDIC, Perl makes it generate the +APC character. Unfortunately, there are several variants of EBCDIC. In most of +them the APC character has the value 255 (hex FF), but in the one Perl calls +POSIX-BC its value is 95 (hex 5F). If certain other characters have POSIX-BC +values, PCRE2 makes \c? generate 95; otherwise it generates 255. +

+
+Character classes +
+

+In character classes there is a special case in EBCDIC environments for ranges +whose end points are both specified as literal letters in the same case. For +compatibility with Perl, EBCDIC code points within the range that are not +letters are omitted. For example, [h-k] matches only four characters, even +though the EBCDIC codes for h and k are 0x88 and 0x92, a range of 11 code +points. However, if the range is specified numerically, for example, +[\x88-\x92] or [h-\x92], all code points are included. +

+
SEE ALSO
+

+pcre2api(3), pcre2callout(3), pcre2matching(3), +pcre2syntax(3), pcre2(3). +

+
AUTHOR
+

+Philip Hazel +
+Retired from University Computing Service +
+Cambridge, England. +
+

+
REVISION
+

+Last updated: 27 November 2024 +
+Copyright © 1997-2024 University of Cambridge. +
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2perform.html b/miniconda3/share/doc/pcre2/html/pcre2perform.html new file mode 100644 index 0000000000000000000000000000000000000000..b595119ba88c78c0fc2799640090f9f37ad2915a --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2perform.html @@ -0,0 +1,280 @@ + + +pcre2perform specification + + +

pcre2perform man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+

+
PCRE2 PERFORMANCE
+

+Two aspects of performance are discussed below: memory usage and processing +time. The way you express your pattern as a regular expression can affect both +of them. +

+
COMPILED PATTERN MEMORY USAGE
+

+Patterns are compiled by PCRE2 into a reasonably efficient interpretive code, +so that most simple patterns do not use much memory for storing the compiled +version. However, there is one case where the memory usage of a compiled +pattern can be unexpectedly large. If a parenthesized group has a quantifier +with a minimum greater than 1 and/or a limited maximum, the whole group is +repeated in the compiled code. For example, the pattern +

+  (abc|def){2,4}
+
+is compiled as if it were +
+  (abc|def)(abc|def)((abc|def)(abc|def)?)?
+
+(Technical aside: It is done this way so that backtrack points within each of +the repetitions can be independently maintained.) +

+

+For regular expressions whose quantifiers use only small numbers, this is not +usually a problem. However, if the numbers are large, and particularly if such +repetitions are nested, the memory usage can become an embarrassment. For +example, the very simple pattern +

+  ((ab){1,1000}c){1,3}
+
+uses over 50KiB when compiled using the 8-bit library. When PCRE2 is +compiled with its default internal pointer size of two bytes, the size limit on +a compiled pattern is 65535 code units in the 8-bit and 16-bit libraries, and +this is reached with the above pattern if the outer repetition is increased +from 3 to 4. PCRE2 can be compiled to use larger internal pointers and thus +handle larger compiled patterns, but it is better to try to rewrite your +pattern to use less memory if you can. +

+

+One way of reducing the memory usage for such patterns is to make use of +PCRE2's +"subroutine" +facility. Re-writing the above pattern as +

+  ((ab)(?2){0,999}c)(?1){0,2}
+
+reduces the memory requirements to around 16KiB, and indeed it remains under +20KiB even with the outer repetition increased to 100. However, this kind of +pattern is not always exactly equivalent, because any captures within +subroutine calls are lost when the subroutine completes. If this is not a +problem, this kind of rewriting will allow you to process patterns that PCRE2 +cannot otherwise handle. The matching performance of the two different versions +of the pattern are roughly the same. (This applies from release 10.30 - things +were different in earlier releases.) +

+
STACK AND HEAP USAGE AT RUN TIME
+

+From release 10.30, the interpretive (non-JIT) version of pcre2_match() +uses very little system stack at run time. In earlier releases recursive +function calls could use a great deal of stack, and this could cause problems, +but this usage has been eliminated. Backtracking positions are now explicitly +remembered in memory frames controlled by the code. +

+

+The size of each frame depends on the size of pointer variables and the number +of capturing parenthesized groups in the pattern being matched. On a 64-bit +system the frame size for a pattern with no captures is 128 bytes. For each +capturing group the size increases by 16 bytes. +

+

+Until release 10.41, an initial 20KiB frames vector was allocated on the system +stack, but this still caused some issues for multi-thread applications where +each thread has a very small stack. From release 10.41 backtracking memory +frames are always held in heap memory. An initial heap allocation is obtained +the first time any match data block is passed to pcre2_match(). This is +remembered with the match data block and re-used if that block is used for +another match. It is freed when the match data block itself is freed. +

+

+The size of the initial block is the larger of 20KiB or ten times the pattern's +frame size, unless the heap limit is less than this, in which case the heap +limit is used. If the initial block proves to be too small during matching, it +is replaced by a larger block, subject to the heap limit. The heap limit is +checked only when a new block is to be allocated. Reducing the heap limit +between calls to pcre2_match() with the same match data block does not +affect the saved block. +

+

+In contrast to pcre2_match(), pcre2_dfa_match() does use recursive +function calls, but only for processing atomic groups, lookaround assertions, +and recursion within the pattern. The original version of the code used to +allocate quite large internal workspace vectors on the stack, which caused some +problems for some patterns in environments with small stacks. From release +10.32 the code for pcre2_dfa_match() has been re-factored to use heap +memory when necessary for internal workspace when recursing, though recursive +function calls are still used. +

+

+The "match depth" parameter can be used to limit the depth of function +recursion, and the "match heap" parameter to limit heap memory in +pcre2_dfa_match(). +

+
PROCESSING TIME
+

+Certain items in regular expression patterns are processed more efficiently +than others. It is more efficient to use a character class like [aeiou] than a +set of single-character alternatives such as (a|e|i|o|u). In general, the +simplest construction that provides the required behaviour is usually the most +efficient. Jeffrey Friedl's book contains a lot of useful general discussion +about optimizing regular expressions for efficient performance. This document +contains a few observations about PCRE2. +

+

+Using Unicode character properties (the \p, \P, and \X escapes) is slow, +because PCRE2 has to use a multi-stage table lookup whenever it needs a +character's property. If you can find an alternative pattern that does not use +character properties, it will probably be faster. +

+

+By default, the escape sequences \b, \d, \s, and \w, and the POSIX +character classes such as [:alpha:] do not use Unicode properties, partly for +backwards compatibility, and partly for performance reasons. However, you can +set the PCRE2_UCP option or start the pattern with (*UCP) if you want Unicode +character properties to be used. This can double the matching time for items +such as \d, when matched with pcre2_match(); the performance loss is +less with a DFA matching function, and in both cases there is not much +difference for \b. +

+

+When a pattern begins with .* not in atomic parentheses, nor in parentheses +that are the subject of a backreference, and the PCRE2_DOTALL option is set, +the pattern is implicitly anchored by PCRE2, since it can match only at the +start of a subject string. If the pattern has multiple top-level branches, they +must all be anchorable. The optimization can be disabled by the +PCRE2_NO_DOTSTAR_ANCHOR option, and is automatically disabled if the pattern +contains (*PRUNE) or (*SKIP). +

+

+If PCRE2_DOTALL is not set, PCRE2 cannot make this optimization, because the +dot metacharacter does not then match a newline, and if the subject string +contains newlines, the pattern may match from the character immediately +following one of them instead of from the very start. For example, the pattern +

+  .*second
+
+matches the subject "first\nand second" (where \n stands for a newline +character), with the match starting at the seventh character. In order to do +this, PCRE2 has to retry the match starting after every newline in the subject. +

+

+If you are using such a pattern with subject strings that do not contain +newlines, the best performance is obtained by setting PCRE2_DOTALL, or starting +the pattern with ^.* or ^.*? to indicate explicit anchoring. That saves PCRE2 +from having to scan along the subject looking for a newline to restart at. +

+

+Beware of patterns that contain nested indefinite repeats. These can take a +long time to run when applied to a string that does not match. Consider the +pattern fragment +

+  ^(a+)*
+
+This can match "aaaa" in 16 different ways, and this number increases very +rapidly as the string gets longer. (The * repeat can match 0, 1, 2, 3, or 4 +times, and for each of those cases other than 0 or 4, the + repeats can match +different numbers of times.) When the remainder of the pattern is such that the +entire match is going to fail, PCRE2 has in principle to try every possible +variation, and this can take an extremely long time, even for relatively short +strings. +

+

+An optimization catches some of the more simple cases such as +

+  (a+)*b
+
+where a literal character follows. Before embarking on the standard matching +procedure, PCRE2 checks that there is a "b" later in the subject string, and if +there is not, it fails the match immediately. However, when there is no +following literal this optimization cannot be used. You can see the difference +by comparing the behaviour of +
+  (a+)*\d
+
+with the pattern above. The former gives a failure almost instantly when +applied to a whole line of "a" characters, whereas the latter takes an +appreciable time with strings longer than about 20 characters. +

+

+In many cases, the solution to this kind of performance issue is to use an +atomic group or a possessive quantifier. This can often reduce memory +requirements as well. As another example, consider this pattern: +

+  ([^<]|<(?!inet))+
+
+It matches from wherever it starts until it encounters "<inet" or the end of +the data, and is the kind of pattern that might be used when processing an XML +file. Each iteration of the outer parentheses matches either one character that +is not "<" or a "<" that is not followed by "inet". However, each time a +parenthesis is processed, a backtracking position is passed, so this +formulation uses a memory frame for each matched character. For a long string, +a lot of memory is required. Consider now this rewritten pattern, which matches +exactly the same strings: +
+  ([^<]++|<(?!inet))+
+
+This runs much faster, because sequences of characters that do not contain "<" +are "swallowed" in one item inside the parentheses, and a possessive quantifier +is used to stop any backtracking into the runs of non-"<" characters. This +version also uses a lot less memory because entry to a new set of parentheses +happens only when a "<" character that is not followed by "inet" is encountered +(and we assume this is relatively rare). +

+

+This example shows that one way of optimizing performance when matching long +subject strings is to write repeated parenthesized subpatterns to match more +than one character whenever possible. +

+
+SETTING RESOURCE LIMITS +
+

+You can set limits on the amount of processing that takes place when matching, +and on the amount of heap memory that is used. The default values of the limits +are very large, and unlikely ever to operate. They can be changed when PCRE2 is +built, and they can also be set when pcre2_match() or +pcre2_dfa_match() is called. For details of these interfaces, see the +pcre2build +documentation and the section entitled +"The match context" +in the +pcre2api +documentation. +

+

+The pcre2test test program has a modifier called "find_limits" which, if +applied to a subject line, causes it to find the smallest limits that allow a +pattern to match. This is done by repeatedly matching with different limits. +

+
AUTHOR
+

+Philip Hazel +
+Retired from University Computing Service +
+Cambridge, England. +
+

+
REVISION
+

+Last updated: 06 December 2022 +
+Copyright © 1997-2022 University of Cambridge. +
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2posix.html b/miniconda3/share/doc/pcre2/html/pcre2posix.html new file mode 100644 index 0000000000000000000000000000000000000000..bc60c3b798ce85e82b8e97caafe9e0ac4e7f325f --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2posix.html @@ -0,0 +1,379 @@ + + +pcre2posix specification + + +

pcre2posix man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+

+
SYNOPSIS
+

+#include <pcre2posix.h> +

+

+int pcre2_regcomp(regex_t *preg, const char *pattern, + int cflags); +
+
+int pcre2_regexec(const regex_t *preg, const char *string, + size_t nmatch, regmatch_t pmatch[], int eflags); +
+
+size_t pcre2_regerror(int errcode, const regex_t *preg, + char *errbuf, size_t errbuf_size); +
+
+void pcre2_regfree(regex_t *preg); +

+
DESCRIPTION
+

+This set of functions provides a POSIX-style API for the PCRE2 regular +expression 8-bit library. There are no POSIX-style wrappers for PCRE2's 16-bit +and 32-bit libraries. See the +pcre2api +documentation for a description of PCRE2's native API, which contains much +additional functionality. +

+

+IMPORTANT NOTE: The functions described here are NOT thread-safe, and +should not be used in multi-threaded applications. They are also limited to +processing subjects that are not bigger than 2GB. Use the native API instead. +

+

+These functions are wrapper functions that ultimately call the PCRE2 native +API. Their prototypes are defined in the pcre2posix.h header file, and +they all have unique names starting with pcre2_. However, the +pcre2posix.h header also contains macro definitions that convert the +standard POSIX names such regcomp() into pcre2_regcomp() etc. This +means that a program can use the usual POSIX names without running the risk of +accidentally linking with POSIX functions from a different library. +

+

+On Unix-like systems the PCRE2 POSIX library is called libpcre2-posix, so +can be accessed by adding -lpcre2-posix to the command for linking an +application. Because the POSIX functions call the native ones, it is also +necessary to add -lpcre2-8. +

+

+On Windows systems, if you are linking to a DLL version of the library, it is +recommended that PCRE2POSIX_SHARED is defined before including the +pcre2posix.h header, as it will allow for a more efficient way to +invoke the functions by adding the __declspec(dllimport) decorator. +

+

+Although they were not defined as prototypes in pcre2posix.h, releases +10.33 to 10.36 of the library contained functions with the POSIX names +regcomp() etc. These simply passed their arguments to the PCRE2 +functions. These functions were provided for backwards compatibility with +earlier versions of PCRE2, which had only POSIX names. However, this has proved +troublesome in situations where a program links with several libraries, some of +which use PCRE2's POSIX interface while others use the real POSIX functions. +For this reason, the POSIX names have been removed since release 10.37. +

+

+Calling the header file pcre2posix.h avoids any conflict with other POSIX +libraries. It can, of course, be renamed or aliased as regex.h, which is +the "correct" name, if there is no clash. It provides two structure types, +regex_t for compiled internal forms, and regmatch_t for returning +captured substrings. It also defines some constants whose names start with +"REG_"; these are used for setting options and identifying error codes. +

+
USING THE POSIX FUNCTIONS
+

+Note that these functions are just POSIX-style wrappers for PCRE2's native API. +They do not give POSIX regular expression behaviour, and they are not +thread-safe or even POSIX compatible. +

+

+Those POSIX option bits that can reasonably be mapped to PCRE2 native options +have been implemented. In addition, the option REG_EXTENDED is defined with the +value zero. This has no effect, but since programs that are written to the +POSIX interface often use it, this makes it easier to slot in PCRE2 as a +replacement library. Other POSIX options are not even defined. +

+

+There are also some options that are not defined by POSIX. These have been +added at the request of users who want to make use of certain PCRE2-specific +features via the POSIX calling interface or to add BSD or GNU functionality. +

+

+When PCRE2 is called via these functions, it is only the API that is POSIX-like +in style. The syntax and semantics of the regular expressions themselves are +still those of Perl, subject to the setting of various PCRE2 options, as +described below. "POSIX-like in style" means that the API approximates to the +POSIX definition; it is not fully POSIX-compatible, and in multi-unit encoding +domains it is probably even less compatible. +

+

+The descriptions below use the actual names of the functions, but, as described +above, the standard POSIX names (without the pcre2_ prefix) may also be +used. +

+
COMPILING A PATTERN
+

+The function pcre2_regcomp() is called to compile a pattern into an +internal form. By default, the pattern is a C string terminated by a binary +zero (but see REG_PEND below). The preg argument is a pointer to a +regex_t structure that is used as a base for storing information about +the compiled regular expression. It is also used for input when REG_PEND is +set. The regex_t structure used by pcre2_regcomp() is defined in +pcre2posix.h and is not the same as the structure used by other libraries +that provide POSIX-style matching. +

+

+The argument cflags is either zero, or contains one or more of the bits +defined by the following macros: +

+  REG_DOTALL
+
+The PCRE2_DOTALL option is set when the regular expression is passed for +compilation to the native function. Note that REG_DOTALL is not part of the +POSIX standard. +
+  REG_ICASE
+
+The PCRE2_CASELESS option is set when the regular expression is passed for +compilation to the native function. +
+  REG_NEWLINE
+
+The PCRE2_MULTILINE option is set when the regular expression is passed for +compilation to the native function. Note that this does not mimic the +defined POSIX behaviour for REG_NEWLINE (see the following section). +
+  REG_NOSPEC
+
+The PCRE2_LITERAL option is set when the regular expression is passed for +compilation to the native function. This disables all meta characters in the +pattern, causing it to be treated as a literal string. The only other options +that are allowed with REG_NOSPEC are REG_ICASE, REG_NOSUB, REG_PEND, and +REG_UTF. Note that REG_NOSPEC is not part of the POSIX standard. +
+  REG_NOSUB
+
+When a pattern that is compiled with this flag is passed to +pcre2_regexec() for matching, the nmatch and pmatch arguments +are ignored, and no captured strings are returned. Versions of the PCRE2 library +prior to 10.22 used to set the PCRE2_NO_AUTO_CAPTURE compile option, but this +no longer happens because it disables the use of backreferences. +
+  REG_PEND
+
+If this option is set, the reg_endp field in the preg structure +(which has the type const char *) must be set to point to the character beyond +the end of the pattern before calling pcre2_regcomp(). The pattern itself +may now contain binary zeros, which are treated as data characters. Without +REG_PEND, a binary zero terminates the pattern and the re_endp field is +ignored. This is a GNU extension to the POSIX standard and should be used with +caution in software intended to be portable to other systems. +
+  REG_UCP
+
+The PCRE2_UCP option is set when the regular expression is passed for +compilation to the native function. This causes PCRE2 to use Unicode properties +when matching \d, \w, etc., instead of just recognizing ASCII values. Note +that REG_UCP is not part of the POSIX standard. +
+  REG_UNGREEDY
+
+The PCRE2_UNGREEDY option is set when the regular expression is passed for +compilation to the native function. Note that REG_UNGREEDY is not part of the +POSIX standard. +
+  REG_UTF
+
+The PCRE2_UTF option is set when the regular expression is passed for +compilation to the native function. This causes the pattern itself and all data +strings used for matching it to be treated as UTF-8 strings. Note that REG_UTF +is not part of the POSIX standard. +

+

+In the absence of these flags, no options are passed to the native function. +This means that the regex is compiled with PCRE2 default semantics. In +particular, the way it handles newline characters in the subject string is the +Perl way, not the POSIX way. Note that setting PCRE2_MULTILINE has only +some of the effects specified for REG_NEWLINE. It does not affect the way +newlines are matched by the dot metacharacter (they are not) or by a negative +class such as [^a] (they are). +

+

+The yield of pcre2_regcomp() is zero on success, and non-zero otherwise. +The preg structure is filled in on success, and one other member of the +structure (as well as re_endp) is public: re_nsub contains the +number of capturing subpatterns in the regular expression. Various error codes +are defined in the header file. +

+

+NOTE: If the yield of pcre2_regcomp() is non-zero, you must not attempt +to use the contents of the preg structure. If, for example, you pass it +to pcre2_regexec(), the result is undefined and your program is likely to +crash. +

+
MATCHING NEWLINE CHARACTERS
+

+This area is not simple, because POSIX and Perl take different views of things. +It is not possible to get PCRE2 to obey POSIX semantics, but then PCRE2 was +never intended to be a POSIX engine. The following table lists the different +possibilities for matching newline characters in Perl and PCRE2: +

+                          Default   Change with
+
+  . matches newline          no     PCRE2_DOTALL
+  newline matches [^a]       yes    not changeable
+  $ matches \n at end        yes    PCRE2_DOLLAR_ENDONLY
+  $ matches \n in middle     no     PCRE2_MULTILINE
+  ^ matches \n in middle     no     PCRE2_MULTILINE
+
+This is the equivalent table for a POSIX-compatible pattern matcher: +
+                          Default   Change with
+
+  . matches newline          yes    REG_NEWLINE
+  newline matches [^a]       yes    REG_NEWLINE
+  $ matches \n at end        no     REG_NEWLINE
+  $ matches \n in middle     no     REG_NEWLINE
+  ^ matches \n in middle     no     REG_NEWLINE
+
+This behaviour is not what happens when PCRE2 is called via its POSIX +API. By default, PCRE2's behaviour is the same as Perl's, except that there is +no equivalent for PCRE2_DOLLAR_ENDONLY in Perl. In both PCRE2 and Perl, there +is no way to stop newline from matching [^a]. +

+

+Default POSIX newline handling can be obtained by setting PCRE2_DOTALL and +PCRE2_DOLLAR_ENDONLY when calling pcre2_compile() directly, but there is +no way to make PCRE2 behave exactly as for the REG_NEWLINE action. When using +the POSIX API, passing REG_NEWLINE to PCRE2's pcre2_regcomp() function +causes PCRE2_MULTILINE to be passed to pcre2_compile(), and REG_DOTALL +passes PCRE2_DOTALL. There is no way to pass PCRE2_DOLLAR_ENDONLY. +

+
MATCHING A PATTERN
+

+The function pcre2_regexec() is called to match a compiled pattern +preg against a given string, which is by default terminated by a +zero byte (but see REG_STARTEND below), subject to the options in eflags. +These can be: +

+  REG_NOTBOL
+
+The PCRE2_NOTBOL option is set when calling the underlying PCRE2 matching +function. +
+  REG_NOTEMPTY
+
+The PCRE2_NOTEMPTY option is set when calling the underlying PCRE2 matching +function. Note that REG_NOTEMPTY is not part of the POSIX standard. However, +setting this option can give more POSIX-like behaviour in some situations. +
+  REG_NOTEOL
+
+The PCRE2_NOTEOL option is set when calling the underlying PCRE2 matching +function. +
+  REG_STARTEND
+
+When this option is set, the subject string starts at string + +pmatch[0].rm_so and ends at string + pmatch[0].rm_eo, which +should point to the first character beyond the string. There may be binary +zeros within the subject string, and indeed, using REG_STARTEND is the only +way to pass a subject string that contains a binary zero. +

+

+Whatever the value of pmatch[0].rm_so, the offsets of the matched string +and any captured substrings are still given relative to the start of +string itself. (Before PCRE2 release 10.30 these were given relative to +string + pmatch[0].rm_so, but this differs from other +implementations.) +

+

+This is a BSD extension, compatible with but not specified by IEEE Standard +1003.2 (POSIX.2), and should be used with caution in software intended to be +portable to other systems. Note that a non-zero rm_so does not imply +REG_NOTBOL; REG_STARTEND affects only the location and length of the string, +not how it is matched. Setting REG_STARTEND and passing pmatch as NULL +are mutually exclusive; the error REG_INVARG is returned. +

+

+If the pattern was compiled with the REG_NOSUB flag, no data about any matched +strings is returned. The nmatch and pmatch arguments of +pcre2_regexec() are ignored (except possibly as input for REG_STARTEND). +

+

+The value of nmatch may be zero, and the value pmatch may be NULL +(unless REG_STARTEND is set); in both these cases no data about any matched +strings is returned. +

+

+Otherwise, the portion of the string that was matched, and also any captured +substrings, are returned via the pmatch argument, which points to an +array of nmatch structures of type regmatch_t, containing the +members rm_so and rm_eo. These contain the byte offset to the first +character of each substring and the offset to the first character after the end +of each substring, respectively. The 0th element of the vector relates to the +entire portion of string that was matched; subsequent elements relate to +the capturing subpatterns of the regular expression. Unused entries in the +array have both structure members set to -1. +

+

+regmatch_t as well as the regoff_t typedef it uses are defined in +pcre2posix.h and are not warranted to have the same size or layout as other +similarly named types from other libraries that provide POSIX-style matching. +

+

+A successful match yields a zero return; various error codes are defined in the +header file, of which REG_NOMATCH is the "expected" failure code. +

+
ERROR MESSAGES
+

+The pcre2_regerror() function maps a non-zero errorcode from either +pcre2_regcomp() or pcre2_regexec() to a printable message. If +preg is not NULL, the error should have arisen from the use of that +structure. A message terminated by a binary zero is placed in errbuf. If +the buffer is too short, only the first errbuf_size - 1 characters of the +error message are used. The yield of the function is the size of buffer needed +to hold the whole message, including the terminating zero. This value is +greater than errbuf_size if the message was truncated. +

+
MEMORY USAGE
+

+Compiling a regular expression causes memory to be allocated and associated +with the preg structure. The function pcre2_regfree() frees all +such memory, after which preg may no longer be used as a compiled +expression. +

+
AUTHOR
+

+Philip Hazel +
+Retired from University Computing Service +
+Cambridge, England. +
+

+
REVISION
+

+Last updated: 27 November 2024 +
+Copyright © 1997-2024 University of Cambridge. +
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2sample.html b/miniconda3/share/doc/pcre2/html/pcre2sample.html new file mode 100644 index 0000000000000000000000000000000000000000..0903f04f99b3f52a7dec6d971c8386d92559d104 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2sample.html @@ -0,0 +1,110 @@ + + +pcre2sample specification + + +

pcre2sample man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+PCRE2 SAMPLE PROGRAM +
+

+A simple, complete demonstration program to get you started with using PCRE2 is +supplied in the file pcre2demo.c in the src directory in the PCRE2 +distribution. A listing of this program is given in the +pcre2demo +documentation. If you do not have a copy of the PCRE2 distribution, you can +save this listing to re-create the contents of pcre2demo.c. +

+

+The demonstration program compiles the regular expression that is its +first argument, and matches it against the subject string in its second +argument. No PCRE2 options are set, and default character tables are used. If +matching succeeds, the program outputs the portion of the subject that matched, +together with the contents of any captured substrings. +

+

+If the -g option is given on the command line, the program then goes on to +check for further matches of the same regular expression in the same subject +string. The logic is a little bit tricky because of the possibility of matching +an empty string. Comments in the code explain what is going on. +

+

+The code in pcre2demo.c is an 8-bit program that uses the PCRE2 8-bit +library. It handles strings and characters that are stored in 8-bit code units. +By default, one character corresponds to one code unit, but if the pattern +starts with "(*UTF)", both it and the subject are treated as UTF-8 strings, +where characters may occupy multiple code units. +

+

+If PCRE2 is installed in the standard include and library directories for your +operating system, you should be able to compile the demonstration program using +a command like this: +

+  cc -o pcre2demo pcre2demo.c -lpcre2-8
+
+If PCRE2 is installed elsewhere, you may need to add additional options to the +command line. For example, on a Unix-like system that has PCRE2 installed in +/usr/local, you can compile the demonstration program using a command +like this: +
+  cc -o pcre2demo -I/usr/local/include pcre2demo.c -L/usr/local/lib -lpcre2-8
+
+Once you have built the demonstration program, you can run simple tests like +this: +
+  ./pcre2demo 'cat|dog' 'the cat sat on the mat'
+  ./pcre2demo -g 'cat|dog' 'the dog sat on the cat'
+
+Note that there is a much more comprehensive test program, called +pcre2test, +which supports many more facilities for testing regular expressions using all +three PCRE2 libraries (8-bit, 16-bit, and 32-bit, though not all three need be +installed). The +pcre2demo +program is provided as a relatively simple coding example. +

+

+If you try to run +pcre2demo +when PCRE2 is not installed in the standard library directory, you may get an +error like this on some operating systems (e.g. Solaris): +

+  ld.so.1: pcre2demo: fatal: libpcre2-8.so.0: open failed: No such file or directory
+
+This is caused by the way shared library support works on those systems. You +need to add +
+  -R/usr/local/lib
+
+(for example) to the compile command to get round this problem. +

+
+AUTHOR +
+

+Philip Hazel +
+Retired from University Computing Service +
+Cambridge, England. +
+

+
+REVISION +
+

+Last updated: 14 November 2023 +
+Copyright © 1997-2016 University of Cambridge. +
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2serialize.html b/miniconda3/share/doc/pcre2/html/pcre2serialize.html new file mode 100644 index 0000000000000000000000000000000000000000..d189bde2b636167784fe8cfd7b822778d09d209b --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2serialize.html @@ -0,0 +1,212 @@ + + +pcre2serialize specification + + +

pcre2serialize man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+

+
SAVING AND RE-USING PRECOMPILED PCRE2 PATTERNS
+

+int32_t pcre2_serialize_decode(pcre2_code **codes, + int32_t number_of_codes, const uint8_t *bytes, + pcre2_general_context *gcontext); +
+
+int32_t pcre2_serialize_encode(const pcre2_code **codes, + int32_t number_of_codes, uint8_t **serialized_bytes, + PCRE2_SIZE *serialized_size, pcre2_general_context *gcontext); +
+
+void pcre2_serialize_free(uint8_t *bytes); +
+
+int32_t pcre2_serialize_get_number_of_codes(const uint8_t *bytes); +
+
+If you are running an application that uses a large number of regular +expression patterns, it may be useful to store them in a precompiled form +instead of having to compile them every time the application is run. However, +if you are using the just-in-time optimization feature, it is not possible to +save and reload the JIT data, because it is position-dependent. The host on +which the patterns are reloaded must be running the same version of PCRE2, with +the same code unit width, and must also have the same endianness, pointer width +and PCRE2_SIZE type. For example, patterns compiled on a 32-bit system using +PCRE2's 16-bit library cannot be reloaded on a 64-bit system, nor can they be +reloaded using the 8-bit library. +

+

+Note that "serialization" in PCRE2 does not convert compiled patterns to an +abstract format like Java or .NET serialization. The serialized output is +really just a bytecode dump, which is why it can only be reloaded in the same +environment as the one that created it. Hence the restrictions mentioned above. +Applications that are not statically linked with a fixed version of PCRE2 must +be prepared to recompile patterns from their sources, in order to be immune to +PCRE2 upgrades. +

+
SECURITY CONCERNS
+

+The facility for saving and restoring compiled patterns is intended for use +within individual applications. As such, the data supplied to +pcre2_serialize_decode() is expected to be trusted data, not data from +arbitrary external sources. There is only some simple consistency checking, not +complete validation of what is being re-loaded. Corrupted data may cause +undefined results. For example, if the length field of a pattern in the +serialized data is corrupted, the deserializing code may read beyond the end of +the byte stream that is passed to it. +

+
SAVING COMPILED PATTERNS
+

+Before compiled patterns can be saved they must be serialized, which in PCRE2 +means converting the pattern to a stream of bytes. A single byte stream may +contain any number of compiled patterns, but they must all use the same +character tables. A single copy of the tables is included in the byte stream +(its size is 1088 bytes). For more details of character tables, see the +section on locale support +in the +pcre2api +documentation. +

+

+The function pcre2_serialize_encode() creates a serialized byte stream +from a list of compiled patterns. Its first two arguments specify the list, +being a pointer to a vector of pointers to compiled patterns, and the length of +the vector. The third and fourth arguments point to variables which are set to +point to the created byte stream and its length, respectively. The final +argument is a pointer to a general context, which can be used to specify custom +memory management functions. If this argument is NULL, malloc() is used +to obtain memory for the byte stream. The yield of the function is the number +of serialized patterns, or one of the following negative error codes: +

+  PCRE2_ERROR_BADDATA      the number of patterns is zero or less
+  PCRE2_ERROR_BADMAGIC     mismatch of id bytes in one of the patterns
+  PCRE2_ERROR_NOMEMORY     memory allocation failed
+  PCRE2_ERROR_MIXEDTABLES  the patterns do not all use the same tables
+  PCRE2_ERROR_NULL         the 1st, 3rd, or 4th argument is NULL
+
+PCRE2_ERROR_BADMAGIC means either that a pattern's code has been corrupted, or +that a slot in the vector does not point to a compiled pattern. +

+

+Once a set of patterns has been serialized you can save the data in any +appropriate manner. Here is sample code that compiles two patterns and writes +them to a file. It assumes that the variable fd refers to a file that is +open for output. The error checking that should be present in a real +application has been omitted for simplicity. +

+  int errorcode;
+  uint8_t *bytes;
+  PCRE2_SIZE erroroffset;
+  PCRE2_SIZE bytescount;
+  pcre2_code *list_of_codes[2];
+  list_of_codes[0] = pcre2_compile("first pattern",
+    PCRE2_ZERO_TERMINATED, 0, &errorcode, &erroroffset, NULL);
+  list_of_codes[1] = pcre2_compile("second pattern",
+    PCRE2_ZERO_TERMINATED, 0, &errorcode, &erroroffset, NULL);
+  errorcode = pcre2_serialize_encode(list_of_codes, 2, &bytes,
+    &bytescount, NULL);
+  errorcode = fwrite(bytes, 1, bytescount, fd);
+
+Note that the serialized data is binary data that may contain any of the 256 +possible byte values. On systems that make a distinction between binary and +non-binary data, be sure that the file is opened for binary output. +

+

+Serializing a set of patterns leaves the original data untouched, so they can +still be used for matching. Their memory must eventually be freed in the usual +way by calling pcre2_code_free(). When you have finished with the byte +stream, it too must be freed by calling pcre2_serialize_free(). If this +function is called with a NULL argument, it returns immediately without doing +anything. +

+
RE-USING PRECOMPILED PATTERNS
+

+In order to re-use a set of saved patterns you must first make the serialized +byte stream available in main memory (for example, by reading from a file). The +management of this memory block is up to the application. You can use the +pcre2_serialize_get_number_of_codes() function to find out how many +compiled patterns are in the serialized data without actually decoding the +patterns: +

+  uint8_t *bytes = <serialized data>;
+  int32_t number_of_codes = pcre2_serialize_get_number_of_codes(bytes);
+
+The pcre2_serialize_decode() function reads a byte stream and recreates +the compiled patterns in new memory blocks, setting pointers to them in a +vector. The first two arguments are a pointer to a suitable vector and its +length, and the third argument points to a byte stream. The final argument is a +pointer to a general context, which can be used to specify custom memory +management functions for the decoded patterns. If this argument is NULL, +malloc() and free() are used. After deserialization, the byte +stream is no longer needed and can be discarded. +
+  pcre2_code *list_of_codes[2];
+  uint8_t *bytes = <serialized data>;
+  int32_t number_of_codes =
+    pcre2_serialize_decode(list_of_codes, 2, bytes, NULL);
+
+If the vector is not large enough for all the patterns in the byte stream, it +is filled with those that fit, and the remainder are ignored. The yield of the +function is the number of decoded patterns, or one of the following negative +error codes: +
+  PCRE2_ERROR_BADDATA    second argument is zero or less
+  PCRE2_ERROR_BADMAGIC   mismatch of id bytes in the data
+  PCRE2_ERROR_BADMODE    mismatch of code unit size or PCRE2 version
+  PCRE2_ERROR_BADSERIALIZEDDATA  other sanity check failure
+  PCRE2_ERROR_MEMORY     memory allocation failed
+  PCRE2_ERROR_NULL       first or third argument is NULL
+
+PCRE2_ERROR_BADMAGIC may mean that the data is corrupt, or that it was compiled +on a system with different endianness. +

+

+Decoded patterns can be used for matching in the usual way, and must be freed +by calling pcre2_code_free(). However, be aware that there is a potential +race issue if you are using multiple patterns that were decoded from a single +byte stream in a multithreaded application. A single copy of the character +tables is used by all the decoded patterns and a reference count is used to +arrange for its memory to be automatically freed when the last pattern is +freed, but there is no locking on this reference count. Therefore, if you want +to call pcre2_code_free() for these patterns in different threads, you +must arrange your own locking, and ensure that pcre2_code_free() cannot +be called by two threads at the same time. +

+

+If a pattern was processed by pcre2_jit_compile() before being +serialized, the JIT data is discarded and so is no longer available after a +save/restore cycle. You can, however, process a restored pattern with +pcre2_jit_compile() if you wish. +

+
AUTHOR
+

+Philip Hazel +
+Retired from University Computing Service +
+Cambridge, England. +
+

+
REVISION
+

+Last updated: 19 January 2024 +
+Copyright © 1997-2018 University of Cambridge. +
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2syntax.html b/miniconda3/share/doc/pcre2/html/pcre2syntax.html new file mode 100644 index 0000000000000000000000000000000000000000..46da3d71fcc53b566bf8efd819f571d2d38433b3 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2syntax.html @@ -0,0 +1,754 @@ + + +pcre2syntax specification + + +

pcre2syntax man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+

+
PCRE2 REGULAR EXPRESSION SYNTAX SUMMARY
+

+The full syntax and semantics of the regular expression patterns that are +supported by PCRE2 are described in the +pcre2pattern +documentation. This document contains a quick-reference summary of the pattern +syntax followed by the syntax of replacement strings in substitution function. +The full description of the latter is in the +pcre2api +documentation. +

+
QUOTING
+

+

+  \x         where x is non-alphanumeric is a literal x
+  \Q...\E    treat enclosed characters as literal
+
+Note that white space inside \Q...\E is always treated as literal, even if +PCRE2_EXTENDED is set, causing most other white space to be ignored. Note also +that PCRE2's handling of \Q...\E has some differences from Perl's. See the +pcre2pattern +documentation for details. +

+
BRACED ITEMS
+

+With one exception, wherever brace characters { and } are required to enclose +data for constructions such as \g{2} or \k{name}, space and/or horizontal tab +characters that follow { or precede } are allowed and are ignored. In the case +of quantifiers, they may also appear before or after the comma. The exception +is \u{...} which is not Perl-compatible and is recognized only when +PCRE2_EXTRA_ALT_BSUX is set. This is an ECMAScript compatibility feature, and +follows ECMAScript's behaviour. +

+
ESCAPED CHARACTERS
+

+This table applies to ASCII and Unicode environments. An unrecognized escape +sequence causes an error. +

+  \a         alarm, that is, the BEL character (hex 07)
+  \cx        "control-x", where x is a non-control ASCII character
+  \e         escape (hex 1B)
+  \f         form feed (hex 0C)
+  \n         newline (hex 0A)
+  \r         carriage return (hex 0D)
+  \t         tab (hex 09)
+  \0dd       character with octal code 0dd
+  \ddd       character with octal code ddd, or backreference
+  \o{ddd..}  character with octal code ddd..
+  \N{U+hh..} character with Unicode code point hh.. (Unicode mode only)
+  \xhh       character with hex code hh
+  \x{hh..}   character with hex code hh..
+
+\N{U+hh..} is synonymous with \x{hh..} but is not supported in environments +that use EBCDIC code (mainly IBM mainframes). Note that \N not followed by an +opening curly bracket has a different meaning (see below). +

+

+If PCRE2_ALT_BSUX or PCRE2_EXTRA_ALT_BSUX is set ("ALT_BSUX mode"), the +following are also recognized: +

+  \U         the character "U"
+  \uhhhh     character with hex code hhhh
+  \u{hh..}   character with hex code hh.. but only for EXTRA_ALT_BSUX
+
+When \x is not followed by {, one or two hexadecimal digits are read, +but in ALT_BSUX mode \x must be followed by two hexadecimal digits to be +recognized as a hexadecimal escape; otherwise it matches a literal "x". +Likewise, if \u (in ALT_BSUX mode) is not followed by four hexadecimal digits +or (in EXTRA_ALT_BSUX mode) a sequence of hex digits in curly brackets, it +matches a literal "u". +

+

+Note that \0dd is always an octal code. The treatment of backslash followed by +a non-zero digit is complicated; for details see the section +"Non-printing characters" +in the +pcre2pattern +documentation, where details of escape processing in EBCDIC environments are +also given. +

+
CHARACTER TYPES
+

+

+  .          any character except newline;
+               in dotall mode, any character whatsoever
+  \C         one code unit, even in UTF mode (best avoided)
+  \d         a decimal digit
+  \D         a character that is not a decimal digit
+  \h         a horizontal white space character
+  \H         a character that is not a horizontal white space character
+  \N         a character that is not a newline
+  \p{xx}     a character with the xx property
+  \P{xx}     a character without the xx property
+  \R         a newline sequence
+  \s         a white space character
+  \S         a character that is not a white space character
+  \v         a vertical white space character
+  \V         a character that is not a vertical white space character
+  \w         a "word" character
+  \W         a "non-word" character
+  \X         a Unicode extended grapheme cluster
+
+\C is dangerous because it may leave the current matching point in the middle +of a UTF-8 or UTF-16 character. The application can lock out the use of \C by +setting the PCRE2_NEVER_BACKSLASH_C option. It is also possible to build PCRE2 +with the use of \C permanently disabled. +

+

+By default, \d, \s, and \w match only ASCII characters, even in UTF-8 mode +or in the 16-bit and 32-bit libraries. However, if locale-specific matching is +happening, \s and \w may also match characters with code points in the range +128-255. If the PCRE2_UCP option is set, the behaviour of these escape +sequences is changed to use Unicode properties and they match many more +characters, but there are some option settings that can restrict individual +sequences to matching only ASCII characters. +

+

+Property descriptions in \p and \P are matched caselessly; hyphens, +underscores, and ASCII white space characters are ignored, in accordance with +Unicode's "loose matching" rules. For example, \p{Bidi_Class=al} is the same +as \p{ bidi class = AL }. +

+
GENERAL CATEGORY PROPERTIES FOR \p and \P
+

+

+  C          Other
+  Cc         Control
+  Cf         Format
+  Cn         Unassigned
+  Co         Private use
+  Cs         Surrogate
+
+  L          Letter
+  Lc         Cased letter, the union of Ll, Lu, and Lt
+  L&         Synonym of Lc
+  Ll         Lower case letter
+  Lm         Modifier letter
+  Lo         Other letter
+  Lt         Title case letter
+  Lu         Upper case letter
+
+  M          Mark
+  Mc         Spacing mark
+  Me         Enclosing mark
+  Mn         Non-spacing mark
+
+  N          Number
+  Nd         Decimal number
+  Nl         Letter number
+  No         Other number
+
+  P          Punctuation
+  Pc         Connector punctuation
+  Pd         Dash punctuation
+  Pe         Close punctuation
+  Pf         Final punctuation
+  Pi         Initial punctuation
+  Po         Other punctuation
+  Ps         Open punctuation
+
+  S          Symbol
+  Sc         Currency symbol
+  Sk         Modifier symbol
+  Sm         Mathematical symbol
+  So         Other symbol
+
+  Z          Separator
+  Zl         Line separator
+  Zp         Paragraph separator
+  Zs         Space separator
+
+From release 10.45, when caseless matching is set, Ll, Lu, and Lt are all +equivalent to Lc. +

+
PCRE2 SPECIAL CATEGORY PROPERTIES FOR \p and \P
+

+

+  Xan        Alphanumeric: union of properties L and N
+  Xps        POSIX space: property Z or tab, NL, VT, FF, CR
+  Xsp        Perl space: property Z or tab, NL, VT, FF, CR
+  Xuc        Universally-named character: one that can be
+               represented by a Universal Character Name
+  Xwd        Perl word: property Xan or underscore
+
+Perl and POSIX space are now the same. Perl added VT to its space character set +at release 5.18. +

+
BINARY PROPERTIES FOR \p AND \P
+

+Unicode defines a number of binary properties, that is, properties whose only +values are true or false. You can obtain a list of those that are recognized by +\p and \P, along with their abbreviations, by running this command: +

+  pcre2test -LP
+
+

+
SCRIPT MATCHING WITH \p AND \P
+

+Many script names and their 4-letter abbreviations are recognized in +\p{sc:...} or \p{scx:...} items, or on their own with \p (and also \P of +course). You can obtain a list of these scripts by running this command: +

+  pcre2test -LS
+
+

+
THE BIDI_CLASS PROPERTY FOR \p AND \P
+

+

+  \p{Bidi_Class:<class>}   matches a character with the given class
+  \p{BC:<class>}           matches a character with the given class
+
+The recognized classes are: +
+  AL          Arabic letter
+  AN          Arabic number
+  B           paragraph separator
+  BN          boundary neutral
+  CS          common separator
+  EN          European number
+  ES          European separator
+  ET          European terminator
+  FSI         first strong isolate
+  L           left-to-right
+  LRE         left-to-right embedding
+  LRI         left-to-right isolate
+  LRO         left-to-right override
+  NSM         non-spacing mark
+  ON          other neutral
+  PDF         pop directional format
+  PDI         pop directional isolate
+  R           right-to-left
+  RLE         right-to-left embedding
+  RLI         right-to-left isolate
+  RLO         right-to-left override
+  S           segment separator
+  WS          white space
+
+

+
CHARACTER CLASSES
+

+

+  [...]       positive character class
+  [^...]      negative character class
+  [x-y]       range (can be used for hex characters)
+  [[:xxx:]]   positive POSIX named set
+  [[:^xxx:]]  negative POSIX named set
+
+  alnum       alphanumeric
+  alpha       alphabetic
+  ascii       0-127
+  blank       space or tab
+  cntrl       control character
+  digit       decimal digit
+  graph       printing, excluding space
+  lower       lower case letter
+  print       printing, including space
+  punct       printing, excluding alphanumeric
+  space       white space
+  upper       upper case letter
+  word        same as \w
+  xdigit      hexadecimal digit
+
+In PCRE2, POSIX character set names recognize only ASCII characters by default, +but some of them use Unicode properties if PCRE2_UCP is set. You can use +\Q...\E inside a character class. +

+

+When PCRE2_ALT_EXTENDED_CLASS is set, UTS#18 extended character classes may be +used, allowing nested character classes, combined using set operators. +

+  [x&&[^y]]   UTS#18 extended character class
+
+  x||y        set union (OR)
+  x&&y        set intersection (AND)
+  x--y        set difference (AND NOT)
+  x~~y        set symmetric difference (XOR)
+
+
+

+
PERL EXTENDED CHARACTER CLASSES
+

+

+  (?[...])                Perl extended character class
+  (?[\p{Thai} & \p{Nd}])  operators; whitespace ignored
+  (?[(x - y) & z])        parentheses for grouping
+
+  (?[ [^3] & \p{Nd} ])    [...] is a nested ordinary class
+  (?[ [:alpha:] - [z] ])  POSIX set is allowed outside [...]
+  (?[ \d - [3] ])         backslash-escaped set is allowed outside [...]
+  (?[ !\n & [:ascii:] ])  backslash-escaped character is allowed outside [...]
+                      all other characters or ranges must be enclosed in [...]
+
+  x|y, x+y                set union (OR)
+  x&y                     set intersection (AND)
+  x-y                     set difference (AND NOT)
+  x^y                     set symmetric difference (XOR)
+  !x                      set complement (NOT)
+
+Inside a Perl extended character class, [...] switches mode to be interpreted +as an ordinary character class. Outside of a nested [...], the only items +permitted are backslash-escapes, POSIX sets, operators, and parentheses. Inside +a nested ordinary class, ^ has its usual meaning (inverts the class when used +as the first character); outside of a nested class, ^ is the XOR operator. +

+
QUANTIFIERS
+

+

+  ?           0 or 1, greedy
+  ?+          0 or 1, possessive
+  ??          0 or 1, lazy
+  *           0 or more, greedy
+  *+          0 or more, possessive
+  *?          0 or more, lazy
+  +           1 or more, greedy
+  ++          1 or more, possessive
+  +?          1 or more, lazy
+  {n}         exactly n
+  {n,m}       at least n, no more than m, greedy
+  {n,m}+      at least n, no more than m, possessive
+  {n,m}?      at least n, no more than m, lazy
+  {n,}        n or more, greedy
+  {n,}+       n or more, possessive
+  {n,}?       n or more, lazy
+  {,m}        zero up to m, greedy
+  {,m}+       zero up to m, possessive
+  {,m}?       zero up to m, lazy
+
+

+
ANCHORS AND SIMPLE ASSERTIONS
+

+

+  \b          word boundary
+  \B          not a word boundary
+  ^           start of subject
+                also after an internal newline in multiline mode
+                (after any newline if PCRE2_ALT_CIRCUMFLEX is set)
+  \A          start of subject
+  $           end of subject
+                also before newline at end of subject
+                also before internal newline in multiline mode
+  \Z          end of subject
+                also before newline at end of subject
+  \z          end of subject
+  \G          first matching position in subject
+
+

+
REPORTED MATCH POINT SETTING
+

+

+  \K          set reported start of match
+
+From release 10.38 \K is not permitted by default in lookaround assertions, +for compatibility with Perl. However, if the PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK +option is set, the previous behaviour is re-enabled. When this option is set, +\K is honoured in positive assertions, but ignored in negative ones. +

+
ALTERNATION
+

+

+  expr|expr|expr...
+
+

+
CAPTURING
+

+

+  (...)           capture group
+  (?<name>...)    named capture group (Perl)
+  (?'name'...)    named capture group (Perl)
+  (?P<name>...)   named capture group (Python)
+  (?:...)         non-capture group
+  (?|...)         non-capture group; reset group numbers for
+                   capture groups in each alternative
+
+In non-UTF modes, names may contain underscores and ASCII letters and digits; +in UTF modes, any Unicode letters and Unicode decimal digits are permitted. In +both cases, a name must not start with a digit. +

+
ATOMIC GROUPS
+

+

+  (?>...)         atomic non-capture group
+  (*atomic:...)   atomic non-capture group
+
+

+
COMMENT
+

+

+  (?#....)        comment (not nestable)
+
+

+
OPTION SETTING
+

+Changes of these options within a group are automatically cancelled at the end +of the group. +

+  (?a)            all ASCII options
+  (?aD)           restrict \d to ASCII in UCP mode
+  (?aS)           restrict \s to ASCII in UCP mode
+  (?aW)           restrict \w to ASCII in UCP mode
+  (?aP)           restrict all POSIX classes to ASCII in UCP mode
+  (?aT)           restrict POSIX digit classes to ASCII in UCP mode
+  (?i)            caseless
+  (?J)            allow duplicate named groups
+  (?m)            multiline
+  (?n)            no auto capture
+  (?r)            restrict caseless to either ASCII or non-ASCII
+  (?s)            single line (dotall)
+  (?U)            default ungreedy (lazy)
+  (?x)            ignore white space except in classes or \Q...\E
+  (?xx)           as (?x) but also ignore space and tab in classes
+  (?-...)         unset the given option(s)
+  (?^)            unset imnrsx options
+
+(?aP) implies (?aT) as well, though this has no additional effect. However, it +means that (?-aP) also implies (?-aT) and disables all ASCII restrictions for +POSIX classes. +

+

+Unsetting x or xx unsets both. Several options may be set at once, and a +mixture of setting and unsetting such as (?i-x) is allowed, but there may be +only one hyphen. Setting (but no unsetting) is allowed after (?^ for example +(?^in). An option setting may appear at the start of a non-capture group, for +example (?i:...). +

+

+The following are recognized only at the very start of a pattern or after one +of the newline or \R sequences or options with similar syntax. More than one +of them may appear. For the first three, d is a decimal number. +

+  (*LIMIT_DEPTH=d)     set the backtracking limit to d
+  (*LIMIT_HEAP=d)      set the heap size limit to d * 1024 bytes
+  (*LIMIT_MATCH=d)     set the match limit to d
+  (*CASELESS_RESTRICT) set PCRE2_EXTRA_CASELESS_RESTRICT when matching
+  (*NOTEMPTY)          set PCRE2_NOTEMPTY when matching
+  (*NOTEMPTY_ATSTART)  set PCRE2_NOTEMPTY_ATSTART when matching
+  (*NO_AUTO_POSSESS)   no auto-possessification (PCRE2_NO_AUTO_POSSESS)
+  (*NO_DOTSTAR_ANCHOR) no .* anchoring (PCRE2_NO_DOTSTAR_ANCHOR)
+  (*NO_JIT)            disable JIT optimization
+  (*NO_START_OPT)      no start-match optimization (PCRE2_NO_START_OPTIMIZE)
+  (*TURKISH_CASING)    set PCRE2_EXTRA_TURKISH_CASING when matching
+  (*UTF)               set appropriate UTF mode for the library in use
+  (*UCP)               set PCRE2_UCP (use Unicode properties for \d etc)
+
+Note that LIMIT_DEPTH, LIMIT_HEAP, and LIMIT_MATCH can only reduce the value of +the limits set by the caller of pcre2_match() or pcre2_dfa_match(), +not increase them. LIMIT_RECURSION is an obsolete synonym for LIMIT_DEPTH. The +application can lock out the use of (*UTF) and (*UCP) by setting the +PCRE2_NEVER_UTF or PCRE2_NEVER_UCP options, respectively, at compile time. +

+
NEWLINE CONVENTION
+

+These are recognized only at the very start of the pattern or after option +settings with a similar syntax. +

+  (*CR)           carriage return only
+  (*LF)           linefeed only
+  (*CRLF)         carriage return followed by linefeed
+  (*ANYCRLF)      all three of the above
+  (*ANY)          any Unicode newline sequence
+  (*NUL)          the NUL character (binary zero)
+
+

+
WHAT \R MATCHES
+

+These are recognized only at the very start of the pattern or after option +setting with a similar syntax. +

+  (*BSR_ANYCRLF)  CR, LF, or CRLF
+  (*BSR_UNICODE)  any Unicode newline sequence
+
+

+
LOOKAHEAD AND LOOKBEHIND ASSERTIONS
+

+

+  (?=...)                     )
+  (*pla:...)                  ) positive lookahead
+  (*positive_lookahead:...)   )
+
+  (?!...)                     )
+  (*nla:...)                  ) negative lookahead
+  (*negative_lookahead:...)   )
+
+  (?<=...)                    )
+  (*plb:...)                  ) positive lookbehind
+  (*positive_lookbehind:...)  )
+
+  (?<!...)                    )
+  (*nlb:...)                  ) negative lookbehind
+  (*negative_lookbehind:...)  )
+
+Each top-level branch of a lookbehind must have a limit for the number of +characters it matches. If any branch can match a variable number of characters, +the maximum for each branch is limited to a value set by the caller of +pcre2_compile() or defaulted. The default is set when PCRE2 is built +(ultimate default 255). If every branch matches a fixed number of characters, +the limit for each branch is 65535 characters. +

+
NON-ATOMIC LOOKAROUND ASSERTIONS
+

+These assertions are specific to PCRE2 and are not Perl-compatible. +

+  (?*...)                                )
+  (*napla:...)                           ) synonyms
+  (*non_atomic_positive_lookahead:...)   )
+
+  (?<*...)                               )
+  (*naplb:...)                           ) synonyms
+  (*non_atomic_positive_lookbehind:...)  )
+
+

+
SUBSTRING SCAN ASSERTION
+

+This feature is not Perl-compatible. +

+  (*scan_substring:(grouplist)...)  scan captured substring
+  (*scs:(grouplist)...)             scan captured substring
+
+The comma-separated list may identify groups in any of the following ways: +
+  n       absolute reference
+  +n      relative reference
+  -n      relative reference
+  <name>  name
+  'name'  name
+
+
+

+
SCRIPT RUNS
+

+

+  (*script_run:...)           ) script run, can be backtracked into
+  (*sr:...)                   )
+
+  (*atomic_script_run:...)    ) atomic script run
+  (*asr:...)                  )
+
+

+
BACKREFERENCES
+

+

+  \n              reference by number (can be ambiguous)
+  \gn             reference by number
+  \g{n}           reference by number
+  \g+n            relative reference by number (PCRE2 extension)
+  \g-n            relative reference by number
+  \g{+n}          relative reference by number (PCRE2 extension)
+  \g{-n}          relative reference by number
+  \k<name>        reference by name (Perl)
+  \k'name'        reference by name (Perl)
+  \g{name}        reference by name (Perl)
+  \k{name}        reference by name (.NET)
+  (?P=name)       reference by name (Python)
+
+

+
SUBROUTINE REFERENCES (POSSIBLY RECURSIVE)
+

+

+  (?R)            recurse whole pattern
+  (?n)            call subroutine by absolute number
+  (?+n)           call subroutine by relative number
+  (?-n)           call subroutine by relative number
+  (?&name)        call subroutine by name (Perl)
+  (?P>name)       call subroutine by name (Python)
+  \g<name>        call subroutine by name (Oniguruma)
+  \g'name'        call subroutine by name (Oniguruma)
+  \g<n>           call subroutine by absolute number (Oniguruma)
+  \g'n'           call subroutine by absolute number (Oniguruma)
+  \g<+n>          call subroutine by relative number (PCRE2 extension)
+  \g'+n'          call subroutine by relative number (PCRE2 extension)
+  \g<-n>          call subroutine by relative number (PCRE2 extension)
+  \g'-n'          call subroutine by relative number (PCRE2 extension)
+
+

+
CONDITIONAL PATTERNS
+

+

+  (?(condition)yes-pattern)
+  (?(condition)yes-pattern|no-pattern)
+
+  (?(n)               absolute reference condition
+  (?(+n)              relative reference condition (PCRE2 extension)
+  (?(-n)              relative reference condition (PCRE2 extension)
+  (?(<name>)          named reference condition (Perl)
+  (?('name')          named reference condition (Perl)
+  (?(name)            named reference condition (PCRE2, deprecated)
+  (?(R)               overall recursion condition
+  (?(Rn)              specific numbered group recursion condition
+  (?(R&name)          specific named group recursion condition
+  (?(DEFINE)          define groups for reference
+  (?(VERSION[>]=n.m)  test PCRE2 version
+  (?(assert)          assertion condition
+
+Note the ambiguity of (?(R) and (?(Rn) which might be named reference +conditions or recursion tests. Such a condition is interpreted as a reference +condition if the relevant named group exists. +

+
BACKTRACKING CONTROL
+

+All backtracking control verbs may be in the form (*VERB:NAME). For (*MARK) the +name is mandatory, for the others it is optional. (*SKIP) changes its behaviour +if :NAME is present. The others just set a name for passing back to the caller, +but this is not a name that (*SKIP) can see. The following act immediately they +are reached: +

+  (*ACCEPT)       force successful match
+  (*FAIL)         force backtrack; synonym (*F)
+  (*MARK:NAME)    set name to be passed back; synonym (*:NAME)
+
+The following act only when a subsequent match failure causes a backtrack to +reach them. They all force a match failure, but they differ in what happens +afterwards. Those that advance the start-of-match point do so only if the +pattern is not anchored. +
+  (*COMMIT)       overall failure, no advance of starting point
+  (*PRUNE)        advance to next starting character
+  (*SKIP)         advance to current matching position
+  (*SKIP:NAME)    advance to position corresponding to an earlier
+                  (*MARK:NAME); if not found, the (*SKIP) is ignored
+  (*THEN)         local failure, backtrack to next alternation
+
+The effect of one of these verbs in a group called as a subroutine is confined +to the subroutine call. +

+
CALLOUTS
+

+

+  (?C)            callout (assumed number 0)
+  (?Cn)           callout with numerical data n
+  (?C"text")      callout with string data
+
+The allowed string delimiters are ` ' " ^ % # $ (which are the same for the +start and the end), and the starting delimiter { matched with the ending +delimiter }. To encode the ending delimiter within the string, double it. +

+
REPLACEMENT STRINGS
+

+If the PCRE2_SUBSTITUTE_LITERAL option is set, a replacement string for +pcre2_substitute() is not interpreted. Otherwise, by default, the only +special character is the dollar character in one of the following forms: +

+  $$                  insert a dollar character
+  $n or ${n}          insert the contents of group n
+  $<name>             insert the contents of named group
+  $0 or $&            insert the entire matched substring
+  $`                  insert the substring that precedes the match
+  $'                  insert the substring that follows the match
+  $_                  insert the entire input string
+  $*MARK or ${*MARK}  insert a control verb name
+
+For ${n}, n can be a name or a number. If PCRE2_SUBSTITUTE_EXTENDED is set, +there is additional interpretation: +

+

+1. Backslash is an escape character, and the forms described in "ESCAPED +CHARACTERS" above are recognized. Also: +

+  \Q...\E   can be used to suppress interpretation
+  \l        force the next character to lower case
+  \u        force the next character to upper case
+  \L        force subsequent characters to lower case
+  \U        force subsequent characters to upper case
+  \u\L      force next character to upper case, then all lower
+  \l\U      force next character to lower case, then all upper
+  \E        end \L or \U case forcing
+  \b        backspace character (note: as in character class in pattern)
+  \v        vertical tab character (note: not the same as in a pattern)
+
+2. The Python form \g<n>, where the angle brackets are part of the syntax and +n is either a group name or a number, is recognized as an alternative way +of inserting the contents of a group, for example \g<3>. +

+

+3. Capture substitution supports the following additional forms: +

+  ${n:-string}             default for unset group
+  ${n:+string1:string2}    values for set/unset group
+
+The substitution strings themselves are expanded. Backslash can be used to +escape colons and closing curly brackets. +

+
SEE ALSO
+

+pcre2pattern(3), pcre2api(3), pcre2callout(3), +pcre2matching(3), pcre2(3). +

+
AUTHOR
+

+Philip Hazel +
+Retired from University Computing Service +
+Cambridge, England. +
+

+
REVISION
+

+Last updated: 27 November 2024 +
+Copyright © 1997-2024 University of Cambridge. +
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2test.html b/miniconda3/share/doc/pcre2/html/pcre2test.html new file mode 100644 index 0000000000000000000000000000000000000000..db9073f0e60101120c2bb401d3615622a115f450 --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2test.html @@ -0,0 +1,2273 @@ + + +pcre2test specification + + +

pcre2test man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+

+
SYNOPSIS
+

+pcre2test [options] [input file [output file]] +
+
+pcre2test is a test program for the PCRE2 regular expression libraries, +but it can also be used for experimenting with regular expressions. This +document describes the features of the test program; for details of the regular +expressions themselves, see the +pcre2pattern +documentation. For details of the PCRE2 library function calls and their +options, see the +pcre2api +documentation. +

+

+The input for pcre2test is a sequence of regular expression patterns and +subject strings to be matched. There are also command lines for setting +defaults and controlling some special actions. The output shows the result of +each match attempt. Modifiers on external or internal command lines, the +patterns, and the subject lines specify PCRE2 function options, control how the +subject is processed, and what output is produced. +

+

+There are many obscure modifiers, some of which are specifically designed for +use in conjunction with the test script and data files that are distributed as +part of PCRE2. All the modifiers are documented here, some without much +justification, but many of them are unlikely to be of use except when testing +the libraries. +

+
PCRE2's 8-BIT, 16-BIT AND 32-BIT LIBRARIES
+

+Different versions of the PCRE2 library can be built to support character +strings that are encoded in 8-bit, 16-bit, or 32-bit code units. One, two, or +all three of these libraries may be simultaneously installed. The +pcre2test program can be used to test all the libraries. However, its own +input and output are always in 8-bit format. When testing the 16-bit or 32-bit +libraries, patterns and subject strings are converted to 16-bit or 32-bit +format before being passed to the library functions. Results are converted back +to 8-bit code units for output. +

+

+In the rest of this document, the names of library functions and structures +are given in generic form, for example, pcre2_compile(). The actual +names used in the libraries have a suffix _8, _16, or _32, as appropriate. +

+
INPUT ENCODING
+

+Input to pcre2test is processed line by line, either by calling the C +library's fgets() function, or via the libreadline or libedit +library. In some Windows environments character 26 (hex 1A) causes an immediate +end of file, and no further data is read, so this character should be avoided +unless you really want that action. +

+

+The input is processed using C's string functions, so must not contain binary +zeros, even though in Unix-like environments, fgets() treats any bytes +other than newline as data characters. An error is generated if a binary zero +is encountered. By default subject lines are processed for backslash escapes, +which makes it possible to include any data value in strings that are passed to +the library for matching. For patterns, there is a facility for specifying some +or all of the 8-bit input characters as hexadecimal pairs, which makes it +possible to include binary zeros. +

+
+Input for the 16-bit and 32-bit libraries +
+

+When testing the 16-bit or 32-bit libraries, there is a need to be able to +generate character code points greater than 255 in the strings that are passed +to the library. For subject lines and some patterns, backslash escapes can be +used. In addition, when the utf modifier (see +"Setting compilation options" +below) is set, the pattern and any following subject lines are interpreted as +UTF-8 strings and translated to UTF-16 or UTF-32 as appropriate. +

+

+For non-UTF testing of wide characters, the utf8_input modifier can be +used. This is mutually exclusive with utf, and is allowed only in 16-bit +or 32-bit mode. It causes the pattern and following subject lines to be treated +as UTF-8 according to the original definition (RFC 2279), which allows for +character values up to 0x7fffffff. Each character is placed in one 16-bit or +32-bit code unit (in the 16-bit case, values greater than 0xffff cause an error +to occur). +

+

+UTF-8 (in its original definition) is not capable of encoding values greater +than 0x7fffffff, but such values can be handled by the 32-bit library. When +testing this library in non-UTF mode with utf8_input set, if any +character is preceded by the byte 0xff (which is an invalid byte in UTF-8) +0x80000000 is added to the character's value. For subject strings, using an +escape sequence is preferable. +

+
COMMAND LINE OPTIONS
+

+-8 +If the 8-bit library has been built, this option causes it to be used (this is +the default). If the 8-bit library has not been built, this option causes an +error. +

+

+-16 +If the 16-bit library has been built, this option causes it to be used. If the +8-bit library has not been built, this is the default. If the 16-bit library +has not been built, this option causes an error. +

+

+-32 +If the 32-bit library has been built, this option causes it to be used. If no +other library has been built, this is the default. If the 32-bit library has +not been built, this option causes an error. +

+

+-ac +Behave as if each pattern has the auto_callout modifier, that is, insert +automatic callouts into every pattern that is compiled. +

+

+-AC +As for -ac, but in addition behave as if each subject line has the +callout_extra modifier, that is, show additional information from +callouts. +

+

+-b +Behave as if each pattern has the fullbincode modifier; the full +internal binary form of the pattern is output after compilation. +

+

+-C +Output the version number of the PCRE2 library, and all available information +about the optional features that are included, and then exit with zero exit +code. All other options are ignored. If both -C and -LM are present, whichever +is first is recognized. +

+

+-C option +Output information about a specific build-time option, then exit. This +functionality is intended for use in scripts such as RunTest. The +following options output the value and set the exit code as indicated: +

+  ebcdic-nl  the code for LF (= NL) in an EBCDIC environment:
+               either 0x15 or 0x25
+               0 if used in an ASCII/Unicode environment
+               exit code is always 0
+  linksize   the configured internal link size (2, 3, or 4)
+               exit code is set to the link size
+  newline    the default newline setting:
+               CR, LF, CRLF, ANYCRLF, ANY, or NUL
+               exit code is always 0
+  bsr        the default setting for what \R matches:
+               ANYCRLF or ANY
+               exit code is always 0
+
+The following options output 1 for true or 0 for false, and set the exit code +to the same value: +
+  backslash-C  \C is supported (not locked out)
+  ebcdic       compiled for an EBCDIC environment
+  jit          just-in-time support is available
+  pcre2-16     the 16-bit library was built
+  pcre2-32     the 32-bit library was built
+  pcre2-8      the 8-bit library was built
+  unicode      Unicode support is available
+
+Note that the availability of JIT support in the library does not guarantee +that it can actually be used because in some environments it is unable to +allocate executable memory. The option "jitusable" gives more detailed +information. It returns one of the following values: +
+  0  JIT is available and usable
+  1  JIT is available but cannot allocate executable memory
+  2  JIT is not available
+  3  Unexpected return from test call to pcre2_jit_compile()
+
+If an unknown option is given, an error message is output; the exit code is 0. +

+

+-d +Behave as if each pattern has the debug modifier; the internal +form and information about the compiled pattern is output after compilation; +-d is equivalent to -b -i. +

+

+-dfa +Behave as if each subject line has the dfa modifier; matching is done +using the pcre2_dfa_match() function instead of the default +pcre2_match(). +

+

+-error number[,number,...] +Call pcre2_get_error_message() for each of the error numbers in the +comma-separated list, display the resulting messages on the standard output, +then exit with zero exit code. The numbers may be positive or negative. This is +a convenience facility for PCRE2 maintainers. +

+

+-help +Output a brief summary these options and then exit. +

+

+-i +Behave as if each pattern has the info modifier; information about the +compiled pattern is given after compilation. +

+

+-jit +Behave as if each pattern line has the jit modifier; after successful +compilation, each pattern is passed to the just-in-time compiler, if available. +

+

+-jitfast +Behave as if each pattern line has the jitfast modifier; after +successful compilation, each pattern is passed to the just-in-time compiler, if +available, and each subject line is passed directly to the JIT matcher via its +"fast path". +

+

+-jitverify +Behave as if each pattern line has the jitverify modifier; after +successful compilation, each pattern is passed to the just-in-time compiler, if +available, and the use of JIT for matching is verified. +

+

+-LM +List modifiers: write a list of available pattern and subject modifiers to the +standard output, then exit with zero exit code. All other options are ignored. +If both -C and any -Lx options are present, whichever is first is recognized. +

+

+-LP +List properties: write a list of recognized Unicode properties to the standard +output, then exit with zero exit code. All other options are ignored. If both +-C and any -Lx options are present, whichever is first is recognized. +

+

+-LS +List scripts: write a list of recognized Unicode script names to the standard +output, then exit with zero exit code. All other options are ignored. If both +-C and any -Lx options are present, whichever is first is recognized. +

+

+-pattern modifier-list +Behave as if each pattern line contains the given modifiers. +

+

+-q +Do not output the version number of pcre2test at the start of execution. +

+

+-S size +On Unix-like systems, set the size of the run-time stack to size +mebibytes (units of 1024*1024 bytes). +

+

+-subject modifier-list +Behave as if each subject line contains the given modifiers. +

+

+-t +Run each compile and match many times with a timer, and output the resulting +times per compile or match. When JIT is used, separate times are given for the +initial compile and the JIT compile. You can control the number of iterations +that are used for timing by following -t with a number (as a separate +item on the command line). For example, "-t 1000" iterates 1000 times. The +default is to iterate 500,000 times. +

+

+-tm +This is like -t except that it times only the matching phase, not the +compile phase. +

+

+-T -TM +These behave like -t and -tm, but in addition, at the end of a run, +the total times for all compiles and matches are output. +

+

+-version +Output the PCRE2 version number and then exit. +

+
DESCRIPTION
+

+If pcre2test is given two filename arguments, it reads from the first and +writes to the second. If the first name is "-", input is taken from the +standard input. If pcre2test is given only one argument, it reads from +that file and writes to stdout. Otherwise, it reads from stdin and writes to +stdout. +

+

+When pcre2test is built, a configuration option can specify that it +should be linked with the libreadline or libedit library. When this +is done, if the input is from a terminal, it is read using the readline() +function. This provides line-editing and history facilities. The output from +the -help option states whether or not readline() will be used. +

+

+The program handles any number of tests, each of which consists of a set of +input lines. Each set starts with a regular expression pattern, followed by any +number of subject lines to be matched against that pattern. In between sets of +test data, command lines that begin with # may appear. This file format, with +some restrictions, can also be processed by the perltest.sh script that +is distributed with PCRE2 as a means of checking that the behaviour of PCRE2 +and Perl is the same. For a specification of perltest.sh, see the +comments near its beginning. See also the #perltest command below. +

+

+When the input is a terminal, pcre2test prompts for each line of input, +using "re>" to prompt for regular expression patterns, and "data>" to prompt +for subject lines. Command lines starting with # can be entered only in +response to the "re>" prompt. +

+

+Each subject line is matched separately and independently. If you want to do +multi-line matches, you have to use the \n escape sequence (or \r or \r\n, +etc., depending on the newline setting) in a single line of input to encode the +newline sequences. There is no limit on the length of subject lines; the input +buffer is automatically extended if it is too small. There are replication +features that makes it possible to generate long repetitive pattern or subject +lines without having to supply them explicitly. +

+

+An empty line or the end of the file signals the end of the subject lines for a +test, at which point a new pattern or command line is expected if there is +still input to be read. +

+
COMMAND LINES
+

+In between sets of test data, a line that begins with # is interpreted as a +command line. If the first character is followed by white space or an +exclamation mark, the line is treated as a comment, and ignored. Otherwise, the +following commands are recognized: +

+  #forbid_utf
+
+Subsequent patterns automatically have the PCRE2_NEVER_UTF and PCRE2_NEVER_UCP +options set, which locks out the use of the PCRE2_UTF and PCRE2_UCP options and +the use of (*UTF) and (*UCP) at the start of patterns. This command also forces +an error if a subsequent pattern contains any occurrences of \P, \p, or \X, +which are still supported when PCRE2_UTF is not set, but which require Unicode +property support to be included in the library. +

+

+This is a trigger guard that is used in test files to ensure that UTF or +Unicode property tests are not accidentally added to files that are used when +Unicode support is not included in the library. Setting PCRE2_NEVER_UTF and +PCRE2_NEVER_UCP as a default can also be obtained by the use of #pattern; +the difference is that #forbid_utf cannot be unset, and the automatic +options are not displayed in pattern information, to avoid cluttering up test +output. +

+  #load <filename>
+
+This command is used to load a set of precompiled patterns from a file, as +described in the section entitled "Saving and restoring compiled patterns" +below. +
+  #loadtables <filename>
+
+This command is used to load a set of binary character tables that can be +accessed by the tables=3 qualifier. Such tables can be created by the +pcre2_dftables program with the -b option. +
+  #newline_default [<newline-list>]
+
+When PCRE2 is built, a default newline convention can be specified. This +determines which characters and/or character pairs are recognized as indicating +a newline in a pattern or subject string. The default can be overridden when a +pattern is compiled. The standard test files contain tests of various newline +conventions, but the majority of the tests expect a single linefeed to be +recognized as a newline by default. Without special action the tests would fail +when PCRE2 is compiled with either CR or CRLF as the default newline. +

+

+The #newline_default command specifies a list of newline types that are +acceptable as the default. The types must be one of CR, LF, CRLF, ANYCRLF, +ANY, or NUL (in upper or lower case), for example: +

+  #newline_default LF Any anyCRLF
+
+If the default newline is in the list, this command has no effect. Otherwise, +except when testing the POSIX API, a newline modifier that specifies the +first newline convention in the list (LF in the above example) is added to any +pattern that does not already have a newline modifier. If the newline +list is empty, the feature is turned off. This command is present in a number +of the standard test input files. +

+

+When the POSIX API is being tested there is no way to override the default +newline convention, though it is possible to set the newline convention from +within the pattern. A warning is given if the posix or posix_nosub +modifier is used when #newline_default would set a default for the +non-POSIX API. +

+  #pattern <modifier-list>
+
+This command sets a default modifier list that applies to all subsequent +patterns. Modifiers on a pattern can change these settings. +
+  #perltest
+
+This line is used in test files that can also be processed by perltest.sh +to confirm that Perl gives the same results as PCRE2. Subsequent tests are +checked for the use of pcre2test features that are incompatible with the +perltest.sh script. +

+

+Patterns must use '/' as their delimiter, and only certain modifiers are +supported. Comment lines, #pattern commands, and #subject commands that set or +unset "mark" are recognized and acted on. The #perltest, #forbid_utf, and +#newline_default commands, which are needed in the relevant pcre2test files, +are silently ignored. All other command lines are ignored, but give a warning +message. The #perltest command helps detect tests that are accidentally +put in the wrong file or use the wrong delimiter. For more details of the +perltest.sh script see the comments it contains. +

+  #pop [<modifiers>]
+  #popcopy [<modifiers>]
+
+These commands are used to manipulate the stack of compiled patterns, as +described in the section entitled "Saving and restoring compiled patterns" +below. +
+  #save <filename>
+
+This command is used to save a set of compiled patterns to a file, as described +in the section entitled "Saving and restoring compiled patterns" +below. +
+  #subject <modifier-list>
+
+This command sets a default modifier list that applies to all subsequent +subject lines. Modifiers on a subject line can change these settings. +

+
MODIFIER SYNTAX
+

+Modifier lists are used with both pattern and subject lines. Items in a list +are separated by commas followed by optional white space. Trailing whitespace +in a modifier list is ignored. Some modifiers may be given for both patterns +and subject lines, whereas others are valid only for one or the other. Each +modifier has a long name, for example "anchored", and some of them must be +followed by an equals sign and a value, for example, "offset=12". Values cannot +contain comma characters, but may contain spaces. Modifiers that do not take +values may be preceded by a minus sign to turn off a previous setting. +

+

+A few of the more common modifiers can also be specified as single letters, for +example "i" for "caseless". In documentation, following the Perl convention, +these are written with a slash ("the /i modifier") for clarity. Abbreviated +modifiers must all be concatenated in the first item of a modifier list. If the +first item is not recognized as a long modifier name, it is interpreted as a +sequence of these abbreviations. For example: +

+  /abc/ig,newline=cr,jit=3
+
+This is a pattern line whose modifier list starts with two one-letter modifiers +(/i and /g). The lower-case abbreviated modifiers are the same as used in Perl. +

+
PATTERN SYNTAX
+

+A pattern line must start with one of the following characters (common symbols, +excluding pattern meta-characters): +

+  / ! " ' ` - = _ : ; , % & @ ~
+
+This is interpreted as the pattern's delimiter. A regular expression may be +continued over several input lines, in which case the newline characters are +included within it. It is possible to include the delimiter as a literal within +the pattern by escaping it with a backslash, for example +
+  /abc\/def/
+
+If you do this, the escape and the delimiter form part of the pattern, but +since the delimiters are all non-alphanumeric, the inclusion of the backslash +does not affect the pattern's interpretation. Note, however, that this trick +does not work within \Q...\E literal bracketing because the backslash will +itself be interpreted as a literal. If the terminating delimiter is immediately +followed by a backslash, for example, +
+  /abc/\
+
+a backslash is added to the end of the pattern. This is done to provide a way +of testing the error condition that arises if a pattern finishes with a +backslash, because +
+  /abc\/
+
+is interpreted as the first line of a pattern that starts with "abc/", causing +pcre2test to read the next line as a continuation of the regular expression. +

+

+A pattern can be followed by a modifier list (details below). +

+
SUBJECT LINE SYNTAX
+

+Before each subject line is passed to pcre2_match(), +pcre2_dfa_match(), or pcre2_jit_match(), leading and trailing white +space is removed, and the line is scanned for backslash escapes, unless the +subject_literal modifier was set for the pattern. The following provide a +means of encoding non-printing characters in a visible way: +

+  \a          alarm (BEL, \x07)
+  \b          backspace (\x08)
+  \e          escape (\x27)
+  \f          form feed (\x0c)
+  \n          newline (\x0a)
+  \N{U+hh...} unicode character (any number of hex digits)
+  \r          carriage return (\x0d)
+  \t          tab (\x09)
+  \v          vertical tab (\x0b)
+  \ddd        octal number (up to 3 octal digits); represent a single
+                code point unless larger than 255 with the 8-bit library
+  \o{dd...}   octal number (any number of octal digits} representing a
+                character in UTF mode or a code point
+  \xhh        hexadecimal byte (up to 2 hex digits)
+  \x{hh...}   hexadecimal number (up to 8 hex digits) representing a
+                character in UTF mode or a code point
+
+Invoking \N{U+hh...} or \x{hh...} doesn't require the use of the utf +modifier on the pattern. It is always recognized. There may be any number of +hexadecimal digits inside the braces; invalid values provoke error messages +but when using \N{U+hh...} with some invalid unicode characters they will +be accepted with a warning instead. +

+

+Note that even in UTF-8 mode, \xhh (and depending of how large, \ddd) +describe one byte rather than one character; this makes it possible to +construct invalid UTF-8 sequences for testing purposes. On the other hand, +\x{hh...} is interpreted as a UTF-8 character in UTF-8 mode, only generating +more than one byte if the value is greater than 127. To avoid the ambiguity +it is preferred to use \N{U+hh...} when describing characters. When testing +the 8-bit library not in UTF-8 mode, \x{hh} generates one byte for values +that could fit on it, and causes an error for greater values. +

+

+When testing the 16-bit library, not in UTF-16 mode, all 4-digit \x{hhhh} +values are accepted. This makes it possible to construct invalid UTF-16 +sequences for testing purposes. +

+

+When testing the 32-bit library, not in UTF-32 mode, all 4 to 8-digit \x{...} +values are accepted. This makes it possible to construct invalid UTF-32 +sequences for testing purposes. +

+

+There is a special backslash sequence that specifies replication of one or more +characters: +

+  \[<characters>]{<count>}
+
+This makes it possible to test long strings without having to provide them as +part of the file. For example: +
+  \[abc]{4}
+
+is converted to "abcabcabcabc". This feature does not support nesting. To +include a closing square bracket in the characters, code it as \x5D. +

+

+A backslash followed by an equals sign marks the end of the subject string and +the start of a modifier list. For example: +

+  abc\=notbol,notempty
+
+If the subject string is empty and \= is followed by whitespace, the line is +treated as a comment line, and is not used for matching. For example: +
+  \= This is a comment.
+  abc\= This is an invalid modifier list.
+
+A backslash followed by any other non-alphanumeric character just escapes that +character. A backslash followed by anything else causes an error. However, if +the very last character in the line is a backslash (and there is no modifier +list), it is ignored. This gives a way of passing an empty line as data, since +a real empty line terminates the data input. +

+

+If the subject_literal modifier is set for a pattern, all subject lines +that follow are treated as literals, with no special treatment of backslashes. +No replication is possible, and any subject modifiers must be set as defaults +by a #subject command. +

+
PATTERN MODIFIERS
+

+There are several types of modifier that can appear in pattern lines. Except +where noted below, they may also be used in #pattern commands. A +pattern's modifier list can add to or override default modifiers that were set +by a previous #pattern command. +

+
+Setting compilation options +
+

+The following modifiers set options for pcre2_compile(). Most of them set +bits in the options argument of that function, but those whose names start with +PCRE2_EXTRA are additional options that are set in the compile context. +Some of these options have single-letter abbreviations. There is special +handling for /x: if a second x is present, PCRE2_EXTENDED is converted into +PCRE2_EXTENDED_MORE as in Perl. A third appearance adds PCRE2_EXTENDED as well, +though this makes no difference to the way pcre2_compile() behaves. See +pcre2api +for a description of the effects of these options. +

+      allow_empty_class         set PCRE2_ALLOW_EMPTY_CLASS
+      allow_lookaround_bsk      set PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK
+      allow_surrogate_escapes   set PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES
+      alt_bsux                  set PCRE2_ALT_BSUX
+      alt_circumflex            set PCRE2_ALT_CIRCUMFLEX
+      alt_extended_class        set PCRE2_ALT_EXTENDED_CLASS
+      alt_verbnames             set PCRE2_ALT_VERBNAMES
+      anchored                  set PCRE2_ANCHORED
+  /a  ascii_all                 set all ASCII options
+      ascii_bsd                 set PCRE2_EXTRA_ASCII_BSD
+      ascii_bss                 set PCRE2_EXTRA_ASCII_BSS
+      ascii_bsw                 set PCRE2_EXTRA_ASCII_BSW
+      ascii_digit               set PCRE2_EXTRA_ASCII_DIGIT
+      ascii_posix               set PCRE2_EXTRA_ASCII_POSIX
+      auto_callout              set PCRE2_AUTO_CALLOUT
+      bad_escape_is_literal     set PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL
+  /i  caseless                  set PCRE2_CASELESS
+  /r  caseless_restrict         set PCRE2_EXTRA_CASELESS_RESTRICT
+      dollar_endonly            set PCRE2_DOLLAR_ENDONLY
+  /s  dotall                    set PCRE2_DOTALL
+      dupnames                  set PCRE2_DUPNAMES
+      endanchored               set PCRE2_ENDANCHORED
+      escaped_cr_is_lf          set PCRE2_EXTRA_ESCAPED_CR_IS_LF
+  /x  extended                  set PCRE2_EXTENDED
+  /xx extended_more             set PCRE2_EXTENDED_MORE
+      extra_alt_bsux            set PCRE2_EXTRA_ALT_BSUX
+      firstline                 set PCRE2_FIRSTLINE
+      literal                   set PCRE2_LITERAL
+      match_line                set PCRE2_EXTRA_MATCH_LINE
+      match_invalid_utf         set PCRE2_MATCH_INVALID_UTF
+      match_unset_backref       set PCRE2_MATCH_UNSET_BACKREF
+      match_word                set PCRE2_EXTRA_MATCH_WORD
+  /m  multiline                 set PCRE2_MULTILINE
+      never_backslash_c         set PCRE2_NEVER_BACKSLASH_C
+      never_callout             set PCRE2_EXTRA_NEVER_CALLOUT
+      never_ucp                 set PCRE2_NEVER_UCP
+      never_utf                 set PCRE2_NEVER_UTF
+  /n  no_auto_capture           set PCRE2_NO_AUTO_CAPTURE
+      no_auto_possess           set PCRE2_NO_AUTO_POSSESS
+      no_bs0                    set PCRE2_EXTRA_NO_BS0
+      no_dotstar_anchor         set PCRE2_NO_DOTSTAR_ANCHOR
+      no_start_optimize         set PCRE2_NO_START_OPTIMIZE
+      no_utf_check              set PCRE2_NO_UTF_CHECK
+      python_octal              set PCRE2_EXTRA_PYTHON_OCTAL
+      turkish_casing            set PCRE2_EXTRA_TURKISH_CASING
+      ucp                       set PCRE2_UCP
+      ungreedy                  set PCRE2_UNGREEDY
+      use_offset_limit          set PCRE2_USE_OFFSET_LIMIT
+      utf                       set PCRE2_UTF
+
+As well as turning on the PCRE2_UTF option, the utf modifier causes all +non-printing characters in output strings to be printed using the \x{hh...} +notation. Otherwise, those less than 0x100 are output in hex without the curly +brackets. Setting utf in 16-bit or 32-bit mode also causes pattern and +subject strings to be translated to UTF-16 or UTF-32, respectively, before +being passed to library functions. +
+
+The following modifiers enable or disable performance optimizations by +calling pcre2_set_optimize() before invoking the regex compiler. +
+      optimization_full      enable all optional optimizations
+      optimization_none      disable all optional optimizations
+      auto_possess           auto-possessify variable quantifiers
+      auto_possess_off       don't auto-possessify variable quantifiers
+      dotstar_anchor         anchor patterns starting with .*
+      dotstar_anchor_off     don't anchor patterns starting with .*
+      start_optimize         enable pre-scan of subject string
+      start_optimize_off     disable pre-scan of subject string
+
+See the +pcre2_set_optimize +documentation for details on these optimizations. +

+
+Setting compilation controls +
+

+The following modifiers affect the compilation process or request information +about the pattern. There are single-letter abbreviations for some that are +heavily used in the test files. +

+  /B  bincode                   show binary code without lengths
+      bsr=[anycrlf|unicode]     specify \R handling
+      callout_info              show callout information
+      convert=<options>         request foreign pattern conversion
+      convert_glob_escape=c     set glob escape character
+      convert_glob_separator=c  set glob separator character
+      convert_length            set convert buffer length
+      debug                     same as info,fullbincode
+      expand                    expand repetition syntax in pattern
+      framesize                 show matching frame size
+      fullbincode               show binary code with lengths
+  /I  info                      show info about compiled pattern
+      hex                       unquoted characters are hexadecimal
+      jit[=<number>]            use JIT
+      jitfast                   use JIT fast path
+      jitverify                 verify JIT use
+      locale=<name>             use this locale
+      max_pattern_compiled      ) set maximum compiled pattern
+                 _length=<n>    )   length (bytes)
+      max_pattern_length=<n>    set maximum pattern length (code units)
+      max_varlookbehind=<n>     set maximum variable lookbehind length
+      memory                    show memory used
+      newline=<type>            set newline type
+      null_context              compile with a NULL context
+      null_pattern              pass pattern as NULL
+      parens_nest_limit=<n>     set maximum parentheses depth
+      posix                     use the POSIX API
+      posix_nosub               use the POSIX API with REG_NOSUB
+      push                      push compiled pattern onto the stack
+      pushcopy                  push a copy onto the stack
+      pushtablescopy            push a copy with tables onto the stack
+      stackguard=<number>       test the stackguard feature
+      subject_literal           treat all subject lines as literal
+      tables=[0|1|2|3]          select internal tables
+      use_length                do not zero-terminate the pattern
+      utf8_input                treat input as UTF-8
+
+The effects of these modifiers are described in the following sections. +

+
+Newline and \R handling +
+

+The bsr modifier specifies what \R in a pattern should match. If it is +set to "anycrlf", \R matches CR, LF, or CRLF only. If it is set to "unicode", +\R matches any Unicode newline sequence. The default can be specified when +PCRE2 is built; if it is not, the default is set to Unicode. +

+

+The newline modifier specifies which characters are to be interpreted as +newlines, both in the pattern and in subject lines. The type must be one of CR, +LF, CRLF, ANYCRLF, ANY, or NUL (in upper or lower case). +

+
+Information about a pattern +
+

+The debug modifier is a shorthand for info,fullbincode, requesting +all available information. +

+

+The bincode modifier causes a representation of the compiled code to be +output after compilation. This information does not contain length and offset +values, which ensures that the same output is generated for different internal +link sizes and different code unit widths. By using bincode, the same +regression tests can be used in different environments. +

+

+The fullbincode modifier, by contrast, does include length and +offset values. This is used in a few special tests that run only for specific +code unit widths and link sizes, and is also useful for one-off tests. +

+

+The info modifier requests information about the compiled pattern +(whether it is anchored, has a fixed first character, and so on). The +information is obtained from the pcre2_pattern_info() function. Here are +some typical examples: +

+    re> /(?i)(^a|^b)/m,info
+  Capture group count = 1
+  Compile options: multiline
+  Overall options: caseless multiline
+  First code unit at start or follows newline
+  Subject length lower bound = 1
+
+    re> /(?i)abc/info
+  Capture group count = 0
+  Compile options: <none>
+  Overall options: caseless
+  First code unit = 'a' (caseless)
+  Last code unit = 'c' (caseless)
+  Subject length lower bound = 3
+
+"Compile options" are those specified by modifiers; "overall options" have +added options that are taken or deduced from the pattern. If both sets of +options are the same, just a single "options" line is output; if there are no +options, the line is omitted. "First code unit" is where any match must start; +if there is more than one they are listed as "starting code units". "Last code +unit" is the last literal code unit that must be present in any match. This is +not necessarily the last character. These lines are omitted if no starting or +ending code units are recorded. The subject length line is omitted when +no_start_optimize is set because the minimum length is not calculated +when it can never be used. +

+

+The framesize modifier shows the size, in bytes, of each storage frame +used by pcre2_match() for handling backtracking. The size depends on the +number of capturing parentheses in the pattern. A vector of these frames is +used at matching time; its overall size is shown when the heaframes_size +subject modifier is set. +

+

+The callout_info modifier requests information about all the callouts in +the pattern. A list of them is output at the end of any other information that +is requested. For each callout, either its number or string is given, followed +by the item that follows it in the pattern. +

+
+Passing a NULL context +
+

+Normally, pcre2test passes a context block to pcre2_compile(). If +the null_context modifier is set, however, NULL is passed. This is for +testing that pcre2_compile() behaves correctly in this case (it uses +default values). +

+
+Passing a NULL pattern +
+

+The null_pattern modifier is for testing the behaviour of +pcre2_compile() when the pattern argument is NULL. The length value +passed is the default PCRE2_ZERO_TERMINATED unless use_length is set. +Any length other than zero causes an error. +

+
+Specifying pattern characters in hexadecimal +
+

+The hex modifier specifies that the characters of the pattern, except for +substrings enclosed in single or double quotes, are to be interpreted as pairs +of hexadecimal digits. This feature is provided as a way of creating patterns +that contain binary zeros and other non-printing characters. White space is +permitted between pairs of digits. For example, this pattern contains three +characters: +

+  /ab 32 59/hex
+
+Parts of such a pattern are taken literally if quoted. This pattern contains +nine characters, only two of which are specified in hexadecimal: +
+  /ab "literal" 32/hex
+
+Either single or double quotes may be used. There is no way of including +the delimiter within a substring. The hex and expand modifiers are +mutually exclusive. +

+
+Specifying the pattern's length +
+

+By default, patterns are passed to the compiling functions as zero-terminated +strings but can be passed by length instead of being zero-terminated. The +use_length modifier causes this to happen. Using a length happens +automatically (whether or not use_length is set) when hex is set, +because patterns specified in hexadecimal may contain binary zeros. +

+

+If hex or use_length is used with the POSIX wrapper API (see +"Using the POSIX wrapper API" +below), the REG_PEND extension is used to pass the pattern's length. +

+
+Specifying a maximum for variable lookbehinds +
+

+Variable lookbehind assertions are supported only if, for each one, there is a +maximum length (in characters) that it can match. There is a limit on this, +whose default can be set at build time, with an ultimate default of 255. The +max_varlookbehind modifier uses the pcre2_set_max_varlookbehind() +function to change the limit. Lookbehinds whose branches each match a fixed +length are limited to 65535 characters per branch. +

+
+Specifying wide characters in 16-bit and 32-bit modes +
+

+In 16-bit and 32-bit modes, all input is automatically treated as UTF-8 and +translated to UTF-16 or UTF-32 when the utf modifier is set. For testing +the 16-bit and 32-bit libraries in non-UTF mode, the utf8_input modifier +can be used. It is mutually exclusive with utf. Input lines are +interpreted as UTF-8 as a means of specifying wide characters. More details are +given in +"Input encoding" +above. +

+
+Generating long repetitive patterns +
+

+Some tests use long patterns that are very repetitive. Instead of creating a +very long input line for such a pattern, you can use a special repetition +feature, similar to the one described for subject lines above. If the +expand modifier is present on a pattern, parts of the pattern that have +the form +

+  \[<characters>]{<count>}
+
+are expanded before the pattern is passed to pcre2_compile(). For +example, \[AB]{6000} is expanded to "ABAB..." 6000 times. This construction +cannot be nested. An initial "\[" sequence is recognized only if "]{" followed +by decimal digits and "}" is found later in the pattern. If not, the characters +remain in the pattern unaltered. The expand and hex modifiers are +mutually exclusive. +

+

+If part of an expanded pattern looks like an expansion, but is really part of +the actual pattern, unwanted expansion can be avoided by giving two values in +the quantifier. For example, \[AB]{6000,6000} is not recognized as an +expansion item. +

+

+If the info modifier is set on an expanded pattern, the result of the +expansion is included in the information that is output. +

+
+JIT compilation +
+

+Just-in-time (JIT) compiling is a heavyweight optimization that can greatly +speed up pattern matching. See the +pcre2jit +documentation for details. JIT compiling happens, optionally, after a pattern +has been successfully compiled into an internal form. The JIT compiler converts +this to optimized machine code. It needs to know whether the match-time options +PCRE2_PARTIAL_HARD and PCRE2_PARTIAL_SOFT are going to be used, because +different code is generated for the different cases. See the partial +modifier in "Subject Modifiers" +below +for details of how these options are specified for each match attempt. +

+

+JIT compilation is requested by the jit pattern modifier, which may +optionally be followed by an equals sign and a number in the range 0 to 7. +The three bits that make up the number specify which of the three JIT operating +modes are to be compiled: +

+  1  compile JIT code for non-partial matching
+  2  compile JIT code for soft partial matching
+  4  compile JIT code for hard partial matching
+
+The possible values for the jit modifier are therefore: +
+  0  disable JIT
+  1  normal matching only
+  2  soft partial matching only
+  3  normal and soft partial matching
+  4  hard partial matching only
+  6  soft and hard partial matching only
+  7  all three modes
+
+If no number is given, 7 is assumed. The phrase "partial matching" means a call +to pcre2_match() with either the PCRE2_PARTIAL_SOFT or the +PCRE2_PARTIAL_HARD option set. Note that such a call may return a complete +match; the options enable the possibility of a partial match, but do not +require it. Note also that if you request JIT compilation only for partial +matching (for example, jit=2) but do not set the partial modifier on a +subject line, that match will not use JIT code because none was compiled for +non-partial matching. +

+

+If JIT compilation is successful, the compiled JIT code will automatically be +used when an appropriate type of match is run, except when incompatible +run-time options are specified. For more details, see the +pcre2jit +documentation. See also the jitstack modifier below for a way of +setting the size of the JIT stack. +

+

+If the jitfast modifier is specified, matching is done using the JIT +"fast path" interface, pcre2_jit_match(), which skips some of the sanity +checks that are done by pcre2_match(), and of course does not work when +JIT is not supported. If jitfast is specified without jit, jit=7 is +assumed. +

+

+If the jitverify modifier is specified, information about the compiled +pattern shows whether JIT compilation was or was not successful. If +jitverify is specified without jit, jit=7 is assumed. If JIT +compilation is successful when jitverify is set, the text "(JIT)" is +added to the first output line after a match or non match when JIT-compiled +code was actually used in the match. +

+
+Setting a locale +
+

+The locale modifier must specify the name of a locale, for example: +

+  /pattern/locale=fr_FR
+
+The given locale is set, pcre2_maketables() is called to build a set of +character tables for the locale, and this is then passed to +pcre2_compile() when compiling the regular expression. The same tables +are used when matching the following subject lines. The locale modifier +applies only to the pattern on which it appears, but can be given in a +#pattern command if a default is needed. Setting a locale and alternate +character tables are mutually exclusive. +

+
+Showing pattern memory +
+

+The memory modifier causes the size in bytes of the memory used to hold +the compiled pattern to be output. This does not include the size of the +pcre2_code block; it is just the actual compiled data. If the pattern is +subsequently passed to the JIT compiler, the size of the JIT compiled code is +also output. Here is an example: +

+    re> /a(b)c/jit,memory
+  Memory allocation (code space): 21
+  Memory allocation (JIT code): 1910
+
+
+

+
+Limiting nested parentheses +
+

+The parens_nest_limit modifier sets a limit on the depth of nested +parentheses in a pattern. Breaching the limit causes a compilation error. +The default for the library is set when PCRE2 is built, but pcre2test +sets its own default of 220, which is required for running the standard test +suite. +

+
+Limiting the pattern length +
+

+The max_pattern_length modifier sets a limit, in code units, to the +length of pattern that pcre2_compile() will accept. Breaching the limit +causes a compilation error. The default is the largest number a PCRE2_SIZE +variable can hold (essentially unlimited). +

+
+Limiting the size of a compiled pattern +
+

+The max_pattern_compiled_length modifier sets a limit, in bytes, to the +amount of memory used by a compiled pattern. Breaching the limit causes a +compilation error. The default is the largest number a PCRE2_SIZE variable can +hold (essentially unlimited). +

+
+Using the POSIX wrapper API +
+

+The posix and posix_nosub modifiers cause pcre2test to call +PCRE2 via the POSIX wrapper API rather than its native API. When +posix_nosub is used, the POSIX option REG_NOSUB is passed to +regcomp(). The POSIX wrapper supports only the 8-bit library. Note that +it does not imply POSIX matching semantics; for more detail see the +pcre2posix +documentation. The following pattern modifiers set options for the +regcomp() function: +

+  caseless           REG_ICASE
+  multiline          REG_NEWLINE
+  dotall             REG_DOTALL     )
+  ungreedy           REG_UNGREEDY   ) These options are not part of
+  ucp                REG_UCP        )   the POSIX standard
+  utf                REG_UTF8       )
+
+The regerror_buffsize modifier specifies a size for the error buffer that +is passed to regerror() in the event of a compilation error. For example: +
+  /abc/posix,regerror_buffsize=20
+
+This provides a means of testing the behaviour of regerror() when the +buffer is too small for the error message. If this modifier has not been set, a +large buffer is used. +

+

+The aftertext and allaftertext subject modifiers work as described +below. All other modifiers are either ignored, with a warning message, or cause +an error. +

+

+The pattern is passed to regcomp() as a zero-terminated string by +default, but if the use_length or hex modifiers are set, the +REG_PEND extension is used to pass it by length. +

+
+Testing the stack guard feature +
+

+The stackguard modifier is used to test the use of +pcre2_set_compile_recursion_guard(), a function that is provided to +enable stack availability to be checked during compilation (see the +pcre2api +documentation for details). If the number specified by the modifier is greater +than zero, pcre2_set_compile_recursion_guard() is called to set up +callback from pcre2_compile() to a local function. The argument it +receives is the current nesting parenthesis depth; if this is greater than the +value given by the modifier, non-zero is returned, causing the compilation to +be aborted. +

+
+Using alternative character tables +
+

+The value specified for the tables modifier must be one of the digits 0, +1, 2, or 3. It causes a specific set of built-in character tables to be passed +to pcre2_compile(). This is used in the PCRE2 tests to check behaviour +with different character tables. The digit specifies the tables as follows: +

+  0   do not pass any special character tables
+  1   the default ASCII tables, as distributed in
+        pcre2_chartables.c.dist
+  2   a set of tables defining ISO 8859 characters
+  3   a set of tables loaded by the #loadtables command
+
+In tables 2, some characters whose codes are greater than 128 are identified as +letters, digits, spaces, etc. Tables 3 can be used only after a +#loadtables command has loaded them from a binary file. Setting alternate +character tables and a locale are mutually exclusive. +

+
+Setting certain match controls +
+

+The following modifiers are really subject modifiers, and are described under +"Subject Modifiers" below. However, they may be included in a pattern's +modifier list, in which case they are applied to every subject line that is +processed with that pattern. These modifiers do not affect the compilation +process. +

+      aftertext                   show text after match
+      allaftertext                show text after captures
+      allcaptures                 show all captures
+      allvector                   show the entire ovector
+      allusedtext                 show all consulted text
+      altglobal                   alternative global matching
+  /g  global                      global matching
+      heapframes_size             show match data heapframes size
+      jitstack=<n>                set size of JIT stack
+      mark                        show mark values
+      replace=<string>            specify a replacement string
+      startchar                   show starting character when relevant
+      substitute_callout          use substitution callouts
+      substitute_case_callout     use substitution case callouts
+      substitute_extended         use PCRE2_SUBSTITUTE_EXTENDED
+      substitute_literal          use PCRE2_SUBSTITUTE_LITERAL
+      substitute_matched          use PCRE2_SUBSTITUTE_MATCHED
+      substitute_overflow_length  use PCRE2_SUBSTITUTE_OVERFLOW_LENGTH
+      substitute_replacement_only use PCRE2_SUBSTITUTE_REPLACEMENT_ONLY
+      substitute_skip=<n>         skip substitution <n>
+      substitute_stop=<n>         skip substitution <n> and following
+      substitute_unknown_unset    use PCRE2_SUBSTITUTE_UNKNOWN_UNSET
+      substitute_unset_empty      use PCRE2_SUBSTITUTE_UNSET_EMPTY
+
+These modifiers may not appear in a #pattern command. If you want them as +defaults, set them in a #subject command. +

+
+Specifying literal subject lines +
+

+If the subject_literal modifier is present on a pattern, all the subject +lines that it matches are taken as literal strings, with no interpretation of +backslashes. It is not possible to set subject modifiers on such lines, but any +that are set as defaults by a #subject command are recognized. +

+
+Saving a compiled pattern +
+

+When a pattern with the push modifier is successfully compiled, it is +pushed onto a stack of compiled patterns, and pcre2test expects the next +line to contain a new pattern (or a command) instead of a subject line. This +facility is used when saving compiled patterns to a file, as described in the +section entitled "Saving and restoring compiled patterns" +below. +If pushcopy is used instead of push, a copy of the compiled +pattern is stacked, leaving the original as current, ready to match the +following input lines. This provides a way of testing the +pcre2_code_copy() function. +The push and pushcopy modifiers are incompatible with compilation +modifiers such as global that act at match time. Any that are specified +are ignored (for the stacked copy), with a warning message, except for +replace, which causes an error. Note that jitverify, which is +allowed, does not carry through to any subsequent matching that uses a stacked +pattern. +

+
+Testing foreign pattern conversion +
+

+The experimental foreign pattern conversion functions in PCRE2 can be tested by +setting the convert modifier. Its argument is a colon-separated list of +options, which set the equivalent option for the pcre2_pattern_convert() +function: +

+  glob                    PCRE2_CONVERT_GLOB
+  glob_no_starstar        PCRE2_CONVERT_GLOB_NO_STARSTAR
+  glob_no_wild_separator  PCRE2_CONVERT_GLOB_NO_WILD_SEPARATOR
+  posix_basic             PCRE2_CONVERT_POSIX_BASIC
+  posix_extended          PCRE2_CONVERT_POSIX_EXTENDED
+  unset                   Unset all options
+
+The "unset" value is useful for turning off a default that has been set by a +#pattern command. When one of these options is set, the input pattern is +passed to pcre2_pattern_convert(). If the conversion is successful, the +result is reflected in the output and then passed to pcre2_compile(). The +normal utf and no_utf_check options, if set, cause the +PCRE2_CONVERT_UTF and PCRE2_CONVERT_NO_UTF_CHECK options to be passed to +pcre2_pattern_convert(). +

+

+By default, the conversion function is allowed to allocate a buffer for its +output. However, if the convert_length modifier is set to a value greater +than zero, pcre2test passes a buffer of the given length. This makes it +possible to test the length check. +

+

+The convert_glob_escape and convert_glob_separator modifiers can be +used to specify the escape and separator characters for glob processing, +overriding the defaults, which are operating-system dependent. +

+
SUBJECT MODIFIERS
+

+The modifiers that can appear in subject lines and the #subject +command are of two types. +

+
+Setting match options +
+

+The following modifiers set options for pcre2_match() or +pcre2_dfa_match(). See +pcre2api +for a description of their effects. +

+      anchored                   set PCRE2_ANCHORED
+      copy_matched_subject       set PCRE2_COPY_MATCHED_SUBJECT
+      endanchored                set PCRE2_ENDANCHORED
+      dfa_restart                set PCRE2_DFA_RESTART
+      dfa_shortest               set PCRE2_DFA_SHORTEST
+      disable_recurseloop_check  set PCRE2_DISABLE_RECURSELOOP_CHECK
+      no_jit                     set PCRE2_NO_JIT
+      no_utf_check               set PCRE2_NO_UTF_CHECK
+      notbol                     set PCRE2_NOTBOL
+      notempty                   set PCRE2_NOTEMPTY
+      notempty_atstart           set PCRE2_NOTEMPTY_ATSTART
+      noteol                     set PCRE2_NOTEOL
+      partial_hard (or ph)       set PCRE2_PARTIAL_HARD
+      partial_soft (or ps)       set PCRE2_PARTIAL_SOFT
+
+The partial matching modifiers are provided with abbreviations because they +appear frequently in tests. +

+

+If the posix or posix_nosub modifier was present on the pattern, +causing the POSIX wrapper API to be used, the only option-setting modifiers +that have any effect are notbol, notempty, and noteol, +causing REG_NOTBOL, REG_NOTEMPTY, and REG_NOTEOL, respectively, to be passed to +regexec(). The other modifiers are ignored, with a warning message. +

+

+There is one additional modifier that can be used with the POSIX wrapper. It is +ignored (with a warning) if used for non-POSIX matching. +

+      posix_startend=<n>[:<m>]
+
+This causes the subject string to be passed to regexec() using the +REG_STARTEND option, which uses offsets to specify which part of the string is +searched. If only one number is given, the end offset is passed as the end of +the subject string. For more detail of REG_STARTEND, see the +pcre2posix +documentation. If the subject string contains binary zeros (coded as escapes +such as \x{00} because pcre2test does not support actual binary zeros in +its input), you must use posix_startend to specify its length. +

+
+Setting match controls +
+

+The following modifiers affect the matching process or request additional +information. Some of them may also be specified on a pattern line (see above), +in which case they apply to every subject line that is matched against that +pattern, but can be overridden by modifiers on the subject. +

+      aftertext                  show text after match
+      allaftertext               show text after captures
+      allcaptures                show all captures
+      allusedtext                show all consulted text (non-JIT only)
+      allvector                  show the entire ovector
+      altglobal                  alternative global matching
+      callout_capture            show captures at callout time
+      callout_data=<n>           set a value to pass via callouts
+      callout_error=<n>[:<m>]    control callout error
+      callout_extra              show extra callout information
+      callout_fail=<n>[:<m>]     control callout failure
+      callout_no_where           do not show position of a callout
+      callout_none               do not supply a callout function
+      copy=<number or name>      copy captured substring
+      depth_limit=<n>            set a depth limit
+      dfa                        use pcre2_dfa_match()
+      find_limits                find heap, match and depth limits
+      find_limits_noheap         find match and depth limits
+      get=<number or name>       extract captured substring
+      getall                     extract all captured substrings
+  /g  global                     global matching
+      heapframes_size            show match data heapframes size
+      heap_limit=<n>             set a limit on heap memory (Kbytes)
+      jitstack=<n>               set size of JIT stack
+      mark                       show mark values
+      match_limit=<n>            set a match limit
+      memory                     show heap memory usage
+      null_context               match with a NULL context
+      null_replacement           substitute with NULL replacement
+      null_subject               match with NULL subject
+      offset=<n>                 set starting offset
+      offset_limit=<n>           set offset limit
+      ovector=<n>                set size of output vector
+      recursion_limit=<n>        obsolete synonym for depth_limit
+      replace=<string>           specify a replacement string
+      startchar                  show startchar when relevant
+      startoffset=<n>            same as offset=<n>
+      substitute_callout         use substitution callouts
+      substitute_case_callout    use substitution case callouts
+      substitute_extended        use PCRE2_SUBSTITUTE_EXTENDED
+      substitute_literal         use PCRE2_SUBSTITUTE_LITERAL
+      substitute_matched         use PCRE2_SUBSTITUTE_MATCHED
+      substitute_overflow_length use PCRE2_SUBSTITUTE_OVERFLOW_LENGTH
+      substitute_replacement_only use PCRE2_SUBSTITUTE_REPLACEMENT_ONLY
+      substitute_skip=<n>        skip substitution number n
+      substitute_stop=<n>        skip substitution number n and greater
+      substitute_unknown_unset   use PCRE2_SUBSTITUTE_UNKNOWN_UNSET
+      substitute_unset_empty     use PCRE2_SUBSTITUTE_UNSET_EMPTY
+      zero_terminate             pass the subject as zero-terminated
+
+The effects of these modifiers are described in the following sections. When +matching via the POSIX wrapper API, the aftertext, allaftertext, +and ovector subject modifiers work as described below. All other +modifiers are either ignored, with a warning message, or cause an error. +

+
+Showing more text +
+

+The aftertext modifier requests that as well as outputting the part of +the subject string that matched the entire pattern, pcre2test should in +addition output the remainder of the subject string. This is useful for tests +where the subject contains multiple copies of the same substring. The +allaftertext modifier requests the same action for captured substrings as +well as the main matched substring. In each case the remainder is output on the +following line with a plus character following the capture number. +

+

+The allusedtext modifier requests that all the text that was consulted +during a successful pattern match by the interpreter should be shown, for both +full and partial matches. This feature is not supported for JIT matching, and +if requested with JIT it is ignored (with a warning message). Setting this +modifier affects the output if there is a lookbehind at the start of a match, +or, for a complete match, a lookahead at the end, or if \K is used in the +pattern. Characters that precede or follow the start and end of the actual +match are indicated in the output by '<' or '>' characters underneath them. +Here is an example: +

+    re> /(?<=pqr)abc(?=xyz)/
+  data> 123pqrabcxyz456\=allusedtext
+   0: pqrabcxyz
+      <<<   >>>
+  data> 123pqrabcxy\=ph,allusedtext
+  Partial match: pqrabcxy
+                 <<<
+
+The first, complete match shows that the matched string is "abc", with the +preceding and following strings "pqr" and "xyz" having been consulted during +the match (when processing the assertions). The partial match can indicate only +the preceding string. +

+

+The startchar modifier requests that the starting character for the match +be indicated, if it is different to the start of the matched string. The only +time when this occurs is when \K has been processed as part of the match. In +this situation, the output for the matched string is displayed from the +starting character instead of from the match point, with circumflex characters +under the earlier characters. For example: +

+    re> /abc\Kxyz/
+  data> abcxyz\=startchar
+   0: abcxyz
+      ^^^
+
+Unlike allusedtext, the startchar modifier can be used with JIT. +However, these two modifiers are mutually exclusive. +

+
+Showing the value of all capture groups +
+

+The allcaptures modifier requests that the values of all potential +captured parentheses be output after a match. By default, only those up to the +highest one actually used in the match are output (corresponding to the return +code from pcre2_match()). Groups that did not take part in the match +are output as "<unset>". This modifier is not relevant for DFA matching (which +does no capturing) and does not apply when replace is specified; it is +ignored, with a warning message, if present. +

+
+Showing the entire ovector, for all outcomes +
+

+The allvector modifier requests that the entire ovector be shown, +whatever the outcome of the match. Compare allcaptures, which shows only +up to the maximum number of capture groups for the pattern, and then only for a +successful complete non-DFA match. This modifier, which acts after any match +result, and also for DFA matching, provides a means of checking that there are +no unexpected modifications to ovector fields. Before each match attempt, the +ovector is filled with a special value, and if this is found in both elements +of a capturing pair, "<unchanged>" is output. After a successful match, this +applies to all groups after the maximum capture group for the pattern. In other +cases it applies to the entire ovector. After a partial match, the first two +elements are the only ones that should be set. After a DFA match, the amount of +ovector that is used depends on the number of matches that were found. +

+
+Testing pattern callouts +
+

+A callout function is supplied when pcre2test calls the library matching +functions, unless callout_none is specified. Its behaviour can be +controlled by various modifiers listed above whose names begin with +callout_. Details are given in the section entitled "Callouts" +below. +Testing callouts from pcre2_substitute() is described separately in +"Testing the substitution function" +below. +

+
+Finding all matches in a string +
+

+Searching for all possible matches within a subject can be requested by the +global or altglobal modifier. After finding a match, the matching +function is called again to search the remainder of the subject. The difference +between global and altglobal is that the former uses the +start_offset argument to pcre2_match() or pcre2_dfa_match() +to start searching at a new point within the entire string (which is what Perl +does), whereas the latter passes over a shortened subject. This makes a +difference to the matching process if the pattern begins with a lookbehind +assertion (including \b or \B). +

+

+If an empty string is matched, the next match is done with the +PCRE2_NOTEMPTY_ATSTART and PCRE2_ANCHORED flags set, in order to search for +another, non-empty, match at the same point in the subject. If this match +fails, the start offset is advanced, and the normal match is retried. This +imitates the way Perl handles such cases when using the /g modifier or +the split() function. Normally, the start offset is advanced by one +character, but if the newline convention recognizes CRLF as a newline, and the +current character is CR followed by LF, an advance of two characters occurs. +

+
+Testing substring extraction functions +
+

+The copy and get modifiers can be used to test the +pcre2_substring_copy_xxx() and pcre2_substring_get_xxx() functions. +They can be given more than once, and each can specify a capture group name or +number, for example: +

+   abcd\=copy=1,copy=3,get=G1
+
+If the #subject command is used to set default copy and/or get lists, +these can be unset by specifying a negative number to cancel all numbered +groups and an empty name to cancel all named groups. +

+

+The getall modifier tests pcre2_substring_list_get(), which +extracts all captured substrings. +

+

+If the subject line is successfully matched, the substrings extracted by the +convenience functions are output with C, G, or L after the string number +instead of a colon. This is in addition to the normal full list. The string +length (that is, the return from the extraction function) is given in +parentheses after each substring, followed by the name when the extraction was +by name. +

+
+Testing the substitution function +
+

+If the replace modifier is set, the pcre2_substitute() function is +called instead of one of the matching functions (or after one call of +pcre2_match() in the case of PCRE2_SUBSTITUTE_MATCHED). Note that +replacement strings cannot contain commas, because a comma signifies the end of +a modifier. This is not thought to be an issue in a test program. +

+

+Specifying a completely empty replacement string disables this modifier. +However, it is possible to specify an empty replacement by providing a buffer +length, as described below, for an otherwise empty replacement. +

+

+Unlike subject strings, pcre2test does not process replacement strings +for escape sequences. In UTF mode, a replacement string is checked to see if it +is a valid UTF-8 string. If so, it is correctly converted to a UTF string of +the appropriate code unit width. If it is not a valid UTF-8 string, the +individual code units are copied directly. This provides a means of passing an +invalid UTF-8 string for testing purposes. +

+

+The following modifiers set options (in additional to the normal match options) +for pcre2_substitute(): +

+  global                      PCRE2_SUBSTITUTE_GLOBAL
+  substitute_extended         PCRE2_SUBSTITUTE_EXTENDED
+  substitute_literal          PCRE2_SUBSTITUTE_LITERAL
+  substitute_matched          PCRE2_SUBSTITUTE_MATCHED
+  substitute_overflow_length  PCRE2_SUBSTITUTE_OVERFLOW_LENGTH
+  substitute_replacement_only PCRE2_SUBSTITUTE_REPLACEMENT_ONLY
+  substitute_unknown_unset    PCRE2_SUBSTITUTE_UNKNOWN_UNSET
+  substitute_unset_empty      PCRE2_SUBSTITUTE_UNSET_EMPTY
+
+See the +pcre2api +documentation for details of these options. +

+

+After a successful substitution, the modified string is output, preceded by the +number of replacements. This may be zero if there were no matches. Here is a +simple example of a substitution test: +

+  /abc/replace=xxx
+      =abc=abc=
+   1: =xxx=abc=
+      =abc=abc=\=global
+   2: =xxx=xxx=
+
+Subject and replacement strings should be kept relatively short (fewer than 256 +characters) for substitution tests, as fixed-size buffers are used. To make it +easy to test for buffer overflow, if the replacement string starts with a +number in square brackets, that number is passed to pcre2_substitute() as +the size of the output buffer, with the replacement string starting at the next +character. Here is an example that tests the edge case: +
+  /abc/
+      123abc123\=replace=[10]XYZ
+   1: 123XYZ123
+      123abc123\=replace=[9]XYZ
+  Failed: error -47: no more memory
+
+The default action of pcre2_substitute() is to return +PCRE2_ERROR_NOMEMORY when the output buffer is too small. However, if the +PCRE2_SUBSTITUTE_OVERFLOW_LENGTH option is set (by using the +substitute_overflow_length modifier), pcre2_substitute() continues +to go through the motions of matching and substituting (but not doing any +callouts), in order to compute the size of buffer that is required. When this +happens, pcre2test shows the required buffer length (which includes space +for the trailing zero) as part of the error message. For example: +
+  /abc/substitute_overflow_length
+      123abc123\=replace=[9]XYZ
+  Failed: error -47: no more memory: 10 code units are needed
+
+A replacement string is ignored with POSIX and DFA matching. Specifying partial +matching provokes an error return ("bad option value") from +pcre2_substitute(). +

+
+Testing substitute callouts +
+

+If the substitute_callout modifier is set, a substitution callout +function is set up. The null_context modifier must not be set, because +the address of the callout function is passed in a match context. When the +callout function is called (after each substitution), details of the input +and output strings are output. For example: +

+  /abc/g,replace=<$0>,substitute_callout
+      abcdefabcpqr
+   1(1) Old 0 3 "abc" New 0 5 "<abc>"
+   2(1) Old 6 9 "abc" New 8 13 "<abc>"
+   2: <abc>def<abc>pqr
+
+The first number on each callout line is the count of matches. The +parenthesized number is the number of pairs that are set in the ovector (that +is, one more than the number of capturing groups that were set). Then are +listed the offsets of the old substring, its contents, and the same for the +replacement. +

+

+By default, the substitution callout function returns zero, which accepts the +replacement and causes matching to continue if /g was used. Two further +modifiers can be used to test other return values. If substitute_skip is +set to a value greater than zero the callout function returns +1 for the match +of that number, and similarly substitute_stop returns -1. These cause the +replacement to be rejected, and -1 causes no further matching to take place. If +either of them are set, substitute_callout is assumed. For example: +

+  /abc/g,replace=<$0>,substitute_skip=1
+      abcdefabcpqr
+   1(1) Old 0 3 "abc" New 0 5 "<abc> SKIPPED"
+   2(1) Old 6 9 "abc" New 6 11 "<abc>"
+   2: abcdef<abc>pqr
+      abcdefabcpqr\=substitute_stop=1
+   1(1) Old 0 3 "abc" New 0 5 "<abc> STOPPED"
+   1: abcdefabcpqr
+
+If both are set for the same number, stop takes precedence. Only a single skip +or stop is supported, which is sufficient for testing that the feature works. +

+
+Testing substitute case callouts +
+

+If the substitute_case_callout modifier is set, a substitution +case callout function is set up. The callout function is called for each +substituted chunk which is to be case-transformed. +

+

+The callout function passed is a fixed function with implementation for certain +behaviours: inputs which shrink when case-transformed; inputs which grow; inputs +with distinct upper/lower/titlecase forms. The characters which are not +special-cased for testing purposes are left unmodified, as if they are caseless +characters. +

+
+Setting the JIT stack size +
+

+The jitstack modifier provides a way of setting the maximum stack size +that is used by the just-in-time optimization code. It is ignored if JIT +optimization is not being used. The value is a number of kibibytes (units of +1024 bytes). Setting zero reverts to the default of 32KiB. Providing a stack +that is larger than the default is necessary only for very complicated +patterns. If jitstack is set non-zero on a subject line it overrides any +value that was set on the pattern. +

+
+Setting heap, match, and depth limits +
+

+The heap_limit, match_limit, and depth_limit modifiers set +the appropriate limits in the match context. These values are ignored when the +find_limits or find_limits_noheap modifier is specified. +

+
+Finding minimum limits +
+

+If the find_limits modifier is present on a subject line, pcre2test +calls the relevant matching function several times, setting different values in +the match context via pcre2_set_heap_limit(), +pcre2_set_match_limit(), or pcre2_set_depth_limit() until it finds +the smallest value for each parameter that allows the match to complete without +a "limit exceeded" error. The match itself may succeed or fail. An alternative +modifier, find_limits_noheap, omits the heap limit. This is used in the +standard tests, because the minimum heap limit varies between systems. If JIT +is being used, only the match limit is relevant, and the other two are +automatically omitted. +

+

+When using this modifier, the pattern should not contain any limit settings +such as (*LIMIT_MATCH=...) within it. If such a setting is present and is +lower than the minimum matching value, the minimum value cannot be found +because pcre2_set_match_limit() etc. are only able to reduce the value of +an in-pattern limit; they cannot increase it. +

+

+For non-DFA matching, the minimum depth_limit number is a measure of how +much nested backtracking happens (that is, how deeply the pattern's tree is +searched). In the case of DFA matching, depth_limit controls the depth of +recursive calls of the internal function that is used for handling pattern +recursion, lookaround assertions, and atomic groups. +

+

+For non-DFA matching, the match_limit number is a measure of the amount +of backtracking that takes place, and learning the minimum value can be +instructive. For most simple matches, the number is quite small, but for +patterns with very large numbers of matching possibilities, it can become large +very quickly with increasing length of subject string. In the case of DFA +matching, match_limit controls the total number of calls, both recursive +and non-recursive, to the internal matching function, thus controlling the +overall amount of computing resource that is used. +

+

+For both kinds of matching, the heap_limit number, which is in kibibytes +(units of 1024 bytes), limits the amount of heap memory used for matching. +

+
+Showing MARK names +
+

+The mark modifier causes the names from backtracking control verbs that +are returned from calls to pcre2_match() to be displayed. If a mark is +returned for a match, non-match, or partial match, pcre2test shows it. +For a match, it is on a line by itself, tagged with "MK:". Otherwise, it +is added to the non-match message. +

+
+Showing memory usage +
+

+The memory modifier causes pcre2test to log the sizes of all heap +memory allocation and freeing calls that occur during a call to +pcre2_match() or pcre2_dfa_match(). In the latter case, heap memory +is used only when a match requires more internal workspace that the default +allocation on the stack, so in many cases there will be no output. No heap +memory is allocated during matching with JIT. For this modifier to work, the +null_context modifier must not be set on both the pattern and the +subject, though it can be set on one or the other. +

+
+Showing the heap frame overall vector size +
+

+The heapframes_size modifier is relevant for matches using +pcre2_match() without JIT. After a match has run (whether successful or +not) the size, in bytes, of the allocated heap frames vector that is left +attached to the match data block is shown. If the matching action involved +several calls to pcre2_match() (for example, global matching or for +timing) only the final value is shown. +

+

+This modifier is ignored, with a warning, for POSIX or DFA matching. JIT +matching does not use the heap frames vector, so the size is always zero, +unless there was a previous non-JIT match. Note that specifing a size of zero +for the output vector (see below) causes pcre2test to free its match data +block (and associated heap frames vector) and allocate a new one. +

+
+Setting a starting offset +
+

+The offset modifier sets an offset in the subject string at which +matching starts. Its value is a number of code units, not characters. +

+
+Setting an offset limit +
+

+The offset_limit modifier sets a limit for unanchored matches. If a match +cannot be found starting at or before this offset in the subject, a "no match" +return is given. The data value is a number of code units, not characters. When +this modifier is used, the use_offset_limit modifier must have been set +for the pattern; if not, an error is generated. +

+
+Setting the size of the output vector +
+

+The ovector modifier applies only to the subject line in which it +appears, though of course it can also be used to set a default in a +#subject command. It specifies the number of pairs of offsets that are +available for storing matching information. The default is 15. +

+

+A value of zero is useful when testing the POSIX API because it causes +regexec() to be called with a NULL capture vector. When not testing the +POSIX API, a value of zero is used to cause +pcre2_match_data_create_from_pattern() to be called, in order to create a +new match block of exactly the right size for the pattern. (It is not possible +to create a match block with a zero-length ovector; there is always at least +one pair of offsets.) The old match data block is freed. +

+
+Passing the subject as zero-terminated +
+

+By default, the subject string is passed to a native API matching function with +its correct length. In order to test the facility for passing a zero-terminated +string, the zero_terminate modifier is provided. It causes the length to +be passed as PCRE2_ZERO_TERMINATED. When matching via the POSIX interface, +this modifier is ignored, with a warning. +

+

+When testing pcre2_substitute(), this modifier also has the effect of +passing the replacement string as zero-terminated. +

+
+Passing a NULL context, subject, or replacement +
+

+Normally, pcre2test passes a context block to pcre2_match(), +pcre2_dfa_match(), pcre2_jit_match() or pcre2_substitute(). +If the null_context modifier is set, however, NULL is passed. This is for +testing that the matching and substitution functions behave correctly in this +case (they use default values). This modifier cannot be used with the +find_limits, find_limits_noheap, or substitute_callout +modifiers. +

+

+Similarly, for testing purposes, if the null_subject or +null_replacement modifier is set, the subject or replacement string +pointers are passed as NULL, respectively, to the relevant functions. +

+
THE ALTERNATIVE MATCHING FUNCTION
+

+By default, pcre2test uses the standard PCRE2 matching function, +pcre2_match() to match each subject line. PCRE2 also supports an +alternative matching function, pcre2_dfa_match(), which operates in a +different way, and has some restrictions. The differences between the two +functions are described in the +pcre2matching +documentation. +

+

+If the dfa modifier is set, the alternative matching function is used. +This function finds all possible matches at a given point in the subject. If, +however, the dfa_shortest modifier is set, processing stops after the +first match is found. This is always the shortest possible match. +

+
DEFAULT OUTPUT FROM pcre2test
+

+This section describes the output when the normal matching function, +pcre2_match(), is being used. +

+

+When a match succeeds, pcre2test outputs the list of captured substrings, +starting with number 0 for the string that matched the whole pattern. +Otherwise, it outputs "No match" when the return is PCRE2_ERROR_NOMATCH, or +"Partial match:" followed by the partially matching substring when the +return is PCRE2_ERROR_PARTIAL. (Note that this is the +entire substring that was inspected during the partial match; it may include +characters before the actual match start if a lookbehind assertion, \K, \b, +or \B was involved.) +

+

+For any other return, pcre2test outputs the PCRE2 negative error number +and a short descriptive phrase. If the error is a failed UTF string check, the +code unit offset of the start of the failing character is also output. Here is +an example of an interactive pcre2test run. +

+  $ pcre2test
+  PCRE2 version 10.22 2016-07-29
+
+    re> /^abc(\d+)/
+  data> abc123
+   0: abc123
+   1: 123
+  data> xyz
+  No match
+
+Unset capturing substrings that are not followed by one that is set are not +shown by pcre2test unless the allcaptures modifier is specified. In +the following example, there are two capturing substrings, but when the first +data line is matched, the second, unset substring is not shown. An "internal" +unset substring is shown as "<unset>", as for the second data line. +
+    re> /(a)|(b)/
+  data> a
+   0: a
+   1: a
+  data> b
+   0: b
+   1: <unset>
+   2: b
+
+If the strings contain any non-printing characters, they are output as \xhh +escapes if the value is less than 256 and UTF mode is not set. Otherwise they +are output as \x{hh...} escapes. See below for the definition of non-printing +characters. If the aftertext modifier is set, the output for substring 0 +is followed by the rest of the subject string, identified by "0+" like this: +
+    re> /cat/aftertext
+  data> cataract
+   0: cat
+   0+ aract
+
+If global matching is requested, the results of successive matching attempts +are output in sequence, like this: +
+    re> /\Bi(\w\w)/g
+  data> Mississippi
+   0: iss
+   1: ss
+   0: iss
+   1: ss
+   0: ipp
+   1: pp
+
+"No match" is output only if the first match attempt fails. Here is an example +of a failure message (the offset 4 that is specified by the offset +modifier is past the end of the subject string): +
+    re> /xyz/
+  data> xyz\=offset=4
+  Error -24 (bad offset value)
+
+

+

+Note that whereas patterns can be continued over several lines (a plain ">" +prompt is used for continuations), subject lines may not. However newlines can +be included in a subject by means of the \n escape (or \r, \r\n, etc., +depending on the newline sequence setting). +

+
OUTPUT FROM THE ALTERNATIVE MATCHING FUNCTION
+

+When the alternative matching function, pcre2_dfa_match(), is used, the +output consists of a list of all the matches that start at the first point in +the subject where there is at least one match. For example: +

+    re> /(tang|tangerine|tan)/
+  data> yellow tangerine\=dfa
+   0: tangerine
+   1: tang
+   2: tan
+
+Using the normal matching function on this data finds only "tang". The +longest matching string is always given first (and numbered zero). After a +PCRE2_ERROR_PARTIAL return, the output is "Partial match:", followed by the +partially matching substring. Note that this is the entire substring that was +inspected during the partial match; it may include characters before the actual +match start if a lookbehind assertion, \b, or \B was involved. (\K is not +supported for DFA matching.) +

+

+If global matching is requested, the search for further matches resumes +at the end of the longest match. For example: +

+    re> /(tang|tangerine|tan)/g
+  data> yellow tangerine and tangy sultana\=dfa
+   0: tangerine
+   1: tang
+   2: tan
+   0: tang
+   1: tan
+   0: tan
+
+The alternative matching function does not support substring capture, so the +modifiers that are concerned with captured substrings are not relevant. +

+
RESTARTING AFTER A PARTIAL MATCH
+

+When the alternative matching function has given the PCRE2_ERROR_PARTIAL +return, indicating that the subject partially matched the pattern, you can +restart the match with additional subject data by means of the +dfa_restart modifier. For example: +

+    re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/
+  data> 23ja\=ps,dfa
+  Partial match: 23ja
+  data> n05\=dfa,dfa_restart
+   0: n05
+
+For further information about partial matching, see the +pcre2partial +documentation. +

+
CALLOUTS
+

+If the pattern contains any callout requests, pcre2test's callout +function is called during matching unless callout_none is specified. This +works with both matching functions, and with JIT, though there are some +differences in behaviour. The output for callouts with numerical arguments and +those with string arguments is slightly different. +

+
+Callouts with numerical arguments +
+

+By default, the callout function displays the callout number, the start and +current positions in the subject text at the callout time, and the next pattern +item to be tested. For example: +

+  --->pqrabcdef
+    0    ^  ^     \d
+
+This output indicates that callout number 0 occurred for a match attempt +starting at the fourth character of the subject string, when the pointer was at +the seventh character, and when the next pattern item was \d. Just +one circumflex is output if the start and current positions are the same, or if +the current position precedes the start position, which can happen if the +callout is in a lookbehind assertion. +

+

+Callouts numbered 255 are assumed to be automatic callouts, inserted as a +result of the auto_callout pattern modifier. In this case, instead of +showing the callout number, the offset in the pattern, preceded by a plus, is +output. For example: +

+    re> /\d?[A-E]\*/auto_callout
+  data> E*
+  --->E*
+   +0 ^      \d?
+   +3 ^      [A-E]
+   +8 ^^     \*
+  +10 ^ ^
+   0: E*
+
+If a pattern contains (*MARK) items, an additional line is output whenever +a change of latest mark is passed to the callout function. For example: +
+    re> /a(*MARK:X)bc/auto_callout
+  data> abc
+  --->abc
+   +0 ^       a
+   +1 ^^      (*MARK:X)
+  +10 ^^      b
+  Latest Mark: X
+  +11 ^ ^     c
+  +12 ^  ^
+   0: abc
+
+The mark changes between matching "a" and "b", but stays the same for the rest +of the match, so nothing more is output. If, as a result of backtracking, the +mark reverts to being unset, the text "<unset>" is output. +

+
+Callouts with string arguments +
+

+The output for a callout with a string argument is similar, except that instead +of outputting a callout number before the position indicators, the callout +string and its offset in the pattern string are output before the reflection of +the subject string, and the subject string is reflected for each callout. For +example: +

+    re> /^ab(?C'first')cd(?C"second")ef/
+  data> abcdefg
+  Callout (7): 'first'
+  --->abcdefg
+      ^ ^         c
+  Callout (20): "second"
+  --->abcdefg
+      ^   ^       e
+   0: abcdef
+
+
+

+
+Callout modifiers +
+

+The callout function in pcre2test returns zero (carry on matching) by +default, but you can use a callout_fail modifier in a subject line to +change this and other parameters of the callout (see below). +

+

+If the callout_capture modifier is set, the current captured groups are +output when a callout occurs. This is useful only for non-DFA matching, as +pcre2_dfa_match() does not support capturing, so no captures are ever +shown. +

+

+The normal callout output, showing the callout number or pattern offset (as +described above) is suppressed if the callout_no_where modifier is set. +

+

+When using the interpretive matching function pcre2_match() without JIT, +setting the callout_extra modifier causes additional output from +pcre2test's callout function to be generated. For the first callout in a +match attempt at a new starting position in the subject, "New match attempt" is +output. If there has been a backtrack since the last callout (or start of +matching if this is the first callout), "Backtrack" is output, followed by "No +other matching paths" if the backtrack ended the previous match attempt. For +example: +

+   re> /(a+)b/auto_callout,no_start_optimize,no_auto_possess
+  data> aac\=callout_extra
+  New match attempt
+  --->aac
+   +0 ^       (
+   +1 ^       a+
+   +3 ^ ^     )
+   +4 ^ ^     b
+  Backtrack
+  --->aac
+   +3 ^^      )
+   +4 ^^      b
+  Backtrack
+  No other matching paths
+  New match attempt
+  --->aac
+   +0  ^      (
+   +1  ^      a+
+   +3  ^^     )
+   +4  ^^     b
+  Backtrack
+  No other matching paths
+  New match attempt
+  --->aac
+   +0   ^     (
+   +1   ^     a+
+  Backtrack
+  No other matching paths
+  New match attempt
+  --->aac
+   +0    ^    (
+   +1    ^    a+
+  No match
+
+Notice that various optimizations must be turned off if you want all possible +matching paths to be scanned. If no_start_optimize is not used, there is +an immediate "no match", without any callouts, because the starting +optimization fails to find "b" in the subject, which it knows must be present +for any match. If no_auto_possess is not used, the "a+" item is turned +into "a++", which reduces the number of backtracks. +

+

+The callout_extra modifier has no effect if used with the DFA matching +function, or with JIT. +

+
+Return values from callouts +
+

+The default return from the callout function is zero, which allows matching to +continue. The callout_fail modifier can be given one or two numbers. If +there is only one number, 1 is returned instead of 0 (causing matching to +backtrack) when a callout of that number is reached. If two numbers (<n>:<m>) +are given, 1 is returned when callout <n> is reached and there have been at +least <m> callouts. The callout_error modifier is similar, except that +PCRE2_ERROR_CALLOUT is returned, causing the entire matching process to be +aborted. If both these modifiers are set for the same callout number, +callout_error takes precedence. Note that callouts with string arguments +are always given the number zero. +

+

+The callout_data modifier can be given an unsigned or a negative number. +This is set as the "user data" that is passed to the matching function, and +passed back when the callout function is invoked. Any value other than zero is +used as a return from pcre2test's callout function. +

+

+Inserting callouts can be helpful when using pcre2test to check +complicated regular expressions. For further information about callouts, see +the +pcre2callout +documentation. +

+
NON-PRINTING CHARACTERS
+

+When pcre2test is outputting text in the compiled version of a pattern, +bytes other than 32-126 are always treated as non-printing characters and are +therefore shown as hex escapes. +

+

+When pcre2test is outputting text that is a matched part of a subject +string, it behaves in the same way, unless a different locale has been set for +the pattern (using the locale modifier). In this case, the +isprint() function is used to distinguish printing and non-printing +characters. +

+
SAVING AND RESTORING COMPILED PATTERNS
+

+It is possible to save compiled patterns on disc or elsewhere, and reload them +later, subject to a number of restrictions. JIT data cannot be saved. The host +on which the patterns are reloaded must be running the same version of PCRE2, +with the same code unit width, and must also have the same endianness, pointer +width and PCRE2_SIZE type. Before compiled patterns can be saved they must be +serialized, that is, converted to a stream of bytes. A single byte stream may +contain any number of compiled patterns, but they must all use the same +character tables. A single copy of the tables is included in the byte stream +(its size is 1088 bytes). +

+

+The functions whose names begin with pcre2_serialize_ are used +for serializing and de-serializing. They are described in the +pcre2serialize +documentation. In this section we describe the features of pcre2test that +can be used to test these functions. +

+

+Note that "serialization" in PCRE2 does not convert compiled patterns to an +abstract format like Java or .NET. It just makes a reloadable byte code stream. +Hence the restrictions on reloading mentioned above. +

+

+In pcre2test, when a pattern with push modifier is successfully +compiled, it is pushed onto a stack of compiled patterns, and pcre2test +expects the next line to contain a new pattern (or command) instead of a +subject line. By contrast, the pushcopy modifier causes a copy of the +compiled pattern to be stacked, leaving the original available for immediate +matching. By using push and/or pushcopy, a number of patterns can +be compiled and retained. These modifiers are incompatible with posix, +and control modifiers that act at match time are ignored (with a message) for +the stacked patterns. The jitverify modifier applies only at compile +time. +

+

+The command +

+  #save <filename>
+
+causes all the stacked patterns to be serialized and the result written to the +named file. Afterwards, all the stacked patterns are freed. The command +
+  #load <filename>
+
+reads the data in the file, and then arranges for it to be de-serialized, with +the resulting compiled patterns added to the pattern stack. The pattern on the +top of the stack can be retrieved by the #pop command, which must be followed +by lines of subjects that are to be matched with the pattern, terminated as +usual by an empty line or end of file. This command may be followed by a +modifier list containing only +control modifiers +that act after a pattern has been compiled. In particular, hex, +posix, posix_nosub, push, and pushcopy are not allowed, +nor are any +option-setting modifiers. +The JIT modifiers are, however permitted. Here is an example that saves and +reloads two patterns. +
+  /abc/push
+  /xyz/push
+  #save tempfile
+  #load tempfile
+  #pop info
+  xyz
+
+  #pop jit,bincode
+  abc
+
+If jitverify is used with #pop, it does not automatically imply +jit, which is different behaviour from when it is used on a pattern. +

+

+The #popcopy command is analogous to the pushcopy modifier in that it +makes current a copy of the topmost stack pattern, leaving the original still +on the stack. +

+
SEE ALSO
+

+pcre2(3), pcre2api(3), pcre2callout(3), +pcre2jit, pcre2matching(3), pcre2partial(d), +pcre2pattern(3), pcre2serialize(3). +

+
AUTHOR
+

+Philip Hazel +
+Retired from University Computing Service +
+Cambridge, England. +
+

+
REVISION
+

+Last updated: 26 December 2024 +
+Copyright © 1997-2024 University of Cambridge. +
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/html/pcre2unicode.html b/miniconda3/share/doc/pcre2/html/pcre2unicode.html new file mode 100644 index 0000000000000000000000000000000000000000..5b425329fac8687816f30121e8a42e70ff7b500e --- /dev/null +++ b/miniconda3/share/doc/pcre2/html/pcre2unicode.html @@ -0,0 +1,556 @@ + + +pcre2unicode specification + + +

pcre2unicode man page

+

+Return to the PCRE2 index page. +

+

+This page is part of the PCRE2 HTML documentation. It was generated +automatically from the original man page. If there is any nonsense in it, +please consult the man page, in case the conversion went wrong. +
+
+UNICODE AND UTF SUPPORT +
+

+PCRE2 is normally built with Unicode support, though if you do not need it, you +can build it without, in which case the library will be smaller. With Unicode +support, PCRE2 has knowledge of Unicode character properties and can process +strings of text in UTF-8, UTF-16, and UTF-32 format (depending on the code unit +width), but this is not the default. Unless specifically requested, PCRE2 +treats each code unit in a string as one character. +

+

+There are two ways of telling PCRE2 to switch to UTF mode, where characters may +consist of more than one code unit and the range of values is constrained. The +program can call +pcre2_compile() +with the PCRE2_UTF option, or the pattern may start with the sequence (*UTF). +However, the latter facility can be locked out by the PCRE2_NEVER_UTF option. +That is, the programmer can prevent the supplier of the pattern from switching +to UTF mode. +

+

+Note that the PCRE2_MATCH_INVALID_UTF option (see +below) +forces PCRE2_UTF to be set. +

+

+In UTF mode, both the pattern and any subject strings that are matched against +it are treated as UTF strings instead of strings of individual one-code-unit +characters. There are also some other changes to the way characters are +handled, as documented below. +

+
+UNICODE PROPERTY SUPPORT +
+

+When PCRE2 is built with Unicode support, the escape sequences \p{..}, +\P{..}, and \X can be used. This is not dependent on the PCRE2_UTF setting. +The Unicode properties that can be tested are a subset of those that Perl +supports. Currently they are limited to the general category properties such as +Lu for an upper case letter or Nd for a decimal number, the derived properties +Any and Lc (synonym L&), the Unicode script names such as Arabic or Han, +Bidi_Class, Bidi_Control, and a few binary properties. +

+

+The full lists are given in the +pcre2pattern +and +pcre2syntax +documentation. In general, only the short names for properties are supported. +For example, \p{L} matches a letter. Its longer synonym, \p{Letter}, is not +supported. Furthermore, in Perl, many properties may optionally be prefixed by +"Is", for compatibility with Perl 5.6. PCRE2 does not support this. +

+
+WIDE CHARACTERS AND UTF MODES +
+

+Code points less than 256 can be specified in patterns by either braced or +unbraced hexadecimal escape sequences (for example, \x{b3} or \xb3). Larger +values have to use braced sequences. Unbraced octal code points up to \777 are +also recognized; larger ones can be coded using \o{...}. +

+

+The escape sequence \N{U+<hex digits>} is recognized as another way of +specifying a Unicode character by code point in a UTF mode. It is not allowed +in non-UTF mode. +

+

+In UTF mode, repeat quantifiers apply to complete UTF characters, not to +individual code units. +

+

+In UTF mode, the dot metacharacter matches one UTF character instead of a +single code unit. +

+

+In UTF mode, capture group names are not restricted to ASCII, and may contain +any Unicode letters and decimal digits, as well as underscore. +

+

+The escape sequence \C can be used to match a single code unit in UTF mode, +but its use can lead to some strange effects because it breaks up multi-unit +characters (see the description of \C in the +pcre2pattern +documentation). For this reason, there is a build-time option that disables +support for \C completely. There is also a less draconian compile-time option +for locking out the use of \C when a pattern is compiled. +

+

+The use of \C is not supported by the alternative matching function +pcre2_dfa_match() when in UTF-8 or UTF-16 mode, that is, when a character +may consist of more than one code unit. The use of \C in these modes provokes +a match-time error. Also, the JIT optimization does not support \C in these +modes. If JIT optimization is requested for a UTF-8 or UTF-16 pattern that +contains \C, it will not succeed, and so when pcre2_match() is called, +the matching will be carried out by the interpretive function. +

+

+The character escapes \b, \B, \d, \D, \s, \S, \w, and \W correctly test +characters of any code value, but, by default, the characters that PCRE2 +recognizes as digits, spaces, or word characters remain the same set as in +non-UTF mode, all with code points less than 256. This remains true even when +PCRE2 is built to include Unicode support, because to do otherwise would slow +down matching in many common cases. Note that this also applies to \b +and \B, because they are defined in terms of \w and \W. If you want +to test for a wider sense of, say, "digit", you can use explicit Unicode +property tests such as \p{Nd}. Alternatively, if you set the PCRE2_UCP option, +the way that the character escapes work is changed so that Unicode properties +are used to determine which characters match, though there are some options +that suppress this for individual escapes. For details see the section on +generic character types +in the +pcre2pattern +documentation. +

+

+Like the escapes, characters that match the POSIX named character classes are +all low-valued characters unless the PCRE2_UCP option is set, but there is an +option to override this. +

+

+In contrast to the character escapes and character classes, the special +horizontal and vertical white space escapes (\h, \H, \v, and \V) do match +all the appropriate Unicode characters, whether or not PCRE2_UCP is set. +

+
+UNICODE CASE-EQUIVALENCE +
+

+If either PCRE2_UTF or PCRE2_UCP is set, upper/lower case processing makes use +of Unicode properties except for characters whose code points are less than 128 +and that have at most two case-equivalent values. For these, a direct table +lookup is used for speed. A few Unicode characters such as Greek sigma have +more than two code points that are case-equivalent, and these are treated +specially. Setting PCRE2_UCP without PCRE2_UTF allows Unicode-style case +processing for non-UTF character encodings such as UCS-2. +

+

+There are two ASCII characters (S and K) that, in addition to their ASCII lower +case equivalents, have a non-ASCII one as well (long S and Kelvin sign). +Recognition of these non-ASCII characters as case-equivalent to their ASCII +counterparts can be disabled by setting the PCRE2_EXTRA_CASELESS_RESTRICT +option. When this is set, all characters in a case equivalence must either be +ASCII or non-ASCII; there can be no mixing. +

+    Without PCRE2_EXTRA_CASELESS_RESTRICT:
+      'k' = 'K' = U+212A (Kelvin sign)
+      's' = 'S' = U+017F (long S)
+    With PCRE2_EXTRA_CASELESS_RESTRICT:
+      'k' = 'K'
+      U+212A (Kelvin sign)  only case-equivalent to itself
+      's' = 'S'
+      U+017F (long S)       only case-equivalent to itself
+
+

+

+One language family, Turkish and Azeri, has its own case-insensitivity rules, +which can be selected by setting PCRE2_EXTRA_TURKISH_CASING. This alters the +behaviour of the 'i', 'I', U+0130 (capital I with dot above), and U+0131 +(small dotless i) characters. +

+    Without PCRE2_EXTRA_TURKISH_CASING:
+      'i' = 'I'
+      U+0130 (capital I with dot above)  only case-equivalent to itself
+      U+0131 (small dotless i)           only case-equivalent to itself
+    With PCRE2_EXTRA_TURKISH_CASING:
+      'i' = U+0130 (capital I with dot above)
+      U+0131 (small dotless i) = 'I'
+
+

+

+It is not allowed to specify both PCRE2_EXTRA_CASELESS_RESTRICT and +PCRE2_EXTRA_TURKISH_CASING together. +

+

+From release 10.45 the Unicode letter properties Lu (upper case), Ll (lower +case), and Lt (title case) are all treated as Lc (cased letter) when caseless +matching is set by the PCRE2_CASELESS option or (?i) within the pattern. +

+
+SCRIPT RUNS +
+

+The pattern constructs (*script_run:...) and (*atomic_script_run:...), with +synonyms (*sr:...) and (*asr:...), verify that the string matched within the +parentheses is a script run. In concept, a script run is a sequence of +characters that are all from the same Unicode script. However, because some +scripts are commonly used together, and because some diacritical and other +marks are used with multiple scripts, it is not that simple. +

+

+Every Unicode character has a Script property, mostly with a value +corresponding to the name of a script, such as Latin, Greek, or Cyrillic. There +are also three special values: +

+

+"Unknown" is used for code points that have not been assigned, and also for the +surrogate code points. In the PCRE2 32-bit library, characters whose code +points are greater than the Unicode maximum (U+10FFFF), which are accessible +only in non-UTF mode, are assigned the Unknown script. +

+

+"Common" is used for characters that are used with many scripts. These include +punctuation, emoji, mathematical, musical, and currency symbols, and the ASCII +digits 0 to 9. +

+

+"Inherited" is used for characters such as diacritical marks that modify a +previous character. These are considered to take on the script of the character +that they modify. +

+

+Some Inherited characters are used with many scripts, but many of them are only +normally used with a small number of scripts. For example, U+102E0 (Coptic +Epact thousands mark) is used only with Arabic and Coptic. In order to make it +possible to check this, a Unicode property called Script Extension exists. Its +value is a list of scripts that apply to the character. For the majority of +characters, the list contains just one script, the same one as the Script +property. However, for characters such as U+102E0 more than one Script is +listed. There are also some Common characters that have a single, non-Common +script in their Script Extension list. +

+

+The next section describes the basic rules for deciding whether a given string +of characters is a script run. Note, however, that there are some special cases +involving the Chinese Han script, and an additional constraint for decimal +digits. These are covered in subsequent sections. +

+
+Basic script run rules +
+

+A string that is less than two characters long is a script run. This is the +only case in which an Unknown character can be part of a script run. Longer +strings are checked using only the Script Extensions property, not the basic +Script property. +

+

+If a character's Script Extension property is the single value "Inherited", it +is always accepted as part of a script run. This is also true for the property +"Common", subject to the checking of decimal digits described below. All the +remaining characters in a script run must have at least one script in common in +their Script Extension lists. In set-theoretic terminology, the intersection of +all the sets of scripts must not be empty. +

+

+A simple example is an Internet name such as "google.com". The letters are all +in the Latin script, and the dot is Common, so this string is a script run. +However, the Cyrillic letter "o" looks exactly the same as the Latin "o"; a +string that looks the same, but with Cyrillic "o"s is not a script run. +

+

+More interesting examples involve characters with more than one script in their +Script Extension. Consider the following characters: +

+  U+060C  Arabic comma
+  U+06D4  Arabic full stop
+
+The first has the Script Extension list Arabic, Hanifi Rohingya, Syriac, and +Thaana; the second has just Arabic and Hanifi Rohingya. Both of them could +appear in script runs of either Arabic or Hanifi Rohingya. The first could also +appear in Syriac or Thaana script runs, but the second could not. +

+
+The Chinese Han script +
+

+The Chinese Han script is commonly used in conjunction with other scripts for +writing certain languages. Japanese uses the Hiragana and Katakana scripts +together with Han; Korean uses Hangul and Han; Taiwanese Mandarin uses Bopomofo +and Han. These three combinations are treated as special cases when checking +script runs and are, in effect, "virtual scripts". Thus, a script run may +contain a mixture of Hiragana, Katakana, and Han, or a mixture of Hangul and +Han, or a mixture of Bopomofo and Han, but not, for example, a mixture of +Hangul and Bopomofo and Han. PCRE2 (like Perl) follows Unicode's Technical +Standard 39 ("Unicode Security Mechanisms", http://unicode.org/reports/tr39/) +in allowing such mixtures. +

+
+Decimal digits +
+

+Unicode contains many sets of 10 decimal digits in different scripts, and some +scripts (including the Common script) contain more than one set. Some of these +decimal digits them are visually indistinguishable from the common ASCII +digits. In addition to the script checking described above, if a script run +contains any decimal digits, they must all come from the same set of 10 +adjacent characters. +

+
+VALIDITY OF UTF STRINGS +
+

+When the PCRE2_UTF option is set, the strings passed as patterns and subjects +are (by default) checked for validity on entry to the relevant functions. If an +invalid UTF string is passed, a negative error code is returned. The code unit +offset to the offending character can be extracted from the match data block by +calling pcre2_get_startchar(), which is used for this purpose after a UTF +error. +

+

+In some situations, you may already know that your strings are valid, and +therefore want to skip these checks in order to improve performance, for +example in the case of a long subject string that is being scanned repeatedly. +If you set the PCRE2_NO_UTF_CHECK option at compile time or at match time, +PCRE2 assumes that the pattern or subject it is given (respectively) contains +only valid UTF code unit sequences. +

+

+If you pass an invalid UTF string when PCRE2_NO_UTF_CHECK is set, the result +is undefined and your program may crash or loop indefinitely or give incorrect +results. There is, however, one mode of matching that can handle invalid UTF +subject strings. This is enabled by passing PCRE2_MATCH_INVALID_UTF to +pcre2_compile() and is discussed below in the next section. The rest of +this section covers the case when PCRE2_MATCH_INVALID_UTF is not set. +

+

+Passing PCRE2_NO_UTF_CHECK to pcre2_compile() just disables the UTF check +for the pattern; it does not also apply to subject strings. If you want to +disable the check for a subject string you must pass this same option to +pcre2_match() or pcre2_dfa_match(). +

+

+UTF-16 and UTF-32 strings can indicate their endianness by special code knows +as a byte-order mark (BOM). The PCRE2 functions do not handle this, expecting +strings to be in host byte order. +

+

+Unless PCRE2_NO_UTF_CHECK is set, a UTF string is checked before any other +processing takes place. In the case of pcre2_match() and +pcre2_dfa_match() calls with a non-zero starting offset, the check is +applied only to that part of the subject that could be inspected during +matching, and there is a check that the starting offset points to the first +code unit of a character or to the end of the subject. If there are no +lookbehind assertions in the pattern, the check starts at the starting offset. +Otherwise, it starts at the length of the longest lookbehind before the +starting offset, or at the start of the subject if there are not that many +characters before the starting offset. Note that the sequences \b and \B are +one-character lookbehinds. +

+

+In addition to checking the format of the string, there is a check to ensure +that all code points lie in the range U+0 to U+10FFFF, excluding the surrogate +area. The so-called "non-character" code points are not excluded because +Unicode corrigendum #9 makes it clear that they should not be. +

+

+Characters in the "Surrogate Area" of Unicode are reserved for use by UTF-16, +where they are used in pairs to encode code points with values greater than +0xFFFF. The code points that are encoded by UTF-16 pairs are available +independently in the UTF-8 and UTF-32 encodings. (In other words, the whole +surrogate thing is a fudge for UTF-16 which unfortunately messes up UTF-8 and +UTF-32.) +

+

+Setting PCRE2_NO_UTF_CHECK at compile time does not disable the error that is +given if an escape sequence for an invalid Unicode code point is encountered in +the pattern. If you want to allow escape sequences such as \x{d800} (a +surrogate code point) you can set the PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES extra +option. However, this is possible only in UTF-8 and UTF-32 modes, because these +values are not representable in UTF-16. +

+
+Errors in UTF-8 strings +
+

+The following negative error codes are given for invalid UTF-8 strings: +

+  PCRE2_ERROR_UTF8_ERR1
+  PCRE2_ERROR_UTF8_ERR2
+  PCRE2_ERROR_UTF8_ERR3
+  PCRE2_ERROR_UTF8_ERR4
+  PCRE2_ERROR_UTF8_ERR5
+
+The string ends with a truncated UTF-8 character; the code specifies how many +bytes are missing (1 to 5). Although RFC 3629 restricts UTF-8 characters to be +no longer than 4 bytes, the encoding scheme (originally defined by RFC 2279) +allows for up to 6 bytes, and this is checked first; hence the possibility of +4 or 5 missing bytes. +
+  PCRE2_ERROR_UTF8_ERR6
+  PCRE2_ERROR_UTF8_ERR7
+  PCRE2_ERROR_UTF8_ERR8
+  PCRE2_ERROR_UTF8_ERR9
+  PCRE2_ERROR_UTF8_ERR10
+
+The two most significant bits of the 2nd, 3rd, 4th, 5th, or 6th byte of the +character do not have the binary value 0b10 (that is, either the most +significant bit is 0, or the next bit is 1). +
+  PCRE2_ERROR_UTF8_ERR11
+  PCRE2_ERROR_UTF8_ERR12
+
+A character that is valid by the RFC 2279 rules is either 5 or 6 bytes long; +these code points are excluded by RFC 3629. +
+  PCRE2_ERROR_UTF8_ERR13
+
+A 4-byte character has a value greater than 0x10ffff; these code points are +excluded by RFC 3629. +
+  PCRE2_ERROR_UTF8_ERR14
+
+A 3-byte character has a value in the range 0xd800 to 0xdfff; this range of +code points are reserved by RFC 3629 for use with UTF-16, and so are excluded +from UTF-8. +
+  PCRE2_ERROR_UTF8_ERR15
+  PCRE2_ERROR_UTF8_ERR16
+  PCRE2_ERROR_UTF8_ERR17
+  PCRE2_ERROR_UTF8_ERR18
+  PCRE2_ERROR_UTF8_ERR19
+
+A 2-, 3-, 4-, 5-, or 6-byte character is "overlong", that is, it codes for a +value that can be represented by fewer bytes, which is invalid. For example, +the two bytes 0xc0, 0xae give the value 0x2e, whose correct coding uses just +one byte. +
+  PCRE2_ERROR_UTF8_ERR20
+
+The two most significant bits of the first byte of a character have the binary +value 0b10 (that is, the most significant bit is 1 and the second is 0). Such a +byte can only validly occur as the second or subsequent byte of a multi-byte +character. +
+  PCRE2_ERROR_UTF8_ERR21
+
+The first byte of a character has the value 0xfe or 0xff. These values can +never occur in a valid UTF-8 string. +

+
+Errors in UTF-16 strings +
+

+The following negative error codes are given for invalid UTF-16 strings: +

+  PCRE2_ERROR_UTF16_ERR1  Missing low surrogate at end of string
+  PCRE2_ERROR_UTF16_ERR2  Invalid low surrogate follows high surrogate
+  PCRE2_ERROR_UTF16_ERR3  Isolated low surrogate
+
+
+

+
+Errors in UTF-32 strings +
+

+The following negative error codes are given for invalid UTF-32 strings: +

+  PCRE2_ERROR_UTF32_ERR1  Surrogate character (0xd800 to 0xdfff)
+  PCRE2_ERROR_UTF32_ERR2  Code point is greater than 0x10ffff
+
+
+

+
+MATCHING IN INVALID UTF STRINGS +
+

+You can run pattern matches on subject strings that may contain invalid UTF +sequences if you call pcre2_compile() with the PCRE2_MATCH_INVALID_UTF +option. This is supported by pcre2_match(), including JIT matching, but +not by pcre2_dfa_match(). When PCRE2_MATCH_INVALID_UTF is set, it forces +PCRE2_UTF to be set as well. Note, however, that the pattern itself must be a +valid UTF string. +

+

+If you do not set PCRE2_MATCH_INVALID_UTF when calling pcre2_compile, and +you are not certain that your subject strings are valid UTF sequences, you +should not make use of the JIT "fast path" function pcre2_jit_match() +because it bypasses sanity checks, including the one for UTF validity. An +invalid string may cause undefined behaviour, including looping, crashing, or +giving the wrong answer. +

+

+Setting PCRE2_MATCH_INVALID_UTF does not affect what pcre2_compile() +generates, but if pcre2_jit_compile() is subsequently called, it does +generate different code. If JIT is not used, the option affects the behaviour +of the interpretive code in pcre2_match(). When PCRE2_MATCH_INVALID_UTF +is set at compile time, PCRE2_NO_UTF_CHECK is ignored at match time. +

+

+In this mode, an invalid code unit sequence in the subject never matches any +pattern item. It does not match dot, it does not match \p{Any}, it does not +even match negative items such as [^X]. A lookbehind assertion fails if it +encounters an invalid sequence while moving the current point backwards. In +other words, an invalid UTF code unit sequence acts as a barrier which no match +can cross. +

+

+You can also think of this as the subject being split up into fragments of +valid UTF, delimited internally by invalid code unit sequences. The pattern is +matched fragment by fragment. The result of a successful match, however, is +given as code unit offsets in the entire subject string in the usual way. There +are a few points to consider: +

+

+The internal boundaries are not interpreted as the beginnings or ends of lines +and so do not match circumflex or dollar characters in the pattern. +

+

+If pcre2_match() is called with an offset that points to an invalid +UTF-sequence, that sequence is skipped, and the match starts at the next valid +UTF character, or the end of the subject. +

+

+At internal fragment boundaries, \b and \B behave in the same way as at the +beginning and end of the subject. For example, a sequence such as \bWORD\b +would match an instance of WORD that is surrounded by invalid UTF code units. +

+

+Using PCRE2_MATCH_INVALID_UTF, an application can run matches on arbitrary +data, knowing that any matched strings that are returned are valid UTF. This +can be useful when searching for UTF text in executable or other binary files. +

+

+Note, however, that the 16-bit and 32-bit PCRE2 libraries process strings as +sequences of uint16_t or uint32_t code points. They cannot find valid UTF +sequences within an arbitrary string of bytes unless such sequences are +suitably aligned. +

+
+AUTHOR +
+

+Philip Hazel +
+Retired from University Computing Service +
+Cambridge, England. +
+

+
+REVISION +
+

+Last updated: 27 November 2024 +
+Copyright © 1997-2024 University of Cambridge. +
+

+Return to the PCRE2 index page. +

diff --git a/miniconda3/share/doc/pcre2/pcre2-config.txt b/miniconda3/share/doc/pcre2/pcre2-config.txt new file mode 100644 index 0000000000000000000000000000000000000000..9c70b401c742f5c35c8fbbfc09bdb286a6c45def --- /dev/null +++ b/miniconda3/share/doc/pcre2/pcre2-config.txt @@ -0,0 +1,84 @@ +PCRE2-CONFIG(1) General Commands Manual PCRE2-CONFIG(1) + + +NAME + pcre2-config - program to return PCRE2 configuration + + +SYNOPSIS + + pcre2-config [--prefix] [--exec-prefix] [--version] + [--libs8] [--libs16] [--libs32] [--libs-posix] + [--cflags] [--cflags-posix] + + +DESCRIPTION + + pcre2-config returns the configuration of the installed PCRE2 libraries + and the options required to compile a program to use them. Some of the + options apply only to the 8-bit, or 16-bit, or 32-bit libraries, re- + spectively, and are not available for libraries that have not been + built. If an unavailable option is encountered, the "usage" information + is output. + + +OPTIONS + + --prefix Writes the directory prefix used in the PCRE2 installation + for architecture independent files (/usr on many systems, + /usr/local on some systems) to the standard output. + + --exec-prefix + Writes the directory prefix used in the PCRE2 installation + for architecture dependent files (normally the same as --pre- + fix) to the standard output. + + --version Writes the version number of the installed PCRE2 libraries to + the standard output. + + --libs8 Writes to the standard output the command line options re- + quired to link with the 8-bit PCRE2 library (-lpcre2-8 on + many systems). + + --libs16 Writes to the standard output the command line options re- + quired to link with the 16-bit PCRE2 library (-lpcre2-16 on + many systems). + + --libs32 Writes to the standard output the command line options re- + quired to link with the 32-bit PCRE2 library (-lpcre2-32 on + many systems). + + --libs-posix + Writes to the standard output the command line options re- + quired to link with PCRE2's POSIX API wrapper library + (-lpcre2-posix -lpcre2-8 on many systems). + + --cflags Writes to the standard output the command line options re- + quired to compile files that use PCRE2 (this may include some + -I options, but is blank on many systems). + + --cflags-posix + Writes to the standard output the command line options re- + quired to compile files that use PCRE2's POSIX API wrapper + library (this may include some -I options, but is blank on + many systems). + + +SEE ALSO + + pcre2(3) + + +AUTHOR + + This manual page was originally written by Mark Baker for the Debian + GNU/Linux system. It has been subsequently revised as a generic PCRE2 + man page. + + +REVISION + + Last updated: 28 September 2014 + + +PCRE2 10.46 28 September 2014 PCRE2-CONFIG(1) diff --git a/miniconda3/share/doc/pcre2/pcre2.txt b/miniconda3/share/doc/pcre2/pcre2.txt new file mode 100644 index 0000000000000000000000000000000000000000..9903eddb370c44c8b1be0ab8dc425acd40d03041 --- /dev/null +++ b/miniconda3/share/doc/pcre2/pcre2.txt @@ -0,0 +1,12696 @@ +----------------------------------------------------------------------------- +This file contains a concatenation of the PCRE2 man pages, converted to plain +text format for ease of searching with a text editor, or for use on systems +that do not have a man page processor. The small individual files that give +synopses of each function in the library have not been included. Neither has +the pcre2demo program. There are separate text files for the pcre2grep and +pcre2test commands. +----------------------------------------------------------------------------- + + +PCRE2(3) Library Functions Manual PCRE2(3) + + +NAME + PCRE2 - Perl-compatible regular expressions (revised API) + + +INTRODUCTION + + PCRE2 is the name used for a revised API for the PCRE library, which is + a set of functions, written in C, that implement regular expression + pattern matching using the same syntax and semantics as Perl, with just + a few differences. After nearly two decades, the limitations of the + original API were making development increasingly difficult. The new + API is more extensible, and it was simplified by abolishing the sepa- + rate "study" optimizing function; in PCRE2, patterns are automatically + optimized where possible. Since forking from PCRE1, the code has been + extensively refactored and new features introduced. The old library is + now obsolete and is no longer maintained. + + As well as Perl-style regular expression patterns, some features that + appeared in Python and the original PCRE before they appeared in Perl + are available using the Python syntax. There is also some support for + one or two .NET and Oniguruma syntax items, and there are options for + requesting some minor changes that give better ECMAScript (aka + JavaScript) compatibility. + + The source code for PCRE2 can be compiled to support strings of 8-bit, + 16-bit, or 32-bit code units, which means that up to three separate li- + braries may be installed, one for each code unit size. The size of code + unit is not related to the bit size of the underlying hardware. In a + 64-bit environment that also supports 32-bit applications, versions of + PCRE2 that are compiled in both 64-bit and 32-bit modes may be needed. + + The original work to extend PCRE to 16-bit and 32-bit code units was + done by Zoltan Herczeg and Christian Persch, respectively. In all three + cases, strings can be interpreted either as one character per code + unit, or as UTF-encoded Unicode, with support for Unicode general cate- + gory properties. Unicode support is optional at build time (but is the + default). However, processing strings as UTF code units must be enabled + explicitly at run time. The version of Unicode in use can be discovered + by running + + pcre2test -C + + The three libraries contain identical sets of functions, with names + ending in _8, _16, or _32, respectively (for example, pcre2_com- + pile_8()). However, by defining PCRE2_CODE_UNIT_WIDTH to be 8, 16, or + 32, a program that uses just one code unit width can be written using + generic names such as pcre2_compile(), and the documentation is written + assuming that this is the case. + + In addition to the Perl-compatible matching function, PCRE2 contains an + alternative function that matches the same compiled patterns in a dif- + ferent way. In certain circumstances, the alternative function has some + advantages. For a discussion of the two matching algorithms, see the + pcre2matching page. + + Details of exactly which Perl regular expression features are and are + not supported by PCRE2 are given in separate documents. See the + pcre2pattern and pcre2compat pages. There is a syntax summary in the + pcre2syntax page. + + Some features of PCRE2 can be included, excluded, or changed when the + library is built. The pcre2_config() function makes it possible for a + client to discover which features are available. The features them- + selves are described in the pcre2build page. Documentation about build- + ing PCRE2 for various operating systems can be found in the README and + NON-AUTOTOOLS_BUILD files in the source distribution. + + The libraries contains a number of undocumented internal functions and + data tables that are used by more than one of the exported external + functions, but which are not intended for use by external callers. + Their names all begin with "_pcre2", which hopefully will not provoke + any name clashes. In some environments, it is possible to control which + external symbols are exported when a shared library is built, and in + these cases the undocumented symbols are not exported. + + +SECURITY CONSIDERATIONS + + If you are using PCRE2 in a non-UTF application that permits users to + supply arbitrary patterns for compilation, you should be aware of a + feature that allows users to turn on UTF support from within a pattern. + For example, an 8-bit pattern that begins with "(*UTF)" turns on UTF-8 + mode, which interprets patterns and subjects as strings of UTF-8 code + units instead of individual 8-bit characters. This causes both the pat- + tern and any data against which it is matched to be checked for UTF-8 + validity. If the data string is very long, such a check might use suf- + ficiently many resources as to cause your application to lose perfor- + mance. + + One way of guarding against this possibility is to use the pcre2_pat- + tern_info() function to check the compiled pattern's options for + PCRE2_UTF. Alternatively, you can set the PCRE2_NEVER_UTF option when + calling pcre2_compile(). This causes a compile time error if the pat- + tern contains a UTF-setting sequence. + + The use of Unicode properties for character types such as \d can also + be enabled from within the pattern, by specifying "(*UCP)". This fea- + ture can be disallowed by setting the PCRE2_NEVER_UCP option. + + If your application is one that supports UTF, be aware that validity + checking can take time. If the same data string is to be matched many + times, you can use the PCRE2_NO_UTF_CHECK option for the second and + subsequent matches to avoid running redundant checks. + + The use of the \C escape sequence in a UTF-8 or UTF-16 pattern can lead + to problems, because it may leave the current matching point in the + middle of a multi-code-unit character. The PCRE2_NEVER_BACKSLASH_C op- + tion can be used by an application to lock out the use of \C, causing a + compile-time error if it is encountered. It is also possible to build + PCRE2 with the use of \C permanently disabled. + + Another way that performance can be hit is by running a pattern that + has a very large search tree against a string that will never match. + Nested unlimited repeats in a pattern are a common example. PCRE2 pro- + vides some protection against this: see the pcre2_set_match_limit() + function in the pcre2api page. There is a similar function called + pcre2_set_depth_limit() that can be used to restrict the amount of mem- + ory that is used. + + +USER DOCUMENTATION + + The user documentation for PCRE2 comprises a number of different sec- + tions. In the "man" format, each of these is a separate "man page". In + the HTML format, each is a separate page, linked from the index page. + In the plain text format, the descriptions of the pcre2grep and + pcre2test programs are in files called pcre2grep.txt and pcre2test.txt, + respectively. The remaining sections, except for the pcre2demo section + (which is a program listing), and the short pages for individual func- + tions, are concatenated in pcre2.txt, for ease of searching. The sec- + tions are as follows: + + pcre2 this document + pcre2-config show PCRE2 installation configuration information + pcre2api details of PCRE2's native C API + pcre2build building PCRE2 + pcre2callout details of the pattern callout feature + pcre2compat discussion of Perl compatibility + pcre2convert details of pattern conversion functions + pcre2demo a demonstration C program that uses PCRE2 + pcre2grep description of the pcre2grep command (8-bit only) + pcre2jit discussion of just-in-time optimization support + pcre2limits details of size and other limits + pcre2matching discussion of the two matching algorithms + pcre2partial details of the partial matching facility + pcre2pattern syntax and semantics of supported regular + expression patterns + pcre2perform discussion of performance issues + pcre2posix the POSIX-compatible C API for the 8-bit library + pcre2sample discussion of the pcre2demo program + pcre2serialize details of pattern serialization + pcre2syntax quick syntax reference + pcre2test description of the pcre2test command + pcre2unicode discussion of Unicode and UTF support + + In the "man" and HTML formats, there is also a short page for each C + library function, listing its arguments and results. + + +AUTHORS + + The current maintainers of PCRE2 are Nicholas Wilson and Zoltan Her- + czeg. + + PCRE2 was written by Philip Hazel, of the University Computing Service, + Cambridge, England. Many others have also contributed. + + To contact the maintainers, please use the GitHub issues tracker or + PCRE2 mailing list, as described at the project page: + https://github.com/PCRE2Project/pcre2 + + +REVISION + + Last updated: 18 December 2024 + Copyright (c) 1997-2021 University of Cambridge. + + +PCRE2 10.46 18 December 2024 PCRE2(3) +------------------------------------------------------------------------------ + + +PCRE2API(3) Library Functions Manual PCRE2API(3) + + +NAME + PCRE2 - Perl-compatible regular expressions (revised API) + + #include + + PCRE2 is a new API for PCRE, starting at release 10.0. This document + contains a description of all its native functions. See the pcre2 docu- + ment for an overview of all the PCRE2 documentation. + + +PCRE2 NATIVE API BASIC FUNCTIONS + + pcre2_code *pcre2_compile(PCRE2_SPTR pattern, PCRE2_SIZE length, + uint32_t options, int *errorcode, PCRE2_SIZE *erroroffset, + pcre2_compile_context *ccontext); + + void pcre2_code_free(pcre2_code *code); + + pcre2_match_data *pcre2_match_data_create(uint32_t ovecsize, + pcre2_general_context *gcontext); + + pcre2_match_data *pcre2_match_data_create_from_pattern( + const pcre2_code *code, pcre2_general_context *gcontext); + + int pcre2_match(const pcre2_code *code, PCRE2_SPTR subject, + PCRE2_SIZE length, PCRE2_SIZE startoffset, + uint32_t options, pcre2_match_data *match_data, + pcre2_match_context *mcontext); + + int pcre2_dfa_match(const pcre2_code *code, PCRE2_SPTR subject, + PCRE2_SIZE length, PCRE2_SIZE startoffset, + uint32_t options, pcre2_match_data *match_data, + pcre2_match_context *mcontext, + int *workspace, PCRE2_SIZE wscount); + + void pcre2_match_data_free(pcre2_match_data *match_data); + + +PCRE2 NATIVE API AUXILIARY MATCH FUNCTIONS + + PCRE2_SPTR pcre2_get_mark(pcre2_match_data *match_data); + + PCRE2_SIZE pcre2_get_match_data_size(pcre2_match_data *match_data); + + PCRE2_SIZE pcre2_get_match_data_heapframes_size( + pcre2_match_data *match_data); + + uint32_t pcre2_get_ovector_count(pcre2_match_data *match_data); + + PCRE2_SIZE *pcre2_get_ovector_pointer(pcre2_match_data *match_data); + + PCRE2_SIZE pcre2_get_startchar(pcre2_match_data *match_data); + + +PCRE2 NATIVE API GENERAL CONTEXT FUNCTIONS + + pcre2_general_context *pcre2_general_context_create( + void *(*private_malloc)(PCRE2_SIZE, void *), + void (*private_free)(void *, void *), void *memory_data); + + pcre2_general_context *pcre2_general_context_copy( + pcre2_general_context *gcontext); + + void pcre2_general_context_free(pcre2_general_context *gcontext); + + +PCRE2 NATIVE API COMPILE CONTEXT FUNCTIONS + + pcre2_compile_context *pcre2_compile_context_create( + pcre2_general_context *gcontext); + + pcre2_compile_context *pcre2_compile_context_copy( + pcre2_compile_context *ccontext); + + void pcre2_compile_context_free(pcre2_compile_context *ccontext); + + int pcre2_set_bsr(pcre2_compile_context *ccontext, + uint32_t value); + + int pcre2_set_character_tables(pcre2_compile_context *ccontext, + const uint8_t *tables); + + int pcre2_set_compile_extra_options(pcre2_compile_context *ccontext, + uint32_t extra_options); + + int pcre2_set_max_pattern_length(pcre2_compile_context *ccontext, + PCRE2_SIZE value); + + int pcre2_set_max_pattern_compiled_length( + pcre2_compile_context *ccontext, PCRE2_SIZE value); + + int pcre2_set_max_varlookbehind(pcre2_compile_contest *ccontext, + uint32_t value); + + int pcre2_set_newline(pcre2_compile_context *ccontext, + uint32_t value); + + int pcre2_set_parens_nest_limit(pcre2_compile_context *ccontext, + uint32_t value); + + int pcre2_set_compile_recursion_guard(pcre2_compile_context *ccontext, + int (*guard_function)(uint32_t, void *), void *user_data); + + int pcre2_set_optimize(pcre2_compile_context *ccontext, + uint32_t directive); + + +PCRE2 NATIVE API MATCH CONTEXT FUNCTIONS + + pcre2_match_context *pcre2_match_context_create( + pcre2_general_context *gcontext); + + pcre2_match_context *pcre2_match_context_copy( + pcre2_match_context *mcontext); + + void pcre2_match_context_free(pcre2_match_context *mcontext); + + int pcre2_set_callout(pcre2_match_context *mcontext, + int (*callout_function)(pcre2_callout_block *, void *), + void *callout_data); + + int pcre2_set_substitute_callout(pcre2_match_context *mcontext, + int (*callout_function)(pcre2_substitute_callout_block *, void *), + void *callout_data); + + int pcre2_set_substitute_case_callout(pcre2_match_context *mcontext, + PCRE2_SIZE (*callout_function)(PCRE2_SPTR, PCRE2_SIZE, + PCRE2_UCHAR *, PCRE2_SIZE, + int, void *), + void *callout_data); + + int pcre2_set_offset_limit(pcre2_match_context *mcontext, + PCRE2_SIZE value); + + int pcre2_set_heap_limit(pcre2_match_context *mcontext, + uint32_t value); + + int pcre2_set_match_limit(pcre2_match_context *mcontext, + uint32_t value); + + int pcre2_set_depth_limit(pcre2_match_context *mcontext, + uint32_t value); + + +PCRE2 NATIVE API STRING EXTRACTION FUNCTIONS + + int pcre2_substring_copy_byname(pcre2_match_data *match_data, + PCRE2_SPTR name, PCRE2_UCHAR *buffer, PCRE2_SIZE *bufflen); + + int pcre2_substring_copy_bynumber(pcre2_match_data *match_data, + uint32_t number, PCRE2_UCHAR *buffer, + PCRE2_SIZE *bufflen); + + void pcre2_substring_free(PCRE2_UCHAR *buffer); + + int pcre2_substring_get_byname(pcre2_match_data *match_data, + PCRE2_SPTR name, PCRE2_UCHAR **bufferptr, PCRE2_SIZE *bufflen); + + int pcre2_substring_get_bynumber(pcre2_match_data *match_data, + uint32_t number, PCRE2_UCHAR **bufferptr, + PCRE2_SIZE *bufflen); + + int pcre2_substring_length_byname(pcre2_match_data *match_data, + PCRE2_SPTR name, PCRE2_SIZE *length); + + int pcre2_substring_length_bynumber(pcre2_match_data *match_data, + uint32_t number, PCRE2_SIZE *length); + + int pcre2_substring_nametable_scan(const pcre2_code *code, + PCRE2_SPTR name, PCRE2_SPTR *first, PCRE2_SPTR *last); + + int pcre2_substring_number_from_name(const pcre2_code *code, + PCRE2_SPTR name); + + void pcre2_substring_list_free(PCRE2_UCHAR **list); + + int pcre2_substring_list_get(pcre2_match_data *match_data, + PCRE2_UCHAR ***listptr, PCRE2_SIZE **lengthsptr); + + +PCRE2 NATIVE API STRING SUBSTITUTION FUNCTION + + int pcre2_substitute(const pcre2_code *code, PCRE2_SPTR subject, + PCRE2_SIZE length, PCRE2_SIZE startoffset, + uint32_t options, pcre2_match_data *match_data, + pcre2_match_context *mcontext, PCRE2_SPTR replacementz, + PCRE2_SIZE rlength, PCRE2_UCHAR *outputbuffer, + PCRE2_SIZE *outlengthptr); + + +PCRE2 NATIVE API JIT FUNCTIONS + + int pcre2_jit_compile(pcre2_code *code, uint32_t options); + + int pcre2_jit_match(const pcre2_code *code, PCRE2_SPTR subject, + PCRE2_SIZE length, PCRE2_SIZE startoffset, + uint32_t options, pcre2_match_data *match_data, + pcre2_match_context *mcontext); + + void pcre2_jit_free_unused_memory(pcre2_general_context *gcontext); + + pcre2_jit_stack *pcre2_jit_stack_create(size_t startsize, + size_t maxsize, pcre2_general_context *gcontext); + + void pcre2_jit_stack_assign(pcre2_match_context *mcontext, + pcre2_jit_callback callback_function, void *callback_data); + + void pcre2_jit_stack_free(pcre2_jit_stack *jit_stack); + + +PCRE2 NATIVE API SERIALIZATION FUNCTIONS + + int32_t pcre2_serialize_decode(pcre2_code **codes, + int32_t number_of_codes, const uint8_t *bytes, + pcre2_general_context *gcontext); + + int32_t pcre2_serialize_encode(const pcre2_code **codes, + int32_t number_of_codes, uint8_t **serialized_bytes, + PCRE2_SIZE *serialized_size, pcre2_general_context *gcontext); + + void pcre2_serialize_free(uint8_t *bytes); + + int32_t pcre2_serialize_get_number_of_codes(const uint8_t *bytes); + + +PCRE2 NATIVE API AUXILIARY FUNCTIONS + + pcre2_code *pcre2_code_copy(const pcre2_code *code); + + pcre2_code *pcre2_code_copy_with_tables(const pcre2_code *code); + + int pcre2_get_error_message(int errorcode, PCRE2_UCHAR *buffer, + PCRE2_SIZE bufflen); + + const uint8_t *pcre2_maketables(pcre2_general_context *gcontext); + + void pcre2_maketables_free(pcre2_general_context *gcontext, + const uint8_t *tables); + + int pcre2_pattern_info(const pcre2_code *code, uint32_t what, + void *where); + + int pcre2_callout_enumerate(const pcre2_code *code, + int (*callback)(pcre2_callout_enumerate_block *, void *), + void *user_data); + + int pcre2_config(uint32_t what, void *where); + + +PCRE2 NATIVE API OBSOLETE FUNCTIONS + + int pcre2_set_recursion_limit(pcre2_match_context *mcontext, + uint32_t value); + + int pcre2_set_recursion_memory_management( + pcre2_match_context *mcontext, + void *(*private_malloc)(size_t, void *), + void (*private_free)(void *, void *), void *memory_data); + + These functions became obsolete at release 10.30 and are retained only + for backward compatibility. They should not be used in new code. The + first is replaced by pcre2_set_depth_limit(); the second is no longer + needed and has no effect (it always returns zero). + + +PCRE2 EXPERIMENTAL PATTERN CONVERSION FUNCTIONS + + pcre2_convert_context *pcre2_convert_context_create( + pcre2_general_context *gcontext); + + pcre2_convert_context *pcre2_convert_context_copy( + pcre2_convert_context *cvcontext); + + void pcre2_convert_context_free(pcre2_convert_context *cvcontext); + + int pcre2_set_glob_escape(pcre2_convert_context *cvcontext, + uint32_t escape_char); + + int pcre2_set_glob_separator(pcre2_convert_context *cvcontext, + uint32_t separator_char); + + int pcre2_pattern_convert(PCRE2_SPTR pattern, PCRE2_SIZE length, + uint32_t options, PCRE2_UCHAR **buffer, + PCRE2_SIZE *blength, pcre2_convert_context *cvcontext); + + void pcre2_converted_pattern_free(PCRE2_UCHAR *converted_pattern); + + These functions provide a way of converting non-PCRE2 patterns into + patterns that can be processed by pcre2_compile(). This facility is ex- + perimental and may be changed in future releases. At present, "globs" + and POSIX basic and extended patterns can be converted. Details are + given in the pcre2convert documentation. + + +PCRE2 8-BIT, 16-BIT, AND 32-BIT LIBRARIES + + There are three PCRE2 libraries, supporting 8-bit, 16-bit, and 32-bit + code units, respectively. However, there is just one header file, + pcre2.h. This contains the function prototypes and other definitions + for all three libraries. One, two, or all three can be installed simul- + taneously. On Unix-like systems the libraries are called libpcre2-8, + libpcre2-16, and libpcre2-32, and they can also co-exist with the orig- + inal PCRE libraries. Every PCRE2 function comes in three different + forms, one for each library, for example: + + pcre2_compile_8() + pcre2_compile_16() + pcre2_compile_32() + + There are also three different sets of data types: + + PCRE2_UCHAR8, PCRE2_UCHAR16, PCRE2_UCHAR32 + PCRE2_SPTR8, PCRE2_SPTR16, PCRE2_SPTR32 + + The UCHAR types define unsigned code units of the appropriate widths. + For example, PCRE2_UCHAR16 is usually defined as `uint16_t'. The SPTR + types are pointers to constants of the equivalent UCHAR types, that is, + they are pointers to vectors of unsigned code units. + + Character strings are passed to a PCRE2 library as sequences of un- + signed integers in code units of the appropriate width. The length of a + string may be given as a number of code units, or the string may be + specified as zero-terminated. + + Many applications use only one code unit width. For their convenience, + macros are defined whose names are the generic forms such as pcre2_com- + pile() and PCRE2_SPTR. These macros use the value of the macro + PCRE2_CODE_UNIT_WIDTH to generate the appropriate width-specific func- + tion and macro names. PCRE2_CODE_UNIT_WIDTH is not defined by default. + An application must define it to be 8, 16, or 32 before including + pcre2.h in order to make use of the generic names. + + Applications that use more than one code unit width can be linked with + more than one PCRE2 library, but must define PCRE2_CODE_UNIT_WIDTH to + be 0 before including pcre2.h, and then use the real function names. + Any code that is to be included in an environment where the value of + PCRE2_CODE_UNIT_WIDTH is unknown should also use the real function + names. (Unfortunately, it is not possible in C code to save and restore + the value of a macro.) + + If PCRE2_CODE_UNIT_WIDTH is not defined before including pcre2.h, a + compiler error occurs. + + When using multiple libraries in an application, you must take care + when processing any particular pattern to use only functions from a + single library. For example, if you want to run a match using a pat- + tern that was compiled with pcre2_compile_16(), you must do so with + pcre2_match_16(), not pcre2_match_8() or pcre2_match_32(). + + In the function summaries above, and in the rest of this document and + other PCRE2 documents, functions and data types are described using + their generic names, without the _8, _16, or _32 suffix. + + +PCRE2 API OVERVIEW + + PCRE2 has its own native API, which is described in this document. + There are also some wrapper functions for the 8-bit library that corre- + spond to the POSIX regular expression API, but they do not give access + to all the functionality of PCRE2 and they are not thread-safe. They + are described in the pcre2posix documentation. Both these APIs define a + set of C function calls. + + The native API C data types, function prototypes, option values, and + error codes are defined in the header file pcre2.h, which also contains + definitions of PCRE2_MAJOR and PCRE2_MINOR, the major and minor release + numbers for the library. Applications can use these to include support + for different releases of PCRE2. + + In a Windows environment, if you want to statically link an application + program against a non-dll PCRE2 library, you must define PCRE2_STATIC + before including pcre2.h. + + The functions pcre2_compile() and pcre2_match() are used for compiling + and matching regular expressions in a Perl-compatible manner. A sample + program that demonstrates the simplest way of using them is provided in + the file called pcre2demo.c in the PCRE2 source distribution. A listing + of this program is given in the pcre2demo documentation, and the + pcre2sample documentation describes how to compile and run it. + + The compiling and matching functions recognize various options that are + passed as bits in an options argument. There are also some more compli- + cated parameters such as custom memory management functions and re- + source limits that are passed in "contexts" (which are just memory + blocks, described below). Simple applications do not need to make use + of contexts. + + Just-in-time (JIT) compiler support is an optional feature of PCRE2 + that can be built in appropriate hardware environments. It greatly + speeds up the matching performance of many patterns. Programs can re- + quest that it be used if available by calling pcre2_jit_compile() after + a pattern has been successfully compiled by pcre2_compile(). This does + nothing if JIT support is not available. + + More complicated programs might need to make use of the specialist + functions pcre2_jit_stack_create(), pcre2_jit_stack_free(), and + pcre2_jit_stack_assign() in order to control the JIT code's memory us- + age. + + JIT matching is automatically used by pcre2_match() if it is available, + unless the PCRE2_NO_JIT option is set. There is also a direct interface + for JIT matching, which gives improved performance at the expense of + less sanity checking. The JIT-specific functions are discussed in the + pcre2jit documentation. + + A second matching function, pcre2_dfa_match(), which is not Perl-com- + patible, is also provided. This uses a different algorithm for the + matching. The alternative algorithm finds all possible matches (at a + given point in the subject), and scans the subject just once (unless + there are lookaround assertions). However, this algorithm does not re- + turn captured substrings. A description of the two matching algorithms + and their advantages and disadvantages is given in the pcre2matching + documentation. There is no JIT support for pcre2_dfa_match(). + + In addition to the main compiling and matching functions, there are + convenience functions for extracting captured substrings from a subject + string that has been matched by pcre2_match(). They are: + + pcre2_substring_copy_byname() + pcre2_substring_copy_bynumber() + pcre2_substring_get_byname() + pcre2_substring_get_bynumber() + pcre2_substring_list_get() + pcre2_substring_length_byname() + pcre2_substring_length_bynumber() + pcre2_substring_nametable_scan() + pcre2_substring_number_from_name() + + pcre2_substring_free() and pcre2_substring_list_free() are also pro- + vided, to free memory used for extracted strings. If either of these + functions is called with a NULL argument, the function returns immedi- + ately without doing anything. + + The function pcre2_substitute() can be called to match a pattern and + return a copy of the subject string with substitutions for parts that + were matched. + + Functions whose names begin with pcre2_serialize_ are used for saving + compiled patterns on disc or elsewhere, and reloading them later. + + Finally, there are functions for finding out information about a com- + piled pattern (pcre2_pattern_info()) and about the configuration with + which PCRE2 was built (pcre2_config()). + + Functions with names ending with _free() are used for freeing memory + blocks of various sorts. In all cases, if one of these functions is + called with a NULL argument, it does nothing. + + +STRING LENGTHS AND OFFSETS + + The PCRE2 API uses string lengths and offsets into strings of code + units in several places. These values are always of type PCRE2_SIZE, + which is an unsigned integer type, currently always defined as size_t. + The largest value that can be stored in such a type (that is + ~(PCRE2_SIZE)0) is reserved as a special indicator for zero-terminated + strings and unset offsets. Therefore, the longest string that can be + handled is one less than this maximum. Note that string lengths are al- + ways given in code units. Only in the 8-bit library is such a length + the same as the number of bytes in the string. + + +NEWLINES + + PCRE2 supports five different conventions for indicating line breaks in + strings: a single CR (carriage return) character, a single LF (line- + feed) character, the two-character sequence CRLF, any of the three pre- + ceding, or any Unicode newline sequence. The Unicode newline sequences + are the three just mentioned, plus the single characters VT (vertical + tab, U+000B), FF (form feed, U+000C), NEL (next line, U+0085), LS (line + separator, U+2028), and PS (paragraph separator, U+2029). + + Each of the first three conventions is used by at least one operating + system as its standard newline sequence. When PCRE2 is built, a default + can be specified. If it is not, the default is set to LF, which is the + Unix standard. However, the newline convention can be changed by an ap- + plication when calling pcre2_compile(), or it can be specified by spe- + cial text at the start of the pattern itself; this overrides any other + settings. See the pcre2pattern page for details of the special charac- + ter sequences. + + In the PCRE2 documentation the word "newline" is used to mean "the + character or pair of characters that indicate a line break". The choice + of newline convention affects the handling of the dot, circumflex, and + dollar metacharacters, the handling of #-comments in /x mode, and, when + CRLF is a recognized line ending sequence, the match position advance- + ment for a non-anchored pattern. There is more detail about this in the + section on pcre2_match() options below. + + The choice of newline convention does not affect the interpretation of + the \n or \r escape sequences, nor does it affect what \R matches; this + has its own separate convention. + + +MULTITHREADING + + In a multithreaded application it is important to keep thread-specific + data separate from data that can be shared between threads. The PCRE2 + library code itself is thread-safe: it contains no static or global + variables. The API is designed to be fairly simple for non-threaded ap- + plications while at the same time ensuring that multithreaded applica- + tions can use it. + + There are several different blocks of data that are used to pass infor- + mation between the application and the PCRE2 libraries. + + The compiled pattern + + A pointer to the compiled form of a pattern is returned to the user + when pcre2_compile() is successful. The data in the compiled pattern is + fixed, and does not change when the pattern is matched. Therefore, it + is thread-safe, that is, the same compiled pattern can be used by more + than one thread simultaneously. For example, an application can compile + all its patterns at the start, before forking off multiple threads that + use them. However, if the just-in-time (JIT) optimization feature is + being used, it needs separate memory stack areas for each thread. See + the pcre2jit documentation for more details. + + In a more complicated situation, where patterns are compiled only when + they are first needed, but are still shared between threads, pointers + to compiled patterns must be protected from simultaneous writing by + multiple threads. This is somewhat tricky to do correctly. If you know + that writing to a pointer is atomic in your environment, you can use + logic like this: + + Get a read-only (shared) lock (mutex) for pointer + if (pointer == NULL) + { + Get a write (unique) lock for pointer + if (pointer == NULL) pointer = pcre2_compile(... + } + Release the lock + Use pointer in pcre2_match() + + Of course, testing for compilation errors should also be included in + the code. + + The reason for checking the pointer a second time is as follows: Sev- + eral threads may have acquired the shared lock and tested the pointer + for being NULL, but only one of them will be given the write lock, with + the rest kept waiting. The winning thread will compile the pattern and + store the result. After this thread releases the write lock, another + thread will get it, and if it does not retest pointer for being NULL, + will recompile the pattern and overwrite the pointer, creating a memory + leak and possibly causing other issues. + + In an environment where writing to a pointer may not be atomic, the + above logic is not sufficient. The thread that is doing the compiling + may be descheduled after writing only part of the pointer, which could + cause other threads to use an invalid value. Instead of checking the + pointer itself, a separate "pointer is valid" flag (that can be updated + atomically) must be used: + + Get a read-only (shared) lock (mutex) for pointer + if (!pointer_is_valid) + { + Get a write (unique) lock for pointer + if (!pointer_is_valid) + { + pointer = pcre2_compile(... + pointer_is_valid = TRUE + } + } + Release the lock + Use pointer in pcre2_match() + + If JIT is being used, but the JIT compilation is not being done immedi- + ately (perhaps waiting to see if the pattern is used often enough), + similar logic is required. JIT compilation updates a value within the + compiled code block, so a thread must gain unique write access to the + pointer before calling pcre2_jit_compile(). Alternatively, + pcre2_code_copy() or pcre2_code_copy_with_tables() can be used to ob- + tain a private copy of the compiled code before calling the JIT com- + piler. + + Context blocks + + The next main section below introduces the idea of "contexts" in which + PCRE2 functions are called. A context is nothing more than a collection + of parameters that control the way PCRE2 operates. Grouping a number of + parameters together in a context is a convenient way of passing them to + a PCRE2 function without using lots of arguments. The parameters that + are stored in contexts are in some sense "advanced features" of the + API. Many straightforward applications will not need to use contexts. + + In a multithreaded application, if the parameters in a context are val- + ues that are never changed, the same context can be used by all the + threads. However, if any thread needs to change any value in a context, + it must make its own thread-specific copy. + + Match blocks + + The matching functions need a block of memory for storing the results + of a match. This includes details of what was matched, as well as addi- + tional information such as the name of a (*MARK) setting. Each thread + must provide its own copy of this memory. + + +PCRE2 CONTEXTS + + Some PCRE2 functions have a lot of parameters, many of which are used + only by specialist applications, for example, those that use custom + memory management or non-standard character tables. To keep function + argument lists at a reasonable size, and at the same time to keep the + API extensible, "uncommon" parameters are passed to certain functions + in a context instead of directly. A context is just a block of memory + that holds the parameter values. Applications that do not need to ad- + just any of the context parameters can pass NULL when a context pointer + is required. + + There are three different types of context: a general context that is + relevant for several PCRE2 operations, a compile-time context, and a + match-time context. + + The general context + + At present, this context just contains pointers to (and data for) ex- + ternal memory management functions that are called from several places + in the PCRE2 library. The context is named `general' rather than + specifically `memory' because in future other fields may be added. If + you do not want to supply your own custom memory management functions, + you do not need to bother with a general context. A general context is + created by: + + pcre2_general_context *pcre2_general_context_create( + void *(*private_malloc)(PCRE2_SIZE, void *), + void (*private_free)(void *, void *), void *memory_data); + + The two function pointers specify custom memory management functions, + whose prototypes are: + + void *private_malloc(PCRE2_SIZE, void *); + void private_free(void *, void *); + + Whenever code in PCRE2 calls these functions, the final argument is the + value of memory_data. Either of the first two arguments of the creation + function may be NULL, in which case the system memory management func- + tions malloc() and free() are used. (This is not currently useful, as + there are no other fields in a general context, but in future there + might be.) The private_malloc() function is used (if supplied) to ob- + tain memory for storing the context, and all three values are saved as + part of the context. + + Whenever PCRE2 creates a data block of any kind, the block contains a + pointer to the free() function that matches the malloc() function that + was used. When the time comes to free the block, this function is + called. + + A general context can be copied by calling: + + pcre2_general_context *pcre2_general_context_copy( + pcre2_general_context *gcontext); + + The memory used for a general context should be freed by calling: + + void pcre2_general_context_free(pcre2_general_context *gcontext); + + If this function is passed a NULL argument, it returns immediately + without doing anything. + + The compile context + + A compile context is required if you want to provide an external func- + tion for stack checking during compilation or to change the default + values of any of the following compile-time parameters: + + What \R matches (Unicode newlines or CR, LF, CRLF only) + PCRE2's character tables + The newline character sequence + The compile time nested parentheses limit + The maximum length of the pattern string + The extra options bits (none set by default) + Which performance optimizations the compiler should apply + + A compile context is also required if you are using custom memory man- + agement. If none of these apply, just pass NULL as the context argu- + ment of pcre2_compile(). + + A compile context is created, copied, and freed by the following func- + tions: + + pcre2_compile_context *pcre2_compile_context_create( + pcre2_general_context *gcontext); + + pcre2_compile_context *pcre2_compile_context_copy( + pcre2_compile_context *ccontext); + + void pcre2_compile_context_free(pcre2_compile_context *ccontext); + + A compile context is created with default values for its parameters. + These can be changed by calling the following functions, which return 0 + on success, or PCRE2_ERROR_BADDATA if invalid data is detected. + + int pcre2_set_bsr(pcre2_compile_context *ccontext, + uint32_t value); + + The value must be PCRE2_BSR_ANYCRLF, to specify that \R matches only + CR, LF, or CRLF, or PCRE2_BSR_UNICODE, to specify that \R matches any + Unicode line ending sequence. The value is used by the JIT compiler and + by the two interpreted matching functions, pcre2_match() and + pcre2_dfa_match(). + + int pcre2_set_character_tables(pcre2_compile_context *ccontext, + const uint8_t *tables); + + The value must be the result of a call to pcre2_maketables(), whose + only argument is a general context. This function builds a set of char- + acter tables in the current locale. + + int pcre2_set_compile_extra_options(pcre2_compile_context *ccontext, + uint32_t extra_options); + + As PCRE2 has developed, almost all the 32 option bits that are avail- + able in the options argument of pcre2_compile() have been used up. To + avoid running out, the compile context contains a set of extra option + bits which are used for some newer, assumed rarer, options. This func- + tion sets those bits. It always sets all the bits (either on or off). + It does not modify any existing setting. The available options are de- + fined in the section entitled "Extra compile options" below. + + int pcre2_set_max_pattern_length(pcre2_compile_context *ccontext, + PCRE2_SIZE value); + + This sets a maximum length, in code units, for any pattern string that + is compiled with this context. If the pattern is longer, an error is + generated. This facility is provided so that applications that accept + patterns from external sources can limit their size. The default is the + largest number that a PCRE2_SIZE variable can hold, which is effec- + tively unlimited. + + int pcre2_set_max_pattern_compiled_length( + pcre2_compile_context *ccontext, PCRE2_SIZE value); + + This sets a maximum size, in bytes, for the memory needed to hold the + compiled version of a pattern that is compiled with this context. If + the pattern needs more memory, an error is generated. This facility is + provided so that applications that accept patterns from external + sources can limit the amount of memory they use. The default is the + largest number that a PCRE2_SIZE variable can hold, which is effec- + tively unlimited. + + int pcre2_set_max_varlookbehind(pcre2_compile_contest *ccontext, + uint32_t value); + + This sets a maximum length for the number of characters matched by a + variable-length lookbehind assertion. The default is set when PCRE2 is + built, with the ultimate default being 255, the same as Perl. Lookbe- + hind assertions without a bounding length are not supported. + + int pcre2_set_newline(pcre2_compile_context *ccontext, + uint32_t value); + + This specifies which characters or character sequences are to be recog- + nized as newlines. The value must be one of PCRE2_NEWLINE_CR (carriage + return only), PCRE2_NEWLINE_LF (linefeed only), PCRE2_NEWLINE_CRLF (the + two-character sequence CR followed by LF), PCRE2_NEWLINE_ANYCRLF (any + of the above), PCRE2_NEWLINE_ANY (any Unicode newline sequence), or + PCRE2_NEWLINE_NUL (the NUL character, that is a binary zero). + + A pattern can override the value set in the compile context by starting + with a sequence such as (*CRLF). See the pcre2pattern page for details. + + When a pattern is compiled with the PCRE2_EXTENDED or PCRE2_EX- + TENDED_MORE option, the newline convention affects the recognition of + the end of internal comments starting with #. The value is saved with + the compiled pattern for subsequent use by the JIT compiler and by the + two interpreted matching functions, pcre2_match() and + pcre2_dfa_match(). + + int pcre2_set_parens_nest_limit(pcre2_compile_context *ccontext, + uint32_t value); + + This parameter adjusts the limit, set when PCRE2 is built (default + 250), on the depth of parenthesis nesting in a pattern. This limit + stops rogue patterns using up too much system stack when being com- + piled. The limit applies to parentheses of all kinds, not just captur- + ing parentheses. + + int pcre2_set_compile_recursion_guard(pcre2_compile_context *ccontext, + int (*guard_function)(uint32_t, void *), void *user_data); + + There is at least one application that runs PCRE2 in threads with very + limited system stack, where running out of stack is to be avoided at + all costs. The parenthesis limit above cannot take account of how much + stack is actually available during compilation. For a finer control, + you can supply a function that is called whenever pcre2_compile() + starts to compile a parenthesized part of a pattern. This function can + check the actual stack size (or anything else that it wants to, of + course). + + The first argument to the callout function gives the current depth of + nesting, and the second is user data that is set up by the last argu- + ment of pcre2_set_compile_recursion_guard(). The callout function + should return zero if all is well, or non-zero to force an error. + + int pcre2_set_optimize(pcre2_compile_context *ccontext, + uint32_t directive); + + PCRE2 can apply various performance optimizations during compilation, + in order to make matching faster. For example, the compiler might con- + vert some regex constructs into an equivalent construct which + pcre2_match() can execute faster. By default, all available optimiza- + tions are enabled. However, in rare cases, one might wish to disable + specific optimizations. For example, if it is known that some optimiza- + tions cannot benefit a certain regex, it might be desirable to disable + them, in order to speed up compilation. + + The permitted values of directive are as follows: + + PCRE2_OPTIMIZATION_FULL + + Enable all optional performance optimizations. This is the default + value. + + PCRE2_OPTIMIZATION_NONE + + Disable all optional performance optimizations. + + PCRE2_AUTO_POSSESS + PCRE2_AUTO_POSSESS_OFF + + Enable/disable "auto-possessification" of variable quantifiers such as + * and +. This optimization, for example, turns a+b into a++b in order + to avoid backtracks into a+ that can never be successful. However, if + callouts are in use, auto-possessification means that some callouts are + never taken. You can disable this optimization if you want the matching + functions to do a full, unoptimized search and run all the callouts. + + PCRE2_DOTSTAR_ANCHOR + PCRE2_DOTSTAR_ANCHOR_OFF + + Enable/disable an optimization that is applied when .* is the first + significant item in a top-level branch of a pattern, and all the other + branches also start with .* or with \A or \G or ^. Such a pattern is + automatically anchored if PCRE2_DOTALL is set for all the .* items and + PCRE2_MULTILINE is not set for any ^ items. Otherwise, the fact that + any match must start either at the start of the subject or following a + newline is remembered. Like other optimizations, this can cause call- + outs to be skipped. + + Dotstar anchor optimization is automatically disabled for .* if it is + inside an atomic group or a capture group that is the subject of a + backreference, or if the pattern contains (*PRUNE) or (*SKIP). + + PCRE2_START_OPTIMIZE + PCRE2_START_OPTIMIZE_OFF + + Enable/disable optimizations which cause matching functions to scan the + subject string for specific code unit values before attempting a match. + For example, if it is known that an unanchored match must start with a + specific value, the matching code searches the subject for that value, + and fails immediately if it cannot find it, without actually running + the main matching function. This means that a special item such as + (*COMMIT) at the start of a pattern is not considered until after a + suitable starting point for the match has been found. Also, when call- + outs or (*MARK) items are in use, these "start-up" optimizations can + cause them to be skipped if the pattern is never actually used. The + start-up optimizations are in effect a pre-scan of the subject that + takes place before the pattern is run. + + Disabling start-up optimizations ensures that in cases where the result + is "no match", the callouts do occur, and that items such as (*COMMIT) + and (*MARK) are considered at every possible starting position in the + subject string. + + Disabling start-up optimizations may change the outcome of a matching + operation. Consider the pattern + + (*COMMIT)ABC + + When this is compiled, PCRE2 records the fact that a match must start + with the character "A". Suppose the subject string is "DEFABC". The + start-up optimization scans along the subject, finds "A" and runs the + first match attempt from there. The (*COMMIT) item means that the pat- + tern must match the current starting position, which in this case, it + does. However, if the same match is run without start-up optimizations, + the initial scan along the subject string does not happen. The first + match attempt is run starting from "D" and when this fails, (*COMMIT) + prevents any further matches being tried, so the overall result is "no + match". + + Another start-up optimization makes use of a minimum length for a + matching subject, which is recorded when possible. Consider the pattern + + (*MARK:1)B(*MARK:2)(X|Y) + + The minimum length for a match is two characters. If the subject is + "XXBB", the "starting character" optimization skips "XX", then tries to + match "BB", which is long enough. In the process, (*MARK:2) is encoun- + tered and remembered. When the match attempt fails, the next "B" is + found, but there is only one character left, so there are no more at- + tempts, and "no match" is returned with the "last mark seen" set to + "2". Without start-up optimizations, however, matches are tried at + every possible starting position, including at the end of the subject, + where (*MARK:1) is encountered, but there is no "B", so the "last mark + seen" that is returned is "1". In this case, the optimizations do not + affect the overall match result, which is still "no match", but they do + affect the auxiliary information that is returned. + + The match context + + A match context is required if you want to: + + Set up a callout function + Set an offset limit for matching an unanchored pattern + Change the limit on the amount of heap used when matching + Change the backtracking match limit + Change the backtracking depth limit + Set custom memory management specifically for the match + + If none of these apply, just pass NULL as the context argument of + pcre2_match(), pcre2_dfa_match(), or pcre2_jit_match(). + + A match context is created, copied, and freed by the following func- + tions: + + pcre2_match_context *pcre2_match_context_create( + pcre2_general_context *gcontext); + + pcre2_match_context *pcre2_match_context_copy( + pcre2_match_context *mcontext); + + void pcre2_match_context_free(pcre2_match_context *mcontext); + + A match context is created with default values for its parameters. + These can be changed by calling the following functions, which return 0 + on success, or PCRE2_ERROR_BADDATA if invalid data is detected. + + int pcre2_set_callout(pcre2_match_context *mcontext, + int (*callout_function)(pcre2_callout_block *, void *), + void *callout_data); + + This sets up a callout function for PCRE2 to call at specified points + during a matching operation. Details are given in the pcre2callout doc- + umentation. + + int pcre2_set_substitute_callout(pcre2_match_context *mcontext, + int (*callout_function)(pcre2_substitute_callout_block *, void *), + void *callout_data); + + This sets up a callout function for PCRE2 to call after each substitu- + tion made by pcre2_substitute(). Details are given in the section enti- + tled "Creating a new string with substitutions" below. + + int pcre2_set_substitute_case_callout(pcre2_match_context *mcontext, + PCRE2_SIZE (*callout_function)(PCRE2_SPTR, PCRE2_SIZE, + PCRE2_UCHAR *, PCRE2_SIZE, + int, void *), + void *callout_data); + + This sets up a callout function for PCRE2 to call when performing case + transformations inside pcre2_substitute(). Details are given in the + section entitled "Creating a new string with substitutions" below. + + int pcre2_set_offset_limit(pcre2_match_context *mcontext, + PCRE2_SIZE value); + + The offset_limit parameter limits how far an unanchored search can ad- + vance in the subject string. The default value is PCRE2_UNSET. The + pcre2_match() and pcre2_dfa_match() functions return PCRE2_ERROR_NO- + MATCH if a match with a starting point before or at the given offset is + not found. The pcre2_substitute() function makes no more substitutions. + + For example, if the pattern /abc/ is matched against "123abc" with an + offset limit less than 3, the result is PCRE2_ERROR_NOMATCH. A match + can never be found if the startoffset argument of pcre2_match(), + pcre2_dfa_match(), or pcre2_substitute() is greater than the offset + limit set in the match context. + + When using this facility, you must set the PCRE2_USE_OFFSET_LIMIT op- + tion when calling pcre2_compile() so that when JIT is in use, different + code can be compiled. If a match is started with a non-default match + limit when PCRE2_USE_OFFSET_LIMIT is not set, an error is generated. + + The offset limit facility can be used to track progress when searching + large subject strings or to limit the extent of global substitutions. + See also the PCRE2_FIRSTLINE option, which requires a match to start + before or at the first newline that follows the start of matching in + the subject. If this is set with an offset limit, a match must occur in + the first line and also within the offset limit. In other words, + whichever limit comes first is used. + + int pcre2_set_heap_limit(pcre2_match_context *mcontext, + uint32_t value); + + The heap_limit parameter specifies, in units of kibibytes (1024 bytes), + the maximum amount of heap memory that pcre2_match() may use to hold + backtracking information when running an interpretive match. This limit + also applies to pcre2_dfa_match(), which may use the heap when process- + ing patterns with a lot of nested pattern recursion or lookarounds or + atomic groups. This limit does not apply to matching with the JIT opti- + mization, which has its own memory control arrangements (see the + pcre2jit documentation for more details). If the limit is reached, the + negative error code PCRE2_ERROR_HEAPLIMIT is returned. The default + limit can be set when PCRE2 is built; if it is not, the default is set + very large and is essentially unlimited. + + A value for the heap limit may also be supplied by an item at the start + of a pattern of the form + + (*LIMIT_HEAP=ddd) + + where ddd is a decimal number. However, such a setting is ignored un- + less ddd is less than the limit set by the caller of pcre2_match() or, + if no such limit is set, less than the default. + + The pcre2_match() function always needs some heap memory, so setting a + value of zero guarantees a "heap limit exceeded" error. Details of how + pcre2_match() uses the heap are given in the pcre2perform documenta- + tion. + + For pcre2_dfa_match(), a vector on the system stack is used when pro- + cessing pattern recursions, lookarounds, or atomic groups, and only if + this is not big enough is heap memory used. In this case, setting a + value of zero disables the use of the heap. + + int pcre2_set_match_limit(pcre2_match_context *mcontext, + uint32_t value); + + The match_limit parameter provides a means of preventing PCRE2 from us- + ing up too many computing resources when processing patterns that are + not going to match, but which have a very large number of possibilities + in their search trees. The classic example is a pattern that uses + nested unlimited repeats. + + There is an internal counter in pcre2_match() that is incremented each + time round its main matching loop. If this value reaches the match + limit, pcre2_match() returns the negative value PCRE2_ERROR_MATCHLIMIT. + This has the effect of limiting the amount of backtracking that can + take place. For patterns that are not anchored, the count restarts from + zero for each position in the subject string. This limit also applies + to pcre2_dfa_match(), though the counting is done in a different way. + + When pcre2_match() is called with a pattern that was successfully + processed by pcre2_jit_compile(), the way in which matching is executed + is entirely different. However, there is still the possibility of run- + away matching that goes on for a very long time, and so the match_limit + value is also used in this case (but in a different way) to limit how + long the matching can continue. + + The default value for the limit can be set when PCRE2 is built; the de- + fault is 10 million, which handles all but the most extreme cases. A + value for the match limit may also be supplied by an item at the start + of a pattern of the form + + (*LIMIT_MATCH=ddd) + + where ddd is a decimal number. However, such a setting is ignored un- + less ddd is less than the limit set by the caller of pcre2_match() or + pcre2_dfa_match() or, if no such limit is set, less than the default. + + int pcre2_set_depth_limit(pcre2_match_context *mcontext, + uint32_t value); + + This parameter limits the depth of nested backtracking in + pcre2_match(). Each time a nested backtracking point is passed, a new + memory frame is used to remember the state of matching at that point. + Thus, this parameter indirectly limits the amount of memory that is + used in a match. However, because the size of each memory frame depends + on the number of capturing parentheses, the actual memory limit varies + from pattern to pattern. This limit was more useful in versions before + 10.30, where function recursion was used for backtracking. + + The depth limit is not relevant, and is ignored, when matching is done + using JIT compiled code. However, it is supported by pcre2_dfa_match(), + which uses it to limit the depth of nested internal recursive function + calls that implement atomic groups, lookaround assertions, and pattern + recursions. This limits, indirectly, the amount of system stack that is + used. It was more useful in versions before 10.32, when stack memory + was used for local workspace vectors for recursive function calls. From + version 10.32, only local variables are allocated on the stack and as + each call uses only a few hundred bytes, even a small stack can support + quite a lot of recursion. + + If the depth of internal recursive function calls is great enough, lo- + cal workspace vectors are allocated on the heap from version 10.32 on- + wards, so the depth limit also indirectly limits the amount of heap + memory that is used. A recursive pattern such as /(.(?2))((?1)|)/, when + matched to a very long string using pcre2_dfa_match(), can use a great + deal of memory. However, it is probably better to limit heap usage di- + rectly by calling pcre2_set_heap_limit(). + + The default value for the depth limit can be set when PCRE2 is built; + if it is not, the default is set to the same value as the default for + the match limit. If the limit is exceeded, pcre2_match() or + pcre2_dfa_match() returns PCRE2_ERROR_DEPTHLIMIT. A value for the depth + limit may also be supplied by an item at the start of a pattern of the + form + + (*LIMIT_DEPTH=ddd) + + where ddd is a decimal number. However, such a setting is ignored un- + less ddd is less than the limit set by the caller of pcre2_match() or + pcre2_dfa_match() or, if no such limit is set, less than the default. + + +CHECKING BUILD-TIME OPTIONS + + int pcre2_config(uint32_t what, void *where); + + The function pcre2_config() makes it possible for a PCRE2 client to + find the value of certain configuration parameters and to discover + which optional features have been compiled into the PCRE2 library. The + pcre2build documentation has more details about these features. + + The first argument for pcre2_config() specifies which information is + required. The second argument is a pointer to memory into which the in- + formation is placed. If NULL is passed, the function returns the amount + of memory that is needed for the requested information. For calls that + return numerical values, the value is in bytes; when requesting these + values, where should point to appropriately aligned memory. For calls + that return strings, the required length is given in code units, not + counting the terminating zero. + + When requesting information, the returned value from pcre2_config() is + non-negative on success, or the negative error code PCRE2_ERROR_BADOP- + TION if the value in the first argument is not recognized. The follow- + ing information is available: + + PCRE2_CONFIG_BSR + + The output is a uint32_t integer whose value indicates what character + sequences the \R escape sequence matches by default. A value of + PCRE2_BSR_UNICODE means that \R matches any Unicode line ending se- + quence; a value of PCRE2_BSR_ANYCRLF means that \R matches only CR, LF, + or CRLF. The default can be overridden when a pattern is compiled. + + PCRE2_CONFIG_COMPILED_WIDTHS + + The output is a uint32_t integer whose lower bits indicate which code + unit widths were selected when PCRE2 was built. The 1-bit indicates + 8-bit support, and the 2-bit and 4-bit indicate 16-bit and 32-bit sup- + port, respectively. + + PCRE2_CONFIG_DEPTHLIMIT + + The output is a uint32_t integer that gives the default limit for the + depth of nested backtracking in pcre2_match() or the depth of nested + recursions, lookarounds, and atomic groups in pcre2_dfa_match(). Fur- + ther details are given with pcre2_set_depth_limit() above. + + PCRE2_CONFIG_HEAPLIMIT + + The output is a uint32_t integer that gives, in kibibytes, the default + limit for the amount of heap memory used by pcre2_match() or + pcre2_dfa_match(). Further details are given with + pcre2_set_heap_limit() above. + + PCRE2_CONFIG_JIT + + The output is a uint32_t integer that is set to one if support for + just-in-time compiling is included in the library; otherwise it is set + to zero. Note that having the support in the library does not guarantee + that JIT will be used for any given match, and neither does it guaran- + tee that JIT will actually be able to function, because it may not be + able to allocate executable memory in some environments. There is a + special call to pcre2_jit_compile() that can be used to check this. See + the pcre2jit documentation for more details. + + PCRE2_CONFIG_JITTARGET + + The where argument should point to a buffer that is at least 48 code + units long. (The exact length required can be found by calling + pcre2_config() with where set to NULL.) The buffer is filled with a + string that contains the name of the architecture for which the JIT + compiler is configured, for example "x86 32bit (little endian + un- + aligned)". If JIT support is not available, PCRE2_ERROR_BADOPTION is + returned, otherwise the number of code units used is returned. This is + the length of the string, plus one unit for the terminating zero. + + PCRE2_CONFIG_LINKSIZE + + The output is a uint32_t integer that contains the number of bytes used + for internal linkage in compiled regular expressions. When PCRE2 is + configured, the value can be set to 2, 3, or 4, with the default being + 2. This is the value that is returned by pcre2_config(). However, when + the 16-bit library is compiled, a value of 3 is rounded up to 4, and + when the 32-bit library is compiled, internal linkages always use 4 + bytes, so the configured value is not relevant. + + The default value of 2 for the 8-bit and 16-bit libraries is sufficient + for all but the most massive patterns, since it allows the size of the + compiled pattern to be up to 65535 code units. Larger values allow + larger regular expressions to be compiled by those two libraries, but + at the expense of slower matching. + + PCRE2_CONFIG_MATCHLIMIT + + The output is a uint32_t integer that gives the default match limit for + pcre2_match(). Further details are given with pcre2_set_match_limit() + above. + + PCRE2_CONFIG_NEWLINE + + The output is a uint32_t integer whose value specifies the default + character sequence that is recognized as meaning "newline". The values + are: + + PCRE2_NEWLINE_CR Carriage return (CR) + PCRE2_NEWLINE_LF Linefeed (LF) + PCRE2_NEWLINE_CRLF Carriage return, linefeed (CRLF) + PCRE2_NEWLINE_ANY Any Unicode line ending + PCRE2_NEWLINE_ANYCRLF Any of CR, LF, or CRLF + PCRE2_NEWLINE_NUL The NUL character (binary zero) + + The default should normally correspond to the standard sequence for + your operating system. + + PCRE2_CONFIG_NEVER_BACKSLASH_C + + The output is a uint32_t integer that is set to one if the use of \C + was permanently disabled when PCRE2 was built; otherwise it is set to + zero. + + PCRE2_CONFIG_PARENSLIMIT + + The output is a uint32_t integer that gives the maximum depth of nest- + ing of parentheses (of any kind) in a pattern. This limit is imposed to + cap the amount of system stack used when a pattern is compiled. It is + specified when PCRE2 is built; the default is 250. This limit does not + take into account the stack that may already be used by the calling ap- + plication. For finer control over compilation stack usage, see + pcre2_set_compile_recursion_guard(). + + PCRE2_CONFIG_STACKRECURSE + + This parameter is obsolete and should not be used in new code. The out- + put is a uint32_t integer that is always set to zero. + + PCRE2_CONFIG_TABLES_LENGTH + + The output is a uint32_t integer that gives the length of PCRE2's char- + acter processing tables in bytes. For details of these tables see the + section on locale support below. + + PCRE2_CONFIG_UNICODE_VERSION + + The where argument should point to a buffer that is at least 24 code + units long. (The exact length required can be found by calling + pcre2_config() with where set to NULL.) If PCRE2 has been compiled + without Unicode support, the buffer is filled with the text "Unicode + not supported". Otherwise, the Unicode version string (for example, + "8.0.0") is inserted. The number of code units used is returned. This + is the length of the string plus one unit for the terminating zero. + + PCRE2_CONFIG_UNICODE + + The output is a uint32_t integer that is set to one if Unicode support + is available; otherwise it is set to zero. Unicode support implies UTF + support. + + PCRE2_CONFIG_VERSION + + The where argument should point to a buffer that is at least 24 code + units long. (The exact length required can be found by calling + pcre2_config() with where set to NULL.) The buffer is filled with the + PCRE2 version string, zero-terminated. The number of code units used is + returned. This is the length of the string plus one unit for the termi- + nating zero. + + +COMPILING A PATTERN + + pcre2_code *pcre2_compile(PCRE2_SPTR pattern, PCRE2_SIZE length, + uint32_t options, int *errorcode, PCRE2_SIZE *erroroffset, + pcre2_compile_context *ccontext); + + void pcre2_code_free(pcre2_code *code); + + pcre2_code *pcre2_code_copy(const pcre2_code *code); + + pcre2_code *pcre2_code_copy_with_tables(const pcre2_code *code); + + The pcre2_compile() function compiles a pattern into an internal form. + The pattern is defined by a pointer to a string of code units and a + length in code units. If the pattern is zero-terminated, the length can + be specified as PCRE2_ZERO_TERMINATED. A NULL pattern pointer with a + length of zero is treated as an empty string (NULL with a non-zero + length causes an error return). The function returns a pointer to a + block of memory that contains the compiled pattern and related data, or + NULL if an error occurred. + + If the compile context argument ccontext is NULL, memory for the com- + piled pattern is obtained by calling malloc(). Otherwise, it is ob- + tained from the same memory function that was used for the compile con- + text. The caller must free the memory by calling pcre2_code_free() when + it is no longer needed. If pcre2_code_free() is called with a NULL ar- + gument, it returns immediately, without doing anything. + + The function pcre2_code_copy() makes a copy of the compiled code in new + memory, using the same memory allocator as was used for the original. + However, if the code has been processed by the JIT compiler (see be- + low), the JIT information cannot be copied (because it is position-de- + pendent). The new copy can initially be used only for non-JIT match- + ing, though it can be passed to pcre2_jit_compile() if required. If + pcre2_code_copy() is called with a NULL argument, it returns NULL. + + The pcre2_code_copy() function provides a way for individual threads in + a multithreaded application to acquire a private copy of shared com- + piled code. However, it does not make a copy of the character tables + used by the compiled pattern; the new pattern code points to the same + tables as the original code. (See "Locale Support" below for details + of these character tables.) In many applications the same tables are + used throughout, so this behaviour is appropriate. Nevertheless, there + are occasions when a copy of a compiled pattern and the relevant tables + are needed. The pcre2_code_copy_with_tables() provides this facility. + Copies of both the code and the tables are made, with the new code + pointing to the new tables. The memory for the new tables is automati- + cally freed when pcre2_code_free() is called for the new copy of the + compiled code. If pcre2_code_copy_with_tables() is called with a NULL + argument, it returns NULL. + + NOTE: When one of the matching functions is called, pointers to the + compiled pattern and the subject string are set in the match data block + so that they can be referenced by the substring extraction functions + after a successful match. After running a match, you must not free a + compiled pattern or a subject string until after all operations on the + match data block have taken place, unless, in the case of the subject + string, you have used the PCRE2_COPY_MATCHED_SUBJECT option, which is + described in the section entitled "Option bits for pcre2_match()" be- + low. + + The options argument for pcre2_compile() contains various bit settings + that affect the compilation. It should be zero if none of them are re- + quired. The available options are described below. Some of them (in + particular, those that are compatible with Perl, but some others as + well) can also be set and unset from within the pattern (see the de- + tailed description in the pcre2pattern documentation). + + For those options that can be different in different parts of the pat- + tern, the contents of the options argument specifies their settings at + the start of compilation. The PCRE2_ANCHORED, PCRE2_ENDANCHORED, and + PCRE2_NO_UTF_CHECK options can be set at the time of matching as well + as at compile time. + + Some additional options and less frequently required compile-time para- + meters (for example, the newline setting) can be provided in a compile + context (as described above). + + If errorcode or erroroffset is NULL, pcre2_compile() returns NULL imme- + diately. Otherwise, the variables to which these point are set to an + error code and an offset (number of code units) within the pattern, re- + spectively, when pcre2_compile() returns NULL because a compilation er- + ror has occurred. + + There are over 100 positive error codes that pcre2_compile() may return + if it finds an error in the pattern. There are also some negative error + codes that are used for invalid UTF strings when validity checking is + in force. These are the same as given by pcre2_match() and + pcre2_dfa_match(), and are described in the pcre2unicode documentation. + There is no separate documentation for the positive error codes, be- + cause the textual error messages that are obtained by calling the + pcre2_get_error_message() function (see "Obtaining a textual error mes- + sage" below) should be self-explanatory. Macro names starting with + PCRE2_ERROR_ are defined for both positive and negative error codes in + pcre2.h. When compilation is successful errorcode is set to a value + that returns the message "no error" if passed to pcre2_get_error_mes- + sage(). + + The value returned in erroroffset is an indication of where in the pat- + tern an error occurred. When there is no error, zero is returned. A + non-zero value is not necessarily the furthest point in the pattern + that was read. For example, after the error "lookbehind assertion is + not fixed length", the error offset points to the start of the failing + assertion. For an invalid UTF-8 or UTF-16 string, the offset is that of + the first code unit of the failing character. + + Some errors are not detected until the whole pattern has been scanned; + in these cases, the offset passed back is the length of the pattern. + Note that the offset is in code units, not characters, even in a UTF + mode. It may sometimes point into the middle of a UTF-8 or UTF-16 char- + acter. + + This code fragment shows a typical straightforward call to pcre2_com- + pile(): + + pcre2_code *re; + PCRE2_SIZE erroffset; + int errorcode; + re = pcre2_compile( + "^A.*Z", /* the pattern */ + PCRE2_ZERO_TERMINATED, /* the pattern is zero-terminated */ + 0, /* default options */ + &errorcode, /* for error code */ + &erroffset, /* for error offset */ + NULL); /* no compile context */ + + + Main compile options + + The following names for option bits are defined in the pcre2.h header + file: + + PCRE2_ANCHORED + + If this bit is set, the pattern is forced to be "anchored", that is, it + is constrained to match only at the first matching point in the string + that is being searched (the "subject string"). This effect can also be + achieved by appropriate constructs in the pattern itself, which is the + only way to do it in Perl. + + PCRE2_ALLOW_EMPTY_CLASS + + By default, for compatibility with Perl, a closing square bracket that + immediately follows an opening one is treated as a data character for + the class. When PCRE2_ALLOW_EMPTY_CLASS is set, it terminates the + class, which therefore contains no characters and so can never match. + + PCRE2_ALT_BSUX + + This option request alternative handling of three escape sequences, + which makes PCRE2's behaviour more like ECMAscript (aka JavaScript). + When it is set: + + (1) \U matches an upper case "U" character; by default \U causes a com- + pile time error (Perl uses \U to upper case subsequent characters). + + (2) \u matches a lower case "u" character unless it is followed by four + hexadecimal digits, in which case the hexadecimal number defines the + code point to match. By default, \u causes a compile time error (Perl + uses it to upper case the following character). + + (3) \x matches a lower case "x" character unless it is followed by two + hexadecimal digits, in which case the hexadecimal number defines the + code point to match. By default, as in Perl, a hexadecimal number is + always expected after \x, but it may have zero, one, or two digits (so, + for example, \xz matches a binary zero character followed by z). + + ECMAscript 6 added additional functionality to \u. This can be accessed + using the PCRE2_EXTRA_ALT_BSUX extra option (see "Extra compile op- + tions" below). Note that this alternative escape handling applies only + to patterns. Neither of these options affects the processing of re- + placement strings passed to pcre2_substitute(). + + PCRE2_ALT_CIRCUMFLEX + + In multiline mode (when PCRE2_MULTILINE is set), the circumflex + metacharacter matches at the start of the subject (unless PCRE2_NOTBOL + is set), and also after any internal newline. However, it does not + match after a newline at the end of the subject, for compatibility with + Perl. If you want a multiline circumflex also to match after a termi- + nating newline, you must set PCRE2_ALT_CIRCUMFLEX. + + PCRE2_ALT_EXTENDED_CLASS + + Alters the parsing of character classes to follow the extended syntax + described by Unicode UTS#18. The PCRE2_ALT_EXTENDED_CLASS option has no + impact on the behaviour of the Perl-specific "(?[...])" syntax for ex- + tended classes, but instead enables the alternative syntax of extended + class behaviour inside ordinary "[...]" character classes. See the + pcre2pattern documentation for details of the character classes sup- + ported. + + PCRE2_ALT_VERBNAMES + + By default, for compatibility with Perl, the name in any verb sequence + such as (*MARK:NAME) is any sequence of characters that does not in- + clude a closing parenthesis. The name is not processed in any way, and + it is not possible to include a closing parenthesis in the name. How- + ever, if the PCRE2_ALT_VERBNAMES option is set, normal backslash pro- + cessing is applied to verb names and only an unescaped closing paren- + thesis terminates the name. A closing parenthesis can be included in a + name either as \) or between \Q and \E. If the PCRE2_EXTENDED or + PCRE2_EXTENDED_MORE option is set with PCRE2_ALT_VERBNAMES, unescaped + whitespace in verb names is skipped and #-comments are recognized, ex- + actly as in the rest of the pattern. + + PCRE2_AUTO_CALLOUT + + If this bit is set, pcre2_compile() automatically inserts callout + items, all with number 255, before each pattern item, except immedi- + ately before or after an explicit callout in the pattern. For discus- + sion of the callout facility, see the pcre2callout documentation. + + PCRE2_CASELESS + + If this bit is set, letters in the pattern match both upper and lower + case letters in the subject. It is equivalent to Perl's /i option, and + it can be changed within a pattern by a (?i) option setting. If either + PCRE2_UTF or PCRE2_UCP is set, Unicode properties are used for all + characters with more than one other case, and for all characters whose + code points are greater than U+007F. + + Note that there are two ASCII characters, K and S, that, in addition to + their lower case ASCII equivalents, are case-equivalent with U+212A + (Kelvin sign) and U+017F (long S) respectively. If you do not want this + case equivalence, you can suppress it by setting PCRE2_EXTRA_CASE- + LESS_RESTRICT. + + One language family, Turkish and Azeri, has its own case-insensitivity + rules, which can be selected by setting PCRE2_EXTRA_TURKISH_CASING. + This alters the behaviour of the 'i', 'I', U+0130 (capital I with dot + above), and U+0131 (small dotless i) characters. + + For lower valued characters with only one other case, a lookup table is + used for speed. When neither PCRE2_UTF nor PCRE2_UCP is set, a lookup + table is used for all code points less than 256, and higher code points + (available only in 16-bit or 32-bit mode) are treated as not having an- + other case. + + From release 10.45 PCRE2_CASELESS also affects what some of the letter- + related Unicode property escapes (\p and \P) match. The properties Lu + (upper case letter), Ll (lower case letter), and Lt (title case letter) + are all treated as LC (cased letter) when PCRE2_CASELESS is set. + + PCRE2_DOLLAR_ENDONLY + + If this bit is set, a dollar metacharacter in the pattern matches only + at the end of the subject string. Without this option, a dollar also + matches immediately before a newline at the end of the string (but not + before any other newlines). The PCRE2_DOLLAR_ENDONLY option is ignored + if PCRE2_MULTILINE is set. There is no equivalent to this option in + Perl, and no way to set it within a pattern. + + PCRE2_DOTALL + + If this bit is set, a dot metacharacter in the pattern matches any + character, including one that indicates a newline. However, it only + ever matches one character, even if newlines are coded as CRLF. Without + this option, a dot does not match when the current position in the sub- + ject is at a newline. This option is equivalent to Perl's /s option, + and it can be changed within a pattern by a (?s) option setting. A neg- + ative class such as [^a] always matches newline characters, and the \N + escape sequence always matches a non-newline character, independent of + the setting of PCRE2_DOTALL. + + PCRE2_DUPNAMES + + If this bit is set, names used to identify capture groups need not be + unique. This can be helpful for certain types of pattern when it is + known that only one instance of the named group can ever be matched. + There are more details of named capture groups below; see also the + pcre2pattern documentation. + + PCRE2_ENDANCHORED + + If this bit is set, the end of any pattern match must be right at the + end of the string being searched (the "subject string"). If the pattern + match succeeds by reaching (*ACCEPT), but does not reach the end of the + subject, the match fails at the current starting point. For unanchored + patterns, a new match is then tried at the next starting point. How- + ever, if the match succeeds by reaching the end of the pattern, but not + the end of the subject, backtracking occurs and an alternative match + may be found. Consider these two patterns: + + .(*ACCEPT)|.. + .|.. + + If matched against "abc" with PCRE2_ENDANCHORED set, the first matches + "c" whereas the second matches "bc". The effect of PCRE2_ENDANCHORED + can also be achieved by appropriate constructs in the pattern itself, + which is the only way to do it in Perl. + + For DFA matching with pcre2_dfa_match(), PCRE2_ENDANCHORED applies only + to the first (that is, the longest) matched string. Other parallel + matches, which are necessarily substrings of the first one, must obvi- + ously end before the end of the subject. + + PCRE2_EXTENDED + + If this bit is set, most white space characters in the pattern are to- + tally ignored except when escaped, inside a character class, or inside + a \Q...\E sequence. However, white space is not allowed within se- + quences such as (?> that introduce various parenthesized groups, nor + within numerical quantifiers such as {1,3}. Ignorable white space is + permitted between an item and a following quantifier and between a + quantifier and a following + that indicates possessiveness. PCRE2_EX- + TENDED is equivalent to Perl's /x option, and it can be changed within + a pattern by a (?x) option setting. + + When PCRE2 is compiled without Unicode support, PCRE2_EXTENDED recog- + nizes as white space only those characters with code points less than + 256 that are flagged as white space in its low-character table. The ta- + ble is normally created by pcre2_maketables(), which uses the isspace() + function to identify space characters. In most ASCII environments, the + relevant characters are those with code points 0x0009 (tab), 0x000A + (linefeed), 0x000B (vertical tab), 0x000C (formfeed), 0x000D (carriage + return), and 0x0020 (space). + + When PCRE2 is compiled with Unicode support, in addition to these char- + acters, five more Unicode "Pattern White Space" characters are recog- + nized by PCRE2_EXTENDED. These are U+0085 (next line), U+200E (left-to- + right mark), U+200F (right-to-left mark), U+2028 (line separator), and + U+2029 (paragraph separator). This set of characters is the same as + recognized by Perl's /x option. Note that the horizontal and vertical + space characters that are matched by the \h and \v escapes in patterns + are a much bigger set. + + As well as ignoring most white space, PCRE2_EXTENDED also causes char- + acters between an unescaped # outside a character class and the next + newline, inclusive, to be ignored, which makes it possible to include + comments inside complicated patterns. Note that the end of this type of + comment is a literal newline sequence in the pattern; escape sequences + that happen to represent a newline do not count. + + Which characters are interpreted as newlines can be specified by a set- + ting in the compile context that is passed to pcre2_compile() or by a + special sequence at the start of the pattern, as described in the sec- + tion entitled "Newline conventions" in the pcre2pattern documentation. + A default is defined when PCRE2 is built. + + PCRE2_EXTENDED_MORE + + This option has the effect of PCRE2_EXTENDED, but, in addition, un- + escaped space and horizontal tab characters are ignored inside a char- + acter class. Note: only these two characters are ignored, not the full + set of pattern white space characters that are ignored outside a char- + acter class. PCRE2_EXTENDED_MORE is equivalent to Perl's /xx option, + and it can be changed within a pattern by a (?xx) option setting. + + PCRE2_FIRSTLINE + + If this option is set, the start of an unanchored pattern match must be + before or at the first newline in the subject string following the + start of matching, though the matched text may continue over the new- + line. If startoffset is non-zero, the limiting newline is not necessar- + ily the first newline in the subject. For example, if the subject + string is "abc\nxyz" (where \n represents a single-character newline) a + pattern match for "yz" succeeds with PCRE2_FIRSTLINE if startoffset is + greater than 3. See also PCRE2_USE_OFFSET_LIMIT, which provides a more + general limiting facility. If PCRE2_FIRSTLINE is set with an offset + limit, a match must occur in the first line and also within the offset + limit. In other words, whichever limit comes first is used. This option + has no effect for anchored patterns. + + PCRE2_LITERAL + + If this option is set, all meta-characters in the pattern are disabled, + and it is treated as a literal string. Matching literal strings with a + regular expression engine is not the most efficient way of doing it. If + you are doing a lot of literal matching and are worried about effi- + ciency, you should consider using other approaches. The only other main + options that are allowed with PCRE2_LITERAL are: PCRE2_ANCHORED, + PCRE2_ENDANCHORED, PCRE2_AUTO_CALLOUT, PCRE2_CASELESS, PCRE2_FIRSTLINE, + PCRE2_MATCH_INVALID_UTF, PCRE2_NO_START_OPTIMIZE, PCRE2_NO_UTF_CHECK, + PCRE2_UTF, and PCRE2_USE_OFFSET_LIMIT. The extra options PCRE2_EX- + TRA_MATCH_LINE and PCRE2_EXTRA_MATCH_WORD are also supported. Any other + options cause an error. + + PCRE2_MATCH_INVALID_UTF + + This option forces PCRE2_UTF (see below) and also enables support for + matching by pcre2_match() in subject strings that contain invalid UTF + sequences. Note, however, that the 16-bit and 32-bit PCRE2 libraries + process strings as sequences of uint16_t or uint32_t code points. They + cannot find valid UTF sequences within an arbitrary string of bytes un- + less such sequences are suitably aligned. This facility is not sup- + ported for DFA matching. For details, see the pcre2unicode documenta- + tion. + + PCRE2_MATCH_UNSET_BACKREF + + If this option is set, a backreference to an unset capture group + matches an empty string (by default this causes the current matching + alternative to fail). A pattern such as (\1)(a) succeeds when this op- + tion is set (assuming it can find an "a" in the subject), whereas it + fails by default, for Perl compatibility. Setting this option makes + PCRE2 behave more like ECMAscript (aka JavaScript). + + PCRE2_MULTILINE + + By default, for the purposes of matching "start of line" and "end of + line", PCRE2 treats the subject string as consisting of a single line + of characters, even if it actually contains newlines. The "start of + line" metacharacter (^) matches only at the start of the string, and + the "end of line" metacharacter ($) matches only at the end of the + string, or before a terminating newline (except when PCRE2_DOLLAR_EN- + DONLY is set). Note, however, that unless PCRE2_DOTALL is set, the "any + character" metacharacter (.) does not match at a newline. This behav- + iour (for ^, $, and dot) is the same as Perl. + + When PCRE2_MULTILINE it is set, the "start of line" and "end of line" + constructs match immediately following or immediately before internal + newlines in the subject string, respectively, as well as at the very + start and end. This is equivalent to Perl's /m option, and it can be + changed within a pattern by a (?m) option setting. Note that the "start + of line" metacharacter does not match after a newline at the end of the + subject, for compatibility with Perl. However, you can change this by + setting the PCRE2_ALT_CIRCUMFLEX option. If there are no newlines in a + subject string, or no occurrences of ^ or $ in a pattern, setting + PCRE2_MULTILINE has no effect. + + PCRE2_NEVER_BACKSLASH_C + + This option locks out the use of \C in the pattern that is being com- + piled. This escape can cause unpredictable behaviour in UTF-8 or + UTF-16 modes, because it may leave the current matching point in the + middle of a multi-code-unit character. This option may be useful in ap- + plications that process patterns from external sources. Note that there + is also a build-time option that permanently locks out the use of \C. + + PCRE2_NEVER_UCP + + This option locks out the use of Unicode properties for handling \B, + \b, \D, \d, \S, \s, \W, \w, and some of the POSIX character classes, as + described for the PCRE2_UCP option below. In particular, it prevents + the creator of the pattern from enabling this facility by starting the + pattern with (*UCP). This option may be useful in applications that + process patterns from external sources. The option combination + PCRE2_UCP and PCRE2_NEVER_UCP causes an error. + + PCRE2_NEVER_UTF + + This option locks out interpretation of the pattern as UTF-8, UTF-16, + or UTF-32, depending on which library is in use. In particular, it pre- + vents the creator of the pattern from switching to UTF interpretation + by starting the pattern with (*UTF). This option may be useful in ap- + plications that process patterns from external sources. The combination + of PCRE2_UTF and PCRE2_NEVER_UTF causes an error. + + PCRE2_NO_AUTO_CAPTURE + + If this option is set, it disables the use of numbered capturing paren- + theses in the pattern. Any opening parenthesis that is not followed by + ? behaves as if it were followed by ?: but named parentheses can still + be used for capturing (and they acquire numbers in the usual way). This + is the same as Perl's /n option. Note that, when this option is set, + references to capture groups (backreferences or recursion/subroutine + calls) may only refer to named groups, though the reference can be by + name or by number. + + PCRE2_NO_AUTO_POSSESS + + If this (deprecated) option is set, it disables "auto-possessifica- + tion", which is an optimization that, for example, turns a+b into a++b + in order to avoid backtracks into a+ that can never be successful. How- + ever, if callouts are in use, auto-possessification means that some + callouts are never taken. You can set this option if you want the + matching functions to do a full unoptimized search and run all the + callouts, but it is mainly provided for testing purposes. + + If a compile context is available, it is recommended to use + pcre2_set_optimize() with the directive PCRE2_AUTO_POSSESS_OFF rather + than the compile option PCRE2_NO_AUTO_POSSESS. Note that + PCRE2_NO_AUTO_POSSESS takes precedence over the pcre2_set_optimize() + optimization directives PCRE2_AUTO_POSSESS and PCRE2_AUTO_POSSESS_OFF. + + PCRE2_NO_DOTSTAR_ANCHOR + + If this (deprecated) option is set, it disables an optimization that is + applied when .* is the first significant item in a top-level branch of + a pattern, and all the other branches also start with .* or with \A or + \G or ^. The optimization is automatically disabled for .* if it is in- + side an atomic group or a capture group that is the subject of a back- + reference, or if the pattern contains (*PRUNE) or (*SKIP). When the op- + timization is not disabled, such a pattern is automatically anchored if + PCRE2_DOTALL is set for all the .* items and PCRE2_MULTILINE is not set + for any ^ items. Otherwise, the fact that any match must start either + at the start of the subject or following a newline is remembered. Like + other optimizations, this can cause callouts to be skipped. (If a com- + pile context is available, it is recommended to use pcre2_set_opti- + mize() with the directive PCRE2_DOTSTAR_ANCHOR_OFF instead.) + + PCRE2_NO_START_OPTIMIZE + + This is an option whose main effect is at matching time. It does not + change what pcre2_compile() generates, but it does affect the output of + the JIT compiler. Setting this option is equivalent to calling + pcre2_set_optimize() with the directive parameter set to + PCRE2_START_OPTIMIZE_OFF. + + There are a number of optimizations that may occur at the start of a + match, in order to speed up the process. For example, if it is known + that an unanchored match must start with a specific code unit value, + the matching code searches the subject for that value, and fails imme- + diately if it cannot find it, without actually running the main match- + ing function. The start-up optimizations are in effect a pre-scan of + the subject that takes place before the pattern is run. + + Disabling the start-up optimizations may cause performance to suffer. + However, this may be desirable for patterns which contain callouts or + items such as (*COMMIT) and (*MARK). See the above description of + PCRE2_START_OPTIMIZE_OFF for further details. + + PCRE2_NO_UTF_CHECK + + When PCRE2_UTF is set, the validity of the pattern as a UTF string is + automatically checked. There are discussions about the validity of + UTF-8 strings, UTF-16 strings, and UTF-32 strings in the pcre2unicode + document. If an invalid UTF sequence is found, pcre2_compile() returns + a negative error code. + + If you know that your pattern is a valid UTF string, and you want to + skip this check for performance reasons, you can set the + PCRE2_NO_UTF_CHECK option. When it is set, the effect of passing an in- + valid UTF string as a pattern is undefined. It may cause your program + to crash or loop. + + Note that this option can also be passed to pcre2_match() and + pcre2_dfa_match(), to suppress UTF validity checking of the subject + string. + + Note also that setting PCRE2_NO_UTF_CHECK at compile time does not dis- + able the error that is given if an escape sequence for an invalid Uni- + code code point is encountered in the pattern. In particular, the so- + called "surrogate" code points (0xd800 to 0xdfff) are invalid. If you + want to allow escape sequences such as \x{d800} you can set the + PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES extra option, as described in the + section entitled "Extra compile options" below. However, this is pos- + sible only in UTF-8 and UTF-32 modes, because these values are not rep- + resentable in UTF-16. + + PCRE2_UCP + + This option has two effects. Firstly, it change the way PCRE2 processes + \B, \b, \D, \d, \S, \s, \W, \w, and some of the POSIX character + classes. By default, only ASCII characters are recognized, but if + PCRE2_UCP is set, Unicode properties are used to classify characters. + There are some PCRE2_EXTRA options (see below) that add finer control + to this behaviour. More details are given in the section on generic + character types in the pcre2pattern page. + + The second effect of PCRE2_UCP is to force the use of Unicode proper- + ties for upper/lower casing operations, even when PCRE2_UTF is not set. + This makes it possible to process strings in the 16-bit UCS-2 code. + This option is available only if PCRE2 has been compiled with Unicode + support (which is the default). + + The PCRE2_EXTRA_CASELESS_RESTRICT option (see above) restricts caseless + matching such that ASCII characters match only ASCII characters and + non-ASCII characters match only non-ASCII characters. The PCRE2_EX- + TRA_TURKISH_CASING option (see above) alters the matching of the 'i' + characters to follow their behaviour in Turkish and Azeri languages. + For further details on PCRE2_EXTRA_CASELESS_RESTRICT and PCRE2_EX- + TRA_TURKISH_CASING, see the pcre2unicode page. + + PCRE2_UNGREEDY + + This option inverts the "greediness" of the quantifiers so that they + are not greedy by default, but become greedy if followed by "?". It is + not compatible with Perl. It can also be set by a (?U) option setting + within the pattern. + + PCRE2_USE_OFFSET_LIMIT + + This option must be set for pcre2_compile() if pcre2_set_offset_limit() + is going to be used to set a non-default offset limit in a match con- + text for matches that use this pattern. An error is generated if an + offset limit is set without this option. For more details, see the de- + scription of pcre2_set_offset_limit() in the section that describes + match contexts. See also the PCRE2_FIRSTLINE option above. + + PCRE2_UTF + + This option causes PCRE2 to regard both the pattern and the subject + strings that are subsequently processed as strings of UTF characters + instead of single-code-unit strings. It is available when PCRE2 is + built to include Unicode support (which is the default). If Unicode + support is not available, the use of this option provokes an error. De- + tails of how PCRE2_UTF changes the behaviour of PCRE2 are given in the + pcre2unicode page. In particular, note that it changes the way + PCRE2_CASELESS works. + + Extra compile options + + The option bits that can be set in a compile context by calling the + pcre2_set_compile_extra_options() function are as follows: + + PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK + + Since release 10.38 PCRE2 has forbidden the use of \K within lookaround + assertions, following Perl's lead. This option is provided to re-enable + the previous behaviour (act in positive lookarounds, ignore in negative + ones) in case anybody is relying on it. + + PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES + + This option applies when compiling a pattern in UTF-8 or UTF-32 mode. + It is forbidden in UTF-16 mode, and ignored in non-UTF modes. Unicode + "surrogate" code points in the range 0xd800 to 0xdfff are used in pairs + in UTF-16 to encode code points with values in the range 0x10000 to + 0x10ffff. The surrogates cannot therefore be represented in UTF-16. + They can be represented in UTF-8 and UTF-32, but are defined as invalid + code points, and cause errors if encountered in a UTF-8 or UTF-32 + string that is being checked for validity by PCRE2. + + These values also cause errors if encountered in escape sequences such + as \x{d912} within a pattern. However, it seems that some applications, + when using PCRE2 to check for unwanted characters in UTF-8 strings, ex- + plicitly test for the surrogates using escape sequences. The + PCRE2_NO_UTF_CHECK option does not disable the error that occurs, be- + cause it applies only to the testing of input strings for UTF validity. + + If the extra option PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES is set, surro- + gate code point values in UTF-8 and UTF-32 patterns no longer provoke + errors and are incorporated in the compiled pattern. However, they can + only match subject characters if the matching function is called with + PCRE2_NO_UTF_CHECK set. + + PCRE2_EXTRA_ALT_BSUX + + The original option PCRE2_ALT_BSUX causes PCRE2 to process \U, \u, and + \x in the way that ECMAscript (aka JavaScript) does. Additional func- + tionality was defined by ECMAscript 6; setting PCRE2_EXTRA_ALT_BSUX has + the effect of PCRE2_ALT_BSUX, but in addition it recognizes \u{hhh..} + as a hexadecimal character code, where hhh.. is any number of hexadeci- + mal digits. + + PCRE2_EXTRA_ASCII_BSD + + This option forces \d to match only ASCII digits, even when PCRE2_UCP + is set. It can be changed within a pattern by means of the (?aD) op- + tion setting. + + PCRE2_EXTRA_ASCII_BSS + + This option forces \s to match only ASCII space characters, even when + PCRE2_UCP is set. It can be changed within a pattern by means of the + (?aS) option setting. + + PCRE2_EXTRA_ASCII_BSW + + This option forces \w to match only ASCII word characters, even when + PCRE2_UCP is set. It can be changed within a pattern by means of the + (?aW) option setting. + + PCRE2_EXTRA_ASCII_DIGIT + + This option forces the POSIX character classes [:digit:] and [:xdigit:] + to match only ASCII digits, even when PCRE2_UCP is set. It can be + changed within a pattern by means of the (?aT) option setting. + + PCRE2_EXTRA_ASCII_POSIX + + This option forces all the POSIX character classes, including [:digit:] + and [:xdigit:], to match only ASCII characters, even when PCRE2_UCP is + set. It can be changed within a pattern by means of the (?aP) option + setting, but note that this also sets PCRE2_EXTRA_ASCII_DIGIT in order + to ensure that (?-aP) unsets all ASCII restrictions for POSIX classes. + + PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL + + This is a dangerous option. Use with care. By default, an unrecognized + escape such as \j or a malformed one such as \x{2z} causes a compile- + time error when detected by pcre2_compile(). Perl is somewhat inconsis- + tent in handling such items: for example, \j is treated as a literal + "j", and non-hexadecimal digits in \x{} are just ignored, though warn- + ings are given in both cases if Perl's warning switch is enabled. How- + ever, a malformed octal number after \o{ always causes an error in + Perl. + + If the PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL extra option is passed to + pcre2_compile(), all unrecognized or malformed escape sequences are + treated as single-character escapes. For example, \j is a literal "j" + and \x{2z} is treated as the literal string "x{2z}". Setting this op- + tion means that typos in patterns may go undetected and have unexpected + results. Also note that a sequence such as [\N{] is interpreted as a + malformed attempt at [\N{...}] and so is treated as [N{] whereas [\N] + gives an error because an unqualified \N is a valid escape sequence but + is not supported in a character class. To reiterate: this is a danger- + ous option. Use with great care. + + PCRE2_EXTRA_CASELESS_RESTRICT + + When either PCRE2_UCP or PCRE2_UTF is set, caseless matching follows + Unicode rules, which allow for more than two cases per character. There + are two case-equivalent character sets that contain both ASCII and non- + ASCII characters. The ASCII letter S is case-equivalent to U+017f (long + S) and the ASCII letter K is case-equivalent to U+212a (Kelvin sign). + This option disables recognition of case-equivalences that cross the + ASCII/non-ASCII boundary. In a caseless match, both characters must ei- + ther be ASCII or non-ASCII. The option can be changed within a pattern + by the (*CASELESS_RESTRICT) or (?r) option settings. + + PCRE2_EXTRA_ESCAPED_CR_IS_LF + + There are some legacy applications where the escape sequence \r in a + pattern is expected to match a newline. If this option is set, \r in a + pattern is converted to \n so that it matches a LF (linefeed) instead + of a CR (carriage return) character. The option does not affect a lit- + eral CR in the pattern, nor does it affect CR specified as an explicit + code point such as \x{0D}. + + PCRE2_EXTRA_MATCH_LINE + + This option is provided for use by the -x option of pcre2grep. It + causes the pattern only to match complete lines. This is achieved by + automatically inserting the code for "^(?:" at the start of the com- + piled pattern and ")$" at the end. Thus, when PCRE2_MULTILINE is set, + the matched line may be in the middle of the subject string. This op- + tion can be used with PCRE2_LITERAL. + + PCRE2_EXTRA_MATCH_WORD + + This option is provided for use by the -w option of pcre2grep. It + causes the pattern only to match strings that have a word boundary at + the start and the end. This is achieved by automatically inserting the + code for "\b(?:" at the start of the compiled pattern and ")\b" at the + end. The option may be used with PCRE2_LITERAL. However, it is ignored + if PCRE2_EXTRA_MATCH_LINE is also set. + + PCRE2_EXTRA_NO_BS0 + + If this option is set (note that its final character is the digit 0) it + locks out the use of the sequence \0 unless at least one more octal + digit follows. + + PCRE2_EXTRA_PYTHON_OCTAL + + If this option is set, PCRE2 follows Python's rules for interpreting + octal escape sequences. The rules for handling sequences such as \14, + which could be an octal number or a back reference are different. De- + tails are given in the pcre2pattern documentation. + + PCRE2_EXTRA_NEVER_CALLOUT + + If this option is set, PCRE2 treats callouts in the pattern as a syntax + error, returning PCRE2_ERROR_CALLOUT_CALLER_DISABLED. This is useful if + the application knows that a callout will not be provided to + pcre2_match(), so that callouts in the pattern are not silently ig- + nored. + + PCRE2_EXTRA_TURKISH_CASING + + This option alters case-equivalence of the 'i' letters to follow the + alphabet used by Turkish and Azeri languages. The option can be changed + within a pattern by the (*TURKISH_CASING) start-of-pattern setting. Ei- + ther the UTF or UCP options must be set. In the 8-bit library, UTF must + be set. This option cannot be combined with PCRE2_EXTRA_CASELESS_RE- + STRICT. + + +JUST-IN-TIME (JIT) COMPILATION + + int pcre2_jit_compile(pcre2_code *code, uint32_t options); + + int pcre2_jit_match(const pcre2_code *code, PCRE2_SPTR subject, + PCRE2_SIZE length, PCRE2_SIZE startoffset, + uint32_t options, pcre2_match_data *match_data, + pcre2_match_context *mcontext); + + void pcre2_jit_free_unused_memory(pcre2_general_context *gcontext); + + pcre2_jit_stack *pcre2_jit_stack_create(size_t startsize, + size_t maxsize, pcre2_general_context *gcontext); + + void pcre2_jit_stack_assign(pcre2_match_context *mcontext, + pcre2_jit_callback callback_function, void *callback_data); + + void pcre2_jit_stack_free(pcre2_jit_stack *jit_stack); + + These functions provide support for JIT compilation, which, if the + just-in-time compiler is available, further processes a compiled pat- + tern into machine code that executes much faster than the pcre2_match() + interpretive matching function. Full details are given in the pcre2jit + documentation. + + JIT compilation is a heavyweight optimization. It can take some time + for patterns to be analyzed, and for one-off matches and simple pat- + terns the benefit of faster execution might be offset by a much slower + compilation time. Most (but not all) patterns can be optimized by the + JIT compiler. + + +LOCALE SUPPORT + + const uint8_t *pcre2_maketables(pcre2_general_context *gcontext); + + void pcre2_maketables_free(pcre2_general_context *gcontext, + const uint8_t *tables); + + PCRE2 handles caseless matching, and determines whether characters are + letters, digits, or whatever, by reference to a set of tables, indexed + by character code point. However, this applies only to characters whose + code points are less than 256. By default, higher-valued code points + never match escapes such as \w or \d. + + When PCRE2 is built with Unicode support (the default), certain Unicode + character properties can be tested with \p and \P, or, alternatively, + the PCRE2_UCP option can be set when a pattern is compiled; this causes + \w and friends to use Unicode property support instead of the built-in + tables. PCRE2_UCP also causes upper/lower casing operations on charac- + ters with code points greater than 127 to use Unicode properties. These + effects apply even when PCRE2_UTF is not set. There are, however, some + PCRE2_EXTRA options (see above) that can be used to modify or suppress + them. + + The use of locales with Unicode is discouraged. If you are handling + characters with code points greater than 127, you should either use + Unicode support, or use locales, but not try to mix the two. + + PCRE2 contains a built-in set of character tables that are used by de- + fault. These are sufficient for many applications. Normally, the in- + ternal tables recognize only ASCII characters. However, when PCRE2 is + built, it is possible to cause the internal tables to be rebuilt in the + default "C" locale of the local system, which may cause them to be dif- + ferent. + + The built-in tables can be overridden by tables supplied by the appli- + cation that calls PCRE2. These may be created in a different locale + from the default. As more and more applications change to using Uni- + code, the need for this locale support is expected to die away. + + External tables are built by calling the pcre2_maketables() function, + in the relevant locale. The only argument to this function is a general + context, which can be used to pass a custom memory allocator. If the + argument is NULL, the system malloc() is used. The result can be passed + to pcre2_compile() as often as necessary, by creating a compile context + and calling pcre2_set_character_tables() to set the tables pointer + therein. + + For example, to build and use tables that are appropriate for the + French locale (where accented characters with values greater than 127 + are treated as letters), the following code could be used: + + setlocale(LC_CTYPE, "fr_FR"); + tables = pcre2_maketables(NULL); + ccontext = pcre2_compile_context_create(NULL); + pcre2_set_character_tables(ccontext, tables); + re = pcre2_compile(..., ccontext); + + The locale name "fr_FR" is used on Linux and other Unix-like systems; + if you are using Windows, the name for the French locale is "french". + + The pointer that is passed (via the compile context) to pcre2_compile() + is saved with the compiled pattern, and the same tables are used by the + matching functions. Thus, for any single pattern, compilation and + matching both happen in the same locale, but different patterns can be + processed in different locales. + + It is the caller's responsibility to ensure that the memory containing + the tables remains available while they are still in use. When they are + no longer needed, you can discard them using pcre2_maketables_free(), + which should pass as its first parameter the same global context that + was used to create the tables. + + Saving locale tables + + The tables described above are just a sequence of binary bytes, which + makes them independent of hardware characteristics such as endianness + or whether the processor is 32-bit or 64-bit. A copy of the result of + pcre2_maketables() can therefore be saved in a file or elsewhere and + re-used later, even in a different program or on another computer. The + size of the tables (number of bytes) must be obtained by calling + pcre2_config() with the PCRE2_CONFIG_TABLES_LENGTH option because + pcre2_maketables() does not return this value. Note that the + pcre2_dftables program, which is part of the PCRE2 build system, can be + used stand-alone to create a file that contains a set of binary tables. + See the pcre2build documentation for details. + + +INFORMATION ABOUT A COMPILED PATTERN + + int pcre2_pattern_info(const pcre2 *code, uint32_t what, void *where); + + The pcre2_pattern_info() function returns general information about a + compiled pattern. For information about callouts, see the next section. + The first argument for pcre2_pattern_info() is a pointer to the com- + piled pattern. The second argument specifies which piece of information + is required, and the third argument is a pointer to a variable to re- + ceive the data. If the third argument is NULL, the first argument is + ignored, and the function returns the size in bytes of the variable + that is required for the information requested. Otherwise, the yield of + the function is zero for success, or one of the following negative num- + bers: + + PCRE2_ERROR_NULL the argument code was NULL + PCRE2_ERROR_BADMAGIC the "magic number" was not found + PCRE2_ERROR_BADOPTION the value of what was invalid + PCRE2_ERROR_UNSET the requested field is not set + + The "magic number" is placed at the start of each compiled pattern as a + simple check against passing an arbitrary memory pointer. Here is a + typical call of pcre2_pattern_info(), to obtain the length of the com- + piled pattern: + + int rc; + size_t length; + rc = pcre2_pattern_info( + re, /* result of pcre2_compile() */ + PCRE2_INFO_SIZE, /* what is required */ + &length); /* where to put the data */ + + The possible values for the second argument are defined in pcre2.h, and + are as follows: + + PCRE2_INFO_ALLOPTIONS + PCRE2_INFO_ARGOPTIONS + PCRE2_INFO_EXTRAOPTIONS + + Return copies of the pattern's options. The third argument should point + to a uint32_t variable. PCRE2_INFO_ARGOPTIONS returns exactly the op- + tions that were passed to pcre2_compile(), whereas PCRE2_INFO_ALLOP- + TIONS returns the compile options as modified by any top-level (*XXX) + option settings such as (*UTF) at the start of the pattern itself. + PCRE2_INFO_EXTRAOPTIONS returns the extra options that were set in the + compile context by calling the pcre2_set_compile_extra_options() func- + tion. + + For example, if the pattern /(*UTF)abc/ is compiled with the PCRE2_EX- + TENDED option, the result for PCRE2_INFO_ALLOPTIONS is PCRE2_EXTENDED + and PCRE2_UTF. Option settings such as (?i) that can change within a + pattern do not affect the result of PCRE2_INFO_ALLOPTIONS, even if they + appear right at the start of the pattern. (This was different in some + earlier releases.) + + A pattern compiled without PCRE2_ANCHORED is automatically anchored by + PCRE2 if the first significant item in every top-level branch is one of + the following: + + ^ unless PCRE2_MULTILINE is set + \A always + \G always + .* sometimes - see below + + When .* is the first significant item, anchoring is possible only when + all the following are true: + + .* is not in an atomic group + .* is not in a capture group that is the subject + of a backreference + PCRE2_DOTALL is in force for .* + Neither (*PRUNE) nor (*SKIP) appears in the pattern + PCRE2_NO_DOTSTAR_ANCHOR is not set + Dotstar anchoring has not been disabled with PCRE2_DOTSTAR_ANCHOR_OFF + + For patterns that are auto-anchored, the PCRE2_ANCHORED bit is set in + the options returned for PCRE2_INFO_ALLOPTIONS. + + PCRE2_INFO_BACKREFMAX + + Return the number of the highest backreference in the pattern. The + third argument should point to a uint32_t variable. Named capture + groups acquire numbers as well as names, and these count towards the + highest backreference. Backreferences such as \4 or \g{12} match the + captured characters of the given group, but in addition, the check that + a capture group is set in a conditional group such as (?(3)a|b) is also + a backreference. Zero is returned if there are no backreferences. + + PCRE2_INFO_BSR + + The output is a uint32_t integer whose value indicates what character + sequences the \R escape sequence matches. A value of PCRE2_BSR_UNICODE + means that \R matches any Unicode line ending sequence; a value of + PCRE2_BSR_ANYCRLF means that \R matches only CR, LF, or CRLF. + + PCRE2_INFO_CAPTURECOUNT + + Return the highest capture group number in the pattern. In patterns + where (?| is not used, this is also the total number of capture groups. + The third argument should point to a uint32_t variable. + + PCRE2_INFO_DEPTHLIMIT + + If the pattern set a backtracking depth limit by including an item of + the form (*LIMIT_DEPTH=nnnn) at the start, the value is returned. The + third argument should point to a uint32_t integer. If no such value has + been set, the call to pcre2_pattern_info() returns the error PCRE2_ER- + ROR_UNSET. Note that this limit will only be used during matching if it + is less than the limit set or defaulted by the caller of the match + function. + + PCRE2_INFO_FIRSTBITMAP + + In the absence of a single first code unit for a non-anchored pattern, + pcre2_compile() may construct a 256-bit table that defines a fixed set + of values for the first code unit in any match. For example, a pattern + that starts with [abc] results in a table with three bits set. When + code unit values greater than 255 are supported, the flag bit for 255 + means "any code unit of value 255 or above". If such a table was con- + structed, a pointer to it is returned. Otherwise NULL is returned. The + third argument should point to a const uint8_t * variable. + + PCRE2_INFO_FIRSTCODETYPE + + Return information about the first code unit of any matched string, for + a non-anchored pattern. The third argument should point to a uint32_t + variable. If there is a fixed first value, for example, the letter "c" + from a pattern such as (cat|cow|coyote), 1 is returned, and the value + can be retrieved using PCRE2_INFO_FIRSTCODEUNIT. If there is no fixed + first value, but it is known that a match can occur only at the start + of the subject or following a newline in the subject, 2 is returned. + Otherwise, and for anchored patterns, 0 is returned. + + PCRE2_INFO_FIRSTCODEUNIT + + Return the value of the first code unit of any matched string for a + pattern where PCRE2_INFO_FIRSTCODETYPE returns 1; otherwise return 0. + The third argument should point to a uint32_t variable. In the 8-bit + library, the value is always less than 256. In the 16-bit library the + value can be up to 0xffff. In the 32-bit library in UTF-32 mode the + value can be up to 0x10ffff, and up to 0xffffffff when not using UTF-32 + mode. + + PCRE2_INFO_FRAMESIZE + + Return the size (in bytes) of the data frames that are used to remember + backtracking positions when the pattern is processed by pcre2_match() + without the use of JIT. The third argument should point to a size_t + variable. The frame size depends on the number of capturing parentheses + in the pattern. Each additional capture group adds two PCRE2_SIZE vari- + ables. + + PCRE2_INFO_HASBACKSLASHC + + Return 1 if the pattern contains any instances of \C, otherwise 0. The + third argument should point to a uint32_t variable. + + PCRE2_INFO_HASCRORLF + + Return 1 if the pattern contains any explicit matches for CR or LF + characters, otherwise 0. The third argument should point to a uint32_t + variable. An explicit match is either a literal CR or LF character, or + \r or \n or one of the equivalent hexadecimal or octal escape se- + quences. + + PCRE2_INFO_HEAPLIMIT + + If the pattern set a heap memory limit by including an item of the form + (*LIMIT_HEAP=nnnn) at the start, the value is returned. The third argu- + ment should point to a uint32_t integer. If no such value has been set, + the call to pcre2_pattern_info() returns the error PCRE2_ERROR_UNSET. + Note that this limit will only be used during matching if it is less + than the limit set or defaulted by the caller of the match function. + + PCRE2_INFO_JCHANGED + + Return 1 if the (?J) or (?-J) option setting is used in the pattern, + otherwise 0. The third argument should point to a uint32_t variable. + (?J) and (?-J) set and unset the local PCRE2_DUPNAMES option, respec- + tively. + + PCRE2_INFO_JITSIZE + + If the compiled pattern was successfully processed by pcre2_jit_com- + pile(), return the size of the JIT compiled code, otherwise return + zero. The third argument should point to a size_t variable. + + PCRE2_INFO_LASTCODETYPE + + Returns 1 if there is a rightmost literal code unit that must exist in + any matched string, other than at its start. The third argument should + point to a uint32_t variable. If there is no such value, 0 is returned. + When 1 is returned, the code unit value itself can be retrieved using + PCRE2_INFO_LASTCODEUNIT. For anchored patterns, a last literal value is + recorded only if it follows something of variable length. For example, + for the pattern /^a\d+z\d+/ the returned value is 1 (with "z" returned + from PCRE2_INFO_LASTCODEUNIT), but for /^a\dz\d/ the returned value is + 0. + + PCRE2_INFO_LASTCODEUNIT + + Return the value of the rightmost literal code unit that must exist in + any matched string, other than at its start, for a pattern where + PCRE2_INFO_LASTCODETYPE returns 1. Otherwise, return 0. The third argu- + ment should point to a uint32_t variable. + + PCRE2_INFO_MATCHEMPTY + + Return 1 if the pattern might match an empty string, otherwise 0. The + third argument should point to a uint32_t variable. When a pattern con- + tains recursive subroutine calls it is not always possible to determine + whether or not it can match an empty string. PCRE2 takes a cautious ap- + proach and returns 1 in such cases. + + PCRE2_INFO_MATCHLIMIT + + If the pattern set a match limit by including an item of the form + (*LIMIT_MATCH=nnnn) at the start, the value is returned. The third ar- + gument should point to a uint32_t integer. If no such value has been + set, the call to pcre2_pattern_info() returns the error PCRE2_ERROR_UN- + SET. Note that this limit will only be used during matching if it is + less than the limit set or defaulted by the caller of the match func- + tion. + + PCRE2_INFO_MAXLOOKBEHIND + + A lookbehind assertion moves back a certain number of characters (not + code units) when it starts to process each of its branches. This re- + quest returns the largest of these backward moves. The third argument + should point to a uint32_t integer. The simple assertions \b and \B re- + quire a one-character lookbehind and cause PCRE2_INFO_MAXLOOKBEHIND to + return 1 in the absence of anything longer. \A also registers a one- + character lookbehind, though it does not actually inspect the previous + character. + + Note that this information is useful for multi-segment matching only if + the pattern contains no nested lookbehinds. For example, the pattern + (?<=a(?<=ba)c) returns a maximum lookbehind of 2, but when it is + processed, the first lookbehind moves back by two characters, matches + one character, then the nested lookbehind also moves back by two char- + acters. This puts the matching point three characters earlier than it + was at the start. PCRE2_INFO_MAXLOOKBEHIND is really only useful as a + debugging tool. See the pcre2partial documentation for a discussion of + multi-segment matching. + + PCRE2_INFO_MINLENGTH + + If a minimum length for matching subject strings was computed, its + value is returned. Otherwise the returned value is 0. This value is not + computed when PCRE2_NO_START_OPTIMIZE is set. The value is a number of + characters, which in UTF mode may be different from the number of code + units. The third argument should point to a uint32_t variable. The + value is a lower bound to the length of any matching string. There may + not be any strings of that length that do actually match, but every + string that does match is at least that long. + + PCRE2_INFO_NAMECOUNT + PCRE2_INFO_NAMEENTRYSIZE + PCRE2_INFO_NAMETABLE + + PCRE2 supports the use of named as well as numbered capturing parenthe- + ses. The names are just an additional way of identifying the parenthe- + ses, which still acquire numbers. Several convenience functions such as + pcre2_substring_get_byname() are provided for extracting captured sub- + strings by name. It is also possible to extract the data directly, by + first converting the name to a number in order to access the correct + pointers in the output vector (described with pcre2_match() below). To + do the conversion, you need to use the name-to-number map, which is de- + scribed by these three values. + + The map consists of a number of fixed-size entries. PCRE2_INFO_NAME- + COUNT gives the number of entries, and PCRE2_INFO_NAMEENTRYSIZE gives + the size of each entry in code units; both of these return a uint32_t + value. The entry size depends on the length of the longest name. + + PCRE2_INFO_NAMETABLE returns a pointer to the first entry of the table. + This is a PCRE2_SPTR pointer to a block of code units. In the 8-bit li- + brary, the first two bytes of each entry are the number of the captur- + ing parenthesis, most significant byte first. In the 16-bit library, + the pointer points to 16-bit code units, the first of which contains + the parenthesis number. In the 32-bit library, the pointer points to + 32-bit code units, the first of which contains the parenthesis number. + The rest of the entry is the corresponding name, zero terminated. + + The names are in alphabetical order. If (?| is used to create multiple + capture groups with the same number, as described in the section on du- + plicate group numbers in the pcre2pattern page, the groups may be given + the same name, but there is only one entry in the table. Different + names for groups of the same number are not permitted. + + Duplicate names for capture groups with different numbers are permit- + ted, but only if PCRE2_DUPNAMES is set. They appear in the table in the + order in which they were found in the pattern. In the absence of (?| + this is the order of increasing number; when (?| is used this is not + necessarily the case because later capture groups may have lower num- + bers. + + As a simple example of the name/number table, consider the following + pattern after compilation by the 8-bit library (assume PCRE2_EXTENDED + is set, so white space - including newlines - is ignored): + + (? (?(\d\d)?\d\d) - + (?\d\d) - (?\d\d) ) + + There are four named capture groups, so the table has four entries, and + each entry in the table is eight bytes long. The table is as follows, + with non-printing bytes shows in hexadecimal, and undefined bytes shown + as ??: + + 00 01 d a t e 00 ?? + 00 05 d a y 00 ?? ?? + 00 04 m o n t h 00 + 00 02 y e a r 00 ?? + + When writing code to extract data from named capture groups using the + name-to-number map, remember that the length of the entries is likely + to be different for each compiled pattern. + + PCRE2_INFO_NEWLINE + + The output is one of the following uint32_t values: + + PCRE2_NEWLINE_CR Carriage return (CR) + PCRE2_NEWLINE_LF Linefeed (LF) + PCRE2_NEWLINE_CRLF Carriage return, linefeed (CRLF) + PCRE2_NEWLINE_ANY Any Unicode line ending + PCRE2_NEWLINE_ANYCRLF Any of CR, LF, or CRLF + PCRE2_NEWLINE_NUL The NUL character (binary zero) + + This identifies the character sequence that will be recognized as mean- + ing "newline" while matching. + + PCRE2_INFO_SIZE + + Return the size of the compiled pattern in bytes (for all three li- + braries). The third argument should point to a size_t variable. This + value includes the size of the general data block that precedes the + code units of the compiled pattern itself. The value that is used when + pcre2_compile() is getting memory in which to place the compiled pat- + tern may be slightly larger than the value returned by this option, be- + cause there are cases where the code that calculates the size has to + over-estimate. Processing a pattern with the JIT compiler does not al- + ter the value returned by this option. + + +INFORMATION ABOUT A PATTERN'S CALLOUTS + + int pcre2_callout_enumerate(const pcre2_code *code, + int (*callback)(pcre2_callout_enumerate_block *, void *), + void *user_data); + + A script language that supports the use of string arguments in callouts + might like to scan all the callouts in a pattern before running the + match. This can be done by calling pcre2_callout_enumerate(). The first + argument is a pointer to a compiled pattern, the second points to a + callback function, and the third is arbitrary user data. The callback + function is called for every callout in the pattern in the order in + which they appear. Its first argument is a pointer to a callout enumer- + ation block, and its second argument is the user_data value that was + passed to pcre2_callout_enumerate(). The contents of the callout enu- + meration block are described in the pcre2callout documentation, which + also gives further details about callouts. + + +SERIALIZATION AND PRECOMPILING + + It is possible to save compiled patterns on disc or elsewhere, and re- + load them later, subject to a number of restrictions. The host on which + the patterns are reloaded must be running the same version of PCRE2, + with the same code unit width, and must also have the same endianness, + pointer width, and PCRE2_SIZE type. Before compiled patterns can be + saved, they must be converted to a "serialized" form, which in the case + of PCRE2 is really just a bytecode dump. The functions whose names be- + gin with pcre2_serialize_ are used for converting to and from the seri- + alized form. They are described in the pcre2serialize documentation. + Note that PCRE2 serialization does not convert compiled patterns to an + abstract format like Java or .NET serialization. + + +THE MATCH DATA BLOCK + + pcre2_match_data *pcre2_match_data_create(uint32_t ovecsize, + pcre2_general_context *gcontext); + + pcre2_match_data *pcre2_match_data_create_from_pattern( + const pcre2_code *code, pcre2_general_context *gcontext); + + void pcre2_match_data_free(pcre2_match_data *match_data); + + Information about a successful or unsuccessful match is placed in a + match data block, which is an opaque structure that is accessed by + function calls. In particular, the match data block contains a vector + of offsets into the subject string that define the matched parts of the + subject. This is known as the ovector. + + Before calling pcre2_match(), pcre2_dfa_match(), or pcre2_jit_match() + you must create a match data block by calling one of the creation func- + tions above. For pcre2_match_data_create(), the first argument is the + number of pairs of offsets in the ovector. + + When using pcre2_match(), one pair of offsets is required to identify + the string that matched the whole pattern, with an additional pair for + each captured substring. For example, a value of 4 creates enough space + to record the matched portion of the subject plus three captured sub- + strings. + + When using pcre2_dfa_match() there may be multiple matched substrings + of different lengths at the same point in the subject. The ovector + should be made large enough to hold as many as are expected. + + A minimum of at least 1 pair is imposed by pcre2_match_data_create(), + so it is always possible to return the overall matched string in the + case of pcre2_match() or the longest match in the case of + pcre2_dfa_match(). The maximum number of pairs is 65535; if the first + argument of pcre2_match_data_create() is greater than this, 65535 is + used. + + The second argument of pcre2_match_data_create() is a pointer to a gen- + eral context, which can specify custom memory management for obtaining + the memory for the match data block. If you are not using custom memory + management, pass NULL, which causes malloc() to be used. + + For pcre2_match_data_create_from_pattern(), the first argument is a + pointer to a compiled pattern. The ovector is created to be exactly the + right size to hold all the substrings a pattern might capture when + matched using pcre2_match(). You should not use this call when matching + with pcre2_dfa_match(). The second argument is again a pointer to a + general context, but in this case if NULL is passed, the memory is ob- + tained using the same allocator that was used for the compiled pattern + (custom or default). + + A match data block can be used many times, with the same or different + compiled patterns. You can extract information from a match data block + after a match operation has finished, using functions that are de- + scribed in the sections on matched strings and other match data below. + + When a call of pcre2_match() fails, valid data is available in the + match block only when the error is PCRE2_ERROR_NOMATCH, PCRE2_ER- + ROR_PARTIAL, or one of the error codes for an invalid UTF string. Ex- + actly what is available depends on the error, and is detailed below. + + When one of the matching functions is called, pointers to the compiled + pattern and the subject string are set in the match data block so that + they can be referenced by the extraction functions after a successful + match. After running a match, you must not free a compiled pattern or a + subject string until after all operations on the match data block (for + that match) have taken place, unless, in the case of the subject + string, you have used the PCRE2_COPY_MATCHED_SUBJECT option, which is + described in the section entitled "Option bits for pcre2_match()" be- + low. + + When a match data block itself is no longer needed, it should be freed + by calling pcre2_match_data_free(). If this function is called with a + NULL argument, it returns immediately, without doing anything. + + +MEMORY USE FOR MATCH DATA BLOCKS + + PCRE2_SIZE pcre2_get_match_data_size(pcre2_match_data *match_data); + + PCRE2_SIZE pcre2_get_match_data_heapframes_size( + pcre2_match_data *match_data); + + The size of a match data block depends on the size of the ovector that + it contains. The function pcre2_get_match_data_size() returns the size, + in bytes, of the block that is its argument. + + When pcre2_match() runs interpretively (that is, without using JIT), it + makes use of a vector of data frames for remembering backtracking posi- + tions. The size of each individual frame depends on the number of cap- + turing parentheses in the pattern and can be obtained by calling + pcre2_pattern_info() with the PCRE2_INFO_FRAMESIZE option (see the sec- + tion entitled "Information about a compiled pattern" above). + + Heap memory is used for the frames vector; if the initial memory block + turns out to be too small during matching, it is automatically ex- + panded. When pcre2_match() returns, the memory is not freed, but re- + mains attached to the match data block, for use by any subsequent + matches that use the same block. It is automatically freed when the + match data block itself is freed. + + You can find the current size of the frames vector that a match data + block owns by calling pcre2_get_match_data_heapframes_size(). For a + newly created match data block the size will be zero. Some types of + match may require a lot of frames and thus a large vector; applications + that run in environments where memory is constrained can check this and + free the match data block if the heap frames vector has become too big. + + +MATCHING A PATTERN: THE TRADITIONAL FUNCTION + + int pcre2_match(const pcre2_code *code, PCRE2_SPTR subject, + PCRE2_SIZE length, PCRE2_SIZE startoffset, + uint32_t options, pcre2_match_data *match_data, + pcre2_match_context *mcontext); + + The function pcre2_match() is called to match a subject string against + a compiled pattern, which is passed in the code argument. You can call + pcre2_match() with the same code argument as many times as you like, in + order to find multiple matches in the subject string or to match dif- + ferent subject strings with the same pattern. + + This function is the main matching facility of the library, and it op- + erates in a Perl-like manner. For specialist use there is also an al- + ternative matching function, which is described below in the section + about the pcre2_dfa_match() function. + + Here is an example of a simple call to pcre2_match(): + + pcre2_match_data *md = pcre2_match_data_create(4, NULL); + int rc = pcre2_match( + re, /* result of pcre2_compile() */ + "some string", /* the subject string */ + 11, /* the length of the subject string */ + 0, /* start at offset 0 in the subject */ + 0, /* default options */ + md, /* the match data block */ + NULL); /* a match context; NULL means use defaults */ + + If the subject string is zero-terminated, the length can be given as + PCRE2_ZERO_TERMINATED. A match context must be provided if certain less + common matching parameters are to be changed. For details, see the sec- + tion on the match context above. + + The string to be matched by pcre2_match() + + The subject string is passed to pcre2_match() as a pointer in subject, + a length in length, and a starting offset in startoffset. The length + and offset are in code units, not characters. That is, they are in + bytes for the 8-bit library, 16-bit code units for the 16-bit library, + and 32-bit code units for the 32-bit library, whether or not UTF pro- + cessing is enabled. As a special case, if subject is NULL and length is + zero, the subject is assumed to be an empty string. If length is non- + zero, an error occurs if subject is NULL. + + If startoffset is greater than the length of the subject, pcre2_match() + returns PCRE2_ERROR_BADOFFSET. When the starting offset is zero, the + search for a match starts at the beginning of the subject, and this is + by far the most common case. In UTF-8 or UTF-16 mode, the starting off- + set must point to the start of a character, or to the end of the sub- + ject (in UTF-32 mode, one code unit equals one character, so all off- + sets are valid). Like the pattern string, the subject may contain bi- + nary zeros. + + A non-zero starting offset is useful when searching for another match + in the same subject by calling pcre2_match() again after a previous + success. Setting startoffset differs from passing over a shortened + string and setting PCRE2_NOTBOL in the case of a pattern that begins + with any kind of lookbehind. For example, consider the pattern + + \Biss\B + + which finds occurrences of "iss" in the middle of words. (\B matches + only if the current position in the subject is not a word boundary.) + When applied to the string "Mississippi" the first call to + pcre2_match() finds the first occurrence. If pcre2_match() is called + again with just the remainder of the subject, namely "issippi", it does + not match, because \B is always false at the start of the subject, + which is deemed to be a word boundary. However, if pcre2_match() is + passed the entire string again, but with startoffset set to 4, it finds + the second occurrence of "iss" because it is able to look behind the + starting point to discover that it is preceded by a letter. + + Finding all the matches in a subject is tricky when the pattern can + match an empty string. It is possible to emulate Perl's /g behaviour by + first trying the match again at the same offset, with the + PCRE2_NOTEMPTY_ATSTART and PCRE2_ANCHORED options, and then if that + fails, advancing the starting offset and trying an ordinary match + again. There is some code that demonstrates how to do this in the + pcre2demo sample program. In the most general case, you have to check + to see if the newline convention recognizes CRLF as a newline, and if + so, and the current character is CR followed by LF, advance the start- + ing offset by two characters instead of one. + + If a non-zero starting offset is passed when the pattern is anchored, a + single attempt to match at the given offset is made. This can only suc- + ceed if the pattern does not require the match to be at the start of + the subject. In other words, the anchoring must be the result of set- + ting the PCRE2_ANCHORED option or the use of .* with PCRE2_DOTALL, not + by starting the pattern with ^ or \A. + + Option bits for pcre2_match() + + The unused bits of the options argument for pcre2_match() must be zero. + The only bits that may be set are PCRE2_ANCHORED, + PCRE2_COPY_MATCHED_SUBJECT, PCRE2_DISABLE_RECURSELOOP_CHECK, PCRE2_EN- + DANCHORED, PCRE2_NOTBOL, PCRE2_NOTEOL, PCRE2_NOTEMPTY, + PCRE2_NOTEMPTY_ATSTART, PCRE2_NO_JIT, PCRE2_NO_UTF_CHECK, PCRE2_PAR- + TIAL_HARD, and PCRE2_PARTIAL_SOFT. Their action is described below. + + Setting PCRE2_ANCHORED or PCRE2_ENDANCHORED at match time is not sup- + ported by the just-in-time (JIT) compiler. If it is set, JIT matching + is disabled and the interpretive code in pcre2_match() is run. + PCRE2_DISABLE_RECURSELOOP_CHECK is ignored by JIT, but apart from + PCRE2_NO_JIT (obviously), the remaining options are supported for JIT + matching. + + PCRE2_ANCHORED + + The PCRE2_ANCHORED option limits pcre2_match() to matching at the first + matching position. If a pattern was compiled with PCRE2_ANCHORED, or + turned out to be anchored by virtue of its contents, it cannot be made + unachored at matching time. Note that setting the option at match time + disables JIT matching. + + PCRE2_COPY_MATCHED_SUBJECT + + By default, a pointer to the subject is remembered in the match data + block so that, after a successful match, it can be referenced by the + substring extraction functions. This means that the subject's memory + must not be freed until all such operations are complete. For some ap- + plications where the lifetime of the subject string is not guaranteed, + it may be necessary to make a copy of the subject string, but it is + wasteful to do this unless the match is successful. After a successful + match, if PCRE2_COPY_MATCHED_SUBJECT is set, the subject is copied and + the new pointer is remembered in the match data block instead of the + original subject pointer. The memory allocator that was used for the + match block itself is used. The copy is automatically freed when + pcre2_match_data_free() is called to free the match data block. It is + also automatically freed if the match data block is re-used for another + match operation. + + PCRE2_DISABLE_RECURSELOOP_CHECK + + This option is relevant only to pcre2_match() for interpretive match- + ing. It is ignored when JIT is used, and is forbidden for + pcre2_dfa_match(). + + The use of recursion in patterns can lead to infinite loops. In the in- + terpretive matcher these would be eventually caught by the match or + heap limits, but this could take a long time and/or use a lot of memory + if the limits are large. There is therefore a check at the start of + each recursion. If the same group is still active from a previous + call, and the current subject pointer is the same as it was at the + start of that group, and the furthest inspected character of the sub- + ject has not changed, an error is generated. + + There are rare cases of matches that would complete, but nevertheless + trigger this error. This option disables the check. It is provided + mainly for testing when comparing JIT and interpretive behaviour. + + PCRE2_ENDANCHORED + + If the PCRE2_ENDANCHORED option is set, any string that pcre2_match() + matches must be right at the end of the subject string. Note that set- + ting the option at match time disables JIT matching. + + PCRE2_NOTBOL + + This option specifies that first character of the subject string is not + the beginning of a line, so the circumflex metacharacter should not + match before it. Setting this without having set PCRE2_MULTILINE at + compile time causes circumflex never to match. This option affects only + the behaviour of the circumflex metacharacter. It does not affect \A. + + PCRE2_NOTEOL + + This option specifies that the end of the subject string is not the end + of a line, so the dollar metacharacter should not match it nor (except + in multiline mode) a newline immediately before it. Setting this with- + out having set PCRE2_MULTILINE at compile time causes dollar never to + match. This option affects only the behaviour of the dollar metacharac- + ter. It does not affect \Z or \z. + + PCRE2_NOTEMPTY + + An empty string is not considered to be a valid match if this option is + set. If there are alternatives in the pattern, they are tried. If all + the alternatives match the empty string, the entire match fails. For + example, if the pattern + + a?b? + + is applied to a string not beginning with "a" or "b", it matches an + empty string at the start of the subject. With PCRE2_NOTEMPTY set, this + match is not valid, so pcre2_match() searches further into the string + for occurrences of "a" or "b". + + PCRE2_NOTEMPTY_ATSTART + + This is like PCRE2_NOTEMPTY, except that it locks out an empty string + match only at the first matching position, that is, at the start of the + subject plus the starting offset. An empty string match later in the + subject is permitted. If the pattern is anchored, such a match can oc- + cur only if the pattern contains \K. + + PCRE2_NO_JIT + + By default, if a pattern has been successfully processed by + pcre2_jit_compile(), JIT is automatically used when pcre2_match() is + called with options that JIT supports. Setting PCRE2_NO_JIT disables + the use of JIT; it forces matching to be done by the interpreter. + + PCRE2_NO_UTF_CHECK + + When PCRE2_UTF is set at compile time, the validity of the subject as a + UTF string is checked unless PCRE2_NO_UTF_CHECK is passed to + pcre2_match() or PCRE2_MATCH_INVALID_UTF was passed to pcre2_compile(). + The latter special case is discussed in detail in the pcre2unicode doc- + umentation. + + In the default case, if a non-zero starting offset is given, the check + is applied only to that part of the subject that could be inspected + during matching, and there is a check that the starting offset points + to the first code unit of a character or to the end of the subject. If + there are no lookbehind assertions in the pattern, the check starts at + the starting offset. Otherwise, it starts at the length of the longest + lookbehind before the starting offset, or at the start of the subject + if there are not that many characters before the starting offset. Note + that the sequences \b and \B are one-character lookbehinds. + + The check is carried out before any other processing takes place, and a + negative error code is returned if the check fails. There are several + UTF error codes for each code unit width, corresponding to different + problems with the code unit sequence. There are discussions about the + validity of UTF-8 strings, UTF-16 strings, and UTF-32 strings in the + pcre2unicode documentation. + + If you know that your subject is valid, and you want to skip this check + for performance reasons, you can set the PCRE2_NO_UTF_CHECK option when + calling pcre2_match(). You might want to do this for the second and + subsequent calls to pcre2_match() if you are making repeated calls to + find multiple matches in the same subject string. + + Warning: Unless PCRE2_MATCH_INVALID_UTF was set at compile time, when + PCRE2_NO_UTF_CHECK is set at match time the effect of passing an in- + valid string as a subject, or an invalid value of startoffset, is unde- + fined. Your program may crash or loop indefinitely or give wrong re- + sults. + + PCRE2_PARTIAL_HARD + PCRE2_PARTIAL_SOFT + + These options turn on the partial matching feature. A partial match oc- + curs if the end of the subject string is reached successfully, but + there are not enough subject characters to complete the match. In addi- + tion, either at least one character must have been inspected or the + pattern must contain a lookbehind, or the pattern must be one that + could match an empty string. + + If this situation arises when PCRE2_PARTIAL_SOFT (but not PCRE2_PAR- + TIAL_HARD) is set, matching continues by testing any remaining alterna- + tives. Only if no complete match can be found is PCRE2_ERROR_PARTIAL + returned instead of PCRE2_ERROR_NOMATCH. In other words, PCRE2_PAR- + TIAL_SOFT specifies that the caller is prepared to handle a partial + match, but only if no complete match can be found. + + If PCRE2_PARTIAL_HARD is set, it overrides PCRE2_PARTIAL_SOFT. In this + case, if a partial match is found, pcre2_match() immediately returns + PCRE2_ERROR_PARTIAL, without considering any other alternatives. In + other words, when PCRE2_PARTIAL_HARD is set, a partial match is consid- + ered to be more important that an alternative complete match. + + There is a more detailed discussion of partial and multi-segment match- + ing, with examples, in the pcre2partial documentation. + + +NEWLINE HANDLING WHEN MATCHING + + When PCRE2 is built, a default newline convention is set; this is usu- + ally the standard convention for the operating system. The default can + be overridden in a compile context by calling pcre2_set_newline(). It + can also be overridden by starting a pattern string with, for example, + (*CRLF), as described in the section on newline conventions in the + pcre2pattern page. During matching, the newline choice affects the be- + haviour of the dot, circumflex, and dollar metacharacters. It may also + alter the way the match starting position is advanced after a match + failure for an unanchored pattern. + + When PCRE2_NEWLINE_CRLF, PCRE2_NEWLINE_ANYCRLF, or PCRE2_NEWLINE_ANY is + set as the newline convention, and a match attempt for an unanchored + pattern fails when the current starting position is at a CRLF sequence, + and the pattern contains no explicit matches for CR or LF characters, + the match position is advanced by two characters instead of one, in + other words, to after the CRLF. + + The above rule is a compromise that makes the most common cases work as + expected. For example, if the pattern is .+A (and the PCRE2_DOTALL op- + tion is not set), it does not match the string "\r\nA" because, after + failing at the start, it skips both the CR and the LF before retrying. + However, the pattern [\r\n]A does match that string, because it con- + tains an explicit CR or LF reference, and so advances only by one char- + acter after the first failure. + + An explicit match for CR of LF is either a literal appearance of one of + those characters in the pattern, or one of the \r or \n or equivalent + octal or hexadecimal escape sequences. Implicit matches such as [^X] do + not count, nor does \s, even though it includes CR and LF in the char- + acters that it matches. + + Notwithstanding the above, anomalous effects may still occur when CRLF + is a valid newline sequence and explicit \r or \n escapes appear in the + pattern. + + +HOW PCRE2_MATCH() RETURNS A STRING AND CAPTURED SUBSTRINGS + + uint32_t pcre2_get_ovector_count(pcre2_match_data *match_data); + + PCRE2_SIZE *pcre2_get_ovector_pointer(pcre2_match_data *match_data); + + In general, a pattern matches a certain portion of the subject, and in + addition, further substrings from the subject may be picked out by + parenthesized parts of the pattern. Following the usage in Jeffrey + Friedl's book, this is called "capturing" in what follows, and the + phrase "capture group" (Perl terminology) is used for a fragment of a + pattern that picks out a substring. PCRE2 supports several other kinds + of parenthesized group that do not cause substrings to be captured. The + pcre2_pattern_info() function can be used to find out how many capture + groups there are in a compiled pattern. + + You can use auxiliary functions for accessing captured substrings by + number or by name, as described in sections below. + + Alternatively, you can make direct use of the vector of PCRE2_SIZE val- + ues, called the ovector, which contains the offsets of captured + strings. It is part of the match data block. The function + pcre2_get_ovector_pointer() returns the address of the ovector, and + pcre2_get_ovector_count() returns the number of pairs of values it con- + tains. + + Within the ovector, the first in each pair of values is set to the off- + set of the first code unit of a substring, and the second is set to the + offset of the first code unit after the end of a substring. These val- + ues are always code unit offsets, not character offsets. That is, they + are byte offsets in the 8-bit library, 16-bit offsets in the 16-bit li- + brary, and 32-bit offsets in the 32-bit library. + + After a partial match (error return PCRE2_ERROR_PARTIAL), only the + first pair of offsets (that is, ovector[0] and ovector[1]) are set. + They identify the part of the subject that was partially matched. See + the pcre2partial documentation for details of partial matching. + + After a fully successful match, the first pair of offsets identifies + the portion of the subject string that was matched by the entire pat- + tern. The next pair is used for the first captured substring, and so + on. The value returned by pcre2_match() is one more than the highest + numbered pair that has been set. For example, if two substrings have + been captured, the returned value is 3. If there are no captured sub- + strings, the return value from a successful match is 1, indicating that + just the first pair of offsets has been set. + + If a pattern uses the \K escape sequence within a positive assertion, + the reported start of a successful match can be greater than the end of + the match. For example, if the pattern (?=ab\K) is matched against + "ab", the start and end offset values for the match are 2 and 0. + + If a capture group is matched repeatedly within a single match opera- + tion, it is the last portion of the subject that it matched that is re- + turned. + + If the ovector is too small to hold all the captured substring offsets, + as much as possible is filled in, and the function returns a value of + zero. If captured substrings are not of interest, pcre2_match() may be + called with a match data block whose ovector is of minimum length (that + is, one pair). + + It is possible for capture group number n+1 to match some part of the + subject when group n has not been used at all. For example, if the + string "abc" is matched against the pattern (a|(z))(bc) the return from + the function is 4, and groups 1 and 3 are matched, but 2 is not. When + this happens, both values in the offset pairs corresponding to unused + groups are set to PCRE2_UNSET. + + Offset values that correspond to unused groups at the end of the ex- + pression are also set to PCRE2_UNSET. For example, if the string "abc" + is matched against the pattern (abc)(x(yz)?)? groups 2 and 3 are not + matched. The return from the function is 2, because the highest used + capture group number is 1. The offsets for the second and third capture + groups (assuming the vector is large enough, of course) are set to + PCRE2_UNSET. + + Elements in the ovector that do not correspond to capturing parentheses + in the pattern are never changed. That is, if a pattern contains n cap- + turing parentheses, no more than ovector[0] to ovector[2n+1] are set by + pcre2_match(). The other elements retain whatever values they previ- + ously had. After a failed match attempt, the contents of the ovector + are unchanged. + + +OTHER INFORMATION ABOUT A MATCH + + PCRE2_SPTR pcre2_get_mark(pcre2_match_data *match_data); + + PCRE2_SIZE pcre2_get_startchar(pcre2_match_data *match_data); + + As well as the offsets in the ovector, other information about a match + is retained in the match data block and can be retrieved by the above + functions in appropriate circumstances. If they are called at other + times, the result is undefined. + + After a successful match, a partial match (PCRE2_ERROR_PARTIAL), or a + failure to match (PCRE2_ERROR_NOMATCH), a mark name may be available. + The function pcre2_get_mark() can be called to access this name, which + can be specified in the pattern by any of the backtracking control + verbs, not just (*MARK). The same function applies to all the verbs. It + returns a pointer to the zero-terminated name, which is within the com- + piled pattern. If no name is available, NULL is returned. The length of + the name (excluding the terminating zero) is stored in the code unit + that precedes the name. You should use this length instead of relying + on the terminating zero if the name might contain a binary zero. + + After a successful match, the name that is returned is the last mark + name encountered on the matching path through the pattern. Instances of + backtracking verbs without names do not count. Thus, for example, if + the matching path contains (*MARK:A)(*PRUNE), the name "A" is returned. + After a "no match" or a partial match, the last encountered name is re- + turned. For example, consider this pattern: + + ^(*MARK:A)((*MARK:B)a|b)c + + When it matches "bc", the returned name is A. The B mark is "seen" in + the first branch of the group, but it is not on the matching path. On + the other hand, when this pattern fails to match "bx", the returned + name is B. + + Warning: By default, certain start-of-match optimizations are used to + give a fast "no match" result in some situations. For example, if the + anchoring is removed from the pattern above, there is an initial check + for the presence of "c" in the subject before running the matching en- + gine. This check fails for "bx", causing a match failure without seeing + any marks. You can disable the start-of-match optimizations by setting + the PCRE2_NO_START_OPTIMIZE option for pcre2_compile() or by starting + the pattern with (*NO_START_OPT). + + After a successful match, a partial match, or one of the invalid UTF + errors (for example, PCRE2_ERROR_UTF8_ERR5), pcre2_get_startchar() can + be called. After a successful or partial match it returns the code unit + offset of the character at which the match started. For a non-partial + match, this can be different to the value of ovector[0] if the pattern + contains the \K escape sequence. After a partial match, however, this + value is always the same as ovector[0] because \K does not affect the + result of a partial match. + + After a UTF check failure, pcre2_get_startchar() can be used to obtain + the code unit offset of the invalid UTF character. Details are given in + the pcre2unicode page. + + +ERROR RETURNS FROM pcre2_match() + + If pcre2_match() fails, it returns a negative number. This can be con- + verted to a text string by calling the pcre2_get_error_message() func- + tion (see "Obtaining a textual error message" below). Negative error + codes are also returned by other functions, and are documented with + them. The codes are given names in the header file. If UTF checking is + in force and an invalid UTF subject string is detected, one of a number + of UTF-specific negative error codes is returned. Details are given in + the pcre2unicode page. The following are the other errors that may be + returned by pcre2_match(): + + PCRE2_ERROR_NOMATCH + + The subject string did not match the pattern. + + PCRE2_ERROR_PARTIAL + + The subject string did not match, but it did match partially. See the + pcre2partial documentation for details of partial matching. + + PCRE2_ERROR_BADMAGIC + + PCRE2 stores a 4-byte "magic number" at the start of the compiled code, + to catch the case when it is passed a junk pointer. This is the error + that is returned when the magic number is not present. + + PCRE2_ERROR_BADMODE + + This error is given when a compiled pattern is passed to a function in + a library of a different code unit width, for example, a pattern com- + piled by the 8-bit library is passed to a 16-bit or 32-bit library + function. + + PCRE2_ERROR_BADOFFSET + + The value of startoffset was greater than the length of the subject. + + PCRE2_ERROR_BADOPTION + + An unrecognized bit was set in the options argument. + + PCRE2_ERROR_BADUTFOFFSET + + The UTF code unit sequence that was passed as a subject was checked and + found to be valid (the PCRE2_NO_UTF_CHECK option was not set), but the + value of startoffset did not point to the beginning of a UTF character + or the end of the subject. + + PCRE2_ERROR_CALLOUT + + This error is never generated by pcre2_match() itself. It is provided + for use by callout functions that want to cause pcre2_match() or + pcre2_callout_enumerate() to return a distinctive error code. See the + pcre2callout documentation for details. + + PCRE2_ERROR_DEPTHLIMIT + + The nested backtracking depth limit was reached. + + PCRE2_ERROR_HEAPLIMIT + + The heap limit was reached. + + PCRE2_ERROR_INTERNAL + + An unexpected internal error has occurred. This error could be caused + by a bug in PCRE2 or by overwriting of the compiled pattern. + + PCRE2_ERROR_JIT_STACKLIMIT + + This error is returned when a pattern that was successfully studied us- + ing JIT is being matched, but the memory available for the just-in-time + processing stack is not large enough. See the pcre2jit documentation + for more details. + + PCRE2_ERROR_MATCHLIMIT + + The backtracking match limit was reached. + + PCRE2_ERROR_NOMEMORY + + Heap memory is used to remember backtracking points. This error is + given when the memory allocation function (default or custom) fails. + Note that a different error, PCRE2_ERROR_HEAPLIMIT, is given if the + amount of memory needed exceeds the heap limit. PCRE2_ERROR_NOMEMORY is + also returned if PCRE2_COPY_MATCHED_SUBJECT is set and memory alloca- + tion fails. + + PCRE2_ERROR_NULL + + Either the code, subject, or match_data argument was passed as NULL. + + PCRE2_ERROR_RECURSELOOP + + This error is returned when pcre2_match() detects a recursion loop + within the pattern. Specifically, it means that either the whole pat- + tern or a capture group has been called recursively for the second time + at the same position in the subject string. Some simple patterns that + might do this are detected and faulted at compile time, but more com- + plicated cases, in particular mutual recursions between two different + groups, cannot be detected until matching is attempted. + + +OBTAINING A TEXTUAL ERROR MESSAGE + + int pcre2_get_error_message(int errorcode, PCRE2_UCHAR *buffer, + PCRE2_SIZE bufflen); + + A text message for an error code from any PCRE2 function (compile, + match, or auxiliary) can be obtained by calling pcre2_get_error_mes- + sage(). The code is passed as the first argument, with the remaining + two arguments specifying a code unit buffer and its length in code + units, into which the text message is placed. The message is returned + in code units of the appropriate width for the library that is being + used. + + The returned message is terminated with a trailing zero, and the func- + tion returns the number of code units used, excluding the trailing + zero. If the error number is unknown, the negative error code PCRE2_ER- + ROR_BADDATA is returned. If the buffer is too small, the message is + truncated (but still with a trailing zero), and the negative error code + PCRE2_ERROR_NOMEMORY is returned. None of the messages are very long; + a buffer size of 120 code units is ample. + + +EXTRACTING CAPTURED SUBSTRINGS BY NUMBER + + int pcre2_substring_length_bynumber(pcre2_match_data *match_data, + uint32_t number, PCRE2_SIZE *length); + + int pcre2_substring_copy_bynumber(pcre2_match_data *match_data, + uint32_t number, PCRE2_UCHAR *buffer, + PCRE2_SIZE *bufflen); + + int pcre2_substring_get_bynumber(pcre2_match_data *match_data, + uint32_t number, PCRE2_UCHAR **bufferptr, + PCRE2_SIZE *bufflen); + + void pcre2_substring_free(PCRE2_UCHAR *buffer); + + Captured substrings can be accessed directly by using the ovector as + described above. For convenience, auxiliary functions are provided for + extracting captured substrings as new, separate, zero-terminated + strings. A substring that contains a binary zero is correctly extracted + and has a further zero added on the end, but the result is not, of + course, a C string. + + The functions in this section identify substrings by number. The number + zero refers to the entire matched substring, with higher numbers refer- + ring to substrings captured by parenthesized groups. After a partial + match, only substring zero is available. An attempt to extract any + other substring gives the error PCRE2_ERROR_PARTIAL. The next section + describes similar functions for extracting captured substrings by name. + + If a pattern uses the \K escape sequence within a positive assertion, + the reported start of a successful match can be greater than the end of + the match. For example, if the pattern (?=ab\K) is matched against + "ab", the start and end offset values for the match are 2 and 0. In + this situation, calling these functions with a zero substring number + extracts a zero-length empty string. + + You can find the length in code units of a captured substring without + extracting it by calling pcre2_substring_length_bynumber(). The first + argument is a pointer to the match data block, the second is the group + number, and the third is a pointer to a variable into which the length + is placed. If you just want to know whether or not the substring has + been captured, you can pass the third argument as NULL. + + The pcre2_substring_copy_bynumber() function copies a captured sub- + string into a supplied buffer, whereas pcre2_substring_get_bynumber() + copies it into new memory, obtained using the same memory allocation + function that was used for the match data block. The first two argu- + ments of these functions are a pointer to the match data block and a + capture group number. + + The final arguments of pcre2_substring_copy_bynumber() are a pointer to + the buffer and a pointer to a variable that contains its length in code + units. This is updated to contain the actual number of code units used + for the extracted substring, excluding the terminating zero. + + For pcre2_substring_get_bynumber() the third and fourth arguments point + to variables that are updated with a pointer to the new memory and the + number of code units that comprise the substring, again excluding the + terminating zero. When the substring is no longer needed, the memory + should be freed by calling pcre2_substring_free(). + + The return value from all these functions is zero for success, or a + negative error code. If the pattern match failed, the match failure + code is returned. If a substring number greater than zero is used af- + ter a partial match, PCRE2_ERROR_PARTIAL is returned. Other possible + error codes are: + + PCRE2_ERROR_NOMEMORY + + The buffer was too small for pcre2_substring_copy_bynumber(), or the + attempt to get memory failed for pcre2_substring_get_bynumber(). + + PCRE2_ERROR_NOSUBSTRING + + There is no substring with that number in the pattern, that is, the + number is greater than the number of capturing parentheses. + + PCRE2_ERROR_UNAVAILABLE + + The substring number, though not greater than the number of captures in + the pattern, is greater than the number of slots in the ovector, so the + substring could not be captured. + + PCRE2_ERROR_UNSET + + The substring did not participate in the match. For example, if the + pattern is (abc)|(def) and the subject is "def", and the ovector con- + tains at least two capturing slots, substring number 1 is unset. + + +EXTRACTING A LIST OF ALL CAPTURED SUBSTRINGS + + int pcre2_substring_list_get(pcre2_match_data *match_data, + PCRE2_UCHAR ***listptr, PCRE2_SIZE **lengthsptr); + + void pcre2_substring_list_free(PCRE2_UCHAR **list); + + The pcre2_substring_list_get() function extracts all available sub- + strings and builds a list of pointers to them. It also (optionally) + builds a second list that contains their lengths (in code units), ex- + cluding a terminating zero that is added to each of them. All this is + done in a single block of memory that is obtained using the same memory + allocation function that was used to get the match data block. + + This function must be called only after a successful match. If called + after a partial match, the error code PCRE2_ERROR_PARTIAL is returned. + + The address of the memory block is returned via listptr, which is also + the start of the list of string pointers. The end of the list is marked + by a NULL pointer. The address of the list of lengths is returned via + lengthsptr. If your strings do not contain binary zeros and you do not + therefore need the lengths, you may supply NULL as the lengthsptr argu- + ment to disable the creation of a list of lengths. The yield of the + function is zero if all went well, or PCRE2_ERROR_NOMEMORY if the mem- + ory block could not be obtained. When the list is no longer needed, it + should be freed by calling pcre2_substring_list_free(). + + If this function encounters a substring that is unset, which can happen + when capture group number n+1 matches some part of the subject, but + group n has not been used at all, it returns an empty string. This can + be distinguished from a genuine zero-length substring by inspecting the + appropriate offset in the ovector, which contain PCRE2_UNSET for unset + substrings, or by calling pcre2_substring_length_bynumber(). + + +EXTRACTING CAPTURED SUBSTRINGS BY NAME + + int pcre2_substring_number_from_name(const pcre2_code *code, + PCRE2_SPTR name); + + int pcre2_substring_length_byname(pcre2_match_data *match_data, + PCRE2_SPTR name, PCRE2_SIZE *length); + + int pcre2_substring_copy_byname(pcre2_match_data *match_data, + PCRE2_SPTR name, PCRE2_UCHAR *buffer, PCRE2_SIZE *bufflen); + + int pcre2_substring_get_byname(pcre2_match_data *match_data, + PCRE2_SPTR name, PCRE2_UCHAR **bufferptr, PCRE2_SIZE *bufflen); + + void pcre2_substring_free(PCRE2_UCHAR *buffer); + + To extract a substring by name, you first have to find associated num- + ber. For example, for this pattern: + + (a+)b(?\d+)... + + the number of the capture group called "xxx" is 2. If the name is known + to be unique (PCRE2_DUPNAMES was not set), you can find the number from + the name by calling pcre2_substring_number_from_name(). The first argu- + ment is the compiled pattern, and the second is the name. The yield of + the function is the group number, PCRE2_ERROR_NOSUBSTRING if there is + no group with that name, or PCRE2_ERROR_NOUNIQUESUBSTRING if there is + more than one group with that name. Given the number, you can extract + the substring directly from the ovector, or use one of the "bynumber" + functions described above. + + For convenience, there are also "byname" functions that correspond to + the "bynumber" functions, the only difference being that the second ar- + gument is a name instead of a number. If PCRE2_DUPNAMES is set and + there are duplicate names, these functions scan all the groups with the + given name, and return the captured substring from the first named + group that is set. + + If there are no groups with the given name, PCRE2_ERROR_NOSUBSTRING is + returned. If all groups with the name have numbers that are greater + than the number of slots in the ovector, PCRE2_ERROR_UNAVAILABLE is re- + turned. If there is at least one group with a slot in the ovector, but + no group is found to be set, PCRE2_ERROR_UNSET is returned. + + Warning: If the pattern uses the (?| feature to set up multiple capture + groups with the same number, as described in the section on duplicate + group numbers in the pcre2pattern page, you cannot use names to distin- + guish the different capture groups, because names are not included in + the compiled code. The matching process uses only numbers. For this + reason, the use of different names for groups with the same number + causes an error at compile time. + + +CREATING A NEW STRING WITH SUBSTITUTIONS + + int pcre2_substitute(const pcre2_code *code, PCRE2_SPTR subject, + PCRE2_SIZE length, PCRE2_SIZE startoffset, + uint32_t options, pcre2_match_data *match_data, + pcre2_match_context *mcontext, PCRE2_SPTR replacement, + PCRE2_SIZE rlength, PCRE2_UCHAR *outputbuffer, + PCRE2_SIZE *outlengthptr); + + This function optionally calls pcre2_match() and then makes a copy of + the subject string in outputbuffer, replacing parts that were matched + with the replacement string, whose length is supplied in rlength, which + can be given as PCRE2_ZERO_TERMINATED for a zero-terminated string. As + a special case, if replacement is NULL and rlength is zero, the re- + placement is assumed to be an empty string. If rlength is non-zero, an + error occurs if replacement is NULL. + + There is an option (see PCRE2_SUBSTITUTE_REPLACEMENT_ONLY below) to re- + turn just the replacement string(s). The default action is to perform + just one replacement if the pattern matches, but there is an option + that requests multiple replacements (see PCRE2_SUBSTITUTE_GLOBAL be- + low). + + If successful, pcre2_substitute() returns the number of substitutions + that were carried out. This may be zero if no match was found, and is + never greater than one unless PCRE2_SUBSTITUTE_GLOBAL is set. A nega- + tive value is returned if an error is detected. + + Matches in which a \K item in a lookahead in the pattern causes the + match to end before it starts are not supported, and give rise to an + error return. For global replacements, matches in which \K in a lookbe- + hind causes the match to start earlier than the point that was reached + in the previous iteration are also not supported. + + The first seven arguments of pcre2_substitute() are the same as for + pcre2_match(), except that the partial matching options are not permit- + ted, and match_data may be passed as NULL, in which case a match data + block is obtained and freed within this function, using memory manage- + ment functions from the match context, if provided, or else those that + were used to allocate memory for the compiled code. + + If match_data is not NULL and PCRE2_SUBSTITUTE_MATCHED is not set, the + provided block is used for all calls to pcre2_match(), and its contents + afterwards are the result of the final call. For global changes, this + will always be a no-match error. The contents of the ovector within the + match data block may or may not have been changed. + + As well as the usual options for pcre2_match(), a number of additional + options can be set in the options argument of pcre2_substitute(). One + such option is PCRE2_SUBSTITUTE_MATCHED. When this is set, an external + match_data block must be provided, and it must have already been used + for an external call to pcre2_match() with the same pattern and subject + arguments. The data in the match_data block (return code, offset vec- + tor) is then used for the first substitution instead of calling + pcre2_match() from within pcre2_substitute(). This allows an applica- + tion to check for a match before choosing to substitute, without having + to repeat the match. + + The contents of the externally supplied match data block are not + changed when PCRE2_SUBSTITUTE_MATCHED is set. If PCRE2_SUBSTI- + TUTE_GLOBAL is also set, pcre2_match() is called after the first sub- + stitution to check for further matches, but this is done using an in- + ternally obtained match data block, thus always leaving the external + block unchanged. + + The code argument is not used for matching before the first substitu- + tion when PCRE2_SUBSTITUTE_MATCHED is set, but it must be provided, + even when PCRE2_SUBSTITUTE_GLOBAL is not set, because it contains in- + formation such as the UTF setting and the number of capturing parenthe- + ses in the pattern. + + The default action of pcre2_substitute() is to return a copy of the + subject string with matched substrings replaced. However, if PCRE2_SUB- + STITUTE_REPLACEMENT_ONLY is set, only the replacement substrings are + returned. In the global case, multiple replacements are concatenated in + the output buffer. Substitution callouts (see below) can be used to + separate them if necessary. + + The outlengthptr argument of pcre2_substitute() must point to a vari- + able that contains the length, in code units, of the output buffer. If + the function is successful, the value is updated to contain the length + in code units of the new string, excluding the trailing zero that is + automatically added. + + If the function is not successful, the value set via outlengthptr de- + pends on the type of error. For syntax errors in the replacement + string, the value is the offset in the replacement string where the er- + ror was detected. For other errors, the value is PCRE2_UNSET by de- + fault. This includes the case of the output buffer being too small, un- + less PCRE2_SUBSTITUTE_OVERFLOW_LENGTH is set. + + PCRE2_SUBSTITUTE_OVERFLOW_LENGTH changes what happens when the output + buffer is too small. The default action is to return PCRE2_ERROR_NOMEM- + ORY immediately. If this option is set, however, pcre2_substitute() + continues to go through the motions of matching and substituting (with- + out, of course, writing anything) in order to compute the size of + buffer that is needed, which will include the extra space for the ter- + minating NUL. This value is passed back via the outlengthptr variable, + with the result of the function still being PCRE2_ERROR_NOMEMORY. + + Passing a buffer size of zero is a permitted way of finding out how + much memory is needed for given substitution. However, this does mean + that the entire operation is carried out twice. Depending on the appli- + cation, it may be more efficient to allocate a large buffer and free + the excess afterwards, instead of using PCRE2_SUBSTITUTE_OVER- + FLOW_LENGTH. + + The replacement string, which is interpreted as a UTF string in UTF + mode, is checked for UTF validity unless PCRE2_NO_UTF_CHECK is set. An + invalid UTF replacement string causes an immediate return with the rel- + evant UTF error code. + + If PCRE2_SUBSTITUTE_LITERAL is set, the replacement string is not in- + terpreted in any way. By default, however, a dollar character is an es- + cape character that can specify the insertion of characters from cap- + ture groups and names from (*MARK) or other control verbs in the pat- + tern. Dollar is the only escape character (backslash is treated as lit- + eral). The following forms are recognized: + + $$ insert a dollar character + $n or ${n} insert the contents of group n + $0 or $& insert the entire matched substring + $` insert the substring that precedes the match + $' insert the substring that follows the match + $_ insert the entire input string + $*MARK or ${*MARK} insert a control verb name + + Either a group number or a group name can be given for n, for example + $2 or $NAME. Curly brackets are required only if the following charac- + ter would be interpreted as part of the number or name. The number may + be zero to include the entire matched string. For example, if the pat- + tern a(b)c is matched with "=abc=" and the replacement string + "+$1$0$1+", the result is "=+babcb+=". + + The JavaScript form $, where the angle brackets are part of the + syntax, is also recognized for group names, but not for group numbers + or *MARK. + + $*MARK inserts the name from the last encountered backtracking control + verb on the matching path that has a name. (*MARK) must always include + a name, but the other verbs need not. For example, in the case of + (*MARK:A)(*PRUNE) the name inserted is "A", but for (*MARK:A)(*PRUNE:B) + the relevant name is "B". This facility can be used to perform simple + simultaneous substitutions, as this pcre2test example shows: + + /(*MARK:pear)apple|(*MARK:orange)lemon/g,replace=${*MARK} + apple lemon + 2: pear orange + + PCRE2_SUBSTITUTE_GLOBAL causes the function to iterate over the subject + string, replacing every matching substring. If this option is not set, + only the first matching substring is replaced. The search for matches + takes place in the original subject string (that is, previous replace- + ments do not affect it). Iteration is implemented by advancing the + startoffset value for each search, which is always passed the entire + subject string. If an offset limit is set in the match context, search- + ing stops when that limit is reached. + + You can restrict the effect of a global substitution to a portion of + the subject string by setting either or both of startoffset and an off- + set limit. Here is a pcre2test example: + + /B/g,replace=!,use_offset_limit + ABC ABC ABC ABC\=offset=3,offset_limit=12 + 2: ABC A!C A!C ABC + + When continuing with global substitutions after matching a substring + with zero length, an attempt to find a non-empty match at the same off- + set is performed. If this is not successful, the offset is advanced by + one character except when CRLF is a valid newline sequence and the next + two characters are CR, LF. In this case, the offset is advanced by two + characters. + + PCRE2_SUBSTITUTE_UNKNOWN_UNSET causes references to capture groups that + do not appear in the pattern to be treated as unset groups. This option + should be used with care, because it means that a typo in a group name + or number no longer causes the PCRE2_ERROR_NOSUBSTRING error. + + PCRE2_SUBSTITUTE_UNSET_EMPTY causes unset capture groups (including un- + known groups when PCRE2_SUBSTITUTE_UNKNOWN_UNSET is set) to be treated + as empty strings when inserted as described above. If this option is + not set, an attempt to insert an unset group causes the PCRE2_ERROR_UN- + SET error. This option does not influence the extended substitution + syntax described below. + + PCRE2_SUBSTITUTE_EXTENDED causes extra processing to be applied to the + replacement string. Without this option, only the dollar character is + special, and only the group insertion forms listed above are valid. + When PCRE2_SUBSTITUTE_EXTENDED is set, several things change: + + Firstly, backslash in a replacement string is interpreted as an escape + character. The usual forms such as \x{ddd} can be used to specify par- + ticular character codes, and backslash followed by any non-alphanumeric + character quotes that character. Extended quoting can be coded using + \Q...\E, exactly as in pattern strings. The escapes \b and \v are in- + terpreted as the characters backspace and vertical tab, respectively. + + The interpretation of backslash followed by one or more digits is the + same as in a pattern, which in Perl has some ambiguities. Details are + given in the pcre2pattern page. + + The Python form \g, where the angle brackets are part of the syntax + and n is either a group name or number, is recognized as an altertive + way of inserting the contents of a group, for example \g<3>. + + There are also four escape sequences for forcing the case of inserted + letters. Case forcing applies to all inserted characters, including + those from capture groups and letters within \Q...\E quoted sequences. + The insertion mechanism has three states: no case forcing, force upper + case, and force lower case. The escape sequences change the current + state: \U and \L change to upper or lower case forcing, respectively, + and \E (when not terminating a \Q quoted sequence) reverts to no case + forcing. The sequences \u and \l force the next character (if it is a + letter) to upper or lower case, respectively, and then the state auto- + matically reverts to no case forcing. + + However, if \u is immediately followed by \L or \l is immediately fol- + lowed by \U, the next character's case is forced by the first escape + sequence, and subsequent characters by the second. This provides a "ti- + tle casing" facility that can be applied to group captures. For exam- + ple, if group 1 has captured "heLLo", the replacement string "\u\L$1" + becomes "Hello". + + If either PCRE2_UTF or PCRE2_UCP was set when the pattern was compiled, + Unicode properties are used for case forcing characters whose code + points are greater than 127. However, only simple case folding, as de- + termined by the Unicode file CaseFolding.txt is supported. PCRE2 does + not support language-specific special casing rules such as using dif- + ferent lower case Greek sigmas in the middle and ends of words (as de- + fined in the Unicode file SpecialCasing.txt). + + Note that case forcing sequences such as \U...\E do not nest. For exam- + ple, the result of processing "\Uaa\LBB\Ecc\E" is "AAbbcc"; the final + \E has no effect. Note also that the PCRE2_ALT_BSUX and PCRE2_EX- + TRA_ALT_BSUX options do not apply to replacement strings. + + The final effect of setting PCRE2_SUBSTITUTE_EXTENDED is to add more + flexibility to capture group substitution. The syntax is similar to + that used by Bash: + + ${n:-string} + ${n:+string1:string2} + + As in the simple case, n may be a group number or a name. The first + form specifies a default value. If group n is set, its value is in- + serted; if not, the string is expanded and the result inserted. The + second form specifies strings that are expanded and inserted when group + n is set or unset, respectively. The first form is just a convenient + shorthand for + + ${n:+${n}:string} + + Backslash can be used to escape colons and closing curly brackets in + the replacement strings. A change of the case forcing state within a + replacement string remains in force afterwards, as shown in this + pcre2test example: + + /(some)?(body)/substitute_extended,replace=${1:+\U:\L}HeLLo + body + 1: hello + somebody + 1: HELLO + + The PCRE2_SUBSTITUTE_UNSET_EMPTY option does not affect these extended + substitutions. However, PCRE2_SUBSTITUTE_UNKNOWN_UNSET does cause un- + known groups in the extended syntax forms to be treated as unset. + + If PCRE2_SUBSTITUTE_LITERAL is set, PCRE2_SUBSTITUTE_UNKNOWN_UNSET, + PCRE2_SUBSTITUTE_UNSET_EMPTY, and PCRE2_SUBSTITUTE_EXTENDED are irrele- + vant and are ignored. + + Substitution errors + + In the event of an error, pcre2_substitute() returns a negative error + code. Except for PCRE2_ERROR_NOMATCH (which is never returned), errors + from pcre2_match() are passed straight back. + + PCRE2_ERROR_NOSUBSTRING is returned for a non-existent substring inser- + tion, unless PCRE2_SUBSTITUTE_UNKNOWN_UNSET is set. + + PCRE2_ERROR_UNSET is returned for an unset substring insertion (includ- + ing an unknown substring when PCRE2_SUBSTITUTE_UNKNOWN_UNSET is set) + when the simple (non-extended) syntax is used and PCRE2_SUBSTITUTE_UN- + SET_EMPTY is not set. + + PCRE2_ERROR_NOMEMORY is returned if the output buffer is not big + enough. If the PCRE2_SUBSTITUTE_OVERFLOW_LENGTH option is set, the size + of buffer that is needed is returned via outlengthptr. Note that this + does not happen by default. + + PCRE2_ERROR_NULL is returned if PCRE2_SUBSTITUTE_MATCHED is set but the + match_data argument is NULL or if the subject or replacement arguments + are NULL. For backward compatibility reasons an exception is made for + the replacement argument if the rlength argument is also 0. + + PCRE2_ERROR_BADREPLACEMENT is used for miscellaneous syntax errors in + the replacement string, with more particular errors being PCRE2_ER- + ROR_BADREPESCAPE (invalid escape sequence), PCRE2_ERROR_REPMISSINGBRACE + (closing curly bracket not found), PCRE2_ERROR_BADSUBSTITUTION (syntax + error in extended group substitution), and PCRE2_ERROR_BADSUBSPATTERN + (the pattern match ended before it started or the match started earlier + than the current position in the subject, which can happen if \K is + used in an assertion). + + As for all PCRE2 errors, a text message that describes the error can be + obtained by calling the pcre2_get_error_message() function (see "Ob- + taining a textual error message" above). + + Substitution callouts + + int pcre2_set_substitute_callout(pcre2_match_context *mcontext, + int (*callout_function)(pcre2_substitute_callout_block *, void *), + void *callout_data); + + The pcre2_set_substitution_callout() function can be used to specify a + callout function for pcre2_substitute(). This information is passed in + a match context. The callout function is called after each substitution + has been processed, but it can cause the replacement not to happen. + + The callout function is not called for simulated substitutions that + happen as a result of the PCRE2_SUBSTITUTE_OVERFLOW_LENGTH option. In + this mode, when substitution processing exceeds the buffer space pro- + vided by the caller, processing continues by counting code units. The + simulation is unable to populate the callout block, and so the simula- + tion is pessimistic about the required buffer size. Whichever is larger + of accepted or rejected substitution is reported as the required size. + Therefore, the returned buffer length may be an overestimate (without a + substitution callout, it is normally an exact measurement). + + The first argument of the callout function is a pointer to a substitute + callout block structure, which contains the following fields, not nec- + essarily in this order: + + uint32_t version; + uint32_t subscount; + PCRE2_SPTR input; + PCRE2_SPTR output; + PCRE2_SIZE *ovector; + uint32_t oveccount; + PCRE2_SIZE output_offsets[2]; + + The version field contains the version number of the block format. The + current version is 0. The version number will increase in future if + more fields are added, but the intention is never to remove any of the + existing fields. + + The subscount field is the number of the current match. It is 1 for the + first callout, 2 for the second, and so on. The input and output point- + ers are copies of the values passed to pcre2_substitute(). + + The ovector field points to the ovector, which contains the result of + the most recent match. The oveccount field contains the number of pairs + that are set in the ovector, and is always greater than zero. + + The output_offsets vector contains the offsets of the replacement in + the output string. This has already been processed for dollar and (if + requested) backslash substitutions as described above. + + The second argument of the callout function is the value passed as + callout_data when the function was registered. The value returned by + the callout function is interpreted as follows: + + If the value is zero, the replacement is accepted, and, if PCRE2_SUB- + STITUTE_GLOBAL is set, processing continues with a search for the next + match. If the value is not zero, the current replacement is not ac- + cepted. If the value is greater than zero, processing continues when + PCRE2_SUBSTITUTE_GLOBAL is set. Otherwise (the value is less than zero + or PCRE2_SUBSTITUTE_GLOBAL is not set), the rest of the input is copied + to the output and the call to pcre2_substitute() exits, returning the + number of matches so far. + + Substitution case callouts + + int pcre2_set_substitute_case_callout(pcre2_match_context *mcontext, + PCRE2_SIZE (*callout_function)(PCRE2_SPTR, PCRE2_SIZE, + PCRE2_UCHAR *, PCRE2_SIZE, + int, void *), + void *callout_data); + + The pcre2_set_substitution_case_callout() function can be used to spec- + ify a callout function for pcre2_substitute() to use when performing + case transformations. This does not affect any case insensitivity be- + haviour when performing a match, but only the user-visible transforma- + tions performed when processing a substitution such as: + + pcre2_substitute(..., "\\U$1", ...) + + The default case transformations applied by PCRE2 are reasonably com- + plete, and, in UTF or UCP mode, perform the simple locale-invariant + case transformations as specified by Unicode. This is suitable for the + internal (invisible) case-equivalence procedures used during pattern + matching, but an application may wish to use more sophisticated locale- + aware processing for the user-visible substitution transformations. + + One example implementation of the callout_function using the ICU li- + brary would be: + + PCRE2_SIZE + icu_case_callout( + PCRE2_SPTR input, PCRE2_SIZE input_len, + PCRE2_UCHAR *output, PCRE2_SIZE output_cap, + int to_case, void *data_ptr) + { + UErrorCode err = U_ZERO_ERROR; + int32_t r = to_case == PCRE2_SUBSTITUTE_CASE_LOWER + ? u_strToLower(output, output_cap, input, input_len, NULL, &err) + : to_case == PCRE2_SUBSTITUTE_CASE_UPPER + ? u_strToUpper(output, output_cap, input, input_len, NULL, &err) + : u_strToTitle(output, output_cap, input, input_len, &first_char_only, + NULL, &err); + if (U_FAILURE(err)) return (~(PCRE2_SIZE)0); + return r; + } + + The first and second arguments of the case callout function are the + Unicode string to transform. + + The third and fourth arguments are the output buffer and its capacity. + + The fifth is one of the constants PCRE2_SUBSTITUTE_CASE_LOWER, + PCRE2_SUBSTITUTE_CASE_UPPER, or PCRE2_SUBSTITUTE_CASE_TITLE_FIRST. + PCRE2_SUBSTITUTE_CASE_LOWER and PCRE2_SUBSTITUTE_CASE_UPPER are passed + to the callout to indicate that the case of the entire callout input + should be case-transformed. PCRE2_SUBSTITUTE_CASE_TITLE_FIRST is passed + to indicate that only the first character or glyph should be trans- + formed to Unicode titlecase and the rest to Unicode lowercase (note + that titlecasing sometimes uses Unicode properties to titlecase each + word in a string; but PCRE2 is requesting that only the single leading + character is to be titlecased). + + The sixth argument is the callout_data supplied to pcre2_set_substi- + tute_case_callout(). + + The resulting string in the destination buffer may be larger or smaller + than the input, if the casing rules merge or split characters. The re- + turn value is the length required for the output string. If a buffer of + sufficient size was provided to the callout, then the result must be + written to the buffer and the number of code units returned. If the re- + sult does not fit in the provided buffer, then the required capacity + must be returned and PCRE2 will not make use of the output buffer. + PCRE2 provides input and output buffers which overlap, so the callout + must support this by suitable internal buffering. + + Alternatively, if the callout wishes to indicate an error, then it may + return (~(PCRE2_SIZE)0). In this case pcre2_substitute() will immedi- + ately fail with error PCRE2_ERROR_REPLACECASE. + + When a case callout is combined with the PCRE2_SUBSTITUTE_OVER- + FLOW_LENGTH option, there are situations when pcre2_substitute() will + return an underestimate of the required buffer size. If you call + pcre2_substitute() once with PCRE2_SUBSTITUTE_OVERFLOW_LENGTH, and the + input buffer is too small for the replacement string to be constructed, + then instead of calling the case callout, pcre2_substitute() will make + an estimate of the required buffer size. The second call should also + pass PCRE2_SUBSTITUTE_OVERFLOW_LENGTH, because that second call is not + guaranteed to succeed either, if the case callout requires more buffer + space than expected. The caller must make repeated attempts in a loop. + + +DUPLICATE CAPTURE GROUP NAMES + + int pcre2_substring_nametable_scan(const pcre2_code *code, + PCRE2_SPTR name, PCRE2_SPTR *first, PCRE2_SPTR *last); + + When a pattern is compiled with the PCRE2_DUPNAMES option, names for + capture groups are not required to be unique. Duplicate names are al- + ways allowed for groups with the same number, created by using the (?| + feature. Indeed, if such groups are named, they are required to use the + same names. + + Normally, patterns that use duplicate names are such that in any one + match, only one of each set of identically-named groups participates. + An example is shown in the pcre2pattern documentation. + + When duplicates are present, pcre2_substring_copy_byname() and + pcre2_substring_get_byname() return the first substring corresponding + to the given name that is set. Only if none are set is PCRE2_ERROR_UN- + SET is returned. The pcre2_substring_number_from_name() function re- + turns the error PCRE2_ERROR_NOUNIQUESUBSTRING when there are duplicate + names. + + If you want to get full details of all captured substrings for a given + name, you must use the pcre2_substring_nametable_scan() function. The + first argument is the compiled pattern, and the second is the name. If + the third and fourth arguments are NULL, the function returns a group + number for a unique name, or PCRE2_ERROR_NOUNIQUESUBSTRING otherwise. + + When the third and fourth arguments are not NULL, they must be pointers + to variables that are updated by the function. After it has run, they + point to the first and last entries in the name-to-number table for the + given name, and the function returns the length of each entry in code + units. In both cases, PCRE2_ERROR_NOSUBSTRING is returned if there are + no entries for the given name. + + The format of the name table is described above in the section entitled + Information about a pattern. Given all the relevant entries for the + name, you can extract each of their numbers, and hence the captured + data. + + +FINDING ALL POSSIBLE MATCHES AT ONE POSITION + + The traditional matching function uses a similar algorithm to Perl, + which stops when it finds the first match at a given point in the sub- + ject. If you want to find all possible matches, or the longest possible + match at a given position, consider using the alternative matching + function (see below) instead. If you cannot use the alternative func- + tion, you can kludge it up by making use of the callout facility, which + is described in the pcre2callout documentation. + + What you have to do is to insert a callout right at the end of the pat- + tern. When your callout function is called, extract and save the cur- + rent matched substring. Then return 1, which forces pcre2_match() to + backtrack and try other alternatives. Ultimately, when it runs out of + matches, pcre2_match() will yield PCRE2_ERROR_NOMATCH. + + +MATCHING A PATTERN: THE ALTERNATIVE FUNCTION + + int pcre2_dfa_match(const pcre2_code *code, PCRE2_SPTR subject, + PCRE2_SIZE length, PCRE2_SIZE startoffset, + uint32_t options, pcre2_match_data *match_data, + pcre2_match_context *mcontext, + int *workspace, PCRE2_SIZE wscount); + + The function pcre2_dfa_match() is called to match a subject string + against a compiled pattern, using a matching algorithm that scans the + subject string just once (not counting lookaround assertions), and does + not backtrack (except when processing lookaround assertions). This has + different characteristics to the normal algorithm, and is not compati- + ble with Perl. Some of the features of PCRE2 patterns are not sup- + ported. Nevertheless, there are times when this kind of matching can be + useful. For a discussion of the two matching algorithms, and a list of + features that pcre2_dfa_match() does not support, see the pcre2matching + documentation. + + The arguments for the pcre2_dfa_match() function are the same as for + pcre2_match(), plus two extras. The ovector within the match data block + is used in a different way, and this is described below. The other com- + mon arguments are used in the same way as for pcre2_match(), so their + description is not repeated here. + + The two additional arguments provide workspace for the function. The + workspace vector should contain at least 20 elements. It is used for + keeping track of multiple paths through the pattern tree. More work- + space is needed for patterns and subjects where there are a lot of po- + tential matches. + + Here is an example of a simple call to pcre2_dfa_match(): + + int wspace[20]; + pcre2_match_data *md = pcre2_match_data_create(4, NULL); + int rc = pcre2_dfa_match( + re, /* result of pcre2_compile() */ + "some string", /* the subject string */ + 11, /* the length of the subject string */ + 0, /* start at offset 0 in the subject */ + 0, /* default options */ + md, /* the match data block */ + NULL, /* a match context; NULL means use defaults */ + wspace, /* working space vector */ + 20); /* number of elements (NOT size in bytes) */ + + Option bits for pcre2_dfa_match() + + The unused bits of the options argument for pcre2_dfa_match() must be + zero. The only bits that may be set are PCRE2_ANCHORED, + PCRE2_COPY_MATCHED_SUBJECT, PCRE2_ENDANCHORED, PCRE2_NOTBOL, PCRE2_NO- + TEOL, PCRE2_NOTEMPTY, PCRE2_NOTEMPTY_ATSTART, PCRE2_NO_UTF_CHECK, + PCRE2_PARTIAL_HARD, PCRE2_PARTIAL_SOFT, PCRE2_DFA_SHORTEST, and + PCRE2_DFA_RESTART. All but the last four of these are exactly the same + as for pcre2_match(), so their description is not repeated here. + + PCRE2_PARTIAL_HARD + PCRE2_PARTIAL_SOFT + + These have the same general effect as they do for pcre2_match(), but + the details are slightly different. When PCRE2_PARTIAL_HARD is set for + pcre2_dfa_match(), it returns PCRE2_ERROR_PARTIAL if the end of the + subject is reached and there is still at least one matching possibility + that requires additional characters. This happens even if some complete + matches have already been found. When PCRE2_PARTIAL_SOFT is set, the + return code PCRE2_ERROR_NOMATCH is converted into PCRE2_ERROR_PARTIAL + if the end of the subject is reached, there have been no complete + matches, but there is still at least one matching possibility. The por- + tion of the string that was inspected when the longest partial match + was found is set as the first matching string in both cases. There is a + more detailed discussion of partial and multi-segment matching, with + examples, in the pcre2partial documentation. + + PCRE2_DFA_SHORTEST + + Setting the PCRE2_DFA_SHORTEST option causes the matching algorithm to + stop as soon as it has found one match. Because of the way the alterna- + tive algorithm works, this is necessarily the shortest possible match + at the first possible matching point in the subject string. + + PCRE2_DFA_RESTART + + When pcre2_dfa_match() returns a partial match, it is possible to call + it again, with additional subject characters, and have it continue with + the same match. The PCRE2_DFA_RESTART option requests this action; when + it is set, the workspace and wscount options must reference the same + vector as before because data about the match so far is left in them + after a partial match. There is more discussion of this facility in the + pcre2partial documentation. + + Successful returns from pcre2_dfa_match() + + When pcre2_dfa_match() succeeds, it may have matched more than one sub- + string in the subject. Note, however, that all the matches from one run + of the function start at the same point in the subject. The shorter + matches are all initial substrings of the longer matches. For example, + if the pattern + + <.*> + + is matched against the string + + This is no more + + the three matched strings are + + + + + + On success, the yield of the function is a number greater than zero, + which is the number of matched substrings. The offsets of the sub- + strings are returned in the ovector, and can be extracted by number in + the same way as for pcre2_match(), but the numbers bear no relation to + any capture groups that may exist in the pattern, because DFA matching + does not support capturing. + + Calls to the convenience functions that extract substrings by name re- + turn the error PCRE2_ERROR_DFA_UFUNC (unsupported function) if used af- + ter a DFA match. The convenience functions that extract substrings by + number never return PCRE2_ERROR_NOSUBSTRING. + + The matched strings are stored in the ovector in reverse order of + length; that is, the longest matching string is first. If there were + too many matches to fit into the ovector, the yield of the function is + zero, and the vector is filled with the longest matches. + + NOTE: PCRE2's "auto-possessification" optimization usually applies to + character repeats at the end of a pattern (as well as internally). For + example, the pattern "a\d+" is compiled as if it were "a\d++". For DFA + matching, this means that only one possible match is found. If you re- + ally do want multiple matches in such cases, either use an ungreedy re- + peat such as "a\d+?" or set the PCRE2_NO_AUTO_POSSESS option when com- + piling. + + Error returns from pcre2_dfa_match() + + The pcre2_dfa_match() function returns a negative number when it fails. + Many of the errors are the same as for pcre2_match(), as described + above. There are in addition the following errors that are specific to + pcre2_dfa_match(): + + PCRE2_ERROR_DFA_UITEM + + This return is given if pcre2_dfa_match() encounters an item in the + pattern that it does not support, for instance, the use of \C in a UTF + mode or a backreference. + + PCRE2_ERROR_DFA_UCOND + + This return is given if pcre2_dfa_match() encounters a condition item + that uses a backreference for the condition, or a test for recursion in + a specific capture group. These are not supported. + + PCRE2_ERROR_DFA_UINVALID_UTF + + This return is given if pcre2_dfa_match() is called for a pattern that + was compiled with PCRE2_MATCH_INVALID_UTF. This is not supported for + DFA matching. + + PCRE2_ERROR_DFA_WSSIZE + + This return is given if pcre2_dfa_match() runs out of space in the + workspace vector. + + PCRE2_ERROR_DFA_RECURSE + + When a recursion or subroutine call is processed, the matching function + calls itself recursively, using private memory for the ovector and + workspace. This error is given if the internal ovector is not large + enough. This should be extremely rare, as a vector of size 1000 is + used. + + PCRE2_ERROR_DFA_BADRESTART + + When pcre2_dfa_match() is called with the PCRE2_DFA_RESTART option, + some plausibility checks are made on the contents of the workspace, + which should contain data about the previous partial match. If any of + these checks fail, this error is given. + + +SEE ALSO + + pcre2build(3), pcre2callout(3), pcre2demo(3), pcre2matching(3), + pcre2partial(3), pcre2posix(3), pcre2sample(3), pcre2unicode(3). + + +AUTHOR + + Philip Hazel + Retired from University Computing Service + Cambridge, England. + + +REVISION + + Last updated: 26 December 2024 + Copyright (c) 1997-2024 University of Cambridge. + + +PCRE2 10.46 26 December 2024 PCRE2API(3) +------------------------------------------------------------------------------ + + +PCRE2BUILD(3) Library Functions Manual PCRE2BUILD(3) + + +NAME + PCRE2 - Perl-compatible regular expressions (revised API) + + +BUILDING PCRE2 + + PCRE2 is distributed with a configure script that can be used to build + the library in Unix-like environments using the applications known as + Autotools. Also in the distribution are files to support building using + CMake instead of configure. The text file README contains general in- + formation about building with Autotools (some of which is repeated be- + low), and also has some comments about building on various operating + systems. The files in the vms directory support building under OpenVMS. + There is a lot more information about building PCRE2 without using Au- + totools (including information about using CMake and building "by + hand") in the text file called NON-AUTOTOOLS-BUILD. You should consult + this file as well as the README file if you are building in a non-Unix- + like environment. + + +PCRE2 BUILD-TIME OPTIONS + + The rest of this document describes the optional features of PCRE2 that + can be selected when the library is compiled. It assumes use of the + configure script, where the optional features are selected or dese- + lected by providing options to configure before running the make com- + mand. However, the same options can be selected in both Unix-like and + non-Unix-like environments if you are using CMake instead of configure + to build PCRE2. + + If you are not using Autotools or CMake, option selection can be done + by editing the config.h file, or by passing parameter settings to the + compiler, as described in NON-AUTOTOOLS-BUILD. + + The complete list of options for configure (which includes the standard + ones such as the selection of the installation directory) can be ob- + tained by running + + ./configure --help + + The following sections include descriptions of "on/off" options whose + names begin with --enable or --disable. Because of the way that config- + ure works, --enable and --disable always come in pairs, so the comple- + mentary option always exists as well, but as it specifies the default, + it is not described. Options that specify values have names that start + with --with. At the end of a configure run, a summary of the configura- + tion is output. + + +BUILDING 8-BIT, 16-BIT AND 32-BIT LIBRARIES + + By default, a library called libpcre2-8 is built, containing functions + that take string arguments contained in arrays of bytes, interpreted + either as single-byte characters, or UTF-8 strings. You can also build + two other libraries, called libpcre2-16 and libpcre2-32, which process + strings that are contained in arrays of 16-bit and 32-bit code units, + respectively. These can be interpreted either as single-unit characters + or UTF-16/UTF-32 strings. To build these additional libraries, add one + or both of the following to the configure command: + + --enable-pcre2-16 + --enable-pcre2-32 + + If you do not want the 8-bit library, add + + --disable-pcre2-8 + + as well. At least one of the three libraries must be built. Note that + the POSIX wrapper is for the 8-bit library only, and that pcre2grep is + an 8-bit program. Neither of these are built if you select only the + 16-bit or 32-bit libraries. + + +BUILDING SHARED AND STATIC LIBRARIES + + The Autotools PCRE2 building process uses libtool to build both shared + and static libraries by default. You can suppress an unwanted library + by adding one of + + --disable-shared + --disable-static + + to the configure command. Setting --disable-shared ensures that PCRE2 + libraries are built as static libraries. The binaries that are then + created as part of the build process (for example, pcre2test and + pcre2grep) are linked statically with one or more PCRE2 libraries, but + may also be dynamically linked with other libraries such as libc. If + you want these binaries to be fully statically linked, you can set LD- + FLAGS like this: + + LDFLAGS=--static ./configure --disable-shared + + Note the two hyphens in --static. Of course, this works only if static + versions of all the relevant libraries are available for linking. + + +UNICODE AND UTF SUPPORT + + By default, PCRE2 is built with support for Unicode and UTF character + strings. To build it without Unicode support, add + + --disable-unicode + + to the configure command. This setting applies to all three libraries. + It is not possible to build one library with Unicode support and an- + other without in the same configuration. + + Of itself, Unicode support does not make PCRE2 treat strings as UTF-8, + UTF-16 or UTF-32. To do that, applications that use the library can set + the PCRE2_UTF option when they call pcre2_compile() to compile a pat- + tern. Alternatively, patterns may be started with (*UTF) unless the + application has locked this out by setting PCRE2_NEVER_UTF. + + UTF support allows the libraries to process character code points up to + 0x10ffff in the strings that they handle. Unicode support also gives + access to the Unicode properties of characters, using pattern escapes + such as \P, \p, and \X. Only the general category properties such as Lu + and Nd, script names, and some bi-directional properties are supported. + Details are given in the pcre2pattern documentation. + + Pattern escapes such as \d and \w do not by default make use of Unicode + properties. The application can request that they do by setting the + PCRE2_UCP option. Unless the application has set PCRE2_NEVER_UCP, a + pattern may also request this by starting with (*UCP). + + +DISABLING THE USE OF \C + + The \C escape sequence, which matches a single code unit, even in a UTF + mode, can cause unpredictable behaviour because it may leave the cur- + rent matching point in the middle of a multi-code-unit character. The + application can lock it out by setting the PCRE2_NEVER_BACKSLASH_C op- + tion when calling pcre2_compile(). There is also a build-time option + + --enable-never-backslash-C + + (note the upper case C) which locks out the use of \C entirely. + + +JUST-IN-TIME COMPILER SUPPORT + + Just-in-time (JIT) compiler support is included in the build by speci- + fying + + --enable-jit + + This support is available only for certain hardware architectures. If + this option is set for an unsupported architecture, a building error + occurs. If in doubt, use + + --enable-jit=auto + + which enables JIT only if the current hardware is supported. You can + check if JIT is enabled in the configuration summary that is output at + the end of a configure run. If you are enabling JIT under SELinux you + may also want to add + + --enable-jit-sealloc + + which enables the use of an execmem allocator in JIT that is compatible + with SELinux. This has no effect if JIT is not enabled. See the + pcre2jit documentation for a discussion of JIT usage. When JIT support + is enabled, pcre2grep automatically makes use of it, unless you add + + --disable-pcre2grep-jit + + to the configure command. + + +NEWLINE RECOGNITION + + By default, PCRE2 interprets the linefeed (LF) character as indicating + the end of a line. This is the normal newline character on Unix-like + systems. You can compile PCRE2 to use carriage return (CR) instead, by + adding + + --enable-newline-is-cr + + to the configure command. There is also an --enable-newline-is-lf op- + tion, which explicitly specifies linefeed as the newline character. + + Alternatively, you can specify that line endings are to be indicated by + the two-character sequence CRLF (CR immediately followed by LF). If you + want this, add + + --enable-newline-is-crlf + + to the configure command. There is a fourth option, specified by + + --enable-newline-is-anycrlf + + which causes PCRE2 to recognize any of the three sequences CR, LF, or + CRLF as indicating a line ending. A fifth option, specified by + + --enable-newline-is-any + + causes PCRE2 to recognize any Unicode newline sequence. The Unicode + newline sequences are the three just mentioned, plus the single charac- + ters VT (vertical tab, U+000B), FF (form feed, U+000C), NEL (next line, + U+0085), LS (line separator, U+2028), and PS (paragraph separator, + U+2029). The final option is + + --enable-newline-is-nul + + which causes NUL (binary zero) to be set as the default line-ending + character. + + Whatever default line ending convention is selected when PCRE2 is built + can be overridden by applications that use the library. At build time + it is recommended to use the standard for your operating system. + + +WHAT \R MATCHES + + By default, the sequence \R in a pattern matches any Unicode newline + sequence, independently of what has been selected as the line ending + sequence. If you specify + + --enable-bsr-anycrlf + + the default is changed so that \R matches only CR, LF, or CRLF. What- + ever is selected when PCRE2 is built can be overridden by applications + that use the library. + + +HANDLING VERY LARGE PATTERNS + + Within a compiled pattern, offset values are used to point from one + part to another (for example, from an opening parenthesis to an alter- + nation metacharacter). By default, in the 8-bit and 16-bit libraries, + two-byte values are used for these offsets, leading to a maximum size + for a compiled pattern of around 64 thousand code units. This is suffi- + cient to handle all but the most gigantic patterns. Nevertheless, some + people do want to process truly enormous patterns, so it is possible to + compile PCRE2 to use three-byte or four-byte offsets by adding a set- + ting such as + + --with-link-size=3 + + to the configure command. The value given must be 2, 3, or 4. For the + 16-bit library, a value of 3 is rounded up to 4. In these libraries, + using longer offsets slows down the operation of PCRE2 because it has + to load additional data when handling them. For the 32-bit library the + value is always 4 and cannot be overridden; the value of --with-link- + size is ignored. + + +LIMITING PCRE2 RESOURCE USAGE + + The pcre2_match() function increments a counter each time it goes round + its main loop. Putting a limit on this counter controls the amount of + computing resource used by a single call to pcre2_match(). The limit + can be changed at run time, as described in the pcre2api documentation. + The default is 10 million, but this can be changed by adding a setting + such as + + --with-match-limit=500000 + + to the configure command. This setting also applies to the + pcre2_dfa_match() matching function, and to JIT matching (though the + counting is done differently). + + The pcre2_match() function uses heap memory to record backtracking + points. The more nested backtracking points there are (that is, the + deeper the search tree), the more memory is needed. There is an upper + limit, specified in kibibytes (units of 1024 bytes). This limit can be + changed at run time, as described in the pcre2api documentation. The + default limit (in effect unlimited) is 20 million. You can change this + by a setting such as + + --with-heap-limit=500 + + which limits the amount of heap to 500 KiB. This limit applies only to + interpretive matching in pcre2_match() and pcre2_dfa_match(), which may + also use the heap for internal workspace when processing complicated + patterns. This limit does not apply when JIT (which has its own memory + arrangements) is used. + + You can also explicitly limit the depth of nested backtracking in the + pcre2_match() interpreter. This limit defaults to the value that is set + for --with-match-limit. You can set a lower default limit by adding, + for example, + + --with-match-limit-depth=10000 + + to the configure command. This value can be overridden at run time. + This depth limit indirectly limits the amount of heap memory that is + used, but because the size of each backtracking "frame" depends on the + number of capturing parentheses in a pattern, the amount of heap that + is used before the limit is reached varies from pattern to pattern. + This limit was more useful in versions before 10.30, where function re- + cursion was used for backtracking. + + As well as applying to pcre2_match(), the depth limit also controls the + depth of recursive function calls in pcre2_dfa_match(). These are used + for lookaround assertions, atomic groups, and recursion within pat- + terns. The limit does not apply to JIT matching. + + +LIMITING VARIABLE-LENGTH LOOKBEHIND ASSERTIONS + + Lookbehind assertions in which one or more branches can match a vari- + able number of characters are supported only if there is a maximum + matching length for each top-level branch. There is a limit to this + maximum that defaults to 255 characters. You can alter this default by + a setting such as + + --with-max-varlookbehind=100 + + The limit can be changed at runtime by calling pcre2_set_max_varlookbe- + hind(). Lookbehind assertions in which every branch matches a fixed + number of characters (not necessarily all the same) are not constrained + by this limit. + + +CREATING CHARACTER TABLES AT BUILD TIME + + PCRE2 uses fixed tables for processing characters whose code points are + less than 256. By default, PCRE2 is built with a set of tables that are + distributed in the file src/pcre2_chartables.c.dist. These tables are + for ASCII codes only. If you add + + --enable-rebuild-chartables + + to the configure command, the distributed tables are no longer used. + Instead, a program called pcre2_dftables is compiled and run. This out- + puts the source for new set of tables, created in the default locale of + your C run-time system. This method of replacing the tables does not + work if you are cross compiling, because pcre2_dftables needs to be run + on the local host and therefore not compiled with the cross compiler. + + If you need to create alternative tables when cross compiling, you will + have to do so "by hand". There may also be other reasons for creating + tables manually. To cause pcre2_dftables to be built on the local + host, run a normal compiling command, and then run the program with the + output file as its argument, for example: + + cc src/pcre2_dftables.c -o pcre2_dftables + ./pcre2_dftables src/pcre2_chartables.c + + This builds the tables in the default locale of the local host. If you + want to specify a locale, you must use the -L option: + + LC_ALL=fr_FR ./pcre2_dftables -L src/pcre2_chartables.c + + You can also specify -b (with or without -L). This causes the tables to + be written in binary instead of as source code. A set of binary tables + can be loaded into memory by an application and passed to pcre2_com- + pile() in the same way as tables created by calling pcre2_maketables(). + The tables are just a string of bytes, independent of hardware charac- + teristics such as endianness. This means they can be bundled with an + application that runs in different environments, to ensure consistent + behaviour. + + +USING EBCDIC CODE + + PCRE2 assumes by default that it will run in an environment where the + character code is ASCII or Unicode, which is a superset of ASCII. This + is the case for most computer operating systems. PCRE2 can, however, be + compiled to run in an 8-bit EBCDIC environment by adding + + --enable-ebcdic --disable-unicode + + to the configure command. This setting implies --enable-rebuild-charta- + bles. You should only use it if you know that you are in an EBCDIC en- + vironment (for example, an IBM mainframe operating system). + + It is not possible to support both EBCDIC and UTF-8 codes in the same + version of the library. Consequently, --enable-unicode and --enable- + ebcdic are mutually exclusive. + + The EBCDIC character that corresponds to an ASCII LF is assumed to have + the value 0x15 by default. However, in some EBCDIC environments, 0x25 + is used. In such an environment you should use + + --enable-ebcdic-nl25 + + as well as, or instead of, --enable-ebcdic. The EBCDIC character for CR + has the same value as in ASCII, namely, 0x0d. Whichever of 0x15 and + 0x25 is not chosen as LF is made to correspond to the Unicode NEL char- + acter (which, in Unicode, is 0x85). + + The options that select newline behaviour, such as --enable-newline-is- + cr, and equivalent run-time options, refer to these character values in + an EBCDIC environment. + + +PCRE2GREP SUPPORT FOR EXTERNAL SCRIPTS + + By default pcre2grep supports the use of callouts with string arguments + within the patterns it is matching. There are two kinds: one that gen- + erates output using local code, and another that calls an external pro- + gram or script. If --disable-pcre2grep-callout-fork is added to the + configure command, only the first kind of callout is supported; if + --disable-pcre2grep-callout is used, all callouts are completely ig- + nored. For more details of pcre2grep callouts, see the pcre2grep docu- + mentation. + + +PCRE2GREP OPTIONS FOR COMPRESSED FILE SUPPORT + + By default, pcre2grep reads all files as plain text. You can build it + so that it recognizes files whose names end in .gz or .bz2, and reads + them with libz or libbz2, respectively, by adding one or both of + + --enable-pcre2grep-libz + --enable-pcre2grep-libbz2 + + to the configure command. These options naturally require that the rel- + evant libraries are installed on your system. Configuration will fail + if they are not. + + +PCRE2GREP BUFFER SIZE + + pcre2grep uses an internal buffer to hold a "window" on the file it is + scanning, in order to be able to output "before" and "after" lines when + it finds a match. The default starting size of the buffer is 20KiB. The + buffer itself is three times this size, but because of the way it is + used for holding "before" lines, the longest line that is guaranteed to + be processable is the notional buffer size. If a longer line is encoun- + tered, pcre2grep automatically expands the buffer, up to a specified + maximum size, whose default is 1MiB or the starting size, whichever is + the larger. You can change the default parameter values by adding, for + example, + + --with-pcre2grep-bufsize=51200 + --with-pcre2grep-max-bufsize=2097152 + + to the configure command. The caller of pcre2grep can override these + values by using --buffer-size and --max-buffer-size on the command + line. + + +PCRE2TEST OPTION FOR LIBREADLINE SUPPORT + + If you add one of + + --enable-pcre2test-libreadline + --enable-pcre2test-libedit + + to the configure command, pcre2test is linked with the libreadline or- + libedit library, respectively, and when its input is from a terminal, + it reads it using the readline() function. This provides line-editing + and history facilities. Note that libreadline is GPL-licensed, so if + you distribute a binary of pcre2test linked in this way, there may be + licensing issues. These can be avoided by linking instead with libedit, + which has a BSD licence. + + Setting --enable-pcre2test-libreadline causes the -lreadline option to + be added to the pcre2test build. In many operating environments with a + system-installed readline library this is sufficient. However, in some + environments (e.g. if an unmodified distribution version of readline is + in use), some extra configuration may be necessary. The INSTALL file + for libreadline says this: + + "Readline uses the termcap functions, but does not link with + the termcap or curses library itself, allowing applications + which link with readline the to choose an appropriate library." + + If your environment has not been set up so that an appropriate library + is automatically included, you may need to add something like + + LIBS="-ncurses" + + immediately before the configure command. + + +INCLUDING DEBUGGING CODE + + If you add + + --enable-debug + + to the configure command, additional debugging code is included in the + build. This feature is intended for use by the PCRE2 maintainers. + + +DEBUGGING WITH VALGRIND SUPPORT + + If you add + + --enable-valgrind + + to the configure command, PCRE2 will use valgrind annotations to mark + certain memory regions as unaddressable. This allows it to detect in- + valid memory accesses, and is mostly useful for debugging PCRE2 itself. + + +CODE COVERAGE REPORTING + + If your C compiler is gcc, you can build a version of PCRE2 that can + generate a code coverage report for its test suite. To enable this, you + must install lcov version 1.6 or above. Then specify + + --enable-coverage + + to the configure command and build PCRE2 in the usual way. + + Note that using ccache (a caching C compiler) is incompatible with code + coverage reporting. If you have configured ccache to run automatically + on your system, you must set the environment variable + + CCACHE_DISABLE=1 + + before running make to build PCRE2, so that ccache is not used. + + When --enable-coverage is used, the following addition targets are + added to the Makefile: + + make coverage + + This creates a fresh coverage report for the PCRE2 test suite. It is + equivalent to running "make coverage-reset", "make coverage-baseline", + "make check", and then "make coverage-report". + + make coverage-reset + + This zeroes the coverage counters, but does nothing else. + + make coverage-baseline + + This captures baseline coverage information. + + make coverage-report + + This creates the coverage report. + + make coverage-clean-report + + This removes the generated coverage report without cleaning the cover- + age data itself. + + make coverage-clean-data + + This removes the captured coverage data without removing the coverage + files created at compile time (*.gcno). + + make coverage-clean + + This cleans all coverage data including the generated coverage report. + For more information about code coverage, see the gcov and lcov docu- + mentation. + + +DISABLING THE Z AND T FORMATTING MODIFIERS + + The C99 standard defines formatting modifiers z and t for size_t and + ptrdiff_t values, respectively. By default, PCRE2 uses these modifiers + in environments other than old versions of Microsoft Visual Studio when + __STDC_VERSION__ is defined and has a value greater than or equal to + 199901L (indicating support for C99). However, there is at least one + environment that claims to be C99 but does not support these modifiers. + If + + --disable-percent-zt + + is specified, no use is made of the z or t modifiers. Instead of %td or + %zu, a suitable format is used depending in the size of long for the + platform. + + +SUPPORT FOR FUZZERS + + There is a special option for use by people who want to run fuzzing + tests on PCRE2: + + --enable-fuzz-support + + At present this applies only to the 8-bit library. If set, it causes an + extra library called libpcre2-fuzzsupport.a to be built, but not in- + stalled. This contains a single function called LLVMFuzzerTestOneIn- + put() whose arguments are a pointer to a string and the length of the + string. When called, this function tries to compile the string as a + pattern, and if that succeeds, to match it. This is done both with no + options and with some random options bits that are generated from the + string. + + Setting --enable-fuzz-support also causes a binary called pcre2fuz- + zcheck to be created. This is normally run under valgrind or used when + PCRE2 is compiled with address sanitizing enabled. It calls the fuzzing + function and outputs information about what it is doing. The input + strings are specified by arguments: if an argument starts with "=" the + rest of it is a literal input string. Otherwise, it is assumed to be a + file name, and the contents of the file are the test string. + + +OBSOLETE OPTION + + In versions of PCRE2 prior to 10.30, there were two ways of handling + backtracking in the pcre2_match() function. The default was to use the + system stack, but if + + --disable-stack-for-recursion + + was set, memory on the heap was used. From release 10.30 onwards this + has changed (the stack is no longer used) and this option now does + nothing except give a warning. + + +SEE ALSO + + pcre2api(3), pcre2-config(3). + + +AUTHOR + + Philip Hazel + Retired from University Computing Service + Cambridge, England. + + +REVISION + + Last updated: 16 April 2024 + Copyright (c) 1997-2024 University of Cambridge. + + +PCRE2 10.46 16 April 2024 PCRE2BUILD(3) +------------------------------------------------------------------------------ + + +PCRE2CALLOUT(3) Library Functions Manual PCRE2CALLOUT(3) + + +NAME + PCRE2 - Perl-compatible regular expressions (revised API) + + +SYNOPSIS + + #include + + int (*pcre2_callout)(pcre2_callout_block *, void *); + + int pcre2_callout_enumerate(const pcre2_code *code, + int (*callback)(pcre2_callout_enumerate_block *, void *), + void *user_data); + + +DESCRIPTION + + PCRE2 provides a feature called "callout", which is a means of tem- + porarily passing control to the caller of PCRE2 in the middle of pat- + tern matching. The caller of PCRE2 provides an external function by + putting its entry point in a match context (see pcre2_set_callout() in + the pcre2api documentation). + + When using the pcre2_substitute() function, an additional callout fea- + ture is available. This does a callout after each change to the subject + string and is described in the pcre2api documentation; the rest of this + document is concerned with callouts during pattern matching. + + Within a regular expression, (?C) indicates a point at which the + external function is to be called. Different callout points can be + identified by putting a number less than 256 after the letter C. The + default value is zero. Alternatively, the argument may be a delimited + string. The starting delimiter must be one of ` ' " ^ % # $ { and the + ending delimiter is the same as the start, except for {, where the end- + ing delimiter is }. If the ending delimiter is needed within the + string, it must be doubled. For example, this pattern has two callout + points: + + (?C1)abc(?C"some ""arbitrary"" text")def + + If the PCRE2_AUTO_CALLOUT option bit is set when a pattern is compiled, + PCRE2 automatically inserts callouts, all with number 255, before each + item in the pattern except for immediately before or after an explicit + callout. For example, if PCRE2_AUTO_CALLOUT is used with the pattern + + A(?C3)B + + it is processed as if it were + + (?C255)A(?C3)B(?C255) + + Here is a more complicated example: + + A(\d{2}|--) + + With PCRE2_AUTO_CALLOUT, this pattern is processed as if it were + + (?C255)A(?C255)((?C255)\d{2}(?C255)|(?C255)-(?C255)-(?C255))(?C255) + + Notice that there is a callout before and after each parenthesis and + alternation bar. If the pattern contains a conditional group whose con- + dition is an assertion, an automatic callout is inserted immediately + before the condition. Such a callout may also be inserted explicitly, + for example: + + (?(?C9)(?=a)ab|de) (?(?C%text%)(?!=d)ab|de) + + This applies only to assertion conditions (because they are themselves + independent groups). + + Callouts can be useful for tracking the progress of pattern matching. + The pcre2test program has a pattern qualifier (/auto_callout) that sets + automatic callouts. When any callouts are present, the output from + pcre2test indicates how the pattern is being matched. This is useful + information when you are trying to optimize the performance of a par- + ticular pattern. + + +MISSING CALLOUTS + + You should be aware that, because of optimizations in the way PCRE2 + compiles and matches patterns, callouts sometimes do not happen exactly + as you might expect. + + Auto-possessification + + At compile time, PCRE2 "auto-possessifies" repeated items when it knows + that what follows cannot be part of the repeat. For example, a+[bc] is + compiled as if it were a++[bc]. The pcre2test output when this pattern + is compiled with PCRE2_ANCHORED and PCRE2_AUTO_CALLOUT and then applied + to the string "aaaa" is: + + --->aaaa + +0 ^ a+ + +2 ^ ^ [bc] + No match + + This indicates that when matching [bc] fails, there is no backtracking + into a+ (because it is being treated as a++) and therefore the callouts + that would be taken for the backtracks do not occur. You can disable + the auto-possessify feature by passing PCRE2_NO_AUTO_POSSESS to + pcre2_compile(), or starting the pattern with (*NO_AUTO_POSSESS). In + this case, the output changes to this: + + --->aaaa + +0 ^ a+ + +2 ^ ^ [bc] + +2 ^ ^ [bc] + +2 ^ ^ [bc] + +2 ^^ [bc] + No match + + This time, when matching [bc] fails, the matcher backtracks into a+ and + tries again, repeatedly, until a+ itself fails. + + Automatic .* anchoring + + By default, an optimization is applied when .* is the first significant + item in a pattern. If PCRE2_DOTALL is set, so that the dot can match + any character, the pattern is automatically anchored. If PCRE2_DOTALL + is not set, a match can start only after an internal newline or at the + beginning of the subject, and pcre2_compile() remembers this. If a pat- + tern has more than one top-level branch, automatic anchoring occurs if + all branches are anchorable. + + This optimization is disabled, however, if .* is in an atomic group or + if there is a backreference to the capture group in which it appears. + It is also disabled if the pattern contains (*PRUNE) or (*SKIP). How- + ever, the presence of callouts does not affect it. + + For example, if the pattern .*\d is compiled with PCRE2_AUTO_CALLOUT + and applied to the string "aa", the pcre2test output is: + + --->aa + +0 ^ .* + +2 ^ ^ \d + +2 ^^ \d + +2 ^ \d + No match + + This shows that all match attempts start at the beginning of the sub- + ject. In other words, the pattern is anchored. You can disable this op- + timization by passing PCRE2_NO_DOTSTAR_ANCHOR to pcre2_compile(), or + starting the pattern with (*NO_DOTSTAR_ANCHOR). In this case, the out- + put changes to: + + --->aa + +0 ^ .* + +2 ^ ^ \d + +2 ^^ \d + +2 ^ \d + +0 ^ .* + +2 ^^ \d + +2 ^ \d + No match + + This shows more match attempts, starting at the second subject charac- + ter. Another optimization, described in the next section, means that + there is no subsequent attempt to match with an empty subject. + + Other optimizations + + Other optimizations that provide fast "no match" results also affect + callouts. For example, if the pattern is + + ab(?C4)cd + + PCRE2 knows that any matching string must contain the letter "d". If + the subject string is "abyz", the lack of "d" means that matching + doesn't ever start, and the callout is never reached. However, with + "abyd", though the result is still no match, the callout is obeyed. + + For most patterns PCRE2 also knows the minimum length of a matching + string, and will immediately give a "no match" return without actually + running a match if the subject is not long enough, or, for unanchored + patterns, if it has been scanned far enough. + + You can disable these optimizations by passing the PCRE2_NO_START_OPTI- + MIZE option to pcre2_compile(), or by starting the pattern with + (*NO_START_OPT). This slows down the matching process, but does ensure + that callouts such as the example above are obeyed. + + +THE CALLOUT INTERFACE + + During matching, when PCRE2 reaches a callout point, if an external + function is provided in the match context, it is called. This applies + to both normal, DFA, and JIT matching. The first argument to the call- + out function is a pointer to a pcre2_callout block. The second argument + is the void * callout data that was supplied when the callout was set + up by calling pcre2_set_callout() (see the pcre2api documentation). The + callout block structure contains the following fields, not necessarily + in this order: + + uint32_t version; + uint32_t callout_number; + uint32_t capture_top; + uint32_t capture_last; + uint32_t callout_flags; + PCRE2_SIZE *offset_vector; + PCRE2_SPTR mark; + PCRE2_SPTR subject; + PCRE2_SIZE subject_length; + PCRE2_SIZE start_match; + PCRE2_SIZE current_position; + PCRE2_SIZE pattern_position; + PCRE2_SIZE next_item_length; + PCRE2_SIZE callout_string_offset; + PCRE2_SIZE callout_string_length; + PCRE2_SPTR callout_string; + + The version field contains the version number of the block format. The + current version is 2; the three callout string fields were added for + version 1, and the callout_flags field for version 2. If you are writ- + ing an application that might use an earlier release of PCRE2, you + should check the version number before accessing any of these fields. + The version number will increase in future if more fields are added, + but the intention is never to remove any of the existing fields. + + Fields for numerical callouts + + For a numerical callout, callout_string is NULL, and callout_number + contains the number of the callout, in the range 0-255. This is the + number that follows (?C for callouts that part of the pattern; it is + 255 for automatically generated callouts. + + Fields for string callouts + + For callouts with string arguments, callout_number is always zero, and + callout_string points to the string that is contained within the com- + piled pattern. Its length is given by callout_string_length. Duplicated + ending delimiters that were present in the original pattern string have + been turned into single characters, but there is no other processing of + the callout string argument. An additional code unit containing binary + zero is present after the string, but is not included in the length. + The delimiter that was used to start the string is also stored within + the pattern, immediately before the string itself. You can access this + delimiter as callout_string[-1] if you need it. + + The callout_string_offset field is the code unit offset to the start of + the callout argument string within the original pattern string. This is + provided for the benefit of applications such as script languages that + might need to report errors in the callout string within the pattern. + + Fields for all callouts + + The remaining fields in the callout block are the same for both kinds + of callout. + + The offset_vector field is a pointer to a vector of capturing offsets + (the "ovector"). You may read the elements in this vector, but you must + not change any of them. + + For calls to pcre2_match(), the offset_vector field is not (since re- + lease 10.30) a pointer to the actual ovector that was passed to the + matching function in the match data block. Instead it points to an in- + ternal ovector of a size large enough to hold all possible captured + substrings in the pattern. Note that whenever a recursion or subroutine + call within a pattern completes, the capturing state is reset to what + it was before. + + The capture_last field contains the number of the most recently cap- + tured substring, and the capture_top field contains one more than the + number of the highest numbered captured substring so far. If no sub- + strings have yet been captured, the value of capture_last is 0 and the + value of capture_top is 1. The values of these fields do not always + differ by one; for example, when the callout in the pattern + ((a)(b))(?C2) is taken, capture_last is 1 but capture_top is 4. + + The contents of ovector[2] to ovector[*2-1] can be in- + spected in order to extract substrings that have been matched so far, + in the same way as extracting substrings after a match has completed. + The values in ovector[0] and ovector[1] are always PCRE2_UNSET because + the match is by definition not complete. Substrings that have not been + captured but whose numbers are less than capture_top also have both of + their ovector slots set to PCRE2_UNSET. + + For DFA matching, the offset_vector field points to the ovector that + was passed to the matching function in the match data block for call- + outs at the top level, but to an internal ovector during the processing + of pattern recursions, lookarounds, and atomic groups. However, these + ovectors hold no useful information because pcre2_dfa_match() does not + support substring capturing. The value of capture_top is always 1 and + the value of capture_last is always 0 for DFA matching. + + The subject and subject_length fields contain copies of the values that + were passed to the matching function. + + The start_match field normally contains the offset within the subject + at which the current match attempt started. However, if the escape se- + quence \K has been encountered, this value is changed to reflect the + modified starting point. If the pattern is not anchored, the callout + function may be called several times from the same point in the pattern + for different starting points in the subject. + + The current_position field contains the offset within the subject of + the current match pointer. + + The pattern_position field contains the offset in the pattern string to + the next item to be matched. + + The next_item_length field contains the length of the next item to be + processed in the pattern string. When the callout is at the end of the + pattern, the length is zero. When the callout precedes an opening + parenthesis, the length includes meta characters that follow the paren- + thesis. For example, in a callout before an assertion such as (?=ab) + the length is 3. For an alternation bar or a closing parenthesis, the + length is one, unless a closing parenthesis is followed by a quanti- + fier, in which case its length is included. (This changed in release + 10.23. In earlier releases, before an opening parenthesis the length + was that of the entire group, and before an alternation bar or a clos- + ing parenthesis the length was zero.) + + The pattern_position and next_item_length fields are intended to help + in distinguishing between different automatic callouts, which all have + the same callout number. However, they are set for all callouts, and + are used by pcre2test to show the next item to be matched when display- + ing callout information. + + In callouts from pcre2_match() the mark field contains a pointer to the + zero-terminated name of the most recently passed (*MARK), (*PRUNE), or + (*THEN) item in the match, or NULL if no such items have been passed. + Instances of (*PRUNE) or (*THEN) without a name do not obliterate a + previous (*MARK). In callouts from the DFA matching function this field + always contains NULL. + + The callout_flags field is always zero in callouts from + pcre2_dfa_match() or when JIT is being used. When pcre2_match() without + JIT is used, the following bits may be set: + + PCRE2_CALLOUT_STARTMATCH + + This is set for the first callout after the start of matching for each + new starting position in the subject. + + PCRE2_CALLOUT_BACKTRACK + + This is set if there has been a matching backtrack since the previous + callout, or since the start of matching if this is the first callout + from a pcre2_match() run. + + Both bits are set when a backtrack has caused a "bumpalong" to a new + starting position in the subject. Output from pcre2test does not indi- + cate the presence of these bits unless the callout_extra modifier is + set. + + The information in the callout_flags field is provided so that applica- + tions can track and tell their users how matching with backtracking is + done. This can be useful when trying to optimize patterns, or just to + understand how PCRE2 works. There is no support in pcre2_dfa_match() + because there is no backtracking in DFA matching, and there is no sup- + port in JIT because JIT is all about maximimizing matching performance. + In both these cases the callout_flags field is always zero. + + +RETURN VALUES FROM CALLOUTS + + The external callout function returns an integer to PCRE2. If the value + is zero, matching proceeds as normal. If the value is greater than + zero, matching fails at the current point, but the testing of other + matching possibilities goes ahead, just as if a lookahead assertion had + failed. If the value is less than zero, the match is abandoned, and the + matching function returns the negative value. + + Negative values should normally be chosen from the set of PCRE2_ER- + ROR_xxx values. In particular, PCRE2_ERROR_NOMATCH forces a standard + "no match" failure. The error number PCRE2_ERROR_CALLOUT is reserved + for use by callout functions; it will never be used by PCRE2 itself. + + +CALLOUT ENUMERATION + + int pcre2_callout_enumerate(const pcre2_code *code, + int (*callback)(pcre2_callout_enumerate_block *, void *), + void *user_data); + + A script language that supports the use of string arguments in callouts + might like to scan all the callouts in a pattern before running the + match. This can be done by calling pcre2_callout_enumerate(). The first + argument is a pointer to a compiled pattern, the second points to a + callback function, and the third is arbitrary user data. The callback + function is called for every callout in the pattern in the order in + which they appear. Its first argument is a pointer to a callout enumer- + ation block, and its second argument is the user_data value that was + passed to pcre2_callout_enumerate(). The data block contains the fol- + lowing fields: + + version Block version number + pattern_position Offset to next item in pattern + next_item_length Length of next item in pattern + callout_number Number for numbered callouts + callout_string_offset Offset to string within pattern + callout_string_length Length of callout string + callout_string Points to callout string or is NULL + + The version number is currently 0. It will increase if new fields are + ever added to the block. The remaining fields are the same as their + namesakes in the pcre2_callout block that is used for callouts during + matching, as described above. + + Note that the value of pattern_position is unique for each callout. + However, if a callout occurs inside a group that is quantified with a + non-zero minimum or a fixed maximum, the group is replicated inside the + compiled pattern. For example, a pattern such as /(a){2}/ is compiled + as if it were /(a)(a)/. This means that the callout will be enumerated + more than once, but with the same value for pattern_position in each + case. + + The callback function should normally return zero. If it returns a non- + zero value, scanning the pattern stops, and that value is returned from + pcre2_callout_enumerate(). + + +AUTHOR + + Philip Hazel + Retired from University Computing Service + Cambridge, England. + + +REVISION + + Last updated: 19 January 2024 + Copyright (c) 1997-2024 University of Cambridge. + + +PCRE2 10.46 19 January 2024 PCRE2CALLOUT(3) +------------------------------------------------------------------------------ + + +PCRE2COMPAT(3) Library Functions Manual PCRE2COMPAT(3) + + +NAME + PCRE2 - Perl-compatible regular expressions (revised API) + + +DIFFERENCES BETWEEN PCRE2 AND PERL + + This document describes some of the known differences in the ways that + PCRE2 and Perl handle regular expressions. The differences described + here are with respect to Perl version 5.38.0, but as both Perl and + PCRE2 are continually changing, the information may at times be out of + date. + + 1. When PCRE2_DOTALL (equivalent to Perl's /s qualifier) is not set, + the behaviour of the '.' metacharacter differs from Perl. In PCRE2, '.' + matches the next character unless it is the start of a newline se- + quence. This means that, if the newline setting is CR, CRLF, or NUL, + '.' will match the code point LF (0x0A) in ASCII/Unicode environments, + and NL (either 0x15 or 0x25) when using EBCDIC. In Perl, '.' appears + never to match LF, even when 0x0A is not a newline indicator. + + 2. PCRE2 has only a subset of Perl's Unicode support. Details of what + it does have are given in the pcre2unicode page. + + 3. Like Perl, PCRE2 allows repeat quantifiers on parenthesized asser- + tions, but they do not mean what you might think. For example, (?!a){3} + does not assert that the next three characters are not "a". It just as- + serts that the next character is not "a" three times (in principle; + PCRE2 optimizes this to run the assertion just once). Perl allows some + repeat quantifiers on other assertions, for example, \b* , but these do + not seem to have any use. PCRE2 does not allow any kind of quantifier + on non-lookaround assertions. + + 4. If a braced quantifier such as {1,2} appears where there is nothing + to repeat (for example, at the start of a branch), PCRE2 raises an er- + ror whereas Perl treats the quantifier characters as literal. + + 5. Capture groups that occur inside negative lookaround assertions are + counted, but their entries in the offsets vector are set only when a + negative assertion is a condition that has a matching branch (that is, + the condition is false). Perl may set such capture groups in other + circumstances. + + 6. The following Perl escape sequences are not supported: \F, \l, \L, + \u, \U, and \N when followed by a character name. \N on its own, match- + ing a non-newline character, and \N{U+dd..}, matching a Unicode code + point, are supported. The escapes that modify the case of following + letters are implemented by Perl's general string-handling and are not + part of its pattern matching engine. If any of these are encountered by + PCRE2, an error is generated by default. However, if either of the + PCRE2_ALT_BSUX or PCRE2_EXTRA_ALT_BSUX options is set, \U and \u are + interpreted as ECMAScript interprets them. + + 7. The Perl escape sequences \p, \P, and \X are supported only if PCRE2 + is built with Unicode support (the default). The properties that can be + tested with \p and \P are limited to the general category properties + such as Lu and Nd, the derived properties Any and Lc (synonym L&), + script names such as Greek or Han, Bidi_Class, Bidi_Control, and a few + binary properties. Both PCRE2 and Perl support the Cs (surrogate) prop- + erty, but in PCRE2 its use is limited. See the pcre2pattern documenta- + tion for details. The long synonyms for property names that Perl sup- + ports (such as \p{Letter}) are not supported by PCRE2, nor is it per- + mitted to prefix any of these properties with "Is". + + 8. PCRE2 supports the \Q...\E escape for quoting substrings. Characters + in between are treated as literals. However, this is slightly different + from Perl in that $ and @ are also handled as literals inside the + quotes. In Perl, they cause variable interpolation (PCRE2 does not have + variables). Also, Perl does "double-quotish backslash interpolation" on + any backslashes between \Q and \E which, its documentation says, "may + lead to confusing results". PCRE2 treats a backslash between \Q and \E + just like any other character. Note the following examples: + + Pattern PCRE2 matches Perl matches + + \Qabc$xyz\E abc$xyz abc followed by the + contents of $xyz + \Qabc\$xyz\E abc\$xyz abc\$xyz + \Qabc\E\$\Qxyz\E abc$xyz abc$xyz + \QA\B\E A\B A\B + \Q\\E \ \\E + + The \Q...\E sequence is recognized both inside and outside character + classes by both PCRE2 and Perl. Another difference from Perl is that + any appearance of \Q or \E inside what might otherwise be a quantifier + causes PCRE2 not to recognize the sequence as a quantifier. Perl recog- + nizes a quantifier if (redundantly) either of the numbers is inside + \Q...\E, but not if the separating comma is. When not recognized as a + quantifier a sequence such as {\Q1\E,2} is treated as the literal + string "{1,2}". + + 9. Fairly obviously, PCRE2 does not support the (?{code}) and + (??{code}) constructions. However, PCRE2 does have a "callout" feature, + which allows an external function to be called during pattern matching. + See the pcre2callout documentation for details. + + 10. Subroutine calls (whether recursive or not) were treated as atomic + groups up to PCRE2 release 10.23, but from release 10.30 this changed, + and backtracking into subroutine calls is now supported, as in Perl. + + 11. In PCRE2, if any of the backtracking control verbs are used in a + group that is called as a subroutine (whether or not recursively), + their effect is confined to that group; it does not extend to the sur- + rounding pattern. This is not always the case in Perl. In particular, + if (*THEN) is present in a group that is called as a subroutine, its + action is limited to that group, even if the group does not contain any + | characters. Note that such groups are processed as anchored at the + point where they are tested. PCRE2 also confines all control verbs + within atomic assertions, again including (*THEN) in assertions with + only one branch. + + 12. If a pattern contains more than one backtracking control verb, the + first one that is backtracked onto acts. For example, in the pattern + A(*COMMIT)B(*PRUNE)C a failure in B triggers (*COMMIT), but a failure + in C triggers (*PRUNE). Perl's behaviour is more complex; in many cases + it is the same as PCRE2, but there are cases where it differs. + + 13. There are some differences that are concerned with the settings of + captured strings when part of a pattern is repeated. For example, + matching "aba" against the pattern /^(a(b)?)+$/ in Perl leaves $2 un- + set, but in PCRE2 it is set to "b". + + 14. PCRE2's handling of duplicate capture group numbers and names is + not as general as Perl's. This is a consequence of the fact the PCRE2 + works internally just with numbers, using an external table to trans- + late between numbers and names. In particular, a pattern such as + (?|(?A)|(?B)), where the two capture groups have the same number + but different names, is not supported, and causes an error at compile + time. If it were allowed, it would not be possible to distinguish which + group matched, because both names map to capture group number 1. To + avoid this confusing situation, an error is given at compile time. + + 15. Perl used to recognize comments in some places that PCRE2 does not, + for example, between the ( and ? at the start of a group. If the /x + modifier is set, Perl allowed white space between ( and ? though the + latest Perls give an error (for a while it was just deprecated). There + may still be some cases where Perl behaves differently. + + 16. Perl, when in warning mode, gives warnings for character classes + such as [A-\d] or [a-[:digit:]]. It then treats the hyphens as liter- + als. PCRE2 has no warning features, so it gives an error in these cases + because they are almost certainly user mistakes. + + 17. In PCRE2, until release 10.45, the upper/lower case character prop- + erties Lu and Ll were not affected when case-independent matching was + specified. Perl has changed in this respect, and PCRE2 has now changed + to match. When caseless matching is in force, Lu, Ll, and Lt (title + case) are all treated as Lc (cased letter). + + 18. From release 5.32.0, Perl locks out the use of \K in lookaround as- + sertions. From release 10.38 PCRE2 does the same by default. However, + there is an option for re-enabling the previous behaviour. When this + option is set, \K is acted on when it occurs in positive assertions, + but is ignored in negative assertions. + + 19. PCRE2 provides some extensions to the Perl regular expression fa- + cilities. Perl 5.10 included new features that were not in earlier + versions of Perl, some of which (such as named parentheses) were in + PCRE2 for some time before. This list is with respect to Perl 5.38: + + (a) If PCRE2_DOLLAR_ENDONLY is set and PCRE2_MULTILINE is not set, the + $ meta-character matches only at the very end of the string. + + (b) A backslash followed by a letter with no special meaning is + faulted. (Perl can be made to issue a warning.) + + (c) If PCRE2_UNGREEDY is set, the greediness of the repetition quanti- + fiers is inverted, that is, by default they are not greedy, but if fol- + lowed by a question mark they are. + + (d) PCRE2_ANCHORED can be used at matching time to force a pattern to + be tried only at the first matching position in the subject string. + + (e) The PCRE2_NOTBOL, PCRE2_NOTEOL, PCRE2_NOTEMPTY and + PCRE2_NOTEMPTY_ATSTART options have no Perl equivalents. + + (f) The \R escape sequence can be restricted to match only CR, LF, or + CRLF by the PCRE2_BSR_ANYCRLF option. + + (g) The callout facility is PCRE2-specific. Perl supports codeblocks + and variable interpolation, but not general hooks on every match. + + (h) The partial matching facility is PCRE2-specific. + + (i) The alternative matching function (pcre2_dfa_match() matches in a + different way and is not Perl-compatible. + + (j) PCRE2 recognizes some special sequences such as (*CR) or (*NO_JIT) + at the start of a pattern. These set overall options that cannot be + changed within the pattern. + + (k) PCRE2 supports non-atomic positive lookaround assertions. This is + an extension to the lookaround facilities. The default, Perl-compatible + lookarounds are atomic. + + (l) There are three syntactical items in patterns that can refer to a + capturing group by number: back references such as \g{2}, subroutine + calls such as (?3), and condition references such as (?(4)...). PCRE2 + supports relative group numbers such as +2 and -4 in all three cases. + Perl supports both plus and minus for subroutine calls, but only minus + for back references, and no relative numbering at all for conditions. + + (m) The scan substring assertion (syntax (*scs:(n)...)) is a PCRE2 ex- + tension that is not available in Perl. + + 20. Perl has different limits than PCRE2. See the pcre2limit documenta- + tion for details. Perl went with 5.10 from recursion to iteration keep- + ing the intermediate matches on the heap, which is ~10% slower but does + not fall into any stack-overflow limit. PCRE2 made a similar change at + release 10.30, and also has many build-time and run-time customizable + limits. + + 21. Unlike Perl, PCRE2 doesn't have character set modifiers and spe- + cially no way to set characters by context just like Perl's "/d". A + regular expression using PCRE2_UTF and PCRE2_UCP will use similar rules + to Perl's "/u"; something closer to "/a" could be selected by adding + other PCRE2_EXTRA_ASCII* options on top. + + 22. Some recursive patterns that Perl diagnoses as infinite recursions + can be handled by PCRE2, either by the interpreter or the JIT. An exam- + ple is /(?:|(?0)abcd)(?(R)|\z)/, which matches a sequence of any number + of repeated "abcd" substrings at the end of the subject. + + 23. Both PCRE2 and Perl error when \x{ escapes are invalid, but Perl + tries to recover and prints a warning if the problem was that an in- + valid hexadecimal digit was found, since PCRE2 doesn't have warnings it + returns an error instead. Additionally, Perl accepts \x{} and gener- + ates NUL unlike PCRE2. + + 24. From release 10.45, PCRE2 gives an error if \x is not followed by a + hexadecimal digit or a curly bracket. It used to interpret this as the + NUL character. Perl still generates NUL, but warns when in warning mode + in most cases. + + +AUTHOR + + Philip Hazel + Retired from University Computing Service + Cambridge, England. + + +REVISION + + Last updated: 02 October 2024 + Copyright (c) 1997-2024 University of Cambridge. + + +PCRE2 10.46 02 October 2024 PCRE2COMPAT(3) +------------------------------------------------------------------------------ + + +PCRE2JIT(3) Library Functions Manual PCRE2JIT(3) + + +NAME + PCRE2 - Perl-compatible regular expressions (revised API) + + +PCRE2 JUST-IN-TIME COMPILER SUPPORT + + Just-in-time compiling is a heavyweight optimization that can greatly + speed up pattern matching. However, it comes at the cost of extra pro- + cessing before the match is performed, so it is of most benefit when + the same pattern is going to be matched many times. This does not nec- + essarily mean many calls of a matching function; if the pattern is not + anchored, matching attempts may take place many times at various posi- + tions in the subject, even for a single call. Therefore, if the subject + string is very long, it may still pay to use JIT even for one-off + matches. JIT support is available for all of the 8-bit, 16-bit and + 32-bit PCRE2 libraries. + + JIT support applies only to the traditional Perl-compatible matching + function. It does not apply when the DFA matching function is being + used. The code for JIT support was written by Zoltan Herczeg. + + +AVAILABILITY OF JIT SUPPORT + + JIT support is an optional feature of PCRE2. The "configure" option + --enable-jit (or equivalent CMake option) must be set when PCRE2 is + built if you want to use JIT. The support is limited to the following + hardware platforms: + + ARM 32-bit (v7, and Thumb2) + ARM 64-bit + IBM s390x 64 bit + Intel x86 32-bit and 64-bit + LoongArch 64 bit + MIPS 32-bit and 64-bit + Power PC 32-bit and 64-bit + RISC-V 32-bit and 64-bit + + If --enable-jit is set on an unsupported platform, compilation fails. + + A client program can tell if JIT support has been compiled by calling + pcre2_config() with the PCRE2_CONFIG_JIT option. The result is one if + PCRE2 was built with JIT support, and zero otherwise. However, having + the JIT code available does not guarantee that it will be used for any + particular match. One reason for this is that there are a number of op- + tions and pattern items that are not supported by JIT (see below). An- + other reason is that in some environments JIT is unable to get exe- + cutable memory in which to build its compiled code. The only guarantee + from pcre2_config() is that if it returns zero, JIT will definitely not + be used. + + As of release 10.45 there is a more informative way to test for JIT + support. If pcre2_compile_jit() is called with the single option + PCRE2_JIT_TEST_ALLOC it returns zero if JIT is available and has a + working allocator. Otherwise it returns PCRE2_ERROR_NOMEMORY if JIT is + available but cannot allocate executable memory, or PCRE2_ERROR_JIT_UN- + SUPPORTED if JIT support is not compiled. The code argument is ignored, + so it can be a NULL value. + + A simple program does not need to check availability in order to use + JIT when possible. The API is implemented in a way that falls back to + the interpretive code if JIT is not available or cannot be used for a + given match. For programs that need the best possible performance, + there is a "fast path" API that is JIT-specific. + + +SIMPLE USE OF JIT + + To make use of the JIT support in the simplest way, all you have to do + is to call pcre2_jit_compile() after successfully compiling a pattern + with pcre2_compile(). This function has two arguments: the first is the + compiled pattern pointer that was returned by pcre2_compile(), and the + second is zero or more of the following option bits: PCRE2_JIT_COM- + PLETE, PCRE2_JIT_PARTIAL_HARD, or PCRE2_JIT_PARTIAL_SOFT. + + If JIT support is not available, a call to pcre2_jit_compile() does + nothing and returns PCRE2_ERROR_JIT_BADOPTION. Otherwise, the compiled + pattern is passed to the JIT compiler, which turns it into machine code + that executes much faster than the normal interpretive code, but yields + exactly the same results. The returned value from pcre2_jit_compile() + is zero on success, or a negative error code. + + There is a limit to the size of pattern that JIT supports, imposed by + the size of machine stack that it uses. The exact rules are not docu- + mented because they may change at any time, in particular, when new op- + timizations are introduced. If a pattern is too big, a call to + pcre2_jit_compile() returns PCRE2_ERROR_NOMEMORY. + + PCRE2_JIT_COMPLETE requests the JIT compiler to generate code for com- + plete matches. If you want to run partial matches using the PCRE2_PAR- + TIAL_HARD or PCRE2_PARTIAL_SOFT options of pcre2_match(), you should + set one or both of the other options as well as, or instead of + PCRE2_JIT_COMPLETE. The JIT compiler generates different optimized code + for each of the three modes (normal, soft partial, hard partial). When + pcre2_match() is called, the appropriate code is run if it is avail- + able. Otherwise, the pattern is matched using interpretive code. + + You can call pcre2_jit_compile() multiple times for the same compiled + pattern. It does nothing if it has previously compiled code for any of + the option bits. For example, you can call it once with PCRE2_JIT_COM- + PLETE and (perhaps later, when you find you need partial matching) + again with PCRE2_JIT_COMPLETE and PCRE2_JIT_PARTIAL_HARD. This time it + will ignore PCRE2_JIT_COMPLETE and just compile code for partial match- + ing. If pcre2_jit_compile() is called with no option bits set, it imme- + diately returns zero. This is an alternative way of testing whether JIT + support has been compiled. + + At present, it is not possible to free JIT compiled code except when + the entire compiled pattern is freed by calling pcre2_code_free(). + + In some circumstances you may need to call additional functions. These + are described in the section entitled "Controlling the JIT stack" be- + low. + + There are some pcre2_match() options that are not supported by JIT, and + there are also some pattern items that JIT cannot handle. Details are + given below. In both cases, matching automatically falls back to the + interpretive code. If you want to know whether JIT was actually used + for a particular match, you should arrange for a JIT callback function + to be set up as described in the section entitled "Controlling the JIT + stack" below, even if you do not need to supply a non-default JIT + stack. Such a callback function is called whenever JIT code is about to + be obeyed. If the match-time options are not right for JIT execution, + the callback function is not obeyed. + + If the JIT compiler finds an unsupported item, no JIT data is gener- + ated. You can find out if JIT compilation was successful for a compiled + pattern by calling pcre2_pattern_info() with the PCRE2_INFO_JITSIZE op- + tion. A non-zero result means that JIT compilation was successful. A + result of 0 means that JIT support is not available, or the pattern was + not processed by pcre2_jit_compile(), or the JIT compiler was not able + to handle the pattern. Successful JIT compilation does not, however, + guarantee the use of JIT at match time because there are some match + time options that are not supported by JIT. + + +MATCHING SUBJECTS CONTAINING INVALID UTF + + When a pattern is compiled with the PCRE2_UTF option, subject strings + are normally expected to be a valid sequence of UTF code units. By de- + fault, this is checked at the start of matching and an error is gener- + ated if invalid UTF is detected. The PCRE2_NO_UTF_CHECK option can be + passed to pcre2_match() to skip the check (for improved performance) if + you are sure that a subject string is valid. If this option is used + with an invalid string, the result is undefined. The calling program + may crash or loop or otherwise misbehave. + + However, a way of running matches on strings that may contain invalid + UTF sequences is available. Calling pcre2_compile() with the + PCRE2_MATCH_INVALID_UTF option has two effects: it tells the inter- + preter in pcre2_match() to support invalid UTF, and, if pcre2_jit_com- + pile() is subsequently called, the compiled JIT code also supports in- + valid UTF. Details of how this support works, in both the JIT and the + interpretive cases, is given in the pcre2unicode documentation. + + There is also an obsolete option for pcre2_jit_compile() called + PCRE2_JIT_INVALID_UTF, which currently exists only for backward compat- + ibility. It is superseded by the pcre2_compile() option + PCRE2_MATCH_INVALID_UTF and should no longer be used. It may be removed + in future. + + +UNSUPPORTED OPTIONS AND PATTERN ITEMS + + The pcre2_match() options that are supported for JIT matching are + PCRE2_COPY_MATCHED_SUBJECT, PCRE2_NOTBOL, PCRE2_NOTEOL, PCRE2_NOTEMPTY, + PCRE2_NOTEMPTY_ATSTART, PCRE2_NO_UTF_CHECK, PCRE2_PARTIAL_HARD, and + PCRE2_PARTIAL_SOFT. The PCRE2_ANCHORED and PCRE2_ENDANCHORED options + are not supported at match time. + + If the PCRE2_NO_JIT option is passed to pcre2_match() it disables the + use of JIT, forcing matching by the interpreter code. + + The only unsupported pattern items are \C (match a single data unit) + when running in a UTF mode, and a callout immediately before an asser- + tion condition in a conditional group. + + +RETURN VALUES FROM JIT MATCHING + + When a pattern is matched using JIT, the return values are the same as + those given by the interpretive pcre2_match() code, with the addition + of one new error code: PCRE2_ERROR_JIT_STACKLIMIT. This means that the + memory used for the JIT stack was insufficient. See "Controlling the + JIT stack" below for a discussion of JIT stack usage. + + The error code PCRE2_ERROR_MATCHLIMIT is returned by the JIT code if + searching a very large pattern tree goes on for too long, as it is in + the same circumstance when JIT is not used, but the details of exactly + what is counted are not the same. The PCRE2_ERROR_DEPTHLIMIT error code + is never returned when JIT matching is used. + + +CONTROLLING THE JIT STACK + + When the compiled JIT code runs, it needs a block of memory to use as a + stack. By default, it uses 32KiB on the machine stack. However, some + large or complicated patterns need more than this. The error PCRE2_ER- + ROR_JIT_STACKLIMIT is given when there is not enough stack. Three func- + tions are provided for managing blocks of memory for use as JIT stacks. + There is further discussion about the use of JIT stacks in the section + entitled "JIT stack FAQ" below. + + The pcre2_jit_stack_create() function creates a JIT stack. Its argu- + ments are a starting size, a maximum size, and a general context (for + memory allocation functions, or NULL for standard memory allocation). + It returns a pointer to an opaque structure of type pcre2_jit_stack, or + NULL if there is an error. The pcre2_jit_stack_free() function is used + to free a stack that is no longer needed. If its argument is NULL, this + function returns immediately, without doing anything. (For the techni- + cally minded: the address space is allocated by mmap or VirtualAlloc.) + A maximum stack size of 512KiB to 1MiB should be more than enough for + any pattern. + + The pcre2_jit_stack_assign() function specifies which stack JIT code + should use. Its arguments are as follows: + + pcre2_match_context *mcontext + pcre2_jit_callback callback + void *data + + The first argument is a pointer to a match context. When this is subse- + quently passed to a matching function, its information determines which + JIT stack is used. If this argument is NULL, the function returns imme- + diately, without doing anything. There are three cases for the values + of the other two options: + + (1) If callback is NULL and data is NULL, an internal 32KiB block + on the machine stack is used. This is the default when a match + context is created. + + (2) If callback is NULL and data is not NULL, data must be + a pointer to a valid JIT stack, the result of calling + pcre2_jit_stack_create(). + + (3) If callback is not NULL, it must point to a function that is + called with data as an argument at the start of matching, in + order to set up a JIT stack. If the return from the callback + function is NULL, the internal 32KiB stack is used; otherwise the + return value must be a valid JIT stack, the result of calling + pcre2_jit_stack_create(). + + A callback function is obeyed whenever JIT code is about to be run; it + is not obeyed when pcre2_match() is called with options that are incom- + patible for JIT matching. A callback function can therefore be used to + determine whether a match operation was executed by JIT or by the in- + terpreter. + + You may safely use the same JIT stack for more than one pattern (either + by assigning directly or by callback), as long as the patterns are + matched sequentially in the same thread. Currently, the only way to set + up non-sequential matches in one thread is to use callouts: if a call- + out function starts another match, that match must use a different JIT + stack to the one used for currently suspended match(es). + + In a multithread application, if you do not specify a JIT stack, or if + you assign or pass back NULL from a callback, that is thread-safe, be- + cause each thread has its own machine stack. However, if you assign or + pass back a non-NULL JIT stack, this must be a different stack for each + thread so that the application is thread-safe. + + Strictly speaking, even more is allowed. You can assign the same non- + NULL stack to a match context that is used by any number of patterns, + as long as they are not used for matching by multiple threads at the + same time. For example, you could use the same stack in all compiled + patterns, with a global mutex in the callback to wait until the stack + is available for use. However, this is an inefficient solution, and not + recommended. + + This is a suggestion for how a multithreaded program that needs to set + up non-default JIT stacks might operate: + + During thread initialization + thread_local_var = pcre2_jit_stack_create(...) + + During thread exit + pcre2_jit_stack_free(thread_local_var) + + Use a one-line callback function + return thread_local_var + + All the functions described in this section do nothing if JIT is not + available. + + +JIT STACK FAQ + + (1) Why do we need JIT stacks? + + PCRE2 (and JIT) is a recursive, depth-first engine, so it needs a stack + where the local data of the current node is pushed before checking its + child nodes. Allocating real machine stack on some platforms is diffi- + cult. For example, the stack chain needs to be updated every time if we + extend the stack on PowerPC. Although it is possible, its updating + time overhead decreases performance. So we do the recursion in memory. + + (2) Why don't we simply allocate blocks of memory with malloc()? + + Modern operating systems have a nice feature: they can reserve an ad- + dress space instead of allocating memory. We can safely allocate memory + pages inside this address space, so the stack could grow without moving + memory data (this is important because of pointers). Thus we can allo- + cate 1MiB address space, and use only a single memory page (usually + 4KiB) if that is enough. However, we can still grow up to 1MiB anytime + if needed. + + (3) Who "owns" a JIT stack? + + The owner of the stack is the user program, not the JIT studied pattern + or anything else. The user program must ensure that if a stack is being + used by pcre2_match(), (that is, it is assigned to a match context that + is passed to the pattern currently running), that stack must not be + used by any other threads (to avoid overwriting the same memory area). + The best practice for multithreaded programs is to allocate a stack for + each thread, and return this stack through the JIT callback function. + + (4) When should a JIT stack be freed? + + You can free a JIT stack at any time, as long as it will not be used by + pcre2_match() again. When you assign the stack to a match context, only + a pointer is set. There is no reference counting or any other magic. + You can free compiled patterns, contexts, and stacks in any order, any- + time. Just do not call pcre2_match() with a match context pointing to + an already freed stack, as that will cause SEGFAULT. (Also, do not free + a stack currently used by pcre2_match() in another thread). You can + also replace the stack in a context at any time when it is not in use. + You should free the previous stack before assigning a replacement. + + (5) Should I allocate/free a stack every time before/after calling + pcre2_match()? + + No, because this is too costly in terms of resources. However, you + could implement some clever idea which release the stack if it is not + used in let's say two minutes. The JIT callback can help to achieve + this without keeping a list of patterns. + + (6) OK, the stack is for long term memory allocation. But what happens + if a pattern causes stack overflow with a stack of 1MiB? Is that 1MiB + kept until the stack is freed? + + Especially on embedded systems, it might be a good idea to release mem- + ory sometimes without freeing the stack. There is no API for this at + the moment. Probably a function call which returns with the currently + allocated memory for any stack and another which allows releasing mem- + ory (shrinking the stack) would be a good idea if someone needs this. + + (7) This is too much of a headache. Isn't there any better solution for + JIT stack handling? + + No, thanks to Windows. If POSIX threads were used everywhere, we could + throw out this complicated API. + + +FREEING JIT SPECULATIVE MEMORY + + void pcre2_jit_free_unused_memory(pcre2_general_context *gcontext); + + The JIT executable allocator does not free all memory when it is possi- + ble. It expects new allocations, and keeps some free memory around to + improve allocation speed. However, in low memory conditions, it might + be better to free all possible memory. You can cause this to happen by + calling pcre2_jit_free_unused_memory(). Its argument is a general con- + text, for custom memory management, or NULL for standard memory manage- + ment. + + +EXAMPLE CODE + + This is a single-threaded example that specifies a JIT stack without + using a callback. A real program should include error checking after + all the function calls. + + int rc; + pcre2_code *re; + pcre2_match_data *match_data; + pcre2_match_context *mcontext; + pcre2_jit_stack *jit_stack; + + re = pcre2_compile(pattern, PCRE2_ZERO_TERMINATED, 0, + &errornumber, &erroffset, NULL); + rc = pcre2_jit_compile(re, PCRE2_JIT_COMPLETE); + mcontext = pcre2_match_context_create(NULL); + jit_stack = pcre2_jit_stack_create(32*1024, 512*1024, NULL); + pcre2_jit_stack_assign(mcontext, NULL, jit_stack); + match_data = pcre2_match_data_create(re, 10); + rc = pcre2_match(re, subject, length, 0, 0, match_data, mcontext); + /* Process result */ + + pcre2_code_free(re); + pcre2_match_data_free(match_data); + pcre2_match_context_free(mcontext); + pcre2_jit_stack_free(jit_stack); + + +JIT FAST PATH API + + Because the API described above falls back to interpreted matching when + JIT is not available, it is convenient for programs that are written + for general use in many environments. However, calling JIT via + pcre2_match() does have a performance impact. Programs that are written + for use where JIT is known to be available, and which need the best + possible performance, can instead use a "fast path" API to call JIT + matching directly instead of calling pcre2_match() (obviously only for + patterns that have been successfully processed by pcre2_jit_compile()). + + The fast path function is called pcre2_jit_match(), and it takes ex- + actly the same arguments as pcre2_match(). However, the subject string + must be specified with a length; PCRE2_ZERO_TERMINATED is not sup- + ported. Unsupported option bits (for example, PCRE2_ANCHORED and + PCRE2_ENDANCHORED) are ignored, as is the PCRE2_NO_JIT option. The re- + turn values are also the same as for pcre2_match(), plus PCRE2_ER- + ROR_JIT_BADOPTION if a matching mode (partial or complete) is requested + that was not compiled. + + When you call pcre2_match(), as well as testing for invalid options, a + number of other sanity checks are performed on the arguments. For exam- + ple, if the subject pointer is NULL but the length is non-zero, an im- + mediate error is given. Also, unless PCRE2_NO_UTF_CHECK is set, a UTF + subject string is tested for validity. In the interests of speed, these + checks do not happen on the JIT fast path. If invalid UTF data is + passed when PCRE2_MATCH_INVALID_UTF was not set for pcre2_compile(), + the result is undefined. The program may crash or loop or give wrong + results. In the absence of PCRE2_MATCH_INVALID_UTF you should call + pcre2_jit_match() in UTF mode only if you are sure the subject is + valid. + + Bypassing the sanity checks and the pcre2_match() wrapping can give + speedups of more than 10%. + + +SEE ALSO + + pcre2api(3), pcre2unicode(3) + + +AUTHOR + + Philip Hazel (FAQ by Zoltan Herczeg) + Retired from University Computing Service + Cambridge, England. + + +REVISION + + Last updated: 22 August 2024 + Copyright (c) 1997-2024 University of Cambridge. + + +PCRE2 10.46 22 August 2024 PCRE2JIT(3) +------------------------------------------------------------------------------ + + +PCRE2LIMITS(3) Library Functions Manual PCRE2LIMITS(3) + + +NAME + PCRE2 - Perl-compatible regular expressions (revised API) + + +SIZE AND OTHER LIMITATIONS + + There are some size limitations in PCRE2 but it is hoped that they will + never in practice be relevant. + + The maximum size of a compiled pattern is approximately 64 thousand + code units for the 8-bit and 16-bit libraries if PCRE2 is compiled with + the default internal linkage size, which is 2 bytes for these li- + braries. If you want to process regular expressions that are truly + enormous, you can compile PCRE2 with an internal linkage size of 3 or 4 + (when building the 16-bit library, 3 is rounded up to 4). See the + README file in the source distribution and the pcre2build documentation + for details. In these cases the limit is substantially larger. How- + ever, the speed of execution is slower. In the 32-bit library, the in- + ternal linkage size is always 4. + + The maximum length of a source pattern string is essentially unlimited; + it is the largest number a PCRE2_SIZE variable can hold. However, the + program that calls pcre2_compile() can specify a smaller limit. + + The maximum length (in code units) of a subject string is one less than + the largest number a PCRE2_SIZE variable can hold. PCRE2_SIZE is an un- + signed integer type, usually defined as size_t. Its maximum value (that + is ~(PCRE2_SIZE)0) is reserved as a special indicator for zero-termi- + nated strings and unset offsets. + + All values in repeating quantifiers must be less than 65536. + + There are two different limits that apply to branches of lookbehind as- + sertions. If every branch in such an assertion matches a fixed number + of characters, the maximum length of any branch is 65535 characters. If + any branch matches a variable number of characters, then the maximum + matching length for every branch is limited. The default limit is set + at compile time, defaulting to 255, but can be changed by the calling + program. + + There is no limit to the number of parenthesized groups, but there can + be no more than 65535 capture groups, and there is a limit to the depth + of nesting of parenthesized subpatterns of all kinds. This is imposed + in order to limit the amount of system stack used at compile time. The + default limit can be specified when PCRE2 is built; if not, the default + is set to 250. An application can change this limit by calling + pcre2_set_parens_nest_limit() to set the limit in a compile context. + + The maximum length of name for a named capture group is 32 code units, + and the maximum number of such groups is 10000. + + The maximum length of a name in a (*MARK), (*PRUNE), (*SKIP), or + (*THEN) verb is 255 code units for the 8-bit library and 65535 code + units for the 16-bit and 32-bit libraries. + + The maximum length of a string argument to a callout is the largest + number a 32-bit unsigned integer can hold. + + The maximum amount of heap memory used for matching is controlled by + the heap limit, which can be set in a pattern or in a match context. + The default is a very large number, effectively unlimited. + + +AUTHOR + + Philip Hazel + Retired from University Computing Service + Cambridge, England. + + +REVISION + + Last updated: 16 August 2023 + Copyright (c) 1997-2023 University of Cambridge. + + +PCRE2 10.46 16 August 2023 PCRE2LIMITS(3) +------------------------------------------------------------------------------ + + +PCRE2MATCHING(3) Library Functions Manual PCRE2MATCHING(3) + + +NAME + PCRE2 - Perl-compatible regular expressions (revised API) + + +PCRE2 MATCHING ALGORITHMS + + This document describes the two different algorithms that are available + in PCRE2 for matching a compiled regular expression against a given + subject string. The "standard" algorithm is the one provided by the + pcre2_match() function. This works in the same as Perl's matching func- + tion, and provides a Perl-compatible matching operation. The just-in- + time (JIT) optimization that is described in the pcre2jit documentation + is compatible with this function. + + An alternative algorithm is provided by the pcre2_dfa_match() function; + it operates in a different way, and is not Perl-compatible. This alter- + native has advantages and disadvantages compared with the standard al- + gorithm, and these are described below. + + When there is only one possible way in which a given subject string can + match a pattern, the two algorithms give the same answer. A difference + arises, however, when there are multiple possibilities. For example, if + the anchored pattern + + ^<.*> + + is matched against the string + + + + there are three possible answers. The standard algorithm finds only one + of them, whereas the alternative algorithm finds all three. + + +REGULAR EXPRESSIONS AS TREES + + The set of strings that are matched by a regular expression can be rep- + resented as a tree structure. An unlimited repetition in the pattern + makes the tree of infinite size, but it is still a tree. Matching the + pattern to a given subject string (from a given starting point) can be + thought of as a search of the tree. There are two ways to search a + tree: depth-first and breadth-first, and these correspond to the two + matching algorithms provided by PCRE2. + + +THE STANDARD MATCHING ALGORITHM + + In the terminology of Jeffrey Friedl's book "Mastering Regular Expres- + sions", the standard algorithm is an "NFA algorithm". It conducts a + depth-first search of the pattern tree. That is, it proceeds along a + single path through the tree, checking that the subject matches what is + required. When there is a mismatch, the algorithm tries any alterna- + tives at the current point, and if they all fail, it backs up to the + previous branch point in the tree, and tries the next alternative + branch at that level. This often involves backing up (moving to the + left) in the subject string as well. The order in which repetition + branches are tried is controlled by the greedy or ungreedy nature of + the quantifier. + + If a leaf node is reached, a matching string has been found, and at + that point the algorithm stops. Thus, if there is more than one possi- + ble match, this algorithm returns the first one that it finds. Whether + this is the shortest, the longest, or some intermediate length depends + on the way the alternations and the greedy or ungreedy repetition quan- + tifiers are specified in the pattern. + + Because it ends up with a single path through the tree, it is rela- + tively straightforward for this algorithm to keep track of the sub- + strings that are matched by portions of the pattern in parentheses. + This provides support for capturing parentheses and backreferences. + + +THE ALTERNATIVE MATCHING ALGORITHM + + This algorithm conducts a breadth-first search of the tree. Starting + from the first matching point in the subject, it scans the subject + string from left to right, once, character by character, and as it does + this, it remembers all the paths through the tree that represent valid + matches. In Friedl's terminology, this is a kind of "DFA algorithm", + though it is not implemented as a traditional finite state machine (it + keeps multiple states active simultaneously). + + Although the general principle of this matching algorithm is that it + scans the subject string only once, without backtracking, there is one + exception: when a lookaround assertion is encountered, the characters + following or preceding the current point have to be independently in- + spected. + + The scan continues until either the end of the subject is reached, or + there are no more unterminated paths. At this point, terminated paths + represent the different matching possibilities (if there are none, the + match has failed). Thus, if there is more than one possible match, + this algorithm finds all of them, and in particular, it finds the + longest. The matches are returned in the output vector in decreasing + order of length. There is an option to stop the algorithm after the + first match (which is necessarily the shortest) is found. + + Note that the size of vector needed to contain all the results depends + on the number of simultaneous matches, not on the number of capturing + parentheses in the pattern. Using pcre2_match_data_create_from_pat- + tern() to create the match data block is therefore not advisable when + doing DFA matching. + + Note also that all the matches that are found start at the same point + in the subject. If the pattern + + cat(er(pillar)?)? + + is matched against the string "the caterpillar catchment", the result + is the three strings "caterpillar", "cater", and "cat" that start at + the fifth character of the subject. The algorithm does not automati- + cally move on to find matches that start at later positions. + + PCRE2's "auto-possessification" optimization usually applies to charac- + ter repeats at the end of a pattern (as well as internally). For exam- + ple, the pattern "a\d+" is compiled as if it were "a\d++" because there + is no point even considering the possibility of backtracking into the + repeated digits. For DFA matching, this means that only one possible + match is found. If you really do want multiple matches in such cases, + either use an ungreedy repeat ("a\d+?") or set the PCRE2_NO_AUTO_POS- + SESS option when compiling. + + There are a number of features of PCRE2 regular expressions that are + not supported or behave differently in the alternative matching func- + tion. Those that are not supported cause an error if encountered. + + 1. Because the algorithm finds all possible matches, the greedy or un- + greedy nature of repetition quantifiers is not relevant (though it may + affect auto-possessification, as just described). During matching, + greedy and ungreedy quantifiers are treated in exactly the same way. + However, possessive quantifiers can make a difference when what follows + could also match what is quantified, for example in a pattern like + this: + + ^a++\w! + + This pattern matches "aaab!" but not "aaa!", which would be matched by + a non-possessive quantifier. Similarly, if an atomic group is present, + it is matched as if it were a standalone pattern at the current point, + and the longest match is then "locked in" for the rest of the overall + pattern. + + 2. When dealing with multiple paths through the tree simultaneously, it + is not straightforward to keep track of captured substrings for the + different matching possibilities, and PCRE2's implementation of this + algorithm does not attempt to do this. This means that no captured sub- + strings are available. + + 3. Because no substrings are captured, a number of related features are + not available: + + (a) Backreferences; + + (b) Conditional expressions that use a backreference as the condition + or test for a specific group recursion; + + (c) Script runs; + + (d) Scan substring assertions. + + 4. Because many paths through the tree may be active, the \K escape se- + quence, which resets the start of the match when encountered (but may + be on some paths and not on others), is not supported. + + 5. Callouts are supported, but the value of the capture_top field is + always 1, and the value of the capture_last field is always 0. + + 6. The \C escape sequence, which (in the standard algorithm) always + matches a single code unit, even in a UTF mode, is not supported in UTF + modes because the alternative algorithm moves through the subject + string one character (not code unit) at a time, for all active paths + through the tree. + + 7. Except for (*FAIL), the backtracking control verbs such as (*PRUNE) + are not supported. (*FAIL) is supported, and behaves like a failing + negative assertion. + + 8. The PCRE2_MATCH_INVALID_UTF option for pcre2_compile() is not sup- + ported by pcre2_dfa_match(). + + +ADVANTAGES OF THE ALTERNATIVE ALGORITHM + + The main advantage of the alternative algorithm is that all possible + matches (at a single point in the subject) are automatically found, and + in particular, the longest match is found. To find more than one match + at the same point using the standard algorithm, you have to do kludgy + things with callouts. + + Partial matching is possible with this algorithm, though it has some + limitations. The pcre2partial documentation gives details of partial + matching and discusses multi-segment matching. + + +DISADVANTAGES OF THE ALTERNATIVE ALGORITHM + + The alternative algorithm suffers from a number of disadvantages: + + 1. It is substantially slower than the standard algorithm. This is + partly because it has to search for all possible matches, but is also + because it is less susceptible to optimization. + + 2. Capturing parentheses and other features such as backreferences that + rely on them are not supported. + + 3. Matching within invalid UTF strings is not supported. + + 4. Although atomic groups are supported, their use does not provide the + performance advantage that it does for the standard algorithm. + + 5. JIT optimization is not supported. + + +AUTHOR + + Philip Hazel + Retired from University Computing Service + Cambridge, England. + + +REVISION + + Last updated: 30 August 2024 + Copyright (c) 1997-2024 University of Cambridge. + + +PCRE2 10.46 30 August 2024 PCRE2MATCHING(3) +------------------------------------------------------------------------------ + + +PCRE2PARTIAL(3) Library Functions Manual PCRE2PARTIAL(3) + + +NAME + PCRE2 - Perl-compatible regular expressions (revised API) + + +PARTIAL MATCHING IN PCRE2 + + In normal use of PCRE2, if there is a match up to the end of a subject + string, but more characters are needed to match the entire pattern, + PCRE2_ERROR_NOMATCH is returned, just like any other failing match. + There are circumstances where it might be helpful to distinguish this + "partial match" case. + + One example is an application where the subject string is very long, + and not all available at once. The requirement here is to be able to do + the matching segment by segment, but special action is needed when a + matched substring spans the boundary between two segments. + + Another example is checking a user input string as it is typed, to en- + sure that it conforms to a required format. Invalid characters can be + immediately diagnosed and rejected, giving instant feedback. + + Partial matching is a PCRE2-specific feature; it is not Perl-compati- + ble. It is requested by setting one of the PCRE2_PARTIAL_HARD or + PCRE2_PARTIAL_SOFT options when calling a matching function. The dif- + ference between the two options is whether or not a partial match is + preferred to an alternative complete match, though the details differ + between the two types of matching function. If both options are set, + PCRE2_PARTIAL_HARD takes precedence. + + If you want to use partial matching with just-in-time optimized code, + as well as setting a partial match option for the matching function, + you must also call pcre2_jit_compile() with one or both of these op- + tions: + + PCRE2_JIT_PARTIAL_HARD + PCRE2_JIT_PARTIAL_SOFT + + PCRE2_JIT_COMPLETE should also be set if you are going to run non-par- + tial matches on the same pattern. Separate code is compiled for each + mode. If the appropriate JIT mode has not been compiled, interpretive + matching code is used. + + Setting a partial matching option disables two of PCRE2's standard op- + timization hints. PCRE2 remembers the last literal code unit in a pat- + tern, and abandons matching immediately if it is not present in the + subject string. This optimization cannot be used for a subject string + that might match only partially. PCRE2 also remembers a minimum length + of a matching string, and does not bother to run the matching function + on shorter strings. This optimization is also disabled for partial + matching. + + +REQUIREMENTS FOR A PARTIAL MATCH + + A possible partial match occurs during matching when the end of the + subject string is reached successfully, but either more characters are + needed to complete the match, or the addition of more characters might + change what is matched. + + Example 1: if the pattern is /abc/ and the subject is "ab", more char- + acters are definitely needed to complete a match. In this case both + hard and soft matching options yield a partial match. + + Example 2: if the pattern is /ab+/ and the subject is "ab", a complete + match can be found, but the addition of more characters might change + what is matched. In this case, only PCRE2_PARTIAL_HARD returns a par- + tial match; PCRE2_PARTIAL_SOFT returns the complete match. + + On reaching the end of the subject, when PCRE2_PARTIAL_HARD is set, if + the next pattern item is \z, \Z, \b, \B, or $ there is always a partial + match. Otherwise, for both options, the next pattern item must be one + that inspects a character, and at least one of the following must be + true: + + (1) At least one character has already been inspected. An inspected + character need not form part of the final matched string; lookbehind + assertions and the \K escape sequence provide ways of inspecting char- + acters before the start of a matched string. + + (2) The pattern contains one or more lookbehind assertions. This condi- + tion exists in case there is a lookbehind that inspects characters be- + fore the start of the match. + + (3) There is a special case when the whole pattern can match an empty + string. When the starting point is at the end of the subject, the + empty string match is a possibility, and if PCRE2_PARTIAL_SOFT is set + and neither of the above conditions is true, it is returned. However, + because adding more characters might result in a non-empty match, + PCRE2_PARTIAL_HARD returns a partial match, which in this case means + "there is going to be a match at this point, but until some more char- + acters are added, we do not know if it will be an empty string or some- + thing longer". + + +PARTIAL MATCHING USING pcre2_match() + + When a partial matching option is set, the result of calling + pcre2_match() can be one of the following: + + A successful match + A complete match has been found, starting and ending within this sub- + ject. + + PCRE2_ERROR_NOMATCH + No match can start anywhere in this subject. + + PCRE2_ERROR_PARTIAL + Adding more characters may result in a complete match that uses one + or more characters from the end of this subject. + + When a partial match is returned, the first two elements in the ovector + point to the portion of the subject that was matched, but the values in + the rest of the ovector are undefined. The appearance of \K in the pat- + tern has no effect for a partial match. Consider this pattern: + + /abc\K123/ + + If it is matched against "456abc123xyz" the result is a complete match, + and the ovector defines the matched string as "123", because \K resets + the "start of match" point. However, if a partial match is requested + and the subject string is "456abc12", a partial match is found for the + string "abc12", because all these characters are needed for a subse- + quent re-match with additional characters. + + If there is more than one partial match, the first one that was found + provides the data that is returned. Consider this pattern: + + /123\w+X|dogY/ + + If this is matched against the subject string "abc123dog", both alter- + natives fail to match, but the end of the subject is reached during + matching, so PCRE2_ERROR_PARTIAL is returned. The offsets are set to 3 + and 9, identifying "123dog" as the first partial match. (In this exam- + ple, there are two partial matches, because "dog" on its own partially + matches the second alternative.) + + How a partial match is processed by pcre2_match() + + What happens when a partial match is identified depends on which of the + two partial matching options is set. + + If PCRE2_PARTIAL_HARD is set, PCRE2_ERROR_PARTIAL is returned as soon + as a partial match is found, without continuing to search for possible + complete matches. This option is "hard" because it prefers an earlier + partial match over a later complete match. For this reason, the assump- + tion is made that the end of the supplied subject string is not the + true end of the available data, which is why \z, \Z, \b, \B, and $ al- + ways give a partial match. + + If PCRE2_PARTIAL_SOFT is set, the partial match is remembered, but + matching continues as normal, and other alternatives in the pattern are + tried. If no complete match can be found, PCRE2_ERROR_PARTIAL is re- + turned instead of PCRE2_ERROR_NOMATCH. This option is "soft" because it + prefers a complete match over a partial match. All the various matching + items in a pattern behave as if the subject string is potentially com- + plete; \z, \Z, and $ match at the end of the subject, as normal, and + for \b and \B the end of the subject is treated as a non-alphanumeric. + + The difference between the two partial matching options can be illus- + trated by a pattern such as: + + /dog(sbody)?/ + + This matches either "dog" or "dogsbody", greedily (that is, it prefers + the longer string if possible). If it is matched against the string + "dog" with PCRE2_PARTIAL_SOFT, it yields a complete match for "dog". + However, if PCRE2_PARTIAL_HARD is set, the result is PCRE2_ERROR_PAR- + TIAL. On the other hand, if the pattern is made ungreedy the result is + different: + + /dog(sbody)??/ + + In this case the result is always a complete match because that is + found first, and matching never continues after finding a complete + match. It might be easier to follow this explanation by thinking of the + two patterns like this: + + /dog(sbody)?/ is the same as /dogsbody|dog/ + /dog(sbody)??/ is the same as /dog|dogsbody/ + + The second pattern will never match "dogsbody", because it will always + find the shorter match first. + + Example of partial matching using pcre2test + + The pcre2test data modifiers partial_hard (or ph) and partial_soft (or + ps) set PCRE2_PARTIAL_HARD and PCRE2_PARTIAL_SOFT, respectively, when + calling pcre2_match(). Here is a run of pcre2test using a pattern that + matches the whole subject in the form of a date: + + re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/ + data> 25dec3\=ph + Partial match: 23dec3 + data> 3ju\=ph + Partial match: 3ju + data> 3juj\=ph + No match + + This example gives the same results for both hard and soft partial + matching options. Here is an example where there is a difference: + + re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/ + data> 25jun04\=ps + 0: 25jun04 + 1: jun + data> 25jun04\=ph + Partial match: 25jun04 + + With PCRE2_PARTIAL_SOFT, the subject is matched completely. For + PCRE2_PARTIAL_HARD, however, the subject is assumed not to be complete, + so there is only a partial match. + + +MULTI-SEGMENT MATCHING WITH pcre2_match() + + PCRE was not originally designed with multi-segment matching in mind. + However, over time, features (including partial matching) that make + multi-segment matching possible have been added. A very long string can + be searched segment by segment by calling pcre2_match() repeatedly, + with the aim of achieving the same results that would happen if the en- + tire string was available for searching all the time. Normally, the + strings that are being sought are much shorter than each individual + segment, and are in the middle of very long strings, so the pattern is + normally not anchored. + + Special logic must be implemented to handle a matched substring that + spans a segment boundary. PCRE2_PARTIAL_HARD should be used, because it + returns a partial match at the end of a segment whenever there is the + possibility of changing the match by adding more characters. The + PCRE2_NOTBOL option should also be set for all but the first segment. + + When a partial match occurs, the next segment must be added to the cur- + rent subject and the match re-run, using the startoffset argument of + pcre2_match() to begin at the point where the partial match started. + For example: + + re> /\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d/ + data> ...the date is 23ja\=ph + Partial match: 23ja + data> ...the date is 23jan19 and on that day...\=offset=15 + 0: 23jan19 + 1: jan + + Note the use of the offset modifier to start the new match where the + partial match was found. In this example, the next segment was added to + the one in which the partial match was found. This is the most + straightforward approach, typically using a memory buffer that is twice + the size of each segment. After a partial match, the first half of the + buffer is discarded, the second half is moved to the start of the + buffer, and a new segment is added before repeating the match as in the + example above. After a no match, the entire buffer can be discarded. + + If there are memory constraints, you may want to discard text that pre- + cedes a partial match before adding the next segment. Unfortunately, + this is not at present straightforward. In cases such as the above, + where the pattern does not contain any lookbehinds, it is sufficient to + retain only the partially matched substring. However, if the pattern + contains a lookbehind assertion, characters that precede the start of + the partial match may have been inspected during the matching process. + When pcre2test displays a partial match, it indicates these characters + with '<' if the allusedtext modifier is set: + + re> "(?<=123)abc" + data> xx123ab\=ph,allusedtext + Partial match: 123ab + <<< + + However, the allusedtext modifier is not available for JIT matching, + because JIT matching does not record the first (or last) consulted + characters. For this reason, this information is not available via the + API. It is therefore not possible in general to obtain the exact number + of characters that must be retained in order to get the right match re- + sult. If you cannot retain the entire segment, you must find some + heuristic way of choosing. + + If you know the approximate length of the matching substrings, you can + use that to decide how much text to retain. The only lookbehind infor- + mation that is currently available via the API is the length of the + longest individual lookbehind in a pattern, but this can be misleading + if there are nested lookbehinds. The value returned by calling + pcre2_pattern_info() with the PCRE2_INFO_MAXLOOKBEHIND option is the + maximum number of characters (not code units) that any individual look- + behind moves back when it is processed. A pattern such as + "(?<=(? /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/ + data> 23ja\=dfa,ps + Partial match: 23ja + data> n05\=dfa,dfa_restart + 0: n05 + + The first call has "23ja" as the subject, and requests partial match- + ing; the second call has "n05" as the subject for the continued + (restarted) match. Notice that when the match is complete, only the + last part is shown; PCRE2 does not retain the previously partially- + matched string. It is up to the calling program to do that if it needs + to. This means that, for an unanchored pattern, if a continued match + fails, it is not possible to try again at a new starting point. All + this facility is capable of doing is continuing with the previous match + attempt. For example, consider this pattern: + + 1234|3789 + + If the first part of the subject is "ABC123", a partial match of the + first alternative is found at offset 3. There is no partial match for + the second alternative, because such a match does not start at the same + point in the subject string. Attempting to continue with the string + "7890" does not yield a match because only those alternatives that + match at one point in the subject are remembered. Depending on the ap- + plication, this may or may not be what you want. + + If you do want to allow for starting again at the next character, one + way of doing it is to retain some or all of the segment and try a new + complete match, as described for pcre2_match() above. Another possibil- + ity is to work with two buffers. If a partial match at offset n in the + first buffer is followed by "no match" when PCRE2_DFA_RESTART is used + on the second buffer, you can then try a new match starting at offset + n+1 in the first buffer. + + +AUTHOR + + Philip Hazel + Retired from University Computing Service + Cambridge, England. + + +REVISION + + Last updated: 27 November 2024 + Copyright (c) 1997-2019 University of Cambridge. + + +PCRE2 10.46 27 November 2024 PCRE2PARTIAL(3) +------------------------------------------------------------------------------ + + +PCRE2PATTERN(3) Library Functions Manual PCRE2PATTERN(3) + + +NAME + PCRE2 - Perl-compatible regular expressions (revised API) + + +PCRE2 REGULAR EXPRESSION DETAILS + + The syntax and semantics of the regular expressions that are supported + by PCRE2 are described in detail below. There is a quick-reference syn- + tax summary in the pcre2syntax page. PCRE2 tries to match Perl syntax + and semantics as closely as it can. PCRE2 also supports some alterna- + tive regular expression syntax that does not conflict with the Perl + syntax in order to provide some compatibility with regular expressions + in Python, .NET, and Oniguruma. There are in addition some options that + enable alternative syntax and semantics that are not the same as in + Perl. + + Perl's regular expressions are described in its own documentation, and + regular expressions in general are covered in a number of books, some + of which have copious examples. Jeffrey Friedl's "Mastering Regular Ex- + pressions", published by O'Reilly, covers regular expressions in great + detail. This description of PCRE2's regular expressions is intended as + reference material. + + This document discusses the regular expression patterns that are sup- + ported by PCRE2 when its main matching function, pcre2_match(), is + used. PCRE2 also has an alternative matching function, + pcre2_dfa_match(), which matches using a different algorithm that is + not Perl-compatible. Some of the features discussed below are not + available when DFA matching is used. The advantages and disadvantages + of the alternative function, and how it differs from the normal func- + tion, are discussed in the pcre2matching page. + + +EBCDIC CHARACTER CODES + + Most computers use ASCII or Unicode for encoding characters, and PCRE2 + assumes this by default. However, it can be compiled to run in an envi- + ronment that uses the EBCDIC code, which is the case for some IBM main- + frame operating systems. In the sections below, character code values + are ASCII or Unicode; in an EBCDIC environment these characters may + have different code values, and there are no code points greater than + 255. Differences in behaviour when PCRE2 is running in an EBCDIC envi- + ronment are described in the section "EBCDIC environments" below, which + you can ignore unless you really are in an EBCDIC environment. + + +SPECIAL START-OF-PATTERN ITEMS + + A number of options that can be passed to pcre2_compile() can also be + set by special items at the start of a pattern. These are not Perl-com- + patible, but are provided to make these options accessible to pattern + writers who are not able to change the program that processes the pat- + tern. Any number of these items may appear, but they must all be to- + gether right at the start of the pattern string, and the letters must + be in upper case. + + UTF support + + In the 8-bit and 16-bit PCRE2 libraries, characters may be coded either + as single code units, or as multiple UTF-8 or UTF-16 code units. UTF-32 + can be specified for the 32-bit library, in which case it constrains + the character values to valid Unicode code points. To process UTF + strings, PCRE2 must be built to include Unicode support (which is the + default). When using UTF strings you must either call the compiling + function with one or both of the PCRE2_UTF or PCRE2_MATCH_INVALID_UTF + options, or the pattern must start with the special sequence (*UTF), + which is equivalent to setting the relevant PCRE2_UTF. How setting a + UTF mode affects pattern matching is mentioned in several places below. + There is also a summary of features in the pcre2unicode page. + + Some applications that allow their users to supply patterns may wish to + restrict them to non-UTF data for security reasons. If the + PCRE2_NEVER_UTF option is passed to pcre2_compile(), (*UTF) is not al- + lowed, and its appearance in a pattern causes an error. + + Unicode property support + + Another special sequence that may appear at the start of a pattern is + (*UCP). This has the same effect as setting the PCRE2_UCP option: it + causes sequences such as \d and \w to use Unicode properties to deter- + mine character types, instead of recognizing only characters with codes + less than 256 via a lookup table. If also causes upper/lower casing op- + erations to use Unicode properties for characters with code points + greater than 127, even when UTF is not set. These behaviours can be + changed within the pattern; see the section entitled "Internal Option + Setting" below. + + Some applications that allow their users to supply patterns may wish to + restrict them for security reasons. If the PCRE2_NEVER_UCP option is + passed to pcre2_compile(), (*UCP) is not allowed, and its appearance in + a pattern causes an error. + + Locking out empty string matching + + Starting a pattern with (*NOTEMPTY) or (*NOTEMPTY_ATSTART) has the same + effect as passing the PCRE2_NOTEMPTY or PCRE2_NOTEMPTY_ATSTART option + to whichever matching function is subsequently called to match the pat- + tern. These options lock out the matching of empty strings, either en- + tirely, or only at the start of the subject. + + Disabling auto-possessification + + If a pattern starts with (*NO_AUTO_POSSESS), it has the same effect as + setting the PCRE2_NO_AUTO_POSSESS option, or calling pcre2_set_opti- + mize() with a PCRE2_AUTO_POSSESS_OFF directive. This stops PCRE2 from + making quantifiers possessive when what follows cannot match the re- + peated item. For example, by default a+b is treated as a++b. For more + details, see the pcre2api documentation. + + Disabling start-up optimizations + + If a pattern starts with (*NO_START_OPT), it has the same effect as + setting the PCRE2_NO_START_OPTIMIZE option, or calling pcre2_set_opti- + mize() with a PCRE2_START_OPTIMIZE_OFF directive. This disables several + optimizations for quickly reaching "no match" results. For more de- + tails, see the pcre2api documentation. + + Disabling automatic anchoring + + If a pattern starts with (*NO_DOTSTAR_ANCHOR), it has the same effect + as setting the PCRE2_NO_DOTSTAR_ANCHOR option, or calling pcre2_set_op- + timize() with a PCRE2_DOTSTAR_ANCHOR_OFF directive. This disables opti- + mizations that apply to patterns whose top-level branches all start + with .* (match any number of arbitrary characters). For more details, + see the pcre2api documentation. + + Disabling JIT compilation + + If a pattern that starts with (*NO_JIT) is successfully compiled, an + attempt by the application to apply the JIT optimization by calling + pcre2_jit_compile() is ignored. + + Setting match resource limits + + The pcre2_match() function contains a counter that is incremented every + time it goes round its main loop. The caller of pcre2_match() can set a + limit on this counter, which therefore limits the amount of computing + resource used for a match. The maximum depth of nested backtracking can + also be limited; this indirectly restricts the amount of heap memory + that is used, but there is also an explicit memory limit that can be + set. + + These facilities are provided to catch runaway matches that are pro- + voked by patterns with huge matching trees. A common example is a pat- + tern with nested unlimited repeats applied to a long string that does + not match. When one of these limits is reached, pcre2_match() gives an + error return. The limits can also be set by items at the start of the + pattern of the form + + (*LIMIT_HEAP=d) + (*LIMIT_MATCH=d) + (*LIMIT_DEPTH=d) + + where d is any number of decimal digits. However, the value of the set- + ting must be less than the value set (or defaulted) by the caller of + pcre2_match() for it to have any effect. In other words, the pattern + writer can lower the limits set by the programmer, but not raise them. + If there is more than one setting of one of these limits, the lower + value is used. The heap limit is specified in kibibytes (units of 1024 + bytes). + + Prior to release 10.30, LIMIT_DEPTH was called LIMIT_RECURSION. This + name is still recognized for backwards compatibility. + + The heap limit applies only when the pcre2_match() or pcre2_dfa_match() + interpreters are used for matching. It does not apply to JIT. The match + limit is used (but in a different way) when JIT is being used, or when + pcre2_dfa_match() is called, to limit computing resource usage by those + matching functions. The depth limit is ignored by JIT but is relevant + for DFA matching, which uses function recursion for recursions within + the pattern and for lookaround assertions and atomic groups. In this + case, the depth limit controls the depth of such recursion. + + Newline conventions + + PCRE2 supports six different conventions for indicating line breaks in + strings: a single CR (carriage return) character, a single LF (line- + feed) character, the two-character sequence CRLF, any of the three pre- + ceding, any Unicode newline sequence, or the NUL character (binary + zero). The pcre2api page has further discussion about newlines, and + shows how to set the newline convention when calling pcre2_compile(). + + It is also possible to specify a newline convention by starting a pat- + tern string with one of the following sequences: + + (*CR) carriage return + (*LF) linefeed + (*CRLF) carriage return, followed by linefeed + (*ANYCRLF) any of the three above + (*ANY) all Unicode newline sequences + (*NUL) the NUL character (binary zero) + + These override the default and the options given to the compiling func- + tion. For example, on a Unix system where LF is the default newline se- + quence, the pattern + + (*CR)a.b + + changes the convention to CR. That pattern matches "a\nb" because LF is + no longer a newline. If more than one of these settings is present, the + last one is used. + + The newline convention affects where the circumflex and dollar asser- + tions are true. It also affects the interpretation of the dot metachar- + acter when PCRE2_DOTALL is not set, and the behaviour of \N when not + followed by an opening brace. However, it does not affect what the \R + escape sequence matches. By default, this is any Unicode newline se- + quence, for Perl compatibility. However, this can be changed; see the + next section and the description of \R in the section entitled "Newline + sequences" below. A change of \R setting can be combined with a change + of newline convention. + + Specifying what \R matches + + It is possible to restrict \R to match only CR, LF, or CRLF (instead of + the complete set of Unicode line endings) by setting the option + PCRE2_BSR_ANYCRLF at compile time. This effect can also be achieved by + starting a pattern with (*BSR_ANYCRLF). For completeness, (*BSR_UNI- + CODE) is also recognized, corresponding to PCRE2_BSR_UNICODE. + + +CHARACTERS AND METACHARACTERS + + A regular expression is a pattern that is matched against a subject + string from left to right. Most characters stand for themselves in a + pattern, and match the corresponding characters in the subject. As a + trivial example, the pattern + + The quick brown fox + + matches a portion of a subject string that is identical to itself. When + caseless matching is specified (the PCRE2_CASELESS option or (?i) + within the pattern), letters are matched independently of case. Note + that there are two ASCII characters, K and S, that, in addition to + their lower case ASCII equivalents, are case-equivalent with Unicode + U+212A (Kelvin sign) and U+017F (long S) respectively when either + PCRE2_UTF or PCRE2_UCP is set, unless the PCRE2_EXTRA_CASELESS_RESTRICT + option is in force (either passed to pcre2_compile() or set by (*CASE- + LESS_RESTRICT) or (?r) within the pattern). If the PCRE2_EXTRA_TURK- + ISH_CASING option is in force (either passed to pcre2_compile() or set + by (*TURKISH_CASING) within the pattern), then the 'i' letters are + matched according to Turkish and Azeri languages. + + The power of regular expressions comes from the ability to include wild + cards, character classes, alternatives, and repetitions in the pattern. + These are encoded in the pattern by the use of metacharacters, which do + not stand for themselves but instead are interpreted in some special + way. + + There are two different sets of metacharacters: those that are recog- + nized anywhere in the pattern except within square brackets, and those + that are recognized within square brackets. Outside square brackets, + the metacharacters are as follows: + + \ general escape character with several uses + ^ assert start of string (or line, in multiline mode) + $ assert end of string (or line, in multiline mode) + . match any character except newline (by default) + [ start character class definition + | start of alternative branch + ( start group or control verb + ) end group or control verb + * 0 or more quantifier + + 1 or more quantifier; also "possessive quantifier" + ? 0 or 1 quantifier; also quantifier minimizer + { potential start of min/max quantifier + + Brace characters { and } are also used to enclose data for construc- + tions such as \g{2} or \k{name}. In almost all uses of braces, space + and/or horizontal tab characters that follow { or precede } are allowed + and are ignored. In the case of quantifiers, they may also appear be- + fore or after the comma. The exception to this is \u{...} which is an + ECMAScript compatibility feature that is recognized only when the + PCRE2_EXTRA_ALT_BSUX option is set. ECMAScript does not ignore such + white space; it causes the item to be interpreted as literal. + + Part of a pattern that is in square brackets is called a "character + class". In a character class the only metacharacters are: + + \ general escape character + ^ negate the class, but only if the first character + - indicates character range + [ POSIX character class (if followed by POSIX syntax) + ] terminates the character class + + If a pattern is compiled with the PCRE2_EXTENDED option, most white + space in the pattern, other than in a character class, within a \Q...\E + sequence, or between a # outside a character class and the next new- + line, inclusive, is ignored. An escaping backslash can be used to in- + clude a white space or a # character as part of the pattern. If the + PCRE2_EXTENDED_MORE option is set, the same applies, but in addition + unescaped space and horizontal tab characters are ignored inside a + character class. Note: only these two characters are ignored, not the + full set of pattern white space characters that are ignored outside a + character class. Option settings can be changed within a pattern; see + the section entitled "Internal Option Setting" below. + + The following sections describe the use of each of the metacharacters. + + +BACKSLASH + + The backslash character has several uses. Firstly, if it is followed by + a character that is not a digit or a letter, it takes away any special + meaning that character may have. This use of backslash as an escape + character applies both inside and outside character classes. + + For example, if you want to match a * character, you must write \* in + the pattern. This escaping action applies whether or not the following + character would otherwise be interpreted as a metacharacter, so it is + always safe to precede a non-alphanumeric with backslash to specify + that it stands for itself. In particular, if you want to match a back- + slash, you write \\. + + Only ASCII digits and letters have any special meaning after a back- + slash. All other characters (in particular, those whose code points are + greater than 127) are treated as literals. + + If you want to treat all characters in a sequence as literals, you can + do so by putting them between \Q and \E. Note that this includes white + space even when the PCRE2_EXTENDED option is set so that most other + white space is ignored. The behaviour is different from Perl in that $ + and @ are handled as literals in \Q...\E sequences in PCRE2, whereas in + Perl, $ and @ cause variable interpolation. Also, Perl does "double- + quotish backslash interpolation" on any backslashes between \Q and \E + which, its documentation says, "may lead to confusing results". PCRE2 + treats a backslash between \Q and \E just like any other character. + Note the following examples: + + Pattern PCRE2 matches Perl matches + + \Qabc$xyz\E abc$xyz abc followed by the + contents of $xyz + \Qabc\$xyz\E abc\$xyz abc\$xyz + \Qabc\E\$\Qxyz\E abc$xyz abc$xyz + \QA\B\E A\B A\B + \Q\\E \ \\E + + The \Q...\E sequence is recognized both inside and outside character + classes. An isolated \E that is not preceded by \Q is ignored. If \Q + is not followed by \E later in the pattern, the literal interpretation + continues to the end of the pattern (that is, \E is assumed at the + end). If the isolated \Q is inside a character class, this causes an + error, because the character class is then not terminated by a closing + square bracket. + + Another difference from Perl is that any appearance of \Q or \E inside + what might otherwise be a quantifier causes PCRE2 not to recognize the + sequence as a quantifier. Perl recognizes a quantifier if (redundantly) + either of the numbers is inside \Q...\E, but not if the separating + comma is. When not recognized as a quantifier a sequence such as + {\Q1\E,2} is treated as the literal string "{1,2}". + + Non-printing characters + + A second use of backslash provides a way of encoding non-printing char- + acters in patterns in a visible manner. There is no restriction on the + appearance of non-printing characters in a pattern, but when a pattern + is being prepared by text editing, it is often easier to use one of the + following escape sequences instead of the binary character it repre- + sents. In an ASCII or Unicode environment, these escapes are as fol- + lows: + + \a alarm, that is, the BEL character (hex 07) + \cx "control-x", where x is a non-control ASCII character + \e escape (hex 1B) + \f form feed (hex 0C) + \n linefeed (hex 0A) + \r carriage return (hex 0D) (but see below) + \t tab (hex 09) + \0dd character with octal code 0dd + \ddd character with octal code ddd, or back reference + \o{ddd..} character with octal code ddd.. + \xhh character with hex code hh + \x{hhh..} character with hex code hhh.. + \N{U+hhh..} character with Unicode hex code point hhh.. + + A description of how back references work is given later, following the + discussion of parenthesized groups. + + By default, after \x that is not followed by {, one or two hexadecimal + digits are read (letters can be in upper or lower case). If the charac- + ter that follows \x is neither { nor a hexadecimal digit, an error oc- + curs. This is different from Perl's default behaviour, which generates + a NUL character, but is in line with the behaviour of Perl's 'strict' + mode in re. + + Any number of hexadecimal digits may appear between \x{ and }. If a + character other than a hexadecimal digit appears between \x{ and }, or + if there is no terminating }, an error occurs. + + Characters whose code points are less than 256 can be defined by either + of the two syntaxes for \x or by an octal sequence. There is no differ- + ence in the way they are handled. For example, \xdc is exactly the same + as \x{dc} or \334. However, using the braced versions does make such + sequences easier to read. + + Support is available for some ECMAScript (aka JavaScript) escape se- + quences via two compile-time options. If PCRE2_ALT_BSUX is set, the se- + quence \x followed by { is not recognized. Only if \x is followed by + two hexadecimal digits is it recognized as a character escape. Other- + wise it is interpreted as a literal "x" character. In this mode, sup- + port for code points greater than 256 is provided by \u, which must be + followed by four hexadecimal digits; otherwise it is interpreted as a + literal "u" character. + + PCRE2_EXTRA_ALT_BSUX has the same effect as PCRE2_ALT_BSUX and, in ad- + dition, \u{hhh..} is recognized as the character specified by hexadeci- + mal code point. There may be any number of hexadecimal digits, but un- + like other places that also use curly brackets, spaces are not allowed + and would result in the string being interpreted as a literal. This + syntax is from ECMAScript 6. + + The \N{U+hhh..} escape sequence is recognized only when PCRE2 is oper- + ating in UTF mode. Perl also uses \N{name} to specify characters by + Unicode name; PCRE2 does not support this. Note that when \N is not + followed by an opening brace (curly bracket) it has an entirely differ- + ent meaning, matching any character that is not a newline. + + There are some legacy applications where the escape sequence \r is ex- + pected to match a newline. If the PCRE2_EXTRA_ESCAPED_CR_IS_LF option + is set, \r in a pattern is converted to \n so that it matches a LF + (linefeed) instead of a CR (carriage return) character. + + An error occurs if \c is not followed by a character whose ASCII code + point is in the range 32 to 126. The precise effect of \cx is as fol- + lows: if x is a lower case letter, it is converted to upper case. Then + bit 6 of the character (hex 40) is inverted. Thus \cA to \cZ become hex + 01 to hex 1A (A is 41, Z is 5A), but \c{ becomes hex 3B ({ is 7B), and + \c; becomes hex 7B (; is 3B). If the code unit following \c has a code + point less than 32 or greater than 126, a compile-time error occurs. + + For differences in the way some escapes behave in EBCDIC environments, + see section "EBCDIC environments" below. + + Octal escapes and back references + + The escape \o must be followed by a sequence of octal digits, enclosed + in braces. An error occurs if this is not the case. This escape pro- + vides a way of specifying character code points as octal numbers + greater than 0777, and it also allows octal numbers and backreferences + to be unambiguously distinguished. + + If braces are not used, after \0 up to two further octal digits are + read. However, if the PCRE2_EXTRA_NO_BS0 option is set, at least one + more octal digit must follow \0 (use \00 to generate a NUL character). + Make sure you supply two digits after the initial zero if the pattern + character that follows is itself an octal digit. + + Inside a character class, when a backslash is followed by any octal + digit, up to three octal digits are read to generate a code point. Any + subsequent digits stand for themselves. The sequences \8 and \9 are + treated as the literal characters "8" and "9". + + Outside a character class, Perl's handling of a backslash followed by a + digit other than 0 is complicated by ambiguity, and Perl has changed + over time, causing PCRE2 also to change. From PCRE2 release 10.45 there + is an option called PCRE2_EXTRA_PYTHON_OCTAL that causes PCRE2 to use + Python's unambiguous rules. The next two subsections describe the two + sets of rules. + + For greater clarity and unambiguity, it is best to avoid following \ by + a digit greater than zero. Instead, use \o{...} or \x{...} to specify + numerical character code points, and \g{...} to specify backreferences. + + Perl rules for non-class backslash 1-9 + + All the digits that follow the backslash are read as a decimal number. + If the number is less than 10, begins with the digit 8 or 9, or if + there are at least that many previous capture groups in the expression, + the entire sequence is taken as a back reference. Otherwise, up to + three octal digits are read to form a character code. For example: + + \040 is another way of writing an ASCII space + \40 is the same, provided there are fewer than 40 + previous capture groups + \7 is always a backreference + \11 might be a backreference, or another way of + writing a tab + \011 is always a tab + \0113 is a tab followed by the character "3" + \113 might be a backreference, otherwise the + character with octal code 113 + \377 might be a backreference, otherwise + the value 255 (decimal) + \81 is always a backreference + + Note that octal values of 100 or greater that are specified using this + syntax must not be introduced by a leading zero, because no more than + three octal digits are ever read. + + Python rules for non_class backslash 1-9 + + If there are at least three octal digits after the backslash, exactly + three are read as an octal code point number, but the value must be no + greater than \377, even in modes where higher code point values are + supported. Any subsequent digits stand for themselves. If there are + fewer than three octal digits, the sequence is taken as a decimal back + reference. Thus, for example, \12 is always a back reference, indepen- + dent of how many captures there are in the pattern. An error is gener- + ated for a reference to a non-existent capturing group. + + Constraints on character values + + Characters that are specified using octal or hexadecimal numbers are + limited to certain values, as follows: + + 8-bit non-UTF mode no greater than 0xff + 16-bit non-UTF mode no greater than 0xffff + 32-bit non-UTF mode no greater than 0xffffffff + All UTF modes no greater than 0x10ffff and a valid code point + + Invalid Unicode code points are all those in the range 0xd800 to 0xdfff + (the so-called "surrogate" code points). The check for these can be + disabled by the caller of pcre2_compile() by setting the option + PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES. However, this is possible only in + UTF-8 and UTF-32 modes, because these values are not representable in + UTF-16. + + Escape sequences in character classes + + All the sequences that define a single character value can be used both + inside and outside character classes. In addition, inside a character + class, \b is interpreted as the backspace character (hex 08). + + When not followed by an opening brace, \N is not allowed in a character + class. \B, \R, and \X are not special inside a character class. Like + other unrecognized alphabetic escape sequences, they cause an error. + Outside a character class, these sequences have different meanings. + + Unsupported escape sequences + + In Perl, the sequences \F, \l, \L, \u, and \U are recognized by its + string handler and used to modify the case of following characters. By + default, PCRE2 does not support these escape sequences in patterns. + However, if either of the PCRE2_ALT_BSUX or PCRE2_EXTRA_ALT_BSUX op- + tions is set, \U matches a "U" character, and \u can be used to define + a character by code point, as described above. + + Absolute and relative backreferences + + The sequence \g followed by a signed or unsigned number, optionally en- + closed in braces, is an absolute or relative backreference. A named + backreference can be coded as \g{name}. Backreferences are discussed + later, following the discussion of parenthesized groups. + + Absolute and relative subroutine calls + + For compatibility with Oniguruma, the non-Perl syntax \g followed by a + name or a number enclosed either in angle brackets or single quotes, is + an alternative syntax for referencing a capture group as a subroutine. + Details are discussed later. Note that \g{...} (Perl syntax) and + \g<...> (Oniguruma syntax) are not synonymous. The former is a backref- + erence; the latter is a subroutine call. + + Generic character types + + Another use of backslash is for specifying generic character types: + + \d any decimal digit + \D any character that is not a decimal digit + \h any horizontal white space character + \H any character that is not a horizontal white space character + \N any character that is not a newline + \s any white space character + \S any character that is not a white space character + \v any vertical white space character + \V any character that is not a vertical white space character + \w any "word" character + \W any "non-word" character + + The \N escape sequence has the same meaning as the "." metacharacter + when PCRE2_DOTALL is not set, but setting PCRE2_DOTALL does not change + the meaning of \N. Note that when \N is followed by an opening brace it + has a different meaning. See the section entitled "Non-printing charac- + ters" above for details. Perl also uses \N{name} to specify characters + by Unicode name; PCRE2 does not support this. + + Each pair of lower and upper case escape sequences partitions the com- + plete set of characters into two disjoint sets. Any given character + matches one, and only one, of each pair. The sequences can appear both + inside and outside character classes. They each match one character of + the appropriate type. If the current matching point is at the end of + the subject string, all of them fail, because there is no character to + match. + + The default \s characters are HT (9), LF (10), VT (11), FF (12), CR + (13), and space (32), which are defined as white space in the "C" lo- + cale. This list may vary if locale-specific matching is taking place. + For example, in some locales the "non-breaking space" character (\xA0) + is recognized as white space, and in others the VT character is not. + + A "word" character is an underscore or any character that is a letter + or digit. By default, the definition of letters and digits is con- + trolled by PCRE2's low-valued character tables, and may vary if locale- + specific matching is taking place (see "Locale support" in the pcre2api + page). For example, in a French locale such as "fr_FR" in Unix-like + systems, or "french" in Windows, some character codes greater than 127 + are used for accented letters, and these are then matched by \w. The + use of locales with Unicode is discouraged. + + By default, characters whose code points are greater than 127 never + match \d, \s, or \w, and always match \D, \S, and \W, although this may + be different for characters in the range 128-255 when locale-specific + matching is happening. These escape sequences retain their original + meanings from before Unicode support was available, mainly for effi- + ciency reasons. If the PCRE2_UCP option is set, the behaviour is + changed so that Unicode properties are used to determine character + types, as follows: + + \d any character that matches \p{Nd} (decimal digit) + \s any character that matches \p{Z} or \h or \v + \w any character that matches \p{L}, \p{N}, \p{Mn}, or \p{Pc} + + The addition of \p{Mn} (non-spacing mark) and the replacement of an ex- + plicit test for underscore with a test for \p{Pc} (connector punctua- + tion) happened in PCRE2 release 10.43. This brings PCRE2 into line with + Perl. + + The upper case escapes match the inverse sets of characters. Note that + \d matches only decimal digits, whereas \w matches any Unicode digit, + as well as other character categories. Note also that PCRE2_UCP affects + \b, and \B because they are defined in terms of \w and \W. Matching + these sequences is noticeably slower when PCRE2_UCP is set. + + The effect of PCRE2_UCP on any one of these escape sequences can be + negated by the options PCRE2_EXTRA_ASCII_BSD, PCRE2_EXTRA_ASCII_BSS, + and PCRE2_EXTRA_ASCII_BSW, respectively. These options can be set and + reset within a pattern by means of an internal option setting (see be- + low). + + The sequences \h, \H, \v, and \V, in contrast to the other sequences, + which match only ASCII characters by default, always match a specific + list of code points, whether or not PCRE2_UCP is set. The horizontal + space characters are: + + U+0009 Horizontal tab (HT) + U+0020 Space + U+00A0 Non-break space + U+1680 Ogham space mark + U+180E Mongolian vowel separator + U+2000 En quad + U+2001 Em quad + U+2002 En space + U+2003 Em space + U+2004 Three-per-em space + U+2005 Four-per-em space + U+2006 Six-per-em space + U+2007 Figure space + U+2008 Punctuation space + U+2009 Thin space + U+200A Hair space + U+202F Narrow no-break space + U+205F Medium mathematical space + U+3000 Ideographic space + + The vertical space characters are: + + U+000A Linefeed (LF) + U+000B Vertical tab (VT) + U+000C Form feed (FF) + U+000D Carriage return (CR) + U+0085 Next line (NEL) + U+2028 Line separator + U+2029 Paragraph separator + + In 8-bit, non-UTF-8 mode, only the characters with code points less + than 256 are relevant. + + Newline sequences + + Outside a character class, by default, the escape sequence \R matches + any Unicode newline sequence. In 8-bit non-UTF-8 mode \R is equivalent + to the following: + + (?>\r\n|\n|\x0b|\f|\r|\x85) + + This is an example of an "atomic group", details of which are given be- + low. This particular group matches either the two-character sequence + CR followed by LF, or one of the single characters LF (linefeed, + U+000A), VT (vertical tab, U+000B), FF (form feed, U+000C), CR (car- + riage return, U+000D), or NEL (next line, U+0085). Because this is an + atomic group, the two-character sequence is treated as a single unit + that cannot be split. + + In other modes, two additional characters whose code points are greater + than 255 are added: LS (line separator, U+2028) and PS (paragraph sepa- + rator, U+2029). Unicode support is not needed for these characters to + be recognized. + + It is possible to restrict \R to match only CR, LF, or CRLF (instead of + the complete set of Unicode line endings) by setting the option + PCRE2_BSR_ANYCRLF at compile time. (BSR is an abbreviation for "back- + slash R".) This can be made the default when PCRE2 is built; if this is + the case, the other behaviour can be requested via the PCRE2_BSR_UNI- + CODE option. It is also possible to specify these settings by starting + a pattern string with one of the following sequences: + + (*BSR_ANYCRLF) CR, LF, or CRLF only + (*BSR_UNICODE) any Unicode newline sequence + + These override the default and the options given to the compiling func- + tion. Note that these special settings, which are not Perl-compatible, + are recognized only at the very start of a pattern, and that they must + be in upper case. If more than one of them is present, the last one is + used. They can be combined with a change of newline convention; for ex- + ample, a pattern can start with: + + (*ANY)(*BSR_ANYCRLF) + + They can also be combined with the (*UTF) or (*UCP) special sequences. + Inside a character class, \R is treated as an unrecognized escape se- + quence, and causes an error. + + Unicode character properties + + When PCRE2 is built with Unicode support (the default), three addi- + tional escape sequences that match characters with specific properties + are available. They can be used in any mode, though in 8-bit and 16-bit + non-UTF modes these sequences are of course limited to testing charac- + ters whose code points are less than U+0100 or U+10000, respectively. + In 32-bit non-UTF mode, code points greater than 0x10ffff (the Unicode + limit) may be encountered. These are all treated as being in the Un- + known script and with an unassigned type. + + Matching characters by Unicode property is not fast, because PCRE2 has + to do a multistage table lookup in order to find a character's prop- + erty. That is why the traditional escape sequences such as \d and \w do + not use Unicode properties in PCRE2 by default, though you can make + them do so by setting the PCRE2_UCP option or by starting the pattern + with (*UCP). + + The extra escape sequences that provide property support are: + + \p{xx} a character with the xx property + \P{xx} a character without the xx property + \X a Unicode extended grapheme cluster + + For compatibility with Perl, negation can be specified by including a + circumflex between the opening brace and the property. For example, + \p{^Lu} is the same as \P{Lu}. + + In accordance with Unicode's "loose matching" rules, ASCII white space + characters, hyphens, and underscores are ignored in the properties rep- + resented by xx above. As well as the space character, ASCII white space + can be tab, linefeed, vertical tab, formfeed, or carriage return. + + Some properties are specified as a name only; others as a name and a + value, separated by a colon or an equals sign. The names and values + consist of ASCII letters and digits (with one Perl-specific exception, + see below). They are not case sensitive. Note, however, that the es- + capes themselves, \p and \P, are case sensitive. There are abbrevia- + tions for many names. The following examples are all equivalent: + + \p{bidiclass=al} + \p{BC=al} + \p{ Bidi_Class : AL } + \p{ Bi-di class = Al } + \P{ ^ Bi-di class = Al } + + There is support for Unicode script names, Unicode general category + properties, "Any", which matches any character (including newline), + Bidi_Class, a number of binary (yes/no) properties, and some special + PCRE2 properties (described below). Certain other Perl properties such + as "InMusicalSymbols" are not supported by PCRE2. Note that \P{Any} + does not match any characters, so always causes a match failure. + + Script properties for \p and \P + + There are three different syntax forms for matching a script. Each Uni- + code character has a basic script and, optionally, a list of other + scripts ("Script Extensions") with which it is commonly used. Using the + Adlam script as an example, \p{sc:Adlam} matches characters whose basic + script is Adlam, whereas \p{scx:Adlam} matches, in addition, characters + that have Adlam in their extensions list. The full names "script" and + "script extensions" for the property types are recognized and, as for + all property specifications, an equals sign is an alternative to the + colon. If a script name is given without a property type, for example, + \p{Adlam}, it is treated as \p{scx:Adlam}. Perl changed to this inter- + pretation at release 5.26 and PCRE2 changed at release 10.40. + + Unassigned characters (and in non-UTF 32-bit mode, characters with code + points greater than 0x10FFFF) are assigned the "Unknown" script. Others + that are not part of an identified script are lumped together as "Com- + mon". The current list of recognized script names and their 4-character + abbreviations can be obtained by running this command: + + pcre2test -LS + + + The general category property for \p and \P + + Each character has exactly one Unicode general category property, spec- + ified by a two-letter abbreviation. If only one letter is specified + with \p or \P, it includes all the general category properties that + start with that letter. In this case, in the absence of negation, the + curly brackets in the escape sequence are optional; these two examples + have the same effect: + + \p{L} + \pL + + The following general category property codes are supported: + + C Other + Cc Control + Cf Format + Cn Unassigned + Co Private use + Cs Surrogate + + L Letter + Lc Cased letter + Ll Lower case letter + Lm Modifier letter + Lo Other letter + Lt Title case letter + Lu Upper case letter + + M Mark + Mc Spacing mark + Me Enclosing mark + Mn Non-spacing mark + + N Number + Nd Decimal number + Nl Letter number + No Other number + + P Punctuation + Pc Connector punctuation + Pd Dash punctuation + Pe Close punctuation + Pf Final punctuation + Pi Initial punctuation + Po Other punctuation + Ps Open punctuation + + S Symbol + Sc Currency symbol + Sk Modifier symbol + Sm Mathematical symbol + So Other symbol + + Z Separator + Zl Line separator + Zp Paragraph separator + Zs Space separator + + Perl originally used the name L& for the Lc property. This is still + supported by Perl, but discouraged. PCRE2 also still supports it. This + property matches any character that has the Lu, Ll, or Lt property, in + other words, any letter that is not classified as a modifier or + "other". From release 10.45 of PCRE2 the properties Lu, Ll, and Lt are + all treated as Lc when case-independent matching is set by the + PCRE2_CASELESS option or (?i) within the pattern. The other properties + are not affected by caseless matching. + + The Cs (Surrogate) property applies only to characters whose code + points are in the range U+D800 to U+DFFF. These characters are no dif- + ferent to any other character when PCRE2 is not in UTF mode (using the + 16-bit or 32-bit library). However, they are not valid in Unicode + strings and so cannot be tested by PCRE2 in UTF mode, unless UTF valid- + ity checking has been turned off (see the discussion of + PCRE2_NO_UTF_CHECK in the pcre2api page). + + The long synonyms for property names that Perl supports (such as + \p{Letter}) are not supported by PCRE2, nor is it permitted to prefix + any of these properties with "Is". + + No character that is in the Unicode table has the Cn (unassigned) prop- + erty. Instead, this property is assumed for any code point that is not + in the Unicode table. + + Binary (yes/no) properties for \p and \P + + Unicode defines a number of binary properties, that is, properties + whose only values are true or false. You can obtain a list of those + that are recognized by \p and \P, along with their abbreviations, by + running this command: + + pcre2test -LP + + + The Bidi_Class property for \p and \P + + \p{Bidi_Class:} matches a character with the given class + \p{BC:} matches a character with the given class + + The recognized classes are: + + AL Arabic letter + AN Arabic number + B paragraph separator + BN boundary neutral + CS common separator + EN European number + ES European separator + ET European terminator + FSI first strong isolate + L left-to-right + LRE left-to-right embedding + LRI left-to-right isolate + LRO left-to-right override + NSM non-spacing mark + ON other neutral + PDF pop directional format + PDI pop directional isolate + R right-to-left + RLE right-to-left embedding + RLI right-to-left isolate + RLO right-to-left override + S segment separator + WS white space + + As in all property specifications, an equals sign may be used instead + of a colon and the class names are case-insensitive. Only the short + names listed above are recognized; PCRE2 does not at present support + any long alternatives. + + Extended grapheme clusters + + The \X escape matches any number of Unicode characters that form an + "extended grapheme cluster", and treats the sequence as an atomic group + (see below). Unicode supports various kinds of composite character by + giving each character a grapheme breaking property, and having rules + that use these properties to define the boundaries of extended grapheme + clusters. The rules are defined in Unicode Standard Annex 29, "Unicode + Text Segmentation". Unicode 11.0.0 abandoned the use of some previous + properties that had been used for emojis. Instead it introduced vari- + ous emoji-specific properties. PCRE2 uses only the Extended Picto- + graphic property. + + \X always matches at least one character. Then it decides whether to + add additional characters according to the following rules for ending a + cluster: + + 1. End at the end of the subject string. + + 2. Do not end between CR and LF; otherwise end after any control char- + acter. + + 3. Do not break Hangul (a Korean script) syllable sequences. Hangul + characters are of five types: L, V, T, LV, and LVT. An L character may + be followed by an L, V, LV, or LVT character; an LV or V character may + be followed by a V or T character; an LVT or T character may be fol- + lowed only by a T character. + + 4. Do not end before extending characters or spacing marks or the zero- + width joiner (ZWJ) character. Characters with the "mark" property al- + ways have the "extend" grapheme breaking property. + + 5. Do not end after prepend characters. + + 6. Do not end within emoji modifier sequences or emoji ZWJ (zero-width + joiner) sequences. An emoji ZWJ sequence consists of a character with + the Extended_Pictographic property, optionally followed by one or more + characters with the Extend property, followed by the ZWJ character, + followed by another Extended_Pictographic character. + + 7. Do not break within emoji flag sequences. That is, do not break be- + tween regional indicator (RI) characters if there are an odd number of + RI characters before the break point. + + 8. Otherwise, end the cluster. + + PCRE2's additional properties + + As well as the standard Unicode properties described above, PCRE2 sup- + ports four more that make it possible to convert traditional escape se- + quences such as \w and \s to use Unicode properties. PCRE2 uses these + non-standard, non-Perl properties internally when PCRE2_UCP is set. + However, they may also be used explicitly. These properties are: + + Xan Any alphanumeric character + Xps Any POSIX space character + Xsp Any Perl space character + Xwd Any Perl "word" character + + Xan matches characters that have either the L (letter) or the N (num- + ber) property. Xps matches the characters tab, linefeed, vertical tab, + form feed, or carriage return, and any other character that has the Z + (separator) property (this includes the space character). Xsp is the + same as Xps; in PCRE1 it used to exclude vertical tab, for Perl compat- + ibility, but Perl changed. Xwd matches the same characters as Xan, plus + those that match Mn (non-spacing mark) or Pc (connector punctuation, + which includes underscore). + + There is another non-standard property, Xuc, which matches any charac- + ter that can be represented by a Universal Character Name in C++ and + other programming languages. These are the characters $, @, ` (grave + accent), and all characters with Unicode code points greater than or + equal to U+00A0, except for the surrogates U+D800 to U+DFFF. Note that + most base (ASCII) characters are excluded. (Universal Character Names + are of the form \uHHHH or \UHHHHHHHH where H is a hexadecimal digit. + Note that the Xuc property does not match these sequences but the char- + acters that they represent.) + + Resetting the match start + + In normal use, the escape sequence \K causes any previously matched + characters not to be included in the final matched sequence that is re- + turned. For example, the pattern: + + foo\Kbar + + matches "foobar", but reports that it has matched "bar". \K does not + interact with anchoring in any way. The pattern: + + ^foo\Kbar + + matches only when the subject begins with "foobar" (in single line + mode), though it again reports the matched string as "bar". This fea- + ture is similar to a lookbehind assertion (described below), but the + part of the pattern that precedes \K is not constrained to match a lim- + ited number of characters, as is required for a lookbehind assertion. + The use of \K does not interfere with the setting of captured sub- + strings. For example, when the pattern + + (foo)\Kbar + + matches "foobar", the first substring is still set to "foo". + + From version 5.32.0 Perl forbids the use of \K in lookaround asser- + tions. From release 10.38 PCRE2 also forbids this by default. However, + the PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK option can be used when calling + pcre2_compile() to re-enable the previous behaviour. When this option + is set, \K is acted upon when it occurs inside positive assertions, but + is ignored in negative assertions. Note that when a pattern such as + (?=ab\K) matches, the reported start of the match can be greater than + the end of the match. Using \K in a lookbehind assertion at the start + of a pattern can also lead to odd effects. For example, consider this + pattern: + + (?<=\Kfoo)bar + + If the subject is "foobar", a call to pcre2_match() with a starting + offset of 3 succeeds and reports the matching string as "foobar", that + is, the start of the reported match is earlier than where the match + started. + + Simple assertions + + The final use of backslash is for certain simple assertions. An asser- + tion specifies a condition that has to be met at a particular point in + a match, without consuming any characters from the subject string. The + use of groups for more complicated assertions is described below. The + backslashed assertions are: + + \b matches at a word boundary + \B matches when not at a word boundary + \A matches at the start of the subject + \Z matches at the end of the subject + also matches before a newline at the end of the subject + \z matches only at the end of the subject + \G matches at the first matching position in the subject + + Inside a character class, \b has a different meaning; it matches the + backspace character. If any other of these assertions appears in a + character class, an "invalid escape sequence" error is generated. + + A word boundary is a position in the subject string where the current + character and the previous character do not both match \w or \W (i.e. + one matches \w and the other matches \W), or the start or end of the + string if the first or last character matches \w, respectively. When + PCRE2 is built with Unicode support, the meanings of \w and \W can be + changed by setting the PCRE2_UCP option. When this is done, it also af- + fects \b and \B. Neither PCRE2 nor Perl has a separate "start of word" + or "end of word" metasequence. However, whatever follows \b normally + determines which it is. For example, the fragment \ba matches "a" at + the start of a word. + + The \A, \Z, and \z assertions differ from the traditional circumflex + and dollar (described in the next section) in that they only ever match + at the very start and end of the subject string, whatever options are + set. Thus, they are independent of multiline mode. These three asser- + tions are not affected by the PCRE2_NOTBOL or PCRE2_NOTEOL options, + which affect only the behaviour of the circumflex and dollar metachar- + acters. However, if the startoffset argument of pcre2_match() is non- + zero, indicating that matching is to start at a point other than the + beginning of the subject, \A can never match. The difference between + \Z and \z is that \Z matches before a newline at the end of the string + as well as at the very end, whereas \z matches only at the end. + + The \G assertion is true only when the current matching position is at + the start point of the matching process, as specified by the startoff- + set argument of pcre2_match(). It differs from \A when the value of + startoffset is non-zero. By calling pcre2_match() multiple times with + appropriate arguments, you can mimic Perl's /g option, and it is in + this kind of implementation where \G can be useful. + + Note, however, that PCRE2's implementation of \G, being true at the + starting character of the matching process, is subtly different from + Perl's, which defines it as true at the end of the previous match. In + Perl, these can be different when the previously matched string was + empty. Because PCRE2 does just one match at a time, it cannot reproduce + this behaviour. + + If all the alternatives of a pattern begin with \G, the expression is + anchored to the starting match position, and the "anchored" flag is set + in the compiled regular expression. + + +CIRCUMFLEX AND DOLLAR + + The circumflex and dollar metacharacters are zero-width assertions. + That is, they test for a particular condition being true without con- + suming any characters from the subject string. These two metacharacters + are concerned with matching the starts and ends of lines. If the new- + line convention is set so that only the two-character sequence CRLF is + recognized as a newline, isolated CR and LF characters are treated as + ordinary data characters, and are not recognized as newlines. + + Outside a character class, in the default matching mode, the circumflex + character is an assertion that is true only if the current matching + point is at the start of the subject string. If the startoffset argu- + ment of pcre2_match() is non-zero, or if PCRE2_NOTBOL is set, circum- + flex can never match if the PCRE2_MULTILINE option is unset. Inside a + character class, circumflex has an entirely different meaning (see be- + low). + + Circumflex need not be the first character of the pattern if a number + of alternatives are involved, but it should be the first thing in each + alternative in which it appears if the pattern is ever to match that + branch. If all possible alternatives start with a circumflex, that is, + if the pattern is constrained to match only at the start of the sub- + ject, it is said to be an "anchored" pattern. (There are also other + constructs that can cause a pattern to be anchored.) + + The dollar character is an assertion that is true only if the current + matching point is at the end of the subject string, or immediately be- + fore a newline at the end of the string (by default), unless PCRE2_NO- + TEOL is set. Note, however, that it does not actually match the new- + line. Dollar need not be the last character of the pattern if a number + of alternatives are involved, but it should be the last item in any + branch in which it appears. Dollar has no special meaning in a charac- + ter class. + + The meaning of dollar can be changed so that it matches only at the + very end of the string, by setting the PCRE2_DOLLAR_ENDONLY option at + compile time. This does not affect the \Z assertion. + + The meanings of the circumflex and dollar metacharacters are changed if + the PCRE2_MULTILINE option is set. When this is the case, a dollar + character matches before any newlines in the string, as well as at the + very end, and a circumflex matches immediately after internal newlines + as well as at the start of the subject string. It does not match after + a newline that ends the string, for compatibility with Perl. However, + this can be changed by setting the PCRE2_ALT_CIRCUMFLEX option. + + For example, the pattern /^abc$/ matches the subject string "def\nabc" + (where \n represents a newline) in multiline mode, but not otherwise. + Consequently, patterns that are anchored in single line mode because + all branches start with ^ are not anchored in multiline mode, and a + match for circumflex is possible when the startoffset argument of + pcre2_match() is non-zero. The PCRE2_DOLLAR_ENDONLY option is ignored + if PCRE2_MULTILINE is set. + + When the newline convention (see "Newline conventions" below) recog- + nizes the two-character sequence CRLF as a newline, this is preferred, + even if the single characters CR and LF are also recognized as new- + lines. For example, if the newline convention is "any", a multiline + mode circumflex matches before "xyz" in the string "abc\r\nxyz" rather + than after CR, even though CR on its own is a valid newline. (It also + matches at the very start of the string, of course.) + + Note that the sequences \A, \Z, and \z can be used to match the start + and end of the subject in both modes, and if all branches of a pattern + start with \A it is always anchored, whether or not PCRE2_MULTILINE is + set. + + +FULL STOP (PERIOD, DOT) AND \N + + Outside a character class, a dot in the pattern matches any one charac- + ter in the subject string except (by default) a character that signi- + fies the end of a line. One or more characters may be specified as line + terminators (see "Newline conventions" above). + + Dot never matches a single line-ending character. When the two-charac- + ter sequence CRLF is the only line ending, dot does not match CR if it + is immediately followed by LF, but otherwise it matches all characters + (including isolated CRs and LFs). When ANYCRLF is selected for line + endings, no occurrences of CR of LF match dot. When all Unicode line + endings are being recognized, dot does not match CR or LF or any of the + other line ending characters. + + The behaviour of dot with regard to newlines can be changed. If the + PCRE2_DOTALL option is set, a dot matches any one character, without + exception. If the two-character sequence CRLF is present in the sub- + ject string, it takes two dots to match it. + + The handling of dot is entirely independent of the handling of circum- + flex and dollar, the only relationship being that they both involve + newlines. Dot has no special meaning in a character class. + + The escape sequence \N when not followed by an opening brace behaves + like a dot, except that it is not affected by the PCRE2_DOTALL option. + In other words, it matches any character except one that signifies the + end of a line. + + When \N is followed by an opening brace it has a different meaning. See + the section entitled "Non-printing characters" above for details. Perl + also uses \N{name} to specify characters by Unicode name; PCRE2 does + not support this. + + +MATCHING A SINGLE CODE UNIT + + Outside a character class, the escape sequence \C matches any one code + unit, whether or not a UTF mode is set. In the 8-bit library, one code + unit is one byte; in the 16-bit library it is a 16-bit unit; in the + 32-bit library it is a 32-bit unit. Unlike a dot, \C always matches + line-ending characters. The feature is provided in Perl in order to + match individual bytes in UTF-8 mode, but it is unclear how it can use- + fully be used. + + Because \C breaks up characters into individual code units, matching + one unit with \C in UTF-8 or UTF-16 mode means that the rest of the + string may start with a malformed UTF character. This has undefined re- + sults, because PCRE2 assumes that it is matching character by character + in a valid UTF string (by default it checks the subject string's valid- + ity at the start of processing unless the PCRE2_NO_UTF_CHECK or + PCRE2_MATCH_INVALID_UTF option is used). + + An application can lock out the use of \C by setting the + PCRE2_NEVER_BACKSLASH_C option when compiling a pattern. It is also + possible to build PCRE2 with the use of \C permanently disabled. + + PCRE2 does not allow \C to appear in lookbehind assertions (described + below) in UTF-8 or UTF-16 modes, because this would make it impossible + to calculate the length of the lookbehind. Neither the alternative + matching function pcre2_dfa_match() nor the JIT optimizer support \C in + these UTF modes. The former gives a match-time error; the latter fails + to optimize and so the match is always run using the interpreter. + + In the 32-bit library, however, \C is always supported (when not ex- + plicitly locked out) because it always matches a single code unit, + whether or not UTF-32 is specified. + + In general, the \C escape sequence is best avoided. However, one way of + using it that avoids the problem of malformed UTF-8 or UTF-16 charac- + ters is to use a lookahead to check the length of the next character, + as in this pattern, which could be used with a UTF-8 string (ignore + white space and line breaks): + + (?| (?=[\x00-\x7f])(\C) | + (?=[\x80-\x{7ff}])(\C)(\C) | + (?=[\x{800}-\x{ffff}])(\C)(\C)(\C) | + (?=[\x{10000}-\x{1fffff}])(\C)(\C)(\C)(\C)) + + In this example, a group that starts with (?| resets the capturing + parentheses numbers in each alternative (see "Duplicate Group Numbers" + below). The assertions at the start of each branch check the next UTF-8 + character for values whose encoding uses 1, 2, 3, or 4 bytes, respec- + tively. The character's individual bytes are then captured by the ap- + propriate number of \C groups. + + +SQUARE BRACKETS AND CHARACTER CLASSES + + An opening square bracket introduces a character class, terminated by a + closing square bracket. A closing square bracket on its own is not spe- + cial by default. If a closing square bracket is required as a member + of the class, it should be the first data character in the class (after + an initial circumflex, if present) or escaped with a backslash. This + means that, by default, an empty class cannot be defined. However, if + the PCRE2_ALLOW_EMPTY_CLASS option is set, a closing square bracket at + the start does end the (empty) class. + + A character class matches a single character in the subject. A matched + character must be in the set of characters defined by the class, unless + the first character in the class definition is a circumflex, in which + case the subject character must not be in the set defined by the class. + If a circumflex is actually required as a member of the class, ensure + it is not the first character, or escape it with a backslash. + + For example, the character class [aeiou] matches any lower case English + vowel, whereas [^aeiou] matches all other characters. Note that a cir- + cumflex is just a convenient notation for specifying the characters + that are in the class by enumerating those that are not. A class that + starts with a circumflex is not an assertion; it still consumes a char- + acter from the subject string, and therefore it fails to match if the + current pointer is at the end of the string. + + Characters in a class may be specified by their code points using \o, + \x, or \N{U+hh..} in the usual way. When caseless matching is set, any + letters in a class represent both their upper case and lower case ver- + sions, so for example, a caseless [aeiou] matches "A" as well as "a", + and a caseless [^aeiou] does not match "A", whereas a caseful version + would. Note that there are two ASCII characters, K and S, that, in ad- + dition to their lower case ASCII equivalents, are case-equivalent with + Unicode U+212A (Kelvin sign) and U+017F (long S) respectively when ei- + ther PCRE2_UTF or PCRE2_UCP is set. If you do not want these ASCII/non- + ASCII case equivalences, you can suppress them by setting PCRE2_EX- + TRA_CASELESS_RESTRICT, either as an option in a compile context, or by + including (*CASELESS_RESTRICT) or (?r) within a pattern. + + Characters that might indicate line breaks are never treated in any + special way when matching character classes, whatever line-ending se- + quence is in use, and whatever setting of the PCRE2_DOTALL and + PCRE2_MULTILINE options is used. A class such as [^a] always matches + one of these characters. + + The generic character type escape sequences \d, \D, \h, \H, \p, \P, \s, + \S, \v, \V, \w, and \W may appear in a character class, and add the + characters that they match to the class. For example, [\dABCDEF] + matches any hexadecimal digit. In UTF modes, the PCRE2_UCP option af- + fects the meanings of \d, \s, \w and their upper case partners, just as + it does when they appear outside a character class, as described in the + section entitled "Generic character types" above. The escape sequence + \b has a different meaning inside a character class; it matches the + backspace character. The sequences \B, \R, and \X are not special in- + side a character class. Like any other unrecognized escape sequences, + they cause an error. The same is true for \N when not followed by an + opening brace. + + The minus (hyphen) character can be used to specify a range of charac- + ters in a character class. For example, [d-m] matches any letter be- + tween d and m, inclusive. If a minus character is required in a class, + it must be escaped with a backslash or appear in a position where it + cannot be interpreted as indicating a range, typically as the first or + last character in the class, or immediately after a range. For example, + [b-d-z] matches letters in the range b to d, a hyphen character, or z. + + There is some special treatment for alphabetic ranges in EBCDIC envi- + ronments; see the section "EBCDIC environments" below. + + Perl treats a hyphen as a literal if it appears before or after a POSIX + class (see below) or before or after a character type escape such as \d + or \H. However, unless the hyphen is the last character in the class, + Perl outputs a warning in its warning mode, as this is most likely a + user error. As PCRE2 has no facility for warning, an error is given in + these cases. + + It is not possible to have the literal character "]" as the end charac- + ter of a range. A pattern such as [W-]46] is interpreted as a class of + two characters ("W" and "-") followed by a literal string "46]", so it + would match "W46]" or "-46]". However, if the "]" is escaped with a + backslash it is interpreted as the end of a range, so [W-\]46] is in- + terpreted as a class containing a range and two other characters. The + octal or hexadecimal representation of "]" can also be used to end a + range. + + Ranges normally include all code points between the start and end char- + acters, inclusive. They can also be used for code points specified nu- + merically, for example [\000-\037]. Ranges can include any characters + that are valid for the current mode. In any UTF mode, the so-called + "surrogate" characters (those whose code points lie between 0xd800 and + 0xdfff inclusive) may not be specified explicitly by default (the + PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES option disables this check). How- + ever, ranges such as [\x{d7ff}-\x{e000}], which include the surrogates, + are always permitted. + + If a range that includes letters is used when caseless matching is set, + it matches the letters in either case. For example, [W-c] is equivalent + to [][\\^_`wxyzabc], matched caselessly, and in a non-UTF mode, if + character tables for a French locale are in use, [\xc8-\xcb] matches + accented E characters in both cases. + + A circumflex can conveniently be used with the upper case character + types to specify a more restricted set of characters than the matching + lower case type. For example, the class [^\W_] matches any letter or + digit, but not underscore, whereas [\w] includes underscore. A positive + character class should be read as "something OR something OR ..." and a + negative class as "NOT something AND NOT something AND NOT ...". + + The metacharacters that are recognized in character classes are back- + slash, hyphen (when it can be interpreted as specifying a range), cir- + cumflex (only at the start), and the terminating closing square + bracket. An opening square bracket is also special when it can be in- + terpreted as introducing a POSIX class (see "Posix character classes" + below), or a special compatibility feature (see "Compatibility feature + for word boundaries" below. Escaping any non-alphanumeric character in + a class turns it into a literal, whether or not it would otherwise be a + metacharacter. + + +PERL EXTENDED CHARACTER CLASSES + + From release 10.45 PCRE2 supports Perl's (?[...]) extended character + class syntax. This can be used to perform set operations such as inter- + section on character classes. + + The syntax permitted within (?[...]) is quite different to ordinary + character classes. Inside the extended class, there is an expression + syntax consisting of "atoms", operators, and ordinary parentheses "()" + used for grouping. Such classes always have the Perl /xx modifier + (PCRE2 option PCRE2_EXTENDED_MORE) turned on within them. This means + that literal space and tab characters are ignored everywhere in the + class. + + The allowed atoms are individual characters specified by escape se- + quences such as \n or \x{123}, character types such as \d, POSIX + classes such as [:alpha:], and nested ordinary (non-extended) character + classes. For example, in (?[\d & [...]]) the nested class [...] follows + the usual rules for ordinary character classes, in which parentheses + are not metacharacters, and character literals and ranges are permit- + ted. + + Character literals and ranges may not appear outside a nested ordinary + character class because they are not atoms in the extended syntax. The + extended syntax does not introduce any additional escape sequences, so + (?[\y]) is an unknown escape, as it would be in [\y]. + + In the extended syntax, ^ does not negate a class (except within an or- + dinary class nested inside an extended class); it is instead a binary + operator. + + The binary operators are "&" (intersection), "|" or "+" (union), "-" + (subtraction) and "^" (symmetric difference). These are left-associa- + tive and "&" has higher (tighter) precedence, while the others have + equal lower precedence. The one prefix unary operator is "!" (comple- + ment), with highest precedence. + + +UTS#18 EXTENDED CHARACTER CLASSES + + The PCRE2_ALT_EXTENDED_CLASS option enables an alternative to Perl's + (?[...]) syntax, allowing instead extended class behaviour inside or- + dinary [...] character classes. This altered syntax for [...] classes + is loosely described by the Unicode standard UTS#18. The PCRE2_ALT_EX- + TENDED_CLASS option does not prevent use of (?[...]) classes; it just + changes the meaning of all [...] classes that are not nested inside a + Perl (?[...]) class. + + Firstly, in ordinary Perl [...] syntax, an expression such as "[a[]" is + a character class with two literal characters "a" and "[", but in + UTS#18 extended classes the "[" character becomes an additional + metacharacter within classes, denoting the start of a nested class, so + a literal "[" must be escaped as "\[". + + Secondly, within the UTS#18 extended syntax, there are operators "||", + "&&", "--" and "~~" which denote character class union, intersection, + subtraction, and symmetric difference respectively. In standard Perl + syntax, these would simply be needlessly-repeated literals (except for + "--" which could be the start or end of a range). In UTS#18 extended + classes these operators can be used in constructs such as [\p{L}--[QW]] + for "Unicode letters, other than Q and W". A literal "-" at the start + or end of a range must be escaped, so while "[--1]" in Perl syntax is + the range from hyphen to "1", it must be escaped as "[\--1]" in UTS#18 + extended classes. + + Unlike Perl's (?[...]) extended classes, the PCRE2_EXTENDED_MORE option + to ignore space and tab characters is not automatically enabled for + UTS#18 extended classes, but it is honoured if set. + + Extended UTS#18 classes can be nested, and nested classes are them- + selves extended classes (unlike Perl, where nested classes must be sim- + ple classes). For example, [\p{L}&&[\p{Thai}||\p{Greek}]] matches any + letter that is in the Thai or Greek scripts. Note that this means that + no special grouping characters (such as the parentheses used in Perl's + (?[...]) class syntax) are needed. + + Individual class items (literal characters, literal ranges, properties + such as \d or \p{...}, and nested classes) can be combined by juxtapo- + sition or by an operator. Juxtaposition is the implicit union operator, + and binds more tightly than any explicit operator. Thus a sequence of + literals and/or ranges behaves as if it is enclosed in square brackets. + For example, [A-Z0-9&&[^E8]] is the same as [[A-Z0-9]&&[^E8]], which + matches any upper case alphanumeric character except "E" or "8". + + Precedence between the explicit operators is not defined, so mixing op- + erators is a syntax error. For example, [A&&B--C] is an error, but + [A&&[B--C]] is valid. + + This is an emerging syntax which is being adopted gradually across the + regex ecosystem: for example JavaScript adopted the "/v" flag in EC- + MAScript 2024; Python's "re" module reserves the syntax for future use + with a FutureWarning for unescaped use of "[" as a literal within char- + acter classes. Due to UTS#18 providing insufficient guidance, engines + interpret the syntax differently. Rust's "regex" crate and Python's + "regex" PyPi module both implement UTS#18 extended classes, but with + slight incompatibilities ([A||B&&C] is parsed as [A||[B&&C]] in + Python's "regex" but as [[A||B]&&C] in Rust's "regex"). + + PCRE2's syntax adds syntax restrictions similar to ECMASCript's /v + flag, so that all the UTS#18 extended classes accepted as valid by + PCRE2 have the property that they are interpreted either with the same + behaviour, or as invalid, by all other major engines. Please file an + issue if you are aware of cross-engine differences in behaviour between + PCRE2 and another major engine. + + +POSIX CHARACTER CLASSES + + Perl supports the POSIX notation for character classes. This uses names + enclosed by [: and :] within the enclosing square brackets. PCRE2 also + supports this notation, in both ordinary and extended classes. For ex- + ample, + + [01[:alpha:]%] + + matches "0", "1", any alphabetic character, or "%". The supported class + names are: + + alnum letters and digits + alpha letters + ascii character codes 0 - 127 + blank space or tab only + cntrl control characters + digit decimal digits (same as \d) + graph printing characters, excluding space + lower lower case letters + print printing characters, including space + punct printing characters, excluding letters and digits and space + space white space (the same as \s from PCRE2 8.34) + upper upper case letters + word "word" characters (same as \w) + xdigit hexadecimal digits + + The default "space" characters are HT (9), LF (10), VT (11), FF (12), + CR (13), and space (32). If locale-specific matching is taking place, + the list of space characters may be different; there may be fewer or + more of them. "Space" and \s match the same set of characters, as do + "word" and \w. + + The name "word" is a Perl extension, and "blank" is a GNU extension + from Perl 5.8. Another Perl extension is negation, which is indicated + by a ^ character after the colon. For example, + + [12[:^digit:]] + + matches "1", "2", or any non-digit. PCRE2 (and Perl) also recognize the + POSIX syntax [.ch.] and [=ch=] where "ch" is a "collating element", but + these are not supported, and an error is given if they are encountered. + + By default, characters with values greater than 127 do not match any of + the POSIX character classes, although this may be different for charac- + ters in the range 128-255 when locale-specific matching is happening. + However, in UCP mode, unless certain options are set (see below), some + of the classes are changed so that Unicode character properties are + used. This is achieved by replacing POSIX classes with other sequences, + as follows: + + [:alnum:] becomes \p{Xan} + [:alpha:] becomes \p{L} + [:blank:] becomes \h + [:cntrl:] becomes \p{Cc} + [:digit:] becomes \p{Nd} + [:lower:] becomes \p{Ll} + [:space:] becomes \p{Xps} + [:upper:] becomes \p{Lu} + [:word:] becomes \p{Xwd} + + Negated versions, such as [:^alpha:] use \P instead of \p. Four other + POSIX classes are handled specially in UCP mode: + + [:graph:] This matches characters that have glyphs that mark the page + when printed. In Unicode property terms, it matches all char- + acters with the L, M, N, P, S, or Cf properties, except for: + + U+061C Arabic Letter Mark + U+180E Mongolian Vowel Separator + U+2066 - U+2069 Various "isolate"s + + + [:print:] This matches the same characters as [:graph:] plus space + characters that are not controls, that is, characters with + the Zs property. + + [:punct:] This matches all characters that have the Unicode P (punctua- + tion) property, plus those characters with code points less + than 256 that have the S (Symbol) property. + + [:xdigit:] + In addition to the ASCII hexadecimal digits, this also + matches the "fullwidth" versions of those characters, whose + Unicode code points start at U+FF10. This is a change that + was made in PCRE2 release 10.43 for Perl compatibility. + + The other POSIX classes are unchanged by PCRE2_UCP, and match only + characters with code points less than 256. + + There are two options that can be used to restrict the POSIX classes to + ASCII characters when PCRE2_UCP is set. The option PCRE2_EX- + TRA_ASCII_DIGIT affects just [:digit:] and [:xdigit:]. Within a pat- + tern, this can be set and unset by (?aT) and (?-aT). The PCRE2_EX- + TRA_ASCII_POSIX option disables UCP processing for all POSIX classes, + including [:digit:] and [:xdigit:]. Within a pattern, (?aP) and (?-aP) + set and unset both these options for consistency. + + +COMPATIBILITY FEATURE FOR WORD BOUNDARIES + + In the POSIX.2 compliant library that was included in 4.4BSD Unix, the + ugly syntax [[:<:]] and [[:>:]] is used for matching "start of word" + and "end of word". PCRE2 treats these items as follows: + + [[:<:]] is converted to \b(?=\w) + [[:>:]] is converted to \b(?<=\w) + + Only these exact character sequences are recognized. A sequence such as + [a[:<:]b] provokes error for an unrecognized POSIX class name. This + support is not compatible with Perl. It is provided to help migrations + from other environments, and is best not used in any new patterns. Note + that \b matches at the start and the end of a word (see "Simple asser- + tions" above), and in a Perl-style pattern the preceding or following + character normally shows which is wanted, without the need for the as- + sertions that are used above in order to give exactly the POSIX behav- + iour. Note also that the PCRE2_UCP option changes the meaning of \w + (and therefore \b) by default, so it also affects these POSIX se- + quences. + + +VERTICAL BAR + + Vertical bar characters are used to separate alternative patterns. For + example, the pattern + + gilbert|sullivan + + matches either "gilbert" or "sullivan". Any number of alternatives may + appear, and an empty alternative is permitted (matching the empty + string). The matching process tries each alternative in turn, from left + to right, and the first one that succeeds is used. If the alternatives + are within a group (defined below), "succeeds" means matching the rest + of the main pattern as well as the alternative in the group. + + +INTERNAL OPTION SETTING + + The settings of several options can be changed within a pattern by a + sequence of letters enclosed between "(?" and ")". The following are + Perl-compatible, and are described in detail in the pcre2api documenta- + tion. The option letters are: + + i for PCRE2_CASELESS + m for PCRE2_MULTILINE + n for PCRE2_NO_AUTO_CAPTURE + s for PCRE2_DOTALL + x for PCRE2_EXTENDED + xx for PCRE2_EXTENDED_MORE + + For example, (?im) sets caseless, multiline matching. It is also possi- + ble to unset these options by preceding the relevant letters with a hy- + phen, for example (?-im). The two "extended" options are not indepen- + dent; unsetting either one cancels the effects of both of them. + + A combined setting and unsetting such as (?im-sx), which sets + PCRE2_CASELESS and PCRE2_MULTILINE while unsetting PCRE2_DOTALL and + PCRE2_EXTENDED, is also permitted. Only one hyphen may appear in the + options string. If a letter appears both before and after the hyphen, + the option is unset. An empty options setting "(?)" is allowed. Need- + less to say, it has no effect. + + If the first character following (? is a circumflex, it causes all of + the above options to be unset. Letters may follow the circumflex to + cause some options to be re-instated, but a hyphen may not appear. + + Some PCRE2-specific options can be changed by the same mechanism using + these pairs or individual letters: + + aD for PCRE2_EXTRA_ASCII_BSD + aS for PCRE2_EXTRA_ASCII_BSS + aW for PCRE2_EXTRA_ASCII_BSW + aP for PCRE2_EXTRA_ASCII_POSIX and PCRE2_EXTRA_ASCII_DIGIT + aT for PCRE2_EXTRA_ASCII_DIGIT + r for PCRE2_EXTRA_CASELESS_RESTRICT + J for PCRE2_DUPNAMES + U for PCRE2_UNGREEDY + + However, except for 'r', these are not unset by (?^), which is equiva- + lent to (?-imnrsx). If 'a' is not followed by any of the upper case + letters shown above, it sets (or unsets) all the ASCII options. + + PCRE2_EXTRA_ASCII_DIGIT has no additional effect when PCRE2_EX- + TRA_ASCII_POSIX is set, but including it in (?aP) means that (?-aP) + suppresses all ASCII restrictions for POSIX classes. + + When one of these option changes occurs at top level (that is, not in- + side group parentheses), the change applies until a subsequent change, + or the end of the pattern. An option change within a group (see below + for a description of groups) affects only that part of the group that + follows it. At the end of the group these options are reset to the + state they were before the group. For example, + + (a(?i)b)c + + matches abc and aBc and no other strings (assuming PCRE2_CASELESS is + not set externally). Any changes made in one alternative do carry on + into subsequent branches within the same group. For example, + + (a(?i)b|c) + + matches "ab", "aB", "c", and "C", even though when matching "C" the + first branch is abandoned before the option setting. This is because + the effects of option settings happen at compile time. There would be + some very weird behaviour otherwise. + + As a convenient shorthand, if any option settings are required at the + start of a non-capturing group (see the next section), the option let- + ters may appear between the "?" and the ":". Thus the two patterns + + (?i:saturday|sunday) + (?:(?i)saturday|sunday) + + match exactly the same set of strings. + + Note: There are other PCRE2-specific options, applying to the whole + pattern, which can be set by the application when the compiling func- + tion is called. In addition, the pattern can contain special leading + sequences such as (*CRLF) to override what the application has set or + what has been defaulted. Details are given in the section entitled + "Newline sequences" above. There are also the (*UTF) and (*UCP) leading + sequences that can be used to set UTF and Unicode property modes; they + are equivalent to setting the PCRE2_UTF and PCRE2_UCP options, respec- + tively. However, the application can set the PCRE2_NEVER_UTF or + PCRE2_NEVER_UCP options, which lock out the use of the (*UTF) and + (*UCP) sequences. + + +GROUPS + + Groups are delimited by parentheses (round brackets), which can be + nested. Turning part of a pattern into a group does two things: + + 1. It localizes a set of alternatives. For example, the pattern + + cat(aract|erpillar|) + + matches "cataract", "caterpillar", or "cat". Without the parentheses, + it would match "cataract", "erpillar" or an empty string. + + 2. It creates a "capture group". This means that, when the whole pat- + tern matches, the portion of the subject string that matched the group + is passed back to the caller, separately from the portion that matched + the whole pattern. (This applies only to the traditional matching + function; the DFA matching function does not support capturing.) + + Opening parentheses are counted from left to right (starting from 1) to + obtain numbers for capture groups. For example, if the string "the red + king" is matched against the pattern + + the ((red|white) (king|queen)) + + the captured substrings are "red king", "red", and "king", and are num- + bered 1, 2, and 3, respectively. + + The fact that plain parentheses fulfil two functions is not always + helpful. There are often times when grouping is required without cap- + turing. If an opening parenthesis is followed by a question mark and a + colon, the group does not do any capturing, and is not counted when + computing the number of any subsequent capture groups. For example, if + the string "the white queen" is matched against the pattern + + the ((?:red|white) (king|queen)) + + the captured substrings are "white queen" and "queen", and are numbered + 1 and 2. The maximum number of capture groups is 65535. + + As a convenient shorthand, if any option settings are required at the + start of a non-capturing group, the option letters may appear between + the "?" and the ":". Thus the two patterns + + (?i:saturday|sunday) + (?:(?i)saturday|sunday) + + match exactly the same set of strings. Because alternative branches are + tried from left to right, and options are not reset until the end of + the group is reached, an option setting in one branch does affect sub- + sequent branches, so the above patterns match "SUNDAY" as well as "Sat- + urday". + + +DUPLICATE GROUP NUMBERS + + Perl 5.10 introduced a feature whereby each alternative in a group uses + the same numbers for its capturing parentheses. Such a group starts + with (?| and is itself a non-capturing group. For example, consider + this pattern: + + (?|(Sat)ur|(Sun))day + + Because the two alternatives are inside a (?| group, both sets of cap- + turing parentheses are numbered one. Thus, when the pattern matches, + you can look at captured substring number one, whichever alternative + matched. This construct is useful when you want to capture part, but + not all, of one of a number of alternatives. Inside a (?| group, paren- + theses are numbered as usual, but the number is reset at the start of + each branch. The numbers of any capturing parentheses that follow the + whole group start after the highest number used in any branch. The fol- + lowing example is taken from the Perl documentation. The numbers under- + neath show in which buffer the captured content will be stored. + + # before ---------------branch-reset----------- after + / ( a ) (?| x ( y ) z | (p (q) r) | (t) u (v) ) ( z ) /x + # 1 2 2 3 2 3 4 + + A backreference to a capture group uses the most recent value that is + set for the group. The following pattern matches "abcabc" or "defdef": + + /(?|(abc)|(def))\1/ + + In contrast, a subroutine call to a capture group always refers to the + first one in the pattern with the given number. The following pattern + matches "abcabc" or "defabc": + + /(?|(abc)|(def))(?1)/ + + A relative reference such as (?-1) is no different: it is just a conve- + nient way of computing an absolute group number. + + If a condition test for a group's having matched refers to a non-unique + number, the test is true if any group with that number has matched. + + An alternative approach to using this "branch reset" feature is to use + duplicate named groups, as described in the next section. + + +NAMED CAPTURE GROUPS + + Identifying capture groups by number is simple, but it can be very hard + to keep track of the numbers in complicated patterns. Furthermore, if + an expression is modified, the numbers may change. To help with this + difficulty, PCRE2 supports the naming of capture groups. This feature + was not added to Perl until release 5.10. Python had the feature ear- + lier, and PCRE1 introduced it at release 4.0, using the Python syntax. + PCRE2 supports both the Perl and the Python syntax. + + In PCRE2, a capture group can be named in one of three ways: + (?...) or (?'name'...) as in Perl, or (?P...) as in Python. + Names may be up to 128 code units long. When PCRE2_UTF is not set, they + may contain only ASCII alphanumeric characters and underscores, but + must start with a non-digit. When PCRE2_UTF is set, the syntax of group + names is extended to allow any Unicode letter or Unicode decimal digit. + In other words, group names must match one of these patterns: + + ^[_A-Za-z][_A-Za-z0-9]*\z when PCRE2_UTF is not set + ^[_\p{L}][_\p{L}\p{Nd}]*\z when PCRE2_UTF is set + + References to capture groups from other parts of the pattern, such as + backreferences, recursion, and conditions, can all be made by name as + well as by number. + + Named capture groups are allocated numbers as well as names, exactly as + if the names were not present. In both PCRE2 and Perl, capture groups + are primarily identified by numbers; any names are just aliases for + these numbers. The PCRE2 API provides function calls for extracting the + complete name-to-number translation table from a compiled pattern, as + well as convenience functions for extracting captured substrings by + name. + + Warning: When more than one capture group has the same number, as de- + scribed in the previous section, a name given to one of them applies to + all of them. Perl allows identically numbered groups to have different + names. Consider this pattern, where there are two capture groups, both + numbered 1: + + (?|(?aa)|(?bb)) + + Perl allows this, with both names AA and BB as aliases of group 1. + Thus, after a successful match, both names yield the same value (either + "aa" or "bb"). + + In an attempt to reduce confusion, PCRE2 does not allow the same group + number to be associated with more than one name. The example above pro- + vokes a compile-time error. However, there is still scope for confu- + sion. Consider this pattern: + + (?|(?aa)|(bb)) + + Although the second group number 1 is not explicitly named, the name AA + is still an alias for any group 1. Whether the pattern matches "aa" or + "bb", a reference by name to group AA yields the matched string. + + By default, a name must be unique within a pattern, except that dupli- + cate names are permitted for groups with the same number, for example: + + (?|(?aa)|(?bb)) + + The duplicate name constraint can be disabled by setting the PCRE2_DUP- + NAMES option at compile time, or by the use of (?J) within the pattern, + as described in the section entitled "Internal Option Setting" above. + + Duplicate names can be useful for patterns where only one instance of + the named capture group can match. Suppose you want to match the name + of a weekday, either as a 3-letter abbreviation or as the full name, + and in both cases you want to extract the abbreviation. This pattern + (ignoring the line breaks) does the job: + + (?J) + (?Mon|Fri|Sun)(?:day)?| + (?Tue)(?:sday)?| + (?Wed)(?:nesday)?| + (?Thu)(?:rsday)?| + (?Sat)(?:urday)? + + There are five capture groups, but only one is ever set after a match. + The convenience functions for extracting the data by name returns the + substring for the first (and in this example, the only) group of that + name that matched. This saves searching to find which numbered group it + was. (An alternative way of solving this problem is to use a "branch + reset" group, as described in the previous section.) + + If you make a backreference to a non-unique named group from elsewhere + in the pattern, the groups to which the name refers are checked in the + order in which they appear in the overall pattern. The first one that + is set is used for the reference. For example, this pattern matches + both "foofoo" and "barbar" but not "foobar" or "barfoo": + + (?J)(?:(?foo)|(?bar))\k + + + If you make a subroutine call to a non-unique named group, the one that + corresponds to the first occurrence of the name is used. In the absence + of duplicate numbers this is the one with the lowest number. + + If you use a named reference in a condition test (see the section about + conditions below), either to check whether a capture group has matched, + or to check for recursion, all groups with the same name are tested. If + the condition is true for any one of them, the overall condition is + true. This is the same behaviour as testing by number. For further de- + tails of the interfaces for handling named capture groups, see the + pcre2api documentation. + + +REPETITION + + Repetition is specified by quantifiers, which may follow any one of + these items: + + a literal data character + the dot metacharacter + the \C escape sequence + the \R escape sequence + the \X escape sequence + any escape sequence that matches a single character + a character class + a backreference + a parenthesized group (including lookaround assertions) + a subroutine call (recursive or otherwise) + + If a quantifier does not follow a repeatable item, an error occurs. The + general repetition quantifier specifies a minimum and maximum number of + permitted matches by giving two numbers in curly brackets (braces), + separated by a comma. The numbers must be less than 65536, and the + first must be less than or equal to the second. For example, + + z{2,4} + + matches "zz", "zzz", or "zzzz". A closing brace on its own is not a + special character. If the second number is omitted, but the comma is + present, there is no upper limit; if the second number and the comma + are both omitted, the quantifier specifies an exact number of required + matches. Thus + + [aeiou]{3,} + + matches at least 3 successive vowels, but may match many more, whereas + + \d{8} + + matches exactly 8 digits. If the first number is omitted, the lower + limit is taken as zero; in this case the upper limit must be present. + + X{,4} is interpreted as X{0,4} + + This is a change in behaviour that happened in Perl 5.34.0 and PCRE2 + 10.43. In earlier versions such a sequence was not interpreted as a + quantifier. Other regular expression engines may behave either way. + + If the characters that follow an opening brace do not match the syntax + of a quantifier, the brace is taken as a literal character. In particu- + lar, this means that {,} is a literal string of three characters. + + Note that not every opening brace is potentially the start of a quanti- + fier because braces are used in other items such as \N{U+345} or + \k{name}. + + In UTF modes, quantifiers apply to characters rather than to individual + code units. Thus, for example, \x{100}{2} matches two characters, each + of which is represented by a two-byte sequence in a UTF-8 string. Simi- + larly, \X{3} matches three Unicode extended grapheme clusters, each of + which may be several code units long (and they may be of different + lengths). + + The quantifier {0} is permitted, causing the expression to behave as if + the previous item and the quantifier were not present. This may be use- + ful for capture groups that are referenced as subroutines from else- + where in the pattern (but see also the section entitled "Defining cap- + ture groups for use by reference only" below). Except for parenthesized + groups, items that have a {0} quantifier are omitted from the compiled + pattern. + + For convenience, the three most common quantifiers have single-charac- + ter abbreviations: + + * is equivalent to {0,} + + is equivalent to {1,} + ? is equivalent to {0,1} + + It is possible to construct infinite loops by following a group that + can match no characters with a quantifier that has no upper limit, for + example: + + (a?)* + + Earlier versions of Perl and PCRE1 used to give an error at compile + time for such patterns. However, because there are cases where this can + be useful, such patterns are now accepted, but whenever an iteration of + such a group matches no characters, matching moves on to the next item + in the pattern instead of repeatedly matching an empty string. This + does not prevent backtracking into any of the iterations if a subse- + quent item fails to match. + + By default, quantifiers are "greedy", that is, they match as much as + possible (up to the maximum number of permitted repetitions), without + causing the rest of the pattern to fail. The classic example of where + this gives problems is in trying to match comments in C programs. These + appear between /* and */ and within the comment, individual * and / + characters may appear. An attempt to match C comments by applying the + pattern + + /\*.*\*/ + + to the string + + /* first comment */ not comment /* second comment */ + + fails, because it matches the entire string owing to the greediness of + the .* item. However, if a quantifier is followed by a question mark, + it ceases to be greedy, and instead matches the minimum number of times + possible, so the pattern + + /\*.*?\*/ + + does the right thing with C comments. The meaning of the various quan- + tifiers is not otherwise changed, just the preferred number of matches. + Do not confuse this use of question mark with its use as a quantifier + in its own right. Because it has two uses, it can sometimes appear + doubled, as in + + \d??\d + + which matches one digit by preference, but can match two if that is the + only way the rest of the pattern matches. + + If the PCRE2_UNGREEDY option is set (an option that is not available in + Perl), the quantifiers are not greedy by default, but individual ones + can be made greedy by following them with a question mark. In other + words, it inverts the default behaviour. + + When a parenthesized group is quantified with a minimum repeat count + that is greater than 1 or with a limited maximum, more memory is re- + quired for the compiled pattern, in proportion to the size of the mini- + mum or maximum. + + If a pattern starts with .* or .{0,} and the PCRE2_DOTALL option + (equivalent to Perl's /s) is set, thus allowing the dot to match new- + lines, the pattern is implicitly anchored, because whatever follows + will be tried against every character position in the subject string, + so there is no point in retrying the overall match at any position af- + ter the first. PCRE2 normally treats such a pattern as though it were + preceded by \A. + + In cases where it is known that the subject string contains no new- + lines, it is worth setting PCRE2_DOTALL in order to obtain this opti- + mization, or alternatively, using ^ to indicate anchoring explicitly. + + However, there are some cases where the optimization cannot be used. + When .* is inside capturing parentheses that are the subject of a + backreference elsewhere in the pattern, a match at the start may fail + where a later one succeeds. Consider, for example: + + (.*)abc\1 + + If the subject is "xyz123abc123" the match point is the fourth charac- + ter. For this reason, such a pattern is not implicitly anchored. + + Another case where implicit anchoring is not applied is when the lead- + ing .* is inside an atomic group. Once again, a match at the start may + fail where a later one succeeds. Consider this pattern: + + (?>.*?a)b + + It matches "ab" in the subject "aab". The use of the backtracking con- + trol verbs (*PRUNE) and (*SKIP) also disable this optimization. To do + so explicitly, either pass the compile option PCRE2_NO_DOTSTAR_ANCHOR, + or call pcre2_set_optimize() with a PCRE2_DOTSTAR_ANCHOR_OFF directive. + + When a capture group is repeated, the value captured is the substring + that matched the final iteration. For example, after + + (tweedle[dume]{3}\s*)+ + + has matched "tweedledum tweedledee" the value of the captured substring + is "tweedledee". However, if there are nested capture groups, the cor- + responding captured values may have been set in previous iterations. + For example, after + + (a|(b))+ + + matches "aba" the value of the second captured substring is "b". + + +ATOMIC GROUPING AND POSSESSIVE QUANTIFIERS + + With both maximizing ("greedy") and minimizing ("ungreedy" or "lazy") + repetition, failure of what follows normally causes the repeated item + to be re-evaluated to see if a different number of repeats allows the + rest of the pattern to match. Sometimes it is useful to prevent this, + either to change the nature of the match, or to cause it fail earlier + than it otherwise might, when the author of the pattern knows there is + no point in carrying on. + + Consider, for example, the pattern \d+foo when applied to the subject + line + + 123456bar + + After matching all 6 digits and then failing to match "foo", the normal + action of the matcher is to try again with only 5 digits matching the + \d+ item, and then with 4, and so on, before ultimately failing. + "Atomic grouping" (a term taken from Jeffrey Friedl's book) provides + the means for specifying that once a group has matched, it is not to be + re-evaluated in this way. + + If we use atomic grouping for the previous example, the matcher gives + up immediately on failing to match "foo" the first time. The notation + is a kind of special parenthesis, starting with (?> as in this example: + + (?>\d+)foo + + Perl 5.28 introduced an experimental alphabetic form starting with (* + which may be easier to remember: + + (*atomic:\d+)foo + + This kind of parenthesized group "locks up" the part of the pattern it + contains once it has matched, and a failure further into the pattern is + prevented from backtracking into it. Backtracking past it to previous + items, however, works as normal. + + An alternative description is that a group of this type matches exactly + the string of characters that an identical standalone pattern would + match, if anchored at the current point in the subject string. + + Atomic groups are not capture groups. Simple cases such as the above + example can be thought of as a maximizing repeat that must swallow + everything it can. So, while both \d+ and \d+? are prepared to adjust + the number of digits they match in order to make the rest of the pat- + tern match, (?>\d+) can only match an entire sequence of digits. + + Atomic groups in general can of course contain arbitrarily complicated + expressions, and can be nested. However, when the contents of an atomic + group is just a single repeated item, as in the example above, a sim- + pler notation, called a "possessive quantifier" can be used. This con- + sists of an additional + character following a quantifier. Using this + notation, the previous example can be rewritten as + + \d++foo + + Note that a possessive quantifier can be used with an entire group, for + example: + + (abc|xyz){2,3}+ + + Possessive quantifiers are always greedy; the setting of the PCRE2_UN- + GREEDY option is ignored. They are a convenient notation for the sim- + pler forms of atomic group. However, there is no difference in the + meaning of a possessive quantifier and the equivalent atomic group, + though there may be a performance difference; possessive quantifiers + should be slightly faster. + + The possessive quantifier syntax is an extension to the Perl 5.8 syn- + tax. Jeffrey Friedl originated the idea (and the name) in the first + edition of his book. Mike McCloskey liked it, so implemented it when he + built Sun's Java package, and PCRE1 copied it from there. It found its + way into Perl at release 5.10. + + PCRE2 has an optimization that automatically "possessifies" certain + simple pattern constructs. For example, the sequence A+B is treated as + A++B because there is no point in backtracking into a sequence of A's + when B must follow. This feature can be disabled by the + PCRE2_NO_AUTO_POSSESS option, by calling pcre2_set_optimize() with a + PCRE2_AUTO_POSSESS_OFF directive, or by starting the pattern with + (*NO_AUTO_POSSESS). + + When a pattern contains an unlimited repeat inside a group that can it- + self be repeated an unlimited number of times, the use of an atomic + group is the only way to avoid some failing matches taking a very long + time indeed. The pattern + + (\D+|<\d+>)*[!?] + + matches an unlimited number of substrings that either consist of non- + digits, or digits enclosed in <>, followed by either ! or ?. When it + matches, it runs quickly. However, if it is applied to + + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + + it takes a long time before reporting failure. This is because the + string can be divided between the internal \D+ repeat and the external + * repeat in a large number of ways, and all have to be tried. (The ex- + ample uses [!?] rather than a single character at the end, because both + PCRE2 and Perl have an optimization that allows for fast failure when a + single character is used. They remember the last single character that + is required for a match, and fail early if it is not present in the + string.) If the pattern is changed so that it uses an atomic group, + like this: + + ((?>\D+)|<\d+>)*[!?] + + sequences of non-digits cannot be broken, and failure happens quickly. + + +BACKREFERENCES + + Outside a character class, a backslash followed by a digit greater than + 0 (and possibly further digits) is a backreference to a capture group + earlier (that is, to its left) in the pattern, provided there have been + that many previous capture groups. + + However, if the decimal number following the backslash is less than 8, + it is always taken as a backreference, and causes an error only if + there are not that many capture groups in the entire pattern. In other + words, the group that is referenced need not be to the left of the ref- + erence for numbers less than 8. A "forward backreference" of this type + can make sense when a repetition is involved and the group to the right + has participated in an earlier iteration. + + It is not possible to have a numerical "forward backreference" to a + group whose number is 8 or more using this syntax because a sequence + such as \50 is interpreted as a character defined in octal. See the + subsection entitled "Non-printing characters" above for further details + of the handling of digits following a backslash. Other forms of back- + referencing do not suffer from this restriction. In particular, there + is no problem when named capture groups are used (see below). + + Another way of avoiding the ambiguity inherent in the use of digits + following a backslash is to use the \g escape sequence. This escape + must be followed by a signed or unsigned number, optionally enclosed in + braces. These examples are all identical: + + (ring), \1 + (ring), \g1 + (ring), \g{1} + + An unsigned number specifies an absolute reference without the ambigu- + ity that is present in the older syntax. It is also useful when literal + digits follow the reference. A signed number is a relative reference. + Consider this example: + + (abc(def)ghi)\g{-1} + + The sequence \g{-1} is a reference to the capture group whose number is + one less than the number of the next group to be started, so in this + example (where the next group would be numbered 3) is it equivalent to + \2, and \g{-2} would be equivalent to \1. Note that if this construct + is inside a capture group, that group is included in the count, so in + this example \g{-2} also refers to group 1: + + (A)(\g{-2}B) + + The use of relative references can be helpful in long patterns, and + also in patterns that are created by joining together fragments that + contain references within themselves. + + The sequence \g{+1} is a reference to the next capture group that is + started after this item, and \g{+2} refers to the one after that, and + so on. This kind of forward reference can be useful in patterns that + repeat. Perl does not support the use of + in this way. + + A backreference matches whatever actually most recently matched the + capture group in the current subject string, rather than anything at + all that matches the group (see "Groups as subroutines" below for a way + of doing that). So the pattern + + (sens|respons)e and \1ibility + + matches "sense and sensibility" and "response and responsibility", but + not "sense and responsibility". If caseful matching is in force at the + time of the backreference, the case of letters is relevant. For exam- + ple, + + ((?i)rah)\s+\1 + + matches "rah rah" and "RAH RAH", but not "RAH rah", even though the + original capture group is matched caselessly. + + There are several different ways of writing backreferences to named + capture groups. The .NET syntax is \k{name}, the Python syntax is + (?=name), and the original Perl syntax is \k or \k'name'. All of + these are now supported by both Perl and PCRE2. Perl 5.10's unified + backreference syntax, in which \g can be used for both numeric and + named references, is also supported by PCRE2. We could rewrite the + above example in any of the following ways: + + (?(?i)rah)\s+\k + (?'p1'(?i)rah)\s+\k{p1} + (?P(?i)rah)\s+(?P=p1) + (?(?i)rah)\s+\g{p1} + + A capture group that is referenced by name may appear in the pattern + before or after the reference. + + There may be more than one backreference to the same group. If a group + has not actually been used in a particular match, backreferences to it + always fail by default. For example, the pattern + + (a|(bc))\2 + + always fails if it starts to match "a" rather than "bc". However, if + the PCRE2_MATCH_UNSET_BACKREF option is set at compile time, a backref- + erence to an unset value matches an empty string. + + Because there may be many capture groups in a pattern, all digits fol- + lowing a backslash are taken as part of a potential backreference num- + ber. If the pattern continues with a digit character, some delimiter + must be used to terminate the backreference. If the PCRE2_EXTENDED or + PCRE2_EXTENDED_MORE option is set, this can be white space. Otherwise, + the \g{} syntax or an empty comment (see "Comments" below) can be used. + + Recursive backreferences + + A backreference that occurs inside the group to which it refers fails + when the group is first used, so, for example, (a\1) never matches. + However, such references can be useful inside repeated groups. For ex- + ample, the pattern + + (a|b\1)+ + + matches any number of "a"s and also "aba", "ababbaa" etc. At each iter- + ation of the group, the backreference matches the character string cor- + responding to the previous iteration. In order for this to work, the + pattern must be such that the first iteration does not need to match + the backreference. This can be done using alternation, as in the exam- + ple above, or by a quantifier with a minimum of zero. + + For versions of PCRE2 less than 10.25, backreferences of this type used + to cause the group that they reference to be treated as an atomic + group. This restriction no longer applies, and backtracking into such + groups can occur as normal. + + +ASSERTIONS + + An assertion is a test that does not consume any characters. The test + must succeed for the match to continue. The simple assertions coded as + \b, \B, \A, \G, \Z, \z, ^ and $ are described above. + + More complicated assertions are coded as parenthesized groups. If + matching such a group succeeds, matching continues after it, but with + the matching position in the subject string reset to what it was before + the assertion was processed. + + A special kind of assertion, called a "scan substring" assertion, + matches a subpattern against a previously captured substring. This is + described in the section entitled "Scan substring assertions" below. It + is a PCRE2 extension, not compatible with Perl. + + The other goup-based assertions are of two kinds: those that look ahead + of the current position in the subject string, and those that look be- + hind it, and in each case an assertion may be positive (must match for + the assertion to be true) or negative (must not match for the assertion + to be true). + + The Perl-compatible lookaround assertions are atomic. If an assertion + is true, but there is a subsequent matching failure, there is no back- + tracking into the assertion. However, there are some cases where non- + atomic assertions can be useful. PCRE2 has some support for these, de- + scribed in the section entitled "Non-atomic assertions" below, but they + are not Perl-compatible. + + A lookaround assertion may appear as the condition in a conditional + group (see below). In this case, the result of matching the assertion + determines which branch of the condition is followed. + + Assertion groups are not capture groups. If an assertion contains cap- + ture groups within it, these are counted for the purposes of numbering + the capture groups in the whole pattern. Within each branch of an as- + sertion, locally captured substrings may be referenced in the usual + way. For example, a sequence such as (.)\g{-1} can be used to check + that two adjacent characters are the same. + + When a branch within an assertion fails to match, any substrings that + were captured are discarded (as happens with any pattern branch that + fails to match). A negative assertion is true only when all its + branches fail to match; this means that no captured substrings are ever + retained after a successful negative assertion. When an assertion con- + tains a matching branch, what happens depends on the type of assertion. + + For a positive assertion, internally captured substrings in the suc- + cessful branch are retained, and matching continues with the next pat- + tern item after the assertion. For a negative assertion, a matching + branch means that the assertion is not true. If such an assertion is + being used as a condition in a conditional group (see below), captured + substrings are retained, because matching continues with the "no" + branch of the condition. For other failing negative assertions, control + passes to the previous backtracking point, thus discarding any captured + strings within the assertion. + + Most assertion groups may be repeated; though it makes no sense to as- + sert the same thing several times, the side effect of capturing in pos- + itive assertions may occasionally be useful. However, an assertion that + forms the condition for a conditional group may not be quantified. + PCRE2 used to restrict the repetition of assertions, but from release + 10.35 the only restriction is that an unlimited maximum repetition is + changed to be one more than the minimum. For example, {3,} is treated + as {3,4}. + + Alphabetic assertion names + + Traditionally, symbolic sequences such as (?= and (?<= have been used + to specify lookaround assertions. Perl 5.28 introduced some experimen- + tal alphabetic alternatives which might be easier to remember. They all + start with (* instead of (? and must be written using lower case let- + ters. PCRE2 supports the following synonyms: + + (*positive_lookahead: or (*pla: is the same as (?= + (*negative_lookahead: or (*nla: is the same as (?! + (*positive_lookbehind: or (*plb: is the same as (?<= + (*negative_lookbehind: or (*nlb: is the same as (? .*? \b\1\b ){2} + + For a subject such as "word1 word2 word3 word2 word3 word4" the result + is "word3". How does it work? At the start, ^(?x) anchors the pattern + and sets the "x" option, which causes white space (introduced for read- + ability) to be ignored. Inside the assertion, the greedy .* at first + consumes the entire string, but then has to backtrack until the rest of + the assertion can match a word, which is captured by group 1. In other + words, when the assertion first succeeds, it captures the right-most + word in the string. + + The current matching point is then reset to the start of the subject, + and the rest of the pattern match checks for two occurrences of the + captured word, using an ungreedy .*? to scan from the left. If this + succeeds, we are done, but if the last word in the string does not oc- + cur twice, this part of the pattern fails. If a traditional atomic + lookahead (?= or (*pla: had been used, the assertion could not be re- + entered, and the whole match would fail. The pattern would succeed only + if the very last word in the subject was found twice. + + Using a non-atomic lookahead, however, means that when the last word + does not occur twice in the string, the lookahead can backtrack and + find the second-last word, and so on, until either the match succeeds, + or all words have been tested. + + Two conditions must be met for a non-atomic assertion to be useful: the + contents of one or more capturing groups must change after a backtrack + into the assertion, and there must be a backreference to a changed + group later in the pattern. If this is not the case, the rest of the + pattern match fails exactly as before because nothing has changed, so + using a non-atomic assertion just wastes resources. + + There is one exception to backtracking into a non-atomic assertion. If + an (*ACCEPT) control verb is triggered, the assertion succeeds atomi- + cally. That is, a subsequent match failure cannot backtrack into the + assertion. + + Non-atomic assertions are not supported by the alternative matching + function pcre2_dfa_match(). They are supported by JIT, but only if they + do not contain any control verbs such as (*ACCEPT). (This may change in + future). Note that assertions that appear as conditions for conditional + groups (see below) must be atomic. + + +SCAN SUBSTRING ASSERTIONS + + A special kind of assertion, not compatible with Perl, makes it possi- + ble to check the contents of a captured substring by matching it with a + subpattern. Because this involves capturing, this feature is not sup- + ported by pcre2_dfa_match(). + + A scan substring assertion starts with the sequence (*scan_substring: + or (*scs: which is followed by a list of substring numbers (absolute or + relative) and/or substring names enclosed in single quotes or angle + brackets, all within parentheses. The rest of the item is the subpat- + tern that is applied to the substring, as shown in these examples: + + (*scan_substring:(1)...) + (*scs:(-2)...) + (*scs:('AB')...) + (*scs:(1,'AB',-2)...) + + The list of groups is checked in the order they are given, and it is + the contents of the first one that is found to be set that are scanned. + When PCRE2_DUPNAMES is set and there are ambiguous group names, all + groups with the same name are checked in numerical order. A scan sub- + string assertion fails if none of the groups it references have been + set. + + The pattern match on the substring is always anchored, that is, it must + match from the start of the substring. There is no "bumpalong" if it + does not match at the start. The end of the subject is temporarily re- + set to be the end of the substring, so \Z, \z, and $ will match there. + However, the start of the subject is not reset. This means that ^ + matches only if the substring is actually at the start of the main sub- + ject, but it also means that lookbehind assertions into what precedes + the substring are possible. + + Here is a very simple example: find a word that contains the rare (in + English) sequence of letters "rh" not at the start: + + \b(\w++)(*scs:(1).+rh) + + The first group captures a word which is then scanned by the second + group. This example does not actually need this heavyweight feature; + the same match can be achieved with: + + \b\w+?rh\w*\b + + When things are more complicated, however, scanning a captured sub- + string can be a useful way to describe the required match. For exmple, + there is a rather complicated pattern in the PCRE2 test data that + checks an entire subject string for a palindrome, that is, the sequence + of letters is the same in both directions. Suppose you want to search + for individual words of two or more characters such as "level" that are + palindromes: + + (\b\w{2,}+\b)(*scs:(1)...palindrome-matching-pattern...) + + Within a substring scanning subpattern, references to other groups work + as normal. Capturing groups may appear, and will retain their values + during ongoing matching if the assertion succeeds. + + +SCRIPT RUNS + + In concept, a script run is a sequence of characters that are all from + the same Unicode script such as Latin or Greek. However, because some + scripts are commonly used together, and because some diacritical and + other marks are used with multiple scripts, it is not that simple. + There is a full description of the rules that PCRE2 uses in the section + entitled "Script Runs" in the pcre2unicode documentation. + + If part of a pattern is enclosed between (*script_run: or (*sr: and a + closing parenthesis, it fails if the sequence of characters that it + matches are not a script run. After a failure, normal backtracking oc- + curs. Script runs can be used to detect spoofing attacks using charac- + ters that look the same, but are from different scripts. The string + "paypal.com" is an infamous example, where the letters could be a mix- + ture of Latin and Cyrillic. This pattern ensures that the matched char- + acters in a sequence of non-spaces that follow white space are a script + run: + + \s+(*sr:\S+) + + To be sure that they are all from the Latin script (for example), a + lookahead can be used: + + \s+(?=\p{Latin})(*sr:\S+) + + This works as long as the first character is expected to be a character + in that script, and not (for example) punctuation, which is allowed + with any script. If this is not the case, a more creative lookahead is + needed. For example, if digits, underscore, and dots are permitted at + the start: + + \s+(?=[0-9_.]*\p{Latin})(*sr:\S+) + + + In many cases, backtracking into a script run pattern fragment is not + desirable. The script run can employ an atomic group to prevent this. + Because this is a common requirement, a shorthand notation is provided + by (*atomic_script_run: or (*asr: + + (*asr:...) is the same as (*sr:(?>...)) + + Note that the atomic group is inside the script run. Putting it outside + would not prevent backtracking into the script run pattern. + + Support for script runs is not available if PCRE2 is compiled without + Unicode support. A compile-time error is given if any of the above con- + structs is encountered. Script runs are not supported by the alternate + matching function, pcre2_dfa_match() because they use the same mecha- + nism as capturing parentheses. + + Warning: The (*ACCEPT) control verb (see below) should not be used + within a script run group, because it causes an immediate exit from the + group, bypassing the script run checking. + + +CONDITIONAL GROUPS + + It is possible to cause the matching process to obey a pattern fragment + conditionally or to choose between two alternative fragments, depending + on the result of an assertion, or whether a specific capture group has + already been matched. The two possible forms of conditional group are: + + (?(condition)yes-pattern) + (?(condition)yes-pattern|no-pattern) + + If the condition is satisfied, the yes-pattern is used; otherwise the + no-pattern (if present) is used. An absent no-pattern is equivalent to + an empty string (it always matches). If there are more than two alter- + natives in the group, a compile-time error occurs. Each of the two al- + ternatives may itself contain nested groups of any form, including con- + ditional groups; the restriction to two alternatives applies only at + the level of the condition itself. This pattern fragment is an example + where the alternatives are complex: + + (?(1) (A|B|C) | (D | (?(2)E|F) | E) ) + + + There are five kinds of condition: references to capture groups, refer- + ences to recursion, two pseudo-conditions called DEFINE and VERSION, + and assertions. + + Checking for a used capture group by number + + If the text between the parentheses consists of a sequence of digits, + the condition is true if a capture group of that number has previously + matched. If there is more than one capture group with the same number + (see the earlier section about duplicate group numbers), the condition + is true if any of them have matched. An alternative notation, which is + a PCRE2 extension, not supported by Perl, is to precede the digits with + a plus or minus sign. In this case, the group number is relative rather + than absolute. The most recently opened capture group (which could be + enclosing this condition) can be referenced by (?(-1), the next most + recent by (?(-2), and so on. Inside loops it can also make sense to re- + fer to subsequent groups. The next capture group to be opened can be + referenced as (?(+1), and so on. The value zero in any of these forms + is not used; it provokes a compile-time error. + + Consider the following pattern, which contains non-significant white + space to make it more readable (assume the PCRE2_EXTENDED option) and + to divide it into three parts for ease of discussion: + + ( \( )? [^()]+ (?(1) \) ) + + The first part matches an optional opening parenthesis, and if that + character is present, sets it as the first captured substring. The sec- + ond part matches one or more characters that are not parentheses. The + third part is a conditional group that tests whether or not the first + capture group matched. If it did, that is, if subject started with an + opening parenthesis, the condition is true, and so the yes-pattern is + executed and a closing parenthesis is required. Otherwise, since no- + pattern is not present, the conditional group matches nothing. In other + words, this pattern matches a sequence of non-parentheses, optionally + enclosed in parentheses. + + If you were embedding this pattern in a larger one, you could use a + relative reference: + + ...other stuff... ( \( )? [^()]+ (?(-1) \) ) ... + + This makes the fragment independent of the parentheses in the larger + pattern. + + Checking for a used capture group by name + + Perl uses the syntax (?()...) or (?('name')...) to test for a + used capture group by name. For compatibility with earlier versions of + PCRE1, which had this facility before Perl, the syntax (?(name)...) is + also recognized. Note, however, that undelimited names consisting of + the letter R followed by digits are ambiguous (see the following sec- + tion). Rewriting the above example to use a named group gives this: + + (? \( )? [^()]+ (?() \) ) + + If the name used in a condition of this kind is a duplicate, the test + is applied to all groups of the same name, and is true if any one of + them has matched. + + Checking for pattern recursion + + "Recursion" in this sense refers to any subroutine-like call from one + part of the pattern to another, whether or not it is actually recur- + sive. See the sections entitled "Recursive patterns" and "Groups as + subroutines" below for details of recursion and subroutine calls. + + If a condition is the string (R), and there is no capture group with + the name R, the condition is true if matching is currently in a recur- + sion or subroutine call to the whole pattern or any capture group. If + digits follow the letter R, and there is no group with that name, the + condition is true if the most recent call is into a group with the + given number, which must exist somewhere in the overall pattern. This + is a contrived example that is equivalent to a+b: + + ((?(R1)a+|(?1)b)) + + However, in both cases, if there is a capture group with a matching + name, the condition tests for its being set, as described in the sec- + tion above, instead of testing for recursion. For example, creating a + group with the name R1 by adding (?) to the above pattern com- + pletely changes its meaning. + + If a name preceded by ampersand follows the letter R, for example: + + (?(R&name)...) + + the condition is true if the most recent recursion is into a group of + that name (which must exist within the pattern). + + This condition does not check the entire recursion stack. It tests only + the current level. If the name used in a condition of this kind is a + duplicate, the test is applied to all groups of the same name, and is + true if any one of them is the most recent recursion. + + At "top level", all these recursion test conditions are false. + + Defining capture groups for use by reference only + + If the condition is the string (DEFINE), the condition is always false, + even if there is a group with the name DEFINE. In this case, there may + be only one alternative in the rest of the conditional group. It is al- + ways skipped if control reaches this point in the pattern; the idea of + DEFINE is that it can be used to define subroutines that can be refer- + enced from elsewhere. (The use of subroutines is described below.) For + example, a pattern to match an IPv4 address such as "192.168.23.245" + could be written like this (ignore white space and line breaks): + + (?(DEFINE) (? 2[0-4]\d | 25[0-5] | 1\d\d | [1-9]?\d) ) + \b (?&byte) (\.(?&byte)){3} \b + + The first part of the pattern is a DEFINE group inside which another + group named "byte" is defined. This matches an individual component of + an IPv4 address (a number less than 256). When matching takes place, + this part of the pattern is skipped because DEFINE acts like a false + condition. The rest of the pattern uses references to the named group + to match the four dot-separated components of an IPv4 address, insist- + ing on a word boundary at each end. + + Checking the PCRE2 version + + Programs that link with a PCRE2 library can check the version by call- + ing pcre2_config() with appropriate arguments. Users of applications + that do not have access to the underlying code cannot do this. A spe- + cial "condition" called VERSION exists to allow such users to discover + which version of PCRE2 they are dealing with by using this condition to + match a string such as "yesno". VERSION must be followed either by "=" + or ">=" and a version number. For example: + + (?(VERSION>=10.4)yes|no) + + This pattern matches "yes" if the PCRE2 version is greater or equal to + 10.4, or "no" otherwise. The fractional part of the version number may + not contain more than two digits. + + Assertion conditions + + If the condition is not in any of the above formats, it must be a + parenthesized assertion. This may be a positive or negative lookahead + or lookbehind assertion. However, it must be a traditional atomic as- + sertion, not one of the non-atomic assertions. + + Consider this pattern, again containing non-significant white space, + and with the two alternatives on the second line: + + (?(?=[^a-z]*[a-z]) + \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) + + The condition is a positive lookahead assertion that matches an op- + tional sequence of non-letters followed by a letter. In other words, it + tests for the presence of at least one letter in the subject. If a let- + ter is found, the subject is matched against the first alternative; + otherwise it is matched against the second. This pattern matches + strings in one of the two forms dd-aaa-dd or dd-dd-dd, where aaa are + letters and dd are digits. + + When an assertion that is a condition contains capture groups, any cap- + turing that occurs in a matching branch is retained afterwards, for + both positive and negative assertions, because matching always contin- + ues after the assertion, whether it succeeds or fails. (Compare non- + conditional assertions, for which captures are retained only for posi- + tive assertions that succeed.) + + +COMMENTS + + There are two ways of including comments in patterns that are processed + by PCRE2. In both cases, the start of the comment must not be in a + character class, nor in the middle of any other sequence of related + characters such as (?: or a group name or number or a Unicode property + name. The characters that make up a comment play no part in the pattern + matching. + + The sequence (?# marks the start of a comment that continues up to the + next closing parenthesis. Nested parentheses are not permitted. If the + PCRE2_EXTENDED or PCRE2_EXTENDED_MORE option is set, an unescaped # + character also introduces a comment, which in this case continues to + immediately after the next newline character or character sequence in + the pattern. Which characters are interpreted as newlines is controlled + by an option passed to the compiling function or by a special sequence + at the start of the pattern, as described in the section entitled "New- + line conventions" above. Note that the end of this type of comment is a + literal newline sequence in the pattern; escape sequences that happen + to represent a newline do not count. For example, consider this pattern + when PCRE2_EXTENDED is set, and the default newline convention (a sin- + gle linefeed character) is in force: + + abc #comment \n still comment + + On encountering the # character, pcre2_compile() skips along, looking + for a newline in the pattern. The sequence \n is still literal at this + stage, so it does not terminate the comment. Only an actual character + with the code value 0x0a (the default newline) does so. + + +RECURSIVE PATTERNS + + Consider the problem of matching a string in parentheses, allowing for + unlimited nested parentheses. Without the use of recursion, the best + that can be done is to use a pattern that matches up to some fixed + depth of nesting. It is not possible to handle an arbitrary nesting + depth. + + For some time, Perl has provided a facility that allows regular expres- + sions to recurse (amongst other things). It does this by interpolating + Perl code in the expression at run time, and the code can refer to the + expression itself. A Perl pattern using code interpolation to solve the + parentheses problem can be created like this: + + $re = qr{\( (?: (?>[^()]+) | (?p{$re}) )* \)}x; + + The (?p{...}) item interpolates Perl code at run time, and in this case + refers recursively to the pattern in which it appears. + + Obviously, PCRE2 cannot support the interpolation of Perl code. In- + stead, it supports special syntax for recursion of the entire pattern, + and also for individual capture group recursion. After its introduction + in PCRE1 and Python, this kind of recursion was subsequently introduced + into Perl at release 5.10. + + A special item that consists of (? followed by a number greater than + zero and a closing parenthesis is a recursive subroutine call of the + capture group of the given number, provided that it occurs inside that + group. (If not, it is a non-recursive subroutine call, which is de- + scribed in the next section.) The special item (?R) or (?0) is a recur- + sive call of the entire regular expression. + + This PCRE2 pattern solves the nested parentheses problem (assume the + PCRE2_EXTENDED option is set so that white space is ignored): + + \( ( [^()]++ | (?R) )* \) + + First it matches an opening parenthesis. Then it matches any number of + substrings which can either be a sequence of non-parentheses, or a re- + cursive match of the pattern itself (that is, a correctly parenthesized + substring). Finally there is a closing parenthesis. Note the use of a + possessive quantifier to avoid backtracking into sequences of non- + parentheses. + + If this were part of a larger pattern, you would not want to recurse + the entire pattern, so instead you could use this: + + ( \( ( [^()]++ | (?1) )* \) ) + + We have put the pattern into parentheses, and caused the recursion to + refer to them instead of the whole pattern. + + In a larger pattern, keeping track of parenthesis numbers can be + tricky. This is made easier by the use of relative references. Instead + of (?1) in the pattern above you can write (?-2) to refer to the second + most recently opened parentheses preceding the recursion. In other + words, a negative number counts capturing parentheses leftwards from + the point at which it is encountered. + + Be aware however, that if duplicate capture group numbers are in use, + relative references refer to the earliest group with the appropriate + number. Consider, for example: + + (?|(a)|(b)) (c) (?-2) + + The first two capture groups (a) and (b) are both numbered 1, and group + (c) is number 2. When the reference (?-2) is encountered, the second + most recently opened parentheses has the number 1, but it is the first + such group (the (a) group) to which the recursion refers. This would be + the same if an absolute reference (?1) was used. In other words, rela- + tive references are just a shorthand for computing a group number. + + It is also possible to refer to subsequent capture groups, by writing + references such as (?+2). However, these cannot be recursive because + the reference is not inside the parentheses that are referenced. They + are always non-recursive subroutine calls, as described in the next + section. + + An alternative approach is to use named parentheses. The Perl syntax + for this is (?&name); PCRE1's earlier syntax (?P>name) is also sup- + ported. We could rewrite the above example as follows: + + (? \( ( [^()]++ | (?&pn) )* \) ) + + If there is more than one group with the same name, the earliest one is + used. + + The example pattern that we have been looking at contains nested unlim- + ited repeats, and so the use of a possessive quantifier for matching + strings of non-parentheses is important when applying the pattern to + strings that do not match. For example, when this pattern is applied to + + (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa() + + it yields "no match" quickly. However, if a possessive quantifier is + not used, the match runs for a very long time indeed because there are + so many different ways the + and * repeats can carve up the subject, + and all have to be tested before failure can be reported. + + At the end of a match, the values of capturing parentheses are those + from the outermost level. If you want to obtain intermediate values, a + callout function can be used (see below and the pcre2callout documenta- + tion). If the pattern above is matched against + + (ab(cd)ef) + + the value for the inner capturing parentheses (numbered 2) is "ef", + which is the last value taken on at the top level. If a capture group + is not matched at the top level, its final captured value is unset, + even if it was (temporarily) set at a deeper level during the matching + process. + + Do not confuse the (?R) item with the condition (R), which tests for + recursion. Consider this pattern, which matches text in angle brack- + ets, allowing for arbitrary nesting. Only digits are allowed in nested + brackets (that is, when recursing), whereas any characters are permit- + ted at the outer level. + + < (?: (?(R) \d++ | [^<>]*+) | (?R)) * > + + In this pattern, (?(R) is the start of a conditional group, with two + different alternatives for the recursive and non-recursive cases. The + (?R) item is the actual recursive call. + + Differences in recursion processing between PCRE2 and Perl + + Some former differences between PCRE2 and Perl no longer exist. + + Before release 10.30, recursion processing in PCRE2 differed from Perl + in that a recursive subroutine call was always treated as an atomic + group. That is, once it had matched some of the subject string, it was + never re-entered, even if it contained untried alternatives and there + was a subsequent matching failure. (Historical note: PCRE implemented + recursion before Perl did.) + + Starting with release 10.30, recursive subroutine calls are no longer + treated as atomic. That is, they can be re-entered to try unused alter- + natives if there is a matching failure later in the pattern. This is + now compatible with the way Perl works. If you want a subroutine call + to be atomic, you must explicitly enclose it in an atomic group. + + Supporting backtracking into recursions simplifies certain types of re- + cursive pattern. For example, this pattern matches palindromic strings: + + ^((.)(?1)\2|.?)$ + + The second branch in the group matches a single central character in + the palindrome when there are an odd number of characters, or nothing + when there are an even number of characters, but in order to work it + has to be able to try the second case when the rest of the pattern + match fails. If you want to match typical palindromic phrases, the pat- + tern has to ignore all non-word characters, which can be done like + this: + + ^\W*+((.)\W*+(?1)\W*+\2|\W*+.?)\W*+$ + + If run with the PCRE2_CASELESS option, this pattern matches phrases + such as "A man, a plan, a canal: Panama!". Note the use of the posses- + sive quantifier *+ to avoid backtracking into sequences of non-word + characters. Without this, PCRE2 takes a great deal longer (ten times or + more) to match typical phrases, and Perl takes so long that you think + it has gone into a loop. + + Another way in which PCRE2 and Perl used to differ in their recursion + processing is in the handling of captured values. Formerly in Perl, + when a group was called recursively or as a subroutine (see the next + section), it had no access to any values that were captured outside the + recursion, whereas in PCRE2 these values can be referenced. Consider + this pattern: + + ^(.)(\1|a(?2)) + + This pattern matches "bab". The first capturing parentheses match "b", + then in the second group, when the backreference \1 fails to match "b", + the second alternative matches "a" and then recurses. In the recursion, + \1 does now match "b" and so the whole match succeeds. This match used + to fail in Perl, but in later versions (I tried 5.024) it now works. + + +GROUPS AS SUBROUTINES + + If the syntax for a recursive group call (either by number or by name) + is used outside the parentheses to which it refers, it operates a bit + like a subroutine in a programming language. More accurately, PCRE2 + treats the referenced group as an independent subpattern which it tries + to match at the current matching position. The called group may be de- + fined before or after the reference. A numbered reference can be ab- + solute or relative, as in these examples: + + (...(absolute)...)...(?2)... + (...(relative)...)...(?-1)... + (...(?+1)...(relative)... + + An earlier example pointed out that the pattern + + (sens|respons)e and \1ibility + + matches "sense and sensibility" and "response and responsibility", but + not "sense and responsibility". If instead the pattern + + (sens|respons)e and (?1)ibility + + is used, it does match "sense and responsibility" as well as the other + two strings. Another example is given in the discussion of DEFINE + above. + + Like recursions, subroutine calls used to be treated as atomic, but + this changed at PCRE2 release 10.30, so backtracking into subroutine + calls can now occur. However, any capturing parentheses that are set + during the subroutine call revert to their previous values afterwards. + + Processing options such as case-independence are fixed when a group is + defined, so if it is used as a subroutine, such options cannot be + changed for different calls. For example, consider this pattern: + + (abc)(?i:(?-1)) + + It matches "abcabc". It does not match "abcABC" because the change of + processing option does not affect the called group. + + The behaviour of backtracking control verbs in groups when called as + subroutines is described in the section entitled "Backtracking verbs in + subroutines" below. + + +ONIGURUMA SUBROUTINE SYNTAX + + For compatibility with Oniguruma, the non-Perl syntax \g followed by a + name or a number enclosed either in angle brackets or single quotes, is + an alternative syntax for calling a group as a subroutine, possibly re- + cursively. Here are two of the examples used above, rewritten using + this syntax: + + (? \( ( (?>[^()]+) | \g )* \) ) + (sens|respons)e and \g'1'ibility + + PCRE2 supports an extension to Oniguruma: if a number is preceded by a + plus or a minus sign it is taken as a relative reference. For example: + + (abc)(?i:\g<-1>) + + Note that \g{...} (Perl syntax) and \g<...> (Oniguruma syntax) are not + synonymous. The former is a backreference; the latter is a subroutine + call. + + +CALLOUTS + + Perl has a feature whereby using the sequence (?{...}) causes arbitrary + Perl code to be obeyed in the middle of matching a regular expression. + This makes it possible, amongst other things, to extract different sub- + strings that match the same pair of parentheses when there is a repeti- + tion. + + PCRE2 provides a similar feature, but of course it cannot obey arbi- + trary Perl code. The feature is called "callout". The caller of PCRE2 + provides an external function by putting its entry point in a match + context using the function pcre2_set_callout(), and then passing that + context to pcre2_match() or pcre2_dfa_match(). If no match context is + passed, or if the callout entry point is set to NULL, callout points + will be passed over silently during matching. To disallow callouts in + the pattern syntax, you may use the PCRE2_EXTRA_NEVER_CALLOUT option. + + Within a regular expression, (?C) indicates a point at which the + external function is to be called. There are two kinds of callout: + those with a numerical argument and those with a string argument. (?C) + on its own with no argument is treated as (?C0). A numerical argument + allows the application to distinguish between different callouts. + String arguments were added for release 10.20 to make it possible for + script languages that use PCRE2 to embed short scripts within patterns + in a similar way to Perl. + + During matching, when PCRE2 reaches a callout point, the external func- + tion is called. It is provided with the number or string argument of + the callout, the position in the pattern, and one item of data that is + also set in the match block. The callout function may cause matching to + proceed, to backtrack, or to fail. + + By default, PCRE2 implements a number of optimizations at matching + time, and one side-effect is that sometimes callouts are skipped. If + you need all possible callouts to happen, you need to set options that + disable the relevant optimizations. More details, including a complete + description of the programming interface to the callout function, are + given in the pcre2callout documentation. + + Callouts with numerical arguments + + If you just want to have a means of identifying different callout + points, put a number less than 256 after the letter C. For example, + this pattern has two callout points: + + (?C1)abc(?C2)def + + If the PCRE2_AUTO_CALLOUT flag is passed to pcre2_compile(), numerical + callouts are automatically installed before each item in the pattern. + They are all numbered 255. If there is a conditional group in the pat- + tern whose condition is an assertion, an additional callout is inserted + just before the condition. An explicit callout may also be set at this + position, as in this example: + + (?(?C9)(?=a)abc|def) + + Note that this applies only to assertion conditions, not to other types + of condition. + + Callouts with string arguments + + A delimited string may be used instead of a number as a callout argu- + ment. The starting delimiter must be one of ` ' " ^ % # $ { and the + ending delimiter is the same as the start, except for {, where the end- + ing delimiter is }. If the ending delimiter is needed within the + string, it must be doubled. For example: + + (?C'ab ''c'' d')xyz(?C{any text})pqr + + The doubling is removed before the string is passed to the callout + function. + + +BACKTRACKING CONTROL + + There are a number of special "Backtracking Control Verbs" (to use + Perl's terminology) that modify the behaviour of backtracking during + matching. They are generally of the form (*VERB) or (*VERB:NAME). Some + verbs take either form, and may behave differently depending on whether + or not a name argument is present. The names are not required to be + unique within the pattern. + + By default, for compatibility with Perl, a name is any sequence of + characters that does not include a closing parenthesis. The name is not + processed in any way, and it is not possible to include a closing + parenthesis in the name. This can be changed by setting the + PCRE2_ALT_VERBNAMES option, but the result is no longer Perl-compati- + ble. + + When PCRE2_ALT_VERBNAMES is set, backslash processing is applied to + verb names and only an unescaped closing parenthesis terminates the + name. However, the only backslash items that are permitted are \Q, \E, + and sequences such as \x{100} that define character code points. Char- + acter type escapes such as \d are faulted. + + A closing parenthesis can be included in a name either as \) or between + \Q and \E. In addition to backslash processing, if the PCRE2_EXTENDED + or PCRE2_EXTENDED_MORE option is also set, unescaped whitespace in verb + names is skipped, and #-comments are recognized, exactly as in the rest + of the pattern. PCRE2_EXTENDED and PCRE2_EXTENDED_MORE do not affect + verb names unless PCRE2_ALT_VERBNAMES is also set. + + The maximum length of a name is 255 in the 8-bit library and 65535 in + the 16-bit and 32-bit libraries. If the name is empty, that is, if the + closing parenthesis immediately follows the colon, the effect is as if + the colon were not there. Any number of these verbs may occur in a pat- + tern. Except for (*ACCEPT), they may not be quantified. + + Since these verbs are specifically related to backtracking, most of + them can be used only when the pattern is to be matched using the tra- + ditional matching function or JIT, because they use backtracking algo- + rithms. With the exception of (*FAIL), which behaves like a failing + negative assertion, the backtracking control verbs cause an error if + encountered by the DFA matching function. + + The behaviour of these verbs in repeated groups, assertions, and in + capture groups called as subroutines (whether or not recursively) is + documented below. + + Optimizations that affect backtracking verbs + + PCRE2 contains some optimizations that are used to speed up matching by + running some checks at the start of each match attempt. For example, it + may know the minimum length of matching subject, or that a particular + character must be present. When one of these optimizations bypasses the + running of a match, any included backtracking verbs will not, of + course, be processed. You can suppress the start-of-match optimizations + by setting the PCRE2_NO_START_OPTIMIZE option when calling pcre2_com- + pile(), by calling pcre2_set_optimize() with a PCRE2_START_OPTIMIZE_OFF + directive, or by starting the pattern with (*NO_START_OPT). There is + more discussion of this option in the section entitled "Compiling a + pattern" in the pcre2api documentation. + + Experiments with Perl suggest that it too has similar optimizations, + and like PCRE2, turning them off can change the result of a match. + + Verbs that act immediately + + The following verbs act as soon as they are encountered. + + (*ACCEPT) or (*ACCEPT:NAME) + + This verb causes the match to end successfully, skipping the remainder + of the pattern. However, when it is inside a capture group that is + called as a subroutine, only that group is ended successfully. Matching + then continues at the outer level. If (*ACCEPT) in triggered in a posi- + tive assertion, the assertion succeeds; in a negative assertion, the + assertion fails. + + If (*ACCEPT) is inside capturing parentheses, the data so far is cap- + tured. For example: + + A((?:A|B(*ACCEPT)|C)D) + + This matches "AB", "AAD", or "ACD"; when it matches "AB", "B" is cap- + tured by the outer parentheses. + + (*ACCEPT) is the only backtracking verb that is allowed to be quanti- + fied because an ungreedy quantification with a minimum of zero acts + only when a backtrack happens. Consider, for example, + + (A(*ACCEPT)??B)C + + where A, B, and C may be complex expressions. After matching "A", the + matcher processes "BC"; if that fails, causing a backtrack, (*ACCEPT) + is triggered and the match succeeds. In both cases, all but C is cap- + tured. Whereas (*COMMIT) (see below) means "fail on backtrack", a re- + peated (*ACCEPT) of this type means "succeed on backtrack". + + Warning: (*ACCEPT) should not be used within a script run group, be- + cause it causes an immediate exit from the group, bypassing the script + run checking. + + (*FAIL) or (*FAIL:NAME) + + This verb causes a matching failure, forcing backtracking to occur. It + may be abbreviated to (*F). It is equivalent to (?!) but easier to + read. The Perl documentation notes that it is probably useful only when + combined with (?{}) or (??{}). Those are, of course, Perl features that + are not present in PCRE2. The nearest equivalent is the callout fea- + ture, as for example in this pattern: + + a+(?C)(*FAIL) + + A match with the string "aaaa" always fails, but the callout is taken + before each backtrack happens (in this example, 10 times). + + (*ACCEPT:NAME) and (*FAIL:NAME) behave the same as (*MARK:NAME)(*AC- + CEPT) and (*MARK:NAME)(*FAIL), respectively, that is, a (*MARK) is + recorded just before the verb acts. + + Recording which path was taken + + There is one verb whose main purpose is to track how a match was ar- + rived at, though it also has a secondary use in conjunction with ad- + vancing the match starting point (see (*SKIP) below). + + (*MARK:NAME) or (*:NAME) + + A name is always required with this verb. For all the other backtrack- + ing control verbs, a NAME argument is optional. + + When a match succeeds, the name of the last-encountered mark name on + the matching path is passed back to the caller as described in the sec- + tion entitled "Other information about the match" in the pcre2api docu- + mentation. This applies to all instances of (*MARK) and other verbs, + including those inside assertions and atomic groups. However, there are + differences in those cases when (*MARK) is used in conjunction with + (*SKIP) as described below. + + The mark name that was last encountered on the matching path is passed + back. A verb without a NAME argument is ignored for this purpose. Here + is an example of pcre2test output, where the "mark" modifier requests + the retrieval and outputting of (*MARK) data: + + re> /X(*MARK:A)Y|X(*MARK:B)Z/mark + data> XY + 0: XY + MK: A + XZ + 0: XZ + MK: B + + The (*MARK) name is tagged with "MK:" in this output, and in this exam- + ple it indicates which of the two alternatives matched. This is a more + efficient way of obtaining this information than putting each alterna- + tive in its own capturing parentheses. + + If a verb with a name is encountered in a positive assertion that is + true, the name is recorded and passed back if it is the last-encoun- + tered. This does not happen for negative assertions or failing positive + assertions. + + After a partial match or a failed match, the last encountered name in + the entire match process is returned. For example: + + re> /X(*MARK:A)Y|X(*MARK:B)Z/mark + data> XP + No match, mark = B + + Note that in this unanchored example the mark is retained from the + match attempt that started at the letter "X" in the subject. Subsequent + match attempts starting at "P" and then with an empty string do not get + as far as the (*MARK) item, but nevertheless do not reset it. + + If you are interested in (*MARK) values after failed matches, you + should probably either set the PCRE2_NO_START_OPTIMIZE option or call + pcre2_set_optimize() with a PCRE2_START_OPTIMIZE_OFF directive (see + above) to ensure that the match is always attempted. + + Verbs that act after backtracking + + The following verbs do nothing when they are encountered. Matching con- + tinues with what follows, but if there is a subsequent match failure, + causing a backtrack to the verb, a failure is forced. That is, back- + tracking cannot pass to the left of the verb. However, when one of + these verbs appears inside an atomic group or in an atomic lookaround + assertion that is true, its effect is confined to that group, because + once the group has been matched, there is never any backtracking into + it. Backtracking from beyond an atomic assertion or group ignores the + entire group, and seeks a preceding backtracking point. + + These verbs differ in exactly what kind of failure occurs when back- + tracking reaches them. The behaviour described below is what happens + when the verb is not in a subroutine or an assertion. Subsequent sec- + tions cover these special cases. + + (*COMMIT) or (*COMMIT:NAME) + + This verb causes the whole match to fail outright if there is a later + matching failure that causes backtracking to reach it. Even if the pat- + tern is unanchored, no further attempts to find a match by advancing + the starting point take place. If (*COMMIT) is the only backtracking + verb that is encountered, once it has been passed pcre2_match() is com- + mitted to finding a match at the current starting point, or not at all. + For example: + + a+(*COMMIT)b + + This matches "xxaab" but not "aacaab". It can be thought of as a kind + of dynamic anchor, or "I've started, so I must finish." + + The behaviour of (*COMMIT:NAME) is not the same as (*MARK:NAME)(*COM- + MIT). It is like (*MARK:NAME) in that the name is remembered for pass- + ing back to the caller. However, (*SKIP:NAME) searches only for names + that are set with (*MARK), ignoring those set by any of the other back- + tracking verbs. + + If there is more than one backtracking verb in a pattern, a different + one that follows (*COMMIT) may be triggered first, so merely passing + (*COMMIT) during a match does not always guarantee that a match must be + at this starting point. + + Note that (*COMMIT) at the start of a pattern is not the same as an an- + chor, unless PCRE2's start-of-match optimizations are turned off, as + shown in this output from pcre2test: + + re> /(*COMMIT)abc/ + data> xyzabc + 0: abc + data> + re> /(*COMMIT)abc/no_start_optimize + data> xyzabc + No match + + For the first pattern, PCRE2 knows that any match must start with "a", + so the optimization skips along the subject to "a" before applying the + pattern to the first set of data. The match attempt then succeeds. The + second pattern disables the optimization that skips along to the first + character. The pattern is now applied starting at "x", and so the + (*COMMIT) causes the match to fail without trying any other starting + points. + + (*PRUNE) or (*PRUNE:NAME) + + This verb causes the match to fail at the current starting position in + the subject if there is a later matching failure that causes backtrack- + ing to reach it. If the pattern is unanchored, the normal "bumpalong" + advance to the next starting character then happens. Backtracking can + occur as usual to the left of (*PRUNE), before it is reached, or when + matching to the right of (*PRUNE), but if there is no match to the + right, backtracking cannot cross (*PRUNE). In simple cases, the use of + (*PRUNE) is just an alternative to an atomic group or possessive quan- + tifier, but there are some uses of (*PRUNE) that cannot be expressed in + any other way. In an anchored pattern (*PRUNE) has the same effect as + (*COMMIT). + + The behaviour of (*PRUNE:NAME) is not the same as (*MARK:NAME)(*PRUNE). + It is like (*MARK:NAME) in that the name is remembered for passing back + to the caller. However, (*SKIP:NAME) searches only for names set with + (*MARK), ignoring those set by other backtracking verbs. + + (*SKIP) + + This verb, when given without a name, is like (*PRUNE), except that if + the pattern is unanchored, the "bumpalong" advance is not to the next + character, but to the position in the subject where (*SKIP) was encoun- + tered. (*SKIP) signifies that whatever text was matched leading up to + it cannot be part of a successful match if there is a later mismatch. + Consider: + + a+(*SKIP)b + + If the subject is "aaaac...", after the first match attempt fails + (starting at the first character in the string), the starting point + skips on to start the next attempt at "c". Note that a possessive quan- + tifier does not have the same effect as this example; although it would + suppress backtracking during the first match attempt, the second at- + tempt would start at the second character instead of skipping on to + "c". + + If (*SKIP) is used to specify a new starting position that is the same + as the starting position of the current match, or (by being inside a + lookbehind) earlier, the position specified by (*SKIP) is ignored, and + instead the normal "bumpalong" occurs. + + (*SKIP:NAME) + + When (*SKIP) has an associated name, its behaviour is modified. When + such a (*SKIP) is triggered, the previous path through the pattern is + searched for the most recent (*MARK) that has the same name. If one is + found, the "bumpalong" advance is to the subject position that corre- + sponds to that (*MARK) instead of to where (*SKIP) was encountered. If + no (*MARK) with a matching name is found, the (*SKIP) is ignored. + + The search for a (*MARK) name uses the normal backtracking mechanism, + which means that it does not see (*MARK) settings that are inside + atomic groups or assertions, because they are never re-entered by back- + tracking. Compare the following pcre2test examples: + + re> /a(?>(*MARK:X))(*SKIP:X)(*F)|(.)/ + data: abc + 0: a + 1: a + data: + re> /a(?:(*MARK:X))(*SKIP:X)(*F)|(.)/ + data: abc + 0: b + 1: b + + In the first example, the (*MARK) setting is in an atomic group, so it + is not seen when (*SKIP:X) triggers, causing the (*SKIP) to be ignored. + This allows the second branch of the pattern to be tried at the first + character position. In the second example, the (*MARK) setting is not + in an atomic group. This allows (*SKIP:X) to find the (*MARK) when it + backtracks, and this causes a new matching attempt to start at the sec- + ond character. This time, the (*MARK) is never seen because "a" does + not match "b", so the matcher immediately jumps to the second branch of + the pattern. + + Note that (*SKIP:NAME) searches only for names set by (*MARK:NAME). It + ignores names that are set by other backtracking verbs. + + (*THEN) or (*THEN:NAME) + + This verb causes a skip to the next innermost alternative when back- + tracking reaches it. That is, it cancels any further backtracking + within the current alternative. Its name comes from the observation + that it can be used for a pattern-based if-then-else block: + + ( COND1 (*THEN) FOO | COND2 (*THEN) BAR | COND3 (*THEN) BAZ ) ... + + If the COND1 pattern matches, FOO is tried (and possibly further items + after the end of the group if FOO succeeds); on failure, the matcher + skips to the second alternative and tries COND2, without backtracking + into COND1. If that succeeds and BAR fails, COND3 is tried. If subse- + quently BAZ fails, there are no more alternatives, so there is a back- + track to whatever came before the entire group. If (*THEN) is not in- + side an alternation, it acts like (*PRUNE). + + The behaviour of (*THEN:NAME) is not the same as (*MARK:NAME)(*THEN). + It is like (*MARK:NAME) in that the name is remembered for passing back + to the caller. However, (*SKIP:NAME) searches only for names set with + (*MARK), ignoring those set by other backtracking verbs. + + A group that does not contain a | character is just a part of the en- + closing alternative; it is not a nested alternation with only one al- + ternative. The effect of (*THEN) extends beyond such a group to the en- + closing alternative. Consider this pattern, where A, B, etc. are com- + plex pattern fragments that do not contain any | characters at this + level: + + A (B(*THEN)C) | D + + If A and B are matched, but there is a failure in C, matching does not + backtrack into A; instead it moves to the next alternative, that is, D. + However, if the group containing (*THEN) is given an alternative, it + behaves differently: + + A (B(*THEN)C | (*FAIL)) | D + + The effect of (*THEN) is now confined to the inner group. After a fail- + ure in C, matching moves to (*FAIL), which causes the whole group to + fail because there are no more alternatives to try. In this case, + matching does backtrack into A. + + Note that a conditional group is not considered as having two alterna- + tives, because only one is ever used. In other words, the | character + in a conditional group has a different meaning. Ignoring white space, + consider: + + ^.*? (?(?=a) a | b(*THEN)c ) + + If the subject is "ba", this pattern does not match. Because .*? is un- + greedy, it initially matches zero characters. The condition (?=a) then + fails, the character "b" is matched, but "c" is not. At this point, + matching does not backtrack to .*? as might perhaps be expected from + the presence of the | character. The conditional group is part of the + single alternative that comprises the whole pattern, and so the match + fails. (If there was a backtrack into .*?, allowing it to match "b", + the match would succeed.) + + The verbs just described provide four different "strengths" of control + when subsequent matching fails. (*THEN) is the weakest, carrying on the + match at the next alternative. (*PRUNE) comes next, failing the match + at the current starting position, but allowing an advance to the next + character (for an unanchored pattern). (*SKIP) is similar, except that + the advance may be more than one character. (*COMMIT) is the strongest, + causing the entire match to fail. + + More than one backtracking verb + + If more than one backtracking verb is present in a pattern, the one + that is backtracked onto first acts. For example, consider this pat- + tern, where A, B, etc. are complex pattern fragments: + + (A(*COMMIT)B(*THEN)C|ABD) + + If A matches but B fails, the backtrack to (*COMMIT) causes the entire + match to fail. However, if A and B match, but C fails, the backtrack to + (*THEN) causes the next alternative (ABD) to be tried. This behaviour + is consistent, but is not always the same as Perl's. It means that if + two or more backtracking verbs appear in succession, all but the last + of them has no effect. Consider this example: + + ...(*COMMIT)(*PRUNE)... + + If there is a matching failure to the right, backtracking onto (*PRUNE) + causes it to be triggered, and its action is taken. There can never be + a backtrack onto (*COMMIT). + + Backtracking verbs in repeated groups + + PCRE2 sometimes differs from Perl in its handling of backtracking verbs + in repeated groups. For example, consider: + + /(a(*COMMIT)b)+ac/ + + If the subject is "abac", Perl matches unless its optimizations are + disabled, but PCRE2 always fails because the (*COMMIT) in the second + repeat of the group acts. + + Backtracking verbs in assertions + + (*FAIL) in any assertion has its normal effect: it forces an immediate + backtrack. The behaviour of the other backtracking verbs depends on + whether or not the assertion is standalone or acting as the condition + in a conditional group. + + (*ACCEPT) in a standalone positive assertion causes the assertion to + succeed without any further processing; captured strings and a mark + name (if set) are retained. In a standalone negative assertion, (*AC- + CEPT) causes the assertion to fail without any further processing; cap- + tured substrings and any mark name are discarded. + + If the assertion is a condition, (*ACCEPT) causes the condition to be + true for a positive assertion and false for a negative one; captured + substrings are retained in both cases. + + The remaining verbs act only when a later failure causes a backtrack to + reach them. This means that, for the Perl-compatible assertions, their + effect is confined to the assertion, because Perl lookaround assertions + are atomic. A backtrack that occurs after such an assertion is complete + does not jump back into the assertion. Note in particular that a + (*MARK) name that is set in an assertion is not "seen" by an instance + of (*SKIP:NAME) later in the pattern. + + PCRE2 now supports non-atomic positive assertions and also "scan sub- + string" assertions, as described in the sections entitled "Non-atomic + assertions" and "Scan substring assertions" above. These assertions + must be standalone (not used as conditions). They are not Perl-compati- + ble. For these assertions, a later backtrack does jump back into the + assertion, and therefore verbs such as (*COMMIT) can be triggered by + backtracks from later in the pattern. + + The effect of (*THEN) is not allowed to escape beyond an assertion. If + there are no more branches to try, (*THEN) causes a positive assertion + to be false, and a negative assertion to be true. This behaviour dif- + fers from Perl when the assertion has only one branch. + + The other backtracking verbs are not treated specially if they appear + in a standalone positive assertion. In a conditional positive asser- + tion, backtracking (from within the assertion) into (*COMMIT), (*SKIP), + or (*PRUNE) causes the condition to be false. However, for both stand- + alone and conditional negative assertions, backtracking into (*COMMIT), + (*SKIP), or (*PRUNE) causes the assertion to be true, without consider- + ing any further alternative branches. + + Backtracking verbs in subroutines + + These behaviours occur whether or not the group is called recursively. + + (*ACCEPT) in a group called as a subroutine causes the subroutine match + to succeed without any further processing. Matching then continues af- + ter the subroutine call. Perl documents this behaviour. Perl's treat- + ment of the other verbs in subroutines is different in some cases. + + (*FAIL) in a group called as a subroutine has its normal effect: it + forces an immediate backtrack. + + (*COMMIT), (*SKIP), and (*PRUNE) cause the subroutine match to fail + when triggered by being backtracked to in a group called as a subrou- + tine. There is then a backtrack at the outer level. + + (*THEN), when triggered, skips to the next alternative in the innermost + enclosing group that has alternatives (its normal behaviour). However, + if there is no such group within the subroutine's group, the subroutine + match fails and there is a backtrack at the outer level. + + +EBCDIC ENVIRONMENTS + + Differences in the way PCRE behaves when it is running in an EBCDIC en- + vironment are covered in this section. + + Escape sequences + + When PCRE2 is compiled in EBCDIC mode, \N{U+hhh..} is not supported. + \a, \e, \f, \n, \r, and \t generate the appropriate EBCDIC code values. + The \c escape is processed as specified for Perl in the perlebcdic doc- + ument. The only characters that are allowed after \c are A-Z, a-z, or + one of @, [, \, ], ^, _, or ?. Any other character provokes a compile- + time error. The sequence \c@ encodes character code 0; after \c the + letters (in either case) encode characters 1-26 (hex 01 to hex 1A); [, + \, ], ^, and _ encode characters 27-31 (hex 1B to hex 1F), and \c? be- + comes either 255 (hex FF) or 95 (hex 5F). + + Thus, apart from \c?, these escapes generate the same character code + values as they do in an ASCII or Unicode environment, though the mean- + ings of the values mostly differ. For example, \cG always generates + code value 7, which is BEL in ASCII but DEL in EBCDIC. + + The sequence \c? generates DEL (127, hex 7F) in an ASCII environment, + but because 127 is not a control character in EBCDIC, Perl makes it + generate the APC character. Unfortunately, there are several variants + of EBCDIC. In most of them the APC character has the value 255 (hex + FF), but in the one Perl calls POSIX-BC its value is 95 (hex 5F). If + certain other characters have POSIX-BC values, PCRE2 makes \c? generate + 95; otherwise it generates 255. + + Character classes + + In character classes there is a special case in EBCDIC environments for + ranges whose end points are both specified as literal letters in the + same case. For compatibility with Perl, EBCDIC code points within the + range that are not letters are omitted. For example, [h-k] matches only + four characters, even though the EBCDIC codes for h and k are 0x88 and + 0x92, a range of 11 code points. However, if the range is specified nu- + merically, for example, [\x88-\x92] or [h-\x92], all code points are + included. + + +SEE ALSO + + pcre2api(3), pcre2callout(3), pcre2matching(3), pcre2syntax(3), + pcre2(3). + + +AUTHOR + + Philip Hazel + Retired from University Computing Service + Cambridge, England. + + +REVISION + + Last updated: 27 November 2024 + Copyright (c) 1997-2024 University of Cambridge. + + +PCRE2 10.46 27 November 2024 PCRE2PATTERN(3) +------------------------------------------------------------------------------ + + +PCRE2PERFORM(3) Library Functions Manual PCRE2PERFORM(3) + + +NAME + PCRE2 - Perl-compatible regular expressions (revised API) + + +PCRE2 PERFORMANCE + + Two aspects of performance are discussed below: memory usage and pro- + cessing time. The way you express your pattern as a regular expression + can affect both of them. + + +COMPILED PATTERN MEMORY USAGE + + Patterns are compiled by PCRE2 into a reasonably efficient interpretive + code, so that most simple patterns do not use much memory for storing + the compiled version. However, there is one case where the memory usage + of a compiled pattern can be unexpectedly large. If a parenthesized + group has a quantifier with a minimum greater than 1 and/or a limited + maximum, the whole group is repeated in the compiled code. For example, + the pattern + + (abc|def){2,4} + + is compiled as if it were + + (abc|def)(abc|def)((abc|def)(abc|def)?)? + + (Technical aside: It is done this way so that backtrack points within + each of the repetitions can be independently maintained.) + + For regular expressions whose quantifiers use only small numbers, this + is not usually a problem. However, if the numbers are large, and par- + ticularly if such repetitions are nested, the memory usage can become + an embarrassment. For example, the very simple pattern + + ((ab){1,1000}c){1,3} + + uses over 50KiB when compiled using the 8-bit library. When PCRE2 is + compiled with its default internal pointer size of two bytes, the size + limit on a compiled pattern is 65535 code units in the 8-bit and 16-bit + libraries, and this is reached with the above pattern if the outer rep- + etition is increased from 3 to 4. PCRE2 can be compiled to use larger + internal pointers and thus handle larger compiled patterns, but it is + better to try to rewrite your pattern to use less memory if you can. + + One way of reducing the memory usage for such patterns is to make use + of PCRE2's "subroutine" facility. Re-writing the above pattern as + + ((ab)(?2){0,999}c)(?1){0,2} + + reduces the memory requirements to around 16KiB, and indeed it remains + under 20KiB even with the outer repetition increased to 100. However, + this kind of pattern is not always exactly equivalent, because any cap- + tures within subroutine calls are lost when the subroutine completes. + If this is not a problem, this kind of rewriting will allow you to + process patterns that PCRE2 cannot otherwise handle. The matching per- + formance of the two different versions of the pattern are roughly the + same. (This applies from release 10.30 - things were different in ear- + lier releases.) + + +STACK AND HEAP USAGE AT RUN TIME + + From release 10.30, the interpretive (non-JIT) version of pcre2_match() + uses very little system stack at run time. In earlier releases recur- + sive function calls could use a great deal of stack, and this could + cause problems, but this usage has been eliminated. Backtracking posi- + tions are now explicitly remembered in memory frames controlled by the + code. + + The size of each frame depends on the size of pointer variables and the + number of capturing parenthesized groups in the pattern being matched. + On a 64-bit system the frame size for a pattern with no captures is 128 + bytes. For each capturing group the size increases by 16 bytes. + + Until release 10.41, an initial 20KiB frames vector was allocated on + the system stack, but this still caused some issues for multi-thread + applications where each thread has a very small stack. From release + 10.41 backtracking memory frames are always held in heap memory. An + initial heap allocation is obtained the first time any match data block + is passed to pcre2_match(). This is remembered with the match data + block and re-used if that block is used for another match. It is freed + when the match data block itself is freed. + + The size of the initial block is the larger of 20KiB or ten times the + pattern's frame size, unless the heap limit is less than this, in which + case the heap limit is used. If the initial block proves to be too + small during matching, it is replaced by a larger block, subject to the + heap limit. The heap limit is checked only when a new block is to be + allocated. Reducing the heap limit between calls to pcre2_match() with + the same match data block does not affect the saved block. + + In contrast to pcre2_match(), pcre2_dfa_match() does use recursive + function calls, but only for processing atomic groups, lookaround as- + sertions, and recursion within the pattern. The original version of the + code used to allocate quite large internal workspace vectors on the + stack, which caused some problems for some patterns in environments + with small stacks. From release 10.32 the code for pcre2_dfa_match() + has been re-factored to use heap memory when necessary for internal + workspace when recursing, though recursive function calls are still + used. + + The "match depth" parameter can be used to limit the depth of function + recursion, and the "match heap" parameter to limit heap memory in + pcre2_dfa_match(). + + +PROCESSING TIME + + Certain items in regular expression patterns are processed more effi- + ciently than others. It is more efficient to use a character class like + [aeiou] than a set of single-character alternatives such as + (a|e|i|o|u). In general, the simplest construction that provides the + required behaviour is usually the most efficient. Jeffrey Friedl's book + contains a lot of useful general discussion about optimizing regular + expressions for efficient performance. This document contains a few ob- + servations about PCRE2. + + Using Unicode character properties (the \p, \P, and \X escapes) is + slow, because PCRE2 has to use a multi-stage table lookup whenever it + needs a character's property. If you can find an alternative pattern + that does not use character properties, it will probably be faster. + + By default, the escape sequences \b, \d, \s, and \w, and the POSIX + character classes such as [:alpha:] do not use Unicode properties, + partly for backwards compatibility, and partly for performance reasons. + However, you can set the PCRE2_UCP option or start the pattern with + (*UCP) if you want Unicode character properties to be used. This can + double the matching time for items such as \d, when matched with + pcre2_match(); the performance loss is less with a DFA matching func- + tion, and in both cases there is not much difference for \b. + + When a pattern begins with .* not in atomic parentheses, nor in paren- + theses that are the subject of a backreference, and the PCRE2_DOTALL + option is set, the pattern is implicitly anchored by PCRE2, since it + can match only at the start of a subject string. If the pattern has + multiple top-level branches, they must all be anchorable. The optimiza- + tion can be disabled by the PCRE2_NO_DOTSTAR_ANCHOR option, and is au- + tomatically disabled if the pattern contains (*PRUNE) or (*SKIP). + + If PCRE2_DOTALL is not set, PCRE2 cannot make this optimization, be- + cause the dot metacharacter does not then match a newline, and if the + subject string contains newlines, the pattern may match from the char- + acter immediately following one of them instead of from the very start. + For example, the pattern + + .*second + + matches the subject "first\nand second" (where \n stands for a newline + character), with the match starting at the seventh character. In order + to do this, PCRE2 has to retry the match starting after every newline + in the subject. + + If you are using such a pattern with subject strings that do not con- + tain newlines, the best performance is obtained by setting + PCRE2_DOTALL, or starting the pattern with ^.* or ^.*? to indicate ex- + plicit anchoring. That saves PCRE2 from having to scan along the sub- + ject looking for a newline to restart at. + + Beware of patterns that contain nested indefinite repeats. These can + take a long time to run when applied to a string that does not match. + Consider the pattern fragment + + ^(a+)* + + This can match "aaaa" in 16 different ways, and this number increases + very rapidly as the string gets longer. (The * repeat can match 0, 1, + 2, 3, or 4 times, and for each of those cases other than 0 or 4, the + + repeats can match different numbers of times.) When the remainder of + the pattern is such that the entire match is going to fail, PCRE2 has + in principle to try every possible variation, and this can take an ex- + tremely long time, even for relatively short strings. + + An optimization catches some of the more simple cases such as + + (a+)*b + + where a literal character follows. Before embarking on the standard + matching procedure, PCRE2 checks that there is a "b" later in the sub- + ject string, and if there is not, it fails the match immediately. How- + ever, when there is no following literal this optimization cannot be + used. You can see the difference by comparing the behaviour of + + (a+)*\d + + with the pattern above. The former gives a failure almost instantly + when applied to a whole line of "a" characters, whereas the latter + takes an appreciable time with strings longer than about 20 characters. + + In many cases, the solution to this kind of performance issue is to use + an atomic group or a possessive quantifier. This can often reduce mem- + ory requirements as well. As another example, consider this pattern: + + ([^<]|<(?!inet))+ + + It matches from wherever it starts until it encounters " + + int pcre2_regcomp(regex_t *preg, const char *pattern, + int cflags); + + int pcre2_regexec(const regex_t *preg, const char *string, + size_t nmatch, regmatch_t pmatch[], int eflags); + + size_t pcre2_regerror(int errcode, const regex_t *preg, + char *errbuf, size_t errbuf_size); + + void pcre2_regfree(regex_t *preg); + + +DESCRIPTION + + This set of functions provides a POSIX-style API for the PCRE2 regular + expression 8-bit library. There are no POSIX-style wrappers for PCRE2's + 16-bit and 32-bit libraries. See the pcre2api documentation for a de- + scription of PCRE2's native API, which contains much additional func- + tionality. + + IMPORTANT NOTE: The functions described here are NOT thread-safe, and + should not be used in multi-threaded applications. They are also lim- + ited to processing subjects that are not bigger than 2GB. Use the na- + tive API instead. + + These functions are wrapper functions that ultimately call the PCRE2 + native API. Their prototypes are defined in the pcre2posix.h header + file, and they all have unique names starting with pcre2_. However, the + pcre2posix.h header also contains macro definitions that convert the + standard POSIX names such regcomp() into pcre2_regcomp() etc. This + means that a program can use the usual POSIX names without running the + risk of accidentally linking with POSIX functions from a different li- + brary. + + On Unix-like systems the PCRE2 POSIX library is called libpcre2-posix, + so can be accessed by adding -lpcre2-posix to the command for linking + an application. Because the POSIX functions call the native ones, it is + also necessary to add -lpcre2-8. + + On Windows systems, if you are linking to a DLL version of the library, + it is recommended that PCRE2POSIX_SHARED is defined before including + the pcre2posix.h header, as it will allow for a more efficient way to + invoke the functions by adding the __declspec(dllimport) decorator. + + Although they were not defined as prototypes in pcre2posix.h, releases + 10.33 to 10.36 of the library contained functions with the POSIX names + regcomp() etc. These simply passed their arguments to the PCRE2 func- + tions. These functions were provided for backwards compatibility with + earlier versions of PCRE2, which had only POSIX names. However, this + has proved troublesome in situations where a program links with several + libraries, some of which use PCRE2's POSIX interface while others use + the real POSIX functions. For this reason, the POSIX names have been + removed since release 10.37. + + Calling the header file pcre2posix.h avoids any conflict with other + POSIX libraries. It can, of course, be renamed or aliased as regex.h, + which is the "correct" name, if there is no clash. It provides two + structure types, regex_t for compiled internal forms, and regmatch_t + for returning captured substrings. It also defines some constants whose + names start with "REG_"; these are used for setting options and identi- + fying error codes. + + +USING THE POSIX FUNCTIONS + + Note that these functions are just POSIX-style wrappers for PCRE2's na- + tive API. They do not give POSIX regular expression behaviour, and + they are not thread-safe or even POSIX compatible. + + Those POSIX option bits that can reasonably be mapped to PCRE2 native + options have been implemented. In addition, the option REG_EXTENDED is + defined with the value zero. This has no effect, but since programs + that are written to the POSIX interface often use it, this makes it + easier to slot in PCRE2 as a replacement library. Other POSIX options + are not even defined. + + There are also some options that are not defined by POSIX. These have + been added at the request of users who want to make use of certain + PCRE2-specific features via the POSIX calling interface or to add BSD + or GNU functionality. + + When PCRE2 is called via these functions, it is only the API that is + POSIX-like in style. The syntax and semantics of the regular expres- + sions themselves are still those of Perl, subject to the setting of + various PCRE2 options, as described below. "POSIX-like in style" means + that the API approximates to the POSIX definition; it is not fully + POSIX-compatible, and in multi-unit encoding domains it is probably + even less compatible. + + The descriptions below use the actual names of the functions, but, as + described above, the standard POSIX names (without the pcre2_ prefix) + may also be used. + + +COMPILING A PATTERN + + The function pcre2_regcomp() is called to compile a pattern into an in- + ternal form. By default, the pattern is a C string terminated by a bi- + nary zero (but see REG_PEND below). The preg argument is a pointer to a + regex_t structure that is used as a base for storing information about + the compiled regular expression. It is also used for input when + REG_PEND is set. The regex_t structure used by pcre2_regcomp() is de- + fined in pcre2posix.h and is not the same as the structure used by + other libraries that provide POSIX-style matching. + + The argument cflags is either zero, or contains one or more of the bits + defined by the following macros: + + REG_DOTALL + + The PCRE2_DOTALL option is set when the regular expression is passed + for compilation to the native function. Note that REG_DOTALL is not + part of the POSIX standard. + + REG_ICASE + + The PCRE2_CASELESS option is set when the regular expression is passed + for compilation to the native function. + + REG_NEWLINE + + The PCRE2_MULTILINE option is set when the regular expression is passed + for compilation to the native function. Note that this does not mimic + the defined POSIX behaviour for REG_NEWLINE (see the following sec- + tion). + + REG_NOSPEC + + The PCRE2_LITERAL option is set when the regular expression is passed + for compilation to the native function. This disables all meta charac- + ters in the pattern, causing it to be treated as a literal string. The + only other options that are allowed with REG_NOSPEC are REG_ICASE, + REG_NOSUB, REG_PEND, and REG_UTF. Note that REG_NOSPEC is not part of + the POSIX standard. + + REG_NOSUB + + When a pattern that is compiled with this flag is passed to + pcre2_regexec() for matching, the nmatch and pmatch arguments are ig- + nored, and no captured strings are returned. Versions of the PCRE2 li- + brary prior to 10.22 used to set the PCRE2_NO_AUTO_CAPTURE compile op- + tion, but this no longer happens because it disables the use of back- + references. + + REG_PEND + + If this option is set, the reg_endp field in the preg structure (which + has the type const char *) must be set to point to the character beyond + the end of the pattern before calling pcre2_regcomp(). The pattern it- + self may now contain binary zeros, which are treated as data charac- + ters. Without REG_PEND, a binary zero terminates the pattern and the + re_endp field is ignored. This is a GNU extension to the POSIX standard + and should be used with caution in software intended to be portable to + other systems. + + REG_UCP + + The PCRE2_UCP option is set when the regular expression is passed for + compilation to the native function. This causes PCRE2 to use Unicode + properties when matching \d, \w, etc., instead of just recognizing + ASCII values. Note that REG_UCP is not part of the POSIX standard. + + REG_UNGREEDY + + The PCRE2_UNGREEDY option is set when the regular expression is passed + for compilation to the native function. Note that REG_UNGREEDY is not + part of the POSIX standard. + + REG_UTF + + The PCRE2_UTF option is set when the regular expression is passed for + compilation to the native function. This causes the pattern itself and + all data strings used for matching it to be treated as UTF-8 strings. + Note that REG_UTF is not part of the POSIX standard. + + In the absence of these flags, no options are passed to the native + function. This means that the regex is compiled with PCRE2 default se- + mantics. In particular, the way it handles newline characters in the + subject string is the Perl way, not the POSIX way. Note that setting + PCRE2_MULTILINE has only some of the effects specified for REG_NEWLINE. + It does not affect the way newlines are matched by the dot metacharac- + ter (they are not) or by a negative class such as [^a] (they are). + + The yield of pcre2_regcomp() is zero on success, and non-zero other- + wise. The preg structure is filled in on success, and one other member + of the structure (as well as re_endp) is public: re_nsub contains the + number of capturing subpatterns in the regular expression. Various er- + ror codes are defined in the header file. + + NOTE: If the yield of pcre2_regcomp() is non-zero, you must not attempt + to use the contents of the preg structure. If, for example, you pass it + to pcre2_regexec(), the result is undefined and your program is likely + to crash. + + +MATCHING NEWLINE CHARACTERS + + This area is not simple, because POSIX and Perl take different views of + things. It is not possible to get PCRE2 to obey POSIX semantics, but + then PCRE2 was never intended to be a POSIX engine. The following table + lists the different possibilities for matching newline characters in + Perl and PCRE2: + + Default Change with + + . matches newline no PCRE2_DOTALL + newline matches [^a] yes not changeable + $ matches \n at end yes PCRE2_DOLLAR_ENDONLY + $ matches \n in middle no PCRE2_MULTILINE + ^ matches \n in middle no PCRE2_MULTILINE + + This is the equivalent table for a POSIX-compatible pattern matcher: + + Default Change with + + . matches newline yes REG_NEWLINE + newline matches [^a] yes REG_NEWLINE + $ matches \n at end no REG_NEWLINE + $ matches \n in middle no REG_NEWLINE + ^ matches \n in middle no REG_NEWLINE + + This behaviour is not what happens when PCRE2 is called via its POSIX + API. By default, PCRE2's behaviour is the same as Perl's, except that + there is no equivalent for PCRE2_DOLLAR_ENDONLY in Perl. In both PCRE2 + and Perl, there is no way to stop newline from matching [^a]. + + Default POSIX newline handling can be obtained by setting PCRE2_DOTALL + and PCRE2_DOLLAR_ENDONLY when calling pcre2_compile() directly, but + there is no way to make PCRE2 behave exactly as for the REG_NEWLINE ac- + tion. When using the POSIX API, passing REG_NEWLINE to PCRE2's + pcre2_regcomp() function causes PCRE2_MULTILINE to be passed to + pcre2_compile(), and REG_DOTALL passes PCRE2_DOTALL. There is no way to + pass PCRE2_DOLLAR_ENDONLY. + + +MATCHING A PATTERN + + The function pcre2_regexec() is called to match a compiled pattern preg + against a given string, which is by default terminated by a zero byte + (but see REG_STARTEND below), subject to the options in eflags. These + can be: + + REG_NOTBOL + + The PCRE2_NOTBOL option is set when calling the underlying PCRE2 match- + ing function. + + REG_NOTEMPTY + + The PCRE2_NOTEMPTY option is set when calling the underlying PCRE2 + matching function. Note that REG_NOTEMPTY is not part of the POSIX + standard. However, setting this option can give more POSIX-like behav- + iour in some situations. + + REG_NOTEOL + + The PCRE2_NOTEOL option is set when calling the underlying PCRE2 match- + ing function. + + REG_STARTEND + + When this option is set, the subject string starts at string + + pmatch[0].rm_so and ends at string + pmatch[0].rm_eo, which should + point to the first character beyond the string. There may be binary ze- + ros within the subject string, and indeed, using REG_STARTEND is the + only way to pass a subject string that contains a binary zero. + + Whatever the value of pmatch[0].rm_so, the offsets of the matched + string and any captured substrings are still given relative to the + start of string itself. (Before PCRE2 release 10.30 these were given + relative to string + pmatch[0].rm_so, but this differs from other im- + plementations.) + + This is a BSD extension, compatible with but not specified by IEEE + Standard 1003.2 (POSIX.2), and should be used with caution in software + intended to be portable to other systems. Note that a non-zero rm_so + does not imply REG_NOTBOL; REG_STARTEND affects only the location and + length of the string, not how it is matched. Setting REG_STARTEND and + passing pmatch as NULL are mutually exclusive; the error REG_INVARG is + returned. + + If the pattern was compiled with the REG_NOSUB flag, no data about any + matched strings is returned. The nmatch and pmatch arguments of + pcre2_regexec() are ignored (except possibly as input for REG_STAR- + TEND). + + The value of nmatch may be zero, and the value pmatch may be NULL (un- + less REG_STARTEND is set); in both these cases no data about any + matched strings is returned. + + Otherwise, the portion of the string that was matched, and also any + captured substrings, are returned via the pmatch argument, which points + to an array of nmatch structures of type regmatch_t, containing the + members rm_so and rm_eo. These contain the byte offset to the first + character of each substring and the offset to the first character after + the end of each substring, respectively. The 0th element of the vector + relates to the entire portion of string that was matched; subsequent + elements relate to the capturing subpatterns of the regular expression. + Unused entries in the array have both structure members set to -1. + + regmatch_t as well as the regoff_t typedef it uses are defined in + pcre2posix.h and are not warranted to have the same size or layout as + other similarly named types from other libraries that provide POSIX- + style matching. + + A successful match yields a zero return; various error codes are de- + fined in the header file, of which REG_NOMATCH is the "expected" fail- + ure code. + + +ERROR MESSAGES + + The pcre2_regerror() function maps a non-zero errorcode from either + pcre2_regcomp() or pcre2_regexec() to a printable message. If preg is + not NULL, the error should have arisen from the use of that structure. + A message terminated by a binary zero is placed in errbuf. If the + buffer is too short, only the first errbuf_size - 1 characters of the + error message are used. The yield of the function is the size of buffer + needed to hold the whole message, including the terminating zero. This + value is greater than errbuf_size if the message was truncated. + + +MEMORY USAGE + + Compiling a regular expression causes memory to be allocated and asso- + ciated with the preg structure. The function pcre2_regfree() frees all + such memory, after which preg may no longer be used as a compiled ex- + pression. + + +AUTHOR + + Philip Hazel + Retired from University Computing Service + Cambridge, England. + + +REVISION + + Last updated: 27 November 2024 + Copyright (c) 1997-2024 University of Cambridge. + + +PCRE2 10.46 27 November 2024 PCRE2POSIX(3) +------------------------------------------------------------------------------ + + +PCRE2SAMPLE(3) Library Functions Manual PCRE2SAMPLE(3) + + +NAME + PCRE2 - Perl-compatible regular expressions (revised API) + + +PCRE2 SAMPLE PROGRAM + + A simple, complete demonstration program to get you started with using + PCRE2 is supplied in the file pcre2demo.c in the src directory in the + PCRE2 distribution. A listing of this program is given in the pcre2demo + documentation. If you do not have a copy of the PCRE2 distribution, you + can save this listing to re-create the contents of pcre2demo.c. + + The demonstration program compiles the regular expression that is its + first argument, and matches it against the subject string in its second + argument. No PCRE2 options are set, and default character tables are + used. If matching succeeds, the program outputs the portion of the sub- + ject that matched, together with the contents of any captured sub- + strings. + + If the -g option is given on the command line, the program then goes on + to check for further matches of the same regular expression in the same + subject string. The logic is a little bit tricky because of the possi- + bility of matching an empty string. Comments in the code explain what + is going on. + + The code in pcre2demo.c is an 8-bit program that uses the PCRE2 8-bit + library. It handles strings and characters that are stored in 8-bit + code units. By default, one character corresponds to one code unit, + but if the pattern starts with "(*UTF)", both it and the subject are + treated as UTF-8 strings, where characters may occupy multiple code + units. + + If PCRE2 is installed in the standard include and library directories + for your operating system, you should be able to compile the demonstra- + tion program using a command like this: + + cc -o pcre2demo pcre2demo.c -lpcre2-8 + + If PCRE2 is installed elsewhere, you may need to add additional options + to the command line. For example, on a Unix-like system that has PCRE2 + installed in /usr/local, you can compile the demonstration program us- + ing a command like this: + + cc -o pcre2demo -I/usr/local/include pcre2demo.c \ + -L/usr/local/lib -lpcre2-8 + + Once you have built the demonstration program, you can run simple tests + like this: + + ./pcre2demo 'cat|dog' 'the cat sat on the mat' + ./pcre2demo -g 'cat|dog' 'the dog sat on the cat' + + Note that there is a much more comprehensive test program, called + pcre2test, which supports many more facilities for testing regular ex- + pressions using all three PCRE2 libraries (8-bit, 16-bit, and 32-bit, + though not all three need be installed). The pcre2demo program is pro- + vided as a relatively simple coding example. + + If you try to run pcre2demo when PCRE2 is not installed in the standard + library directory, you may get an error like this on some operating + systems (e.g. Solaris): + + ld.so.1: pcre2demo: fatal: libpcre2-8.so.0: open failed: No such file + or directory + + This is caused by the way shared library support works on those sys- + tems. You need to add + + -R/usr/local/lib + + (for example) to the compile command to get round this problem. + + +AUTHOR + + Philip Hazel + Retired from University Computing Service + Cambridge, England. + + +REVISION + + Last updated: 14 November 2023 + Copyright (c) 1997-2016 University of Cambridge. + + +PCRE2 10.46 14 November 2023 PCRE2SAMPLE(3) +------------------------------------------------------------------------------ +PCRE2SERIALIZE(3) Library Functions Manual PCRE2SERIALIZE(3) + + +NAME + PCRE2 - Perl-compatible regular expressions (revised API) + + +SAVING AND RE-USING PRECOMPILED PCRE2 PATTERNS + + int32_t pcre2_serialize_decode(pcre2_code **codes, + int32_t number_of_codes, const uint8_t *bytes, + pcre2_general_context *gcontext); + + int32_t pcre2_serialize_encode(const pcre2_code **codes, + int32_t number_of_codes, uint8_t **serialized_bytes, + PCRE2_SIZE *serialized_size, pcre2_general_context *gcontext); + + void pcre2_serialize_free(uint8_t *bytes); + + int32_t pcre2_serialize_get_number_of_codes(const uint8_t *bytes); + + If you are running an application that uses a large number of regular + expression patterns, it may be useful to store them in a precompiled + form instead of having to compile them every time the application is + run. However, if you are using the just-in-time optimization feature, + it is not possible to save and reload the JIT data, because it is posi- + tion-dependent. The host on which the patterns are reloaded must be + running the same version of PCRE2, with the same code unit width, and + must also have the same endianness, pointer width and PCRE2_SIZE type. + For example, patterns compiled on a 32-bit system using PCRE2's 16-bit + library cannot be reloaded on a 64-bit system, nor can they be reloaded + using the 8-bit library. + + Note that "serialization" in PCRE2 does not convert compiled patterns + to an abstract format like Java or .NET serialization. The serialized + output is really just a bytecode dump, which is why it can only be re- + loaded in the same environment as the one that created it. Hence the + restrictions mentioned above. Applications that are not statically + linked with a fixed version of PCRE2 must be prepared to recompile pat- + terns from their sources, in order to be immune to PCRE2 upgrades. + + +SECURITY CONCERNS + + The facility for saving and restoring compiled patterns is intended for + use within individual applications. As such, the data supplied to + pcre2_serialize_decode() is expected to be trusted data, not data from + arbitrary external sources. There is only some simple consistency + checking, not complete validation of what is being re-loaded. Corrupted + data may cause undefined results. For example, if the length field of a + pattern in the serialized data is corrupted, the deserializing code may + read beyond the end of the byte stream that is passed to it. + + +SAVING COMPILED PATTERNS + + Before compiled patterns can be saved they must be serialized, which in + PCRE2 means converting the pattern to a stream of bytes. A single byte + stream may contain any number of compiled patterns, but they must all + use the same character tables. A single copy of the tables is included + in the byte stream (its size is 1088 bytes). For more details of char- + acter tables, see the section on locale support in the pcre2api docu- + mentation. + + The function pcre2_serialize_encode() creates a serialized byte stream + from a list of compiled patterns. Its first two arguments specify the + list, being a pointer to a vector of pointers to compiled patterns, and + the length of the vector. The third and fourth arguments point to vari- + ables which are set to point to the created byte stream and its length, + respectively. The final argument is a pointer to a general context, + which can be used to specify custom memory management functions. If + this argument is NULL, malloc() is used to obtain memory for the byte + stream. The yield of the function is the number of serialized patterns, + or one of the following negative error codes: + + PCRE2_ERROR_BADDATA the number of patterns is zero or less + PCRE2_ERROR_BADMAGIC mismatch of id bytes in one of the patterns + PCRE2_ERROR_NOMEMORY memory allocation failed + PCRE2_ERROR_MIXEDTABLES the patterns do not all use the same tables + PCRE2_ERROR_NULL the 1st, 3rd, or 4th argument is NULL + + PCRE2_ERROR_BADMAGIC means either that a pattern's code has been cor- + rupted, or that a slot in the vector does not point to a compiled pat- + tern. + + Once a set of patterns has been serialized you can save the data in any + appropriate manner. Here is sample code that compiles two patterns and + writes them to a file. It assumes that the variable fd refers to a file + that is open for output. The error checking that should be present in a + real application has been omitted for simplicity. + + int errorcode; + uint8_t *bytes; + PCRE2_SIZE erroroffset; + PCRE2_SIZE bytescount; + pcre2_code *list_of_codes[2]; + list_of_codes[0] = pcre2_compile("first pattern", + PCRE2_ZERO_TERMINATED, 0, &errorcode, &erroroffset, NULL); + list_of_codes[1] = pcre2_compile("second pattern", + PCRE2_ZERO_TERMINATED, 0, &errorcode, &erroroffset, NULL); + errorcode = pcre2_serialize_encode(list_of_codes, 2, &bytes, + &bytescount, NULL); + errorcode = fwrite(bytes, 1, bytescount, fd); + + Note that the serialized data is binary data that may contain any of + the 256 possible byte values. On systems that make a distinction be- + tween binary and non-binary data, be sure that the file is opened for + binary output. + + Serializing a set of patterns leaves the original data untouched, so + they can still be used for matching. Their memory must eventually be + freed in the usual way by calling pcre2_code_free(). When you have fin- + ished with the byte stream, it too must be freed by calling pcre2_seri- + alize_free(). If this function is called with a NULL argument, it re- + turns immediately without doing anything. + + +RE-USING PRECOMPILED PATTERNS + + In order to re-use a set of saved patterns you must first make the se- + rialized byte stream available in main memory (for example, by reading + from a file). The management of this memory block is up to the applica- + tion. You can use the pcre2_serialize_get_number_of_codes() function to + find out how many compiled patterns are in the serialized data without + actually decoding the patterns: + + uint8_t *bytes = ; + int32_t number_of_codes = pcre2_serialize_get_number_of_codes(bytes); + + The pcre2_serialize_decode() function reads a byte stream and recreates + the compiled patterns in new memory blocks, setting pointers to them in + a vector. The first two arguments are a pointer to a suitable vector + and its length, and the third argument points to a byte stream. The fi- + nal argument is a pointer to a general context, which can be used to + specify custom memory management functions for the decoded patterns. If + this argument is NULL, malloc() and free() are used. After deserializa- + tion, the byte stream is no longer needed and can be discarded. + + pcre2_code *list_of_codes[2]; + uint8_t *bytes = ; + int32_t number_of_codes = + pcre2_serialize_decode(list_of_codes, 2, bytes, NULL); + + If the vector is not large enough for all the patterns in the byte + stream, it is filled with those that fit, and the remainder are ig- + nored. The yield of the function is the number of decoded patterns, or + one of the following negative error codes: + + PCRE2_ERROR_BADDATA second argument is zero or less + PCRE2_ERROR_BADMAGIC mismatch of id bytes in the data + PCRE2_ERROR_BADMODE mismatch of code unit size or PCRE2 version + PCRE2_ERROR_BADSERIALIZEDDATA other sanity check failure + PCRE2_ERROR_MEMORY memory allocation failed + PCRE2_ERROR_NULL first or third argument is NULL + + PCRE2_ERROR_BADMAGIC may mean that the data is corrupt, or that it was + compiled on a system with different endianness. + + Decoded patterns can be used for matching in the usual way, and must be + freed by calling pcre2_code_free(). However, be aware that there is a + potential race issue if you are using multiple patterns that were de- + coded from a single byte stream in a multithreaded application. A sin- + gle copy of the character tables is used by all the decoded patterns + and a reference count is used to arrange for its memory to be automati- + cally freed when the last pattern is freed, but there is no locking on + this reference count. Therefore, if you want to call pcre2_code_free() + for these patterns in different threads, you must arrange your own + locking, and ensure that pcre2_code_free() cannot be called by two + threads at the same time. + + If a pattern was processed by pcre2_jit_compile() before being serial- + ized, the JIT data is discarded and so is no longer available after a + save/restore cycle. You can, however, process a restored pattern with + pcre2_jit_compile() if you wish. + + +AUTHOR + + Philip Hazel + Retired from University Computing Service + Cambridge, England. + + +REVISION + + Last updated: 19 January 2024 + Copyright (c) 1997-2018 University of Cambridge. + + +PCRE2 10.46 19 January 2024 PCRE2SERIALIZE(3) +------------------------------------------------------------------------------ + + +PCRE2SYNTAX(3) Library Functions Manual PCRE2SYNTAX(3) + + +NAME + PCRE2 - Perl-compatible regular expressions (revised API) + + +PCRE2 REGULAR EXPRESSION SYNTAX SUMMARY + + The full syntax and semantics of the regular expression patterns that + are supported by PCRE2 are described in the pcre2pattern documentation. + This document contains a quick-reference summary of the pattern syntax + followed by the syntax of replacement strings in substitution function. + The full description of the latter is in the pcre2api documentation. + + +QUOTING + + \x where x is non-alphanumeric is a literal x + \Q...\E treat enclosed characters as literal + + Note that white space inside \Q...\E is always treated as literal, even + if PCRE2_EXTENDED is set, causing most other white space to be ignored. + Note also that PCRE2's handling of \Q...\E has some differences from + Perl's. See the pcre2pattern documentation for details. + + +BRACED ITEMS + + With one exception, wherever brace characters { and } are required to + enclose data for constructions such as \g{2} or \k{name}, space and/or + horizontal tab characters that follow { or precede } are allowed and + are ignored. In the case of quantifiers, they may also appear before or + after the comma. The exception is \u{...} which is not Perl-compatible + and is recognized only when PCRE2_EXTRA_ALT_BSUX is set. This is an EC- + MAScript compatibility feature, and follows ECMAScript's behaviour. + + +ESCAPED CHARACTERS + + This table applies to ASCII and Unicode environments. An unrecognized + escape sequence causes an error. + + \a alarm, that is, the BEL character (hex 07) + \cx "control-x", where x is a non-control ASCII character + \e escape (hex 1B) + \f form feed (hex 0C) + \n newline (hex 0A) + \r carriage return (hex 0D) + \t tab (hex 09) + \0dd character with octal code 0dd + \ddd character with octal code ddd, or backreference + \o{ddd..} character with octal code ddd.. + \N{U+hh..} character with Unicode code point hh.. (Unicode mode only) + \xhh character with hex code hh + \x{hh..} character with hex code hh.. + + \N{U+hh..} is synonymous with \x{hh..} but is not supported in environ- + ments that use EBCDIC code (mainly IBM mainframes). Note that \N not + followed by an opening curly bracket has a different meaning (see be- + low). + + If PCRE2_ALT_BSUX or PCRE2_EXTRA_ALT_BSUX is set ("ALT_BSUX mode"), the + following are also recognized: + + \U the character "U" + \uhhhh character with hex code hhhh + \u{hh..} character with hex code hh.. but only for EXTRA_ALT_BSUX + + When \x is not followed by {, one or two hexadecimal digits are read, + but in ALT_BSUX mode \x must be followed by two hexadecimal digits to + be recognized as a hexadecimal escape; otherwise it matches a literal + "x". Likewise, if \u (in ALT_BSUX mode) is not followed by four hexa- + decimal digits or (in EXTRA_ALT_BSUX mode) a sequence of hex digits in + curly brackets, it matches a literal "u". + + Note that \0dd is always an octal code. The treatment of backslash fol- + lowed by a non-zero digit is complicated; for details see the section + "Non-printing characters" in the pcre2pattern documentation, where de- + tails of escape processing in EBCDIC environments are also given. + + +CHARACTER TYPES + + . any character except newline; + in dotall mode, any character whatsoever + \C one code unit, even in UTF mode (best avoided) + \d a decimal digit + \D a character that is not a decimal digit + \h a horizontal white space character + \H a character that is not a horizontal white space character + \N a character that is not a newline + \p{xx} a character with the xx property + \P{xx} a character without the xx property + \R a newline sequence + \s a white space character + \S a character that is not a white space character + \v a vertical white space character + \V a character that is not a vertical white space character + \w a "word" character + \W a "non-word" character + \X a Unicode extended grapheme cluster + + \C is dangerous because it may leave the current matching point in the + middle of a UTF-8 or UTF-16 character. The application can lock out the + use of \C by setting the PCRE2_NEVER_BACKSLASH_C option. It is also + possible to build PCRE2 with the use of \C permanently disabled. + + By default, \d, \s, and \w match only ASCII characters, even in UTF-8 + mode or in the 16-bit and 32-bit libraries. However, if locale-specific + matching is happening, \s and \w may also match characters with code + points in the range 128-255. If the PCRE2_UCP option is set, the behav- + iour of these escape sequences is changed to use Unicode properties and + they match many more characters, but there are some option settings + that can restrict individual sequences to matching only ASCII charac- + ters. + + Property descriptions in \p and \P are matched caselessly; hyphens, un- + derscores, and ASCII white space characters are ignored, in accordance + with Unicode's "loose matching" rules. For example, \p{Bidi_Class=al} + is the same as \p{ bidi class = AL }. + + +GENERAL CATEGORY PROPERTIES FOR \p and \P + + C Other + Cc Control + Cf Format + Cn Unassigned + Co Private use + Cs Surrogate + + L Letter + Lc Cased letter, the union of Ll, Lu, and Lt + L& Synonym of Lc + Ll Lower case letter + Lm Modifier letter + Lo Other letter + Lt Title case letter + Lu Upper case letter + + M Mark + Mc Spacing mark + Me Enclosing mark + Mn Non-spacing mark + + N Number + Nd Decimal number + Nl Letter number + No Other number + + P Punctuation + Pc Connector punctuation + Pd Dash punctuation + Pe Close punctuation + Pf Final punctuation + Pi Initial punctuation + Po Other punctuation + Ps Open punctuation + + S Symbol + Sc Currency symbol + Sk Modifier symbol + Sm Mathematical symbol + So Other symbol + + Z Separator + Zl Line separator + Zp Paragraph separator + Zs Space separator + + From release 10.45, when caseless matching is set, Ll, Lu, and Lt are + all equivalent to Lc. + + +PCRE2 SPECIAL CATEGORY PROPERTIES FOR \p and \P + + Xan Alphanumeric: union of properties L and N + Xps POSIX space: property Z or tab, NL, VT, FF, CR + Xsp Perl space: property Z or tab, NL, VT, FF, CR + Xuc Universally-named character: one that can be + represented by a Universal Character Name + Xwd Perl word: property Xan or underscore + + Perl and POSIX space are now the same. Perl added VT to its space char- + acter set at release 5.18. + + +BINARY PROPERTIES FOR \p AND \P + + Unicode defines a number of binary properties, that is, properties + whose only values are true or false. You can obtain a list of those + that are recognized by \p and \P, along with their abbreviations, by + running this command: + + pcre2test -LP + + +SCRIPT MATCHING WITH \p AND \P + + Many script names and their 4-letter abbreviations are recognized in + \p{sc:...} or \p{scx:...} items, or on their own with \p (and also \P + of course). You can obtain a list of these scripts by running this com- + mand: + + pcre2test -LS + + +THE BIDI_CLASS PROPERTY FOR \p AND \P + + \p{Bidi_Class:} matches a character with the given class + \p{BC:} matches a character with the given class + + The recognized classes are: + + AL Arabic letter + AN Arabic number + B paragraph separator + BN boundary neutral + CS common separator + EN European number + ES European separator + ET European terminator + FSI first strong isolate + L left-to-right + LRE left-to-right embedding + LRI left-to-right isolate + LRO left-to-right override + NSM non-spacing mark + ON other neutral + PDF pop directional format + PDI pop directional isolate + R right-to-left + RLE right-to-left embedding + RLI right-to-left isolate + RLO right-to-left override + S segment separator + WS white space + + +CHARACTER CLASSES + + [...] positive character class + [^...] negative character class + [x-y] range (can be used for hex characters) + [[:xxx:]] positive POSIX named set + [[:^xxx:]] negative POSIX named set + + alnum alphanumeric + alpha alphabetic + ascii 0-127 + blank space or tab + cntrl control character + digit decimal digit + graph printing, excluding space + lower lower case letter + print printing, including space + punct printing, excluding alphanumeric + space white space + upper upper case letter + word same as \w + xdigit hexadecimal digit + + In PCRE2, POSIX character set names recognize only ASCII characters by + default, but some of them use Unicode properties if PCRE2_UCP is set. + You can use \Q...\E inside a character class. + + When PCRE2_ALT_EXTENDED_CLASS is set, UTS#18 extended character classes + may be used, allowing nested character classes, combined using set op- + erators. + + [x&&[^y]] UTS#18 extended character class + + x||y set union (OR) + x&&y set intersection (AND) + x--y set difference (AND NOT) + x~~y set symmetric difference (XOR) + + +PERL EXTENDED CHARACTER CLASSES + + (?[...]) Perl extended character class + (?[\p{Thai} & \p{Nd}]) operators; whitespace ignored + (?[(x - y) & z]) parentheses for grouping + + (?[ [^3] & \p{Nd} ]) [...] is a nested ordinary class + (?[ [:alpha:] - [z] ]) POSIX set is allowed outside [...] + (?[ \d - [3] ]) backslash-escaped set is allowed outside + [...] + (?[ !\n & [:ascii:] ]) backslash-escaped character is allowed out- + side [...] + all other characters or ranges must be enclosed + in [...] + + x|y, x+y set union (OR) + x&y set intersection (AND) + x-y set difference (AND NOT) + x^y set symmetric difference (XOR) + !x set complement (NOT) + + Inside a Perl extended character class, [...] switches mode to be in- + terpreted as an ordinary character class. Outside of a nested [...], + the only items permitted are backslash-escapes, POSIX sets, operators, + and parentheses. Inside a nested ordinary class, ^ has its usual mean- + ing (inverts the class when used as the first character); outside of a + nested class, ^ is the XOR operator. + + +QUANTIFIERS + + ? 0 or 1, greedy + ?+ 0 or 1, possessive + ?? 0 or 1, lazy + * 0 or more, greedy + *+ 0 or more, possessive + *? 0 or more, lazy + + 1 or more, greedy + ++ 1 or more, possessive + +? 1 or more, lazy + {n} exactly n + {n,m} at least n, no more than m, greedy + {n,m}+ at least n, no more than m, possessive + {n,m}? at least n, no more than m, lazy + {n,} n or more, greedy + {n,}+ n or more, possessive + {n,}? n or more, lazy + {,m} zero up to m, greedy + {,m}+ zero up to m, possessive + {,m}? zero up to m, lazy + + +ANCHORS AND SIMPLE ASSERTIONS + + \b word boundary + \B not a word boundary + ^ start of subject + also after an internal newline in multiline mode + (after any newline if PCRE2_ALT_CIRCUMFLEX is set) + \A start of subject + $ end of subject + also before newline at end of subject + also before internal newline in multiline mode + \Z end of subject + also before newline at end of subject + \z end of subject + \G first matching position in subject + + +REPORTED MATCH POINT SETTING + + \K set reported start of match + + From release 10.38 \K is not permitted by default in lookaround asser- + tions, for compatibility with Perl. However, if the PCRE2_EXTRA_AL- + LOW_LOOKAROUND_BSK option is set, the previous behaviour is re-enabled. + When this option is set, \K is honoured in positive assertions, but ig- + nored in negative ones. + + +ALTERNATION + + expr|expr|expr... + + +CAPTURING + + (...) capture group + (?...) named capture group (Perl) + (?'name'...) named capture group (Perl) + (?P...) named capture group (Python) + (?:...) non-capture group + (?|...) non-capture group; reset group numbers for + capture groups in each alternative + + In non-UTF modes, names may contain underscores and ASCII letters and + digits; in UTF modes, any Unicode letters and Unicode decimal digits + are permitted. In both cases, a name must not start with a digit. + + +ATOMIC GROUPS + + (?>...) atomic non-capture group + (*atomic:...) atomic non-capture group + + +COMMENT + + (?#....) comment (not nestable) + + +OPTION SETTING + Changes of these options within a group are automatically cancelled at + the end of the group. + + (?a) all ASCII options + (?aD) restrict \d to ASCII in UCP mode + (?aS) restrict \s to ASCII in UCP mode + (?aW) restrict \w to ASCII in UCP mode + (?aP) restrict all POSIX classes to ASCII in UCP mode + (?aT) restrict POSIX digit classes to ASCII in UCP mode + (?i) caseless + (?J) allow duplicate named groups + (?m) multiline + (?n) no auto capture + (?r) restrict caseless to either ASCII or non-ASCII + (?s) single line (dotall) + (?U) default ungreedy (lazy) + (?x) ignore white space except in classes or \Q...\E + (?xx) as (?x) but also ignore space and tab in classes + (?-...) unset the given option(s) + (?^) unset imnrsx options + + (?aP) implies (?aT) as well, though this has no additional effect. How- + ever, it means that (?-aP) also implies (?-aT) and disables all ASCII + restrictions for POSIX classes. + + Unsetting x or xx unsets both. Several options may be set at once, and + a mixture of setting and unsetting such as (?i-x) is allowed, but there + may be only one hyphen. Setting (but no unsetting) is allowed after (?^ + for example (?^in). An option setting may appear at the start of a non- + capture group, for example (?i:...). + + The following are recognized only at the very start of a pattern or af- + ter one of the newline or \R sequences or options with similar syntax. + More than one of them may appear. For the first three, d is a decimal + number. + + (*LIMIT_DEPTH=d) set the backtracking limit to d + (*LIMIT_HEAP=d) set the heap size limit to d * 1024 bytes + (*LIMIT_MATCH=d) set the match limit to d + (*CASELESS_RESTRICT) set PCRE2_EXTRA_CASELESS_RESTRICT when matching + (*NOTEMPTY) set PCRE2_NOTEMPTY when matching + (*NOTEMPTY_ATSTART) set PCRE2_NOTEMPTY_ATSTART when matching + (*NO_AUTO_POSSESS) no auto-possessification (PCRE2_NO_AUTO_POSSESS) + (*NO_DOTSTAR_ANCHOR) no .* anchoring (PCRE2_NO_DOTSTAR_ANCHOR) + (*NO_JIT) disable JIT optimization + (*NO_START_OPT) no start-match optimization (PCRE2_NO_START_OP- + TIMIZE) + (*TURKISH_CASING) set PCRE2_EXTRA_TURKISH_CASING when matching + (*UTF) set appropriate UTF mode for the library in use + (*UCP) set PCRE2_UCP (use Unicode properties for \d + etc) + + Note that LIMIT_DEPTH, LIMIT_HEAP, and LIMIT_MATCH can only reduce the + value of the limits set by the caller of pcre2_match() or + pcre2_dfa_match(), not increase them. LIMIT_RECURSION is an obsolete + synonym for LIMIT_DEPTH. The application can lock out the use of (*UTF) + and (*UCP) by setting the PCRE2_NEVER_UTF or PCRE2_NEVER_UCP options, + respectively, at compile time. + + +NEWLINE CONVENTION + + These are recognized only at the very start of the pattern or after op- + tion settings with a similar syntax. + + (*CR) carriage return only + (*LF) linefeed only + (*CRLF) carriage return followed by linefeed + (*ANYCRLF) all three of the above + (*ANY) any Unicode newline sequence + (*NUL) the NUL character (binary zero) + + +WHAT \R MATCHES + + These are recognized only at the very start of the pattern or after op- + tion setting with a similar syntax. + + (*BSR_ANYCRLF) CR, LF, or CRLF + (*BSR_UNICODE) any Unicode newline sequence + + +LOOKAHEAD AND LOOKBEHIND ASSERTIONS + + (?=...) ) + (*pla:...) ) positive lookahead + (*positive_lookahead:...) ) + + (?!...) ) + (*nla:...) ) negative lookahead + (*negative_lookahead:...) ) + + (?<=...) ) + (*plb:...) ) positive lookbehind + (*positive_lookbehind:...) ) + + (? name + 'name' name + + +SCRIPT RUNS + + (*script_run:...) ) script run, can be backtracked into + (*sr:...) ) + + (*atomic_script_run:...) ) atomic script run + (*asr:...) ) + + +BACKREFERENCES + + \n reference by number (can be ambiguous) + \gn reference by number + \g{n} reference by number + \g+n relative reference by number (PCRE2 extension) + \g-n relative reference by number + \g{+n} relative reference by number (PCRE2 extension) + \g{-n} relative reference by number + \k reference by name (Perl) + \k'name' reference by name (Perl) + \g{name} reference by name (Perl) + \k{name} reference by name (.NET) + (?P=name) reference by name (Python) + + +SUBROUTINE REFERENCES (POSSIBLY RECURSIVE) + + (?R) recurse whole pattern + (?n) call subroutine by absolute number + (?+n) call subroutine by relative number + (?-n) call subroutine by relative number + (?&name) call subroutine by name (Perl) + (?P>name) call subroutine by name (Python) + \g call subroutine by name (Oniguruma) + \g'name' call subroutine by name (Oniguruma) + \g call subroutine by absolute number (Oniguruma) + \g'n' call subroutine by absolute number (Oniguruma) + \g<+n> call subroutine by relative number (PCRE2 extension) + \g'+n' call subroutine by relative number (PCRE2 extension) + \g<-n> call subroutine by relative number (PCRE2 extension) + \g'-n' call subroutine by relative number (PCRE2 extension) + + +CONDITIONAL PATTERNS + + (?(condition)yes-pattern) + (?(condition)yes-pattern|no-pattern) + + (?(n) absolute reference condition + (?(+n) relative reference condition (PCRE2 extension) + (?(-n) relative reference condition (PCRE2 extension) + (?() named reference condition (Perl) + (?('name') named reference condition (Perl) + (?(name) named reference condition (PCRE2, deprecated) + (?(R) overall recursion condition + (?(Rn) specific numbered group recursion condition + (?(R&name) specific named group recursion condition + (?(DEFINE) define groups for reference + (?(VERSION[>]=n.m) test PCRE2 version + (?(assert) assertion condition + + Note the ambiguity of (?(R) and (?(Rn) which might be named reference + conditions or recursion tests. Such a condition is interpreted as a + reference condition if the relevant named group exists. + + +BACKTRACKING CONTROL + + All backtracking control verbs may be in the form (*VERB:NAME). For + (*MARK) the name is mandatory, for the others it is optional. (*SKIP) + changes its behaviour if :NAME is present. The others just set a name + for passing back to the caller, but this is not a name that (*SKIP) can + see. The following act immediately they are reached: + + (*ACCEPT) force successful match + (*FAIL) force backtrack; synonym (*F) + (*MARK:NAME) set name to be passed back; synonym (*:NAME) + + The following act only when a subsequent match failure causes a back- + track to reach them. They all force a match failure, but they differ in + what happens afterwards. Those that advance the start-of-match point do + so only if the pattern is not anchored. + + (*COMMIT) overall failure, no advance of starting point + (*PRUNE) advance to next starting character + (*SKIP) advance to current matching position + (*SKIP:NAME) advance to position corresponding to an earlier + (*MARK:NAME); if not found, the (*SKIP) is ignored + (*THEN) local failure, backtrack to next alternation + + The effect of one of these verbs in a group called as a subroutine is + confined to the subroutine call. + + +CALLOUTS + + (?C) callout (assumed number 0) + (?Cn) callout with numerical data n + (?C"text") callout with string data + + The allowed string delimiters are ` ' " ^ % # $ (which are the same for + the start and the end), and the starting delimiter { matched with the + ending delimiter }. To encode the ending delimiter within the string, + double it. + + +REPLACEMENT STRINGS + + If the PCRE2_SUBSTITUTE_LITERAL option is set, a replacement string for + pcre2_substitute() is not interpreted. Otherwise, by default, the only + special character is the dollar character in one of the following + forms: + + $$ insert a dollar character + $n or ${n} insert the contents of group n + $ insert the contents of named group + $0 or $& insert the entire matched substring + $` insert the substring that precedes the match + $' insert the substring that follows the match + $_ insert the entire input string + $*MARK or ${*MARK} insert a control verb name + + For ${n}, n can be a name or a number. If PCRE2_SUBSTITUTE_EXTENDED is + set, there is additional interpretation: + + 1. Backslash is an escape character, and the forms described in "ES- + CAPED CHARACTERS" above are recognized. Also: + + \Q...\E can be used to suppress interpretation + \l force the next character to lower case + \u force the next character to upper case + \L force subsequent characters to lower case + \U force subsequent characters to upper case + \u\L force next character to upper case, then all lower + \l\U force next character to lower case, then all upper + \E end \L or \U case forcing + \b backspace character (note: as in character class in pat- + tern) + \v vertical tab character (note: not the same as in a pattern) + + 2. The Python form \g, where the angle brackets are part of the syn- + tax and n is either a group name or a number, is recognized as an al- + ternative way of inserting the contents of a group, for example \g<3>. + + 3. Capture substitution supports the following additional forms: + + ${n:-string} default for unset group + ${n:+string1:string2} values for set/unset group + + The substitution strings themselves are expanded. Backslash can be used + to escape colons and closing curly brackets. + + +SEE ALSO + + pcre2pattern(3), pcre2api(3), pcre2callout(3), pcre2matching(3), + pcre2(3). + + +AUTHOR + + Philip Hazel + Retired from University Computing Service + Cambridge, England. + + +REVISION + + Last updated: 27 November 2024 + Copyright (c) 1997-2024 University of Cambridge. + + +PCRE2 10.46 27 November 2024 PCRE2SYNTAX(3) +------------------------------------------------------------------------------ + + +PCRE2UNICODE(3) Library Functions Manual PCRE2UNICODE(3) + + +NAME + PCRE2 - Perl-compatible regular expressions (revised API) + + +UNICODE AND UTF SUPPORT + + PCRE2 is normally built with Unicode support, though if you do not need + it, you can build it without, in which case the library will be + smaller. With Unicode support, PCRE2 has knowledge of Unicode character + properties and can process strings of text in UTF-8, UTF-16, and UTF-32 + format (depending on the code unit width), but this is not the default. + Unless specifically requested, PCRE2 treats each code unit in a string + as one character. + + There are two ways of telling PCRE2 to switch to UTF mode, where char- + acters may consist of more than one code unit and the range of values + is constrained. The program can call pcre2_compile() with the PCRE2_UTF + option, or the pattern may start with the sequence (*UTF). However, + the latter facility can be locked out by the PCRE2_NEVER_UTF option. + That is, the programmer can prevent the supplier of the pattern from + switching to UTF mode. + + Note that the PCRE2_MATCH_INVALID_UTF option (see below) forces + PCRE2_UTF to be set. + + In UTF mode, both the pattern and any subject strings that are matched + against it are treated as UTF strings instead of strings of individual + one-code-unit characters. There are also some other changes to the way + characters are handled, as documented below. + + +UNICODE PROPERTY SUPPORT + + When PCRE2 is built with Unicode support, the escape sequences \p{..}, + \P{..}, and \X can be used. This is not dependent on the PCRE2_UTF set- + ting. The Unicode properties that can be tested are a subset of those + that Perl supports. Currently they are limited to the general category + properties such as Lu for an upper case letter or Nd for a decimal num- + ber, the derived properties Any and Lc (synonym L&), the Unicode script + names such as Arabic or Han, Bidi_Class, Bidi_Control, and a few binary + properties. + + The full lists are given in the pcre2pattern and pcre2syntax documenta- + tion. In general, only the short names for properties are supported. + For example, \p{L} matches a letter. Its longer synonym, \p{Letter}, is + not supported. Furthermore, in Perl, many properties may optionally be + prefixed by "Is", for compatibility with Perl 5.6. PCRE2 does not sup- + port this. + + +WIDE CHARACTERS AND UTF MODES + + Code points less than 256 can be specified in patterns by either braced + or unbraced hexadecimal escape sequences (for example, \x{b3} or \xb3). + Larger values have to use braced sequences. Unbraced octal code points + up to \777 are also recognized; larger ones can be coded using \o{...}. + + The escape sequence \N{U+} is recognized as another way of + specifying a Unicode character by code point in a UTF mode. It is not + allowed in non-UTF mode. + + In UTF mode, repeat quantifiers apply to complete UTF characters, not + to individual code units. + + In UTF mode, the dot metacharacter matches one UTF character instead of + a single code unit. + + In UTF mode, capture group names are not restricted to ASCII, and may + contain any Unicode letters and decimal digits, as well as underscore. + + The escape sequence \C can be used to match a single code unit in UTF + mode, but its use can lead to some strange effects because it breaks up + multi-unit characters (see the description of \C in the pcre2pattern + documentation). For this reason, there is a build-time option that dis- + ables support for \C completely. There is also a less draconian com- + pile-time option for locking out the use of \C when a pattern is com- + piled. + + The use of \C is not supported by the alternative matching function + pcre2_dfa_match() when in UTF-8 or UTF-16 mode, that is, when a charac- + ter may consist of more than one code unit. The use of \C in these + modes provokes a match-time error. Also, the JIT optimization does not + support \C in these modes. If JIT optimization is requested for a UTF-8 + or UTF-16 pattern that contains \C, it will not succeed, and so when + pcre2_match() is called, the matching will be carried out by the inter- + pretive function. + + The character escapes \b, \B, \d, \D, \s, \S, \w, and \W correctly test + characters of any code value, but, by default, the characters that + PCRE2 recognizes as digits, spaces, or word characters remain the same + set as in non-UTF mode, all with code points less than 256. This re- + mains true even when PCRE2 is built to include Unicode support, because + to do otherwise would slow down matching in many common cases. Note + that this also applies to \b and \B, because they are defined in terms + of \w and \W. If you want to test for a wider sense of, say, "digit", + you can use explicit Unicode property tests such as \p{Nd}. Alterna- + tively, if you set the PCRE2_UCP option, the way that the character es- + capes work is changed so that Unicode properties are used to determine + which characters match, though there are some options that suppress + this for individual escapes. For details see the section on generic + character types in the pcre2pattern documentation. + + Like the escapes, characters that match the POSIX named character + classes are all low-valued characters unless the PCRE2_UCP option is + set, but there is an option to override this. + + In contrast to the character escapes and character classes, the special + horizontal and vertical white space escapes (\h, \H, \v, and \V) do + match all the appropriate Unicode characters, whether or not PCRE2_UCP + is set. + + +UNICODE CASE-EQUIVALENCE + + If either PCRE2_UTF or PCRE2_UCP is set, upper/lower case processing + makes use of Unicode properties except for characters whose code points + are less than 128 and that have at most two case-equivalent values. For + these, a direct table lookup is used for speed. A few Unicode charac- + ters such as Greek sigma have more than two code points that are case- + equivalent, and these are treated specially. Setting PCRE2_UCP without + PCRE2_UTF allows Unicode-style case processing for non-UTF character + encodings such as UCS-2. + + There are two ASCII characters (S and K) that, in addition to their + ASCII lower case equivalents, have a non-ASCII one as well (long S and + Kelvin sign). Recognition of these non-ASCII characters as case-equiv- + alent to their ASCII counterparts can be disabled by setting the + PCRE2_EXTRA_CASELESS_RESTRICT option. When this is set, all characters + in a case equivalence must either be ASCII or non-ASCII; there can be + no mixing. + + Without PCRE2_EXTRA_CASELESS_RESTRICT: + 'k' = 'K' = U+212A (Kelvin sign) + 's' = 'S' = U+017F (long S) + With PCRE2_EXTRA_CASELESS_RESTRICT: + 'k' = 'K' + U+212A (Kelvin sign) only case-equivalent to itself + 's' = 'S' + U+017F (long S) only case-equivalent to itself + + One language family, Turkish and Azeri, has its own case-insensitivity + rules, which can be selected by setting PCRE2_EXTRA_TURKISH_CASING. + This alters the behaviour of the 'i', 'I', U+0130 (capital I with dot + above), and U+0131 (small dotless i) characters. + + Without PCRE2_EXTRA_TURKISH_CASING: + 'i' = 'I' + U+0130 (capital I with dot above) only case-equivalent to itself + U+0131 (small dotless i) only case-equivalent to itself + With PCRE2_EXTRA_TURKISH_CASING: + 'i' = U+0130 (capital I with dot above) + U+0131 (small dotless i) = 'I' + + It is not allowed to specify both PCRE2_EXTRA_CASELESS_RESTRICT and + PCRE2_EXTRA_TURKISH_CASING together. + + From release 10.45 the Unicode letter properties Lu (upper case), Ll + (lower case), and Lt (title case) are all treated as Lc (cased letter) + when caseless matching is set by the PCRE2_CASELESS option or (?i) + within the pattern. + + +SCRIPT RUNS + + The pattern constructs (*script_run:...) and (*atomic_script_run:...), + with synonyms (*sr:...) and (*asr:...), verify that the string matched + within the parentheses is a script run. In concept, a script run is a + sequence of characters that are all from the same Unicode script. How- + ever, because some scripts are commonly used together, and because some + diacritical and other marks are used with multiple scripts, it is not + that simple. + + Every Unicode character has a Script property, mostly with a value cor- + responding to the name of a script, such as Latin, Greek, or Cyrillic. + There are also three special values: + + "Unknown" is used for code points that have not been assigned, and also + for the surrogate code points. In the PCRE2 32-bit library, characters + whose code points are greater than the Unicode maximum (U+10FFFF), + which are accessible only in non-UTF mode, are assigned the Unknown + script. + + "Common" is used for characters that are used with many scripts. These + include punctuation, emoji, mathematical, musical, and currency sym- + bols, and the ASCII digits 0 to 9. + + "Inherited" is used for characters such as diacritical marks that mod- + ify a previous character. These are considered to take on the script of + the character that they modify. + + Some Inherited characters are used with many scripts, but many of them + are only normally used with a small number of scripts. For example, + U+102E0 (Coptic Epact thousands mark) is used only with Arabic and Cop- + tic. In order to make it possible to check this, a Unicode property + called Script Extension exists. Its value is a list of scripts that ap- + ply to the character. For the majority of characters, the list contains + just one script, the same one as the Script property. However, for + characters such as U+102E0 more than one Script is listed. There are + also some Common characters that have a single, non-Common script in + their Script Extension list. + + The next section describes the basic rules for deciding whether a given + string of characters is a script run. Note, however, that there are + some special cases involving the Chinese Han script, and an additional + constraint for decimal digits. These are covered in subsequent sec- + tions. + + Basic script run rules + + A string that is less than two characters long is a script run. This is + the only case in which an Unknown character can be part of a script + run. Longer strings are checked using only the Script Extensions prop- + erty, not the basic Script property. + + If a character's Script Extension property is the single value "Inher- + ited", it is always accepted as part of a script run. This is also true + for the property "Common", subject to the checking of decimal digits + described below. All the remaining characters in a script run must have + at least one script in common in their Script Extension lists. In set- + theoretic terminology, the intersection of all the sets of scripts must + not be empty. + + A simple example is an Internet name such as "google.com". The letters + are all in the Latin script, and the dot is Common, so this string is a + script run. However, the Cyrillic letter "o" looks exactly the same as + the Latin "o"; a string that looks the same, but with Cyrillic "o"s is + not a script run. + + More interesting examples involve characters with more than one script + in their Script Extension. Consider the following characters: + + U+060C Arabic comma + U+06D4 Arabic full stop + + The first has the Script Extension list Arabic, Hanifi Rohingya, Syr- + iac, and Thaana; the second has just Arabic and Hanifi Rohingya. Both + of them could appear in script runs of either Arabic or Hanifi Ro- + hingya. The first could also appear in Syriac or Thaana script runs, + but the second could not. + + The Chinese Han script + + The Chinese Han script is commonly used in conjunction with other + scripts for writing certain languages. Japanese uses the Hiragana and + Katakana scripts together with Han; Korean uses Hangul and Han; Tai- + wanese Mandarin uses Bopomofo and Han. These three combinations are + treated as special cases when checking script runs and are, in effect, + "virtual scripts". Thus, a script run may contain a mixture of Hira- + gana, Katakana, and Han, or a mixture of Hangul and Han, or a mixture + of Bopomofo and Han, but not, for example, a mixture of Hangul and + Bopomofo and Han. PCRE2 (like Perl) follows Unicode's Technical Stan- + dard 39 ("Unicode Security Mechanisms", http://unicode.org/re- + ports/tr39/) in allowing such mixtures. + + Decimal digits + + Unicode contains many sets of 10 decimal digits in different scripts, + and some scripts (including the Common script) contain more than one + set. Some of these decimal digits them are visually indistinguishable + from the common ASCII digits. In addition to the script checking de- + scribed above, if a script run contains any decimal digits, they must + all come from the same set of 10 adjacent characters. + + +VALIDITY OF UTF STRINGS + + When the PCRE2_UTF option is set, the strings passed as patterns and + subjects are (by default) checked for validity on entry to the relevant + functions. If an invalid UTF string is passed, a negative error code is + returned. The code unit offset to the offending character can be ex- + tracted from the match data block by calling pcre2_get_startchar(), + which is used for this purpose after a UTF error. + + In some situations, you may already know that your strings are valid, + and therefore want to skip these checks in order to improve perfor- + mance, for example in the case of a long subject string that is being + scanned repeatedly. If you set the PCRE2_NO_UTF_CHECK option at com- + pile time or at match time, PCRE2 assumes that the pattern or subject + it is given (respectively) contains only valid UTF code unit sequences. + + If you pass an invalid UTF string when PCRE2_NO_UTF_CHECK is set, the + result is undefined and your program may crash or loop indefinitely or + give incorrect results. There is, however, one mode of matching that + can handle invalid UTF subject strings. This is enabled by passing + PCRE2_MATCH_INVALID_UTF to pcre2_compile() and is discussed below in + the next section. The rest of this section covers the case when + PCRE2_MATCH_INVALID_UTF is not set. + + Passing PCRE2_NO_UTF_CHECK to pcre2_compile() just disables the UTF + check for the pattern; it does not also apply to subject strings. If + you want to disable the check for a subject string you must pass this + same option to pcre2_match() or pcre2_dfa_match(). + + UTF-16 and UTF-32 strings can indicate their endianness by special code + knows as a byte-order mark (BOM). The PCRE2 functions do not handle + this, expecting strings to be in host byte order. + + Unless PCRE2_NO_UTF_CHECK is set, a UTF string is checked before any + other processing takes place. In the case of pcre2_match() and + pcre2_dfa_match() calls with a non-zero starting offset, the check is + applied only to that part of the subject that could be inspected during + matching, and there is a check that the starting offset points to the + first code unit of a character or to the end of the subject. If there + are no lookbehind assertions in the pattern, the check starts at the + starting offset. Otherwise, it starts at the length of the longest + lookbehind before the starting offset, or at the start of the subject + if there are not that many characters before the starting offset. Note + that the sequences \b and \B are one-character lookbehinds. + + In addition to checking the format of the string, there is a check to + ensure that all code points lie in the range U+0 to U+10FFFF, excluding + the surrogate area. The so-called "non-character" code points are not + excluded because Unicode corrigendum #9 makes it clear that they should + not be. + + Characters in the "Surrogate Area" of Unicode are reserved for use by + UTF-16, where they are used in pairs to encode code points with values + greater than 0xFFFF. The code points that are encoded by UTF-16 pairs + are available independently in the UTF-8 and UTF-32 encodings. (In + other words, the whole surrogate thing is a fudge for UTF-16 which un- + fortunately messes up UTF-8 and UTF-32.) + + Setting PCRE2_NO_UTF_CHECK at compile time does not disable the error + that is given if an escape sequence for an invalid Unicode code point + is encountered in the pattern. If you want to allow escape sequences + such as \x{d800} (a surrogate code point) you can set the PCRE2_EX- + TRA_ALLOW_SURROGATE_ESCAPES extra option. However, this is possible + only in UTF-8 and UTF-32 modes, because these values are not repre- + sentable in UTF-16. + + Errors in UTF-8 strings + + The following negative error codes are given for invalid UTF-8 strings: + + PCRE2_ERROR_UTF8_ERR1 + PCRE2_ERROR_UTF8_ERR2 + PCRE2_ERROR_UTF8_ERR3 + PCRE2_ERROR_UTF8_ERR4 + PCRE2_ERROR_UTF8_ERR5 + + The string ends with a truncated UTF-8 character; the code specifies + how many bytes are missing (1 to 5). Although RFC 3629 restricts UTF-8 + characters to be no longer than 4 bytes, the encoding scheme (origi- + nally defined by RFC 2279) allows for up to 6 bytes, and this is + checked first; hence the possibility of 4 or 5 missing bytes. + + PCRE2_ERROR_UTF8_ERR6 + PCRE2_ERROR_UTF8_ERR7 + PCRE2_ERROR_UTF8_ERR8 + PCRE2_ERROR_UTF8_ERR9 + PCRE2_ERROR_UTF8_ERR10 + + The two most significant bits of the 2nd, 3rd, 4th, 5th, or 6th byte of + the character do not have the binary value 0b10 (that is, either the + most significant bit is 0, or the next bit is 1). + + PCRE2_ERROR_UTF8_ERR11 + PCRE2_ERROR_UTF8_ERR12 + + A character that is valid by the RFC 2279 rules is either 5 or 6 bytes + long; these code points are excluded by RFC 3629. + + PCRE2_ERROR_UTF8_ERR13 + + A 4-byte character has a value greater than 0x10ffff; these code points + are excluded by RFC 3629. + + PCRE2_ERROR_UTF8_ERR14 + + A 3-byte character has a value in the range 0xd800 to 0xdfff; this + range of code points are reserved by RFC 3629 for use with UTF-16, and + so are excluded from UTF-8. + + PCRE2_ERROR_UTF8_ERR15 + PCRE2_ERROR_UTF8_ERR16 + PCRE2_ERROR_UTF8_ERR17 + PCRE2_ERROR_UTF8_ERR18 + PCRE2_ERROR_UTF8_ERR19 + + A 2-, 3-, 4-, 5-, or 6-byte character is "overlong", that is, it codes + for a value that can be represented by fewer bytes, which is invalid. + For example, the two bytes 0xc0, 0xae give the value 0x2e, whose cor- + rect coding uses just one byte. + + PCRE2_ERROR_UTF8_ERR20 + + The two most significant bits of the first byte of a character have the + binary value 0b10 (that is, the most significant bit is 1 and the sec- + ond is 0). Such a byte can only validly occur as the second or subse- + quent byte of a multi-byte character. + + PCRE2_ERROR_UTF8_ERR21 + + The first byte of a character has the value 0xfe or 0xff. These values + can never occur in a valid UTF-8 string. + + Errors in UTF-16 strings + + The following negative error codes are given for invalid UTF-16 + strings: + + PCRE2_ERROR_UTF16_ERR1 Missing low surrogate at end of string + PCRE2_ERROR_UTF16_ERR2 Invalid low surrogate follows high surrogate + PCRE2_ERROR_UTF16_ERR3 Isolated low surrogate + + + Errors in UTF-32 strings + + The following negative error codes are given for invalid UTF-32 + strings: + + PCRE2_ERROR_UTF32_ERR1 Surrogate character (0xd800 to 0xdfff) + PCRE2_ERROR_UTF32_ERR2 Code point is greater than 0x10ffff + + +MATCHING IN INVALID UTF STRINGS + + You can run pattern matches on subject strings that may contain invalid + UTF sequences if you call pcre2_compile() with the PCRE2_MATCH_IN- + VALID_UTF option. This is supported by pcre2_match(), including JIT + matching, but not by pcre2_dfa_match(). When PCRE2_MATCH_INVALID_UTF is + set, it forces PCRE2_UTF to be set as well. Note, however, that the + pattern itself must be a valid UTF string. + + If you do not set PCRE2_MATCH_INVALID_UTF when calling pcre2_compile, + and you are not certain that your subject strings are valid UTF se- + quences, you should not make use of the JIT "fast path" function + pcre2_jit_match() because it bypasses sanity checks, including the one + for UTF validity. An invalid string may cause undefined behaviour, in- + cluding looping, crashing, or giving the wrong answer. + + Setting PCRE2_MATCH_INVALID_UTF does not affect what pcre2_compile() + generates, but if pcre2_jit_compile() is subsequently called, it does + generate different code. If JIT is not used, the option affects the be- + haviour of the interpretive code in pcre2_match(). When PCRE2_MATCH_IN- + VALID_UTF is set at compile time, PCRE2_NO_UTF_CHECK is ignored at + match time. + + In this mode, an invalid code unit sequence in the subject never + matches any pattern item. It does not match dot, it does not match + \p{Any}, it does not even match negative items such as [^X]. A lookbe- + hind assertion fails if it encounters an invalid sequence while moving + the current point backwards. In other words, an invalid UTF code unit + sequence acts as a barrier which no match can cross. + + You can also think of this as the subject being split up into fragments + of valid UTF, delimited internally by invalid code unit sequences. The + pattern is matched fragment by fragment. The result of a successful + match, however, is given as code unit offsets in the entire subject + string in the usual way. There are a few points to consider: + + The internal boundaries are not interpreted as the beginnings or ends + of lines and so do not match circumflex or dollar characters in the + pattern. + + If pcre2_match() is called with an offset that points to an invalid + UTF-sequence, that sequence is skipped, and the match starts at the + next valid UTF character, or the end of the subject. + + At internal fragment boundaries, \b and \B behave in the same way as at + the beginning and end of the subject. For example, a sequence such as + \bWORD\b would match an instance of WORD that is surrounded by invalid + UTF code units. + + Using PCRE2_MATCH_INVALID_UTF, an application can run matches on arbi- + trary data, knowing that any matched strings that are returned are + valid UTF. This can be useful when searching for UTF text in executable + or other binary files. + + Note, however, that the 16-bit and 32-bit PCRE2 libraries process + strings as sequences of uint16_t or uint32_t code points. They cannot + find valid UTF sequences within an arbitrary string of bytes unless + such sequences are suitably aligned. + + +AUTHOR + + Philip Hazel + Retired from University Computing Service + Cambridge, England. + + +REVISION + + Last updated: 27 November 2024 + Copyright (c) 1997-2024 University of Cambridge. + + +PCRE2 10.46 27 November 2024 PCRE2UNICODE(3) +------------------------------------------------------------------------------ + + diff --git a/miniconda3/share/doc/pcre2/pcre2grep.txt b/miniconda3/share/doc/pcre2/pcre2grep.txt new file mode 100644 index 0000000000000000000000000000000000000000..dd1a38ea479abe35f59b8c69da98d6fe20a87122 --- /dev/null +++ b/miniconda3/share/doc/pcre2/pcre2grep.txt @@ -0,0 +1,1106 @@ +PCRE2GREP(1) General Commands Manual PCRE2GREP(1) + + +NAME + pcre2grep - a grep with Perl-compatible regular expressions. + + +SYNOPSIS + pcre2grep [options] [long options] [pattern] [path1 path2 ...] + + +DESCRIPTION + + pcre2grep searches files for character patterns, in the same way as + other grep commands do, but it uses the PCRE2 regular expression li- + brary to support patterns that are compatible with the regular expres- + sions of Perl 5. See pcre2syntax(3) for a quick-reference summary of + pattern syntax, or pcre2pattern(3) for a full description of the syntax + and semantics of the regular expressions that PCRE2 supports. + + Patterns, whether supplied on the command line or in a separate file, + are given without delimiters. For example: + + pcre2grep Thursday /etc/motd + + If you attempt to use delimiters (for example, by surrounding a pattern + with slashes, as is common in Perl scripts), they are interpreted as + part of the pattern. Quotes can of course be used to delimit patterns + on the command line because they are interpreted by the shell, and in- + deed quotes are required if a pattern contains white space or shell + metacharacters. + + The first argument that follows any option settings is treated as the + single pattern to be matched when neither -e nor -f is present. Con- + versely, when one or both of these options are used to specify pat- + terns, all arguments are treated as path names. At least one of -e, -f, + or an argument pattern must be provided. + + If no files are specified, pcre2grep reads the standard input. The + standard input can also be referenced by a name consisting of a single + hyphen. For example: + + pcre2grep some-pattern file1 - file3 + + By default, input files are searched line by line, so pattern asser- + tions about the beginning and end of a subject string (^, $, \A, \Z, + and \z) match at the beginning and end of each line. When a line + matches a pattern, it is copied to the standard output, and if there is + more than one file, the file name is output at the start of each line, + followed by a colon. However, there are options that can change how + pcre2grep behaves. For example, the -M option makes it possible to + search for strings that span line boundaries. What defines a line + boundary is controlled by the -N (--newline) option. The -h and -H op- + tions control whether or not file names are shown, and the -Z option + changes the file name terminator to a zero byte. + + The amount of memory used for buffering files that are being scanned is + controlled by parameters that can be set by the --buffer-size and + --max-buffer-size options. The first of these sets the size of buffer + that is obtained at the start of processing. If an input file contains + very long lines, a larger buffer may be needed; this is handled by au- + tomatically extending the buffer, up to the limit specified by --max- + buffer-size. The default values for these parameters can be set when + pcre2grep is built; if nothing is specified, the defaults are set to + 20KiB and 1MiB respectively. An error occurs if a line is too long and + the buffer can no longer be expanded. + + The block of memory that is actually used is three times the "buffer + size", to allow for buffering "before" and "after" lines. If the buffer + size is too small, fewer than requested "before" and "after" lines may + be output. + + When matching with a multiline pattern, the size of the buffer must be + at least half of the maximum match expected or the pattern might fail + to match. + + Patterns can be no longer than 8KiB or BUFSIZ bytes, whichever is the + greater. BUFSIZ is defined in . When there is more than one + pattern (specified by the use of -e and/or -f), each pattern is applied + to each line in the order in which they are defined, except that all + the -e patterns are tried before the -f patterns. + + By default, as soon as one pattern matches a line, no further patterns + are considered. However, if --colour (or --color) is used to colour the + matching substrings, or if --only-matching, --file-offsets, --line-off- + sets, or --output is used to output only the part of the line that + matched (either shown literally, or as an offset), the behaviour is + different. In this situation, all the patterns are applied to the line. + If there is more than one match, the one that begins nearest to the + start of the subject is processed; if there is more than one match at + that position, the one with the longest matching substring is + processed; if the matching substrings are equal, the first match found + is processed. + + Scanning with all the patterns resumes immediately following the match, + so that later matches on the same line can be found. Note, however, + that an overlapping match that starts in the middle of another match + will not be processed. + + The above behaviour was changed at release 10.41 to be more compatible + with GNU grep. In earlier releases, pcre2grep did not recognize matches + from later patterns that were earlier in the subject. + + Patterns that can match an empty string are accepted, but empty string + matches are never recognized. An example is the pattern "(su- + per)?(man)?", in which all components are optional. This pattern finds + all occurrences of both "super" and "man"; the output differs from + matching with "super|man" when only the matching substrings are being + shown. + + If the LC_ALL or LC_CTYPE environment variable is set, pcre2grep uses + the value to set a locale when calling the PCRE2 library. The --locale + option can be used to override this. + + +SUPPORT FOR COMPRESSED FILES + + Compile-time options for pcre2grep can set it up to use libz or libbz2 + for reading compressed files whose names end in .gz or .bz2, respec- + tively. You can find out whether your pcre2grep binary has support for + one or both of these file types by running it with the --help option. + If the appropriate support is not present, all files are treated as + plain text. The standard input is always so treated. If a file with a + .gz or .bz2 extension is not in fact compressed, it is read as a plain + text file. When input is from a compressed .gz or .bz2 file, the + --line-buffered option is ignored. + + +BINARY FILES + + By default, a file that contains a binary zero byte within the first + 1024 bytes is identified as a binary file, and is processed specially. + However, if the newline type is specified as NUL, that is, the line + terminator is a binary zero, the test for a binary file is not applied. + See the --binary-files option for a means of changing the way binary + files are handled. + + +BINARY ZEROS IN PATTERNS + + Patterns passed from the command line are strings that are terminated + by a binary zero, so cannot contain internal zeros. However, patterns + that are read from a file via the -f option may contain binary zeros. + + +OPTIONS + + The order in which some of the options appear can affect the output. + For example, both the -H and -l options affect the printing of file + names. Whichever comes later in the command line will be the one that + takes effect. Similarly, except where noted below, if an option is + given twice, the later setting is used. Numerical values for options + may be followed by K or M, to signify multiplication by 1024 or + 1024*1024 respectively. + + -- This terminates the list of options. It is useful if the next + item on the command line starts with a hyphen but is not an + option. This allows for the processing of patterns and file + names that start with hyphens. + + -A number, --after-context=number + Output up to number lines of context after each matching + line. Fewer lines are output if the next match or the end of + the file is reached, or if the processing buffer size has + been set too small. If file names and/or line numbers are be- + ing output, a hyphen separator is used instead of a colon for + the context lines (the -Z option can be used to change the + file name terminator to a zero byte). A line containing "--" + is output between each group of lines, unless they are in + fact contiguous in the input file. The value of number is ex- + pected to be relatively small. When -c is used, -A is ig- + nored. + + -a, --text + Treat binary files as text. This is equivalent to --binary- + files=text. + + --allow-lookaround-bsk + PCRE2 now forbids the use of \K in lookarounds by default, in + line with Perl. This option causes pcre2grep to set the + PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK option, which enables this + somewhat dangerous usage. + + -B number, --before-context=number + Output up to number lines of context before each matching + line. Fewer lines are output if the previous match or the + start of the file is within number lines, or if the process- + ing buffer size has been set too small. If file names and/or + line numbers are being output, a hyphen separator is used in- + stead of a colon for the context lines (the -Z option can be + used to change the file name terminator to a zero byte). A + line containing "--" is output between each group of lines, + unless they are in fact contiguous in the input file. The + value of number is expected to be relatively small. When -c + is used, -B is ignored. + + --binary-files=word + Specify how binary files are to be processed. If the word is + "binary" (the default), pattern matching is performed on bi- + nary files, but the only output is "Binary file + matches" when a match succeeds. If the word is "text", which + is equivalent to the -a or --text option, binary files are + processed in the same way as any other file. In this case, + when a match succeeds, the output may be binary garbage, + which can have nasty effects if sent to a terminal. If the + word is "without-match", which is equivalent to the -I op- + tion, binary files are not processed at all; they are assumed + not to be of interest and are skipped without causing any + output or affecting the return code. + + --buffer-size=number + Set the parameter that controls how much memory is obtained + at the start of processing for buffering files that are being + scanned. See also --max-buffer-size below. + + -C number, --context=number + Output number lines of context both before and after each + matching line. This is equivalent to setting both -A and -B + to the same value. + + -c, --count + Do not output lines from the files that are being scanned; + instead output the number of lines that would have been + shown, either because they matched, or, if -v is set, because + they failed to match. By default, this count is exactly the + same as the number of lines that would have been output, but + if the -M (multiline) option is used (without -v), there may + be more suppressed lines than the count (that is, the number + of matches). + + If no lines are selected, the number zero is output. If sev- + eral files are being scanned, a count is output for each of + them and the -t option can be used to cause a total to be + output at the end. However, if the --files-with-matches op- + tion is also used, only those files whose counts are greater + than zero are listed. When -c is used, the -A, -B, and -C op- + tions are ignored. + + --colour, --color + If this option is given without any data, it is equivalent to + "--colour=auto". If data is required, it must be given in + the same shell item, separated by an equals sign. + + --colour=value, --color=value + This option specifies under what circumstances the parts of a + line that matched a pattern should be coloured in the output. + It is ignored if --file-offsets, --line-offsets, or --output + is set. By default, output is not coloured. The value for the + --colour option (which is optional, see above) may be + "never", "always", or "auto". In the latter case, colouring + happens only if the standard output is connected to a termi- + nal. More resources are used when colouring is enabled, be- + cause pcre2grep has to search for all possible matches in a + line, not just one, in order to colour them all. + + The colour that is used can be specified by setting one of + the environment variables PCRE2GREP_COLOUR, PCRE2GREP_COLOR, + PCREGREP_COLOUR, or PCREGREP_COLOR, which are checked in that + order. If none of these are set, pcre2grep looks for + GREP_COLORS or GREP_COLOR (in that order). The value of the + variable should be a string of two numbers, separated by a + semicolon, except in the case of GREP_COLORS, which must + start with "ms=" or "mt=" followed by two semicolon-separated + colours, terminated by the end of the string or by a colon. + If GREP_COLORS does not start with "ms=" or "mt=" it is ig- + nored, and GREP_COLOR is checked. + + If the string obtained from one of the above variables con- + tains any characters other than semicolon or digits, the set- + ting is ignored and the default colour is used. The string is + copied directly into the control string for setting colour on + a terminal, so it is your responsibility to ensure that the + values make sense. If no relevant environment variable is + set, the default is "1;31", which gives red. + + -D action, --devices=action + If an input path is not a regular file or a directory, "ac- + tion" specifies how it is to be processed. Valid values are + "read" (the default) or "skip" (silently skip the path). + + -d action, --directories=action + If an input path is a directory, "action" specifies how it is + to be processed. Valid values are "read" (the default in + non-Windows environments, for compatibility with GNU grep), + "recurse" (equivalent to the -r option), or "skip" (silently + skip the path, the default in Windows environments). In the + "read" case, directories are read as if they were ordinary + files. In some operating systems the effect of reading a di- + rectory like this is an immediate end-of-file; in others it + may provoke an error. + + --depth-limit=number + See --match-limit below. + + -E, --case-restrict + When case distinctions are being ignored in Unicode mode, two + ASCII letters (K and S) will by default match Unicode charac- + ters U+212A (Kelvin sign) and U+017F (long S) respectively, + as well as their lower case ASCII counterparts. When this op- + tion is set, case equivalences are restricted such that no + ASCII character matches a non-ASCII character, and vice + versa. + + -e pattern, --regex=pattern, --regexp=pattern + Specify a pattern to be matched. This option can be used mul- + tiple times in order to specify several patterns. It can also + be used as a way of specifying a single pattern that starts + with a hyphen. When -e is used, no argument pattern is taken + from the command line; all arguments are treated as file + names. There is no limit to the number of patterns. They are + applied to each line in the order in which they are defined. + + If -f is used with -e, the command line patterns are matched + first, followed by the patterns from the file(s), independent + of the order in which these options are specified. + + --exclude=pattern + Files (but not directories) whose names match the pattern are + skipped without being processed. This applies to all files, + whether listed on the command line, obtained from --file- + list, or by scanning a directory. The pattern is a PCRE2 reg- + ular expression, and is matched against the final component + of the file name, not the entire path. The -F, -w, and -x op- + tions do not apply to this pattern. The option may be given + any number of times in order to specify multiple patterns. If + a file name matches both an --include and an --exclude pat- + tern, it is excluded. There is no short form for this option. + + --exclude-from=filename + Treat each non-empty line of the file as the data for an + --exclude option. What constitutes a newline when reading the + file is the operating system's default. The --newline option + has no effect on this option. This option may be given more + than once in order to specify a number of files to read. + + --exclude-dir=pattern + Directories whose names match the pattern are skipped without + being processed, whatever the setting of the --recursive op- + tion. This applies to all directories, whether listed on the + command line, obtained from --file-list, or by scanning a + parent directory. The pattern is a PCRE2 regular expression, + and is matched against the final component of the directory + name, not the entire path. The -F, -w, and -x options do not + apply to this pattern. The option may be given any number of + times in order to specify more than one pattern. If a direc- + tory matches both --include-dir and --exclude-dir, it is ex- + cluded. There is no short form for this option. + + -F, --fixed-strings + Interpret each data-matching pattern as a list of fixed + strings, separated by newlines, instead of as a regular ex- + pression. What constitutes a newline for this purpose is con- + trolled by the --newline option. The -w (match as a word) and + -x (match whole line) options can be used with -F. They ap- + ply to each of the fixed strings. A line is selected if any + of the fixed strings are found in it (subject to -w or -x, if + present). This option applies only to the patterns that are + matched against the contents of files; it does not apply to + patterns specified by any of the --include or --exclude op- + tions. + + -f filename, --file=filename + Read patterns from the file, one per line. As is the case + with patterns on the command line, no delimiters should be + used. What constitutes a newline when reading the file is the + operating system's default interpretation of \n. The --new- + line option has no effect on this option. Trailing white + space is removed from each line, and blank lines are ignored + unless the --posix-pattern-file option is also provided. An + empty file contains no patterns and therefore matches noth- + ing. Patterns read from a file in this way may contain binary + zeros, which are treated as ordinary character literals. + + If this option is given more than once, all the specified + files are read. A data line is output if any of the patterns + match it. A file name can be given as "-" to refer to the + standard input. When -f is used, patterns specified on the + command line using -e may also be present; they are matched + before the file's patterns. However, no pattern is taken from + the command line; all arguments are treated as the names of + paths to be searched. + + --file-list=filename + Read a list of files and/or directories that are to be + scanned from the given file, one per line. What constitutes a + newline when reading the file is the operating system's de- + fault. Trailing white space is removed from each line, and + blank lines are ignored. These paths are processed before any + that are listed on the command line. The file name can be + given as "-" to refer to the standard input. If --file and + --file-list are both specified as "-", patterns are read + first. This is useful only when the standard input is a ter- + minal, from which further lines (the list of files) can be + read after an end-of-file indication. If this option is given + more than once, all the specified files are read. + + --file-offsets + Instead of showing lines or parts of lines that match, show + each match as an offset from the start of the file and a + length, separated by a comma. In this mode, --colour has no + effect, and no context is shown. That is, the -A, -B, and -C + options are ignored. If there is more than one match in a + line, each of them is shown separately. This option is mutu- + ally exclusive with --output, --line-offsets, and --only- + matching. + + --group-separator=text + Output this text string instead of two hyphens between groups + of lines when -A, -B, or -C is in use. See also --no-group- + separator. + + -H, --with-filename + Force the inclusion of the file name at the start of output + lines when searching a single file. The file name is not nor- + mally shown in this case. By default, for matching lines, + the file name is followed by a colon; for context lines, a + hyphen separator is used. The -Z option can be used to change + the terminator to a zero byte. If a line number is also being + output, it follows the file name. When the -M option causes a + pattern to match more than one line, only the first is pre- + ceded by the file name. This option overrides any previous + -h, -l, or -L options. + + -h, --no-filename + Suppress the output file names when searching multiple files. + File names are normally shown when multiple files are + searched. By default, for matching lines, the file name is + followed by a colon; for context lines, a hyphen separator is + used. The -Z option can be used to change the terminator to a + zero byte. If a line number is also being output, it follows + the file name. This option overrides any previous -H, -L, or + -l options. + + --heap-limit=number + See --match-limit below. + + --help Output a help message, giving brief details of the command + options and file type support, and then exit. Anything else + on the command line is ignored. + + -I Ignore binary files. This is equivalent to --binary- + files=without-match. + + -i, --ignore-case + Ignore upper/lower case distinctions when pattern matching. + This applies when matching path names for inclusion or exclu- + sion as well as when matching lines in files. + + --include=pattern + If any --include patterns are specified, the only files that + are processed are those whose names match one of the patterns + and do not match an --exclude pattern. This option does not + affect directories, but it applies to all files, whether + listed on the command line, obtained from --file-list, or by + scanning a directory. The pattern is a PCRE2 regular expres- + sion, and is matched against the final component of the file + name, not the entire path. The -F, -w, and -x options do not + apply to this pattern. The option may be given any number of + times. If a file name matches both an --include and an --ex- + clude pattern, it is excluded. There is no short form for + this option. + + --include-from=filename + Treat each non-empty line of the file as the data for an + --include option. What constitutes a newline for this purpose + is the operating system's default. The --newline option has + no effect on this option. This option may be given any number + of times; all the files are read. + + --include-dir=pattern + If any --include-dir patterns are specified, the only direc- + tories that are processed are those whose names match one of + the patterns and do not match an --exclude-dir pattern. This + applies to all directories, whether listed on the command + line, obtained from --file-list, or by scanning a parent di- + rectory. The pattern is a PCRE2 regular expression, and is + matched against the final component of the directory name, + not the entire path. The -F, -w, and -x options do not apply + to this pattern. The option may be given any number of times. + If a directory matches both --include-dir and --exclude-dir, + it is excluded. There is no short form for this option. + + -L, --files-without-match + Instead of outputting lines from the files, just output the + names of the files that do not contain any lines that would + have been output. Each file name is output once, on a sepa- + rate line by default, but if the -Z option is set, they are + separated by zero bytes instead of newlines. This option + overrides any previous -H, -h, or -l options. + + -l, --files-with-matches + Instead of outputting lines from the files, just output the + names of the files containing lines that would have been out- + put. Each file name is output once, on a separate line, but + if the -Z option is set, they are separated by zero bytes in- + stead of newlines. Searching normally stops as soon as a + matching line is found in a file. However, if the -c (count) + option is also used, matching continues in order to obtain + the correct count, and those files that have at least one + match are listed along with their counts. Using this option + with -c is a way of suppressing the listing of files with no + matches that occurs with -c on its own. This option overrides + any previous -H, -h, or -L options. + + --label=name + This option supplies a name to be used for the standard input + when file names are being output. If not supplied, "(standard + input)" is used. There is no short form for this option. + + --line-buffered + When this option is given, non-compressed input is read and + processed line by line, and the output is flushed after each + write. By default, input is read in large chunks, unless + pcre2grep can determine that it is reading from a terminal, + which is currently possible only in Unix-like environments or + Windows. Output to terminal is normally automatically flushed + by the operating system. This option can be useful when the + input or output is attached to a pipe and you do not want + pcre2grep to buffer up large amounts of data. However, its + use will affect performance, and the -M (multiline) option + ceases to work. When input is from a compressed .gz or .bz2 + file, --line-buffered is ignored. + + --line-offsets + Instead of showing lines or parts of lines that match, show + each match as a line number, the offset from the start of the + line, and a length. The line number is terminated by a colon + (as usual; see the -n option), and the offset and length are + separated by a comma. In this mode, --colour has no effect, + and no context is shown. That is, the -A, -B, and -C options + are ignored. If there is more than one match in a line, each + of them is shown separately. This option is mutually exclu- + sive with --output, --file-offsets, and --only-matching. + + --locale=locale-name + This option specifies a locale to be used for pattern match- + ing. It overrides the value in the LC_ALL or LC_CTYPE envi- + ronment variables. If no locale is specified, the PCRE2 li- + brary's default (usually the "C" locale) is used. There is no + short form for this option. + + -M, --multiline + Allow patterns to match more than one line. When this option + is set, the PCRE2 library is called in "multiline" mode, and + a match is allowed to continue past the end of the initial + line and onto one or more subsequent lines. + + Patterns used with -M may usefully contain literal newline + characters and internal occurrences of ^ and $ characters, + because in multiline mode these can match at internal new- + lines. Because pcre2grep is scanning multiple lines, the \Z + and \z assertions match only at the end of the last line in + the file. The \A assertion matches at the start of the first + line of a match. This can be any line in the file; it is not + anchored to the first line. + + The output for a successful match may consist of more than + one line. The first line is the line in which the match + started, and the last line is the line in which the match + ended. If the matched string ends with a newline sequence, + the output ends at the end of that line. If -v is set, none + of the lines in a multi-line match are output. Once a match + has been handled, scanning restarts at the beginning of the + line after the one in which the match ended. + + The newline sequence that separates multiple lines must be + matched as part of the pattern. For example, to find the + phrase "regular expression" in a file where "regular" might + be at the end of a line and "expression" at the start of the + next line, you could use this command: + + pcre2grep -M 'regular\s+expression' + + The \s escape sequence matches any white space character, in- + cluding newlines, and is followed by + so as to match trail- + ing white space on the first line as well as possibly han- + dling a two-character newline sequence. + + There is a limit to the number of lines that can be matched, + imposed by the way that pcre2grep buffers the input file as + it scans it. With a sufficiently large processing buffer, + this should not be a problem. + + The -M option does not work when input is read line by line + (see --line-buffered.) + + -m number, --max-count=number + Stop processing after finding number matching lines, or non- + matching lines if -v is also set. Any trailing context lines + are output after the final match. In multiline mode, each + multiline match counts as just one line for this purpose. If + this limit is reached when reading the standard input from a + regular file, the file is left positioned just after the last + matching line. If -c is also set, the count that is output + is never greater than number. This option has no effect if + used with -L, -l, or -q, or when just checking for a match in + a binary file. + + --match-limit=number + Processing some regular expression patterns may take a very + long time to search for all possible matching strings. Others + may require a very large amount of memory. There are three + options that set resource limits for matching. + + The --match-limit option provides a means of limiting comput- + ing resource usage when processing patterns that are not go- + ing to match, but which have a very large number of possibil- + ities in their search trees. The classic example is a pattern + that uses nested unlimited repeats. Internally, PCRE2 has a + counter that is incremented each time around its main pro- + cessing loop. If the value set by --match-limit is reached, + an error occurs. + + The --heap-limit option specifies, as a number of kibibytes + (units of 1024 bytes), the maximum amount of heap memory that + may be used for matching. + + The --depth-limit option limits the depth of nested back- + tracking points, which indirectly limits the amount of memory + that is used. The amount of memory needed for each backtrack- + ing point depends on the number of capturing parentheses in + the pattern, so the amount of memory that is used before this + limit acts varies from pattern to pattern. This limit is of + use only if it is set smaller than --match-limit. + + There are no short forms for these options. The default lim- + its can be set when the PCRE2 library is compiled; if they + are not specified, the defaults are very large and so effec- + tively unlimited. + + --max-buffer-size=number + This limits the expansion of the processing buffer, whose + initial size can be set by --buffer-size. The maximum buffer + size is silently forced to be no smaller than the starting + buffer size. + + -N newline-type, --newline=newline-type + Six different conventions for indicating the ends of lines in + scanned files are supported. For example: + + pcre2grep -N CRLF 'some pattern' + + The newline type may be specified in upper, lower, or mixed + case. If the newline type is NUL, lines are separated by bi- + nary zero characters. The other types are the single-charac- + ter sequences CR (carriage return) and LF (linefeed), the + two-character sequence CRLF, an "anycrlf" type, which recog- + nizes any of the preceding three types, and an "any" type, + for which any Unicode line ending sequence is assumed to end + a line. The Unicode sequences are the three just mentioned, + plus VT (vertical tab, U+000B), FF (form feed, U+000C), NEL + (next line, U+0085), LS (line separator, U+2028), and PS + (paragraph separator, U+2029). + + When the PCRE2 library is built, a default line-ending se- + quence is specified. This is normally the standard sequence + for the operating system. Unless otherwise specified by this + option, pcre2grep uses the library's default. + + This option makes it possible to use pcre2grep to scan files + that have come from other environments without having to mod- + ify their line endings. If the data that is being scanned + does not agree with the convention set by this option, + pcre2grep may behave in strange ways. Note that this option + does not apply to files specified by the -f, --exclude-from, + or --include-from options, which are expected to use the op- + erating system's standard newline sequence. + + -n, --line-number + Precede each output line by its line number in the file, fol- + lowed by a colon for matching lines or a hyphen for context + lines. If the file name is also being output, it precedes the + line number. When the -M option causes a pattern to match + more than one line, only the first is preceded by its line + number. This option is forced if --line-offsets is used. + + --no-group-separator + Do not output a separator between groups of lines when -A, + -B, or -C is in use. The default is to output a line contain- + ing two hyphens. See also --group-separator. + + --no-jit If the PCRE2 library is built with support for just-in-time + compiling (which speeds up matching), pcre2grep automatically + makes use of this, unless it was explicitly disabled at build + time. This option can be used to disable the use of JIT at + run time. It is provided for testing and working around prob- + lems. It should never be needed in normal use. + + -O text, --output=text + When there is a match, instead of outputting the line that + matched, output just the text specified in this option, fol- + lowed by an operating-system standard newline. In this mode, + --colour has no effect, and no context is shown. That is, + the -A, -B, and -C options are ignored. The --newline option + has no effect on this option, which is mutually exclusive + with --only-matching, --file-offsets, and --line-offsets. + However, like --only-matching, if there is more than one + match in a line, each of them causes a line of output. + + Escape sequences starting with a dollar character may be used + to insert the contents of the matched part of the line and/or + captured substrings into the text. + + $ or ${} is replaced by the captured sub- + string of the given decimal number; $& (or the legacy $0) + substitutes the whole match. If the number is greater than + the number of capturing substrings, or if the capture is un- + set, the replacement is empty. + + $a is replaced by bell; $b by backspace; $e by escape; $f by + form feed; $n by newline; $r by carriage return; $t by tab; + $v by vertical tab. + + $o or $o{} is replaced by the character whose + code point is the given octal number. In the first form, up + to three octal digits are processed. When more digits are + needed in Unicode mode to specify a wide character, the sec- + ond form must be used. + + $x or $x{} is replaced by the character rep- + resented by the given hexadecimal number. In the first form, + up to two hexadecimal digits are processed. When more digits + are needed in Unicode mode to specify a wide character, the + second form must be used. + + Any other character is substituted by itself. In particular, + $$ is replaced by a single dollar. + + -o, --only-matching + Show only the part of the line that matched a pattern instead + of the whole line. In this mode, no context is shown. That + is, the -A, -B, and -C options are ignored. If there is more + than one match in a line, each of them is shown separately, + on a separate line of output. If -o is combined with -v (in- + vert the sense of the match to find non-matching lines), no + output is generated, but the return code is set appropri- + ately. If the matched portion of the line is empty, nothing + is output unless the file name or line number are being + printed, in which case they are shown on an otherwise empty + line. This option is mutually exclusive with --output, + --file-offsets and --line-offsets. + + -onumber, --only-matching=number + Show only the part of the line that matched the capturing + parentheses of the given number. Up to 50 capturing parenthe- + ses are supported by default. This limit can be changed via + the --om-capture option. A pattern may contain any number of + capturing parentheses, but only those whose number is within + the limit can be accessed by -o. An error occurs if the num- + ber specified by -o is greater than the limit. + + -o0 is the same as -o without a number. Because these options + can be given without an argument (see above), if an argument + is present, it must be given in the same shell item, for ex- + ample, -o3 or --only-matching=2. The comments given for the + non-argument case above also apply to this option. If the + specified capturing parentheses do not exist in the pattern, + or were not set in the match, nothing is output unless the + file name or line number are being output. + + If this option is given multiple times, multiple substrings + are output for each match, in the order the options are + given, and all on one line. For example, -o3 -o1 -o3 causes + the substrings matched by capturing parentheses 3 and 1 and + then 3 again to be output. By default, there is no separator + (but see the next but one option). + + --om-capture=number + Set the number of capturing parentheses that can be accessed + by -o. The default is 50. + + --om-separator=text + Specify a separating string for multiple occurrences of -o. + The default is an empty string. Separating strings are never + coloured. + + -P, --no-ucp + Starting from release 10.43, when UTF/Unicode mode is speci- + fied with -u or -U, the PCRE2_UCP option is used by default. + This means that the POSIX classes in patterns match more than + just ASCII characters. For example, [:digit:] matches any + Unicode decimal digit. The --no-ucp option suppresses + PCRE2_UCP, thus restricting the POSIX classes to ASCII char- + acters, as was the case in earlier releases. Note that there + are now more fine-grained option settings within patterns + that affect individual classes. For example, when in UCP + mode, the sequence (?aP) restricts [:word:] to ASCII letters, + while allowing \w to match Unicode letters and digits. + + --posix-pattern-file + When patterns are provided with the -f option, do not trim + trailing spaces or ignore empty lines in a similar way than + other grep tools. To keep the behaviour consistent with older + versions, if the pattern read was terminated with CRLF (as + character literals) then both characters won't be included as + part of it, so if you really need to have pattern ending in + '\r', use a escape sequence or provide it by a different + method. + + -q, --quiet + Work quietly, that is, display nothing except error messages. + The exit status indicates whether or not any matches were + found. + + -r, --recursive + If any given path is a directory, recursively scan the files + it contains, taking note of any --include and --exclude set- + tings. By default, a directory is read as a normal file; in + some operating systems this gives an immediate end-of-file. + This option is a shorthand for setting the -d option to "re- + curse". + + --recursion-limit=number + This is an obsolete synonym for --depth-limit. See --match- + limit above for details. + + -s, --no-messages + Suppress error messages about non-existent or unreadable + files. Such files are quietly skipped. However, the return + code is still 2, even if matches were found in other files. + + -t, --total-count + This option is useful when scanning more than one file. If + used on its own, -t suppresses all output except for a grand + total number of matching lines (or non-matching lines if -v + is used) in all the files. If -t is used with -c, a grand to- + tal is output except when the previous output is just one + line. In other words, it is not output when just one file's + count is listed. If file names are being output, the grand + total is preceded by "TOTAL:". Otherwise, it appears as just + another number. The -t option is ignored when used with -L + (list files without matches), because the grand total would + always be zero. + + -u, --utf Operate in UTF/Unicode mode. This option is available only if + PCRE2 has been compiled with UTF-8 support. All patterns (in- + cluding those for any --exclude and --include options) and + all lines that are scanned must be valid strings of UTF-8 + characters. If an invalid UTF-8 string is encountered, an er- + ror occurs. + + -U, --utf-allow-invalid + As --utf, but in addition subject lines may contain invalid + UTF-8 code unit sequences. These can never form part of any + pattern match. Patterns themselves, however, must still be + valid UTF-8 strings. This facility allows valid UTF-8 strings + to be sought within arbitrary byte sequences in executable or + other binary files. For more details about matching in non- + valid UTF-8 strings, see the pcre2unicode(3) documentation. + + -V, --version + Write the version numbers of pcre2grep and the PCRE2 library + to the standard output and then exit. Anything else on the + command line is ignored. + + -v, --invert-match + Invert the sense of the match, so that lines which do not + match any of the patterns are the ones that are found. When + this option is set, options such as --only-matching and + --output, which specify parts of a match that are to be out- + put, are ignored. + + -w, --word-regex, --word-regexp + Force the patterns only to match "words". That is, there must + be a word boundary at the start and end of each matched + string. This is equivalent to having "\b(?:" at the start of + each pattern, and ")\b" at the end. This option applies only + to the patterns that are matched against the contents of + files; it does not apply to patterns specified by any of the + --include or --exclude options. + + -x, --line-regex, --line-regexp + Force the patterns to start matching only at the beginnings + of lines, and in addition, require them to match entire + lines. In multiline mode the match may be more than one line. + This is equivalent to having "^(?:" at the start of each pat- + tern and ")$" at the end. This option applies only to the + patterns that are matched against the contents of files; it + does not apply to patterns specified by any of the --include + or --exclude options. + + -Z, --null + Terminate files names in the regular output with a zero byte + (the NUL character) instead of what would normally appear. + This is useful when file names contain unusual characters + such as colons, hyphens, or even newlines. The option does + not apply to file names in error messages. + + +ENVIRONMENT VARIABLES + + The environment variables LC_ALL and LC_CTYPE are examined, in that or- + der, for a locale. The first one that is set is used. This can be over- + ridden by the --locale option. If no locale is set, the PCRE2 library's + default (usually the "C" locale) is used. + + +NEWLINES + + The -N (--newline) option allows pcre2grep to scan files with newline + conventions that differ from the default. This option affects only the + way scanned files are processed. It does not affect the interpretation + of files specified by the -f, --file-list, --exclude-from, or --in- + clude-from options. + + Any parts of the scanned input files that are written to the standard + output are copied with whatever newline sequences they have in the in- + put. However, if the final line of a file is output, and it does not + end with a newline sequence, a newline sequence is added. If the new- + line setting is CR, LF, CRLF or NUL, that line ending is output; for + the other settings (ANYCRLF or ANY) a single NL is used. + + The newline setting does not affect the way in which pcre2grep writes + newlines in informational messages to the standard output and error + streams. Under Windows, the standard output is set to be binary, so + that "\r\n" at the ends of output lines that are copied from the input + is not converted to "\r\r\n" by the C I/O library. This means that any + messages written to the standard output must end with "\r\n". For all + other operating systems, and for all messages to the standard error + stream, "\n" is used. + + +OPTIONS COMPATIBILITY WITH GNU GREP + + Many of the short and long forms of pcre2grep's options are the same as + in the GNU grep program. Any long option of the form --xxx-regexp (GNU + terminology) is also available as --xxx-regex (PCRE2 terminology). + However, the --case-restrict, --depth-limit, -E, --file-list, --file- + offsets, --heap-limit, --include-dir, --line-offsets, --locale, + --match-limit, -M, --multiline, -N, --newline, --no-ucp, --om-separa- + tor, --output, -P, -u, --utf, -U, and --utf-allow-invalid options are + specific to pcre2grep, as is the use of the --only-matching option with + a capturing parentheses number. + + Although most of the common options work the same way, a few are dif- + ferent in pcre2grep. For example, the --include option's argument is a + glob for GNU grep, but in pcre2grep it is a regular expression to which + the -i option applies. If both the -c and -l options are given, GNU + grep lists only file names, without counts, but pcre2grep gives the + counts as well. + + +OPTIONS WITH DATA + + There are four different ways in which an option with data can be spec- + ified. If a short form option is used, the data may follow immedi- + ately, or (with one exception) in the next command line item. For exam- + ple: + + -f/some/file + -f /some/file + + The exception is the -o option, which may appear with or without data. + Because of this, if data is present, it must follow immediately in the + same item, for example -o3. + + If a long form option is used, the data may appear in the same command + line item, separated by an equals character, or (with two exceptions) + it may appear in the next command line item. For example: + + --file=/some/file + --file /some/file + + Note, however, that if you want to supply a file name beginning with ~ + as data in a shell command, and have the shell expand ~ to a home di- + rectory, you must separate the file name from the option, because the + shell does not treat ~ specially unless it is at the start of an item. + + The exceptions to the above are the --colour (or --color) and --only- + matching options, for which the data is optional. If one of these op- + tions does have data, it must be given in the first form, using an + equals character. Otherwise pcre2grep will assume that it has no data. + + +USING PCRE2'S CALLOUT FACILITY + + pcre2grep has, by default, support for calling external programs or + scripts or echoing specific strings during matching by making use of + PCRE2's callout facility. However, this support can be completely or + partially disabled when pcre2grep is built. You can find out whether + your binary has support for callouts by running it with the --help op- + tion. If callout support is completely disabled, callouts in patterns + are forbidden by pcre2grep. If the facility is partially disabled, + calling external programs is not supported, and callouts that request + it are ignored. + + A callout in a PCRE2 pattern is of the form (?C) where the argu- + ment is either a number or a quoted string (see the pcre2callout docu- + mentation for details). Numbered callouts are ignored by pcre2grep; + only callouts with string arguments are useful. + + Echoing a specific string + + Starting the callout string with a pipe character invokes an echoing + facility that avoids calling an external program or script. This facil- + ity is always available, provided that callouts were not completely + disabled when pcre2grep was built. The rest of the callout string is + processed as a zero-terminated string, which means it should not con- + tain any internal binary zeros. It is written to the output, having + first been passed through the same escape processing as text from the + --output (-O) option (see above). However, $0 or $& cannot be used to + insert a matched substring because the match is still in progress. In- + stead, the single character '0' is inserted. Any syntax errors in the + string (for example, a dollar not followed by another character) causes + the callout to be ignored. No terminator is added to the output string, + so if you want a newline, you must include it explicitly using the es- + cape $n. For example: + + pcre2grep '(.)(..(.))(?C"|[$1] [$2] [$3]$n")' + + Matching continues normally after the string is output. If you want to + see only the callout output but not any output from an actual match, + you should end the pattern with (*FAIL). + + Calling external programs or scripts + + This facility can be independently disabled when pcre2grep is built. It + is supported for Windows, where a call to _spawnvp() is used, for VMS, + where lib$spawn() is used, and for any Unix-like environment where + fork() and execv() are available. + + If the callout string does not start with a pipe (vertical bar) charac- + ter, it is parsed into a list of substrings separated by pipe charac- + ters. The first substring must be an executable name, with the follow- + ing substrings specifying arguments: + + executable_name|arg1|arg2|... + + Any substring (including the executable name) may contain escape se- + quences started by a dollar character. These are the same as for the + --output (-O) option documented above, except that $0 or $& cannot in- + sert the matched string because the match is still in progress. In- + stead, the character '0' is inserted. If you need a literal dollar or + pipe character in any substring, use $$ or $| respectively. Here is an + example: + + echo -e "abcde\n12345" | pcre2grep \ + '(?x)(.)(..(.)) + (?C"/bin/echo|Arg1: [$1] [$2] [$3]|Arg2: $|${1}$| ($4)")()' - + + Output: + + Arg1: [a] [bcd] [d] Arg2: |a| () + abcde + Arg1: [1] [234] [4] Arg2: |1| () + 12345 + + The parameters for the system call that is used to run the program or + script are zero-terminated strings. This means that binary zero charac- + ters in the callout argument will cause premature termination of their + substrings, and therefore should not be present. Any syntax errors in + the string (for example, a dollar not followed by another character) + causes the callout to be ignored. If running the program fails for any + reason (including the non-existence of the executable), a local match- + ing failure occurs and the matcher backtracks in the normal way. + + +MATCHING ERRORS + + It is possible to supply a regular expression that takes a very long + time to fail to match certain lines. Such patterns normally involve + nested indefinite repeats, for example: (a+)*\d when matched against a + line of a's with no final digit. The PCRE2 matching function has a re- + source limit that causes it to abort in these circumstances. If this + happens, pcre2grep outputs an error message and the line that caused + the problem to the standard error stream. If there are more than 20 + such errors, pcre2grep gives up. + + The --match-limit option of pcre2grep can be used to set the overall + resource limit. There are also other limits that affect the amount of + memory used during matching; see the discussion of --heap-limit and + --depth-limit above. + + +DIAGNOSTICS + + Exit status is 0 if any matches were found, 1 if no matches were found, + and 2 for syntax errors, overlong lines, non-existent or inaccessible + files (even if matches were found in other files) or too many matching + errors. Using the -s option to suppress error messages about inaccessi- + ble files does not affect the return code. + + When run under VMS, the return code is placed in the symbol + PCRE2GREP_RC because VMS does not distinguish between exit(0) and + exit(1). + + +SEE ALSO + + pcre2pattern(3), pcre2syntax(3), pcre2callout(3), pcre2unicode(3). + + +AUTHOR + + Philip Hazel + Retired from University Computing Service + Cambridge, England. + + +REVISION + + Last updated: 04 February 2025 + Copyright (c) 1997-2023 University of Cambridge. + + +PCRE2 10.46 04 February 2025 PCRE2GREP(1) diff --git a/miniconda3/share/doc/pcre2/pcre2test.txt b/miniconda3/share/doc/pcre2/pcre2test.txt new file mode 100644 index 0000000000000000000000000000000000000000..5df8c71c9aedaee45c01f5c1164d506ecc1e9121 --- /dev/null +++ b/miniconda3/share/doc/pcre2/pcre2test.txt @@ -0,0 +1,2068 @@ +PCRE2TEST(1) General Commands Manual PCRE2TEST(1) + + +NAME + pcre2test - a program for testing Perl-compatible regular expressions. + + +SYNOPSIS + + pcre2test [options] [input file [output file]] + + pcre2test is a test program for the PCRE2 regular expression libraries, + but it can also be used for experimenting with regular expressions. + This document describes the features of the test program; for details + of the regular expressions themselves, see the pcre2pattern documenta- + tion. For details of the PCRE2 library function calls and their op- + tions, see the pcre2api documentation. + + The input for pcre2test is a sequence of regular expression patterns + and subject strings to be matched. There are also command lines for + setting defaults and controlling some special actions. The output shows + the result of each match attempt. Modifiers on external or internal + command lines, the patterns, and the subject lines specify PCRE2 func- + tion options, control how the subject is processed, and what output is + produced. + + There are many obscure modifiers, some of which are specifically de- + signed for use in conjunction with the test script and data files that + are distributed as part of PCRE2. All the modifiers are documented + here, some without much justification, but many of them are unlikely to + be of use except when testing the libraries. + + +PCRE2's 8-BIT, 16-BIT AND 32-BIT LIBRARIES + + Different versions of the PCRE2 library can be built to support charac- + ter strings that are encoded in 8-bit, 16-bit, or 32-bit code units. + One, two, or all three of these libraries may be simultaneously in- + stalled. The pcre2test program can be used to test all the libraries. + However, its own input and output are always in 8-bit format. When + testing the 16-bit or 32-bit libraries, patterns and subject strings + are converted to 16-bit or 32-bit format before being passed to the li- + brary functions. Results are converted back to 8-bit code units for + output. + + In the rest of this document, the names of library functions and struc- + tures are given in generic form, for example, pcre2_compile(). The ac- + tual names used in the libraries have a suffix _8, _16, or _32, as ap- + propriate. + + +INPUT ENCODING + + Input to pcre2test is processed line by line, either by calling the C + library's fgets() function, or via the libreadline or libedit library. + In some Windows environments character 26 (hex 1A) causes an immediate + end of file, and no further data is read, so this character should be + avoided unless you really want that action. + + The input is processed using C's string functions, so must not contain + binary zeros, even though in Unix-like environments, fgets() treats any + bytes other than newline as data characters. An error is generated if a + binary zero is encountered. By default subject lines are processed for + backslash escapes, which makes it possible to include any data value in + strings that are passed to the library for matching. For patterns, + there is a facility for specifying some or all of the 8-bit input char- + acters as hexadecimal pairs, which makes it possible to include binary + zeros. + + Input for the 16-bit and 32-bit libraries + + When testing the 16-bit or 32-bit libraries, there is a need to be able + to generate character code points greater than 255 in the strings that + are passed to the library. For subject lines and some patterns, back- + slash escapes can be used. In addition, when the utf modifier (see + "Setting compilation options" below) is set, the pattern and any fol- + lowing subject lines are interpreted as UTF-8 strings and translated to + UTF-16 or UTF-32 as appropriate. + + For non-UTF testing of wide characters, the utf8_input modifier can be + used. This is mutually exclusive with utf, and is allowed only in + 16-bit or 32-bit mode. It causes the pattern and following subject + lines to be treated as UTF-8 according to the original definition (RFC + 2279), which allows for character values up to 0x7fffffff. Each charac- + ter is placed in one 16-bit or 32-bit code unit (in the 16-bit case, + values greater than 0xffff cause an error to occur). + + UTF-8 (in its original definition) is not capable of encoding values + greater than 0x7fffffff, but such values can be handled by the 32-bit + library. When testing this library in non-UTF mode with utf8_input set, + if any character is preceded by the byte 0xff (which is an invalid byte + in UTF-8) 0x80000000 is added to the character's value. For subject + strings, using an escape sequence is preferable. + + +COMMAND LINE OPTIONS + + -8 If the 8-bit library has been built, this option causes it to + be used (this is the default). If the 8-bit library has not + been built, this option causes an error. + + -16 If the 16-bit library has been built, this option causes it + to be used. If the 8-bit library has not been built, this is + the default. If the 16-bit library has not been built, this + option causes an error. + + -32 If the 32-bit library has been built, this option causes it + to be used. If no other library has been built, this is the + default. If the 32-bit library has not been built, this op- + tion causes an error. + + -ac Behave as if each pattern has the auto_callout modifier, that + is, insert automatic callouts into every pattern that is com- + piled. + + -AC As for -ac, but in addition behave as if each subject line + has the callout_extra modifier, that is, show additional in- + formation from callouts. + + -b Behave as if each pattern has the fullbincode modifier; the + full internal binary form of the pattern is output after com- + pilation. + + -C Output the version number of the PCRE2 library, and all + available information about the optional features that are + included, and then exit with zero exit code. All other op- + tions are ignored. If both -C and -LM are present, whichever + is first is recognized. + + -C option Output information about a specific build-time option, then + exit. This functionality is intended for use in scripts such + as RunTest. The following options output the value and set + the exit code as indicated: + + ebcdic-nl the code for LF (= NL) in an EBCDIC environment: + either 0x15 or 0x25 + 0 if used in an ASCII/Unicode environment + exit code is always 0 + linksize the configured internal link size (2, 3, or 4) + exit code is set to the link size + newline the default newline setting: + CR, LF, CRLF, ANYCRLF, ANY, or NUL + exit code is always 0 + bsr the default setting for what \R matches: + ANYCRLF or ANY + exit code is always 0 + + The following options output 1 for true or 0 for false, and + set the exit code to the same value: + + backslash-C \C is supported (not locked out) + ebcdic compiled for an EBCDIC environment + jit just-in-time support is available + pcre2-16 the 16-bit library was built + pcre2-32 the 32-bit library was built + pcre2-8 the 8-bit library was built + unicode Unicode support is available + + Note that the availability of JIT support in the library does + not guarantee that it can actually be used because in some + environments it is unable to allocate executable memory. The + option "jitusable" gives more detailed information. It re- + turns one of the following values: + + 0 JIT is available and usable + 1 JIT is available but cannot allocate executable memory + 2 JIT is not available + 3 Unexpected return from test call to pcre2_jit_compile() + + If an unknown option is given, an error message is output; + the exit code is 0. + + -d Behave as if each pattern has the debug modifier; the inter- + nal form and information about the compiled pattern is output + after compilation; -d is equivalent to -b -i. + + -dfa Behave as if each subject line has the dfa modifier; matching + is done using the pcre2_dfa_match() function instead of the + default pcre2_match(). + + -error number[,number,...] + Call pcre2_get_error_message() for each of the error numbers + in the comma-separated list, display the resulting messages + on the standard output, then exit with zero exit code. The + numbers may be positive or negative. This is a convenience + facility for PCRE2 maintainers. + + -help Output a brief summary these options and then exit. + + -i Behave as if each pattern has the info modifier; information + about the compiled pattern is given after compilation. + + -jit Behave as if each pattern line has the jit modifier; after + successful compilation, each pattern is passed to the just- + in-time compiler, if available. + + -jitfast Behave as if each pattern line has the jitfast modifier; af- + ter successful compilation, each pattern is passed to the + just-in-time compiler, if available, and each subject line is + passed directly to the JIT matcher via its "fast path". + + -jitverify + Behave as if each pattern line has the jitverify modifier; + after successful compilation, each pattern is passed to the + just-in-time compiler, if available, and the use of JIT for + matching is verified. + + -LM List modifiers: write a list of available pattern and subject + modifiers to the standard output, then exit with zero exit + code. All other options are ignored. If both -C and any -Lx + options are present, whichever is first is recognized. + + -LP List properties: write a list of recognized Unicode proper- + ties to the standard output, then exit with zero exit code. + All other options are ignored. If both -C and any -Lx options + are present, whichever is first is recognized. + + -LS List scripts: write a list of recognized Unicode script names + to the standard output, then exit with zero exit code. All + other options are ignored. If both -C and any -Lx options are + present, whichever is first is recognized. + + -pattern modifier-list + Behave as if each pattern line contains the given modifiers. + + -q Do not output the version number of pcre2test at the start of + execution. + + -S size On Unix-like systems, set the size of the run-time stack to + size mebibytes (units of 1024*1024 bytes). + + -subject modifier-list + Behave as if each subject line contains the given modifiers. + + -t Run each compile and match many times with a timer, and out- + put the resulting times per compile or match. When JIT is + used, separate times are given for the initial compile and + the JIT compile. You can control the number of iterations + that are used for timing by following -t with a number (as a + separate item on the command line). For example, "-t 1000" + iterates 1000 times. The default is to iterate 500,000 times. + + -tm This is like -t except that it times only the matching phase, + not the compile phase. + + -T -TM These behave like -t and -tm, but in addition, at the end of + a run, the total times for all compiles and matches are out- + put. + + -version Output the PCRE2 version number and then exit. + + +DESCRIPTION + + If pcre2test is given two filename arguments, it reads from the first + and writes to the second. If the first name is "-", input is taken from + the standard input. If pcre2test is given only one argument, it reads + from that file and writes to stdout. Otherwise, it reads from stdin and + writes to stdout. + + When pcre2test is built, a configuration option can specify that it + should be linked with the libreadline or libedit library. When this is + done, if the input is from a terminal, it is read using the readline() + function. This provides line-editing and history facilities. The output + from the -help option states whether or not readline() will be used. + + The program handles any number of tests, each of which consists of a + set of input lines. Each set starts with a regular expression pattern, + followed by any number of subject lines to be matched against that pat- + tern. In between sets of test data, command lines that begin with # may + appear. This file format, with some restrictions, can also be processed + by the perltest.sh script that is distributed with PCRE2 as a means of + checking that the behaviour of PCRE2 and Perl is the same. For a speci- + fication of perltest.sh, see the comments near its beginning. See also + the #perltest command below. + + When the input is a terminal, pcre2test prompts for each line of input, + using "re>" to prompt for regular expression patterns, and "data>" to + prompt for subject lines. Command lines starting with # can be entered + only in response to the "re>" prompt. + + Each subject line is matched separately and independently. If you want + to do multi-line matches, you have to use the \n escape sequence (or \r + or \r\n, etc., depending on the newline setting) in a single line of + input to encode the newline sequences. There is no limit on the length + of subject lines; the input buffer is automatically extended if it is + too small. There are replication features that makes it possible to + generate long repetitive pattern or subject lines without having to + supply them explicitly. + + An empty line or the end of the file signals the end of the subject + lines for a test, at which point a new pattern or command line is ex- + pected if there is still input to be read. + + +COMMAND LINES + + In between sets of test data, a line that begins with # is interpreted + as a command line. If the first character is followed by white space or + an exclamation mark, the line is treated as a comment, and ignored. + Otherwise, the following commands are recognized: + + #forbid_utf + + Subsequent patterns automatically have the PCRE2_NEVER_UTF and + PCRE2_NEVER_UCP options set, which locks out the use of the PCRE2_UTF + and PCRE2_UCP options and the use of (*UTF) and (*UCP) at the start of + patterns. This command also forces an error if a subsequent pattern + contains any occurrences of \P, \p, or \X, which are still supported + when PCRE2_UTF is not set, but which require Unicode property support + to be included in the library. + + This is a trigger guard that is used in test files to ensure that UTF + or Unicode property tests are not accidentally added to files that are + used when Unicode support is not included in the library. Setting + PCRE2_NEVER_UTF and PCRE2_NEVER_UCP as a default can also be obtained + by the use of #pattern; the difference is that #forbid_utf cannot be + unset, and the automatic options are not displayed in pattern informa- + tion, to avoid cluttering up test output. + + #load + + This command is used to load a set of precompiled patterns from a file, + as described in the section entitled "Saving and restoring compiled + patterns" below. + + #loadtables + + This command is used to load a set of binary character tables that can + be accessed by the tables=3 qualifier. Such tables can be created by + the pcre2_dftables program with the -b option. + + #newline_default [] + + When PCRE2 is built, a default newline convention can be specified. + This determines which characters and/or character pairs are recognized + as indicating a newline in a pattern or subject string. The default can + be overridden when a pattern is compiled. The standard test files con- + tain tests of various newline conventions, but the majority of the + tests expect a single linefeed to be recognized as a newline by de- + fault. Without special action the tests would fail when PCRE2 is com- + piled with either CR or CRLF as the default newline. + + The #newline_default command specifies a list of newline types that are + acceptable as the default. The types must be one of CR, LF, CRLF, ANY- + CRLF, ANY, or NUL (in upper or lower case), for example: + + #newline_default LF Any anyCRLF + + If the default newline is in the list, this command has no effect. Oth- + erwise, except when testing the POSIX API, a newline modifier that + specifies the first newline convention in the list (LF in the above ex- + ample) is added to any pattern that does not already have a newline + modifier. If the newline list is empty, the feature is turned off. This + command is present in a number of the standard test input files. + + When the POSIX API is being tested there is no way to override the de- + fault newline convention, though it is possible to set the newline con- + vention from within the pattern. A warning is given if the posix or + posix_nosub modifier is used when #newline_default would set a default + for the non-POSIX API. + + #pattern + + This command sets a default modifier list that applies to all subse- + quent patterns. Modifiers on a pattern can change these settings. + + #perltest + + This line is used in test files that can also be processed by perl- + test.sh to confirm that Perl gives the same results as PCRE2. Subse- + quent tests are checked for the use of pcre2test features that are in- + compatible with the perltest.sh script. + + Patterns must use '/' as their delimiter, and only certain modifiers + are supported. Comment lines, #pattern commands, and #subject commands + that set or unset "mark" are recognized and acted on. The #perltest, + #forbid_utf, and #newline_default commands, which are needed in the + relevant pcre2test files, are silently ignored. All other command lines + are ignored, but give a warning message. The #perltest command helps + detect tests that are accidentally put in the wrong file or use the + wrong delimiter. For more details of the perltest.sh script see the + comments it contains. + + #pop [] + #popcopy [] + + These commands are used to manipulate the stack of compiled patterns, + as described in the section entitled "Saving and restoring compiled + patterns" below. + + #save + + This command is used to save a set of compiled patterns to a file, as + described in the section entitled "Saving and restoring compiled pat- + terns" below. + + #subject + + This command sets a default modifier list that applies to all subse- + quent subject lines. Modifiers on a subject line can change these set- + tings. + + +MODIFIER SYNTAX + + Modifier lists are used with both pattern and subject lines. Items in a + list are separated by commas followed by optional white space. Trailing + whitespace in a modifier list is ignored. Some modifiers may be given + for both patterns and subject lines, whereas others are valid only for + one or the other. Each modifier has a long name, for example "an- + chored", and some of them must be followed by an equals sign and a + value, for example, "offset=12". Values cannot contain comma charac- + ters, but may contain spaces. Modifiers that do not take values may be + preceded by a minus sign to turn off a previous setting. + + A few of the more common modifiers can also be specified as single let- + ters, for example "i" for "caseless". In documentation, following the + Perl convention, these are written with a slash ("the /i modifier") for + clarity. Abbreviated modifiers must all be concatenated in the first + item of a modifier list. If the first item is not recognized as a long + modifier name, it is interpreted as a sequence of these abbreviations. + For example: + + /abc/ig,newline=cr,jit=3 + + This is a pattern line whose modifier list starts with two one-letter + modifiers (/i and /g). The lower-case abbreviated modifiers are the + same as used in Perl. + + +PATTERN SYNTAX + + A pattern line must start with one of the following characters (common + symbols, excluding pattern meta-characters): + + / ! " ' ` - = _ : ; , % & @ ~ + + This is interpreted as the pattern's delimiter. A regular expression + may be continued over several input lines, in which case the newline + characters are included within it. It is possible to include the delim- + iter as a literal within the pattern by escaping it with a backslash, + for example + + /abc\/def/ + + If you do this, the escape and the delimiter form part of the pattern, + but since the delimiters are all non-alphanumeric, the inclusion of the + backslash does not affect the pattern's interpretation. Note, however, + that this trick does not work within \Q...\E literal bracketing because + the backslash will itself be interpreted as a literal. If the terminat- + ing delimiter is immediately followed by a backslash, for example, + + /abc/\ + + a backslash is added to the end of the pattern. This is done to provide + a way of testing the error condition that arises if a pattern finishes + with a backslash, because + + /abc\/ + + is interpreted as the first line of a pattern that starts with "abc/", + causing pcre2test to read the next line as a continuation of the regu- + lar expression. + + A pattern can be followed by a modifier list (details below). + + +SUBJECT LINE SYNTAX + + Before each subject line is passed to pcre2_match(), pcre2_dfa_match(), + or pcre2_jit_match(), leading and trailing white space is removed, and + the line is scanned for backslash escapes, unless the subject_literal + modifier was set for the pattern. The following provide a means of en- + coding non-printing characters in a visible way: + + \a alarm (BEL, \x07) + \b backspace (\x08) + \e escape (\x27) + \f form feed (\x0c) + \n newline (\x0a) + \N{U+hh...} unicode character (any number of hex digits) + \r carriage return (\x0d) + \t tab (\x09) + \v vertical tab (\x0b) + \ddd octal number (up to 3 octal digits); represent a single + code point unless larger than 255 with the 8-bit li- + brary + \o{dd...} octal number (any number of octal digits} representing a + character in UTF mode or a code point + \xhh hexadecimal byte (up to 2 hex digits) + \x{hh...} hexadecimal number (up to 8 hex digits) representing a + character in UTF mode or a code point + + Invoking \N{U+hh...} or \x{hh...} doesn't require the use of the utf + modifier on the pattern. It is always recognized. There may be any num- + ber of hexadecimal digits inside the braces; invalid values provoke er- + ror messages but when using \N{U+hh...} with some invalid unicode char- + acters they will be accepted with a warning instead. + + Note that even in UTF-8 mode, \xhh (and depending of how large, \ddd) + describe one byte rather than one character; this makes it possible to + construct invalid UTF-8 sequences for testing purposes. On the other + hand, \x{hh...} is interpreted as a UTF-8 character in UTF-8 mode, only + generating more than one byte if the value is greater than 127. To + avoid the ambiguity it is preferred to use \N{U+hh...} when describing + characters. When testing the 8-bit library not in UTF-8 mode, \x{hh} + generates one byte for values that could fit on it, and causes an error + for greater values. + + When testing the 16-bit library, not in UTF-16 mode, all 4-digit + \x{hhhh} values are accepted. This makes it possible to construct in- + valid UTF-16 sequences for testing purposes. + + When testing the 32-bit library, not in UTF-32 mode, all 4 to 8-digit + \x{...} values are accepted. This makes it possible to construct in- + valid UTF-32 sequences for testing purposes. + + There is a special backslash sequence that specifies replication of one + or more characters: + + \[]{} + + This makes it possible to test long strings without having to provide + them as part of the file. For example: + + \[abc]{4} + + is converted to "abcabcabcabc". This feature does not support nesting. + To include a closing square bracket in the characters, code it as \x5D. + + A backslash followed by an equals sign marks the end of the subject + string and the start of a modifier list. For example: + + abc\=notbol,notempty + + If the subject string is empty and \= is followed by whitespace, the + line is treated as a comment line, and is not used for matching. For + example: + + \= This is a comment. + abc\= This is an invalid modifier list. + + A backslash followed by any other non-alphanumeric character just es- + capes that character. A backslash followed by anything else causes an + error. However, if the very last character in the line is a backslash + (and there is no modifier list), it is ignored. This gives a way of + passing an empty line as data, since a real empty line terminates the + data input. + + If the subject_literal modifier is set for a pattern, all subject lines + that follow are treated as literals, with no special treatment of back- + slashes. No replication is possible, and any subject modifiers must be + set as defaults by a #subject command. + + +PATTERN MODIFIERS + + There are several types of modifier that can appear in pattern lines. + Except where noted below, they may also be used in #pattern commands. A + pattern's modifier list can add to or override default modifiers that + were set by a previous #pattern command. + + Setting compilation options + + The following modifiers set options for pcre2_compile(). Most of them + set bits in the options argument of that function, but those whose + names start with PCRE2_EXTRA are additional options that are set in the + compile context. Some of these options have single-letter abbrevia- + tions. There is special handling for /x: if a second x is present, + PCRE2_EXTENDED is converted into PCRE2_EXTENDED_MORE as in Perl. A + third appearance adds PCRE2_EXTENDED as well, though this makes no dif- + ference to the way pcre2_compile() behaves. See pcre2api for a descrip- + tion of the effects of these options. + + allow_empty_class set PCRE2_ALLOW_EMPTY_CLASS + allow_lookaround_bsk set PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK + allow_surrogate_escapes set PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES + alt_bsux set PCRE2_ALT_BSUX + alt_circumflex set PCRE2_ALT_CIRCUMFLEX + alt_extended_class set PCRE2_ALT_EXTENDED_CLASS + alt_verbnames set PCRE2_ALT_VERBNAMES + anchored set PCRE2_ANCHORED + /a ascii_all set all ASCII options + ascii_bsd set PCRE2_EXTRA_ASCII_BSD + ascii_bss set PCRE2_EXTRA_ASCII_BSS + ascii_bsw set PCRE2_EXTRA_ASCII_BSW + ascii_digit set PCRE2_EXTRA_ASCII_DIGIT + ascii_posix set PCRE2_EXTRA_ASCII_POSIX + auto_callout set PCRE2_AUTO_CALLOUT + bad_escape_is_literal set PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL + /i caseless set PCRE2_CASELESS + /r caseless_restrict set PCRE2_EXTRA_CASELESS_RESTRICT + dollar_endonly set PCRE2_DOLLAR_ENDONLY + /s dotall set PCRE2_DOTALL + dupnames set PCRE2_DUPNAMES + endanchored set PCRE2_ENDANCHORED + escaped_cr_is_lf set PCRE2_EXTRA_ESCAPED_CR_IS_LF + /x extended set PCRE2_EXTENDED + /xx extended_more set PCRE2_EXTENDED_MORE + extra_alt_bsux set PCRE2_EXTRA_ALT_BSUX + firstline set PCRE2_FIRSTLINE + literal set PCRE2_LITERAL + match_line set PCRE2_EXTRA_MATCH_LINE + match_invalid_utf set PCRE2_MATCH_INVALID_UTF + match_unset_backref set PCRE2_MATCH_UNSET_BACKREF + match_word set PCRE2_EXTRA_MATCH_WORD + /m multiline set PCRE2_MULTILINE + never_backslash_c set PCRE2_NEVER_BACKSLASH_C + never_callout set PCRE2_EXTRA_NEVER_CALLOUT + never_ucp set PCRE2_NEVER_UCP + never_utf set PCRE2_NEVER_UTF + /n no_auto_capture set PCRE2_NO_AUTO_CAPTURE + no_auto_possess set PCRE2_NO_AUTO_POSSESS + no_bs0 set PCRE2_EXTRA_NO_BS0 + no_dotstar_anchor set PCRE2_NO_DOTSTAR_ANCHOR + no_start_optimize set PCRE2_NO_START_OPTIMIZE + no_utf_check set PCRE2_NO_UTF_CHECK + python_octal set PCRE2_EXTRA_PYTHON_OCTAL + turkish_casing set PCRE2_EXTRA_TURKISH_CASING + ucp set PCRE2_UCP + ungreedy set PCRE2_UNGREEDY + use_offset_limit set PCRE2_USE_OFFSET_LIMIT + utf set PCRE2_UTF + + As well as turning on the PCRE2_UTF option, the utf modifier causes all + non-printing characters in output strings to be printed using the + \x{hh...} notation. Otherwise, those less than 0x100 are output in hex + without the curly brackets. Setting utf in 16-bit or 32-bit mode also + causes pattern and subject strings to be translated to UTF-16 or + UTF-32, respectively, before being passed to library functions. + + The following modifiers enable or disable performance optimizations by + calling pcre2_set_optimize() before invoking the regex compiler. + + optimization_full enable all optional optimizations + optimization_none disable all optional optimizations + auto_possess auto-possessify variable quantifiers + auto_possess_off don't auto-possessify variable quantifiers + dotstar_anchor anchor patterns starting with .* + dotstar_anchor_off don't anchor patterns starting with .* + start_optimize enable pre-scan of subject string + start_optimize_off disable pre-scan of subject string + + See the pcre2_set_optimize documentation for details on these optimiza- + tions. + + Setting compilation controls + + The following modifiers affect the compilation process or request in- + formation about the pattern. There are single-letter abbreviations for + some that are heavily used in the test files. + + /B bincode show binary code without lengths + bsr=[anycrlf|unicode] specify \R handling + callout_info show callout information + convert= request foreign pattern conversion + convert_glob_escape=c set glob escape character + convert_glob_separator=c set glob separator character + convert_length set convert buffer length + debug same as info,fullbincode + expand expand repetition syntax in pattern + framesize show matching frame size + fullbincode show binary code with lengths + /I info show info about compiled pattern + hex unquoted characters are hexadecimal + jit[=] use JIT + jitfast use JIT fast path + jitverify verify JIT use + locale= use this locale + max_pattern_compiled ) set maximum compiled pattern + _length= ) length (bytes) + max_pattern_length= set maximum pattern length (code units) + max_varlookbehind= set maximum variable lookbehind length + memory show memory used + newline= set newline type + null_context compile with a NULL context + null_pattern pass pattern as NULL + parens_nest_limit= set maximum parentheses depth + posix use the POSIX API + posix_nosub use the POSIX API with REG_NOSUB + push push compiled pattern onto the stack + pushcopy push a copy onto the stack + pushtablescopy push a copy with tables onto the stack + stackguard= test the stackguard feature + subject_literal treat all subject lines as literal + tables=[0|1|2|3] select internal tables + use_length do not zero-terminate the pattern + utf8_input treat input as UTF-8 + + The effects of these modifiers are described in the following sections. + + Newline and \R handling + + The bsr modifier specifies what \R in a pattern should match. If it is + set to "anycrlf", \R matches CR, LF, or CRLF only. If it is set to + "unicode", \R matches any Unicode newline sequence. The default can be + specified when PCRE2 is built; if it is not, the default is set to Uni- + code. + + The newline modifier specifies which characters are to be interpreted + as newlines, both in the pattern and in subject lines. The type must be + one of CR, LF, CRLF, ANYCRLF, ANY, or NUL (in upper or lower case). + + Information about a pattern + + The debug modifier is a shorthand for info,fullbincode, requesting all + available information. + + The bincode modifier causes a representation of the compiled code to be + output after compilation. This information does not contain length and + offset values, which ensures that the same output is generated for dif- + ferent internal link sizes and different code unit widths. By using + bincode, the same regression tests can be used in different environ- + ments. + + The fullbincode modifier, by contrast, does include length and offset + values. This is used in a few special tests that run only for specific + code unit widths and link sizes, and is also useful for one-off tests. + + The info modifier requests information about the compiled pattern + (whether it is anchored, has a fixed first character, and so on). The + information is obtained from the pcre2_pattern_info() function. Here + are some typical examples: + + re> /(?i)(^a|^b)/m,info + Capture group count = 1 + Compile options: multiline + Overall options: caseless multiline + First code unit at start or follows newline + Subject length lower bound = 1 + + re> /(?i)abc/info + Capture group count = 0 + Compile options: + Overall options: caseless + First code unit = 'a' (caseless) + Last code unit = 'c' (caseless) + Subject length lower bound = 3 + + "Compile options" are those specified by modifiers; "overall options" + have added options that are taken or deduced from the pattern. If both + sets of options are the same, just a single "options" line is output; + if there are no options, the line is omitted. "First code unit" is + where any match must start; if there is more than one they are listed + as "starting code units". "Last code unit" is the last literal code + unit that must be present in any match. This is not necessarily the + last character. These lines are omitted if no starting or ending code + units are recorded. The subject length line is omitted when + no_start_optimize is set because the minimum length is not calculated + when it can never be used. + + The framesize modifier shows the size, in bytes, of each storage frame + used by pcre2_match() for handling backtracking. The size depends on + the number of capturing parentheses in the pattern. A vector of these + frames is used at matching time; its overall size is shown when the + heaframes_size subject modifier is set. + + The callout_info modifier requests information about all the callouts + in the pattern. A list of them is output at the end of any other infor- + mation that is requested. For each callout, either its number or string + is given, followed by the item that follows it in the pattern. + + Passing a NULL context + + Normally, pcre2test passes a context block to pcre2_compile(). If the + null_context modifier is set, however, NULL is passed. This is for + testing that pcre2_compile() behaves correctly in this case (it uses + default values). + + Passing a NULL pattern + + The null_pattern modifier is for testing the behaviour of pcre2_com- + pile() when the pattern argument is NULL. The length value passed is + the default PCRE2_ZERO_TERMINATED unless use_length is set. Any length + other than zero causes an error. + + Specifying pattern characters in hexadecimal + + The hex modifier specifies that the characters of the pattern, except + for substrings enclosed in single or double quotes, are to be inter- + preted as pairs of hexadecimal digits. This feature is provided as a + way of creating patterns that contain binary zeros and other non-print- + ing characters. White space is permitted between pairs of digits. For + example, this pattern contains three characters: + + /ab 32 59/hex + + Parts of such a pattern are taken literally if quoted. This pattern + contains nine characters, only two of which are specified in hexadeci- + mal: + + /ab "literal" 32/hex + + Either single or double quotes may be used. There is no way of includ- + ing the delimiter within a substring. The hex and expand modifiers are + mutually exclusive. + + Specifying the pattern's length + + By default, patterns are passed to the compiling functions as zero-ter- + minated strings but can be passed by length instead of being zero-ter- + minated. The use_length modifier causes this to happen. Using a length + happens automatically (whether or not use_length is set) when hex is + set, because patterns specified in hexadecimal may contain binary ze- + ros. + + If hex or use_length is used with the POSIX wrapper API (see "Using the + POSIX wrapper API" below), the REG_PEND extension is used to pass the + pattern's length. + + Specifying a maximum for variable lookbehinds + + Variable lookbehind assertions are supported only if, for each one, + there is a maximum length (in characters) that it can match. There is a + limit on this, whose default can be set at build time, with an ultimate + default of 255. The max_varlookbehind modifier uses the + pcre2_set_max_varlookbehind() function to change the limit. Lookbehinds + whose branches each match a fixed length are limited to 65535 charac- + ters per branch. + + Specifying wide characters in 16-bit and 32-bit modes + + In 16-bit and 32-bit modes, all input is automatically treated as UTF-8 + and translated to UTF-16 or UTF-32 when the utf modifier is set. For + testing the 16-bit and 32-bit libraries in non-UTF mode, the utf8_input + modifier can be used. It is mutually exclusive with utf. Input lines + are interpreted as UTF-8 as a means of specifying wide characters. More + details are given in "Input encoding" above. + + Generating long repetitive patterns + + Some tests use long patterns that are very repetitive. Instead of cre- + ating a very long input line for such a pattern, you can use a special + repetition feature, similar to the one described for subject lines + above. If the expand modifier is present on a pattern, parts of the + pattern that have the form + + \[]{} + + are expanded before the pattern is passed to pcre2_compile(). For exam- + ple, \[AB]{6000} is expanded to "ABAB..." 6000 times. This construction + cannot be nested. An initial "\[" sequence is recognized only if "]{" + followed by decimal digits and "}" is found later in the pattern. If + not, the characters remain in the pattern unaltered. The expand and hex + modifiers are mutually exclusive. + + If part of an expanded pattern looks like an expansion, but is really + part of the actual pattern, unwanted expansion can be avoided by giving + two values in the quantifier. For example, \[AB]{6000,6000} is not rec- + ognized as an expansion item. + + If the info modifier is set on an expanded pattern, the result of the + expansion is included in the information that is output. + + JIT compilation + + Just-in-time (JIT) compiling is a heavyweight optimization that can + greatly speed up pattern matching. See the pcre2jit documentation for + details. JIT compiling happens, optionally, after a pattern has been + successfully compiled into an internal form. The JIT compiler converts + this to optimized machine code. It needs to know whether the match-time + options PCRE2_PARTIAL_HARD and PCRE2_PARTIAL_SOFT are going to be used, + because different code is generated for the different cases. See the + partial modifier in "Subject Modifiers" below for details of how these + options are specified for each match attempt. + + JIT compilation is requested by the jit pattern modifier, which may op- + tionally be followed by an equals sign and a number in the range 0 to + 7. The three bits that make up the number specify which of the three + JIT operating modes are to be compiled: + + 1 compile JIT code for non-partial matching + 2 compile JIT code for soft partial matching + 4 compile JIT code for hard partial matching + + The possible values for the jit modifier are therefore: + + 0 disable JIT + 1 normal matching only + 2 soft partial matching only + 3 normal and soft partial matching + 4 hard partial matching only + 6 soft and hard partial matching only + 7 all three modes + + If no number is given, 7 is assumed. The phrase "partial matching" + means a call to pcre2_match() with either the PCRE2_PARTIAL_SOFT or the + PCRE2_PARTIAL_HARD option set. Note that such a call may return a com- + plete match; the options enable the possibility of a partial match, but + do not require it. Note also that if you request JIT compilation only + for partial matching (for example, jit=2) but do not set the partial + modifier on a subject line, that match will not use JIT code because + none was compiled for non-partial matching. + + If JIT compilation is successful, the compiled JIT code will automati- + cally be used when an appropriate type of match is run, except when in- + compatible run-time options are specified. For more details, see the + pcre2jit documentation. See also the jitstack modifier below for a way + of setting the size of the JIT stack. + + If the jitfast modifier is specified, matching is done using the JIT + "fast path" interface, pcre2_jit_match(), which skips some of the san- + ity checks that are done by pcre2_match(), and of course does not work + when JIT is not supported. If jitfast is specified without jit, jit=7 + is assumed. + + If the jitverify modifier is specified, information about the compiled + pattern shows whether JIT compilation was or was not successful. If + jitverify is specified without jit, jit=7 is assumed. If JIT compila- + tion is successful when jitverify is set, the text "(JIT)" is added to + the first output line after a match or non match when JIT-compiled code + was actually used in the match. + + Setting a locale + + The locale modifier must specify the name of a locale, for example: + + /pattern/locale=fr_FR + + The given locale is set, pcre2_maketables() is called to build a set of + character tables for the locale, and this is then passed to pcre2_com- + pile() when compiling the regular expression. The same tables are used + when matching the following subject lines. The locale modifier applies + only to the pattern on which it appears, but can be given in a #pattern + command if a default is needed. Setting a locale and alternate charac- + ter tables are mutually exclusive. + + Showing pattern memory + + The memory modifier causes the size in bytes of the memory used to hold + the compiled pattern to be output. This does not include the size of + the pcre2_code block; it is just the actual compiled data. If the pat- + tern is subsequently passed to the JIT compiler, the size of the JIT + compiled code is also output. Here is an example: + + re> /a(b)c/jit,memory + Memory allocation (code space): 21 + Memory allocation (JIT code): 1910 + + + Limiting nested parentheses + + The parens_nest_limit modifier sets a limit on the depth of nested + parentheses in a pattern. Breaching the limit causes a compilation er- + ror. The default for the library is set when PCRE2 is built, but + pcre2test sets its own default of 220, which is required for running + the standard test suite. + + Limiting the pattern length + + The max_pattern_length modifier sets a limit, in code units, to the + length of pattern that pcre2_compile() will accept. Breaching the limit + causes a compilation error. The default is the largest number a + PCRE2_SIZE variable can hold (essentially unlimited). + + Limiting the size of a compiled pattern + + The max_pattern_compiled_length modifier sets a limit, in bytes, to the + amount of memory used by a compiled pattern. Breaching the limit causes + a compilation error. The default is the largest number a PCRE2_SIZE + variable can hold (essentially unlimited). + + Using the POSIX wrapper API + + The posix and posix_nosub modifiers cause pcre2test to call PCRE2 via + the POSIX wrapper API rather than its native API. When posix_nosub is + used, the POSIX option REG_NOSUB is passed to regcomp(). The POSIX + wrapper supports only the 8-bit library. Note that it does not imply + POSIX matching semantics; for more detail see the pcre2posix documenta- + tion. The following pattern modifiers set options for the regcomp() + function: + + caseless REG_ICASE + multiline REG_NEWLINE + dotall REG_DOTALL ) + ungreedy REG_UNGREEDY ) These options are not part of + ucp REG_UCP ) the POSIX standard + utf REG_UTF8 ) + + The regerror_buffsize modifier specifies a size for the error buffer + that is passed to regerror() in the event of a compilation error. For + example: + + /abc/posix,regerror_buffsize=20 + + This provides a means of testing the behaviour of regerror() when the + buffer is too small for the error message. If this modifier has not + been set, a large buffer is used. + + The aftertext and allaftertext subject modifiers work as described be- + low. All other modifiers are either ignored, with a warning message, or + cause an error. + + The pattern is passed to regcomp() as a zero-terminated string by de- + fault, but if the use_length or hex modifiers are set, the REG_PEND ex- + tension is used to pass it by length. + + Testing the stack guard feature + + The stackguard modifier is used to test the use of pcre2_set_com- + pile_recursion_guard(), a function that is provided to enable stack + availability to be checked during compilation (see the pcre2api docu- + mentation for details). If the number specified by the modifier is + greater than zero, pcre2_set_compile_recursion_guard() is called to set + up callback from pcre2_compile() to a local function. The argument it + receives is the current nesting parenthesis depth; if this is greater + than the value given by the modifier, non-zero is returned, causing the + compilation to be aborted. + + Using alternative character tables + + The value specified for the tables modifier must be one of the digits + 0, 1, 2, or 3. It causes a specific set of built-in character tables to + be passed to pcre2_compile(). This is used in the PCRE2 tests to check + behaviour with different character tables. The digit specifies the ta- + bles as follows: + + 0 do not pass any special character tables + 1 the default ASCII tables, as distributed in + pcre2_chartables.c.dist + 2 a set of tables defining ISO 8859 characters + 3 a set of tables loaded by the #loadtables command + + In tables 2, some characters whose codes are greater than 128 are iden- + tified as letters, digits, spaces, etc. Tables 3 can be used only after + a #loadtables command has loaded them from a binary file. Setting al- + ternate character tables and a locale are mutually exclusive. + + Setting certain match controls + + The following modifiers are really subject modifiers, and are described + under "Subject Modifiers" below. However, they may be included in a + pattern's modifier list, in which case they are applied to every sub- + ject line that is processed with that pattern. These modifiers do not + affect the compilation process. + + aftertext show text after match + allaftertext show text after captures + allcaptures show all captures + allvector show the entire ovector + allusedtext show all consulted text + altglobal alternative global matching + /g global global matching + heapframes_size show match data heapframes size + jitstack= set size of JIT stack + mark show mark values + replace= specify a replacement string + startchar show starting character when relevant + substitute_callout use substitution callouts + substitute_case_callout use substitution case callouts + substitute_extended use PCRE2_SUBSTITUTE_EXTENDED + substitute_literal use PCRE2_SUBSTITUTE_LITERAL + substitute_matched use PCRE2_SUBSTITUTE_MATCHED + substitute_overflow_length use PCRE2_SUBSTITUTE_OVERFLOW_LENGTH + substitute_replacement_only use PCRE2_SUBSTITUTE_REPLACEMENT_ONLY + substitute_skip= skip substitution + substitute_stop= skip substitution and following + substitute_unknown_unset use PCRE2_SUBSTITUTE_UNKNOWN_UNSET + substitute_unset_empty use PCRE2_SUBSTITUTE_UNSET_EMPTY + + These modifiers may not appear in a #pattern command. If you want them + as defaults, set them in a #subject command. + + Specifying literal subject lines + + If the subject_literal modifier is present on a pattern, all the sub- + ject lines that it matches are taken as literal strings, with no inter- + pretation of backslashes. It is not possible to set subject modifiers + on such lines, but any that are set as defaults by a #subject command + are recognized. + + Saving a compiled pattern + + When a pattern with the push modifier is successfully compiled, it is + pushed onto a stack of compiled patterns, and pcre2test expects the + next line to contain a new pattern (or a command) instead of a subject + line. This facility is used when saving compiled patterns to a file, as + described in the section entitled "Saving and restoring compiled pat- + terns" below. If pushcopy is used instead of push, a copy of the com- + piled pattern is stacked, leaving the original as current, ready to + match the following input lines. This provides a way of testing the + pcre2_code_copy() function. The push and pushcopy modifiers are in- + compatible with compilation modifiers such as global that act at match + time. Any that are specified are ignored (for the stacked copy), with a + warning message, except for replace, which causes an error. Note that + jitverify, which is allowed, does not carry through to any subsequent + matching that uses a stacked pattern. + + Testing foreign pattern conversion + + The experimental foreign pattern conversion functions in PCRE2 can be + tested by setting the convert modifier. Its argument is a colon-sepa- + rated list of options, which set the equivalent option for the + pcre2_pattern_convert() function: + + glob PCRE2_CONVERT_GLOB + glob_no_starstar PCRE2_CONVERT_GLOB_NO_STARSTAR + glob_no_wild_separator PCRE2_CONVERT_GLOB_NO_WILD_SEPARATOR + posix_basic PCRE2_CONVERT_POSIX_BASIC + posix_extended PCRE2_CONVERT_POSIX_EXTENDED + unset Unset all options + + The "unset" value is useful for turning off a default that has been set + by a #pattern command. When one of these options is set, the input pat- + tern is passed to pcre2_pattern_convert(). If the conversion is suc- + cessful, the result is reflected in the output and then passed to + pcre2_compile(). The normal utf and no_utf_check options, if set, cause + the PCRE2_CONVERT_UTF and PCRE2_CONVERT_NO_UTF_CHECK options to be + passed to pcre2_pattern_convert(). + + By default, the conversion function is allowed to allocate a buffer for + its output. However, if the convert_length modifier is set to a value + greater than zero, pcre2test passes a buffer of the given length. This + makes it possible to test the length check. + + The convert_glob_escape and convert_glob_separator modifiers can be + used to specify the escape and separator characters for glob process- + ing, overriding the defaults, which are operating-system dependent. + + +SUBJECT MODIFIERS + + The modifiers that can appear in subject lines and the #subject command + are of two types. + + Setting match options + + The following modifiers set options for pcre2_match() or + pcre2_dfa_match(). See pcre2api for a description of their effects. + + anchored set PCRE2_ANCHORED + copy_matched_subject set PCRE2_COPY_MATCHED_SUBJECT + endanchored set PCRE2_ENDANCHORED + dfa_restart set PCRE2_DFA_RESTART + dfa_shortest set PCRE2_DFA_SHORTEST + disable_recurseloop_check set PCRE2_DISABLE_RECURSELOOP_CHECK + no_jit set PCRE2_NO_JIT + no_utf_check set PCRE2_NO_UTF_CHECK + notbol set PCRE2_NOTBOL + notempty set PCRE2_NOTEMPTY + notempty_atstart set PCRE2_NOTEMPTY_ATSTART + noteol set PCRE2_NOTEOL + partial_hard (or ph) set PCRE2_PARTIAL_HARD + partial_soft (or ps) set PCRE2_PARTIAL_SOFT + + The partial matching modifiers are provided with abbreviations because + they appear frequently in tests. + + If the posix or posix_nosub modifier was present on the pattern, caus- + ing the POSIX wrapper API to be used, the only option-setting modifiers + that have any effect are notbol, notempty, and noteol, causing REG_NOT- + BOL, REG_NOTEMPTY, and REG_NOTEOL, respectively, to be passed to + regexec(). The other modifiers are ignored, with a warning message. + + There is one additional modifier that can be used with the POSIX wrap- + per. It is ignored (with a warning) if used for non-POSIX matching. + + posix_startend=[:] + + This causes the subject string to be passed to regexec() using the + REG_STARTEND option, which uses offsets to specify which part of the + string is searched. If only one number is given, the end offset is + passed as the end of the subject string. For more detail of REG_STAR- + TEND, see the pcre2posix documentation. If the subject string contains + binary zeros (coded as escapes such as \x{00} because pcre2test does + not support actual binary zeros in its input), you must use posix_star- + tend to specify its length. + + Setting match controls + + The following modifiers affect the matching process or request addi- + tional information. Some of them may also be specified on a pattern + line (see above), in which case they apply to every subject line that + is matched against that pattern, but can be overridden by modifiers on + the subject. + + aftertext show text after match + allaftertext show text after captures + allcaptures show all captures + allusedtext show all consulted text (non-JIT only) + allvector show the entire ovector + altglobal alternative global matching + callout_capture show captures at callout time + callout_data= set a value to pass via callouts + callout_error=[:] control callout error + callout_extra show extra callout information + callout_fail=[:] control callout failure + callout_no_where do not show position of a callout + callout_none do not supply a callout function + copy= copy captured substring + depth_limit= set a depth limit + dfa use pcre2_dfa_match() + find_limits find heap, match and depth limits + find_limits_noheap find match and depth limits + get= extract captured substring + getall extract all captured substrings + /g global global matching + heapframes_size show match data heapframes size + heap_limit= set a limit on heap memory (Kbytes) + jitstack= set size of JIT stack + mark show mark values + match_limit= set a match limit + memory show heap memory usage + null_context match with a NULL context + null_replacement substitute with NULL replacement + null_subject match with NULL subject + offset= set starting offset + offset_limit= set offset limit + ovector= set size of output vector + recursion_limit= obsolete synonym for depth_limit + replace= specify a replacement string + startchar show startchar when relevant + startoffset= same as offset= + substitute_callout use substitution callouts + substitute_case_callout use substitution case callouts + substitute_extended use PCRE2_SUBSTITUTE_EXTENDED + substitute_literal use PCRE2_SUBSTITUTE_LITERAL + substitute_matched use PCRE2_SUBSTITUTE_MATCHED + substitute_overflow_length use PCRE2_SUBSTITUTE_OVERFLOW_LENGTH + substitute_replacement_only use PCRE2_SUBSTITUTE_REPLACEMENT_ONLY + substitute_skip= skip substitution number n + substitute_stop= skip substitution number n and greater + substitute_unknown_unset use PCRE2_SUBSTITUTE_UNKNOWN_UNSET + substitute_unset_empty use PCRE2_SUBSTITUTE_UNSET_EMPTY + zero_terminate pass the subject as zero-terminated + + The effects of these modifiers are described in the following sections. + When matching via the POSIX wrapper API, the aftertext, allaftertext, + and ovector subject modifiers work as described below. All other modi- + fiers are either ignored, with a warning message, or cause an error. + + Showing more text + + The aftertext modifier requests that as well as outputting the part of + the subject string that matched the entire pattern, pcre2test should in + addition output the remainder of the subject string. This is useful for + tests where the subject contains multiple copies of the same substring. + The allaftertext modifier requests the same action for captured sub- + strings as well as the main matched substring. In each case the remain- + der is output on the following line with a plus character following the + capture number. + + The allusedtext modifier requests that all the text that was consulted + during a successful pattern match by the interpreter should be shown, + for both full and partial matches. This feature is not supported for + JIT matching, and if requested with JIT it is ignored (with a warning + message). Setting this modifier affects the output if there is a look- + behind at the start of a match, or, for a complete match, a lookahead + at the end, or if \K is used in the pattern. Characters that precede or + follow the start and end of the actual match are indicated in the out- + put by '<' or '>' characters underneath them. Here is an example: + + re> /(?<=pqr)abc(?=xyz)/ + data> 123pqrabcxyz456\=allusedtext + 0: pqrabcxyz + <<< >>> + data> 123pqrabcxy\=ph,allusedtext + Partial match: pqrabcxy + <<< + + The first, complete match shows that the matched string is "abc", with + the preceding and following strings "pqr" and "xyz" having been con- + sulted during the match (when processing the assertions). The partial + match can indicate only the preceding string. + + The startchar modifier requests that the starting character for the + match be indicated, if it is different to the start of the matched + string. The only time when this occurs is when \K has been processed as + part of the match. In this situation, the output for the matched string + is displayed from the starting character instead of from the match + point, with circumflex characters under the earlier characters. For ex- + ample: + + re> /abc\Kxyz/ + data> abcxyz\=startchar + 0: abcxyz + ^^^ + + Unlike allusedtext, the startchar modifier can be used with JIT. How- + ever, these two modifiers are mutually exclusive. + + Showing the value of all capture groups + + The allcaptures modifier requests that the values of all potential cap- + tured parentheses be output after a match. By default, only those up to + the highest one actually used in the match are output (corresponding to + the return code from pcre2_match()). Groups that did not take part in + the match are output as "". This modifier is not relevant for + DFA matching (which does no capturing) and does not apply when replace + is specified; it is ignored, with a warning message, if present. + + Showing the entire ovector, for all outcomes + + The allvector modifier requests that the entire ovector be shown, what- + ever the outcome of the match. Compare allcaptures, which shows only up + to the maximum number of capture groups for the pattern, and then only + for a successful complete non-DFA match. This modifier, which acts af- + ter any match result, and also for DFA matching, provides a means of + checking that there are no unexpected modifications to ovector fields. + Before each match attempt, the ovector is filled with a special value, + and if this is found in both elements of a capturing pair, "" is output. After a successful match, this applies to all + groups after the maximum capture group for the pattern. In other cases + it applies to the entire ovector. After a partial match, the first two + elements are the only ones that should be set. After a DFA match, the + amount of ovector that is used depends on the number of matches that + were found. + + Testing pattern callouts + + A callout function is supplied when pcre2test calls the library match- + ing functions, unless callout_none is specified. Its behaviour can be + controlled by various modifiers listed above whose names begin with + callout_. Details are given in the section entitled "Callouts" below. + Testing callouts from pcre2_substitute() is described separately in + "Testing the substitution function" below. + + Finding all matches in a string + + Searching for all possible matches within a subject can be requested by + the global or altglobal modifier. After finding a match, the matching + function is called again to search the remainder of the subject. The + difference between global and altglobal is that the former uses the + start_offset argument to pcre2_match() or pcre2_dfa_match() to start + searching at a new point within the entire string (which is what Perl + does), whereas the latter passes over a shortened subject. This makes a + difference to the matching process if the pattern begins with a lookbe- + hind assertion (including \b or \B). + + If an empty string is matched, the next match is done with the + PCRE2_NOTEMPTY_ATSTART and PCRE2_ANCHORED flags set, in order to search + for another, non-empty, match at the same point in the subject. If this + match fails, the start offset is advanced, and the normal match is re- + tried. This imitates the way Perl handles such cases when using the /g + modifier or the split() function. Normally, the start offset is ad- + vanced by one character, but if the newline convention recognizes CRLF + as a newline, and the current character is CR followed by LF, an ad- + vance of two characters occurs. + + Testing substring extraction functions + + The copy and get modifiers can be used to test the pcre2_sub- + string_copy_xxx() and pcre2_substring_get_xxx() functions. They can be + given more than once, and each can specify a capture group name or num- + ber, for example: + + abcd\=copy=1,copy=3,get=G1 + + If the #subject command is used to set default copy and/or get lists, + these can be unset by specifying a negative number to cancel all num- + bered groups and an empty name to cancel all named groups. + + The getall modifier tests pcre2_substring_list_get(), which extracts + all captured substrings. + + If the subject line is successfully matched, the substrings extracted + by the convenience functions are output with C, G, or L after the + string number instead of a colon. This is in addition to the normal + full list. The string length (that is, the return from the extraction + function) is given in parentheses after each substring, followed by the + name when the extraction was by name. + + Testing the substitution function + + If the replace modifier is set, the pcre2_substitute() function is + called instead of one of the matching functions (or after one call of + pcre2_match() in the case of PCRE2_SUBSTITUTE_MATCHED). Note that re- + placement strings cannot contain commas, because a comma signifies the + end of a modifier. This is not thought to be an issue in a test pro- + gram. + + Specifying a completely empty replacement string disables this modi- + fier. However, it is possible to specify an empty replacement by pro- + viding a buffer length, as described below, for an otherwise empty re- + placement. + + Unlike subject strings, pcre2test does not process replacement strings + for escape sequences. In UTF mode, a replacement string is checked to + see if it is a valid UTF-8 string. If so, it is correctly converted to + a UTF string of the appropriate code unit width. If it is not a valid + UTF-8 string, the individual code units are copied directly. This pro- + vides a means of passing an invalid UTF-8 string for testing purposes. + + The following modifiers set options (in additional to the normal match + options) for pcre2_substitute(): + + global PCRE2_SUBSTITUTE_GLOBAL + substitute_extended PCRE2_SUBSTITUTE_EXTENDED + substitute_literal PCRE2_SUBSTITUTE_LITERAL + substitute_matched PCRE2_SUBSTITUTE_MATCHED + substitute_overflow_length PCRE2_SUBSTITUTE_OVERFLOW_LENGTH + substitute_replacement_only PCRE2_SUBSTITUTE_REPLACEMENT_ONLY + substitute_unknown_unset PCRE2_SUBSTITUTE_UNKNOWN_UNSET + substitute_unset_empty PCRE2_SUBSTITUTE_UNSET_EMPTY + + See the pcre2api documentation for details of these options. + + After a successful substitution, the modified string is output, pre- + ceded by the number of replacements. This may be zero if there were no + matches. Here is a simple example of a substitution test: + + /abc/replace=xxx + =abc=abc= + 1: =xxx=abc= + =abc=abc=\=global + 2: =xxx=xxx= + + Subject and replacement strings should be kept relatively short (fewer + than 256 characters) for substitution tests, as fixed-size buffers are + used. To make it easy to test for buffer overflow, if the replacement + string starts with a number in square brackets, that number is passed + to pcre2_substitute() as the size of the output buffer, with the re- + placement string starting at the next character. Here is an example + that tests the edge case: + + /abc/ + 123abc123\=replace=[10]XYZ + 1: 123XYZ123 + 123abc123\=replace=[9]XYZ + Failed: error -47: no more memory + + The default action of pcre2_substitute() is to return PCRE2_ER- + ROR_NOMEMORY when the output buffer is too small. However, if the + PCRE2_SUBSTITUTE_OVERFLOW_LENGTH option is set (by using the substi- + tute_overflow_length modifier), pcre2_substitute() continues to go + through the motions of matching and substituting (but not doing any + callouts), in order to compute the size of buffer that is required. + When this happens, pcre2test shows the required buffer length (which + includes space for the trailing zero) as part of the error message. For + example: + + /abc/substitute_overflow_length + 123abc123\=replace=[9]XYZ + Failed: error -47: no more memory: 10 code units are needed + + A replacement string is ignored with POSIX and DFA matching. Specifying + partial matching provokes an error return ("bad option value") from + pcre2_substitute(). + + Testing substitute callouts + + If the substitute_callout modifier is set, a substitution callout func- + tion is set up. The null_context modifier must not be set, because the + address of the callout function is passed in a match context. When the + callout function is called (after each substitution), details of the + input and output strings are output. For example: + + /abc/g,replace=<$0>,substitute_callout + abcdefabcpqr + 1(1) Old 0 3 "abc" New 0 5 "" + 2(1) Old 6 9 "abc" New 8 13 "" + 2: defpqr + + The first number on each callout line is the count of matches. The + parenthesized number is the number of pairs that are set in the ovector + (that is, one more than the number of capturing groups that were set). + Then are listed the offsets of the old substring, its contents, and the + same for the replacement. + + By default, the substitution callout function returns zero, which ac- + cepts the replacement and causes matching to continue if /g was used. + Two further modifiers can be used to test other return values. If sub- + stitute_skip is set to a value greater than zero the callout function + returns +1 for the match of that number, and similarly substitute_stop + returns -1. These cause the replacement to be rejected, and -1 causes + no further matching to take place. If either of them are set, substi- + tute_callout is assumed. For example: + + /abc/g,replace=<$0>,substitute_skip=1 + abcdefabcpqr + 1(1) Old 0 3 "abc" New 0 5 " SKIPPED" + 2(1) Old 6 9 "abc" New 6 11 "" + 2: abcdefpqr + abcdefabcpqr\=substitute_stop=1 + 1(1) Old 0 3 "abc" New 0 5 " STOPPED" + 1: abcdefabcpqr + + If both are set for the same number, stop takes precedence. Only a sin- + gle skip or stop is supported, which is sufficient for testing that the + feature works. + + Testing substitute case callouts + + If the substitute_case_callout modifier is set, a substitution case + callout function is set up. The callout function is called for each + substituted chunk which is to be case-transformed. + + The callout function passed is a fixed function with implementation for + certain behaviours: inputs which shrink when case-transformed; inputs + which grow; inputs with distinct upper/lower/titlecase forms. The char- + acters which are not special-cased for testing purposes are left unmod- + ified, as if they are caseless characters. + + Setting the JIT stack size + + The jitstack modifier provides a way of setting the maximum stack size + that is used by the just-in-time optimization code. It is ignored if + JIT optimization is not being used. The value is a number of kibibytes + (units of 1024 bytes). Setting zero reverts to the default of 32KiB. + Providing a stack that is larger than the default is necessary only for + very complicated patterns. If jitstack is set non-zero on a subject + line it overrides any value that was set on the pattern. + + Setting heap, match, and depth limits + + The heap_limit, match_limit, and depth_limit modifiers set the appro- + priate limits in the match context. These values are ignored when the + find_limits or find_limits_noheap modifier is specified. + + Finding minimum limits + + If the find_limits modifier is present on a subject line, pcre2test + calls the relevant matching function several times, setting different + values in the match context via pcre2_set_heap_limit(), + pcre2_set_match_limit(), or pcre2_set_depth_limit() until it finds the + smallest value for each parameter that allows the match to complete + without a "limit exceeded" error. The match itself may succeed or fail. + An alternative modifier, find_limits_noheap, omits the heap limit. This + is used in the standard tests, because the minimum heap limit varies + between systems. If JIT is being used, only the match limit is rele- + vant, and the other two are automatically omitted. + + When using this modifier, the pattern should not contain any limit set- + tings such as (*LIMIT_MATCH=...) within it. If such a setting is + present and is lower than the minimum matching value, the minimum value + cannot be found because pcre2_set_match_limit() etc. are only able to + reduce the value of an in-pattern limit; they cannot increase it. + + For non-DFA matching, the minimum depth_limit number is a measure of + how much nested backtracking happens (that is, how deeply the pattern's + tree is searched). In the case of DFA matching, depth_limit controls + the depth of recursive calls of the internal function that is used for + handling pattern recursion, lookaround assertions, and atomic groups. + + For non-DFA matching, the match_limit number is a measure of the amount + of backtracking that takes place, and learning the minimum value can be + instructive. For most simple matches, the number is quite small, but + for patterns with very large numbers of matching possibilities, it can + become large very quickly with increasing length of subject string. In + the case of DFA matching, match_limit controls the total number of + calls, both recursive and non-recursive, to the internal matching func- + tion, thus controlling the overall amount of computing resource that is + used. + + For both kinds of matching, the heap_limit number, which is in + kibibytes (units of 1024 bytes), limits the amount of heap memory used + for matching. + + Showing MARK names + + + The mark modifier causes the names from backtracking control verbs that + are returned from calls to pcre2_match() to be displayed. If a mark is + returned for a match, non-match, or partial match, pcre2test shows it. + For a match, it is on a line by itself, tagged with "MK:". Otherwise, + it is added to the non-match message. + + Showing memory usage + + The memory modifier causes pcre2test to log the sizes of all heap mem- + ory allocation and freeing calls that occur during a call to + pcre2_match() or pcre2_dfa_match(). In the latter case, heap memory is + used only when a match requires more internal workspace that the de- + fault allocation on the stack, so in many cases there will be no out- + put. No heap memory is allocated during matching with JIT. For this + modifier to work, the null_context modifier must not be set on both the + pattern and the subject, though it can be set on one or the other. + + Showing the heap frame overall vector size + + The heapframes_size modifier is relevant for matches using + pcre2_match() without JIT. After a match has run (whether successful or + not) the size, in bytes, of the allocated heap frames vector that is + left attached to the match data block is shown. If the matching action + involved several calls to pcre2_match() (for example, global matching + or for timing) only the final value is shown. + + This modifier is ignored, with a warning, for POSIX or DFA matching. + JIT matching does not use the heap frames vector, so the size is always + zero, unless there was a previous non-JIT match. Note that specifing a + size of zero for the output vector (see below) causes pcre2test to free + its match data block (and associated heap frames vector) and allocate a + new one. + + Setting a starting offset + + The offset modifier sets an offset in the subject string at which + matching starts. Its value is a number of code units, not characters. + + Setting an offset limit + + The offset_limit modifier sets a limit for unanchored matches. If a + match cannot be found starting at or before this offset in the subject, + a "no match" return is given. The data value is a number of code units, + not characters. When this modifier is used, the use_offset_limit modi- + fier must have been set for the pattern; if not, an error is generated. + + Setting the size of the output vector + + The ovector modifier applies only to the subject line in which it ap- + pears, though of course it can also be used to set a default in a #sub- + ject command. It specifies the number of pairs of offsets that are + available for storing matching information. The default is 15. + + A value of zero is useful when testing the POSIX API because it causes + regexec() to be called with a NULL capture vector. When not testing the + POSIX API, a value of zero is used to cause pcre2_match_data_cre- + ate_from_pattern() to be called, in order to create a new match block + of exactly the right size for the pattern. (It is not possible to cre- + ate a match block with a zero-length ovector; there is always at least + one pair of offsets.) The old match data block is freed. + + Passing the subject as zero-terminated + + By default, the subject string is passed to a native API matching func- + tion with its correct length. In order to test the facility for passing + a zero-terminated string, the zero_terminate modifier is provided. It + causes the length to be passed as PCRE2_ZERO_TERMINATED. When matching + via the POSIX interface, this modifier is ignored, with a warning. + + When testing pcre2_substitute(), this modifier also has the effect of + passing the replacement string as zero-terminated. + + Passing a NULL context, subject, or replacement + + Normally, pcre2test passes a context block to pcre2_match(), + pcre2_dfa_match(), pcre2_jit_match() or pcre2_substitute(). If the + null_context modifier is set, however, NULL is passed. This is for + testing that the matching and substitution functions behave correctly + in this case (they use default values). This modifier cannot be used + with the find_limits, find_limits_noheap, or substitute_callout modi- + fiers. + + Similarly, for testing purposes, if the null_subject or null_replace- + ment modifier is set, the subject or replacement string pointers are + passed as NULL, respectively, to the relevant functions. + + +THE ALTERNATIVE MATCHING FUNCTION + + By default, pcre2test uses the standard PCRE2 matching function, + pcre2_match() to match each subject line. PCRE2 also supports an alter- + native matching function, pcre2_dfa_match(), which operates in a dif- + ferent way, and has some restrictions. The differences between the two + functions are described in the pcre2matching documentation. + + If the dfa modifier is set, the alternative matching function is used. + This function finds all possible matches at a given point in the sub- + ject. If, however, the dfa_shortest modifier is set, processing stops + after the first match is found. This is always the shortest possible + match. + + +DEFAULT OUTPUT FROM pcre2test + + This section describes the output when the normal matching function, + pcre2_match(), is being used. + + When a match succeeds, pcre2test outputs the list of captured sub- + strings, starting with number 0 for the string that matched the whole + pattern. Otherwise, it outputs "No match" when the return is PCRE2_ER- + ROR_NOMATCH, or "Partial match:" followed by the partially matching + substring when the return is PCRE2_ERROR_PARTIAL. (Note that this is + the entire substring that was inspected during the partial match; it + may include characters before the actual match start if a lookbehind + assertion, \K, \b, or \B was involved.) + + For any other return, pcre2test outputs the PCRE2 negative error number + and a short descriptive phrase. If the error is a failed UTF string + check, the code unit offset of the start of the failing character is + also output. Here is an example of an interactive pcre2test run. + + $ pcre2test + PCRE2 version 10.22 2016-07-29 + + re> /^abc(\d+)/ + data> abc123 + 0: abc123 + 1: 123 + data> xyz + No match + + Unset capturing substrings that are not followed by one that is set are + not shown by pcre2test unless the allcaptures modifier is specified. In + the following example, there are two capturing substrings, but when the + first data line is matched, the second, unset substring is not shown. + An "internal" unset substring is shown as "", as for the second + data line. + + re> /(a)|(b)/ + data> a + 0: a + 1: a + data> b + 0: b + 1: + 2: b + + If the strings contain any non-printing characters, they are output as + \xhh escapes if the value is less than 256 and UTF mode is not set. + Otherwise they are output as \x{hh...} escapes. See below for the defi- + nition of non-printing characters. If the aftertext modifier is set, + the output for substring 0 is followed by the rest of the subject + string, identified by "0+" like this: + + re> /cat/aftertext + data> cataract + 0: cat + 0+ aract + + If global matching is requested, the results of successive matching at- + tempts are output in sequence, like this: + + re> /\Bi(\w\w)/g + data> Mississippi + 0: iss + 1: ss + 0: iss + 1: ss + 0: ipp + 1: pp + + "No match" is output only if the first match attempt fails. Here is an + example of a failure message (the offset 4 that is specified by the + offset modifier is past the end of the subject string): + + re> /xyz/ + data> xyz\=offset=4 + Error -24 (bad offset value) + + Note that whereas patterns can be continued over several lines (a plain + ">" prompt is used for continuations), subject lines may not. However + newlines can be included in a subject by means of the \n escape (or \r, + \r\n, etc., depending on the newline sequence setting). + + +OUTPUT FROM THE ALTERNATIVE MATCHING FUNCTION + + When the alternative matching function, pcre2_dfa_match(), is used, the + output consists of a list of all the matches that start at the first + point in the subject where there is at least one match. For example: + + re> /(tang|tangerine|tan)/ + data> yellow tangerine\=dfa + 0: tangerine + 1: tang + 2: tan + + Using the normal matching function on this data finds only "tang". The + longest matching string is always given first (and numbered zero). Af- + ter a PCRE2_ERROR_PARTIAL return, the output is "Partial match:", fol- + lowed by the partially matching substring. Note that this is the entire + substring that was inspected during the partial match; it may include + characters before the actual match start if a lookbehind assertion, \b, + or \B was involved. (\K is not supported for DFA matching.) + + If global matching is requested, the search for further matches resumes + at the end of the longest match. For example: + + re> /(tang|tangerine|tan)/g + data> yellow tangerine and tangy sultana\=dfa + 0: tangerine + 1: tang + 2: tan + 0: tang + 1: tan + 0: tan + + The alternative matching function does not support substring capture, + so the modifiers that are concerned with captured substrings are not + relevant. + + +RESTARTING AFTER A PARTIAL MATCH + + When the alternative matching function has given the PCRE2_ERROR_PAR- + TIAL return, indicating that the subject partially matched the pattern, + you can restart the match with additional subject data by means of the + dfa_restart modifier. For example: + + re> /^\d?\d(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d\d$/ + data> 23ja\=ps,dfa + Partial match: 23ja + data> n05\=dfa,dfa_restart + 0: n05 + + For further information about partial matching, see the pcre2partial + documentation. + + +CALLOUTS + + If the pattern contains any callout requests, pcre2test's callout func- + tion is called during matching unless callout_none is specified. This + works with both matching functions, and with JIT, though there are some + differences in behaviour. The output for callouts with numerical argu- + ments and those with string arguments is slightly different. + + Callouts with numerical arguments + + By default, the callout function displays the callout number, the start + and current positions in the subject text at the callout time, and the + next pattern item to be tested. For example: + + --->pqrabcdef + 0 ^ ^ \d + + This output indicates that callout number 0 occurred for a match at- + tempt starting at the fourth character of the subject string, when the + pointer was at the seventh character, and when the next pattern item + was \d. Just one circumflex is output if the start and current posi- + tions are the same, or if the current position precedes the start posi- + tion, which can happen if the callout is in a lookbehind assertion. + + Callouts numbered 255 are assumed to be automatic callouts, inserted as + a result of the auto_callout pattern modifier. In this case, instead of + showing the callout number, the offset in the pattern, preceded by a + plus, is output. For example: + + re> /\d?[A-E]\*/auto_callout + data> E* + --->E* + +0 ^ \d? + +3 ^ [A-E] + +8 ^^ \* + +10 ^ ^ + 0: E* + + If a pattern contains (*MARK) items, an additional line is output when- + ever a change of latest mark is passed to the callout function. For ex- + ample: + + re> /a(*MARK:X)bc/auto_callout + data> abc + --->abc + +0 ^ a + +1 ^^ (*MARK:X) + +10 ^^ b + Latest Mark: X + +11 ^ ^ c + +12 ^ ^ + 0: abc + + The mark changes between matching "a" and "b", but stays the same for + the rest of the match, so nothing more is output. If, as a result of + backtracking, the mark reverts to being unset, the text "" is + output. + + Callouts with string arguments + + The output for a callout with a string argument is similar, except that + instead of outputting a callout number before the position indicators, + the callout string and its offset in the pattern string are output be- + fore the reflection of the subject string, and the subject string is + reflected for each callout. For example: + + re> /^ab(?C'first')cd(?C"second")ef/ + data> abcdefg + Callout (7): 'first' + --->abcdefg + ^ ^ c + Callout (20): "second" + --->abcdefg + ^ ^ e + 0: abcdef + + + Callout modifiers + + The callout function in pcre2test returns zero (carry on matching) by + default, but you can use a callout_fail modifier in a subject line to + change this and other parameters of the callout (see below). + + If the callout_capture modifier is set, the current captured groups are + output when a callout occurs. This is useful only for non-DFA matching, + as pcre2_dfa_match() does not support capturing, so no captures are + ever shown. + + The normal callout output, showing the callout number or pattern offset + (as described above) is suppressed if the callout_no_where modifier is + set. + + When using the interpretive matching function pcre2_match() without + JIT, setting the callout_extra modifier causes additional output from + pcre2test's callout function to be generated. For the first callout in + a match attempt at a new starting position in the subject, "New match + attempt" is output. If there has been a backtrack since the last call- + out (or start of matching if this is the first callout), "Backtrack" is + output, followed by "No other matching paths" if the backtrack ended + the previous match attempt. For example: + + re> /(a+)b/auto_callout,no_start_optimize,no_auto_possess + data> aac\=callout_extra + New match attempt + --->aac + +0 ^ ( + +1 ^ a+ + +3 ^ ^ ) + +4 ^ ^ b + Backtrack + --->aac + +3 ^^ ) + +4 ^^ b + Backtrack + No other matching paths + New match attempt + --->aac + +0 ^ ( + +1 ^ a+ + +3 ^^ ) + +4 ^^ b + Backtrack + No other matching paths + New match attempt + --->aac + +0 ^ ( + +1 ^ a+ + Backtrack + No other matching paths + New match attempt + --->aac + +0 ^ ( + +1 ^ a+ + No match + + Notice that various optimizations must be turned off if you want all + possible matching paths to be scanned. If no_start_optimize is not + used, there is an immediate "no match", without any callouts, because + the starting optimization fails to find "b" in the subject, which it + knows must be present for any match. If no_auto_possess is not used, + the "a+" item is turned into "a++", which reduces the number of back- + tracks. + + The callout_extra modifier has no effect if used with the DFA matching + function, or with JIT. + + Return values from callouts + + The default return from the callout function is zero, which allows + matching to continue. The callout_fail modifier can be given one or two + numbers. If there is only one number, 1 is returned instead of 0 (caus- + ing matching to backtrack) when a callout of that number is reached. If + two numbers (:) are given, 1 is returned when callout is + reached and there have been at least callouts. The callout_error + modifier is similar, except that PCRE2_ERROR_CALLOUT is returned, caus- + ing the entire matching process to be aborted. If both these modifiers + are set for the same callout number, callout_error takes precedence. + Note that callouts with string arguments are always given the number + zero. + + The callout_data modifier can be given an unsigned or a negative num- + ber. This is set as the "user data" that is passed to the matching + function, and passed back when the callout function is invoked. Any + value other than zero is used as a return from pcre2test's callout + function. + + Inserting callouts can be helpful when using pcre2test to check compli- + cated regular expressions. For further information about callouts, see + the pcre2callout documentation. + + +NON-PRINTING CHARACTERS + + When pcre2test is outputting text in the compiled version of a pattern, + bytes other than 32-126 are always treated as non-printing characters + and are therefore shown as hex escapes. + + When pcre2test is outputting text that is a matched part of a subject + string, it behaves in the same way, unless a different locale has been + set for the pattern (using the locale modifier). In this case, the is- + print() function is used to distinguish printing and non-printing char- + acters. + + +SAVING AND RESTORING COMPILED PATTERNS + + It is possible to save compiled patterns on disc or elsewhere, and re- + load them later, subject to a number of restrictions. JIT data cannot + be saved. The host on which the patterns are reloaded must be running + the same version of PCRE2, with the same code unit width, and must also + have the same endianness, pointer width and PCRE2_SIZE type. Before + compiled patterns can be saved they must be serialized, that is, con- + verted to a stream of bytes. A single byte stream may contain any num- + ber of compiled patterns, but they must all use the same character ta- + bles. A single copy of the tables is included in the byte stream (its + size is 1088 bytes). + + The functions whose names begin with pcre2_serialize_ are used for se- + rializing and de-serializing. They are described in the pcre2serialize + documentation. In this section we describe the features of pcre2test + that can be used to test these functions. + + Note that "serialization" in PCRE2 does not convert compiled patterns + to an abstract format like Java or .NET. It just makes a reloadable + byte code stream. Hence the restrictions on reloading mentioned above. + + In pcre2test, when a pattern with push modifier is successfully com- + piled, it is pushed onto a stack of compiled patterns, and pcre2test + expects the next line to contain a new pattern (or command) instead of + a subject line. By contrast, the pushcopy modifier causes a copy of the + compiled pattern to be stacked, leaving the original available for im- + mediate matching. By using push and/or pushcopy, a number of patterns + can be compiled and retained. These modifiers are incompatible with + posix, and control modifiers that act at match time are ignored (with a + message) for the stacked patterns. The jitverify modifier applies only + at compile time. + + The command + + #save + + causes all the stacked patterns to be serialized and the result written + to the named file. Afterwards, all the stacked patterns are freed. The + command + + #load + + reads the data in the file, and then arranges for it to be de-serial- + ized, with the resulting compiled patterns added to the pattern stack. + The pattern on the top of the stack can be retrieved by the #pop com- + mand, which must be followed by lines of subjects that are to be + matched with the pattern, terminated as usual by an empty line or end + of file. This command may be followed by a modifier list containing + only control modifiers that act after a pattern has been compiled. In + particular, hex, posix, posix_nosub, push, and pushcopy are not al- + lowed, nor are any option-setting modifiers. The JIT modifiers are, + however permitted. Here is an example that saves and reloads two pat- + terns. + + /abc/push + /xyz/push + #save tempfile + #load tempfile + #pop info + xyz + + #pop jit,bincode + abc + + If jitverify is used with #pop, it does not automatically imply jit, + which is different behaviour from when it is used on a pattern. + + The #popcopy command is analogous to the pushcopy modifier in that it + makes current a copy of the topmost stack pattern, leaving the original + still on the stack. + + +SEE ALSO + + pcre2(3), pcre2api(3), pcre2callout(3), pcre2jit, pcre2matching(3), + pcre2partial(d), pcre2pattern(3), pcre2serialize(3). + + +AUTHOR + + Philip Hazel + Retired from University Computing Service + Cambridge, England. + + +REVISION + + Last updated: 26 December 2024 + Copyright (c) 1997-2024 University of Cambridge. + + +PCRE2 10.46 26 December 2024 PCRE2TEST(1) diff --git a/miniconda3/share/doc/readline/CHANGES b/miniconda3/share/doc/readline/CHANGES new file mode 100644 index 0000000000000000000000000000000000000000..8c89f1e36bce609373a9094c1f64ba1b8010ea30 --- /dev/null +++ b/miniconda3/share/doc/readline/CHANGES @@ -0,0 +1,2112 @@ +This document details the changes between this version, readline-8.3, and +the previous version, readline-8.2. + +1. Changes to Readline + +a. Fixed a bug in clearing the visible line structure before redisplay. + +b. Fix a bug where setlocale(3) returning NULL caused a crash. + +c. Fixed signal checking in callback mode to handle signals that arrive before + readline restore's the application's signal handlers. + +d. Fixed a bug with word completion where the directory name needs to be + dequoted and tilde-expanded. + +e. Fixed a bug that caused compilation to fail on systems with select but not + pselect. + +f. System-specific changes for: WIN32, z/OS, Cygwin, MSYS + +g. Fixed a bug that caused word completion mismatches if the quoted text the + user typed was longer than the unquoted match. + +h. Fixes for freeing undo lists that might appear in history list entries + after non-incremental searches. + +i. Fixes for some errors revealed by address sanitizer. + +j. In vi mode, if an `f' or `F' move command associated with a `c' or `C' + command fails, don't enter insert mode. + +k. Fixed bug with truncating a history file containing timestamps that caused + the timestamp associated with the first history entry not to be written. + +l. Fix vi-mode so that a motion command attached to d/D, y/Y, or t/T must + consume or delete at least one character. + +m. Fix a redisplay error when displaying meta characters as octal sequences + and other C locale issues. + +n. Fix error that caused characters composing an incomplete multibyte + character not to be inserted into the line. + +o. In callback mode, let the application echo the signal characters (e.g., ^C) + when the application's signal handlers are installed. + +p. Added some support for lines that consume more than the physical number of + screen lines. + +q. Make sure dump-variables returns the string values for active-region-start-color + and active-region-end-color if they're set. + +r. Fixes to how characters between 128 and 159 are printed when displaying + macro values (use symbolic notation instead of directly printing the + character). + +s. Don't convert meta characters that contain NULL (\M-\C-@) to actual NULs, + which prematurely terminates the macro value. + +t. Fix typo in the readline color prefix extension that it uses for coloring + filename prefixes when displaying possible completions. + +u. Call the filename rewrite hook on the word being completed before comparing + it against possible completions from the file system to get consistent + strings. + +v. Fix infinite recursion that can happen if someone binds a key that doesn't + have a different upper and lower case represenation to do-lowercase-version. + +w. Check for non-ANSI (dumb) terminals a little more thoroughly. + +x. Don't attempt to history-expand the `quick substitution' character at the + beginning of a line if the application has set the quoting state to single + quotes. + +y. Fix small memory leak if non-incremental or incremental search is + interrupted by a signal. + +z. Loading very large history files should be much faster. + +aa. Retry opening startup files if the open is interrupted by a signal + and is not automatically restarted. + +bb. Make sure the bracketed-paste input buffer is null-terminated when read + returns an error. + +cc. Fixed a small memory leak in execute-named-command if the command doesn't + exist or the function doesn't return. + +dd. Fix for attempting to change case of invalid multibyte characters. + +ee. Fix for possible completions that compare identically when using case- + insensitive completion but have different byte lengths. + +ff. Fix to make non-incremental searches use undo lists and set the history + position the same way as incremental searches. + +gg. Don't check for signals when handling a received signal. + +hh. Fix off-by-one error when tokenizing words like $((expr)) while performing + history expansion. + +ii. Fixes for incremental searches and redisplay in the C locale. + +jj. Fixes for some use-after-free of the undo list errors when stacking multiple + commands that use rl_maybe_replace_line to save changes to a history entry. + +kk. Fixes to ensure that completion-prefix-display-length and + colored-completion-prefix are mutually exclusive. + +ll. Fixed a bug that allowed a history search to change the current history + list position. + +mm. Fixed a bug that allowed ^G to retain a saved command to execute. + +nn. Updates to new export-completions command to allow filename suffixes. + +oo. Fixed a redisplay bug with prompts containing multiple sequences of + invisible characters that are longer than the screen width. + +pp. The history library no longer skips blank lines while it is reading a + multiline history entry from a history file. + +2. New Features in Readline + +a. Output a newline if there is no prompt and readline reads an empty line. + +b. The history library falls back to stdio when writing the history list if + mmap fails. + +c. New bindable variable `search-ignore-case', causes readline to perform + case-insensitive incremental and non-incremental history searches. + +d. rl_full_quoting_desired: new application-settable variable, causes all + completions to be quoted as if they were filenames. + +e. rl_macro_display_hook: new application-settable function pointer, used if + the application wants to print macro values itself instead of letting + readline do it + +f. rl_reparse_colors: new application-callable function, reparses $LS_COLORS + (presumably after the user changes it) + +g. rl_completion_rewrite_hook: new application-settable function pointer, + called to modify the word being completed before comparing it against + pathnames from the file system. + +h. execute-named-command: a new bindable command that reads the name of a + readline command from the standard input and executes it. Bound to M-x + in emacs mode by default. + +i. Incremental and non-incremental searches now allow ^V/^Q (or, in the former + case, anything bound to quoted-insert) to quote characters in the search + string. + +j. Documentation has been significantly updated. + +k. New `force-meta-prefix' bindable variable, which forces the use of ESC as + the meta prefix when using "\M-" in key bindings instead of overloading + convert-meta. + +l. The default value for `readline-colored-completion-prefix' no longer has a + leading `.'; the original report was based on a misunderstanding. + +m. There is a new bindable command, `export-completions', which writes the + possible completions for a word to the standard output in a defined format. + +n. Readline can reset its idea of the screen dimensions when executing after + a SIGCONT. + +------------------------------------------------------------------------------- +This document details the changes between this version, readline-8.2, and +the previous version, readline-8.1. + +1. Changes to Readline + +a. Fixed a problem with cleaning up active marks when using callback mode. + +b. Fixed a problem with arithmetic comparison operators checking the version. + +c. Fixed a problem that could cause readline not to build on systems without + POSIX signal functions. + +d. Fixed a bug that could cause readline to crash if the application removed + the callback line handler before readline read all typeahead. + +e. Added additional checks for read errors in the middle of readline commands. + +f. Fixed a redisplay problem that occurred when switching from the digit- + argument prompt `(arg: N)' back to the regular prompt and the regular + prompt contained invisible characters. + +g. Fixed a problem with restoring the prompt when aborting an incremental + search. + +h. Fix a problem with characters > 128 not being displayed correctly in certain + single-byte encodings. + +i. Fixed a problem with unix-filename-rubout that caused it to delete too much + when applied to a pathname consisting only of one or more slashes. + +j. Fixed a display problem that caused the prompt to be wrapped incorrectly if + the screen changed dimensions during a call to readline() and the prompt + became longer than the screen width. + +k. Fixed a problem that caused the \r output by turning off bracketed paste + to overwrite the line if terminal echo was disabled. + +l. Fixed a bug that could cause colored-completion-prefix to not display if + completion-prefix-display-length was set. + +m. Fixed a problem with line wrapping prompts when a group of invisible + characters runs to the right edge of the screen and the prompt extends + longer then the screen width. + +n. Fixed a couple problems that could cause rl_end to be set incorrectly by + transpose-words. + +o. Prevent some display problems when running a command as the result of a + trap or one bound using `bind -x' and the command generates output. + +p. Fixed an issue with multi-line prompt strings that have one or more + invisible characters at the end of a physical line. + +q. Fixed an issue that caused a history line's undo list to be cleared when + it should not have been. + +r. When replacing a history entry, make sure the existing entry has a non-NULL + timestamp before copying it; it may have been added by the application, not + the history library. + +2. New Features in Readline + +a. There is now an HS_HISTORY_VERSION containing the version number of the + history library for applications to use. + +b. History expansion better understands multiple history expansions that may + contain strings that would ordinarily inhibit history expansion (e.g., + `abc!$!$'). + +c. There is a new framework for readline timeouts, including new public + functions to set timeouts and query how much time is remaining before a + timeout hits, and a hook function that can trigger when readline times + out. There is a new state value to indicate a timeout. + +d. Automatically bind termcap key sequences for page-up and page-down to + history-search-backward and history-search-forward, respectively. + +e. There is a new `fetch-history' bindable command that retrieves the history + entry corresponding to its numeric argument. Negative arguments count back + from the end of the history. + +f. `vi-undo' is now a bindable command. + +g. There is a new option: `enable-active-region'. This separates control of + the active region and bracketed-paste. It has the same default value as + bracketed-paste, and enabling bracketed paste enables the active region. + Users can now turn off the active region while leaving bracketed paste + enabled. + +h. rl_completer_word_break_characters is now `const char *' like + rl_basic_word_break_characters. + +i. Readline looks in $LS_COLORS for a custom filename extension + (*.readline-colored-completion-prefix) and uses that as the default color + for the common prefix displayed when `colored-completion-prefix' is set. + +j. Two new bindable string variables: active-region-start-color and + active-region-end-color. The first sets the color used to display the + active region; the second turns it off. If set, these are used in place + of terminal standout mode. + +k. New readline state (RL_STATE_EOF) and application-visible variable + (rl_eof_found) to allow applications to detect when readline reads EOF + before calling the deprep-terminal hook. + +l. There is a new configuration option: --with-shared-termcap-library, which + forces linking the shared readline library with the shared termcap (or + curses/ncurses/termlib) library so applications don't have to do it. + +m. Readline now checks for changes to locale settings (LC_ALL/LC_CTYPE/LANG) + each time it is called, and modifies the appropriate locale-specific display + and key binding variables when the locale changes. + +------------------------------------------------------------------------------- +This document details the changes between this version, readline-8.1, and +the previous version, readline-8.0. + +1. Changes to Readline + +a. There are a number of fixes that were found as the result of fuzzing with + random input. + +b. Changed the revert-all-at-newline behavior to make sure to start at the end + of the history list when doing it, instead of the line where the user hit + return. + +c. When parsing `set' commands from the inputrc file or an application, readline + now allows trailing whitespace. + +d. Fixed a bug that left a file descriptor open to the history file if the + file size was 0. + +e. Fixed a problem with binding key sequences containing meta characters. + +f. Fixed a bug that caused the wrong line to be displayed if the user tried to + move back beyond the beginning of the history list, or forward past the end + of the history list. + +g. If readline catches SIGTSTP, it now sets a hook that allows the calling + application to handle it if it desires. + +h. Fixed a redisplay problem with a prompt string containing embedded newlines. + +i. Fixed a problem with completing filenames containing invalid multibyte + sequences when case-insensitive comparisons are enabled. + +j. Fixed a redisplay problem with prompt strings containing invisible multibyte + characters. + +k. Fixed a problem with multibyte characters mapped to editing commands that + modify the search string in incremental search. + +l. Fixed a bug with maintaining the key sequence while resolving a bound + command in the presence of ambiguous sequences (sequences with a common + prefix), in most cases while attempting to unbind it. + +m. Fixed several buffer overflows found as the result of fuzzing. + +n. Reworked backslash handling when translating key sequences for key binding + to be more uniform and consistent, which introduces a slight backwards + incompatibility. + +o. Fixed a bug with saving the history that resulted in errors not being + propagated to the calling application when the history file is not writable. + +p. Readline only calls chown(2) on a newly-written history file if it really + needs to, instead of having it be a no-op. + +q. Readline now behaves better when operate-and-get-next is used when the + history list is `full': when there are already $HISTSIZE entries. + +r. Fixed a bug that could cause vi redo (`.') of a replace command not to work + correctly in the C or POSIX locale. + +s. Fixed a bug with vi-mode digit arguments that caused the last command to be + set incorrectly. This prevents yank-last-arg from working as intended, for + example. + +t. Make sure that all undo groups are closed when leaving vi insertion mode. + +u. Make sure that the vi-mode `C' and `c' commands enter insert mode even if + the motion command doesn't have any effect. + +v. Fixed several potential memory leaks in the callback mode context handling. + +w. If readline is handling a SIGTTOU, make sure SIGTTOU is blocked while + executing the terminal cleanup code, since it's no longer run in a signal + handling context. + +x. Fixed a bug that could cause an application with an application-specific + redisplay function to crash if the line data structures had not been + initialized. + +y. Terminals that are named "dumb" or unknown do not enable bracketed paste + by default. + +z. Ensure that disabling bracketed paste turns off highlighting the incremental + search string when the search is successful. + +2. New Features in Readline + +a. If a second consecutive completion attempt produces matches where the first + did not, treat it as a new completion attempt and insert a match as + appropriate. + +b. Bracketed paste mode works in more places: incremental search strings, vi + overstrike mode, character search, and reading numeric arguments. + +c. Readline automatically switches to horizontal scrolling if the terminal has + only one line. + +d. Unbinding all key sequences bound to a particular readline function now + descends into keymaps for multi-key sequences. + +e. rl-clear-display: new bindable command that clears the screen and, if + possible, the scrollback buffer (bound to emacs mode M-C-l by default). + +f. New active mark and face feature: when enabled, it will highlight the text + inserted by a bracketed paste (the `active region') and the text found by + incremental and non-incremental history searches. This is tied to bracketed + paste and can be disabled by turning off bracketed paste. + +g. Readline sets the mark in several additional commands. + +h. Bracketed paste mode is enabled by default. There is a configure-time + option (--enable-bracketed-paste-default) to set the default to on or off. + +i. Readline tries to take advantage of the more regular structure of UTF-8 + characters to identify the beginning and end of characters when moving + through the line buffer. + +j. The bindable operate-and-get-next command (and its default bindings) are + now part of readline instead of a bash-specific addition. + +k. The signal cleanup code now blocks SIGINT while processing after a SIGINT. + +------------------------------------------------------------------------------- +This document details the changes between this version, readline-8.0, and the +previous version, readline-7.0. + +1. Changes to Readline + +a. Added a guard to prevent nested macros from causing an infinite expansion + loop. + +b. Instead of allocating enough history list entries to hold the maximum list + size, cap the number allocated initially. + +c. Added a strategy to avoid allocating huge amounts of memory if a block of + history entries without timestamps occurs after a block with timestamps. + +d. Added support for keyboard timeouts when an ESC character is the last + character in a macro. + +e. There are several performance improvements when in a UTF-8 locale. + +f. Readline does a better job of preserving the original set of blocked + signals when using pselect() to wait for input. + +g. Fixed a bug that caused multibyte characters in macros to be mishandled. + +h. Fixed several bugs in the code that calculates line breaks when expanding + prompts that span several lines, contain multibyte characters, and contain + invisible character seqeuences. + +i. Fixed several bugs in cursor positioning when displaying lines with prompts + containing invisible characters and multibyte characters. + +j. When performing case-insensitive completion, Readline no longer sorts the + list of matches unless directed to do so. + +k. Fixed a problem with key sequences ending with a backslash. + +l. Fixed out-of-bounds and free memory read errors found via fuzzing. + +m. Fixed several cases where the mark was set to an invalid value. + +n. Fixed a problem with the case-changing operators in the case where the + lower and upper case versions of a character do not have the same number + of bytes. + +o. Handle incremental and non-incremental search character reads returning EOF. + +p. Handle the case where a failing readline command at the end of a multi-key + sequence could be misinterpreted. + +q. The history library now prints a meaningful error message if the history + file isn't a regular file. + +r. Fixed a problem with vi-mode redo (`.') on a command when trying to replace + a multibyte character. + +s. The key binding code now attempts to remove a keymap if a key unbinding + leaves it empty. + +t. Fixed a line-wrapping issue that caused problems for some terminal + emulators. + +u. If there is a key bound to the tty's VDISCARD special character, readline + disables VDISCARD while it is active. + +v. Fixed a problem with exiting bracketed paste mode on terminals that assume + the bracketed paste mode character sequence contains visible characters. + +w. Fixed a bug that could cause a key binding command to refer to an + uninitialized variable. + +x. Added more UTF-8-specific versions of multibyte functions, and optimized + existing functions if the current locale uses UTF-8 encoding. + +y. Fixed a problem with bracketed-paste inserting more than one character and + interacting with other readline functions. + +z. Fixed a bug that caused the history library to attempt to append a history + line to a non-existent history entry. + +aa. If using bracketed paste mode, output a newline after the \r that is the + last character of the mode disable string to avoid overwriting output. + +bb. Fixes to the vi-mode `b', `B', `w', `W', `e', and `E' commands to better + handle multibyte characters. + +cc. Fixed a redisplay problem that caused an extra newline to be generated on + accept-line when the line length is exactly the screenwidth. + +dd. Fixed a bug with adding multibyte characters to an incremental search + string. + +ee. Fixed a bug with redoing text insertions in vi mode. + +ff. Fixed a bug with pasting text into an incremental search string if bracketed + paste mode is enabled. ESC cannot be one of the incremental search + terminator characters for this to work. + +gg. Fixed a bug with anchored search patterns when performing searches in vi + mode. + +2. New Features in Readline + +a. Non-incremental vi-mode search (`N', `n') can search for a shell pattern, as + Posix specifies (uses fnmatch(3) if available). + +b. There are new `next-screen-line' and `previous-screen-line' bindable + commands, which move the cursor to the same column in the next, or previous, + physical line, respectively. + +c. There are default key bindings for control-arrow-key key combinations. + +d. A negative argument (-N) to `quoted-insert' means to insert the next N + characters using quoted-insert. + +e. New public function: rl_check_signals(), which allows applications to + respond to signals that readline catches while waiting for input using + a custom read function. + +f. There is new support for conditionally testing the readline version in an + inputrc file, with a full set of arithmetic comparison operators available. + +g. There is a simple variable comparison facility available for use within an + inputrc file. Allowable operators are equality and inequality; string + variables may be compared to a value; boolean variables must be compared to + either `on' or `off'; variable names are separated from the operator by + whitespace. + +h. The history expansion library now understands command and process + substitution and extended globbing and allows them to appear anywhere in a + word. + +i. The history library has a new variable that allows applications to set the + initial quoting state, so quoting state can be inherited from a previous + line. + +j. Readline now allows application-defined keymap names; there is a new public + function, rl_set_keymap_name(), to do that. + +k. The "Insert" keypad key, if available, now puts readline into overwrite + mode. + +------------------------------------------------------------------------------- +This document details the changes between this version, readline-7.0, and the +previous version, readline-6.3. + +1. Changes to Readline + +a. A bug that caused vi-mode `.' to be unable to redo `c', `d', and `y' + commands with modifiers was fixed. + +b. Fixed a bug that caused callback mode to dump core when reading a + multiple-key sequence (e.g., arrow keys). + +c. Fixed a bug that caused the redisplay code to erase some of the line when + using horizontal scrolling with incremental search. + +d. Readline's input handler now performs signal processing if read(2) is + interrupted by SIGALRM or SIGVTALRM. + +e. Fixed a problem with revert-all-at-newline freeing freed memory. + +f. Clarified the documentation for the history_quotes_inhibit_expansion + variable to note that it inhibits scanning for the history comment + character and that it only affects double-quoted strings. + +g. Fixed an off-by-one error in the prompt printed when performing searches. + +h. Use pselect(2), if available, to wait for input before calling read(2), so + a SIGWINCH can interrupt it, since it doesn't interrupt read(2). + +i. Some memory leaks caused by signals interrupting filename completion have + been fixed. + +j. Reading EOF twice on a non-empty line causes EOF to be returned, rather + than the partial line. This can cause partial lines to be executed on + SIGHUP, for example. + +k. Fixed a bug concerning deleting multibyte characters from the search + string while performing an incremental search. + +l. Fixed a bug with tilde expanding directory names in filename completion. + +m. Fixed a bug that did not allow binding sequences beginning with a `\'. + +n. Fixed a redisplay bug involving incorrect line wrapping when the prompt + contains a multibyte character in the last screen column. + +o. Fixed a bug that caused history expansion to disregard characters that are + documented to delimit a history event specifier without requiring `:'. + +p. Fixed a bug that could cause reading past the end of a string when reading + the value when binding the set of isearch terminators. + +q. Fixed a bug that caused readline commands that depend on knowing which + key invoked them to misbehave when dispatching key sequences that are + prefixes of other key bindings. + +r. Paren matching now works in vi insert mode. + +s. Colored completion prefixes are now displayed using a different color, less + likely to collide with files. + +t. Fixed a bug that caused vi-mode character search to misbehave when + running in callback mode. + +u. Fixed a bug that caused output to be delayed when input is coming from a + macro in vi-mode. + +v. Fixed a bug that caused the vi-mode `.' command to misbehave when redoing + a multi-key key sequence via a macro. + +w. Fixed a bug that caused problems with applications that supply their own + input function when performing completion. + +x. When read returns -1/EIO when attempting to read a key, return an error + instead of line termination back to the caller. + +y. Updated tty auditing feature based on patch from Red Hat. + +z. Fixed a bug that could cause the history library to crash on overflows + introduced by malicious editing of timestamps in the history file. + +aa. The history file writing functions only attempt to create and use a backup + history file if the history file exists and is a regular file. + +bb. Fixed an out-of-bounds read in readline's internal tilde expansion interface. + +cc. Fixed several redisplay bugs with prompt strings containing multibyte + and non-visible characters whose physical length is longer than the screen + width. + +dd. Fixed a redisplay bug with prompt strings containing invisible characters + whose physical length exceeds the screen width and using incremental search. + +ee. Readline prints more descriptive error messages when it encounters errors + while reading an inputrc file. + +ff. Fixed a bug in the character insertion code that attempts to optimize + typeahead when it reads a character that is not bound to self-insert and + resets the key sequence state. + +gg. When refreshing the line as the result of a key sequence, Readline attempts + to redraw only the last line of a multiline prompt. + +hh. Fixed an issue that caused completion of git commands to display + incorrectly when using colored-completion-prefix. + +ii. Fixed several redisplay bugs having to do with multibyte characters and + invisible characters in prompt strings. + +jj. Fixed a bug that caused mode strings to be displayed incorrectly if the + prompt was shorter than the mode string. + +2. New Features in Readline + +a. The history truncation code now uses the same error recovery mechanism as + the history writing code, and restores the old version of the history file + on error. The error recovery mechanism handles symlinked history files. + +b. There is a new bindable variable, `enable-bracketed-paste', which enables + support for a terminal's bracketed paste mode. + +c. The editing mode indicators can now be strings and are user-settable + (new `emacs-mode-string', `vi-cmd-mode-string' and `vi-ins-mode-string' + variables). Mode strings can contain invisible character sequences. + Setting mode strings to null strings restores the defaults. + +d. Prompt expansion adds the mode string to the last line of a multi-line + prompt (one with embedded newlines). + +e. There is a new bindable variable, `colored-completion-prefix', which, if + set, causes the common prefix of a set of possible completions to be + displayed in color. + +f. There is a new bindable command `vi-yank-pop', a vi-mode version of emacs- + mode yank-pop. + +g. The redisplay code underwent several efficiency improvements for multibyte + locales. + +h. The insert-char function attempts to batch-insert all pending typeahead + that maps to self-insert, as long as it is coming from the terminal. + +i. rl_callback_sigcleanup: a new application function that can clean up and + unset any state set by readline's callback mode. Intended to be used + after a signal. + +j. If an incremental search string has its last character removed with DEL, the + resulting empty search string no longer matches the previous line. + +k. If readline reads a history file that begins with `#' (or the value of + the history comment character) and has enabled history timestamps, the history + entries are assumed to be delimited by timestamps. This allows multi-line + history entries. + +l. Readline now throws an error if it parses a key binding without a terminating + `:' or whitespace. + +m. The default binding for ^W in vi mode now uses word boundaries specified + by Posix (vi-unix-word-rubout is bindable command name). + +n. rl_clear_visible_line: new application-callable function; clears all + screen lines occupied by the current visible readline line. + +o. rl_tty_set_echoing: application-callable function that controls whether + or not readline thinks it is echoing terminal output. + +p. Handle >| and strings of digits preceding and following redirection + specifications as single tokens when tokenizing the line for history + expansion. + +q. Fixed a bug with displaying completions when the prefix display length + is greater than the length of the completions to be displayed. + +r. The :p history modifier now applies to the entire line, so any expansion + specifying :p causes the line to be printed instead of expanded. + +s. New application-callable function: rl_pending_signal(): returns the signal + number of any signal readline has caught but not yet handled. + +t. New application-settable variable: rl_persistent_signal_handlers: if set + to a non-zero value, readline will enable the readline-6.2 signal handler + behavior in callback mode: handlers are installed when + rl_callback_handler_install is called and removed removed when a complete + line has been read. + +------------------------------------------------------------------------------- +This document details the changes between this version, readline-6.3, and the +previous version, readline-6.2. + +1. Changes to Readline + +a. Fixed a bug that did not allow the `dd', `cc', or `yy' vi editing mode + commands to work on the entire line. + +b. Fixed a bug that caused redisplay problems with prompts longer than 128 + characters and history searches. + +c. Fixed a bug that caused readline to try and run code to modify its idea + of the screen size in a signal handler context upon receiving a SIGWINCH. + +d. Fixed a bug that caused the `meta' key to be enabled beyond the duration + of an individual call top readline(). + +e. Added a workaround for a wcwidth bug in Mac OS X that caused readline's + redisplay to mishandle zero-width combining characters. + +f. Fixed a bug that caused readline to `forget' part of a key sequence when + a multiple-key sequence caused it to break out of an incremental search. + +g. Fixed bugs that caused readline to execute code in a signal handler + context if interrupted while reading from the file system during completion. + +h. Fixed a bug that caused readline to `forget' part of a key sequence when + reading an unbound multi-character key sequence. + +i. Fixed a bug that caused Readline's signal handlers to be installed beyond + the bounds of a single call to readline(). + +j. Fixed a bug that caused the `.' command to not redo the most recent `R' + command in vi mode. + +k. Fixed a bug that caused ignoring case in completion matches to result in + readline using the wrong match. + +l. Paren matching now works in vi insert mode. + +m. Fix menu-completion to make show-all-if-ambiguous and menu-complete-display-prefix + work together. + +n. Fixed a bug that didn't allow the `cc', `dd', or `yy' commands to be redone + in vi editing mode. + +o. Fixed a bug that caused the filename comparison code to not compare + multibyte characters correctly when using case-sensitive or case-mapping + comparisons. + +p. Fixed the input reading loop to call the input hook function only when there + is no terminal input available. + +q. Fixed a bug that caused binding a macro to a multi-character key sequence + where the sequence and macro value share a common prefix to not perform + the macro replacement. + +r. Fixed several redisplay errors with multibyte characters and prompts + containing invisible characters when using horizontal scrolling. + +s. Fixed a bug that caused redisplay errors when trying to overwrite + existing characters using multibyte characters. + +t. Fixed a bug in vi mode that caused the arrow keys to set the saved last + vi-mode command to the wrong value. + +u. Fixed a bug that caused double-quoted strings to be scanned incorrectly + when being used as the value of a readline variable assignment. + +v. Fixed a bug with vi mode that prevented `.' from repeating a command + entered on a previous line (command). + +w. Fixed a bug that could cause completion to core dump if it was interrupted + by a signal. + +x. Fixed a bug that could cause readline to crash and seg fault attempting to + expand an empty history entry. + +y. Fixed a bug that caused display problems with multi-line prompts containing + invisible characters on multiple lines. + +z. Fixed a bug that caused effects made by undoing changes to a history line to + be discarded. + +2. New Features in Readline + +a. Readline is now more responsive to SIGHUP and other fatal signals when + reading input from the terminal or performing word completion but no + longer attempts to run any not-allowable functions from a signal handler + context. + +b. There are new bindable commands to search the history for the string of + characters between the beginning of the line and the point + (history-substring-search-forward, history-substring-search-backward) + +c. Readline allows quoted strings as the values of variables when setting + them with `set'. As a side effect, trailing spaces and tabs are ignored + when setting a string variable's value. + +d. The history library creates a backup of the history file when writing it + and restores the backup on a write error. + +e. New application-settable variable: rl_filename_stat_hook: a function called + with a filename before using it in a call to stat(2). Bash uses it to + expand shell variables so things like $HOME/Downloads have a slash + appended. + +f. New bindable function `print-last-kbd-macro', prints the most-recently- + defined keyboard macro in a reusable format. + +g. New user-settable variable `colored-stats', enables use of colored text + to denote file types when displaying possible completions (colored analog + of visible-stats). + +h. New user-settable variable `keyseq-timout', acts as an inter-character + timeout when reading input or incremental search strings. + +i. New application-callable function: rl_clear_history. Clears the history list + and frees all readline-associated private data. + +j. New user-settable variable, show-mode-in-prompt, adds a characters to the + beginning of the prompt indicating the current editing mode. + +k. New application-settable variable: rl_input_available_hook; function to be + called when readline needs to check whether there is data available on its + input source. The default hook checks rl_instream. + +l. Readline calls an application-set event hook (rl_signal_event_hook) after + it gets a signal while reading input (read returns -1/EINTR but readline + does not handle the signal immediately) to allow the application to handle + or otherwise note it. Not currently called for SIGHUP or SIGTERM. + +m. If the user-settable variable `history-size' is set to a value less than + 0, the history list size is unlimited. + +n. When creating shared libraries on Mac OS X, the pathname written into the + library (install_name) no longer includes the minor version number. + +------------------------------------------------------------------------------- +This document details the changes between this version, readline-6.2, +and the previous version, readline-6.1. + +1. Changes to Readline + +a. Fixed a bug that caused the unconverted filename to be added to the list of + completions when the application specified filename conversion functions. + +b. Fixed a bug that caused the wrong filename to be passed to opendir when the + application has specified a filename dequoting function. + +c. Fixed a bug when repeating a character search in vi mode in the case where + there was no search to repeat. + +d. When show-all-if-ambiguous is set, the completion routines no longer insert + a common match prefix that is shorter than the text being completed. + +e. The full set of vi editing commands may now be used in callback mode. + +f. Fixed a bug that caused readline to not update its idea of the terminal + dimensions while running in `no-echo' mode. + +h. Fixed a bug that caused readline to dump core if an application called + rl_prep_terminal without setting rl_instream. + +i. Fixed a bug that caused meta-prefixed characters bound to incremental + search forward or backward to not be recognized if they were typed + subsequently. + +j. The incremental search code treats key sequences that map to the same + functions as (default) ^G, ^W, and ^Y as equivalent to those characters. + +k. Fixed a bug in menu-complete that caused it to misbehave with large + negative argument. + +l. Fixed a bug that caused vi-mode yank-last-arg to ring the bell when invoked + at the end of the line. + +m. Fixed a bug that made an explicit argument of 0 to yank-last-arg behave + as if it were a negative argument. + +n. Fixed a bug that caused directory names in words to be completed to not + be dequoted correctly. + +2. New Features in Readline + +a. The history library does not try to write the history filename in the + current directory if $HOME is unset. This closes a potential security + problem if the application does not specify a history filename. + +b. New bindable variable `completion-display-width' to set the number of + columns used when displaying completions. + +c. New bindable variable `completion-case-map' to cause case-insensitive + completion to treat `-' and `_' as identical. + +d. There are new bindable vi-mode command names to avoid readline's case- + insensitive matching not allowing them to be bound separately. + +e. New bindable variable `menu-complete-display-prefix' causes the menu + completion code to display the common prefix of the possible completions + before cycling through the list, instead of after. + +------------------------------------------------------------------------------- +This document details the changes between this version, readline-6.1, +and the previous version, readline-6.0. + +1. Changes to Readline + +a. The SIGWINCH signal handler now avoids calling the redisplay code if + one arrives while in the middle of redisplay. + +b. Changes to the timeout code to make sure that timeout values greater + than one second are handled better. + +c. Fixed a bug in the redisplay code that was triggered by a prompt + containing invisible characters exactly the width of the screen. + +d. Fixed a bug in the redisplay code encountered when running in horizontal + scroll mode. + +e. Fixed a bug that prevented menu completion from properly completing + filenames. + +f. Fixed a redisplay bug caused by a multibyte character causing a line to + wrap. + +g. Fixed a bug that caused key sequences of two characters to not be + recognized when a longer sequence identical in the first two characters + was bound. + +h. Fixed a bug that caused history expansion to be attempted on $'...' + single-quoted strings. + +i. Fixed a bug that caused incorrect redisplay when the prompt contained + multibyte characters in an `invisible' sequence bracketed by \[ and + \]. + +j. Fixed a bug that caused history expansion to short-circuit after + encountering a multibyte character. + +k. Fixed a bug that caused applications using the callback interface to not + react to SIGINT (or other signals) until another character arrived. + +2. New Features in Readline + +a. New bindable function: menu-complete-backward. + +b. In the vi insertion keymap, C-n is now bound to menu-complete by default, + and C-p to menu-complete-backward. + +c. When in vi command mode, repeatedly hitting ESC now does nothing, even + when ESC introduces a bound key sequence. This is closer to how + historical vi behaves. + +d. New bindable function: skip-csi-sequence. Can be used as a default to + consume key sequences generated by keys like Home and End without having + to bind all keys. + +e. New application-settable function: rl_filename_rewrite_hook. Can be used + to rewrite or modify filenames read from the file system before they are + compared to the word to be completed. + +f. New bindable variable: skip-completed-text, active when completing in the + middle of a word. If enabled, it means that characters in the completion + that match characters in the remainder of the word are "skipped" rather + than inserted into the line. + +g. The pre-readline-6.0 version of menu completion is available as + "old-menu-complete" for users who do not like the readline-6.0 version. + +h. New bindable variable: echo-control-characters. If enabled, and the + tty ECHOCTL bit is set, controls the echoing of characters corresponding + to keyboard-generated signals. + +i. New bindable variable: enable-meta-key. Controls whether or not readline + sends the smm/rmm sequences if the terminal indicates it has a meta key + that enables eight-bit characters. + +------------------------------------------------------------------------------- +This document details the changes between this version, readline-6.0, +and the previous version, readline-5.2. + +1. Changes to Readline + +a. Fixed a number of redisplay errors in environments supporting multibyte + characters. + +b. Fixed bugs in vi command mode that caused motion commands to inappropriately + set the mark. + +c. When using the arrow keys in vi insertion mode, readline allows movement + beyond the current end of the line (unlike command mode). + +d. Fixed bugs that caused readline to loop when the terminal has been taken + away and reads return -1/EIO. + +e. Fixed bugs in redisplay occurring when displaying prompts containing + invisible characters. + +f. Fixed a bug that caused the completion append character to not be reset to + the default after an application-specified completion function changed it. + +g. Fixed a problem that caused incorrect positioning of the cursor while in + emacs editing mode when moving forward at the end of a line while using + a locale supporting multibyte characters. + +h. Fixed an off-by-one error that caused readline to drop every 511th + character of buffered input. + +i. Fixed a bug that resulted in SIGTERM not being caught or cleaned up. + +j. Fixed redisplay bugs caused by multiline prompts with invisible characters + or no characters following the final newline. + +k. Fixed redisplay bug caused by prompts consisting solely of invisible + characters. + +l. Fixed a bug in the code that buffers characters received very quickly in + succession which caused characters to be dropped. + +m. Fixed a bug that caused readline to reference uninitialized data structures + if it received a SIGWINCH before completing initialization. + +n. Fixed a bug that caused the vi-mode `last command' to be set incorrectly + and therefore unrepeatable. + +o. Fixed a bug that caused readline to disable echoing when it was being used + with an output file descriptor that was not a terminal. + +p. Readline now blocks SIGINT while manipulating internal data structures + during redisplay. + +q. Fixed a bug in redisplay that caused readline to segfault when pasting a + very long line (over 130,000 characters). + +r. Fixed bugs in redisplay when using prompts with no visible printing + characters. + +s. Fixed a bug that caused redisplay errors when using prompts with invisible + characters and numeric arguments to a command in a multibyte locale. + +t. Fixed a bug that caused redisplay errors when using prompts with invisible + characters spanning more than two physical screen lines. + +2. New Features in Readline + +a. A new variable, rl_sort_completion_matches; allows applications to inhibit + match list sorting (but beware: some things don't work right if + applications do this). + +b. A new variable, rl_completion_invoking_key; allows applications to discover + the key that invoked rl_complete or rl_menu_complete. + +c. The functions rl_block_sigint and rl_release_sigint are now public and + available to calling applications who want to protect critical sections + (like redisplay). + +d. The functions rl_save_state and rl_restore_state are now public and + available to calling applications; documented rest of readline's state + flag values. + +e. A new user-settable variable, `history-size', allows setting the maximum + number of entries in the history list. + +f. There is a new implementation of menu completion, with several improvements + over the old; the most notable improvement is a better `completions + browsing' mode. + +g. The menu completion code now uses the rl_menu_completion_entry_function + variable, allowing applications to provide their own menu completion + generators. + +h. There is support for replacing a prefix of a pathname with a `...' when + displaying possible completions. This is controllable by setting the + `completion-prefix-display-length' variable. Matches with a common prefix + longer than this value have the common prefix replaced with `...'. + +i. There is a new `revert-all-at-newline' variable. If enabled, readline will + undo all outstanding changes to all history lines when `accept-line' is + executed. + +------------------------------------------------------------------------------- +This document details the changes between this version, readline-5.2, +and the previous version, readline-5.1. + +1. Changes to Readline + +a. Fixed a problem that caused segmentation faults when using readline in + callback mode and typing consecutive DEL characters on an empty line. + +b. Fixed several redisplay problems with multibyte characters, all having to + do with the different code paths and variable meanings between single-byte + and multibyte character redisplay. + +c. Fixed a problem with key sequence translation when presented with the + sequence \M-\C-x. + +d. Fixed a problem that prevented the `a' command in vi mode from being + undone and redone properly. + +e. Fixed a problem that prevented empty inserts in vi mode from being undone + properly. + +f. Fixed a problem that caused readline to initialize with an incorrect idea + of whether or not the terminal can autowrap. + +g. Fixed output of key bindings (like bash `bind -p') to honor the setting of + convert-meta and use \e where appropriate. + +h. Changed the default filename completion function to call the filename + dequoting function if the directory completion hook isn't set. This means + that any directory completion hooks need to dequote the directory name, + since application-specific hooks need to know how the word was quoted, + even if no other changes are made. + +i. Fixed a bug with creating the prompt for a non-interactive search string + when there are non-printing characters in the primary prompt. + +j. Fixed a bug that caused prompts with invisible characters to be redrawn + multiple times in a multibyte locale. + +k. Fixed a bug that could cause the key sequence scanning code to return the + wrong function. + +l. Fixed a problem with the callback interface that caused it to fail when + using multi-character keyboard macros. + +m. Fixed a bug that could cause a core dump when an edited history entry was + re-executed under certain conditions. + +n. Fixed a bug that caused readline to reference freed memory when attmpting + to display a portion of the prompt. + +o. Fixed a bug with prompt redisplay in a multi-byte locale to avoid redrawing + the prompt and input line multiple times. + +p. Fixed history expansion to not be confused by here-string redirection. + +q. Readline no longer treats read errors by converting them to newlines, as + it does with EOF. This caused partial lines to be returned from readline(). + +r. Fixed a redisplay bug that occurred in multibyte-capable locales when the + prompt was one character longer than the screen width. + +2. New Features in Readline + +a. Calling applications can now set the keyboard timeout to 0, allowing + poll-like behavior. + +b. The value of SYS_INPUTRC (configurable at compilation time) is now used as + the default last-ditch startup file. + +c. The history file reading functions now allow windows-like \r\n line + terminators. + +------------------------------------------------------------------------------- +This document details the changes between this version, readline-5.1, +and the previous version, readline-5.0. + +1. Changes to Readline + +a. Fixed a bug that caused multiliine prompts to be wrapped and displayed + incorrectly. + +b. Fixed a bug that caused ^P/^N in emacs mode to fail to display the current + line correctly. + +c. Fixed a problem in computing the number of invisible characters on the first + line of a prompt whose length exceeds the screen width. + +d. Fixed vi-mode searching so that failure preserves the current line rather + than the last line in the history list. + +e. Fixed the vi-mode `~' command (change-case) to have the correct behavior at + end-of-line when manipulating multibyte characters. + +f. Fixed the vi-mode `r' command (change-char) to have the correct behavior at + end-of-line when manipulating multibyte characters. + +g. Fixed multiple bugs in the redisplay of multibyte characters: displaying + prompts longer than the screen width containing multibyte characters, + +h. Fix the calculation of the number of physical characters in the prompt + string when it contains multibyte characters. + +i. A non-zero value for the `rl_complete_suppress_append' variable now causes + no `/' to be appended to a directory name. + +j. Fixed forward-word and backward-word to work when words contained + multibyte characters. + +k. Fixed a bug in finding the delimiter of a `?' substring when performing + history expansion in a locale that supports multibyte characters. + +l. Fixed a memory leak caused by not freeing the timestamp in a history entry. + +m. Fixed a bug that caused "\M-x" style key bindings to not obey the setting + of the `convert-meta' variable. + +n. Fixed saving and restoring primary prompt when prompting for incremental + and non-incremental searches; search prompts now display multibyte + characters correctly. + +o. Fixed a bug that caused keys originally bound to self-insert but shadowed + by a multi-character key sequence to not be inserted. + +p. Fixed code so rl_prep_term_function and rl_deprep_term_function aren't + dereferenced if NULL (matching the documentation). + +q. Extensive changes to readline to add enough state so that commands + requiring additional characters (searches, multi-key sequences, numeric + arguments, commands requiring an additional specifier character like + vi-mode change-char, etc.) work without synchronously waiting for + additional input. + +r. Lots of changes so readline builds and runs on MinGW. + +s. Readline no longer tries to modify the terminal settings when running in + callback mode. + +t. The Readline display code no longer sets the location of the last invisible + character in the prompt if the \[\] sequence is empty. + +u. The `change-case' command now correctly changes the case of multibyte + characters. + +v. Changes to the shared library construction scripts to deal with Windows + DLL naming conventions for Cygwin. + +w. Fixed the redisplay code to avoid core dumps resulting from a poorly-timed + SIGWINCH. + +x. Fixed the non-incremental search code in vi mode to dispose of any current + undo list when copying a line from the history into the current editing + buffer. + +y. Fixed a bug that caused reversing the incremental search direction to + not work correctly. + +z. Fixed the vi-mode `U' command to only undo up to the first time insert mode + was entered, as Posix specifies. + +aa. Fixed a bug in the vi-mode `r' command that left the cursor in the wrong + place. + +bb. Fixed a redisplay bug caused by moving the cursor vertically to a line + with invisible characters in the prompt in a multibyte locale. + +cc. Fixed a bug that could cause the terminal special chars to be bound in the + wrong keymap in vi mode. + +2. New Features in Readline + +a. The key sequence sent by the keypad `delete' key is now automatically + bound to delete-char. + +b. A negative argument to menu-complete now cycles backward through the + completion list. + +c. A new bindable readline variable: bind-tty-special-chars. If non-zero, + readline will bind the terminal special characters to their readline + equivalents when it's called (on by default). + +d. New bindable command: vi-rubout. Saves deleted text for possible + reinsertion, as with any vi-mode `text modification' command; `X' is bound + to this in vi command mode. + +e. If the rl_completion_query_items is set to a value < 0, readline never + asks the user whether or not to view the possible completions. + +f. The `C-w' binding in incremental search now understands multibyte + characters. + +g. New application-callable auxiliary function, rl_variable_value, returns + a string corresponding to a readline variable's value. + +h. When parsing inputrc files and variable binding commands, the parser + strips trailing whitespace from values assigned to boolean variables + before checking them. + +i. A new external application-controllable variable that allows the LINES + and COLUMNS environment variables to set the window size regardless of + what the kernel returns. + +------------------------------------------------------------------------------- +This document details the changes between this version, readline-5.0, +and the previous version, readline-4.3. + +1. Changes to Readline + +a. Fixes to avoid core dumps because of null pointer references in the + multibyte character code. + +b. Fix to avoid infinite recursion caused by certain key combinations. + +c. Fixed a bug that caused the vi-mode `last command' to be set incorrectly. + +d. Readline no longer tries to read ahead more than one line of input, even + when more is available. + +e. Fixed the code that adjusts the point to not mishandle null wide + characters. + +f. Fixed a bug in the history expansion `g' modifier that caused it to skip + every other match. + +g. Fixed a bug that caused the prompt to overwrite previous output when the + output doesn't contain a newline and the locale supports multibyte + characters. This same change fixes the problem of readline redisplay + slowing down dramatically as the line gets longer in multibyte locales. + +h. History traversal with arrow keys in vi insertion mode causes the cursor + to be placed at the end of the new line, like in emacs mode. + +i. The locale initialization code does a better job of using the right + precedence and defaulting when checking the appropriate environment + variables. + +j. Fixed the history word tokenizer to handle <( and >( better when used as + part of bash. + +k. The overwrite mode code received several bug fixes to improve undo. + +l. Many speedups to the multibyte character redisplay code. + +m. The callback character reading interface should not hang waiting to read + keyboard input. + +n. Fixed a bug with redoing vi-mode `s' command. + +o. The code that initializes the terminal tracks changes made to the terminal + special characters with stty(1) (or equivalent), so that these changes + are reflected in the readline bindings. New application-callable function + to make it work: rl_tty_unset_default_bindings(). + +p. Fixed a bug that could cause garbage to be inserted in the buffer when + changing character case in vi mode when using a multibyte locale. + +q. Fixed a bug in the redisplay code that caused problems on systems + supporting multibyte characters when moving between history lines when the + new line has more glyphs but fewer bytes. + +r. Undo and redo now work better after exiting vi insertion mode. + +s. Make sure system calls are restarted after a SIGWINCH is received using + SA_RESTART. + +t. Improvements to the code that displays possible completions when using + multibyte characters. + +u. Fixed a problem when parsing nested if statements in inputrc files. + +v. The completer now takes multibyte characters into account when looking for + quoted substrings on which to perform completion. + +w. The history search functions now perform better bounds checking on the + history list. + +x. Change to history expansion functions to treat `^' as equivalent to word + one, as the documentation states. + +y. Some changes to the display code to improve display and redisplay of + multibyte characters. + +z. Changes to speed up the multibyte character redisplay code. + +aa. Fixed a bug in the vi-mode `E' command that caused it to skip over the + last character of a word if invoked while point was on the word's + next-to-last character. + +bb. Fixed a bug that could cause incorrect filename quoting when + case-insensitive completion was enabled and the word being completed + contained backslashes quoting word break characters. + +cc. Fixed a bug in redisplay triggered when the prompt string contains + invisible characters. + +dd. Fixed some display (and other) bugs encountered in multibyte locales + when a non-ascii character was the last character on a line. + +ee. Fixed some display bugs caused by multibyte characters in prompt strings. + +ff. Fixed a problem with history expansion caused by non-whitespace characters + used as history word delimiters. + +gg. Fixed a problem that could cause readline to refer to freed memory when + moving between history lines while doing searches. + +hh. Improvements to the code that expands and displays prompt strings + containing multibyte characters. + +ii. Fixed a problem with vi-mode not correctly remembering the numeric argument + to the last `c'hange command for later use with `.'. + +jj. Fixed a bug in vi-mode that caused multi-digit count arguments to work + incorrectly. + +kk. Fixed a problem in vi-mode that caused the last text modification command + to not be remembered across different command lines. + +ll. Fixed problems with changing characters and changing case at the end of + the line. + +mm. Fixed a problem with readline saving the contents of the current line + before beginning a non-interactive search. + +nn. Fixed a problem with EOF detection when using rl_event_hook. + +oo. Fixed a problem with the vi mode `p' and `P' commands ignoring numeric + arguments. + +2. New Features in Readline + +a. History expansion has a new `a' modifier equivalent to the `g' modifier + for compatibility with the BSD csh. + +b. History expansion has a new `G' modifier equivalent to the BSD csh `g' + modifier, which performs a substitution once per word. + +c. All non-incremental search operations may now undo the operation of + replacing the current line with the history line. + +d. The text inserted by an `a' command in vi mode can be reinserted with + `.'. + +e. New bindable variable, `show-all-if-unmodified'. If set, the readline + completer will list possible completions immediately if there is more + than one completion and partial completion cannot be performed. + +f. There is a new application-callable `free_history_entry()' function. + +g. History list entries now contain timestamp information; the history file + functions know how to read and write timestamp information associated + with each entry. + +h. Four new key binding functions have been added: + + rl_bind_key_if_unbound() + rl_bind_key_if_unbound_in_map() + rl_bind_keyseq_if_unbound() + rl_bind_keyseq_if_unbound_in_map() + +i. New application variable, rl_completion_quote_character, set to any + quote character readline finds before it calls the application completion + function. + +j. New application variable, rl_completion_suppress_quote, settable by an + application completion function. If set to non-zero, readline does not + attempt to append a closing quote to a completed word. + +k. New application variable, rl_completion_found_quote, set to a non-zero + value if readline determines that the word to be completed is quoted. + Set before readline calls any application completion function. + +l. New function hook, rl_completion_word_break_hook, called when readline + needs to break a line into words when completion is attempted. Allows + the word break characters to vary based on position in the line. + +m. New bindable command: unix-filename-rubout. Does the same thing as + unix-word-rubout, but adds `/' to the set of word delimiters. + +n. When listing completions, directories have a `/' appended if the + `mark-directories' option has been enabled. + +------------------------------------------------------------------------------- +This document details the changes between this version, readline-4.3, +and the previous version, readline-4.2a. + +1. Changes to Readline + +a. Fixed output of comment-begin character when listing variable values. + +b. Added some default key bindings for common escape sequences produced by + HOME and END keys. + +c. Fixed the mark handling code to be more emacs-compatible. + +d. A bug was fixed in the code that prints possible completions to keep it + from printing empty strings in certain circumstances. + +e. Change the key sequence printing code to print ESC as M\- if ESC is a + meta-prefix character -- it's easier for users to understand than \e. + +f. Fixed unstifle_history() to return values that match the documentation. + +g. Fixed the event loop (rl_event_hook) to handle the case where the input + file descriptor is invalidated. + +h. Fixed the prompt display code to work better when the application has a + custom redisplay function. + +i. Changes to make reading and writing the history file a little faster, and + to cope with huge history files without calling abort(3) from xmalloc. + +j. The vi-mode `S' and `s' commands are now undone correctly. + +k. Fixed a problem which caused the display to be messed up when the last + line of a multi-line prompt (possibly containing invisible characters) + was longer than the screen width. + +2. New Features in Readline + +a. Support for key `subsequences': allows, e.g., ESC and ESC-a to both + be bound to readline functions. Now the arrow keys may be used in vi + insert mode. + +b. When listing completions, and the number of lines displayed is more than + the screen length, readline uses an internal pager to display the results. + This is controlled by the `page-completions' variable (default on). + +c. New code to handle editing and displaying multibyte characters. + +d. The behavior introduced in bash-2.05a of deciding whether or not to + append a slash to a completed name that is a symlink to a directory has + been made optional, controlled by the `mark-symlinked-directories' + variable (default is the 2.05a behavior). + +e. The `insert-comment' command now acts as a toggle if given a numeric + argument: if the first characters on the line don't specify a + comment, insert one; if they do, delete the comment text + +f. New application-settable completion variable: + rl_completion_mark_symlink_dirs, allows an application's completion + function to temporarily override the user's preference for appending + slashes to names which are symlinks to directories. + +g. New function available to application completion functions: + rl_completion_mode, to tell how the completion function was invoked + and decide which argument to supply to rl_complete_internal (to list + completions, etc.). + +h. Readline now has an overwrite mode, toggled by the `overwrite-mode' + bindable command, which could be bound to `Insert'. + +i. New application-settable completion variable: + rl_completion_suppress_append, inhibits appending of + rl_completion_append_character to completed words. + +j. New key bindings when reading an incremental search string: ^W yanks + the currently-matched word out of the current line into the search + string; ^Y yanks the rest of the current line into the search string, + DEL or ^H deletes characters from the search string. + +------------------------------------------------------------------------------- +This document details the changes between this version, readline-4.2a, +and the previous version, readline-4.2. + +1. Changes to Readline + +a. More `const' and type casting fixes. + +b. Changed rl_message() to use vsnprintf(3) (if available) to fix buffer + overflow problems. + +c. The completion code no longer appends a `/' or ` ' to a match when + completing a symbolic link that resolves to a directory name, unless + the match does not add anything to the word being completed. This + means that a tab will complete the word up to the full name, but not + add anything, and a subsequent tab will add a slash. + +d. Fixed a trivial typo that made the vi-mode `dT' command not work. + +e. Fixed the tty code so that ^S and ^Q can be inserted with rl_quoted_insert. + +f. Fixed the tty code so that ^V works more than once. + +g. Changed the use of __P((...)) for function prototypes to PARAMS((...)) + because the use of __P in typedefs conflicted g++ and glibc. + +h. The completion code now attempts to do a better job of preserving the + case of the word the user typed if ignoring case in completions. + +i. Readline defaults to not echoing the input and lets the terminal + initialization code enable echoing if there is a controlling terminal. + +j. The key binding code now processes only two hex digits after a `\x' + escape sequence, and the documentation was changed to note that the + octal and hex escape sequences result in an eight-bit value rather + than strict ASCII. + +k. Fixed a few places where negative array subscripts could have occurred. + +l. Fixed the vi-mode code to use a better method to determine the bounds of + the array used to hold the marks, and to avoid out-of-bounds references. + +m. Fixed the defines in chardefs.h to work better when chars are signed. + +n. Fixed configure.in to use the new names for bash autoconf macros. + +o. Readline no longer attempts to define its own versions of some ctype + macros if they are implemented as functions in libc but not as macros in + . + +p. Fixed a problem where rl_backward could possibly set point to before + the beginning of the line. + +q. Fixed Makefile to not put -I/usr/include into CFLAGS, since it can cause + include file problems. + +2. New Features in Readline + +a. Added extern declaration for rl_get_termcap to readline.h, making it a + public function (it was always there, just not in readline.h). + +b. New #defines in readline.h: RL_READLINE_VERSION, currently 0x0402, + RL_VERSION_MAJOR, currently 4, and RL_VERSION_MINOR, currently 2. + +c. New readline variable: rl_readline_version, mirrors RL_READLINE_VERSION. + +d. New bindable boolean readline variable: match-hidden-files. Controls + completion of files beginning with a `.' (on Unix). Enabled by default. + +e. The history expansion code now allows any character to terminate a + `:first-' modifier, like csh. + +f. The incremental search code remembers the last search string and uses + it if ^R^R is typed without a search string. + +h. New bindable variable `history-preserve-point'. If set, the history + code attempts to place the user at the same location on each history + line retrieved with previous-history or next-history. + +------------------------------------------------------------------------------- +This document details the changes between this version, readline-4.2, +and the previous version, readline-4.1. + +1. Changes to Readline + +a. When setting the terminal attributes on systems using `struct termio', + readline waits for output to drain before changing the attributes. + +b. A fix was made to the history word tokenization code to avoid attempts to + dereference a null pointer. + +c. Readline now defaults rl_terminal_name to $TERM if the calling application + has left it unset, and tries to initialize with the resultant value. + +d. Instead of calling (*rl_getc_function)() directly to get input in certain + places, readline now calls rl_read_key() consistently. + +e. Fixed a bug in the completion code that allowed a backslash to quote a + single quote inside a single-quoted string. + +f. rl_prompt is no longer assigned directly from the argument to readline(), + but uses memory allocated by readline. This allows constant strings to + be passed to readline without problems arising when the prompt processing + code wants to modify the string. + +g. Fixed a bug that caused non-interactive history searches to return the + wrong line when performing multiple searches backward for the same string. + +h. Many variables, function arguments, and function return values are now + declared `const' where appropriate, to improve behavior when linking with + C++ code. + +i. The control character detection code now works better on systems where + `char' is unsigned by default. + +j. The vi-mode numeric argument is now capped at 999999, just like emacs mode. + +k. The Function, CPFunction, CPPFunction, and VFunction typedefs have been + replaced with a set of specific prototyped typedefs, though they are + still in the readline header files for backwards compatibility. + +m. Nearly all of the (undocumented) internal global variables in the library + now have an _rl_ prefix -- there were a number that did not, like + screenheight, screenwidth, alphabetic, etc. + +n. The ding() convenience function has been renamed to rl_ding(), though the + old function is still defined for backwards compatibility. + +o. The completion convenience functions filename_completion_function, + username_completion_function, and completion_matches now have an rl_ + prefix, though the old names are still defined for backwards compatibility. + +p. The functions shared by readline and bash (linkage is satisfied from bash + when compiling with bash, and internally otherwise) now have an sh_ prefix. + +q. Changed the shared library creation procedure on Linux and BSD/OS 4.x so + that the `soname' contains only the major version number rather than the + major and minor numbers. + +r. Fixed a redisplay bug that occurred when the prompt spanned more than one + physical line and contained invisible characters. + +s. Added a missing `includedir' variable to the Makefile. + +t. When installing the shared libraries, make sure symbolic links are relative. + +u. Added configure test so that it can set `${MAKE}' appropriately. + +v. Fixed a bug in rl_forward that could cause the point to be set to before + the beginning of the line in vi mode. + +w. Fixed a bug in the callback read-char interface to make it work when a + readline function pushes some input onto the input stream with + rl_execute_next (like the incremental search functions). + +x. Fixed a file descriptor leak in the history file manipulation code that + was tripped when attempting to truncate a non-regular file (like + /dev/null). + +y. Changes to make all of the exported readline functions declared in + readline.h have an rl_ prefix (rltty_set_default_bindings is now + rl_tty_set_default_bindings, crlf is now rl_crlf, etc.) + +z. The formatted documentation included in the base readline distribution + is no longer removed on a `make distclean'. + +aa. Some changes were made to avoid gcc warnings with -Wall. + +bb. rl_get_keymap_by_name now finds keymaps case-insensitively, so + `set keymap EMACS' works. + +cc. The history file writing and truncation functions now return a useful + status on error. + +dd. Fixed a bug that could cause applications to dereference a NULL pointer + if a NULL second argument was passed to history_expand(). + +ee. If a hook function assigned to rl_event_hook sets rl_done to a non-zero + value, rl_read_key() now immediately returns '\n' (which is assumed to + be bound to accept-line). + +2. New Features in Readline + +a. The blink timeout for paren matching is now settable by applications, + via the rl_set_paren_blink_timeout() function. + +b. _rl_executing_macro has been renamed to rl_executing_macro, which means + it's now part of the public interface. + +c. Readline has a new variable, rl_readline_state, which is a bitmap that + encapsulates the current state of the library; intended for use by + callbacks and hook functions. + +d. rlfe has a new -l option to log input and output (-a appends to logfile), + a new -n option to set the readline application name, and -v and -h + options for version and help information. + +e. rlfe can now perform filename completion for the inferior process if the + OS has a /proc//cwd that can be read with readlink(2) to get the + inferior's current working directory. + +f. A new file, rltypedefs.h, contains the new typedefs for function pointers + and is installed by `make install'. + +g. New application-callable function rl_set_prompt(const char *prompt): + expands its prompt string argument and sets rl_prompt to the result. + +h. New application-callable function rl_set_screen_size(int rows, int cols): + public method for applications to set readline's idea of the screen + dimensions. + +i. The history example program (examples/histexamp.c) is now built as one + of the examples. + +j. The documentation has been updated to cover nearly all of the public + functions and variables declared in readline.h. + +k. New function, rl_get_screen_size (int *rows, int *columns), returns + readline's idea of the screen dimensions. + +l. The timeout in rl_gather_tyi (readline keyboard input polling function) + is now settable via a function (rl_set_keyboard_input_timeout()). + +m. Renamed the max_input_history variable to history_max_entries; the old + variable is maintained for backwards compatibility. + +n. The list of characters that separate words for the history tokenizer is + now settable with a variable: history_word_delimiters. The default + value is as before. + +o. There is a new history.3 manual page documenting the history library. + +------------------------------------------------------------------------------- +This document details the changes between this version, readline-4.1, +and the previous version, readline-4.0. + +1. Changes to Readline + +a. Changed the HTML documents so that the table-of-contents is no longer + a separate file. + +b. Changes to the shared object configuration for: Irix 5.x, Irix 6.x, + OSF/1. + +c. The shared library major and minor versions are now constructed + automatically by configure and substituted into the makefiles. + +d. It's now possible to install the shared libraries separately from the + static libraries. + +e. The history library tries to truncate the history file only if it is a + regular file. + +f. A bug that caused _rl_dispatch to address negative array indices on + systems with signed chars was fixed. + +g. rl-yank-nth-arg now leaves the history position the same as when it was + called. + +h. Changes to the completion code to handle MS-DOS drive-letter:pathname + filenames. + +i. Completion is now case-insensitive by default on MS-DOS. + +j. Fixes to the history file manipulation code for MS-DOS. + +k. Readline attempts to bind the arrow keys to appropriate defaults on MS-DOS. + +l. Some fixes were made to the redisplay code for better operation on MS-DOS. + +m. The quoted-insert code will now insert tty special chars like ^C. + +n. A bug was fixed that caused the display code to reference memory before + the start of the prompt string. + +o. More support for __EMX__ (OS/2). + +p. A bug was fixed in readline's signal handling that could cause infinite + recursion in signal handlers. + +q. A bug was fixed that caused the point to be less than zero when rl_forward + was given a very large numeric argument. + +r. The vi-mode code now gets characters via the application-settable value + of rl_getc_function rather than calling rl_getc directly. + +s. The history file code now uses O_BINARY mode when reading and writing + the history file on cygwin32. + +t. Fixed a bug in the redisplay code for lines with more than 256 line + breaks. + +u. A bug was fixed which caused invisible character markers to not be + stripped from the prompt string if the terminal was in no-echo mode. + +v. Readline no longer tries to get the variables it needs for redisplay + from the termcap entry if the calling application has specified its + own redisplay function. Readline treats the terminal as `dumb' in + this case. + +w. Fixes to the SIGWINCH code so that a multiple-line prompt with escape + sequences is redrawn correctly. + +x. Changes to the install and install-shared targets so that the libraries + and header files are installed separately. + +2. New Features in Readline + +a. A new Readline `user manual' is in doc/rluserman.texinfo. + +b. Parentheses matching is now always compiled into readline, and enabled + or disabled when the value of the `blink-matching-paren' variable is + changed. + +c. MS-DOS systems now use ~/_inputrc as the last-ditch inputrc filename. + +d. MS-DOS systems now use ~/_history as the default history file. + +e. history-search-{forward,backward} now leave the point at the end of the + line when the string to search for is empty, like + {reverse,forward}-search-history. + +f. history-search-{forward,backward} now leave the last history line found + in the readline buffer if the second or subsequent search fails. + +g. New function for use by applications: rl_on_new_line_with_prompt, used + when an application displays the prompt itself before calling readline(). + +h. New variable for use by applications: rl_already_prompted. An application + that displays the prompt itself before calling readline() must set this to + a non-zero value. + +i. A new variable, rl_gnu_readline_p, always 1. The intent is that an + application can verify whether or not it is linked with the `real' + readline library or some substitute. + +j. Per Bothner's `rlfe' (pronounced `Ralphie') readline front-end program + is included in the examples subdirectory, though it is not built + by default. + +------------------------------------------------------------------------------- +This document details the changes between this version, readline-4.0, +and the previous version, readline-2.2. + +1. Changes to Readline + +a. The version number is now 4.0, to match the major and minor version + numbers on the shared readline and history libraries. Future + releases will maintain the identical numbering. + +b. Fixed a typo in the `make install' recipe that copied libreadline.a + to libhistory.old right after installing it. + +c. The readline and history info files are now installed out of the source + directory if they are not found in the build directory. + +d. The library no longer exports a function named `savestring' -- backwards + compatibility be damned. + +e. There is no longer any #ifdef SHELL code in the source files. + +f. Some changes were made to the key binding code to fix memory leaks and + better support Win32 systems. + +g. Fixed a silly typo in the paren matching code -- it's microseconds, not + milliseconds. + +h. The readline library should be compilable by C++ compilers. + +i. The readline.h public header file now includes function prototypes for + all readline functions, and some changes were made to fix errors in the + source files uncovered by the use of prototypes. + +j. The maximum numeric argument is now clamped at 1000000. + +k. Fixes to rl_yank_last_arg to make it behave better. + +l. Fixed a bug in the display code that caused core dumps if the prompt + string length exceeded 1024 characters. + +m. The menu completion code was fixed to properly insert a single completion + if there is only one match. + +n. A bug was fixed that caused the display code to improperly display tabs + after newlines. + +o. A fix was made to the completion code in which a typo caused the wrong + value to be passed to the function that computed the longest common + prefix of the list of matches. + +p. The completion code now checks the value of rl_filename_completion_desired, + which is set by application-supplied completion functions to indicate + that filename completion is being performed, to decide whether or not to + call an application-supplied `ignore completions' function. + +q. Code was added to the history library to catch history substitutions + using `&' without a previous history substitution or search having been + performed. + + +2. New Features in Readline + +a. There is a new script, support/shobj-conf, to do system-specific shared + object and library configuration. It generates variables for configure + to substitute into makefiles. The README file provides a detailed + explanation of the shared library creation process. + +b. Shared libraries and objects are now built in the `shlib' subdirectory. + There is a shlib/Makefile.in to control the build process. `make shared' + from the top-level directory is still the right way to build shared + versions of the libraries. + +c. rlconf.h is now installed, so applications can find out which features + have been compiled into the installed readline and history libraries. + +d. rlstdc.h is now an installed header file. + +e. Many changes to the signal handling: + o Readline now catches SIGQUIT and cleans up the tty before returning; + o A new variable, rl_catch_signals, is available to application writers + to indicate to readline whether or not it should install its own + signal handlers for SIGINT, SIGTERM, SIGQUIT, SIGALRM, SIGTSTP, + SIGTTIN, and SIGTTOU; + o A new variable, rl_catch_sigwinch, is available to application + writers to indicate to readline whether or not it should install its + own signal handler for SIGWINCH, which will chain to the calling + applications's SIGWINCH handler, if one is installed; + o There is a new function, rl_free_line_state, for application signal + handlers to call to free up the state associated with the current + line after receiving a signal; + o There is a new function, rl_cleanup_after_signal, to clean up the + display and terminal state after receiving a signal; + o There is a new function, rl_reset_after_signal, to reinitialize the + terminal and display state after an application signal handler + returns and readline continues + +f. There is a new function, rl_resize_terminal, to reset readline's idea of + the screen size after a SIGWINCH. + +g. New public functions: rl_save_prompt and rl_restore_prompt. These were + previously private functions with a `_' prefix. These functions are + used when an application wants to write a message to the `message area' + with rl_message and have the prompt restored correctly when the message + is erased. + +h. New function hook: rl_pre_input_hook, called just before readline starts + reading input, after initialization. + +i. New function hook: rl_display_matches_hook, called when readline would + display the list of completion matches. The new function + rl_display_match_list is what readline uses internally, and is available + for use by application functions called via this hook. + +j. New bindable function, delete-char-or-list, like tcsh. + +k. A new variable, rl_erase_empty_line, which, if set by an application using + readline, will cause readline to erase, prompt and all, lines on which the + only thing typed was a newline. + +l. There is a new script, support/shlib-install, to install and uninstall + the shared readline and history libraries. + +m. A new bindable variable, `isearch-terminators', which is a string + containing the set of characters that should terminate an incremental + search without being executed as a command. + +n. A new bindable function, forward-backward-delete-char. + +------------------------------------------------------------------------------- +This document details the changes between this version, readline-2.2, +and the previous version, readline-2.1. + +1. Changes to Readline + +a. Added a missing `extern' to a declaration in readline.h that kept + readline from compiling cleanly on some systems. + +b. The history file is now opened with mode 0600 when it is written for + better security. + +c. Changes were made to the SIGWINCH handling code so that prompt redisplay + is done better. + +d. ^G now interrupts incremental searches correctly. + +e. A bug that caused a core dump when the set of characters to be quoted + when completing words was empty was fixed. + +f. Fixed a problem in the readline test program rltest.c that caused a core + dump. + +g. The code that handles parser directives in inputrc files now displays + more error messages. + +h. The history expansion code was fixed so that the appearance of the + history comment character at the beginning of a word inhibits history + expansion for that word and the rest of the input line. + +i. The code that prints completion listings now behaves better if one or + more of the filenames contains non-printable characters. + +j. The time delay when showing matching parentheses is now 0.5 seconds. + + +2. New Features in Readline + +a. There is now an option for `iterative' yank-last-arg handline, so a user + can keep entering `M-.', yanking the last argument of successive history + lines. + +b. New variable, `print-completions-horizontally', which causes completion + matches to be displayed across the screen (like `ls -x') rather than up + and down the screen (like `ls'). + +c. New variable, `completion-ignore-case', which causes filename completion + and matching to be performed case-insensitively. + +d. There is a new bindable command, `magic-space', which causes history + expansion to be performed on the current readline buffer and a space to + be inserted into the result. + +e. There is a new bindable command, `menu-complete', which enables tcsh-like + menu completion (successive executions of menu-complete insert a single + completion match, cycling through the list of possible completions). + +f. There is a new bindable command, `paste-from-clipboard', for use on Win32 + systems, to insert the text from the Win32 clipboard into the editing + buffer. + +g. The key sequence translation code now understands printf-style backslash + escape sequences, including \NNN octal escapes. These escape sequences + may be used in key sequence definitions or macro values. + +h. An `$include' inputrc file parser directive has been added. diff --git a/miniconda3/share/doc/readline/INSTALL b/miniconda3/share/doc/readline/INSTALL new file mode 100644 index 0000000000000000000000000000000000000000..52ba8eb360eb52464c612076fa4d4c9404697194 --- /dev/null +++ b/miniconda3/share/doc/readline/INSTALL @@ -0,0 +1,335 @@ +Basic Installation +================== + +These are installation instructions for Readline. + +The simplest way to compile readline is: + + 1. `cd' to the directory containing the readline source code and type + `./configure' to configure readline for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes some time. While running, it prints some + messages telling which features it is checking for. + + If you want to build readline in a directory other than the source + directory, just run `configure' using a full pathname, for instance: + + bash /usr/local/src/readline/readline-8.3/configure + + 2. Type `make' to compile readline and build the static readline + and history libraries. If supported, this will build the shared + readline and history libraries also. See below for instructions on + compiling the other parts of the distribution. Typing `make everything' + will build the static and shared libraries (if supported) and the + example programs. + + 3. Type `make install' to install the static readline and history + libraries, the readline include files, the documentation, and, if + supported, the shared readline and history libraries. + + 4. You can remove the created libraries and object files from the + build directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile readline for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the readline developers, and should be used with care. + +The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It +uses those values to create a `Makefile' in the build directory, +and Makefiles in the `doc', `shlib', and `examples' +subdirectories. It also creates a `config.h' file containing +system-dependent definitions. Finally, it creates a shell script +`config.status' that you can run in the future to recreate the +current configuration, a file `config.cache' that saves the +results of its tests to speed up reconfiguring, and a file +`config.log' containing compiler output (useful mainly for +debugging `configure'). + +To find out more about the options and arguments that the `configure' +script understands, type + + bash-4.2$ ./configure --help + +at a shell prompt in your readline source directory. + +If you want to build readline in a directory separate from the source +directory - to build for multiple architectures, for example - just use +the full path to the configure script. The following commands will +build readline in a directory under `/usr/local/build' from the source code +in `/usr/local/src/readline/readline-8.3': + + mkdir /usr/local/build/readline-8.3 + cd /usr/local/build/readline-8.3 + bash /usr/local/src/readline/readline-8.3/configure + make + +See `Compiling For Multiple Architectures' below for more information +about building in a directory separate from the source. + +If you need to do unusual things to compile readline, please try +to figure out how `configure' could check whether to do them, and +mail diffs or instructions to so they can +be considered for the next release. If at some point +`config.cache' contains results you don't want to keep, you may +remove or edit it. + +The file `configure.in' is used to create `configure' by a +program called `autoconf'. You only need `configure.in' if you +want to change it or regenerate `configure' using a newer version +of `autoconf'. The readline `configure.in' requires autoconf +version 2.69 or newer. + +Compilers and Options +===================== + +Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + +You can compile readline for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + +If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile readline for one architecture at a +time in the source code directory. After you have installed +readline for one architecture, use `make distclean' before +reconfiguring for another architecture. + +Installation Names +================== + +By default, `make install' will install the readline libraries in +`/usr/local/lib', the include files in `/usr/local/include/readline', +the man pages in `/usr/local/man', and the info files in `/usr/local/info'. +You can specify an installation prefix other than `/usr/local' by +giving `configure' the option `--prefix=PATH' or by supplying a value for +the DESTDIR variable when running `make install'. + +You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. +If you give `configure' the option `--exec-prefix=PATH', the +readline Makefiles will use PATH as the prefix for installing the +libraries. Documentation and other data files will still use the +regular prefix. + +Specifying the System Type +========================== + +There may be some features `configure' can not figure out +automatically, but need to determine by the type of host readline +will run on. Usually `configure' can figure that out, but if it +prints a message saying it can not guess the host type, give it +the `--host=TYPE' option. TYPE can either be a short name for +the system type, such as `sun4', or a canonical name with three +fields: CPU-COMPANY-SYSTEM (e.g., i386-unknown-freebsd4.2). + +See the file `config.sub' for the possible values of each field. + +Sharing Defaults +================ + +If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: the readline `configure' looks for a site script, but not +all `configure' scripts do. + +Operation Controls +================== + +`configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. + +Optional Features +================= + +The readline `configure' recognizes two `--with-PACKAGE' options: + +`--with-curses' + This tells readline that it can find the termcap library functions + (tgetent, et al.) in the curses library, rather than a separate + termcap library. Readline uses the termcap functions, but does not + usually link with the termcap or curses library itself, allowing + applications which link with readline the to choose an appropriate + library. This option tells readline to link the example programs with + the curses library rather than libtermcap. + +`--with-shared-termcap-library' + This tells the readline build process to link the shared version of + libreadline against a shared version of the curses or termcap library + (see the description of SHLIB_LIBS below under `Shared Libraries'). + This relieves the application of having to link with curses or termcap + itself, but does not allow the application to choose which library to + use. This is only effective on systems that build shared libraries (see + below; the default for shared libraries is `yes'). + +`configure' also recognizes several `--enable-FEATURE' options: + +`--enable-bracketed-paste-default' + Enable bracketed paste by default, so the initial value of the + `enable-bracketed-paste' Readline variable is `on'. The default + is `yes'. + +`--enable-install-examples' + Install the readline example programs as part of `make install'. + +`--enable-multibyte' + Build with support for multibyte characters enabled on systems with the + necessary framework (locale definitions, C library functions, etc.). The + default is `yes'. + +`--enable-shared' + Build the shared libraries by default on supported platforms. The + default is `yes'. + +`--enable-static' + Build the static libraries by default. The default is `yes'. + +Shared Libraries +================ + +There is support for building shared versions of the readline and +history libraries. The configure script creates a Makefile in +the `shlib' subdirectory, and typing `make shared' will cause +shared versions of the readline and history libraries to be built +on supported platforms. + +If `configure' is given the `--enable-shared' option, it will attempt +to build the shared libraries by default on supported platforms. This +option is enabled by default. + +Configure calls the script support/shobj-conf to test whether or +not shared library creation is supported and to generate the values +of variables that are substituted into shlib/Makefile. If you +try to build shared libraries on an unsupported platform, `make' +will display a message asking you to update support/shobj-conf for +your platform. + +If you need to update support/shobj-conf, you will need to create +a `stanza' for your operating system and compiler. The script uses +the value of host_os and ${CC} as determined by configure. For +instance, FreeBSD 4.2 with any version of gcc is identified as +`freebsd4.2-gcc*'. + +In the stanza for your operating system-compiler pair, you will need to +define several variables. They are: + +SHOBJ_CC The C compiler used to compile source files into shareable + object files. This is normally set to the value of ${CC} + by configure, and should not need to be changed. + +SHOBJ_CFLAGS Flags to pass to the C compiler ($SHOBJ_CC) to create + position-independent code. If you are using gcc, this + should probably be set to `-fpic'. + +SHOBJ_LD The link editor to be used to create the shared library from + the object files created by $SHOBJ_CC. If you are using + gcc, a value of `gcc' will probably work. + +SHOBJ_LDFLAGS Flags to pass to SHOBJ_LD to enable shared object creation. + If you are using gcc, `-shared' may be all that is necessary. + These should be the flags needed for generic shared object + creation. + +SHLIB_XLDFLAGS Additional flags to pass to SHOBJ_LD for shared library + creation. Many systems use the -R option to the link + editor to embed a path within the library for run-time + library searches. A reasonable value for such systems would + be `-R$(libdir)'. + +SHLIB_LIBS Any additional libraries that shared libraries should be + linked against when they are created. + +SHLIB_LIBPREF The prefix to use when generating the filename of the shared + library. The default is `lib'; Cygwin uses `cyg'. + +SHLIB_LIBSUFF The suffix to add to `libreadline' and `libhistory' when + generating the filename of the shared library. Many systems + use `so'; HP-UX uses `sl'. + +SHLIB_LIBVERSION The string to append to the filename to indicate the version + of the shared library. It should begin with $(SHLIB_LIBSUFF), + and possibly include version information that allows the + run-time loader to load the version of the shared library + appropriate for a particular program. Systems using shared + libraries similar to SunOS 4.x use major and minor library + version numbers; for those systems a value of + `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' is appropriate. + Systems based on System V Release 4 don't use minor version + numbers; use `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' on those systems. + Other Unix versions use different schemes. + +SHLIB_DLLVERSION The version number for shared libraries that determines API + compatibility between readline versions and the underlying + system. Used only on Cygwin. Defaults to $SHLIB_MAJOR, but + can be overridden at configuration time by defining DLLVERSION + in the environment. + +SHLIB_DOT The character used to separate the name of the shared library + from the suffix and version information. The default is `.'; + systems like Cygwin which don't separate version information + from the library name should set this to the empty string. + +SHLIB_STATUS Set this to `supported' when you have defined the other + necessary variables. Make uses this to determine whether + or not shared library creation should be attempted. If + shared libraries are not supported, this will be set to + `unsupported'. + +You should look at the existing stanzas in support/shobj-conf for ideas. + +Once you have updated support/shobj-conf, re-run configure and type +`make shared' or `make'. The shared libraries will be created in the +shlib subdirectory. + +If shared libraries are created, `make install' will install them. +You may install only the shared libraries by running `make +install-shared' from the top-level build directory. Running `make +install' in the shlib subdirectory will also work. If you don't want +to install any created shared libraries, run `make install-static'. diff --git a/miniconda3/share/doc/readline/README b/miniconda3/share/doc/readline/README new file mode 100644 index 0000000000000000000000000000000000000000..75eaa2ff8e57b78ff9d4ac6a7a7c76e956dd7935 --- /dev/null +++ b/miniconda3/share/doc/readline/README @@ -0,0 +1,197 @@ +Introduction +============ + +This is the Gnu Readline library, version 8.3. + +The Readline library provides a set of functions for use by applications +that allow users to edit command lines as they are typed in. Both +Emacs and vi editing modes are available. The Readline library includes +additional functions to maintain a list of previously-entered command +lines, to recall and perhaps reedit those lines, and perform csh-like +history expansion on previous commands. + +The history facilities are also placed into a separate library, the +History library, as part of the build process. The History library +may be used without Readline in applications which desire its +capabilities. + +The Readline library is free software, distributed under the terms of +the [GNU] General Public License as published by the Free Software +Foundation, version 3 of the License. For more information, see the +file COPYING. + +To build the library, try typing `./configure', then `make'. The +configuration process is automated, so no further intervention should +be necessary. Readline builds with `gcc' by default if it is +available. If you want to use `cc' instead, type + + CC=cc ./configure + +if you are using a Bourne-style shell. If you are not, the following +may work: + + env CC=cc ./configure + +Read the file INSTALL in this directory for more information about how +to customize and control the build process, including how to build readline +in a directory other than the source directory. + +The file rlconf.h contains C preprocessor defines that enable and disable +certain Readline features. + +The special make target `everything' will build the static and shared +libraries (if the target platform supports them) and the examples. + +Examples +======== + +There are several example programs that use Readline features in the +examples directory. The `rl' program is of particular interest. It +is a command-line interface to Readline, suitable for use in shell +scripts in place of `read' (but look at bash's `read -e' first). + +Shared Libraries +================ + +There is skeletal support for building shared versions of the +Readline and History libraries. The configure script creates +a Makefile in the `shlib' subdirectory, and typing `make shared' +will cause shared versions of the Readline and History libraries +to be built on supported platforms. + +If `configure' is given the `--enable-shared' option, it will attempt +to build the shared libraries by default on supported platforms. + +Configure calls the script support/shobj-conf to test whether or +not shared library creation is supported and to generate the values +of variables that are substituted into shlib/Makefile. If you +try to build shared libraries on an unsupported platform, `make' +will display a message asking you to update support/shobj-conf for +your platform. + +If you need to update support/shobj-conf, you will need to create +a `stanza' for your operating system and compiler. The script uses +the value of host_os and ${CC} as determined by configure. For +instance, FreeBSD 4.2 with any version of gcc is identified as +`freebsd4.2-gcc*'. + +In the stanza for your operating system-compiler pair, you will need to +define several variables. They are: + +SHOBJ_CC The C compiler used to compile source files into shareable + object files. This is normally set to the value of ${CC} + by configure, and should not need to be changed. + +SHOBJ_CFLAGS Flags to pass to the C compiler ($SHOBJ_CC) to create + position-independent code. If you are using gcc, this + should probably be set to `-fpic'. + +SHOBJ_LD The link editor to be used to create the shared library from + the object files created by $SHOBJ_CC. If you are using + gcc, a value of `gcc' will probably work. + +SHOBJ_LDFLAGS Flags to pass to SHOBJ_LD to enable shared object creation. + If you are using gcc, `-shared' may be all that is necessary. + These should be the flags needed for generic shared object + creation. + +SHLIB_XLDFLAGS Additional flags to pass to SHOBJ_LD for shared library + creation. Many systems use the -R option to the link + editor to embed a path within the library for run-time + library searches. A reasonable value for such systems would + be `-R$(libdir)'. + +SHLIB_LIBS Any additional libraries that shared libraries should be + linked against when they are created. + +SHLIB_LIBPREF The prefix to use when generating the filename of the shared + library. The default is `lib'; Cygwin uses `cyg'. + +SHLIB_LIBSUFF The suffix to add to `libreadline' and `libhistory' when + generating the filename of the shared library. Many systems + use `so'; HP-UX uses `sl'. + +SHLIB_LIBVERSION The string to append to the filename to indicate the version + of the shared library. It should begin with $(SHLIB_LIBSUFF), + and possibly include version information that allows the + run-time loader to load the version of the shared library + appropriate for a particular program. Systems using shared + libraries similar to SunOS 4.x use major and minor library + version numbers; for those systems a value of + `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)' is appropriate. + Systems based on System V Release 4 don't use minor version + numbers; use `$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)' on those systems. + Other Unix versions use different schemes. + +SHLIB_DLLVERSION The version number for shared libraries that determines API + compatibility between readline versions and the underlying + system. Used only on Cygwin. Defaults to $SHLIB_MAJOR, but + can be overridden at configuration time by defining DLLVERSION + in the environment. + +SHLIB_DOT The character used to separate the name of the shared library + from the suffix and version information. The default is `.'; + systems like Cygwin which don't separate version information + from the library name should set this to the empty string. + +SHLIB_STATUS Set this to `supported' when you have defined the other + necessary variables. Make uses this to determine whether + or not shared library creation should be attempted. + +You should look at the existing stanzas in support/shobj-conf for ideas. + +Once you have updated support/shobj-conf, re-run configure and type +`make shared'. The shared libraries will be created in the shlib +subdirectory. + +If shared libraries are created, `make install' will install them. +You may install only the shared libraries by running `make +install-shared' from the top-level build directory. Running `make +install' in the shlib subdirectory will also work. If you don't want +to install any created shared libraries, run `make install-static'. + +Documentation +============= + +The documentation for the Readline and History libraries appears in +the `doc' subdirectory. There are three texinfo files and a +Unix-style manual page describing the facilities available in the +Readline library. The texinfo files include both user and +programmer's manuals. HTML versions of the manuals appear in the +`doc' subdirectory as well. + +Usage +===== + +Our position on the use of Readline through a shared-library linking +mechanism is that there is no legal difference between shared-library +linking and static linking--either kind of linking combines various +modules into a single larger work. The conditions for using Readline +in a larger work are stated in section 3 of the GNU GPL. + +Reporting Bugs +============== + +Bug reports for Readline should be sent to: + + bug-readline@gnu.org + +When reporting a bug, please include the following information: + + * the version number and release status of Readline (e.g., 4.2-release) + * the machine and OS that it is running on + * a list of the compilation flags or the contents of `config.h', if + appropriate + * a description of the bug + * a recipe for recreating the bug reliably + * a fix for the bug if you have one! + +If you would like to contact the Readline maintainer directly, send mail +to bash-maintainers@gnu.org. + +Since Readline is developed along with bash, the bug-bash@gnu.org mailing +list (mirrored to the Usenet newsgroup gnu.bash.bug) often contains +Readline bug reports and fixes. + +Chet Ramey +chet.ramey@case.edu diff --git a/miniconda3/share/doc/readline/history.html b/miniconda3/share/doc/readline/history.html new file mode 100644 index 0000000000000000000000000000000000000000..62803d81e89c7cbae8036be1c1ac466617d9ca19 --- /dev/null +++ b/miniconda3/share/doc/readline/history.html @@ -0,0 +1,1835 @@ + + + + + + +GNU History Library + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/miniconda3/share/doc/readline/readline.html b/miniconda3/share/doc/readline/readline.html new file mode 100644 index 0000000000000000000000000000000000000000..897bc7c22091a3d3a2e80ffabf3f1341c67c9fa4 --- /dev/null +++ b/miniconda3/share/doc/readline/readline.html @@ -0,0 +1,6706 @@ + + + + + + +GNU Readline Library + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

GNU Readline Library

+ +

This document describes the GNU Readline Library, a utility which aids +in the consistency of user interface across discrete programs which +provide a command line interface. +The Readline home page is http://www.gnu.org/software/readline/. +

+ + + + + +
+

Table of Contents

+ +
+ + +
+
+
+
+ +

1 Command Line Editing

+ +

This chapter describes the basic features of the GNU +command line editing interface. +

+ + +
+
+ +

1.1 Introduction to Line Editing

+ +

The following paragraphs use Emacs style to +describe the notation used to represent keystrokes. +

+

The text C-k is read as ‘Control-K’ and describes the character +produced when the k key is pressed while the Control key +is depressed. +

+

The text M-k is read as ‘Meta-K’ and describes the character +produced when the Meta key (if you have one) is depressed, and the k +key is pressed (a meta character), then both are released. +The Meta key is labeled ALT or Option on many keyboards. +On keyboards with two keys labeled ALT (usually to either side of +the space bar), the ALT on the left side is generally set to +work as a Meta key. +One of the ALT keys may also be configured +as some other modifier, such as a +Compose key for typing accented characters. +

+

On some keyboards, the Meta key modifier produces characters with +the eighth bit (0200) set. +You can use the enable-meta-key variable +to control whether or not it does this, if the keyboard allows it. +On many others, the terminal or terminal emulator converts the metafied +key to a key sequence beginning with ESC as described in the +next paragraph. +

+

If you do not have a Meta or ALT key, or another key working as +a Meta key, you can generally achieve the latter effect by typing ESC +first, and then typing k. +The ESC character is known as the meta prefix). +

+

Either process is known as metafying the k key. +

+

If your Meta key produces a key sequence with the ESC meta prefix, +you can make M-key key bindings you specify +(see Key Bindings in Readline Init File Syntax) +do the same thing by setting the force-meta-prefix variable. +

+

The text M-C-k is read as ‘Meta-Control-k’ and describes the +character produced by metafying C-k. +

+

In addition, several keys have their own names. +Specifically, +DEL, ESC, LFD, SPC, RET, and TAB all +stand for themselves when seen in this text, or in an init file +(see Readline Init File). +If your keyboard lacks a LFD key, typing C-j will +output the appropriate character. +The RET key may be labeled Return or Enter on +some keyboards. +

+
+
+
+ +

1.2 Readline Interaction

+ + +

Often during an interactive session you type in a long line of text, +only to notice that the first word on the line is misspelled. +The Readline library gives you a set of commands for manipulating the text +as you type it in, allowing you to just fix your typo, and not forcing +you to retype the majority of the line. +Using these editing commands, +you move the cursor to the place that needs correction, and delete or +insert the text of the corrections. +Then, when you are satisfied with the line, you simply press RET. +You do not have to be at the +end of the line to press RET; the entire line is accepted +regardless of the location of the cursor within the line. +

+ + +
+
+ +

1.2.1 Readline Bare Essentials

+ + + + +

In order to enter characters into the line, simply type them. +The typed +character appears where the cursor was, and then the cursor moves one +space to the right. +If you mistype a character, you can use your +erase character to back up and delete the mistyped character. +

+

Sometimes you may mistype a character, and +not notice the error until you have typed several other characters. +In that case, you can type C-b to move the cursor to the left, +and then correct your mistake. +Afterwards, you can move the cursor to the right with C-f. +

+

When you add text in the middle of a line, you will notice that characters +to the right of the cursor are ‘pushed over’ to make room for the text +that you have inserted. +Likewise, when you delete text behind the cursor, +characters to the right of the cursor are ‘pulled back’ to fill in the +blank space created by the removal of the text. +These are the bare +essentials for editing the text of an input line: +

+
+
C-b
+

Move back one character. +

+
C-f
+

Move forward one character. +

+
DEL or Backspace
+

Delete the character to the left of the cursor. +

+
C-d
+

Delete the character underneath the cursor. +

+
Printing characters
+

Insert the character into the line at the cursor. +

+
C-_ or C-x C-u
+

Undo the last editing command. +You can undo all the way back to an empty line. +

+
+ +

Depending on your configuration, the Backspace key might be set to +delete the character to the left of the cursor and the DEL key set +to delete the character underneath the cursor, like C-d, rather +than the character to the left of the cursor. +

+
+
+
+ +

1.2.2 Readline Movement Commands

+ +

The above table describes the most basic keystrokes that you need +in order to do editing of the input line. +For your convenience, many other commands are available in +addition to C-b, C-f, C-d, and DEL. +Here are some commands for moving more rapidly within the line. +

+
+
C-a
+

Move to the start of the line. +

+
C-e
+

Move to the end of the line. +

+
M-f
+

Move forward a word, where a word is composed of letters and digits. +

+
M-b
+

Move backward a word. +

+
C-l
+

Clear the screen, reprinting the current line at the top. +

+
+ +

Notice how C-f moves forward a character, while M-f moves +forward a word. +It is a loose convention that control keystrokes +operate on characters while meta keystrokes operate on words. +

+
+
+
+ +

1.2.3 Readline Killing Commands

+ + + + +

Killing text means to delete the text from the line, but to save +it away for later use, usually by yanking (re-inserting) +it back into the line. +(‘Cut’ and ‘paste’ are more recent jargon for ‘kill’ and ‘yank’.) +

+

If the description for a command says that it ‘kills’ text, then you can +be sure that you can get the text back in a different (or the same) +place later. +

+

When you use a kill command, the text is saved in a kill-ring. +Any number of consecutive kills save all of the killed text together, so +that when you yank it back, you get it all. +The kill ring is not line specific; the text that you killed on a previously +typed line is available to be yanked back later, when you are typing +another line. + +

+

Here is the list of commands for killing text. +

+
+
C-k
+

Kill the text from the current cursor position to the end of the line. +

+
+
M-d
+

Kill from the cursor to the end of the current word, or, if between +words, to the end of the next word. +Word boundaries are the same as those used by M-f. +

+
+
M-DEL
+

Kill from the cursor to the start of the current word, or, if between +words, to the start of the previous word. +Word boundaries are the same as those used by M-b. +

+
+
C-w
+

Kill from the cursor to the previous whitespace. +This is different than +M-DEL because the word boundaries differ. +

+
+
+ +

Here is how to yank the text back into the line. Yanking +means to copy the most-recently-killed text from the kill buffer +into the line at the current cursor position. +

+
+
C-y
+

Yank the most recently killed text back into the buffer at the cursor. +

+
+
M-y
+

Rotate the kill-ring, and yank the new top. +You can only do this if the prior command is C-y or M-y. +

+
+ +
+
+
+ +

1.2.4 Readline Arguments

+ +

You can pass numeric arguments to Readline commands. +Sometimes the +argument acts as a repeat count, other times it is the sign of the +argument that is significant. +If you pass a negative argument to a +command which normally acts in a forward direction, that command will +act in a backward direction. +For example, to kill text back to the +start of the line, you might type ‘M-- C-k’. +

+

The general way to pass numeric arguments to a command is to type meta +digits before the command. +If the first ‘digit’ typed is a minus +sign (‘-’), then the sign of the argument will be negative. +Once you have typed one meta digit to get the argument started, you can +type the remainder of the digits, and then the command. +For example, to give +the C-d command an argument of 10, you could type ‘M-1 0 C-d’, +which will delete the next ten characters on the input line. +

+
+
+
+ +

1.2.5 Searching for Commands in the History

+ +

Readline provides commands for searching through the command history +for lines containing a specified string. +There are two search modes: incremental and non-incremental. +

+

Incremental searches begin before the user has finished typing the +search string. +As each character of the search string is typed, Readline displays +the next entry from the history matching the string typed so far. +An incremental search requires only as many characters as needed to +find the desired history entry. +When using emacs editing mode, type C-r +to search backward in the history for a particular string. +Typing C-s searches forward through the history. +The characters present in the value of the isearch-terminators variable +are used to terminate an incremental search. +If that variable has not been assigned a value, the ESC and +C-j characters terminate an incremental search. +C-g aborts an incremental search and restores the original line. +When the search is terminated, the history entry containing the +search string becomes the current line. +

+

To find other matching entries in the history list, type C-r or +C-s as appropriate. +This searches backward or forward in the history for the next +entry matching the search string typed so far. +Any other key sequence bound to a Readline command terminates +the search and executes that command. +For instance, a RET terminates the search and accepts +the line, thereby executing the command from the history list. +A movement command will terminate the search, make the last line found +the current line, and begin editing. +

+

Readline remembers the last incremental search string. +If two C-rs are typed without any intervening characters defining +a new search string, Readline uses any remembered search string. +

+

Non-incremental searches read the entire search string before starting +to search for matching history entries. +The search string may be typed by the user or be part of the contents of +the current line. +

+
+
+
+
+ +

1.3 Readline Init File

+ + +

Although the Readline library comes with a set of Emacs-like +keybindings installed by default, it is possible to use a different set +of keybindings. +Any user can customize programs that use Readline by putting +commands in an inputrc file, conventionally in their home directory. +The name of this file is taken from the value of the +environment variable INPUTRC. +If that variable is unset, the default is ~/.inputrc. +If that file does not exist or cannot be read, Readline looks for +/etc/inputrc. +

+

When a program that uses the Readline library starts up, Readline reads +the init file and sets any variables and key bindings it contains. +

+

In addition, the C-x C-r command re-reads this init file, thus +incorporating any changes that you might have made to it. +

+ + +
+
+ +

1.3.1 Readline Init File Syntax

+ +

There are only a few basic constructs allowed in the +Readline init file. +Blank lines are ignored. +Lines beginning with a ‘#’ are comments. +Lines beginning with a ‘$’ indicate conditional +constructs (see Conditional Init Constructs). +Other lines denote variable settings and key bindings. +

+
+
Variable Settings
+

You can modify the run-time behavior of Readline by +altering the values of variables in Readline +using the set command within the init file. +The syntax is simple: +

+
+
set variable value
+
+ +

Here, for example, is how to +change from the default Emacs-like key binding to use +vi line editing commands: +

+
+
set editing-mode vi
+
+ +

Variable names and values, where appropriate, are recognized without +regard to case. +Unrecognized variable names are ignored. +

+

Boolean variables (those that can be set to on or off) are set to on if +the value is null or empty, on (case-insensitive), or 1. +Any other value results in the variable being set to off. +

+ +

A great deal of run-time behavior is changeable with the following +variables. +

+ +
+
active-region-start-color
+

A string variable that controls the text color and background when displaying +the text in the active region (see the description of +enable-active-region below). +This string must not take up any physical character positions on the display, +so it should consist only of terminal escape sequences. +It is output to the terminal before displaying the text in the active region. +This variable is reset to the default value whenever the terminal type changes. +The default value is the string that puts the terminal in standout mode, +as obtained from the terminal’s terminfo description. +A sample value might be ‘\e[01;33m’. +

+
+
active-region-end-color
+

A string variable that “undoes” +the effects of active-region-start-color +and restores “normal” +terminal display appearance after displaying text in the active region. +This string must not take up any physical character positions on the display, +so it should consist only of terminal escape sequences. +It is output to the terminal after displaying the text in the active region. +This variable is reset to the default value whenever the terminal type changes. +The default value is the string that restores the terminal from standout mode, +as obtained from the terminal’s terminfo description. +A sample value might be ‘\e[0m’. +

+
+
bell-style
+

Controls what happens when Readline wants to ring the terminal bell. +If set to ‘none’, Readline never rings the bell. +If set to ‘visible’, Readline uses a visible bell if one is available. +If set to ‘audible’ (the default), Readline attempts to ring +the terminal’s bell. +

+
+
bind-tty-special-chars
+

If set to ‘on’ (the default), Readline attempts to bind the control +characters that are +treated specially by the kernel’s terminal driver to their +Readline equivalents. +These override the default Readline bindings described here. +Type ‘stty -a’ at a Bash prompt to see your current terminal settings, +including the special control characters (usually cchars). +

+
+
blink-matching-paren
+

If set to ‘on’, Readline attempts to briefly move the cursor to an +opening parenthesis when a closing parenthesis is inserted. +The default is ‘off’. +

+
+
colored-completion-prefix
+

If set to ‘on’, when listing completions, Readline displays the +common prefix of the set of possible completions using a different color. +The color definitions are taken from the value of the LS_COLORS +environment variable. +If there is a color definition in LS_COLORS for the custom suffix +‘readline-colored-completion-prefix’, Readline uses this color for +the common prefix instead of its default. +The default is ‘off’. +

+
+
colored-stats
+

If set to ‘on’, Readline displays possible completions using different +colors to indicate their file type. +The color definitions are taken from the value of the LS_COLORS +environment variable. +The default is ‘off’. +

+
+
comment-begin
+

The string to insert at the beginning of the line by the +insert-comment command. +The default value is "#". +

+
+
completion-display-width
+

The number of screen columns used to display possible matches +when performing completion. +The value is ignored if it is less than 0 or greater than the terminal +screen width. +A value of 0 causes matches to be displayed one per line. +The default value is -1. +

+
+
completion-ignore-case
+

If set to ‘on’, Readline performs filename matching and completion +in a case-insensitive fashion. +The default value is ‘off’. +

+
+
completion-map-case
+

If set to ‘on’, and completion-ignore-case is enabled, Readline +treats hyphens (‘-’) and underscores (‘_’) as equivalent when +performing case-insensitive filename matching and completion. +The default value is ‘off’. +

+
+
completion-prefix-display-length
+

The maximum +length in characters of the common prefix of a list of possible +completions that is displayed without modification. +When set to a value greater than zero, Readline +replaces common prefixes longer than this value +with an ellipsis when displaying possible completions. +If a completion begins with a period, +and Readline is completing filenames, +it uses three underscores instead of an ellipsis. +

+
+
completion-query-items
+

The number of possible completions that determines when the user is asked +whether the list of possibilities should be displayed. +If the number of possible completions is greater than +or equal to this value, +Readline asks whether or not the user wishes to view them; +otherwise, Readline simply lists the completions. +This variable must be set to an integer value greater than or equal to zero. +A zero value means Readline should never ask; negative +values are treated as zero. +The default limit is 100. +

+
+
convert-meta
+

If set to ‘on’, Readline converts characters it reads +that have the eighth bit set to an ASCII key sequence by +clearing the eighth bit and prefixing an ESC character, +converting them to a meta-prefixed key sequence. +The default value is ‘on’, but Readline sets it to ‘off’ +if the locale contains +characters whose encodings may include bytes with the eighth bit set. +This variable is dependent on the LC_CTYPE locale category, and +may change if the locale changes. +This variable also affects key bindings; +see the description of force-meta-prefix below. +

+
+
disable-completion
+

If set to ‘On’, Readline inhibits word completion. +Completion characters are inserted into the line as if they +had been mapped to self-insert. +The default is ‘off’. +

+
+
echo-control-characters
+

When set to ‘on’, on operating systems that indicate they support it, +Readline echoes a character corresponding to a signal generated from the +keyboard. +The default is ‘on’. +

+
+
editing-mode
+

The editing-mode variable controls the default set of +key bindings. +By default, Readline starts up in emacs editing mode, where +the keystrokes are most similar to Emacs. +This variable can be set to either ‘emacs’ or ‘vi’. +

+
+
emacs-mode-string
+

If the show-mode-in-prompt variable is enabled, +this string is displayed immediately before the last line of the primary +prompt when emacs editing mode is active. +The value is expanded like a +key binding, so the standard set of meta- and control- prefixes and +backslash escape sequences is available. +The ‘\1’ and ‘\2’ escapes begin and end sequences of +non-printing characters, which can be used to embed a terminal control +sequence into the mode string. +The default is ‘@’. +

+
+
enable-active-region
+

point is the current cursor position, and mark refers to a +saved cursor position (see Commands For Moving). +The text between the point and mark is referred to as the region. +When this variable is set to ‘On’, Readline allows certain commands +to designate the region as active. +When the region is active, Readline highlights the text in the region using +the value of the active-region-start-color, which defaults to the +string that enables the terminal’s standout mode. +The active region shows the text inserted by bracketed-paste and any +matching text found by incremental and non-incremental history searches. +The default is ‘On’. +

+
+
enable-bracketed-paste
+

When set to ‘On’, Readline configures the terminal to insert each +paste into the editing buffer as a single string of characters, instead +of treating each character as if it had been read from the keyboard. +This is called putting the terminal into bracketed paste mode; +it prevents Readline from executing any editing commands bound +to key sequences appearing in the pasted text. +The default is ‘On’. +

+
+
enable-keypad
+

When set to ‘on’, Readline tries to enable the application +keypad when it is called. +Some systems need this to enable the arrow keys. +The default is ‘off’. +

+
+
enable-meta-key
+

When set to ‘on’, Readline tries to enable any meta +modifier key the terminal claims to support when it is called. +On many terminals, the Meta key is used to send eight-bit characters; +this variable checks for the terminal capability that indicates the +terminal can enable and disable a mode that sets the eighth bit of a +character (0200) if the Meta key is held down when the character is +typed (a meta character). +The default is ‘on’. +

+
+
expand-tilde
+

If set to ‘on’, Readline attempts tilde expansion when it +attempts word completion. +The default is ‘off’. +

+
+
force-meta-prefix
+

If set to ‘on’, Readline modifies its behavior when binding key +sequences containing \M- or Meta- +(see Key Bindings in Readline Init File Syntax) +by converting a key sequence of the form +\M-C or Meta-C to the two-character sequence +ESC C (adding the meta prefix). +If force-meta-prefix is set to ‘off’ (the default), +Readline uses the value of the convert-meta variable to determine +whether to perform this conversion: +if convert-meta is ‘on’, +Readline performs the conversion described above; +if it is ‘off’, Readline converts C to a meta character by +setting the eighth bit (0200). +The default is ‘off’. +

+
+
history-preserve-point
+

If set to ‘on’, the history code attempts to place the point (the +current cursor position) at the +same location on each history line retrieved with previous-history +or next-history. +The default is ‘off’. +

+
+
history-size
+

Set the maximum number of history entries saved in the history list. +If set to zero, any existing history entries are deleted and no new entries +are saved. +If set to a value less than zero, the number of history entries is not +limited. +By default, the number of history entries is not limited. +If you try to set history-size to a non-numeric value, +the maximum number of history entries will be set to 500. +

+
+
horizontal-scroll-mode
+

Setting this variable to ‘on’ means that the text of the lines +being edited will scroll horizontally on a single screen line when +the lines are longer than the width of the screen, instead of wrapping +onto a new screen line. +This variable is automatically set to ‘on’ for terminals of height 1. +By default, this variable is set to ‘off’. +

+
+
+input-meta
+

If set to ‘on’, Readline enables eight-bit input (that is, it +does not clear the eighth bit in the characters it reads), +regardless of what the terminal claims it can support. +The default value is ‘off’, but Readline sets it to ‘on’ +if the locale contains characters whose encodings may include bytes +with the eighth bit set. +This variable is dependent on the LC_CTYPE locale category, and +its value may change if the locale changes. +The name meta-flag is a synonym for input-meta. +

+
+
isearch-terminators
+

The string of characters that should terminate an incremental search without +subsequently executing the character as a command (see Searching for Commands in the History). +If this variable has not been given a value, the characters ESC and +C-j terminate an incremental search. +

+
+
keymap
+

Sets Readline’s idea of the current keymap for key binding commands. +Built-in keymap names are +emacs, +emacs-standard, +emacs-meta, +emacs-ctlx, +vi, +vi-move, +vi-command, and +vi-insert. +vi is equivalent to vi-command (vi-move is also a +synonym); emacs is equivalent to emacs-standard. +Applications may add additional names. +The default value is emacs; +the value of the editing-mode variable also affects the +default keymap. +

+
+
keyseq-timeout
+

Specifies the duration Readline will wait for a character when +reading an ambiguous key sequence +(one that can form a complete key sequence using the input read so far, +or can take additional input to complete a longer key sequence). +If Readline doesn’t receive any input within the timeout, it uses the +shorter but complete key sequence. +Readline uses this value to determine whether or not input is +available on the current input source (rl_instream by default). +The value is specified in milliseconds, so a value of 1000 means that +Readline will wait one second for additional input. +If this variable is set to a value less than or equal to zero, or to a +non-numeric value, Readline waits until another key is pressed to +decide which key sequence to complete. +The default value is 500. +

+
+
mark-directories
+

If set to ‘on’, completed directory names have a slash appended. +The default is ‘on’. +

+
+
mark-modified-lines
+

When this variable is set to ‘on’, Readline displays an +asterisk (‘*’) at the start of history lines which have been modified. +This variable is ‘off’ by default. +

+
+
mark-symlinked-directories
+

If set to ‘on’, completed names which are symbolic links to directories +have a slash appended, subject to the value of mark-directories. +The default is ‘off’. +

+
+
match-hidden-files
+

This variable, when set to ‘on’, forces Readline to match files whose +names begin with a ‘.’ (hidden files) when performing filename +completion. +If set to ‘off’, the user must include the leading ‘.’ +in the filename to be completed. +This variable is ‘on’ by default. +

+
+
menu-complete-display-prefix
+

If set to ‘on’, menu completion displays the common prefix of the +list of possible completions (which may be empty) before cycling through +the list. +The default is ‘off’. +

+
+
output-meta
+

If set to ‘on’, Readline displays characters with the +eighth bit set directly rather than as a meta-prefixed escape +sequence. +The default is ‘off’, but Readline sets it to ‘on’ +if the locale contains characters whose encodings may include +bytes with the eighth bit set. +This variable is dependent on the LC_CTYPE locale category, and +its value may change if the locale changes. +

+
+
page-completions
+

If set to ‘on’, Readline uses an internal pager resembling +more(1) +to display a screenful of possible completions at a time. +This variable is ‘on’ by default. +

+
+
prefer-visible-bell
+

See bell-style. +

+
+
print-completions-horizontally
+

If set to ‘on’, Readline displays completions with matches +sorted horizontally in alphabetical order, rather than down the screen. +The default is ‘off’. +

+
+
revert-all-at-newline
+

If set to ‘on’, Readline will undo all changes to history lines +before returning when executing accept-line. +By default, +history lines may be modified and retain individual undo lists across +calls to readline(). +The default is ‘off’. +

+
+
search-ignore-case
+

If set to ‘on’, Readline performs incremental and non-incremental +history list searches in a case-insensitive fashion. +The default value is ‘off’. +

+
+
show-all-if-ambiguous
+

This alters the default behavior of the completion functions. +If set to ‘on’, +words which have more than one possible completion cause the +matches to be listed immediately instead of ringing the bell. +The default value is ‘off’. +

+
+
show-all-if-unmodified
+

This alters the default behavior of the completion functions in +a fashion similar to show-all-if-ambiguous. +If set to ‘on’, +words which have more than one possible completion without any +possible partial completion (the possible completions don’t share +a common prefix) cause the matches to be listed immediately instead +of ringing the bell. +The default value is ‘off’. +

+
+
show-mode-in-prompt
+

If set to ‘on’, add a string to the beginning of the prompt +indicating the editing mode: emacs, vi command, or vi insertion. +The mode strings are user-settable (e.g., emacs-mode-string). +The default value is ‘off’. +

+
+
skip-completed-text
+

If set to ‘on’, this alters the default completion behavior when +inserting a single match into the line. +It’s only active when performing completion in the middle of a word. +If enabled, Readline does not insert characters from the completion +that match characters after point in the word being completed, +so portions of the word following the cursor are not duplicated. +For instance, if this is enabled, attempting completion when the cursor +is after the first ‘e’ in ‘Makefile’ will result in +‘Makefile’ rather than ‘Makefilefile’, +assuming there is a single possible completion. +The default value is ‘off’. +

+
+
vi-cmd-mode-string
+

If the show-mode-in-prompt variable is enabled, +this string is displayed immediately before the last line of the primary +prompt when vi editing mode is active and in command mode. +The value is expanded like a key binding, so the standard set of +meta- and control- prefixes and backslash escape sequences is available. +The ‘\1’ and ‘\2’ escapes begin and end sequences of +non-printing characters, which can be used to embed a terminal control +sequence into the mode string. +The default is ‘(cmd)’. +

+
+
vi-ins-mode-string
+

If the show-mode-in-prompt variable is enabled, +this string is displayed immediately before the last line of the primary +prompt when vi editing mode is active and in insertion mode. +The value is expanded like a key binding, so the standard set of +meta- and control- prefixes and backslash escape sequences is available. +The ‘\1’ and ‘\2’ escapes begin and end sequences of +non-printing characters, which can be used to embed a terminal control +sequence into the mode string. +The default is ‘(ins)’. +

+
+
visible-stats
+

If set to ‘on’, a character denoting a file’s type +is appended to the filename when listing possible +completions. +The default is ‘off’. +

+
+
+ +
+
Key Bindings
+

The syntax for controlling key bindings in the init file is simple. +First you need to find the name of the command that you +want to change. +The following sections contain tables of the command +name, the default keybinding, if any, and a short description of what +the command does. +

+

Once you know the name of the command, simply place on a line +in the init file the name of the key +you wish to bind the command to, a colon, and then the name of the +command. +There can be no space between the key name and the colon – that will be +interpreted as part of the key name. +The name of the key can be expressed in different ways, depending on +what you find most comfortable. +

+

In addition to command names, Readline allows keys to be bound +to a string that is inserted when the key is pressed (a macro). +The difference between a macro and a command is that a macro is +enclosed in single or double quotes. +

+ +
+
keynamefunction-name or macro
+

keyname is the name of a key spelled out in English. +For example: +

+
Control-u: universal-argument
+Meta-Rubout: backward-kill-word
+Control-o: "> output"
+
+ +

In the example above, C-u is bound to the function +universal-argument, +M-DEL is bound to the function backward-kill-word, and +C-o is bound to run the macro +expressed on the right hand side (that is, to insert the text +‘> output’ into the line). +

+

This key binding syntax recognizes a number of symbolic character names: +DEL, +ESC, +ESCAPE, +LFD, +NEWLINE, +RET, +RETURN, +RUBOUT +(a destructive backspace), +SPACE, +SPC, +and +TAB. +

+
+
"keyseq": function-name or macro
+

keyseq differs from keyname above in that strings +denoting an entire key sequence can be specified, by placing +the key sequence in double quotes. +Some GNU Emacs style key escapes can be used, +as in the following example, but none of the +special character names are recognized. +

+
+
"\C-u": universal-argument
+"\C-x\C-r": re-read-init-file
+"\e[11~": "Function Key 1"
+
+ +

In the above example, C-u is again bound to the function +universal-argument (just as it was in the first example), +‘C-x C-r’ is bound to the function re-read-init-file, +and ‘ESC [ 1 1 ~’ is bound to insert +the text ‘Function Key 1’. +

+
+
+ +

The following GNU Emacs style escape sequences are available when +specifying key sequences: +

+
+
\C-
+

A control prefix. +

+
\M-
+

Adding the meta prefix or converting the following character to a meta +character, as described above under force-meta-prefix +(see Variable Settings in Readline Init File Syntax). +

+
\e
+

An escape character. +

+
\\
+

Backslash. +

+
\"
+

", a double quotation mark. +

+
\'
+

', a single quote or apostrophe. +

+
+ +

In addition to the GNU Emacs style escape sequences, a second +set of backslash escapes is available: +

+
+
\a
+

alert (bell) +

+
\b
+

backspace +

+
\d
+

delete +

+
\f
+

form feed +

+
\n
+

newline +

+
\r
+

carriage return +

+
\t
+

horizontal tab +

+
\v
+

vertical tab +

+
\nnn
+

The eight-bit character whose value is the octal value nnn +(one to three digits). +

+
\xHH
+

The eight-bit character whose value is the hexadecimal value HH +(one or two hex digits). +

+
+ +

When entering the text of a macro, single or double quotes must +be used to indicate a macro definition. +Unquoted text is assumed to be a function name. +The backslash escapes described above are expanded +in the macro body. +Backslash will quote any other character in the macro text, +including ‘"’ and ‘'’. +For example, the following binding will make ‘C-x \’ +insert a single ‘\’ into the line: +

+
"\C-x\\": "\\"
+
+ +
+
+ +
+
+
+ +

1.3.2 Conditional Init Constructs

+ +

Readline implements a facility similar in spirit to the conditional +compilation features of the C preprocessor which allows key +bindings and variable settings to be performed as the result +of tests. +There are four parser directives available. +

+
+
$if
+

The $if construct allows bindings to be made based on the +editing mode, the terminal being used, or the application using +Readline. +The text of the test, after any comparison operator, +extends to the end of the line; +unless otherwise noted, no characters are required to isolate it. +

+
+
mode
+

The mode= form of the $if directive is used to test +whether Readline is in emacs or vi mode. +This may be used in conjunction +with the ‘set keymap’ command, for instance, to set bindings in +the emacs-standard and emacs-ctlx keymaps only if +Readline is starting out in emacs mode. +

+
+
term
+

The term= form may be used to include terminal-specific +key bindings, perhaps to bind the key sequences output by the +terminal’s function keys. +The word on the right side of the +‘=’ +is tested against both the full name of the terminal and the portion +of the terminal name before the first ‘-’. +This allows xterm to match both xterm and +xterm-256color, for instance. +

+
+
version
+

The version test may be used to perform comparisons against +specific Readline versions. +The version expands to the current Readline version. +The set of comparison operators includes +‘=’ (and ‘==’), ‘!=’, ‘<=’, ‘>=’, ‘<’, +and ‘>’. +The version number supplied on the right side of the operator consists +of a major version number, an optional decimal point, and an optional +minor version (e.g., ‘7.1’). +If the minor version is omitted, it +defaults to ‘0’. +The operator may be separated from the string version and +from the version number argument by whitespace. +The following example sets a variable if the Readline version being used +is 7.0 or newer: +

+
$if version >= 7.0
+set show-mode-in-prompt on
+$endif
+
+ +
+
application
+

The application construct is used to include +application-specific settings. +Each program using the Readline +library sets the application name, and you can test for +a particular value. +This could be used to bind key sequences to functions useful for +a specific program. +For instance, the following command adds a +key sequence that quotes the current or previous word in Bash: +

+
$if Bash
+# Quote the current or previous word
+"\C-xq": "\eb\"\ef\""
+$endif
+
+ +
+
variable
+

The variable construct provides simple equality tests for Readline +variables and values. +The permitted comparison operators are ‘=’, ‘==’, and ‘!=’. +The variable name must be separated from the comparison operator by +whitespace; the operator may be separated from the value on the right hand +side by whitespace. +String and boolean variables may be tested. +Boolean variables must be +tested against the values on and off. +The following example is equivalent to the mode=emacs test described +above: +

+
$if editing-mode == emacs
+set show-mode-in-prompt on
+$endif
+
+
+
+ +
+
$else
+

Commands in this branch of the $if directive are executed if +the test fails. +

+
+
$endif
+

This command, as seen in the previous example, terminates an +$if command. +

+
+
$include
+

This directive takes a single filename as an argument and reads commands +and key bindings from that file. +For example, the following directive reads from /etc/inputrc: +

+
$include /etc/inputrc
+
+
+
+ +
+
+
+ +

1.3.3 Sample Init File

+ +

Here is an example of an inputrc file. This illustrates key +binding, variable assignment, and conditional syntax. +

+
+
# This file controls the behavior of line input editing for
+# programs that use the GNU Readline library.  Existing
+# programs include FTP, Bash, and GDB.
+#
+# You can re-read the inputrc file with C-x C-r.
+# Lines beginning with '#' are comments.
+#
+# First, include any system-wide bindings and variable
+# assignments from /etc/Inputrc
+$include /etc/Inputrc
+
+#
+# Set various bindings for emacs mode.
+
+set editing-mode emacs 
+
+$if mode=emacs
+
+Meta-Control-h:	backward-kill-word	Text after the function name is ignored
+
+#
+# Arrow keys in keypad mode
+#
+#"\M-OD":        backward-char
+#"\M-OC":        forward-char
+#"\M-OA":        previous-history
+#"\M-OB":        next-history
+#
+# Arrow keys in ANSI mode
+#
+"\M-[D":        backward-char
+"\M-[C":        forward-char
+"\M-[A":        previous-history
+"\M-[B":        next-history
+#
+# Arrow keys in 8 bit keypad mode
+#
+#"\M-\C-OD":       backward-char
+#"\M-\C-OC":       forward-char
+#"\M-\C-OA":       previous-history
+#"\M-\C-OB":       next-history
+#
+# Arrow keys in 8 bit ANSI mode
+#
+#"\M-\C-[D":       backward-char
+#"\M-\C-[C":       forward-char
+#"\M-\C-[A":       previous-history
+#"\M-\C-[B":       next-history
+
+C-q: quoted-insert
+
+$endif
+
+# An old-style binding.  This happens to be the default.
+TAB: complete
+
+# Macros that are convenient for shell interaction
+$if Bash
+# edit the path
+"\C-xp": "PATH=${PATH}\e\C-e\C-a\ef\C-f"
+# prepare to type a quoted word --
+# insert open and close double quotes
+# and move to just after the open quote
+"\C-x\"": "\"\"\C-b"
+# insert a backslash (testing backslash escapes
+# in sequences and macros)
+"\C-x\\": "\\"
+# Quote the current or previous word
+"\C-xq": "\eb\"\ef\""
+# Add a binding to refresh the line, which is unbound
+"\C-xr": redraw-current-line
+# Edit variable on current line.
+"\M-\C-v": "\C-a\C-k$\C-y\M-\C-e\C-a\C-y="
+$endif
+
+# use a visible bell if one is available
+set bell-style visible
+
+# don't strip characters to 7 bits when reading
+set input-meta on
+
+# allow iso-latin1 characters to be inserted rather
+# than converted to prefix-meta sequences
+set convert-meta off
+
+# display characters with the eighth bit set directly
+# rather than as meta-prefixed characters
+set output-meta on
+
+# if there are 150 or more possible completions for a word,
+# ask whether or not the user wants to see all of them
+set completion-query-items 150
+
+# For FTP
+$if Ftp
+"\C-xg": "get \M-?"
+"\C-xt": "put \M-?"
+"\M-.": yank-last-arg
+$endif
+
+ +
+
+
+
+ +

1.4 Bindable Readline Commands

+ + +

This section describes Readline commands that may be bound to key +sequences. +Command names without an accompanying key sequence are unbound by default. +

+

In the following descriptions, point refers to the current cursor +position, and mark refers to a cursor position saved by the +set-mark command. +The text between the point and mark is referred to as the region. +Readline +has the concept of an active region: +when the region is active, +Readline redisplay highlights the region using the +value of the +active-region-start-color +variable. +The enable-active-region variable turns this on and off. +Several commands set the region to active; those are noted below. +

+ +
+
+ +

1.4.1 Commands For Moving

+
+
beginning-of-line (C-a)
+

Move to the start of the current line. +This may also be bound to the Home key on some keyboards. +

+
+
end-of-line (C-e)
+

Move to the end of the line. +This may also be bound to the End key on some keyboards. +

+
+
forward-char (C-f)
+

Move forward a character. +This may also be bound to the right arrow key on some keyboards. +

+
+
backward-char (C-b)
+

Move back a character. +This may also be bound to the left arrow key on some keyboards. +

+
+
forward-word (M-f)
+

Move forward to the end of the next word. +Words are composed of letters and digits. +

+
+
backward-word (M-b)
+

Move back to the start of the current or previous word. +Words are composed of letters and digits. +

+ +
+
previous-screen-line ()
+

Attempt to move point to the same physical screen column on the previous +physical screen line. +This will not have the desired effect if the current +Readline line does not take up more than one physical line or if point is not +greater than the length of the prompt plus the screen width. +

+
+
next-screen-line ()
+

Attempt to move point to the same physical screen column on the next +physical screen line. +This will not have the desired effect if the current +Readline line does not take up more than one physical line or if the length +of the current Readline line is not greater than the length of the prompt +plus the screen width. +

+
+
clear-display (M-C-l)
+

Clear the screen and, if possible, the terminal’s scrollback buffer, +then redraw the current line, +leaving the current line at the top of the screen. +

+
+
clear-screen (C-l)
+

Clear the screen, +then redraw the current line, +leaving the current line at the top of the screen. +If given a numeric argument, this refreshes the current line +without clearing the screen. +

+
+
redraw-current-line ()
+

Refresh the current line. By default, this is unbound. +

+
+
+ +
+
+
+ +

1.4.2 Commands For Manipulating The History

+ +
+
accept-line (Newline or Return)
+

Accept the line regardless of where the cursor is. +If this line is non-empty, you can add it to the history list using +add_history(). +If this line is a modified history line, then restore the history line +to its original state. +

+
+
previous-history (C-p)
+

Move ‘back’ through the history list, fetching the previous command. +This may also be bound to the up arrow key on some keyboards. +

+
+
next-history (C-n)
+

Move ‘forward’ through the history list, fetching the next command. +This may also be bound to the down arrow key on some keyboards. +

+
+
beginning-of-history (M-<)
+

Move to the first line in the history. +

+
+
end-of-history (M->)
+

Move to the end of the input history, i.e., the line currently +being entered. +

+
+
reverse-search-history (C-r)
+

Search backward starting at the current line and moving ‘up’ through +the history as necessary. +This is an incremental search. +This command sets the region to the matched text and activates the region. +

+
+
forward-search-history (C-s)
+

Search forward starting at the current line and moving ‘down’ through +the history as necessary. +This is an incremental search. +This command sets the region to the matched text and activates the region. +

+
+
non-incremental-reverse-search-history (M-p)
+

Search backward starting at the current line and moving ‘up’ +through the history as necessary using a non-incremental search +for a string supplied by the user. +The search string may match anywhere in a history line. +

+
+
non-incremental-forward-search-history (M-n)
+

Search forward starting at the current line and moving ‘down’ +through the history as necessary using a non-incremental search +for a string supplied by the user. +The search string may match anywhere in a history line. +

+
+
history-search-backward ()
+

Search backward through the history for the string of characters +between the start of the current line and the point. +The search string must match at the beginning of a history line. +This is a non-incremental search. +By default, this command is unbound, but may be bound to the Page Down +key on some keyboards. +

+
+
history-search-forward ()
+

Search forward through the history for the string of characters +between the start of the current line and the point. +The search string must match at the beginning of a history line. +This is a non-incremental search. +By default, this command is unbound, but may be bound to the Page Up +key on some keyboards. +

+
+
history-substring-search-backward ()
+

Search backward through the history for the string of characters +between the start of the current line and the point. +The search string may match anywhere in a history line. +This is a non-incremental search. +By default, this command is unbound. +

+
+
history-substring-search-forward ()
+

Search forward through the history for the string of characters +between the start of the current line and the point. +The search string may match anywhere in a history line. +This is a non-incremental search. +By default, this command is unbound. +

+
+
yank-nth-arg (M-C-y)
+

Insert the first argument to the previous command (usually +the second word on the previous line) at point. +With an argument n, +insert the nth word from the previous command (the words +in the previous command begin with word 0). +A negative argument inserts the nth word from the end of +the previous command. +Once the argument n is computed, +this uses the history expansion facilities to extract the +nth word, as if the +‘!n’ history expansion had been specified. +

+
+
yank-last-arg (M-. or M-_)
+

Insert last argument to the previous command (the last word of the +previous history entry). +With a numeric argument, behave exactly like yank-nth-arg. +Successive calls to yank-last-arg move back through the history +list, inserting the last word (or the word specified by the argument to +the first call) of each line in turn. +Any numeric argument supplied to these successive calls determines +the direction to move through the history. +A negative argument switches the direction through the history +(back or forward). +This uses the history expansion facilities to extract the +last word, as if the +‘!$’ history expansion had been specified. +

+
+
operate-and-get-next (C-o)
+

Accept the current line for return to the calling application as if a +newline had been entered, +and fetch the next line relative to the current line from the history +for editing. +A numeric argument, if supplied, specifies the history entry +to use instead of the current line. +

+
+
fetch-history ()
+

With a numeric argument, fetch that entry from the history list +and make it the current line. +Without an argument, move back to the first entry in the history list. +

+
+
+ +
+
+
+ +

1.4.3 Commands For Changing Text

+ +
+
end-of-file (usually C-d)
+

The character indicating end-of-file as set, for example, by +stty. +If this character is read when there are no characters +on the line, and point is at the beginning of the line, Readline +interprets it as the end of input and returns EOF. +

+
+
delete-char (C-d)
+

Delete the character at point. +If this function is bound to the +same character as the tty EOF character, as C-d +commonly is, see above for the effects. +This may also be bound to the Delete key on some keyboards. +

+
+
backward-delete-char (Rubout)
+

Delete the character behind the cursor. +A numeric argument means +to kill the characters, saving them on the kill ring, +instead of deleting them. +

+
+
forward-backward-delete-char ()
+

Delete the character under the cursor, unless the cursor is at the +end of the line, in which case the character behind the cursor is +deleted. +By default, this is not bound to a key. +

+
+
quoted-insert (C-q or C-v)
+

Add the next character typed to the line verbatim. +This is how to insert key sequences like C-q, for example. +

+
+
tab-insert (M-TAB)
+

Insert a tab character. +

+
+
self-insert (a, b, A, 1, !, …)
+

Insert the character typed. +

+
+
bracketed-paste-begin ()
+

This function is intended to be bound to the "bracketed paste" escape +sequence sent by some terminals, and such a binding is assigned by default. +It allows Readline to insert the pasted text as a single unit without treating +each character as if it had been read from the keyboard. +The characters +are inserted as if each one was bound to self-insert instead of +executing any editing commands. +

+

Bracketed paste sets the region (the characters between point and the mark) +to the inserted text. +It sets the active region. +

+
+
transpose-chars (C-t)
+

Drag the character before the cursor forward over +the character at the cursor, moving the +cursor forward as well. +If the insertion point +is at the end of the line, then this +transposes the last two characters of the line. +Negative arguments have no effect. +

+
+
transpose-words (M-t)
+

Drag the word before point past the word after point, +moving point past that word as well. +If the insertion point is at the end of the line, this transposes +the last two words on the line. +

+ +
+
upcase-word (M-u)
+

Uppercase the current (or following) word. +With a negative argument, +uppercase the previous word, but do not move the cursor. +

+
+
downcase-word (M-l)
+

Lowercase the current (or following) word. +With a negative argument, +lowercase the previous word, but do not move the cursor. +

+
+
capitalize-word (M-c)
+

Capitalize the current (or following) word. +With a negative argument, +capitalize the previous word, but do not move the cursor. +

+
+
overwrite-mode ()
+

Toggle overwrite mode. +With an explicit positive numeric argument, switches to overwrite mode. +With an explicit non-positive numeric argument, switches to insert mode. +This command affects only emacs mode; +vi mode does overwrite differently. +Each call to readline() starts in insert mode. +

+

In overwrite mode, characters bound to self-insert replace +the text at point rather than pushing the text to the right. +Characters bound to backward-delete-char replace the character +before point with a space. +

+

By default, this command is unbound, but may be bound to the Insert +key on some keyboards. +

+
+
+ +
+
+
+ +

1.4.4 Killing And Yanking

+ +
+
kill-line (C-k)
+

Kill the text from point to the end of the current line. +With a negative numeric argument, kill backward from the cursor to the +beginning of the line. +

+
+
backward-kill-line (C-x Rubout)
+

Kill backward from the cursor to the beginning of the current line. +With a negative numeric argument, kill forward from the cursor to the +end of the line. +

+
+
unix-line-discard (C-u)
+

Kill backward from the cursor to the beginning of the current line. +

+
+
kill-whole-line ()
+

Kill all characters on the current line, no matter where point is. +By default, this is unbound. +

+
+
kill-word (M-d)
+

Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as forward-word. +

+
+
backward-kill-word (M-DEL)
+

Kill the word behind point. +Word boundaries are the same as backward-word. +

+ +
+
unix-word-rubout (C-w)
+

Kill the word behind point, using white space as a word boundary, +saving the killed text on the kill-ring. +

+
+
unix-filename-rubout ()
+

Kill the word behind point, using white space and the slash character +as the word boundaries, +saving the killed text on the kill-ring. +

+
+
delete-horizontal-space ()
+

Delete all spaces and tabs around point. +By default, this is unbound. +

+
+
kill-region ()
+

Kill the text in the current region. +By default, this command is unbound. +

+
+
copy-region-as-kill ()
+

Copy the text in the region to the kill buffer, so it can be yanked +right away. +By default, this command is unbound. +

+
+
copy-backward-word ()
+

Copy the word before point to the kill buffer. +The word boundaries are the same as backward-word. +By default, this command is unbound. +

+
+
copy-forward-word ()
+

Copy the word following point to the kill buffer. +The word boundaries are the same as forward-word. +By default, this command is unbound. +

+
+
yank (C-y)
+

Yank the top of the kill ring into the buffer at point. +

+
+
yank-pop (M-y)
+

Rotate the kill-ring, and yank the new top. +You can only do this if +the prior command is yank or yank-pop. +

+
+ +
+
+
+ +

1.4.5 Specifying Numeric Arguments

+
+
digit-argument (M-0, M-1, … M--)
+

Add this digit to the argument already accumulating, or start a new +argument. +M-- starts a negative argument. +

+
+
universal-argument ()
+

This is another way to specify an argument. +If this command is followed by one or more digits, optionally with a +leading minus sign, those digits define the argument. +If the command is followed by digits, executing universal-argument +again ends the numeric argument, but is otherwise ignored. +As a special case, if this command is immediately followed by a +character that is neither a digit nor minus sign, the argument count +for the next command is multiplied by four. +The argument count is initially one, so executing this function the +first time makes the argument count four, a second time makes the +argument count sixteen, and so on. +By default, this is not bound to a key. +

+
+ +
+
+
+ +

1.4.6 Letting Readline Type For You

+ +
+
complete (TAB)
+

Attempt to perform completion on the text before point. +The actual completion performed is application-specific. +The default is filename completion. +

+
+
possible-completions (M-?)
+

List the possible completions of the text before point. +When displaying completions, Readline sets the number of columns used +for display to the value of completion-display-width, the value of +the environment variable COLUMNS, or the screen width, in that order. +

+
+
insert-completions (M-*)
+

Insert all completions of the text before point that would have +been generated by possible-completions, +separated by a space. +

+
+
menu-complete ()
+

Similar to complete, but replaces the word to be completed +with a single match from the list of possible completions. +Repeatedly executing menu-complete steps through the list +of possible completions, inserting each match in turn. +At the end of the list of completions, +menu-complete rings the bell +(subject to the setting of bell-style) +and restores the original text. +An argument of n moves n positions forward in the list +of matches; a negative argument moves backward through the list. +This command is intended to be bound to TAB, but is unbound +by default. +

+
+
menu-complete-backward ()
+

Identical to menu-complete, but moves backward through the list +of possible completions, as if menu-complete had been given a +negative argument. +This command is unbound by default. +

+
+
export-completions ()
+

Perform completion on the word before point as described above +and write the list of possible completions to Readline’s output stream +using the following format, writing information on separate lines: +

+
    +
  • the number of matches N; +
  • the word being completed; +
  • S:E, +where S and E are the start and end offsets of the word +in the Readline line buffer; then +
  • each match, one per line +
+ +

If there are no matches, the first line will be “0”, +and this command does not print any output after the S:E. +If there is only a single match, this prints a single line containing it. +If there is more than one match, this prints the common prefix of the +matches, which may be empty, on the first line after the S:E, +then the matches on subsequent lines. +In this case, N will include the first line with the common prefix. +

+

The user or application +should be able to accommodate the possibility of a blank line. +The intent is that the user or application reads N lines after +the line containing S:E to obtain the match list. +This command is unbound by default. +

+
+
delete-char-or-list ()
+

Deletes the character under the cursor if not at the beginning or +end of the line (like delete-char). +At the end of the line, it behaves identically to possible-completions. +This command is unbound by default. +

+
+
+ +
+
+
+ +

1.4.7 Keyboard Macros

+
+
start-kbd-macro (C-x ()
+

Begin saving the characters typed into the current keyboard macro. +

+
+
end-kbd-macro (C-x ))
+

Stop saving the characters typed into the current keyboard macro +and save the definition. +

+
+
call-last-kbd-macro (C-x e)
+

Re-execute the last keyboard macro defined, by making the characters +in the macro appear as if typed at the keyboard. +

+
+
print-last-kbd-macro ()
+

Print the last keyboard macro defined in a format suitable for the +inputrc file. +

+
+
+ +
+
+
+ +

1.4.8 Some Miscellaneous Commands

+
+
re-read-init-file (C-x C-r)
+

Read in the contents of the inputrc file, and incorporate +any bindings or variable assignments found there. +

+
+
abort (C-g)
+

Abort the current editing command and +ring the terminal’s bell (subject to the setting of +bell-style). +

+
+
do-lowercase-version (M-A, M-B, M-x, …)
+

If the metafied character x is upper case, run the command +that is bound to the corresponding metafied lower case character. +The behavior is undefined if x is already lower case. +

+
+
prefix-meta (ESC)
+

Metafy the next character typed. +Typing ‘ESC f’ is equivalent to typing M-f. +

+
+
undo (C-_ or C-x C-u)
+

Incremental undo, separately remembered for each line. +

+
+
revert-line (M-r)
+

Undo all changes made to this line. +This is like executing the undo +command enough times to get back to the initial state. +

+
+
tilde-expand (M-~)
+

Perform tilde expansion on the current word. +

+
+
set-mark (C-@)
+

Set the mark to the point. +If a numeric argument is supplied, set the mark to that position. +

+
+
exchange-point-and-mark (C-x C-x)
+

Swap the point with the mark. +Set the current cursor position to the saved position, +then set the mark to the old cursor position. +

+
+
character-search (C-])
+

Read a character and move point to the next occurrence of that character. +A negative argument searches for previous occurrences. +

+
+
character-search-backward (M-C-])
+

Read a character and move point to the previous occurrence of that character. +A negative argument searches for subsequent occurrences. +

+
+
skip-csi-sequence ()
+

Read enough characters to consume a multi-key sequence such as those +defined for keys like Home and End. +CSI sequences begin with a Control Sequence Indicator (CSI), usually +ESC [. +If this sequence is bound to "\e[", +keys producing CSI sequences have no effect +unless explicitly bound to a Readline command, +instead of inserting stray characters into the editing buffer. +This is unbound by default, but usually bound to +ESC [. +

+
+
insert-comment (M-#)
+

Without a numeric argument, insert the value of the comment-begin +variable at the beginning of the current line. +If a numeric argument is supplied, this command acts as a toggle: if +the characters at the beginning of the line do not match the value +of comment-begin, insert the value; otherwise delete +the characters in comment-begin from the beginning of the line. +In either case, the line is accepted as if a newline had been typed. +

+
+
dump-functions ()
+

Print all of the functions and their key bindings +to the Readline output stream. +If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an inputrc file. +This command is unbound by default. +

+
+
dump-variables ()
+

Print all of the settable variables and their values +to the Readline output stream. +If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an inputrc file. +This command is unbound by default. +

+
+
dump-macros ()
+

Print all of the Readline key sequences bound to macros and the +strings they output +to the Readline output stream. +If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an inputrc file. +This command is unbound by default. +

+
+
execute-named-command (M-x)
+

Read a bindable Readline command name from the input and execute the +function to which it’s bound, as if the key sequence to which it was +bound appeared in the input. +If this function is supplied with a numeric argument, it passes that +argument to the function it executes. +

+ +
+
emacs-editing-mode (C-e)
+

When in vi command mode, this causes a switch to emacs +editing mode. +

+
+
vi-editing-mode (M-C-j)
+

When in emacs editing mode, this causes a switch to vi +editing mode. +

+ +
+
+ +
+
+
+
+ +

1.5 Readline vi Mode

+ +

While the Readline library does not have a full set of vi +editing functions, it does contain enough to allow simple editing +of the line. +The Readline vi mode behaves as specified in the +sh description in the POSIX standard. +

+

In order to switch interactively between emacs and vi +editing modes, use the command M-C-j (bound to emacs-editing-mode +when in vi mode and to vi-editing-mode in emacs mode). +The Readline default is emacs mode. +

+

When you enter a line in vi mode, you are already placed in +‘insertion’ mode, as if you had typed an ‘i’. Pressing ESC +switches you into ‘command’ mode, where you can edit the text of the +line with the standard vi movement keys, move to previous +history lines with ‘k’ and subsequent lines with ‘j’, and +so forth. +

+ + +
+
+
+
+ +

2 Programming with GNU Readline

+ +

This chapter describes the interface between the GNU Readline Library and +other programs. If you are a programmer, and you wish to include the +features found in GNU Readline +such as completion, line editing, and interactive history manipulation +in your own programs, this section is for you. +

+ + +
+
+ +

2.1 Basic Behavior

+ +

Many programs provide a command line interface, such as mail, +ftp, and sh. +For such programs, the default behavior of Readline is sufficient. +This section describes how to use Readline in +the simplest way possible, perhaps to replace calls in your code to +fgets(). +

+ + + +

The function readline() prints a prompt prompt +and then reads and returns a single line of text from the user. +Since it’s possible to enter characters into the line while quoting +them to disable any Readline editing function they might normally have, +this line may include embedded newlines and other special characters. +If prompt is NULL or the empty string, +readline() does not display a prompt. +The line readline() returns is allocated with malloc(); +the caller should free() the line when it has finished with it. +The declaration for readline in ANSI C is +

+
+
char *readline (const char *prompt);
+
+ +

So, one might say +

+
char *line = readline ("Enter a line: ");
+
+

in order to read a line of text from the user. +The line returned has the final newline removed, so only the +text remains. +This means that lines consisting of a newline return the empty string. +

+

If Readline encounters an EOF while reading the line, +and the line is empty at that point, +then readline() returns (char *)NULL. +Otherwise, the line is ended just as if a newline had been typed. +

+

Readline performs some expansion on the prompt before it is +displayed on the screen. +See the description of rl_expand_prompt +(see Redisplay) for additional details, especially if prompt +will contain characters that do not consume physical screen space when +displayed. +

+

If you want the user to be able to get at the line later, (with +C-p for example), you must call add_history() to save the +line away in a history list of such lines. +

+
+
add_history (line);
+
+ +

For full details on the GNU History Library, see the associated manual. +

+

It is preferable to avoid saving empty lines on the history list, since +users rarely have a burning need to reuse a blank line. +Here is a function which usefully replaces the standard gets() library +function, and has the advantage of no static buffer to overflow: +

+
+
/* A static variable for holding the line. */
+static char *line_read = (char *)NULL;
+
+/* Read a string, and return a pointer to it.
+   Returns NULL on EOF. */
+char *
+rl_gets ()
+{
+  /* If the buffer has already been allocated,
+     return the memory to the free pool. */
+  if (line_read)
+    {
+      free (line_read);
+      line_read = (char *)NULL;
+    }
+
+  /* Get a line from the user. */
+  line_read = readline ("");
+
+  /* If the line has any text in it,
+     save it on the history. */
+  if (line_read && *line_read)
+    add_history (line_read);
+
+  return (line_read);
+}
+
+ +

This function gives the user the default behavior of TAB +completion: filename completion. +If you do not want Readline to +complete filenames, you can change the binding of the TAB key +with rl_bind_key(). +

+
+
int rl_bind_key (int key, rl_command_func_t *function);
+
+ +

rl_bind_key() takes two arguments: key is the character that +you want to bind, and function is the address of the function to +call when key is pressed. +Binding TAB to rl_insert() makes TAB insert itself. +rl_bind_key() returns non-zero if key is not a valid +ASCII character code (between 0 and 255). +

+

Thus, to disable the default TAB behavior, the following suffices: +

+
rl_bind_key ('\t', rl_insert);
+
+ +

This code should be executed once at the start of your program; you +might write a function called initialize_readline() which +performs this and other desired initializations, such as installing +custom completers (see Custom Completers). +

+
+
+
+ +

2.2 Custom Functions

+ +

Readline provides many functions for manipulating the text of +the line, but it isn’t possible to anticipate the needs of all +programs. +This section describes the various functions and variables +defined within the Readline library which allow a program to add +customized functionality to Readline. +

+

Before declaring any functions that customize Readline’s behavior, or +using any functionality Readline provides in other code, an +application writer should include the file <readline/readline.h> +in any file that uses Readline’s features. +Since some of the definitions +in readline.h use the stdio library, the program +should include the file <stdio.h> +before readline.h. +

+

readline.h defines a C preprocessor variable that should +be treated as an integer, RL_READLINE_VERSION, which may +be used to conditionally compile application code depending on +the installed Readline version. +The value is a hexadecimal +encoding of the major and minor version numbers of the library, +of the form 0xMMmm. MM is the two-digit major +version number; mm is the two-digit minor version number. +For Readline 4.2, for example, the value of +RL_READLINE_VERSION would be 0x0402. +

+ + +
+
+ +

2.2.1 Readline Typedefs

+ +

For readability, we declare a number of new object types, all pointers +to functions. +

+

The reason for declaring these new types is to make it easier to write +code describing pointers to C functions with appropriately prototyped +arguments and return values. +

+

For instance, say we want to declare a variable func as a pointer +to a function which takes two int arguments and returns an +int (this is the type of all of the Readline bindable functions). +Instead of the classic C declaration +

+

int (*func)(); +

+

or the ANSI-C style declaration +

+

int (*func)(int, int); +

+

we may write +

+

rl_command_func_t *func; +

+

The full list of function pointer types available is +

+
+
typedef int rl_command_func_t (int, int);
+
typedef char *rl_compentry_func_t (const char *, int);
+
typedef char **rl_completion_func_t (const char *, int, int);
+
typedef char *rl_quote_func_t (char *, int, char *);
+
typedef char *rl_dequote_func_t (char *, int);
+
typedef int rl_compignore_func_t (char **);
+
typedef void rl_compdisp_func_t (char **, int, int);
+
typedef void rl_macro_print_func_t (const char *, const char *, int, const char *);
+
typedef int rl_hook_func_t (void);
+
typedef int rl_getc_func_t (FILE *);
+
typedef int rl_linebuf_func_t (char *, int);
+
typedef int rl_intfunc_t (int);
+
#define rl_ivoidfunc_t rl_hook_func_t
+
typedef int rl_icpfunc_t (char *);
+
typedef int rl_icppfunc_t (char **);
+
typedef void rl_voidfunc_t (void);
+
typedef void rl_vintfunc_t (int);
+
typedef void rl_vcpfunc_t (char *);
+
typedef void rl_vcppfunc_t (char **);
+
+ +

The rltypedefs.h file has more documentation for these types. +

+
+
+
+ +

2.2.2 Writing a New Function

+ +

In order to write new functions for Readline, you need to know the +calling conventions for keyboard-invoked functions, and the names of the +variables that describe the current state of the line read so far. +

+

The calling sequence for a command foo looks like +

+
+
int foo (int count, int key)
+
+ +

where count is the numeric argument (or 1 if defaulted) and +key is the key that invoked this function. +

+

It is completely up to the function as to what should be done with the +numeric argument. +Some functions use it as a repeat count, some +as a flag, and others to choose alternate behavior (refreshing the current +line as opposed to refreshing the screen, for example). +Some choose to ignore it. +In general, if a +function uses the numeric argument as a repeat count, it should be able +to do something useful with both negative and positive arguments. +At the very least, it should be aware that it can be passed a +negative argument. +

+

A command function should return 0 if its action completes successfully, +and a value greater than zero if some error occurs. +All of the builtin Readline bindable command functions +obey this convention. +

+
+
+
+
+ +

2.3 Readline Variables

+ +

These variables are available to function writers. +

+
+
Variable: char * rl_line_buffer
+

This is the line gathered so far. +You are welcome to modify the contents of the line, +but see Allowing Undoing. +The function rl_extend_line_buffer will increase +the memory allocated to rl_line_buffer. +

+ +
+
Variable: int rl_point
+

The offset of the current cursor position in rl_line_buffer +(the point). +

+ +
+
Variable: int rl_end
+

The number of characters present in rl_line_buffer. +When rl_point is at the end of the line, +rl_point and rl_end are equal. +

+ +
+
Variable: int rl_mark
+

The mark (saved position) in the current line. +If set, the mark and point define a region. +Some Readline commands set the mark as part of operating; +users can also set the mark explicitly. +

+ +
+
Variable: int rl_done
+

Setting this to a non-zero value causes Readline to return the current +line immediately. +Readline will set this variable when it has read a key sequence bound +to accept-line and is about to return the line to the caller. +

+ +
+
Variable: int rl_eof_found
+

Readline will set this variable when it has read an EOF character +(e.g., the stty ‘EOF’ character) on an empty line +or has encountered a read error or EOF and +is about to return a NULL line to the caller. +

+ +
+
Variable: int rl_num_chars_to_read
+

Setting this to a positive value before calling readline() causes +Readline to return after accepting that many characters, rather +than reading up to a character bound to accept-line. +

+ +
+
Variable: int rl_pending_input
+

Setting this to a value makes it the next keystroke read. +This is a way to stuff a single character into the input stream. +

+ +
+
Variable: int rl_dispatching
+

Set to a non-zero value if a function is being called from a key binding; +zero otherwise. +Application functions can test this to discover whether +they were called directly or by Readline’s dispatching mechanism. +

+ +
+
Variable: int rl_erase_empty_line
+

Setting this to a non-zero value causes Readline to completely erase +the current line, including any prompt, any time a newline is typed as +the only character on an otherwise-empty line. +This moves the cursor to the beginning of the newly-blank line. +

+ +
+
Variable: char * rl_prompt
+

The prompt Readline uses. +This is set from the argument to +readline(), and should not be assigned to directly. +The rl_set_prompt() function (see Redisplay) may +be used to modify the prompt string after calling readline(). +Readline performs some prompt expansions and analyzes the prompt for +line breaks, so rl_set_prompt() is preferred. +

+ +
+
Variable: char * rl_display_prompt
+

The string displayed as the prompt. +This is usually identical to +rl_prompt, but may be changed temporarily by functions that +use the prompt string as a message area, such as incremental search. +

+ +
+
Variable: int rl_already_prompted
+

If an application wishes to display the prompt itself, rather than have +Readline do it the first time readline() is called, it should set +this variable to a non-zero value after displaying the prompt. +The prompt must also be passed as the argument to readline() so +the redisplay functions can update the display properly. +The calling application is responsible for managing the value; Readline +never sets it. +

+ +
+
Variable: const char * rl_library_version
+

The version number of this revision of the Readline library, as a string +(e.g., "4.2"). +

+ +
+
Variable: int rl_readline_version
+

An integer encoding the current version of the library. +The encoding is of the form 0xMMmm, +where MM is the two-digit major version number, +and mm is the two-digit minor version number. +For example, for Readline-4.2, rl_readline_version would have the +value 0x0402. +

+ +
+
Variable: int rl_gnu_readline_p
+

Always set to 1, denoting that this is GNU Readline rather than some +emulation. +

+ +
+
Variable: const char * rl_terminal_name
+

The terminal type, used for initialization. +If not set by the application, +Readline sets this to the value of the TERM environment variable +the first time it is called. +Readline uses this to look up the terminal capabilities it needs in +the terminfo database. +

+ +
+
Variable: const char * rl_readline_name
+

This variable is set to a unique name by each application using Readline. +The value allows conditional parsing of the inputrc file +(see Conditional Init Constructs). +

+ +
+
Variable: FILE * rl_instream
+

The stdio stream from which Readline reads input. +If NULL, Readline defaults to stdin. +

+ +
+
Variable: FILE * rl_outstream
+

The stdio stream to which Readline performs output. +If NULL, Readline defaults to stdout. +

+ +
+
Variable: int rl_prefer_env_winsize
+

If non-zero, Readline gives values found in the LINES and +COLUMNS environment variables greater precedence than values fetched +from the kernel when computing the screen dimensions. +

+ +
+
Variable: rl_command_func_t * rl_last_func
+

The address of the last command function Readline executed. +This may be used to test whether or not a function is being executed +twice in succession, for example. +

+ +
+
Variable: rl_hook_func_t * rl_startup_hook
+

If non-zero, this is the address of a function to call just +before Readline prints the first prompt. +

+ +
+
Variable: rl_hook_func_t * rl_pre_input_hook
+

If non-zero, this is the address of a function to call after +the first prompt has been printed and just before Readline +starts reading input characters. +

+ +
+
Variable: rl_hook_func_t * rl_event_hook
+

If non-zero, this is the address of a function to call periodically +when Readline is waiting for terminal input. +By default, this will be called at most ten times a second if there +is no keyboard input. +

+ +
+
Variable: rl_getc_func_t * rl_getc_function
+

If non-zero, Readline will call indirectly through this pointer +to get a character from the input stream. +By default, it is set to rl_getc, the Readline character +input function (see Character Input). +In general, an application that sets rl_getc_function should consider +setting rl_input_available_hook as well. +

+ +
+
Variable: rl_hook_func_t * rl_signal_event_hook
+

If non-zero, this is the address of a function to call if a read system +call is interrupted by a signal when Readline is reading terminal input. +

+ +
+
Variable: rl_hook_func_t * rl_timeout_event_hook
+

If non-zero, this is the address of a function to call if Readline times +out while reading input. +

+ +
+
Variable: rl_hook_func_t * rl_input_available_hook
+

If non-zero, Readline will use this function’s return value when it needs +to determine whether or not there is available input on the current input +source. +The default hook checks rl_instream; if an application is using a +different input source, it should set the hook appropriately. +Readline queries for available input when implementing intra-key-sequence +timeouts during input and incremental searches. +This function must return zero if there is no input available, and non-zero +if input is available. +This may use an application-specific timeout before returning a value; +Readline uses the value passed to rl_set_keyboard_input_timeout() +or the value of the user-settable keyseq-timeout variable. +This is designed for use by applications using Readline’s callback interface +(see Alternate Interface), which may not use the traditional +read(2) and file descriptor interface, or other applications using +a different input mechanism. +If an application uses an input mechanism or hook that can potentially exceed +the value of keyseq-timeout, it should increase the timeout or set +this hook appropriately even when not using the callback interface. +In general, an application that sets rl_getc_function should consider +setting rl_input_available_hook as well. +

+ +
+
Variable: rl_voidfunc_t * rl_redisplay_function
+

Readline will call indirectly through this pointer +to update the display with the current contents of the editing buffer. +By default, it is set to rl_redisplay, the default Readline +redisplay function (see Redisplay). +

+ +
+
Variable: rl_vintfunc_t * rl_prep_term_function
+

If non-zero, Readline will call indirectly through this pointer +to initialize the terminal. +The function takes a single argument, an +int flag that says whether or not to use eight-bit characters. +By default, this is set to rl_prep_terminal +(see Terminal Management). +

+ +
+
Variable: rl_voidfunc_t * rl_deprep_term_function
+

If non-zero, Readline will call indirectly through this pointer +to reset the terminal. +This function should undo the effects of rl_prep_term_function. +By default, this is set to rl_deprep_terminal +(see Terminal Management). +

+ +
+
Variable: void rl_macro_display_hook
+

If set, this points to a function that rl_macro_dumper will call to +display a key sequence bound to a macro. +It is called with the key sequence, the "untranslated" macro value (i.e., +with backslash escapes included, as when passed to rl_macro_bind), +the readable argument passed to rl_macro_dumper, and any +prefix to display before the key sequence. +

+ +
+
Variable: Keymap rl_executing_keymap
+

This variable is set to the keymap (see Selecting a Keymap) in which the +currently executing Readline function was found. +

+ +
+
Variable: Keymap rl_binding_keymap
+

This variable is set to the keymap (see Selecting a Keymap) in which the +last key binding occurred. +

+ +
+
Variable: char * rl_executing_macro
+

This variable is set to the text of any currently-executing macro. +

+ +
+
Variable: int rl_executing_key
+

The key that caused the dispatch to the currently-executing Readline function. +

+ +
+
Variable: char * rl_executing_keyseq
+

The full key sequence that caused the dispatch to the currently-executing +Readline function. +

+ +
+
Variable: int rl_key_sequence_length
+

The number of characters in rl_executing_keyseq. +

+ +
+
Variable: int rl_readline_state
+

A variable with bit values that encapsulate the current Readline state. +A bit is set with the RL_SETSTATE macro, and unset with the +RL_UNSETSTATE macro. +Use the RL_ISSTATE macro to test whether a particular state +bit is set. +Current state bits include: +

+
+
RL_STATE_NONE
+

Readline has not yet been called, nor has it begun to initialize. +

+
RL_STATE_INITIALIZING
+

Readline is initializing its internal data structures. +

+
RL_STATE_INITIALIZED
+

Readline has completed its initialization. +

+
RL_STATE_TERMPREPPED
+

Readline has modified the terminal modes to do its own input and redisplay. +

+
RL_STATE_READCMD
+

Readline is reading a command from the keyboard. +

+
RL_STATE_METANEXT
+

Readline is reading more input after reading the meta-prefix character. +

+
RL_STATE_DISPATCHING
+

Readline is dispatching to a command. +

+
RL_STATE_MOREINPUT
+

Readline is reading more input while executing an editing command. +

+
RL_STATE_ISEARCH
+

Readline is performing an incremental history search. +

+
RL_STATE_NSEARCH
+

Readline is performing a non-incremental history search. +

+
RL_STATE_SEARCH
+

Readline is searching backward or forward through the history for a string. +

+
RL_STATE_NUMERICARG
+

Readline is reading a numeric argument. +

+
RL_STATE_MACROINPUT
+

Readline is currently getting its input from a previously-defined keyboard +macro. +

+
RL_STATE_MACRODEF
+

Readline is currently reading characters defining a keyboard macro. +

+
RL_STATE_OVERWRITE
+

Readline is in overwrite mode. +

+
RL_STATE_COMPLETING
+

Readline is performing word completion. +

+
RL_STATE_SIGHANDLER
+

Readline is currently executing the Readline signal handler. +

+
RL_STATE_UNDOING
+

Readline is performing an undo. +

+
RL_STATE_INPUTPENDING
+

Readline has input pending due to a call to rl_execute_next(). +

+
RL_STATE_TTYCSAVED
+

Readline has saved the values of the terminal’s special characters. +

+
RL_STATE_CALLBACK
+

Readline is currently using the alternate (callback) interface +(see Alternate Interface). +

+
RL_STATE_VIMOTION
+

Readline is reading the argument to a vi-mode "motion" command. +

+
RL_STATE_MULTIKEY
+

Readline is reading a multiple-keystroke command. +

+
RL_STATE_VICMDONCE
+

Readline has entered vi command (movement) mode at least one time during +the current call to readline(). +

+
RL_STATE_DONE
+

Readline has read a key sequence bound to accept-line +and is about to return the line to the caller. +

+
RL_STATE_TIMEOUT
+

Readline has timed out (it did not receive a line or specified number of +characters before the timeout duration specified by rl_set_timeout +elapsed) and is returning that status to the caller. +

+
RL_STATE_EOF
+

Readline has read an EOF character (e.g., the stty ‘EOF’ character) +or encountered a read error or EOF +and is about to return a NULL line to the caller. +

+
+ +
+ +
+
Variable: int rl_explicit_arg
+

Set to a non-zero value if an explicit numeric argument was specified by +the user. +It is only valid in a bindable command function. +

+ +
+
Variable: int rl_numeric_arg
+

Set to the value of any numeric argument explicitly specified by the user +before executing the current Readline function. +It is only valid in a bindable command function. +

+ +
+
Variable: int rl_editing_mode
+

Set to a value denoting Readline’s current editing mode. +A value of 1 means Readline is currently in emacs mode; +0 means that vi mode is active. +This determines the current keymap and key bindings. +

+ +
+
+
+ +

2.4 Readline Convenience Functions

+ + + +
+
+ +

2.4.1 Naming a Function

+ +

Readline has a descriptive +string name for every function a user can bind to a key sequence, +so users can dynamically change the bindings associated with key +sequences while using Readline, +using the descriptive name when referring to the function. +Thus, in an init file, one might find +

+
+
Meta-Rubout:	backward-kill-word
+
+ +

This binds the keystroke Meta-Rubout to the function +descriptively named backward-kill-word. +As the programmer, you +should bind the functions you write to descriptive names as well. +Readline provides a function for doing that: +

+
+
Function: int rl_add_defun (const char *name, rl_command_func_t *function, int key)
+

Add name to the list of named functions. +Make function be the function that gets called by key sequences +that bind to name. +If key is not -1, then bind it to +function using rl_bind_key(). +

+ +

Using this function alone is sufficient for most applications. +It is the recommended way to add a few functions to the default +functions that Readline has built in. +If you need to do something other than adding a function to Readline, +you may need to use the underlying functions described below. +

+
+
+
+ +

2.4.2 Selecting a Keymap

+ +

Key bindings take place on a keymap. +The keymap is the association between the keys that the user types and +the functions that get run. +You can make your own keymaps, copy existing keymaps, and tell +Readline which keymap to use. +

+
+
Function: Keymap rl_make_bare_keymap (void)
+

Returns a new, empty keymap. +The space for the keymap is allocated with +malloc(); the caller should free it by calling +rl_free_keymap() when done. +

+ +
+
Function: Keymap rl_copy_keymap (Keymap map)
+

Return a new keymap which is a copy of map. +

+ +
+
Function: Keymap rl_make_keymap (void)
+

Return a new keymap with the printing characters bound to rl_insert, +the lowercase Meta characters bound to run their equivalents, and +the Meta digits bound to produce numeric arguments. +

+ +
+
Function: void rl_discard_keymap (Keymap keymap)
+

Free the storage associated with the data in keymap. +The caller should free keymap. +

+ +
+
Function: void rl_free_keymap (Keymap keymap)
+

Free all storage associated with keymap. +This calls rl_discard_keymap to free subordinate +keymaps and macros. +

+ +
+
Function: int rl_empty_keymap (Keymap keymap)
+

Return non-zero if there are no keys bound to functions in keymap; +zero if there are any keys bound. +

+ +

Readline has several internal keymaps. +These functions allow you to change which keymap is active. +This is one way to switch editing modes, for example. +

+
+
Function: Keymap rl_get_keymap (void)
+

Returns the currently active keymap. +

+ +
+
Function: void rl_set_keymap (Keymap keymap)
+

Makes keymap the currently active keymap. +

+ +
+
Function: Keymap rl_get_keymap_by_name (const char *name)
+

Return the keymap matching name. +name is one which would be supplied in a +set keymap inputrc line (see Readline Init File). +

+ +
+
Function: char * rl_get_keymap_name (Keymap keymap)
+

Return the name matching keymap. +name is one which would be supplied in a +set keymap inputrc line (see Readline Init File). +

+ +
+
Function: int rl_set_keymap_name (const char *name, Keymap keymap)
+

Set the name of keymap. +This name will then be "registered" and +available for use in a set keymap inputrc directive +see Readline Init File). +The name may not be one of Readline’s builtin keymap names; +you may not add a different name for one of Readline’s builtin keymaps. +You may replace the name associated with a given keymap by calling this +function more than once with the same keymap argument. +You may associate a registered name with a new keymap by calling this +function more than once with the same name argument. +There is no way to remove a named keymap once the name has been +registered. +Readline will make a copy of name. +The return value is greater than zero unless name is one of +Readline’s builtin keymap names or keymap is one of Readline’s +builtin keymaps. +

+ +
+
+
+ +

2.4.3 Binding Keys

+ +

Key sequences are associated with functions through the keymap. +Readline has several internal keymaps: emacs_standard_keymap, +emacs_meta_keymap, emacs_ctlx_keymap, +vi_movement_keymap, and vi_insertion_keymap. +emacs_standard_keymap is the default, and the examples in +this manual assume that. +

+

Since readline() installs a set of default key bindings the first +time it is called, there is always the danger that a custom binding +installed before the first call to readline() will be overridden. +An alternate mechanism that can avoid this +is to install custom key bindings in an +initialization function assigned to the rl_startup_hook variable +(see Readline Variables). +

+

These functions manage key bindings. +

+
+
Function: int rl_bind_key (int key, rl_command_func_t *function)
+

Binds key to function in the currently active keymap. +Returns non-zero in the case of an invalid key. +

+ +
+
Function: int rl_bind_key_in_map (int key, rl_command_func_t *function, Keymap map)
+

Bind key to function in map. +Returns non-zero in the case of an invalid key. +

+ +
+
Function: int rl_bind_key_if_unbound (int key, rl_command_func_t *function)
+

Binds key to function if it is not already bound in the +currently active keymap. +Returns non-zero in the case of an invalid key or if key is +already bound. +

+ +
+
Function: int rl_bind_key_if_unbound_in_map (int key, rl_command_func_t *function, Keymap map)
+

Binds key to function if it is not already bound in map. +Returns non-zero in the case of an invalid key or if key is +already bound. +

+ +
+
Function: int rl_unbind_key (int key)
+

Bind key to the null function in the currently active keymap. +This is not the same as binding it to self-insert. +Returns non-zero in case of error. +

+ +
+
Function: int rl_unbind_key_in_map (int key, Keymap map)
+

Bind key to the null function in map. +This is not the same as binding it to self-insert. +Returns non-zero in case of error. +

+ +
+
Function: int rl_unbind_function_in_map (rl_command_func_t *function, Keymap map)
+

Unbind all keys that execute function in map. +

+ +
+
Function: int rl_unbind_command_in_map (const char *command, Keymap map)
+

Unbind all keys that are bound to command in map. +

+ +
+
Function: int rl_bind_keyseq (const char *keyseq, rl_command_func_t *function)
+

Bind the key sequence represented by the string keyseq to the function +function, beginning in the current keymap. +This makes new keymaps as necessary. +The return value is non-zero if keyseq is invalid. +

+ +
+
Function: int rl_bind_keyseq_in_map (const char *keyseq, rl_command_func_t *function, Keymap map)
+

Bind the key sequence represented by the string keyseq to the function +function in map. +This makes new keymaps as necessary. +Initial bindings are performed in map. +The return value is non-zero if keyseq is invalid. +

+ +
+
Function: int rl_set_key (const char *keyseq, rl_command_func_t *function, Keymap map)
+

Equivalent to rl_bind_keyseq_in_map. +

+ +
+
Function: int rl_bind_keyseq_if_unbound (const char *keyseq, rl_command_func_t *function)
+

Binds keyseq to function if it is not already bound in the +currently active keymap. +Returns non-zero in the case of an invalid keyseq or if keyseq is +already bound. +

+ +
+
Function: int rl_bind_keyseq_if_unbound_in_map (const char *keyseq, rl_command_func_t *function, Keymap map)
+

Binds keyseq to function if it is not already bound in map. +Returns non-zero in the case of an invalid keyseq or if keyseq is +already bound. +

+ +
+
Function: int rl_generic_bind (int type, const char *keyseq, char *data, Keymap map)
+

Bind the key sequence represented by the string keyseq to the arbitrary +pointer data. +type says what kind of data is pointed to by data; this can be +a function (ISFUNC), +a macro (ISMACR), +or a keymap (ISKMAP). +This makes new keymaps as necessary. +The initial keymap in which to do bindings is map. +Returns non-zero in the case of an invalid keyseq, zero otherwise. +

+ +
+
Function: int rl_parse_and_bind (char *line)
+

Parse line as if it had been read from the inputrc file and +perform any key bindings and variable assignments found +(see Readline Init File). +

+ +
+
Function: int rl_read_init_file (const char *filename)
+

Read keybindings and variable assignments from filename +(see Readline Init File). +

+ +
+
+
+ +

2.4.4 Associating Function Names and Bindings

+ +

These functions allow you to find out what keys invoke named functions +and the functions invoked by a particular key sequence. +You may also associate a new function name with an arbitrary function. +

+
+
Function: rl_command_func_t * rl_named_function (const char *name)
+

Return the function with name name. +name is a descriptive name users might use in a key binding. +

+ +
+
Function: rl_command_func_t * rl_function_of_keyseq (const char *keyseq, Keymap map, int *type)
+

Return the function invoked by keyseq in keymap map. +If map is NULL, this uses the current keymap. +If type is not NULL, this returns the type of the object +in the int variable it points to +(one of ISFUNC, ISKMAP, or ISMACR). +It takes a "translated" key sequence and should not be used +if the key sequence can include NUL. +

+ +
+
Function: rl_command_func_t * rl_function_of_keyseq_len (const char *keyseq, size_t len, Keymap map, int *type)
+

Return the function invoked by keyseq of length len +in keymap map. +Equivalent to rl_function_of_keyseq with the addition +of the len parameter. +It takes a "translated" key sequence and should be used +if the key sequence can include NUL. +

+ +
+
Function: int rl_trim_arg_from_keyseq (const char *keyseq, size_t len, Keymap map)
+

If there is a numeric argument at the beginning of keyseq, possibly +including digits, return the index of the first character in keyseq +following the numeric argument. +This can be used to skip over the numeric argument (which is available as +rl_numeric_arg) while traversing the key sequence that invoked the +current command. +

+ +
+
Function: char ** rl_invoking_keyseqs (rl_command_func_t *function)
+

Return an array of strings representing the key sequences used to +invoke function in the current keymap. +

+ +
+
Function: char ** rl_invoking_keyseqs_in_map (rl_command_func_t *function, Keymap map)
+

Return an array of strings representing the key sequences used to +invoke function in the keymap map. +

+ +
+
Function: void rl_print_keybinding (const char *name, Keymap map, int readable)
+

Print key sequences bound to Readline function name name in +keymap map. +If map is NULL, this uses the current keymap. +If readable is non-zero, +the list is formatted in such a way that it can be made part of an +inputrc file and re-read to recreate the key binding. +

+ +
+
Function: void rl_function_dumper (int readable)
+

Print the Readline function names and the key sequences currently +bound to them to rl_outstream. +If readable is non-zero, +the list is formatted in such a way that it can be made part of an +inputrc file and re-read. +

+ +
+
Function: void rl_list_funmap_names (void)
+

Print the names of all bindable Readline functions to rl_outstream. +

+ +
+
Function: const char ** rl_funmap_names (void)
+

Return a NULL terminated array of known function names. +The array is sorted. +The array itself is allocated, but not the strings inside. +You should free the array, but not the pointers, using free +or rl_free when you are done. +

+ +
+
Function: int rl_add_funmap_entry (const char *name, rl_command_func_t *function)
+

Add name to the list of bindable Readline command names, and make +function the function to be called when name is invoked. +This returns the index of the newly-added name in the array of +function names. +

+ +
+
+
+ +

2.4.5 Allowing Undoing

+ +

Supporting the undo command is a painless thing, and makes your +functions much more useful. +It is certainly easier to try something if you know you can undo it. +

+

If your function simply inserts text once, or deletes text once, +and uses rl_insert_text() or rl_delete_text() to do it, +then Readline does the undoing for you automatically. +

+

If you do multiple insertions or multiple deletions, or any combination +of these operations, you should group them together into one operation. +This is done with rl_begin_undo_group() and +rl_end_undo_group(). +

+

The types of events Readline can undo are: +

+
+
enum undo_code { UNDO_DELETE, UNDO_INSERT, UNDO_BEGIN, UNDO_END }; 
+
+ +

Notice that UNDO_DELETE means to insert some text, and +UNDO_INSERT means to delete some text. +That is, the undo code tells what to undo, not how to undo it. +UNDO_BEGIN and UNDO_END are tags +added by rl_begin_undo_group() and rl_end_undo_group(); +they are how Readline delimits groups of commands that should be +undone together. +

+
+
Function: int rl_begin_undo_group (void)
+

Begins saving undo information in a group construct. +The undo information usually comes from calls to rl_insert_text() +and rl_delete_text(), but could be the result of calls to +rl_add_undo(). +

+ +
+
Function: int rl_end_undo_group (void)
+

Closes the current undo group started with rl_begin_undo_group(). +There should be one call to rl_end_undo_group() +for each call to rl_begin_undo_group(). +

+ +
+
Function: void rl_add_undo (enum undo_code what, int start, int end, char *text)
+

Remember how to undo an event (according to what). +The affected text runs from start to end, +and encompasses text. +

+ +
+
Function: void rl_free_undo_list (void)
+

Free the existing undo list. +

+ +
+
Function: int rl_do_undo (void)
+

Undo the first thing on the undo list. +Returns 0 if there was nothing to undo, +non-zero if something was undone. +

+ +

Finally, if you neither insert nor delete text, but directly modify the +existing text (e.g., change its case), call rl_modifying() +once, just before you modify the text. +You must supply the indices of the text range that you are going to modify. +Readline will create an undo group for you. +

+
+
Function: int rl_modifying (int start, int end)
+

Tell Readline to save the text between start and end as a +single undo unit. +It is assumed that you will subsequently modify that text. +

+ +
+
+
+ +

2.4.6 Redisplay

+ +
+
Function: void rl_redisplay (void)
+

Change what’s displayed on the screen to reflect the current contents +of rl_line_buffer. +

+ +
+
Function: int rl_forced_update_display (void)
+

Force the line to be updated and redisplayed, whether or not +Readline thinks the screen display is correct. +

+ +
+
Function: int rl_on_new_line (void)
+

Tell the update functions that we have moved onto a new (empty) line, +usually after outputting a newline. +

+ +
+
Function: int rl_on_new_line_with_prompt (void)
+

Tell the update functions that we have moved onto a new line, with +rl_prompt already displayed. +This could be used by applications that want to output the prompt string +themselves, but still need Readline to know the prompt string length for +redisplay. +It should be used after setting rl_already_prompted. +

+ +
+
Function: int rl_clear_visible_line (void)
+

Clear the screen lines corresponding to the current line’s contents. +

+ +
+
Function: int rl_reset_line_state (void)
+

Reset the display state to a clean state and redisplay the current line +starting on a new line. +

+ +
+
Function: int rl_crlf (void)
+

Move the cursor to the start of the next screen line. +

+ +
+
Function: int rl_show_char (int c)
+

Display character c on rl_outstream. +If Readline has not been set to display meta characters directly, this +will convert meta characters to a meta-prefixed key sequence. +This is intended for use by applications which wish to do their own +redisplay. +

+ +
+
Function: int rl_message (const char *, …)
+

The arguments are a format string as would be supplied to printf, +possibly containing conversion specifications such as ‘%d’, and +any additional arguments necessary to satisfy the conversion specifications. +The resulting string is displayed in the echo area. +The echo area is also used to display numeric arguments and search strings. +You should call rl_save_prompt to save the prompt information +before calling this function. +

+ +
+
Function: int rl_clear_message (void)
+

Clear the message in the echo area. +If the prompt was saved with a call to +rl_save_prompt before the last call to rl_message, +you must call rl_restore_prompt before calling this function. +

+ +
+
Function: void rl_save_prompt (void)
+

Save the local Readline prompt display state in preparation for +displaying a new message in the message area with rl_message(). +

+ +
+
Function: void rl_restore_prompt (void)
+

Restore the local Readline prompt display state saved by the most +recent call to rl_save_prompt. +If you called rl_save_prompt to save the prompt before a call +to rl_message, you should call this function before the +corresponding call to rl_clear_message. +

+ +
+
Function: int rl_expand_prompt (char *prompt)
+

Expand any special character sequences in prompt and set up the +local Readline prompt redisplay variables. +This function is called by readline(). +It may also be called to +expand the primary prompt if the application uses the +rl_on_new_line_with_prompt() function or +rl_already_prompted variable. +It returns the number of visible characters on the last line of the +(possibly multi-line) prompt. +Applications may indicate that the prompt contains characters that take +up no physical screen space when displayed by bracketing a sequence of +such characters with the special markers RL_PROMPT_START_IGNORE +and RL_PROMPT_END_IGNORE (declared in readline.h as +‘\001’ and ‘\002’, respectively). +This may be used to embed terminal-specific escape sequences in prompts. +If you don’t use these indicators, redisplay will likely produce screen +contents that don’t match the line buffer. +

+ +
+
Function: int rl_set_prompt (const char *prompt)
+

Make Readline use prompt for subsequent redisplay. +This calls rl_expand_prompt() to expand the prompt +and sets rl_prompt to the result. +

+ +
+
+
+ +

2.4.7 Modifying Text

+ +
+
Function: int rl_insert_text (const char *text)
+

Insert text into the line at the current cursor position. +Returns the number of characters inserted. +

+ +
+
Function: int rl_delete_text (int start, int end)
+

Delete the text between start and end in the current line. +Returns the number of characters deleted. +

+ +
+
Function: char * rl_copy_text (int start, int end)
+

Return a copy of the text between start and end in +the current line. +

+ +
+
Function: int rl_kill_text (int start, int end)
+

Copy the text between start and end in the current line +to the kill ring, appending or prepending to the last kill if the +last command was a kill command. +This deletes the text from the line. +If start is less than end, the text is appended, +otherwise it is prepended. +If the last command was not a kill, this uses a new kill ring slot. +

+ +
+
Function: void rl_replace_line (const char *text, int clear_undo)
+

Replace the contents of rl_line_buffer with text. +This preserves the point and mark, if possible. +If clear_undo is non-zero, this clears the undo list associated +with the current line. +

+ +
+
Function: int rl_push_macro_input (char *macro)
+

Insert macro into the line, as if it had been invoked +by a key bound to a macro. +Not especially useful; use rl_insert_text() instead. +

+ +
+
+
+ +

2.4.8 Character Input

+ +
+
Function: int rl_read_key (void)
+

Return the next character available from Readline’s current input stream. +This handles input inserted into +the input stream via rl_pending_input (see Readline Variables) +and rl_stuff_char(), macros, and characters read from the keyboard. +While waiting for input, this function will call any function assigned to +the rl_event_hook variable. +

+ +
+
Function: int rl_getc (FILE *stream)
+

Return the next character available from stream, which is assumed to +be the keyboard. +

+ +
+
Function: int rl_stuff_char (int c)
+

Insert c into the Readline input stream. +It will be "read" before Readline attempts to read characters +from the terminal with rl_read_key(). +Applications can push back up to 512 characters. +rl_stuff_char returns 1 if the character was successfully inserted; +0 otherwise. +

+ +
+
Function: int rl_execute_next (int c)
+

Make c be the next command to be executed when rl_read_key() +is called. +This sets rl_pending_input. +

+ +
+
Function: int rl_clear_pending_input (void)
+

Unset rl_pending_input, effectively negating the effect of any +previous call to rl_execute_next(). +This works only if the pending input has not already been read +with rl_read_key(). +

+ +
+
Function: int rl_set_keyboard_input_timeout (int u)
+

While waiting for keyboard input in rl_read_key(), Readline will +wait for u microseconds for input before calling any function +assigned to rl_event_hook. +u must be greater than or equal +to zero (a zero-length timeout is equivalent to a poll). +The default waiting period is one-tenth of a second. +Returns the old timeout value. +

+ +
+
Function: int rl_set_timeout (unsigned int secs, unsigned int usecs)
+

Set a timeout for subsequent calls to readline(). +If Readline does not read a complete line, or the number of characters +specified by rl_num_chars_to_read, +before the duration specified by secs (in seconds) +and usecs (microseconds), it returns and sets +RL_STATE_TIMEOUT in rl_readline_state. +Passing 0 for secs and usecs cancels any previously set +timeout; the convenience macro rl_clear_timeout() is shorthand +for this. +Returns 0 if the timeout is set successfully. +

+ +
+
Function: int rl_timeout_remaining (unsigned int *secs, unsigned int *usecs)
+

Return the number of seconds and microseconds remaining in the current +timeout duration in *secs and *usecs, respectively. +Both *secs and *usecs must be non-NULL to return any values. +The return value is -1 on error or when there is no timeout set, +0 when the timeout has expired (leaving *secs and *usecs +unchanged), +and 1 if the timeout has not expired. +If either of secs and usecs is NULL, +the return value indicates whether the timeout has expired. +

+ +
+
+
+ +

2.4.9 Terminal Management

+ +
+
Function: void rl_prep_terminal (int meta_flag)
+

Modify the terminal settings for Readline’s use, so readline() +can read a single character at a time from the keyboard +and perform redisplay. +The meta_flag argument should be non-zero if Readline should +read eight-bit input. +

+ +
+
Function: void rl_deprep_terminal (void)
+

Undo the effects of rl_prep_terminal(), leaving the terminal in +the state in which it was before the most recent call to +rl_prep_terminal(). +

+ +
+
Function: void rl_tty_set_default_bindings (Keymap kmap)
+

Read the operating system’s terminal editing characters (as would be +displayed by stty) to their Readline equivalents. +The bindings are performed in kmap. +

+ +
+
Function: void rl_tty_unset_default_bindings (Keymap kmap)
+

Reset the bindings manipulated by rl_tty_set_default_bindings so +that the terminal editing characters are bound to rl_insert. +The bindings are performed in kmap. +

+ +
+
Function: int rl_tty_set_echoing (int value)
+

Set Readline’s idea of whether or not it is +echoing output to its output stream (rl_outstream). +If value is 0, +Readline does not display output to rl_outstream; any other +value enables output. +The initial value is set when Readline initializes the terminal settings. +This function returns the previous value. +

+ +
+
Function: int rl_reset_terminal (const char *terminal_name)
+

Reinitialize Readline’s idea of the terminal settings using +terminal_name as the terminal type (e.g., xterm). +If terminal_name is NULL, Readline uses the value of the +TERM environment variable. +

+ +
+
+
+ +

2.4.10 Utility Functions

+ +
+
Function: int rl_save_state (struct readline_state *sp)
+

Save a snapshot of Readline’s internal state to sp. +The contents of the readline_state structure are +documented in readline.h. +The caller is responsible for allocating the structure. +

+ +
+
Function: int rl_restore_state (struct readline_state *sp)
+

Restore Readline’s internal state to that stored in sp, +which must have been saved by a call to rl_save_state. +The contents of the readline_state structure are documented in +readline.h. +The caller is responsible for freeing the structure. +

+ +
+
Function: void rl_free (void *mem)
+

Deallocate the memory pointed to by mem. +mem must have been allocated by malloc. +

+ +
+
Function: void rl_extend_line_buffer (int len)
+

Ensure that rl_line_buffer has enough space to hold len +characters, reallocating it if necessary. +

+ +
+
Function: int rl_initialize (void)
+

Initialize or re-initialize Readline’s internal state. +It’s not strictly necessary to call this; +readline() calls it before reading any input. +

+ +
+
Function: int rl_ding (void)
+

Ring the terminal bell, obeying the setting of bell-style. +

+ +
+
Function: int rl_alphabetic (int c)
+

Return 1 if c is an alphabetic character. +

+ +
+
Function: void rl_display_match_list (char **matches, int len, int max)
+

A convenience function for displaying a list of strings in +columnar format on Readline’s output stream. +matches is the list of strings, in argv format, +such as a list of completion matches. +len is the number of strings in matches, and max +is the length of the longest string in matches. +This function uses the setting of print-completions-horizontally +to select how the matches are displayed (see Readline Init File Syntax). +When displaying completions, this function sets the number of columns used +for display to the value of completion-display-width, the value of +the environment variable COLUMNS, or the screen width, in that order. +

+ +

The following are implemented as macros, defined in chardefs.h. +Applications should refrain from using them. +

+
+
Function: int _rl_uppercase_p (int c)
+

Return 1 if c is an uppercase alphabetic character. +

+ +
+
Function: int _rl_lowercase_p (int c)
+

Return 1 if c is a lowercase alphabetic character. +

+ +
+
Function: int _rl_digit_p (int c)
+

Return 1 if c is a numeric character. +

+ +
+
Function: int _rl_to_upper (int c)
+

If c is a lowercase alphabetic character, return the corresponding +uppercase character. +

+ +
+
Function: int _rl_to_lower (int c)
+

If c is an uppercase alphabetic character, return the corresponding +lowercase character. +

+ +
+
Function: int _rl_digit_value (int c)
+

If c is a number, return the value it represents. +

+ +
+
+
+ +

2.4.11 Miscellaneous Functions

+ +
+
Function: int rl_macro_bind (const char *keyseq, const char *macro, Keymap map)
+

Bind the key sequence keyseq to invoke the macro macro. +The binding is performed in map. +When keyseq is invoked, the macro will be inserted into the line. +This function is deprecated; use rl_generic_bind instead. +

+ +
+
Function: void rl_macro_dumper (int readable)
+

Print the key sequences bound to macros and their values, using +the current keymap, to rl_outstream. +If the application has assigned a value to rl_macro_display_hook, +rl_macro_dumper calls it instead of printing anything. +If readable is greater than zero, the list is formatted in such a way +that it can be made part of an inputrc file and re-read. +

+ +
+
Function: int rl_variable_bind (const char *variable, const char *value)
+

Make the Readline variable variable have value. +This behaves as if the Readline command +‘set variable value’ had been executed in an inputrc +file (see Readline Init File Syntax) +or by rl_parse_and_bind. +

+ +
+
Function: char * rl_variable_value (const char *variable)
+

Return a string representing the value of the Readline variable variable. +For boolean variables, this string is either ‘on’ or ‘off’. +

+ +
+
Function: void rl_variable_dumper (int readable)
+

Print the Readline variable names and their current values +to rl_outstream. +If readable is non-zero, the list is formatted in such a way +that it can be made part of an inputrc file and re-read. +

+ +
+ +

Set the time interval (in microseconds) that Readline waits when showing +a balancing character when blink-matching-paren has been enabled. +

+ +
+
Function: char * rl_get_termcap (const char *cap)
+

Retrieve the string value of the termcap capability cap. +Readline fetches the termcap entry for the current terminal name and +uses those capabilities to move around the screen line and perform other +terminal-specific operations, like erasing a line. +Readline does not fetch or use all of a terminal’s capabilities, +and this function will return +values for only those capabilities Readline fetches. +

+ +
+
Function: void rl_reparse_colors (void)
+

Read or re-read color definitions from LS_COLORS. +

+ +
+
Function: void rl_clear_history (void)
+

Clear the history list by deleting all of the entries, in the same manner +as the History library’s clear_history() function. +This differs from clear_history because it frees private data +Readline saves in the history list. +

+ +
+
Function: void rl_activate_mark (void)
+

Enable an active region. +When this is enabled, the text between point and mark (the region) is +displayed using the color specified by the value of the +active-region-start-color variable (a face). +The default face is the terminal’s standout mode. +This is called by various Readline functions that set the mark and insert +text, and is available for applications to call. +

+ +
+
Function: void rl_deactivate_mark (void)
+

Turn off the active region. +

+ +
+
Function: void rl_keep_mark_active (void)
+

Indicate that the mark should remain active when the current Readline +function completes and after redisplay occurs. +In most cases, the mark remains active for only the duration of a single +bindable Readline function. +

+ +
+
Function: int rl_mark_active_p (void)
+

Return a non-zero value if the mark is currently active; zero otherwise. +

+ +
+
+
+ +

2.4.12 Alternate Interface

+ +

For applications that need more granular control than +plain readline() provides, there is +an alternate interface. +Some applications need to interleave keyboard I/O with file, device, +or window system I/O, typically by using a main loop to select() +on various file descriptors. +To accommodate this use case, Readline can +also be invoked as a ‘callback’ function from an event loop. +There are functions available to make this easy. +

+
+
Function: void rl_callback_handler_install (const char *prompt, rl_vcpfunc_t *line_handler)
+

Set up the terminal for Readline I/O and display the initial +expanded value of prompt. +Save the value of line_handler to +use as a handler function to call when a complete line of input has been +entered. +The handler function receives the text of the line as an argument. +As with readline(), the handler function should free the +line when it it finished with it. +

+ +
+
Function: void rl_callback_read_char (void)
+

Whenever an application determines that keyboard input is available, it +should call rl_callback_read_char(), which will read the next +character from the current input source. +If that character completes the line, rl_callback_read_char will +invoke the line_handler function installed by +rl_callback_handler_install to process the line. +Before calling the line_handler function, Readline resets +the terminal settings to the values they had before calling +rl_callback_handler_install. +If the line_handler function returns, +and the line handler remains installed, +Readline modifies the terminal settings for its use again. +EOF is indicated by calling line_handler with a +NULL line. +

+ +
+
Function: void rl_callback_sigcleanup (void)
+

Clean up any internal state the callback interface uses to maintain state +between calls to rl_callback_read_char (e.g., the state of any active +incremental searches). +This is intended to be used by applications that +wish to perform their own signal handling; +Readline’s internal signal handler calls this when appropriate. +

+ +
+
Function: void rl_callback_handler_remove (void)
+

Restore the terminal to its initial state and remove the line handler. +You may call this function from within a callback as well as independently. +If the line_handler installed by rl_callback_handler_install +does not exit the program, your program should call +either this function or the function referred +to by the value of rl_deprep_term_function +before the program exits to reset the terminal settings. +

+ +
+
+
+ +

2.4.13 A Readline Example

+ +

Here is a function which changes lowercase characters to their uppercase +equivalents, and uppercase characters to lowercase. +If this function was bound to ‘M-c’, then typing ‘M-c’ would +change the case of the character under point. +Typing ‘M-1 0 M-c’ would change the case +of the following 10 characters, leaving the cursor on +the last character changed. +

+
+
/* Invert the case of the COUNT following characters. */
+int
+invert_case_line (count, key)
+     int count, key;
+{
+  int start, end, i;
+
+  start = rl_point;
+
+  if (rl_point >= rl_end)
+    return (0);
+
+  /* Find the end of the range to modify. */
+  end = start + count;
+
+  /* Force it to be within range. */
+  if (end > rl_end)
+    end = rl_end;
+  else if (end < 0)
+    end = 0;
+
+  if (start == end)
+    return (0);
+
+  /* For positive arguments, put point after the last changed character. For
+     negative arguments, put point before the last changed character. */
+  rl_point = end;
+
+  /* Swap start and end if we are moving backwards */
+  if (start > end)
+    {
+      int temp = start;
+      start = end;
+      end = temp;
+    }
+
+  /* Tell readline that we are modifying the line,
+     so it will save the undo information. */
+  rl_modifying (start, end);
+
+  for (i = start; i != end; i++)
+    {
+      if (_rl_uppercase_p (rl_line_buffer[i]))
+        rl_line_buffer[i] = _rl_to_lower (rl_line_buffer[i]);
+      else if (_rl_lowercase_p (rl_line_buffer[i]))
+        rl_line_buffer[i] = _rl_to_upper (rl_line_buffer[i]);
+    }
+
+  return (0);
+}
+
+ +
+
+
+ +

2.4.14 Alternate Interface Example

+ +

Here is a complete program that illustrates Readline’s alternate interface. +It reads lines from the terminal and displays them, providing the +standard history and TAB completion functions. +It understands the EOF character or "exit" to exit the program. +

+
+
/* Standard include files. stdio.h is required. */
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+/* Used for select(2) */
+#include <sys/types.h>
+#include <sys/select.h>
+
+#include <signal.h>
+
+#include <errno.h>
+#include <stdio.h>
+
+#include <locale.h>
+
+/* Standard readline include files. */
+#include <readline/readline.h>
+#include <readline/history.h>
+
+#if !defined (errno)
+extern int errno;
+#endif
+
+static void cb_linehandler (char *);
+static void sighandler (int);
+
+int running;
+int sigwinch_received;
+const char *prompt = "rltest$ ";
+
+/* Handle SIGWINCH and window size changes when readline is not active and
+   reading a character. */
+static void
+sighandler (int sig)
+{
+  sigwinch_received = 1;
+}
+
+/* Callback function called for each line when accept-line executed, EOF
+   seen, or EOF character read.  This sets a flag and returns; it could
+   also call exit(3). */
+static void
+cb_linehandler (char *line)
+{
+  /* Can use ^D (stty eof) or `exit' to exit. */
+  if (line == NULL || strcmp (line, "exit") == 0)
+    {
+      if (line == 0)
+        printf ("\n");
+      printf ("exit\n");
+      /* This function needs to be called to reset the terminal settings,
+         and calling it from the line handler keeps one extra prompt from
+         being displayed. */
+      rl_callback_handler_remove ();
+
+      running = 0;
+    }
+  else
+    {
+      if (*line)
+        add_history (line);
+      printf ("input line: %s\n", line);
+      free (line);
+    }
+}
+
+int
+main (int c, char **v)
+{
+  fd_set fds;
+  int r;
+
+  /* Set the default locale values according to environment variables. */
+  setlocale (LC_ALL, "");
+
+  /* Handle window size changes when readline is not active and reading
+     characters. */
+  signal (SIGWINCH, sighandler);
+
+  /* Install the line handler. */
+  rl_callback_handler_install (prompt, cb_linehandler);
+
+  /* Enter a simple event loop.  This waits until something is available
+     to read on readline's input stream (defaults to standard input) and
+     calls the builtin character read callback to read it.  It does not
+     have to modify the user's terminal settings. */
+  running = 1;
+  while (running)
+    {
+      FD_ZERO (&fds);
+      FD_SET (fileno (rl_instream), &fds);
+
+      r = select (FD_SETSIZE, &fds, NULL, NULL, NULL);
+      if (r < 0 && errno != EINTR)
+        {
+          perror ("rltest: select");
+          rl_callback_handler_remove ();
+          break;
+        }
+      if (sigwinch_received)
+	{
+	  rl_resize_terminal ();
+	  sigwinch_received = 0;
+	}
+      if (r < 0)
+	continue;     
+
+      if (FD_ISSET (fileno (rl_instream), &fds))
+        rl_callback_read_char ();
+    }
+
+  printf ("rltest: Event loop has exited\n");
+  return 0;
+}
+
+ +
+
+
+
+ +

2.5 Readline Signal Handling

+ +

Signals are asynchronous events sent to a process by the Unix kernel, +sometimes on behalf of another process. +They are intended to indicate exceptional events, +like a user pressing the terminal’s interrupt key, +or a network connection being broken. +There is a class of signals that can +be sent to the process currently reading input from the keyboard. +Since Readline changes the terminal attributes when it is called, it needs +to perform special processing when such a signal is received in order to +restore the terminal to a sane state, or provide applications using +Readline with functions to do so manually. +

+

Readline contains an internal signal handler that is installed for a +number of signals (SIGINT, SIGQUIT, SIGTERM, +SIGHUP, +SIGALRM, SIGTSTP, SIGTTIN, and SIGTTOU). +When Readline receives one of these signals, the signal handler +will reset the terminal attributes to those that were in effect before +readline() was called, reset the signal handling to what it was +before readline() was called, and resend the signal to the calling +application. +If and when the calling application’s signal handler returns, Readline +will reinitialize the terminal and continue to accept input. +When a SIGINT is received, the Readline signal handler performs +some additional work, which will cause any partially-entered line to be +aborted (see the description of rl_free_line_state() below). +

+

There is an additional Readline signal handler, for SIGWINCH, which +the kernel sends to a process whenever the terminal’s size changes (for +example, if a user resizes an xterm). +The Readline SIGWINCH handler updates +Readline’s internal screen size information, and then calls any +SIGWINCH signal handler the calling application has installed. +Readline calls the application’s SIGWINCH signal handler without +resetting the terminal to its original state. +If the application’s signal +handler does more than update its idea of the terminal size and return +(for example, a longjmp back to a main processing loop), +it must call rl_cleanup_after_signal() (described below), +to restore the terminal state. +

+

When an application is using the callback interface +(see Alternate Interface), Readline installs signal handlers only for +the duration of the call to rl_callback_read_char. +Applications using the callback interface should be prepared +to clean up Readline’s state if they wish to handle the signal +before the line handler completes and restores the terminal state. +

+

If an application using the callback interface wishes to have Readline +install its signal handlers at the time the application calls +rl_callback_handler_install and remove them only when a complete +line of input has been read, it should set the +rl_persistent_signal_handlers variable to a non-zero value. +This allows an application to defer all of the handling of the signals +Readline catches to Readline. +Applications should use this variable with care; it can result in Readline +catching signals and not acting on them (or allowing the application to react +to them) until the application calls rl_callback_read_char. +This can result in an application becoming less responsive to keyboard +signals like SIGINT. +If an application does not want or need to perform any signal handling, or +does not need to do any processing +between calls to rl_callback_read_char, +setting this variable may be appropriate. +

+

Readline provides two variables that allow application writers to +control whether or not it will catch certain signals and act on them +when they are received. +It is important that applications change the +values of these variables only when calling readline(), +not in a signal handler, so Readline’s internal signal state +is not corrupted. +

+
+
Variable: int rl_catch_signals
+

If this variable is non-zero, Readline will install signal handlers for +SIGINT, SIGQUIT, SIGTERM, SIGHUP, SIGALRM, +SIGTSTP, SIGTTIN, and SIGTTOU. +

+

The default value of rl_catch_signals is 1. +

+ +
+
Variable: int rl_catch_sigwinch
+

If this variable is set to a non-zero value, +Readline will install a signal handler for SIGWINCH. +

+

The default value of rl_catch_sigwinch is 1. +

+ +
+
Variable: int rl_persistent_signal_handlers
+

If an application using the callback interface wishes Readline’s signal +handlers to be installed and active during the set of calls to +rl_callback_read_char that constitutes an entire single line, +it should set this variable to a non-zero value. +

+

The default value of rl_persistent_signal_handlers is 0. +

+ +
+
Variable: int rl_change_environment
+

If this variable is set to a non-zero value, +and Readline is handling SIGWINCH, Readline will modify the +LINES and COLUMNS environment variables upon receipt of a +SIGWINCH. +

+

The default value of rl_change_environment is 1. +

+ +

If an application does not wish to have Readline catch any signals, or +to handle signals other than those Readline catches (SIGHUP, +for example), +Readline provides convenience functions to do the necessary terminal +and internal state cleanup upon receipt of a signal. +

+
+
Function: int rl_pending_signal (void)
+

Return the signal number of the most recent signal Readline received but +has not yet handled, or 0 if there is no pending signal. +

+ +
+
Function: void rl_cleanup_after_signal (void)
+

This function will reset the state of the terminal to what it was before +readline() was called, and remove the Readline signal handlers for +all signals, depending on the values of rl_catch_signals and +rl_catch_sigwinch. +

+ +
+
Function: void rl_free_line_state (void)
+

This will free any partial state associated with the current input line +(undo information, any partial history entry, any partially-entered +keyboard macro, and any partially-entered numeric argument). +This should be called before rl_cleanup_after_signal(). +The Readline signal handler for SIGINT calls this to abort +the current input line. +

+ +
+
Function: void rl_reset_after_signal (void)
+

This will reinitialize the terminal and reinstall any Readline signal +handlers, depending on the values of rl_catch_signals and +rl_catch_sigwinch. +

+ +

If an application wants to force Readline to handle any signals that +have arrived while it has been executing, rl_check_signals() +will call Readline’s internal signal handler if there are any pending +signals. +This is primarily intended for those applications that use +a custom rl_getc_function (see Readline Variables) and wish +to handle signals received while waiting for input. +

+
+
Function: void rl_check_signals (void)
+

If there are any pending signals, call Readline’s internal signal +handling functions to process them. +rl_pending_signal() can be used independently +to determine whether or not there are any pending signals. +

+ +

If an application does not wish Readline to catch SIGWINCH, +it may call rl_resize_terminal() or rl_set_screen_size() +to force Readline to update its idea of the terminal size when it receives +a SIGWINCH. +

+
+
Function: void rl_echo_signal_char (int sig)
+

If an application wishes to install its own signal handlers, but still +have Readline display characters that generate signals, calling this +function with sig set to SIGINT, SIGQUIT, or +SIGTSTP will display the character generating that signal. +

+ +
+
Function: void rl_resize_terminal (void)
+

Update Readline’s internal screen size by reading values from the kernel. +

+ +
+
Function: void rl_set_screen_size (int rows, int cols)
+

Set Readline’s idea of the terminal size to rows rows and +cols columns. +If either rows or columns is less than or equal to 0, +Readline doesn’t change that terminal dimension. +This is intended to tell Readline the physical dimensions of the terminal, +and is used internally to calculate the maximum number of characters that +may appear on a single line and on the screen. +

+ +

If an application does not want to install a SIGWINCH handler, but +is still interested in the screen dimensions, it may query Readline’s idea +of the screen size. +

+
+
Function: void rl_get_screen_size (int *rows, int *cols)
+

Return Readline’s idea of the terminal’s size in the +variables pointed to by the arguments. +

+ +
+
Function: void rl_reset_screen_size (void)
+

Cause Readline to reobtain the screen size and recalculate its dimensions. +

+ +

The following functions install and remove Readline’s signal handlers. +

+
+
Function: int rl_set_signals (void)
+

Install Readline’s signal handler for SIGINT, SIGQUIT, +SIGTERM, SIGHUP, SIGALRM, SIGTSTP, SIGTTIN, +SIGTTOU, and SIGWINCH, depending on the values of +rl_catch_signals and rl_catch_sigwinch. +

+ +
+
Function: int rl_clear_signals (void)
+

Remove all of the Readline signal handlers installed by +rl_set_signals(). +

+ +
+
+
+ +

2.6 Custom Completers

+ + +

Typically, a program that reads commands from the user has a way of +disambiguating commands and data. +If your program is one of these, then +it can provide completion for commands, data, or both. +The following sections describe how your program and Readline +cooperate to provide this service. +

+ + +
+
+ +

2.6.1 How Completing Works

+ +

In order to complete some text, the full list of possible completions +must be available. +That is, it is not possible to accurately +expand a partial word without knowing all of the possible words +which make sense in that context. +The Readline library provides +the user interface to completion, and two of the most common +completion functions: filename and username. +For completing other types +of text, you must write your own completion function. +This section +describes exactly what such functions must do, and provides an example. +

+

There are three major functions used to perform completion: +

+
    +
  1. The user-interface function rl_complete(). +This function is called with the same arguments as other bindable +Readline functions: count and invoking_key. +It isolates the word to be completed and calls +rl_completion_matches() to generate a list of possible completions. +It then either lists the possible completions, inserts the possible +completions, or actually performs the +completion, depending on which behavior is desired. + +
  2. The internal function rl_completion_matches() uses an +application-supplied generator function to generate the list of +possible matches, and then returns the array of these matches. +The caller should place the address of its generator function in +rl_completion_entry_function. + +
  3. The generator function is called repeatedly from +rl_completion_matches(), returning a string each time. +The arguments to the generator function are text and state. +text is the partial word to be completed. +state is zero the first time the function is called, +allowing the generator to perform any necessary initialization, +and a positive integer for each subsequent call. +The generator function returns +(char *)NULL to inform rl_completion_matches() that there are +no more possibilities left. +Usually the generator function computes the +list of possible completions when state is zero, and returns them +one at a time on subsequent calls. +Each string the generator function +returns as a match must be allocated with malloc(); Readline +frees the strings when it has finished with them. +Such a generator function is referred to as an +application-specific completion function. + +
+ +
+
Function: int rl_complete (int ignore, int invoking_key)
+

Complete the word at or before point. +You have supplied the function that does the initial simple matching +selection algorithm (see rl_completion_matches()). +The default is to do filename completion. +

+ +
+
Variable: rl_compentry_func_t * rl_completion_entry_function
+

This is a pointer to the generator function for +rl_completion_matches(). +If the value of rl_completion_entry_function is +NULL then Readline uses the default filename generator +function, rl_filename_completion_function(). +An application-specific completion function is a function whose +address is assigned to rl_completion_entry_function and whose +return values are used to generate possible completions. +

+ +
+
+
+ +

2.6.2 Completion Functions

+ +

Here is the complete list of callable completion functions present in +Readline. +

+
+
Function: int rl_complete_internal (int what_to_do)
+

Complete the word at or before point. +what_to_do says what to do with the completion. +A value of ‘?’ means list the possible completions. +‘TAB’ means do standard completion. +‘*’ means insert all of the possible completions. +‘!’ means to display all of the possible completions, +if there is more than one, as well as performing partial completion. +‘@’ is similar to ‘!’, but does not list possible completions +if the possible completions share a common prefix. +

+ +
+
Function: int rl_complete (int ignore, int invoking_key)
+

Complete the word at or before point. +You have supplied the function that does the initial simple +matching selection algorithm (see rl_completion_matches() and +rl_completion_entry_function). +The default is to do filename completion. +This calls rl_complete_internal() with an +argument depending on invoking_key. +

+ +
+
Function: int rl_possible_completions (int count, int invoking_key)
+

List the possible completions. +See description of rl_complete(). +This calls rl_complete_internal() with an argument of ‘?’. +

+ +
+
Function: int rl_insert_completions (int count, int invoking_key)
+

Insert the list of possible completions into the line, deleting the +partially-completed word. +See description of rl_complete(). +This calls rl_complete_internal() with an argument of ‘*’. +

+ +
+
Function: int rl_completion_mode (rl_command_func_t *cfunc)
+

Returns the appropriate value to pass to rl_complete_internal() +depending on whether cfunc was called twice in succession and +the values of the show-all-if-ambiguous and +show-all-if-unmodified variables. +Application-specific completion functions may use this function to present +the same interface as rl_complete(). +

+ +
+
Function: char ** rl_completion_matches (const char *text, rl_compentry_func_t *entry_func)
+

Returns an array of strings which is a list of completions for text. +If there are no completions, returns NULL. +The first entry in the returned array is the substitution for text. +The remaining entries are the possible completions. +The array is terminated with a NULL pointer. +

+

entry_func is a function of two args, and returns a char *. +The first argument is text. +The second is a state argument; +it is zero on the first call, and non-zero on subsequent calls. +entry_func returns a NULL pointer to the caller +when there are no more matches. +

+ +
+
Function: char * rl_filename_completion_function (const char *text, int state)
+

A generator function for filename completion in the general case. +text is a partial filename. +The Bash source is a useful reference for writing application-specific +completion functions (the Bash completion functions call this and other +Readline functions). +

+ +
+
Function: char * rl_username_completion_function (const char *text, int state)
+

A completion generator for usernames. +text contains a partial username preceded by a +random character (usually ‘~’). +As with all completion generators, +state is zero on the first call and non-zero for subsequent calls. +

+ +
+
+
+ +

2.6.3 Completion Variables

+ +
+
Variable: rl_compentry_func_t * rl_completion_entry_function
+

A pointer to the generator function for rl_completion_matches(). +NULL means to use rl_filename_completion_function(), +the default filename completer. +

+ +
+
Variable: rl_completion_func_t * rl_attempted_completion_function
+

A pointer to an alternative function to create matches. +The function is called with text, start, and end. +start and end are indices in rl_line_buffer defining +the boundaries of text, which is a character string. +If this function exists and returns NULL, or if this variable is +set to NULL, then rl_complete() will call the value of +rl_completion_entry_function to generate matches, otherwise +completion will use the array of strings this function returns. +If this function sets the rl_attempted_completion_over +variable to a non-zero value, Readline will not perform its default +completion even if this function returns no matches. +

+ +
+
Variable: rl_quote_func_t * rl_filename_quoting_function
+

A pointer to a function that will quote a filename in an +application-specific fashion. +Readline calls this function during filename completion +if one of the characters in rl_filename_quote_characters +appears in a completed filename. +The function is called with +text, match_type, and quote_pointer. +The text is the filename to be quoted. +The match_type is either SINGLE_MATCH, +if there is only one completion match, or MULT_MATCH. +Some functions use this to decide whether or not to +insert a closing quote character. +The quote_pointer is a pointer +to any opening quote character the user typed. +Some functions choose to reset this character if they decide to quote +the filename in a different style. +It’s preferable to preserve the user’s quoting as much as possible – +it’s less disruptive. +

+ +
+
Variable: rl_dequote_func_t * rl_filename_dequoting_function
+

A pointer to a function that will remove application-specific quoting +characters from a filename before attempting completion, +so those characters do not interfere with matching the text against +names in the filesystem. +It is called with text, the text of the word +to be dequoted, and quote_char, which is the quoting character +that delimits the filename (usually ‘'’ or ‘"’). +If quote_char is zero, the filename was not in a quoted string. +

+ +
+
Variable: rl_linebuf_func_t * rl_char_is_quoted_p
+

A pointer to a function to call that determines whether or not a specific +character in the line buffer is quoted, according to whatever quoting +mechanism the application uses. +The function is called with two arguments: +text, the text of the line, +and index, the index of the character in the line. +It is used to decide whether a character found in +rl_completer_word_break_characters should be +used to break words for the completer. +

+ +
+
Variable: rl_compignore_func_t * rl_ignore_some_completions_function
+

Readline calls this function, if defined, when filename +completion is done, after all the matching names have been generated. +It is passed a NULL terminated array of matches. +The first element (matches[0]) is the maximal substring +common to all matches. +This function can re-arrange the list of matches as required, but +must free each element it deletes from the array. +

+ +
+
Variable: rl_icppfunc_t * rl_directory_completion_hook
+

This function, if defined, is allowed to modify the directory portion +of filenames during completion. +It could be used to expand symbolic links or shell variables in pathnames. +It is called with the address of a string (the current directory name) as an +argument, and may modify that string. +If the function replaces the string with a new string, it +should free the old value. +Any modified directory name should have a trailing slash. +The modified value will be used as part of the completion, replacing +the directory portion of the pathname the user typed. +At the least, even if no other expansion is performed, this function should +remove any quote characters from the directory name, because its result will +be passed directly to opendir(). +

+

The directory completion hook returns an integer that should be non-zero if +the function modifies its directory argument. +The function should not modify the directory argument if it returns 0. +

+ +
+
Variable: rl_icppfunc_t * rl_directory_rewrite_hook;
+

If non-zero, this is the address of a function to call when completing +a directory name. +This function takes the address of the directory name +to be modified as an argument. +Unlike rl_directory_completion_hook, +it only modifies the directory name used in opendir(), +not what Readline displays when it prints or inserts +the possible completions. +Readline calls this before rl_directory_completion_hook. +At the least, even if no other expansion is performed, this function should +remove any quote characters from the directory name, because its result will +be passed directly to opendir(). +

+

The directory rewrite hook returns an integer that should be non-zero if +the function modifies its directory argument. +The function should not modify the directory argument if it returns 0. +

+ +
+
Variable: rl_icppfunc_t * rl_filename_stat_hook
+

If non-zero, this is the address of a function for the completer to +call before deciding which character to append to a completed name. +This function modifies its filename name argument, and Readline passes +the modified value to stat() +to determine the file’s type and characteristics. +This function does not need to remove quote characters from the filename. +

+

The stat hook returns an integer that should be non-zero if +the function modifies its directory argument. +The function should not modify the directory argument if it returns 0. +

+ +
+
Variable: rl_dequote_func_t * rl_filename_rewrite_hook
+

If non-zero, this is the address of a function +for Readline to call when reading +directory entries from the filesystem for completion and comparing +them to the filename portion of the partial word being completed. +It modifies the filesystem entries, +as opposed to rl_completion_rewrite_hook, +which modifies the word being completed. +The function takes two arguments: +fname, the filename to be converted, +and fnlen, its length in bytes. +It must either return its first argument (if no conversion takes place) +or the converted filename in newly-allocated memory. +The function should perform any necessary application or system-specific +conversion on the filename, such as converting between character sets +or converting from a filesystem format to a character input format. +Readline compares the converted form against the word to be completed, +and, if it matches, adds it to the list of matches. +Readline will free the allocated string. +

+ +
+
Variable: rl_dequote_func_t * rl_completion_rewrite_hook
+

If non-zero, this is the address of a function +for Readline to call before +comparing the filename portion of a word to be completed with directory +entries from the filesystem. +It modifies the word being completed, +as opposed to rl_filename_rewrite_hook, +which modifies filesystem entries. +The function takes two arguments: +fname, the word to be converted, +after any rl_filename_dequoting_function has been applied, +and fnlen, its length in bytes. +It must either return its first argument (if no conversion takes place) +or the converted filename in newly-allocated memory. +The function should perform any necessary application or system-specific +conversion on the filename, such as converting between character sets or +converting from a character input format to some other format. +Readline compares the converted form against directory entries, after +their potential modification by rl_filename_rewrite_hook, +and adds any matches to the list of matches. +Readline will free the allocated string. +

+ +
+
Variable: rl_compdisp_func_t * rl_completion_display_matches_hook
+

If non-zero, then this is the address of a function to call when +completing a word would normally display the list of possible matches. +Readline calls this function instead of displaying the list itself. +It takes three arguments: +(char **matches, int num_matches, int max_length) +where matches is the array of matching strings, +num_matches is the number of strings in that array, and +max_length is the length of the longest string in that array. +Readline provides a convenience function, rl_display_match_list, +that takes care of doing the display to Readline’s output stream. +You may call that function from this hook. +

+ +
+
Variable: const char * rl_basic_word_break_characters
+

The basic list of characters that signal a break between words for the +completer routine. +The default value of this variable is the characters +which break words for completion in Bash: +" \t\n\"\\'`@$><=;|&{(". +

+ +
+
Variable: const char * rl_basic_quote_characters
+

A list of quote characters which can cause a word break. +The default value includes single and double quotes. +

+ +
+
Variable: const char * rl_completer_word_break_characters
+

The list of characters that signal a break between words for +rl_complete_internal(). +These characters determine how Readline decides what to complete. +The default list is the value of +rl_basic_word_break_characters. +

+ +
+
Variable: rl_cpvfunc_t * rl_completion_word_break_hook
+

If non-zero, this is the address of a function to call when Readline is +deciding where to separate words for word completion. +It should return a character string like +rl_completer_word_break_characters to be +used to perform the current completion. +The function may choose to set +rl_completer_word_break_characters itself. +If the function returns NULL, Readline uses +rl_completer_word_break_characters. +

+ +
+
Variable: const char * rl_completer_quote_characters
+

A list of characters which can be used to quote a substring of the line. +Completion occurs on the entire substring, and within the substring, +rl_completer_word_break_characters are treated as any other character, +unless they also appear within this list. +

+ +
+
Variable: const char * rl_filename_quote_characters
+

A list of characters that cause Readline to quote a filename +when they appear in a completed filename. +The default is the null string. +

+ +
+
Variable: const char * rl_special_prefixes
+

The list of characters that are word break characters, but should be +left in text when it is passed to the completion function. +Programs can use this to help determine what kind of completing to do. +For instance, Bash sets this variable to "$@" so that it can complete +shell variables and hostnames. +

+ +
+
Variable: int rl_completion_query_items
+

This determines the maximum number of items +that possible-completions will display unconditionally. +If there are more possible completions than this, +Readline asks the user for confirmation before displaying them. +The default value is 100. +A negative value +indicates that Readline should never ask for confirmation. +

+ +
+
Variable: int rl_completion_append_character
+

When a single completion alternative matches at the end of the command +line, Readline appends this character to the inserted completion text. +The default is a space character (‘ ’). +Setting this to the null +character (‘\0’) prevents anything being appended automatically. +This can be changed in application-specific completion functions to +provide the “most sensible word separator character” according to +an application-specific command line syntax specification. +It is set to the default before calling any application-specific completion +function, and may only be changed within such a function. +

+ +
+
Variable: int rl_completion_suppress_append
+

If non-zero, Readline will not append the +rl_completion_append_character to +matches at the end of the command line, as described above. +It is set to 0 before calling any application-specific completion function, +and may only be changed within such a function. +

+ +
+
Variable: int rl_completion_suppress_quote
+

If non-zero, Readline does not append a matching quote character when +performing completion on a quoted string. +It is set to 0 before calling any application-specific completion function, +and may only be changed within such a function. +

+ +
+
Variable: int rl_completion_found_quote
+

When Readline is completing quoted text, it sets this variable +to a non-zero value if the word being completed contains or is delimited +by any quoting characters, including backslashes. +This is set before calling any application-specific completion function. +

+ +
+
Variable: int rl_completion_quote_character
+

When Readline is completing quoted text, as delimited by one of the +characters in rl_completer_quote_characters, it sets this variable +to the quoting character it found. +This is set before calling any application-specific completion function. +

+ +
+ +

If non-zero, Readline appends a slash to completed filenames that are +symbolic links to directory names, subject to the value of the +user-settable mark-directories variable. +This variable exists so that application-specific completion functions +can override the user’s global preference (set via the +mark-symlinked-directories Readline variable) if appropriate. +This variable is set to the user’s preference before calling any +application-specific completion function, +so unless that function modifies the value, +Readline will honor the user’s preferences. +

+ +
+
Variable: int rl_ignore_completion_duplicates
+

If non-zero, then Readline removes duplicates in the set of possible +completions. +The default is 1. +

+ +
+
Variable: int rl_filename_completion_desired
+

A non-zero value means that Readline should treat the results of the +matches as filenames. +This is always zero when completion is attempted, +and can only be changed +within an application-specific completion function. +If it is set to a +non-zero value by such a function, Readline +appends a slash to directory names +and attempts to quote completed filenames if they contain any +characters in rl_filename_quote_characters and +rl_filename_quoting_desired is set to a non-zero value. +

+ +
+
Variable: int rl_filename_quoting_desired
+

A non-zero value means that Readline should quote the results of the +matches using double quotes (or an application-specific quoting mechanism) +if the completed filename contains any characters in +rl_filename_quote_chars. +This is always non-zero when completion is attempted, +and can only be changed within an +application-specific completion function. +The quoting is performed via a call to the function pointed to +by rl_filename_quoting_function. +

+ +
+
Variable: int rl_full_quoting_desired
+

A non-zero value means that Readline should apply filename-style quoting, +including any application-specified quoting mechanism, +to all completion matches even if it is not otherwise treating the +matches as filenames. +This is always zero when completion is attempted, +and can only be changed within an +application-specific completion function. +The quoting is performed via a call to the function pointed to +by rl_filename_quoting_function. +

+ +
+
Variable: int rl_attempted_completion_over
+

If an application-specific completion function assigned to +rl_attempted_completion_function sets this variable to a non-zero +value, Readline will not perform its default filename completion even +if the application’s completion function returns no matches. +It should be set only by an application’s completion function. +

+ +
+
Variable: int rl_sort_completion_matches
+

If an application sets this variable to 0, Readline will not sort the +list of completions (which implies that it cannot remove any duplicate +completions). +The default value is 1, which means that Readline will +sort the completions and, depending on the value of +rl_ignore_completion_duplicates, will attempt to remove +duplicate matches. +

+ +
+
Variable: int rl_completion_type
+

Set to a character describing the type of completion Readline is currently +attempting; see the description of rl_complete_internal() +(see Completion Functions) for the list of characters. +This is set to the appropriate value before calling +any application-specific completion function, +so these functions can present +the same interface as rl_complete(). +

+ +
+
Variable: int rl_completion_invoking_key
+

Set to the final character in the key sequence that invoked one of the +completion functions that call rl_complete_internal(). +This is set to the appropriate value before calling +any application-specific completion function. +

+ +
+
Variable: int rl_inhibit_completion
+

If this variable is non-zero, Readline does not perform completion, +even if a key binding indicates it should. +The completion character +is inserted as if it were bound to self-insert. +

+ +
+
+
+ +

2.6.4 A Short Completion Example

+ +

Here is a small application demonstrating the use of the GNU Readline +library. +It is called fileman, and the source code resides in +examples/fileman.c. +This sample application provides +command name completion, line editing features, +and access to the history list. +

+
+
/* fileman.c -- A tiny application which demonstrates how to use the
+   GNU Readline library.  This application interactively allows users
+   to manipulate files and their modes. */
+
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_FILE_H
+#  include <sys/file.h>
+#endif
+#include <sys/stat.h>
+
+#ifdef HAVE_UNISTD_H
+#  include <unistd.h>
+#endif
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <errno.h>
+#include <locale.h>
+
+#if defined (HAVE_STRING_H)
+#  include <string.h>
+#else /* !HAVE_STRING_H */
+#  include <strings.h>
+#endif /* !HAVE_STRING_H */
+
+#ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+#endif
+
+#include <time.h>
+
+#include <readline/readline.h>
+#include <readline/history.h>
+
+extern char *xmalloc PARAMS((size_t));
+
+/* The names of functions that actually do the manipulation. */
+int com_list PARAMS((char *));
+int com_view PARAMS((char *));
+int com_rename PARAMS((char *));
+int com_stat PARAMS((char *));
+int com_pwd PARAMS((char *));
+int com_delete PARAMS((char *));
+int com_help PARAMS((char *));
+int com_cd PARAMS((char *));
+int com_quit PARAMS((char *));
+
+/* A structure which contains information on the commands this program
+   can understand. */
+
+typedef struct {
+  char *name;			/* User printable name of the function. */
+  rl_icpfunc_t *func;		/* Function to call to do the job. */
+  char *doc;			/* Documentation for this function.  */
+} COMMAND;
+
+COMMAND commands[] = {
+  { "cd", com_cd, "Change to directory DIR" },
+  { "delete", com_delete, "Delete FILE" },
+  { "help", com_help, "Display this text" },
+  { "?", com_help, "Synonym for `help'" },
+  { "list", com_list, "List files in DIR" },
+  { "ls", com_list, "Synonym for `list'" },
+  { "pwd", com_pwd, "Print the current working directory" },
+  { "quit", com_quit, "Quit using Fileman" },
+  { "rename", com_rename, "Rename FILE to NEWNAME" },
+  { "stat", com_stat, "Print out statistics on FILE" },
+  { "view", com_view, "View the contents of FILE" },
+  { (char *)NULL, (rl_icpfunc_t *)NULL, (char *)NULL }
+};
+
+/* Forward declarations. */
+char *stripwhite (char *);
+COMMAND *find_command (char *);
+
+/* The name of this program, as taken from argv[0]. */
+char *progname;
+
+/* When non-zero, this global means the user is done using this program. */
+int done;
+
+char *
+dupstr (char *s)
+{
+  char *r;
+
+  r = xmalloc (strlen (s) + 1);
+  strcpy (r, s);
+  return (r);
+}
+
+int
+main (int argc, char **argv)
+{
+  char *line, *s;
+
+  setlocale (LC_ALL, "");
+
+  progname = argv[0];
+
+  initialize_readline ();	/* Bind our completer. */
+
+  /* Loop reading and executing lines until the user quits. */
+  for ( ; done == 0; )
+    {
+      line = readline ("FileMan: ");
+
+      if (!line)
+        break;
+
+      /* Remove leading and trailing whitespace from the line.
+         Then, if there is anything left, add it to the history list
+         and execute it. */
+      s = stripwhite (line);
+
+      if (*s)
+        {
+          add_history (s);
+          execute_line (s);
+        }
+
+      free (line);
+    }
+  exit (0);
+}
+
+/* Execute a command line. */
+int
+execute_line (char *line)
+{
+  register int i;
+  COMMAND *command;
+  char *word;
+
+  /* Isolate the command word. */
+  i = 0;
+  while (line[i] && whitespace (line[i]))
+    i++;
+  word = line + i;
+
+  while (line[i] && !whitespace (line[i]))
+    i++;
+
+  if (line[i])
+    line[i++] = '\0';
+
+  command = find_command (word);
+
+  if (!command)
+    {
+      fprintf (stderr, "%s: No such command for FileMan.\n", word);
+      return (-1);
+    }
+
+  /* Get argument to command, if any. */
+  while (whitespace (line[i]))
+    i++;
+
+  word = line + i;
+
+  /* Call the function. */
+  return ((*(command->func)) (word));
+}
+
+/* Look up NAME as the name of a command, and return a pointer to that
+   command.  Return a NULL pointer if NAME isn't a command name. */
+COMMAND *
+find_command (char *name)
+{
+  register int i;
+
+  for (i = 0; commands[i].name; i++)
+    if (strcmp (name, commands[i].name) == 0)
+      return (&commands[i]);
+
+  return ((COMMAND *)NULL);
+}
+
+/* Strip whitespace from the start and end of STRING.  Return a pointer
+   into STRING. */
+char *
+stripwhite (char *string)
+{
+  register char *s, *t;
+
+  for (s = string; whitespace (*s); s++)
+    ;
+    
+  if (*s == 0)
+    return (s);
+
+  t = s + strlen (s) - 1;
+  while (t > s && whitespace (*t))
+    t--;
+  *++t = '\0';
+
+  return s;
+}
+
+/* **************************************************************** */
+/*                                                                  */
+/*                  Interface to Readline Completion                */
+/*                                                                  */
+/* **************************************************************** */
+
+char *command_generator (const char *, int);
+char **fileman_completion (const char *, int, int);
+
+/* Tell the GNU Readline library how to complete.  We want to try to complete
+   on command names if this is the first word in the line, or on filenames
+   if not. */
+void
+initialize_readline (void)
+{
+  /* Allow conditional parsing of the ~/.inputrc file. */
+  rl_readline_name = "FileMan";
+
+  /* Tell the completer that we want a crack first. */
+  rl_attempted_completion_function = fileman_completion;
+}
+
+/* Attempt to complete on the contents of TEXT.  START and END bound the
+   region of rl_line_buffer that contains the word to complete.  TEXT is
+   the word to complete.  We can use the entire contents of rl_line_buffer
+   in case we want to do some simple parsing.  Return the array of matches,
+   or NULL if there aren't any. */
+char **
+fileman_completion (const char *text, int start, int end)
+{
+  char **matches;
+
+  matches = (char **)NULL;
+
+  /* If this word is at the start of the line, then it is a command
+     to complete.  Otherwise it is the name of a file in the current
+     directory. */
+  if (start == 0)
+    matches = rl_completion_matches (text, command_generator);
+
+  return (matches);
+}
+
+/* Generator function for command completion.  STATE lets us know whether
+   to start from scratch; without any state (i.e. STATE == 0), then we
+   start at the top of the list. */
+char *
+command_generator (const char *text, int state)
+{
+  static int list_index, len;
+  char *name;
+
+  /* If this is a new word to complete, initialize now.  This includes
+     saving the length of TEXT for efficiency, and initializing the index
+     variable to 0. */
+  if (!state)
+    {
+      list_index = 0;
+      len = strlen (text);
+    }
+
+  /* Return the next name which partially matches from the command list. */
+  while (name = commands[list_index].name)
+    {
+      list_index++;
+
+      if (strncmp (name, text, len) == 0)
+        return (dupstr(name));
+    }
+
+  /* If no names matched, then return NULL. */
+  return ((char *)NULL);
+}
+
+/* **************************************************************** */
+/*                                                                  */
+/*                       FileMan Commands                           */
+/*                                                                  */
+/* **************************************************************** */
+
+/* String to pass to system ().  This is for the LIST, VIEW and RENAME
+   commands. */
+static char syscom[1024];
+
+/* List the file(s) named in arg. */
+int
+com_list (char *arg)
+{
+  if (!arg)
+    arg = "";
+
+  snprintf (syscom, sizeof (syscom), "ls -FClg %s", arg);
+  return (system (syscom));
+}
+
+int
+com_view (char *arg)
+{
+  if (!valid_argument ("view", arg))
+    return 1;
+
+#if defined (__MSDOS__)
+  /* more.com doesn't grok slashes in pathnames */
+  snprintf (syscom, sizeof (syscom), "less %s", arg);
+#else
+  snprintf (syscom, sizeof (syscom), "more %s", arg);
+#endif
+  return (system (syscom));
+}
+
+int
+com_rename (char *arg)
+{
+  too_dangerous ("rename");
+  return (1);
+}
+
+int
+com_stat (char *arg)
+{
+  struct stat finfo;
+
+  if (!valid_argument ("stat", arg))
+    return (1);
+
+  if (stat (arg, &finfo) == -1)
+    {
+      perror (arg);
+      return (1);
+    }
+
+  printf ("Statistics for `%s':\n", arg);
+
+  printf ("%s has %d link%s, and is %d byte%s in length.\n",
+	  arg,
+          finfo.st_nlink,
+          (finfo.st_nlink == 1) ? "" : "s",
+          finfo.st_size,
+          (finfo.st_size == 1) ? "" : "s");
+  printf ("Inode Last Change at: %s", ctime (&finfo.st_ctime));
+  printf ("      Last access at: %s", ctime (&finfo.st_atime));
+  printf ("    Last modified at: %s", ctime (&finfo.st_mtime));
+  return (0);
+}
+
+int
+com_delete (char *arg)
+{
+  too_dangerous ("delete");
+  return (1);
+}
+
+/* Print out help for ARG, or for all of the commands if ARG is
+   not present. */
+int
+com_help (char *arg)
+{
+  register int i;
+  int printed = 0;
+
+  for (i = 0; commands[i].name; i++)
+    {
+      if (!*arg || (strcmp (arg, commands[i].name) == 0))
+        {
+          printf ("%s\t\t%s.\n", commands[i].name, commands[i].doc);
+          printed++;
+        }
+    }
+
+  if (!printed)
+    {
+      printf ("No commands match `%s'.  Possibilities are:\n", arg);
+
+      for (i = 0; commands[i].name; i++)
+        {
+          /* Print in six columns. */
+          if (printed == 6)
+            {
+              printed = 0;
+              printf ("\n");
+            }
+
+          printf ("%s\t", commands[i].name);
+          printed++;
+        }
+
+      if (printed)
+        printf ("\n");
+    }
+  return (0);
+}
+
+/* Change to the directory ARG. */
+int
+com_cd (char *arg)
+{
+  if (chdir (arg) == -1)
+    {
+      perror (arg);
+      return 1;
+    }
+
+  com_pwd ("");
+  return (0);
+}
+
+/* Print out the current working directory. */
+int
+com_pwd (char *ignore)
+{
+  char dir[1024], *s;
+
+  s = getcwd (dir, sizeof(dir) - 1);
+  if (s == 0)
+    {
+      printf ("Error getting pwd: %s\n", dir);
+      return 1;
+    }
+
+  printf ("Current directory is %s\n", dir);
+  return 0;
+}
+
+/* The user wishes to quit using this program.  Just set DONE non-zero. */
+int
+com_quit (char *arg)
+{
+  done = 1;
+  return (0);
+}
+
+/* Function which tells you that you can't do this. */
+void
+too_dangerous (char *caller)
+{
+  fprintf (stderr,
+           "%s: Too dangerous for me to distribute.  Write it yourself.\n",
+           caller);
+}
+
+/* Return non-zero if ARG is a valid argument for CALLER, else print
+   an error message and return zero. */
+int
+valid_argument (char *caller, char *arg)
+{
+  if (!arg || !*arg)
+    {
+      fprintf (stderr, "%s: Argument required.\n", caller);
+      return (0);
+    }
+
+  return (1);
+}
+
+ +
+
+
+
+
+ +

Appendix A GNU Free Documentation License

+ +
Version 1.3, 3 November 2008 +
+ +
+
Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+http://fsf.org/
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+ +
    +
  1. PREAMBLE + +

    The purpose of this License is to make a manual, textbook, or other +functional and useful document free in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. +

    +

    This License is a kind of “copyleft”, which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. +

    +

    We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. +

    +
  2. APPLICABILITY AND DEFINITIONS + +

    This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The “Document”, below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as “you”. You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. +

    +

    A “Modified Version” of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. +

    +

    A “Secondary Section” is a named appendix or a front-matter section +of the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document’s overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. +

    +

    The “Invariant Sections” are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. +

    +

    The “Cover Texts” are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. +

    +

    A “Transparent” copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not “Transparent” is called “Opaque”. +

    +

    Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input +format, SGML or XML using a publicly available +DTD, and standard-conforming simple HTML, +PostScript or PDF designed for human modification. Examples +of transparent image formats include PNG, XCF and +JPG. Opaque formats include proprietary formats that can be +read and edited only by proprietary word processors, SGML or +XML for which the DTD and/or processing tools are +not generally available, and the machine-generated HTML, +PostScript or PDF produced by some word processors for +output purposes only. +

    +

    The “Title Page” means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, “Title Page” means +the text near the most prominent appearance of the work’s title, +preceding the beginning of the body of the text. +

    +

    The “publisher” means any person or entity that distributes copies +of the Document to the public. +

    +

    A section “Entitled XYZ” means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as “Acknowledgements”, +“Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” +of such a section when you modify the Document means that it remains a +section “Entitled XYZ” according to this definition. +

    +

    The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. +

    +
  3. VERBATIM COPYING + +

    You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. +

    +

    You may also lend copies, under the same conditions stated above, and +you may publicly display copies. +

    +
  4. COPYING IN QUANTITY + +

    If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document’s license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. +

    +

    If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. +

    +

    If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. +

    +

    It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. +

    +
  5. MODIFICATIONS + +

    You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: +

    +
      +
    1. Use in the Title Page (and on the covers, if any) a title distinct +from that of the Document, and from those of previous versions +(which should, if there were any, be listed in the History section +of the Document). You may use the same title as a previous version +if the original publisher of that version gives permission. + +
    2. List on the Title Page, as authors, one or more persons or entities +responsible for authorship of the modifications in the Modified +Version, together with at least five of the principal authors of the +Document (all of its principal authors, if it has fewer than five), +unless they release you from this requirement. + +
    3. State on the Title page the name of the publisher of the +Modified Version, as the publisher. + +
    4. Preserve all the copyright notices of the Document. + +
    5. Add an appropriate copyright notice for your modifications +adjacent to the other copyright notices. + +
    6. Include, immediately after the copyright notices, a license notice +giving the public permission to use the Modified Version under the +terms of this License, in the form shown in the Addendum below. + +
    7. Preserve in that license notice the full lists of Invariant Sections +and required Cover Texts given in the Document’s license notice. + +
    8. Include an unaltered copy of this License. + +
    9. Preserve the section Entitled “History”, Preserve its Title, and add +to it an item stating at least the title, year, new authors, and +publisher of the Modified Version as given on the Title Page. If +there is no section Entitled “History” in the Document, create one +stating the title, year, authors, and publisher of the Document as +given on its Title Page, then add an item describing the Modified +Version as stated in the previous sentence. + +
    10. Preserve the network location, if any, given in the Document for +public access to a Transparent copy of the Document, and likewise +the network locations given in the Document for previous versions +it was based on. These may be placed in the “History” section. +You may omit a network location for a work that was published at +least four years before the Document itself, or if the original +publisher of the version it refers to gives permission. + +
    11. For any section Entitled “Acknowledgements” or “Dedications”, Preserve +the Title of the section, and preserve in the section all the +substance and tone of each of the contributor acknowledgements and/or +dedications given therein. + +
    12. Preserve all the Invariant Sections of the Document, +unaltered in their text and in their titles. Section numbers +or the equivalent are not considered part of the section titles. + +
    13. Delete any section Entitled “Endorsements”. Such a section +may not be included in the Modified Version. + +
    14. Do not retitle any existing section to be Entitled “Endorsements” or +to conflict in title with any Invariant Section. + +
    15. Preserve any Warranty Disclaimers. +
    + +

    If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version’s license notice. +These titles must be distinct from any other section titles. +

    +

    You may add a section Entitled “Endorsements”, provided it contains +nothing but endorsements of your Modified Version by various +parties—for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. +

    +

    You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. +

    +

    The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. +

    +
  6. COMBINING DOCUMENTS + +

    You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. +

    +

    The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. +

    +

    In the combination, you must combine any sections Entitled “History” +in the various original documents, forming one section Entitled +“History”; likewise combine any sections Entitled “Acknowledgements”, +and any sections Entitled “Dedications”. You must delete all +sections Entitled “Endorsements.” +

    +
  7. COLLECTIONS OF DOCUMENTS + +

    You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. +

    +

    You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. +

    +
  8. AGGREGATION WITH INDEPENDENT WORKS + +

    A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an “aggregate” if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation’s users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. +

    +

    If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document’s Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. +

    +
  9. TRANSLATION + +

    Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. +

    +

    If a section in the Document is Entitled “Acknowledgements”, +“Dedications”, or “History”, the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. +

    +
  10. TERMINATION + +

    You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. +

    +

    However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. +

    +

    Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. +

    +

    Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. +

    +
  11. FUTURE REVISIONS OF THIS LICENSE + +

    The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +http://www.gnu.org/copyleft/. +

    +

    Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License “or any later version” applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy’s public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. +

    +
  12. RELICENSING + +

    “Massive Multiauthor Collaboration Site” (or “MMC Site”) means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +“Massive Multiauthor Collaboration” (or “MMC”) contained in the +site means any set of copyrightable works thus published on the MMC +site. +

    +

    “CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. +

    +

    “Incorporate” means to publish or republish a Document, in whole or +in part, as part of another Document. +

    +

    An MMC is “eligible for relicensing” if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole +or in part into the MMC, (1) had no cover texts or invariant sections, +and (2) were thus incorporated prior to November 1, 2008. +

    +

    The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. +

    +
+ +

ADDENDUM: How to use this License for your documents

+ +

To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: +

+
+
  Copyright (C)  year  your name.
+  Permission is granted to copy, distribute and/or modify this document
+  under the terms of the GNU Free Documentation License, Version 1.3
+  or any later version published by the Free Software Foundation;
+  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+  Texts.  A copy of the license is included in the section entitled ``GNU
+  Free Documentation License''.
+
+ +

If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the “with…Texts.” line with this: +

+
+
    with the Invariant Sections being list their titles, with
+    the Front-Cover Texts being list, and with the Back-Cover Texts
+    being list.
+
+ +

If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. +

+

If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. +

+ + +
+
+ +
+ +

Function and Variable Index

+
+
Jump to:   _ +   +
+A +   +B +   +C +   +D +   +E +   +F +   +H +   +I +   +K +   +M +   +N +   +O +   +P +   +Q +   +R +   +S +   +T +   +U +   +V +   +Y +   +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Index EntrySection

_
_rl_digit_pUtility Functions
_rl_digit_valueUtility Functions
_rl_lowercase_pUtility Functions
_rl_to_lowerUtility Functions
_rl_to_upperUtility Functions
_rl_uppercase_pUtility Functions

A
abort (C-g)Miscellaneous Commands
accept-line (Newline or Return)Commands For History
active-region-end-colorReadline Init File Syntax
active-region-start-colorReadline Init File Syntax

B
backward-char (C-b)Commands For Moving
backward-delete-char (Rubout)Commands For Text
backward-kill-line (C-x Rubout)Commands For Killing
backward-kill-word (M-DEL)Commands For Killing
backward-word (M-b)Commands For Moving
beginning-of-history (M-<)Commands For History
beginning-of-line (C-a)Commands For Moving
bell-styleReadline Init File Syntax
bind-tty-special-charsReadline Init File Syntax
blink-matching-parenReadline Init File Syntax
bracketed-paste-begin ()Commands For Text

C
call-last-kbd-macro (C-x e)Keyboard Macros
capitalize-word (M-c)Commands For Text
character-search (C-])Miscellaneous Commands
character-search-backward (M-C-])Miscellaneous Commands
clear-display (M-C-l)Commands For Moving
clear-screen (C-l)Commands For Moving
colored-completion-prefixReadline Init File Syntax
colored-statsReadline Init File Syntax
comment-beginReadline Init File Syntax
complete (TAB)Commands For Completion
completion-display-widthReadline Init File Syntax
completion-ignore-caseReadline Init File Syntax
completion-map-caseReadline Init File Syntax
completion-prefix-display-lengthReadline Init File Syntax
completion-query-itemsReadline Init File Syntax
convert-metaReadline Init File Syntax
copy-backward-word ()Commands For Killing
copy-forward-word ()Commands For Killing
copy-region-as-kill ()Commands For Killing

D
delete-char (C-d)Commands For Text
delete-char-or-list ()Commands For Completion
delete-horizontal-space ()Commands For Killing
digit-argument (M-0, M-1, … M--)Numeric Arguments
disable-completionReadline Init File Syntax
do-lowercase-version (M-A, M-B, M-x, …)Miscellaneous Commands
downcase-word (M-l)Commands For Text
dump-functions ()Miscellaneous Commands
dump-macros ()Miscellaneous Commands
dump-variables ()Miscellaneous Commands

E
echo-control-charactersReadline Init File Syntax
editing-modeReadline Init File Syntax
emacs-editing-mode (C-e)Miscellaneous Commands
emacs-mode-stringReadline Init File Syntax
enable-active-region TheReadline Init File Syntax
enable-bracketed-pasteReadline Init File Syntax
enable-keypadReadline Init File Syntax
enable-meta-keyReadline Init File Syntax
end-kbd-macro (C-x ))Keyboard Macros
end-of-file (usually C-d)Commands For Text
end-of-history (M->)Commands For History
end-of-line (C-e)Commands For Moving
exchange-point-and-mark (C-x C-x)Miscellaneous Commands
execute-named-command (M-x)Miscellaneous Commands
expand-tildeReadline Init File Syntax
export-completions ()Commands For Completion

F
fetch-history ()Commands For History
force-meta-prefixReadline Init File Syntax
forward-backward-delete-char ()Commands For Text
forward-char (C-f)Commands For Moving
forward-search-history (C-s)Commands For History
forward-word (M-f)Commands For Moving

H
history-preserve-pointReadline Init File Syntax
history-search-backward ()Commands For History
history-search-forward ()Commands For History
history-sizeReadline Init File Syntax
history-substring-search-backward ()Commands For History
history-substring-search-forward ()Commands For History
horizontal-scroll-modeReadline Init File Syntax

I
input-metaReadline Init File Syntax
insert-comment (M-#)Miscellaneous Commands
insert-completions (M-*)Commands For Completion
isearch-terminatorsReadline Init File Syntax

K
keymapReadline Init File Syntax
kill-line (C-k)Commands For Killing
kill-region ()Commands For Killing
kill-whole-line ()Commands For Killing
kill-word (M-d)Commands For Killing

M
mark-modified-linesReadline Init File Syntax
mark-symlinked-directoriesReadline Init File Syntax
match-hidden-filesReadline Init File Syntax
menu-complete ()Commands For Completion
menu-complete-backward ()Commands For Completion
menu-complete-display-prefixReadline Init File Syntax
meta-flagReadline Init File Syntax

N
next-history (C-n)Commands For History
next-screen-line ()Commands For Moving
non-incremental-forward-search-history (M-n)Commands For History
non-incremental-reverse-search-history (M-p)Commands For History

O
operate-and-get-next (C-o)Commands For History
output-metaReadline Init File Syntax
overwrite-mode ()Commands For Text

P
page-completionsReadline Init File Syntax
possible-completions (M-?)Commands For Completion
prefix-meta (ESC)Miscellaneous Commands
previous-history (C-p)Commands For History
previous-screen-line ()Commands For Moving
print-last-kbd-macro ()Keyboard Macros

Q
quoted-insert (C-q or C-v)Commands For Text

R
re-read-init-file (C-x C-r)Miscellaneous Commands
readlineBasic Behavior
redraw-current-line ()Commands For Moving
reverse-search-history (C-r)Commands For History
revert-all-at-newlineReadline Init File Syntax
revert-line (M-r)Miscellaneous Commands
rl_activate_markMiscellaneous Functions
rl_add_defunFunction Naming
rl_add_funmap_entryAssociating Function Names and Bindings
rl_add_undoAllowing Undoing
rl_alphabeticUtility Functions
rl_already_promptedReadline Variables
rl_attempted_completion_functionCompletion Variables
rl_attempted_completion_overCompletion Variables
rl_basic_quote_charactersCompletion Variables
rl_basic_word_break_charactersCompletion Variables
rl_begin_undo_groupAllowing Undoing
rl_bind_keyBinding Keys
rl_bind_key_if_unboundBinding Keys
rl_bind_key_if_unbound_in_mapBinding Keys
rl_bind_key_in_mapBinding Keys
rl_bind_keyseqBinding Keys
rl_bind_keyseq_if_unboundBinding Keys
rl_bind_keyseq_if_unbound_in_mapBinding Keys
rl_bind_keyseq_in_mapBinding Keys
rl_binding_keymapReadline Variables
rl_callback_handler_installAlternate Interface
rl_callback_handler_removeAlternate Interface
rl_callback_read_charAlternate Interface
rl_callback_sigcleanupAlternate Interface
rl_catch_signalsReadline Signal Handling
rl_catch_sigwinchReadline Signal Handling
rl_change_environmentReadline Signal Handling
rl_char_is_quoted_pCompletion Variables
rl_check_signalsReadline Signal Handling
rl_cleanup_after_signalReadline Signal Handling
rl_clear_historyMiscellaneous Functions
rl_clear_messageRedisplay
rl_clear_pending_inputCharacter Input
rl_clear_signalsReadline Signal Handling
rl_clear_visible_lineRedisplay
rl_completeHow Completing Works
rl_completeCompletion Functions
rl_complete_internalCompletion Functions
rl_completer_quote_charactersCompletion Variables
rl_completer_word_break_charactersCompletion Variables
rl_completion_append_characterCompletion Variables
rl_completion_display_matches_hookCompletion Variables
rl_completion_entry_functionHow Completing Works
rl_completion_entry_functionCompletion Variables
rl_completion_found_quoteCompletion Variables
rl_completion_invoking_keyCompletion Variables
rl_completion_mark_symlink_dirsCompletion Variables
rl_completion_matchesCompletion Functions
rl_completion_modeCompletion Functions
rl_completion_query_itemsCompletion Variables
rl_completion_quote_characterCompletion Variables
rl_completion_rewrite_hookCompletion Variables
rl_completion_suppress_appendCompletion Variables
rl_completion_suppress_quoteCompletion Variables
rl_completion_typeCompletion Variables
rl_completion_word_break_hookCompletion Variables
rl_copy_keymapKeymaps
rl_copy_textModifying Text
rl_crlfRedisplay
rl_deactivate_markMiscellaneous Functions
rl_delete_textModifying Text
rl_deprep_term_functionReadline Variables
rl_deprep_terminalTerminal Management
rl_dingUtility Functions
rl_directory_completion_hookCompletion Variables
rl_directory_rewrite_hook;Completion Variables
rl_discard_keymapKeymaps
rl_dispatchingReadline Variables
rl_display_match_listUtility Functions
rl_display_promptReadline Variables
rl_do_undoAllowing Undoing
rl_doneReadline Variables
rl_echo_signal_charReadline Signal Handling
rl_editing_modeReadline Variables
rl_empty_keymapKeymaps
rl_endReadline Variables
rl_end_undo_groupAllowing Undoing
rl_eof_foundReadline Variables
rl_erase_empty_lineReadline Variables
rl_event_hookReadline Variables
rl_execute_nextCharacter Input
rl_executing_keyReadline Variables
rl_executing_keymapReadline Variables
rl_executing_keyseqReadline Variables
rl_executing_macroReadline Variables
rl_expand_promptRedisplay
rl_explicit_argReadline Variables
rl_extend_line_bufferUtility Functions
rl_filename_completion_desiredCompletion Variables
rl_filename_completion_functionCompletion Functions
rl_filename_dequoting_functionCompletion Variables
rl_filename_quote_charactersCompletion Variables
rl_filename_quoting_desiredCompletion Variables
rl_filename_quoting_functionCompletion Variables
rl_filename_rewrite_hookCompletion Variables
rl_filename_stat_hookCompletion Variables
rl_forced_update_displayRedisplay
rl_freeUtility Functions
rl_free_keymapKeymaps
rl_free_line_stateReadline Signal Handling
rl_free_undo_listAllowing Undoing
rl_full_quoting_desiredCompletion Variables
rl_function_dumperAssociating Function Names and Bindings
rl_function_of_keyseqAssociating Function Names and Bindings
rl_function_of_keyseq_lenAssociating Function Names and Bindings
rl_funmap_namesAssociating Function Names and Bindings
rl_generic_bindBinding Keys
rl_get_keymapKeymaps
rl_get_keymap_by_nameKeymaps
rl_get_keymap_nameKeymaps
rl_get_screen_sizeReadline Signal Handling
rl_get_termcapMiscellaneous Functions
rl_getcCharacter Input
rl_getc_functionReadline Variables
rl_gnu_readline_pReadline Variables
rl_ignore_completion_duplicatesCompletion Variables
rl_ignore_some_completions_functionCompletion Variables
rl_inhibit_completionCompletion Variables
rl_initializeUtility Functions
rl_input_available_hookReadline Variables
rl_insert_completionsCompletion Functions
rl_insert_textModifying Text
rl_instreamReadline Variables
rl_invoking_keyseqsAssociating Function Names and Bindings
rl_invoking_keyseqs_in_mapAssociating Function Names and Bindings
rl_keep_mark_activeMiscellaneous Functions
rl_key_sequence_lengthReadline Variables
rl_kill_textModifying Text
rl_last_funcReadline Variables
rl_library_versionReadline Variables
rl_line_bufferReadline Variables
rl_list_funmap_namesAssociating Function Names and Bindings
rl_macro_bindMiscellaneous Functions
rl_macro_display_hookReadline Variables
rl_macro_dumperMiscellaneous Functions
rl_make_bare_keymapKeymaps
rl_make_keymapKeymaps
rl_markReadline Variables
rl_mark_active_pMiscellaneous Functions
rl_messageRedisplay
rl_modifyingAllowing Undoing
rl_named_functionAssociating Function Names and Bindings
rl_num_chars_to_readReadline Variables
rl_numeric_argReadline Variables
rl_on_new_lineRedisplay
rl_on_new_line_with_promptRedisplay
rl_outstreamReadline Variables
rl_parse_and_bindBinding Keys
rl_pending_inputReadline Variables
rl_pending_signalReadline Signal Handling
rl_persistent_signal_handlersReadline Signal Handling
rl_pointReadline Variables
rl_possible_completionsCompletion Functions
rl_pre_input_hookReadline Variables
rl_prefer_env_winsizeReadline Variables
rl_prep_term_functionReadline Variables
rl_prep_terminalTerminal Management
rl_print_keybindingAssociating Function Names and Bindings
rl_promptReadline Variables
rl_push_macro_inputModifying Text
rl_read_init_fileBinding Keys
rl_read_keyCharacter Input
rl_readline_nameReadline Variables
rl_readline_stateReadline Variables
rl_readline_versionReadline Variables
rl_redisplayRedisplay
rl_redisplay_functionReadline Variables
rl_reparse_colorsMiscellaneous Functions
rl_replace_lineModifying Text
rl_reset_after_signalReadline Signal Handling
rl_reset_line_stateRedisplay
rl_reset_screen_sizeReadline Signal Handling
rl_reset_terminalTerminal Management
rl_resize_terminalReadline Signal Handling
rl_restore_promptRedisplay
rl_restore_stateUtility Functions
rl_save_promptRedisplay
rl_save_stateUtility Functions
rl_set_keyBinding Keys
rl_set_keyboard_input_timeoutCharacter Input
rl_set_keymapKeymaps
rl_set_keymap_nameKeymaps
rl_set_paren_blink_timeoutMiscellaneous Functions
rl_set_promptRedisplay
rl_set_screen_sizeReadline Signal Handling
rl_set_signalsReadline Signal Handling
rl_set_timeoutCharacter Input
rl_show_charRedisplay
rl_signal_event_hookReadline Variables
rl_sort_completion_matchesCompletion Variables
rl_special_prefixesCompletion Variables
rl_startup_hookReadline Variables
rl_stuff_charCharacter Input
rl_terminal_nameReadline Variables
rl_timeout_event_hookReadline Variables
rl_timeout_remainingCharacter Input
rl_trim_arg_from_keyseqAssociating Function Names and Bindings
rl_tty_set_default_bindingsTerminal Management
rl_tty_set_echoingTerminal Management
rl_tty_unset_default_bindingsTerminal Management
rl_unbind_command_in_mapBinding Keys
rl_unbind_function_in_mapBinding Keys
rl_unbind_keyBinding Keys
rl_unbind_key_in_mapBinding Keys
rl_username_completion_functionCompletion Functions
rl_variable_bindMiscellaneous Functions
rl_variable_dumperMiscellaneous Functions
rl_variable_valueMiscellaneous Functions

S
search-ignore-caseReadline Init File Syntax
self-insert (a, b, A, 1, !, …)Commands For Text
set-mark (C-@)Miscellaneous Commands
show-all-if-ambiguousReadline Init File Syntax
show-all-if-unmodifiedReadline Init File Syntax
show-mode-in-promptReadline Init File Syntax
skip-completed-textReadline Init File Syntax
skip-csi-sequence ()Miscellaneous Commands
start-kbd-macro (C-x ()Keyboard Macros

T
tab-insert (M-TAB)Commands For Text
tilde-expand (M-~)Miscellaneous Commands
transpose-chars (C-t)Commands For Text
transpose-words (M-t)Commands For Text

U
undo (C-_ or C-x C-u)Miscellaneous Commands
universal-argument ()Numeric Arguments
unix-filename-rubout ()Commands For Killing
unix-line-discard (C-u)Commands For Killing
unix-word-rubout (C-w)Commands For Killing
upcase-word (M-u)Commands For Text

V
vi-cmd-mode-stringReadline Init File Syntax
vi-editing-mode (M-C-j)Miscellaneous Commands
vi-ins-mode-stringReadline Init File Syntax
visible-statsReadline Init File Syntax

Y
yank (C-y)Commands For Killing
yank-last-arg (M-. or M-_)Commands For History
yank-nth-arg (M-C-y)Commands For History
yank-pop (M-y)Commands For Killing

+ +
+ +
+
+ + + + + diff --git a/miniconda3/share/doc/readline/rluserman.html b/miniconda3/share/doc/readline/rluserman.html new file mode 100644 index 0000000000000000000000000000000000000000..b79efb467d131d6b0559eca95f5339a7e58b092d --- /dev/null +++ b/miniconda3/share/doc/readline/rluserman.html @@ -0,0 +1,2708 @@ + + + + + + +GNU Readline Library + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

GNU Readline Library

+ +

This document describes the end user interface of the GNU Readline Library, +a utility which aids in the consistency of user interface across discrete +programs which provide a command line interface. +The Readline home page is http://www.gnu.org/software/readline/. +

+ + + + + + +
+
+ +

1 Command Line Editing

+ +

This chapter describes the basic features of the GNU +command line editing interface. +

+ + +
+
+ +

1.1 Introduction to Line Editing

+ +

The following paragraphs use Emacs style to +describe the notation used to represent keystrokes. +

+

The text C-k is read as ‘Control-K’ and describes the character +produced when the k key is pressed while the Control key +is depressed. +

+

The text M-k is read as ‘Meta-K’ and describes the character +produced when the Meta key (if you have one) is depressed, and the k +key is pressed (a meta character), then both are released. +The Meta key is labeled ALT or Option on many keyboards. +On keyboards with two keys labeled ALT (usually to either side of +the space bar), the ALT on the left side is generally set to +work as a Meta key. +One of the ALT keys may also be configured +as some other modifier, such as a +Compose key for typing accented characters. +

+

On some keyboards, the Meta key modifier produces characters with +the eighth bit (0200) set. +You can use the enable-meta-key variable +to control whether or not it does this, if the keyboard allows it. +On many others, the terminal or terminal emulator converts the metafied +key to a key sequence beginning with ESC as described in the +next paragraph. +

+

If you do not have a Meta or ALT key, or another key working as +a Meta key, you can generally achieve the latter effect by typing ESC +first, and then typing k. +The ESC character is known as the meta prefix). +

+

Either process is known as metafying the k key. +

+

If your Meta key produces a key sequence with the ESC meta prefix, +you can make M-key key bindings you specify +(see Key Bindings in Readline Init File Syntax) +do the same thing by setting the force-meta-prefix variable. +

+

The text M-C-k is read as ‘Meta-Control-k’ and describes the +character produced by metafying C-k. +

+

In addition, several keys have their own names. +Specifically, +DEL, ESC, LFD, SPC, RET, and TAB all +stand for themselves when seen in this text, or in an init file +(see Readline Init File). +If your keyboard lacks a LFD key, typing C-j will +output the appropriate character. +The RET key may be labeled Return or Enter on +some keyboards. +

+
+
+
+ +

1.2 Readline Interaction

+ + +

Often during an interactive session you type in a long line of text, +only to notice that the first word on the line is misspelled. +The Readline library gives you a set of commands for manipulating the text +as you type it in, allowing you to just fix your typo, and not forcing +you to retype the majority of the line. +Using these editing commands, +you move the cursor to the place that needs correction, and delete or +insert the text of the corrections. +Then, when you are satisfied with the line, you simply press RET. +You do not have to be at the +end of the line to press RET; the entire line is accepted +regardless of the location of the cursor within the line. +

+ + +
+
+ +

1.2.1 Readline Bare Essentials

+ + + + +

In order to enter characters into the line, simply type them. +The typed +character appears where the cursor was, and then the cursor moves one +space to the right. +If you mistype a character, you can use your +erase character to back up and delete the mistyped character. +

+

Sometimes you may mistype a character, and +not notice the error until you have typed several other characters. +In that case, you can type C-b to move the cursor to the left, +and then correct your mistake. +Afterwards, you can move the cursor to the right with C-f. +

+

When you add text in the middle of a line, you will notice that characters +to the right of the cursor are ‘pushed over’ to make room for the text +that you have inserted. +Likewise, when you delete text behind the cursor, +characters to the right of the cursor are ‘pulled back’ to fill in the +blank space created by the removal of the text. +These are the bare +essentials for editing the text of an input line: +

+
+
C-b
+

Move back one character. +

+
C-f
+

Move forward one character. +

+
DEL or Backspace
+

Delete the character to the left of the cursor. +

+
C-d
+

Delete the character underneath the cursor. +

+
Printing characters
+

Insert the character into the line at the cursor. +

+
C-_ or C-x C-u
+

Undo the last editing command. +You can undo all the way back to an empty line. +

+
+ +

Depending on your configuration, the Backspace key might be set to +delete the character to the left of the cursor and the DEL key set +to delete the character underneath the cursor, like C-d, rather +than the character to the left of the cursor. +

+
+
+
+ +

1.2.2 Readline Movement Commands

+ +

The above table describes the most basic keystrokes that you need +in order to do editing of the input line. +For your convenience, many other commands are available in +addition to C-b, C-f, C-d, and DEL. +Here are some commands for moving more rapidly within the line. +

+
+
C-a
+

Move to the start of the line. +

+
C-e
+

Move to the end of the line. +

+
M-f
+

Move forward a word, where a word is composed of letters and digits. +

+
M-b
+

Move backward a word. +

+
C-l
+

Clear the screen, reprinting the current line at the top. +

+
+ +

Notice how C-f moves forward a character, while M-f moves +forward a word. +It is a loose convention that control keystrokes +operate on characters while meta keystrokes operate on words. +

+
+
+
+ +

1.2.3 Readline Killing Commands

+ + + + +

Killing text means to delete the text from the line, but to save +it away for later use, usually by yanking (re-inserting) +it back into the line. +(‘Cut’ and ‘paste’ are more recent jargon for ‘kill’ and ‘yank’.) +

+

If the description for a command says that it ‘kills’ text, then you can +be sure that you can get the text back in a different (or the same) +place later. +

+

When you use a kill command, the text is saved in a kill-ring. +Any number of consecutive kills save all of the killed text together, so +that when you yank it back, you get it all. +The kill ring is not line specific; the text that you killed on a previously +typed line is available to be yanked back later, when you are typing +another line. + +

+

Here is the list of commands for killing text. +

+
+
C-k
+

Kill the text from the current cursor position to the end of the line. +

+
+
M-d
+

Kill from the cursor to the end of the current word, or, if between +words, to the end of the next word. +Word boundaries are the same as those used by M-f. +

+
+
M-DEL
+

Kill from the cursor to the start of the current word, or, if between +words, to the start of the previous word. +Word boundaries are the same as those used by M-b. +

+
+
C-w
+

Kill from the cursor to the previous whitespace. +This is different than +M-DEL because the word boundaries differ. +

+
+
+ +

Here is how to yank the text back into the line. Yanking +means to copy the most-recently-killed text from the kill buffer +into the line at the current cursor position. +

+
+
C-y
+

Yank the most recently killed text back into the buffer at the cursor. +

+
+
M-y
+

Rotate the kill-ring, and yank the new top. +You can only do this if the prior command is C-y or M-y. +

+
+ +
+
+
+ +

1.2.4 Readline Arguments

+ +

You can pass numeric arguments to Readline commands. +Sometimes the +argument acts as a repeat count, other times it is the sign of the +argument that is significant. +If you pass a negative argument to a +command which normally acts in a forward direction, that command will +act in a backward direction. +For example, to kill text back to the +start of the line, you might type ‘M-- C-k’. +

+

The general way to pass numeric arguments to a command is to type meta +digits before the command. +If the first ‘digit’ typed is a minus +sign (‘-’), then the sign of the argument will be negative. +Once you have typed one meta digit to get the argument started, you can +type the remainder of the digits, and then the command. +For example, to give +the C-d command an argument of 10, you could type ‘M-1 0 C-d’, +which will delete the next ten characters on the input line. +

+
+
+
+ +

1.2.5 Searching for Commands in the History

+ +

Readline provides commands for searching through the command history +for lines containing a specified string. +There are two search modes: incremental and non-incremental. +

+

Incremental searches begin before the user has finished typing the +search string. +As each character of the search string is typed, Readline displays +the next entry from the history matching the string typed so far. +An incremental search requires only as many characters as needed to +find the desired history entry. +When using emacs editing mode, type C-r +to search backward in the history for a particular string. +Typing C-s searches forward through the history. +The characters present in the value of the isearch-terminators variable +are used to terminate an incremental search. +If that variable has not been assigned a value, the ESC and +C-j characters terminate an incremental search. +C-g aborts an incremental search and restores the original line. +When the search is terminated, the history entry containing the +search string becomes the current line. +

+

To find other matching entries in the history list, type C-r or +C-s as appropriate. +This searches backward or forward in the history for the next +entry matching the search string typed so far. +Any other key sequence bound to a Readline command terminates +the search and executes that command. +For instance, a RET terminates the search and accepts +the line, thereby executing the command from the history list. +A movement command will terminate the search, make the last line found +the current line, and begin editing. +

+

Readline remembers the last incremental search string. +If two C-rs are typed without any intervening characters defining +a new search string, Readline uses any remembered search string. +

+

Non-incremental searches read the entire search string before starting +to search for matching history entries. +The search string may be typed by the user or be part of the contents of +the current line. +

+
+
+
+
+ +

1.3 Readline Init File

+ + +

Although the Readline library comes with a set of Emacs-like +keybindings installed by default, it is possible to use a different set +of keybindings. +Any user can customize programs that use Readline by putting +commands in an inputrc file, conventionally in their home directory. +The name of this file is taken from the value of the +environment variable INPUTRC. +If that variable is unset, the default is ~/.inputrc. +If that file does not exist or cannot be read, Readline looks for +/etc/inputrc. +

+

When a program that uses the Readline library starts up, Readline reads +the init file and sets any variables and key bindings it contains. +

+

In addition, the C-x C-r command re-reads this init file, thus +incorporating any changes that you might have made to it. +

+ + +
+
+ +

1.3.1 Readline Init File Syntax

+ +

There are only a few basic constructs allowed in the +Readline init file. +Blank lines are ignored. +Lines beginning with a ‘#’ are comments. +Lines beginning with a ‘$’ indicate conditional +constructs (see Conditional Init Constructs). +Other lines denote variable settings and key bindings. +

+
+
Variable Settings
+

You can modify the run-time behavior of Readline by +altering the values of variables in Readline +using the set command within the init file. +The syntax is simple: +

+
+
set variable value
+
+ +

Here, for example, is how to +change from the default Emacs-like key binding to use +vi line editing commands: +

+
+
set editing-mode vi
+
+ +

Variable names and values, where appropriate, are recognized without +regard to case. +Unrecognized variable names are ignored. +

+

Boolean variables (those that can be set to on or off) are set to on if +the value is null or empty, on (case-insensitive), or 1. +Any other value results in the variable being set to off. +

+ +

A great deal of run-time behavior is changeable with the following +variables. +

+ +
+
active-region-start-color
+

A string variable that controls the text color and background when displaying +the text in the active region (see the description of +enable-active-region below). +This string must not take up any physical character positions on the display, +so it should consist only of terminal escape sequences. +It is output to the terminal before displaying the text in the active region. +This variable is reset to the default value whenever the terminal type changes. +The default value is the string that puts the terminal in standout mode, +as obtained from the terminal’s terminfo description. +A sample value might be ‘\e[01;33m’. +

+
+
active-region-end-color
+

A string variable that “undoes” +the effects of active-region-start-color +and restores “normal” +terminal display appearance after displaying text in the active region. +This string must not take up any physical character positions on the display, +so it should consist only of terminal escape sequences. +It is output to the terminal after displaying the text in the active region. +This variable is reset to the default value whenever the terminal type changes. +The default value is the string that restores the terminal from standout mode, +as obtained from the terminal’s terminfo description. +A sample value might be ‘\e[0m’. +

+
+
bell-style
+

Controls what happens when Readline wants to ring the terminal bell. +If set to ‘none’, Readline never rings the bell. +If set to ‘visible’, Readline uses a visible bell if one is available. +If set to ‘audible’ (the default), Readline attempts to ring +the terminal’s bell. +

+
+
bind-tty-special-chars
+

If set to ‘on’ (the default), Readline attempts to bind the control +characters that are +treated specially by the kernel’s terminal driver to their +Readline equivalents. +These override the default Readline bindings described here. +Type ‘stty -a’ at a Bash prompt to see your current terminal settings, +including the special control characters (usually cchars). +

+
+
blink-matching-paren
+

If set to ‘on’, Readline attempts to briefly move the cursor to an +opening parenthesis when a closing parenthesis is inserted. +The default is ‘off’. +

+
+
colored-completion-prefix
+

If set to ‘on’, when listing completions, Readline displays the +common prefix of the set of possible completions using a different color. +The color definitions are taken from the value of the LS_COLORS +environment variable. +If there is a color definition in LS_COLORS for the custom suffix +‘readline-colored-completion-prefix’, Readline uses this color for +the common prefix instead of its default. +The default is ‘off’. +

+
+
colored-stats
+

If set to ‘on’, Readline displays possible completions using different +colors to indicate their file type. +The color definitions are taken from the value of the LS_COLORS +environment variable. +The default is ‘off’. +

+
+
comment-begin
+

The string to insert at the beginning of the line by the +insert-comment command. +The default value is "#". +

+
+
completion-display-width
+

The number of screen columns used to display possible matches +when performing completion. +The value is ignored if it is less than 0 or greater than the terminal +screen width. +A value of 0 causes matches to be displayed one per line. +The default value is -1. +

+
+
completion-ignore-case
+

If set to ‘on’, Readline performs filename matching and completion +in a case-insensitive fashion. +The default value is ‘off’. +

+
+
completion-map-case
+

If set to ‘on’, and completion-ignore-case is enabled, Readline +treats hyphens (‘-’) and underscores (‘_’) as equivalent when +performing case-insensitive filename matching and completion. +The default value is ‘off’. +

+
+
completion-prefix-display-length
+

The maximum +length in characters of the common prefix of a list of possible +completions that is displayed without modification. +When set to a value greater than zero, Readline +replaces common prefixes longer than this value +with an ellipsis when displaying possible completions. +If a completion begins with a period, +and Readline is completing filenames, +it uses three underscores instead of an ellipsis. +

+
+
completion-query-items
+

The number of possible completions that determines when the user is asked +whether the list of possibilities should be displayed. +If the number of possible completions is greater than +or equal to this value, +Readline asks whether or not the user wishes to view them; +otherwise, Readline simply lists the completions. +This variable must be set to an integer value greater than or equal to zero. +A zero value means Readline should never ask; negative +values are treated as zero. +The default limit is 100. +

+
+
convert-meta
+

If set to ‘on’, Readline converts characters it reads +that have the eighth bit set to an ASCII key sequence by +clearing the eighth bit and prefixing an ESC character, +converting them to a meta-prefixed key sequence. +The default value is ‘on’, but Readline sets it to ‘off’ +if the locale contains +characters whose encodings may include bytes with the eighth bit set. +This variable is dependent on the LC_CTYPE locale category, and +may change if the locale changes. +This variable also affects key bindings; +see the description of force-meta-prefix below. +

+
+
disable-completion
+

If set to ‘On’, Readline inhibits word completion. +Completion characters are inserted into the line as if they +had been mapped to self-insert. +The default is ‘off’. +

+
+
echo-control-characters
+

When set to ‘on’, on operating systems that indicate they support it, +Readline echoes a character corresponding to a signal generated from the +keyboard. +The default is ‘on’. +

+
+
editing-mode
+

The editing-mode variable controls the default set of +key bindings. +By default, Readline starts up in emacs editing mode, where +the keystrokes are most similar to Emacs. +This variable can be set to either ‘emacs’ or ‘vi’. +

+
+
emacs-mode-string
+

If the show-mode-in-prompt variable is enabled, +this string is displayed immediately before the last line of the primary +prompt when emacs editing mode is active. +The value is expanded like a +key binding, so the standard set of meta- and control- prefixes and +backslash escape sequences is available. +The ‘\1’ and ‘\2’ escapes begin and end sequences of +non-printing characters, which can be used to embed a terminal control +sequence into the mode string. +The default is ‘@’. +

+
+
enable-active-region
+

point is the current cursor position, and mark refers to a +saved cursor position (see Commands For Moving). +The text between the point and mark is referred to as the region. +When this variable is set to ‘On’, Readline allows certain commands +to designate the region as active. +When the region is active, Readline highlights the text in the region using +the value of the active-region-start-color, which defaults to the +string that enables the terminal’s standout mode. +The active region shows the text inserted by bracketed-paste and any +matching text found by incremental and non-incremental history searches. +The default is ‘On’. +

+
+
enable-bracketed-paste
+

When set to ‘On’, Readline configures the terminal to insert each +paste into the editing buffer as a single string of characters, instead +of treating each character as if it had been read from the keyboard. +This is called putting the terminal into bracketed paste mode; +it prevents Readline from executing any editing commands bound +to key sequences appearing in the pasted text. +The default is ‘On’. +

+
+
enable-keypad
+

When set to ‘on’, Readline tries to enable the application +keypad when it is called. +Some systems need this to enable the arrow keys. +The default is ‘off’. +

+
+
enable-meta-key
+

When set to ‘on’, Readline tries to enable any meta +modifier key the terminal claims to support when it is called. +On many terminals, the Meta key is used to send eight-bit characters; +this variable checks for the terminal capability that indicates the +terminal can enable and disable a mode that sets the eighth bit of a +character (0200) if the Meta key is held down when the character is +typed (a meta character). +The default is ‘on’. +

+
+
expand-tilde
+

If set to ‘on’, Readline attempts tilde expansion when it +attempts word completion. +The default is ‘off’. +

+
+
force-meta-prefix
+

If set to ‘on’, Readline modifies its behavior when binding key +sequences containing \M- or Meta- +(see Key Bindings in Readline Init File Syntax) +by converting a key sequence of the form +\M-C or Meta-C to the two-character sequence +ESC C (adding the meta prefix). +If force-meta-prefix is set to ‘off’ (the default), +Readline uses the value of the convert-meta variable to determine +whether to perform this conversion: +if convert-meta is ‘on’, +Readline performs the conversion described above; +if it is ‘off’, Readline converts C to a meta character by +setting the eighth bit (0200). +The default is ‘off’. +

+
+
history-preserve-point
+

If set to ‘on’, the history code attempts to place the point (the +current cursor position) at the +same location on each history line retrieved with previous-history +or next-history. +The default is ‘off’. +

+
+
history-size
+

Set the maximum number of history entries saved in the history list. +If set to zero, any existing history entries are deleted and no new entries +are saved. +If set to a value less than zero, the number of history entries is not +limited. +By default, the number of history entries is not limited. +If you try to set history-size to a non-numeric value, +the maximum number of history entries will be set to 500. +

+
+
horizontal-scroll-mode
+

Setting this variable to ‘on’ means that the text of the lines +being edited will scroll horizontally on a single screen line when +the lines are longer than the width of the screen, instead of wrapping +onto a new screen line. +This variable is automatically set to ‘on’ for terminals of height 1. +By default, this variable is set to ‘off’. +

+
+
+input-meta
+

If set to ‘on’, Readline enables eight-bit input (that is, it +does not clear the eighth bit in the characters it reads), +regardless of what the terminal claims it can support. +The default value is ‘off’, but Readline sets it to ‘on’ +if the locale contains characters whose encodings may include bytes +with the eighth bit set. +This variable is dependent on the LC_CTYPE locale category, and +its value may change if the locale changes. +The name meta-flag is a synonym for input-meta. +

+
+
isearch-terminators
+

The string of characters that should terminate an incremental search without +subsequently executing the character as a command (see Searching for Commands in the History). +If this variable has not been given a value, the characters ESC and +C-j terminate an incremental search. +

+
+
keymap
+

Sets Readline’s idea of the current keymap for key binding commands. +Built-in keymap names are +emacs, +emacs-standard, +emacs-meta, +emacs-ctlx, +vi, +vi-move, +vi-command, and +vi-insert. +vi is equivalent to vi-command (vi-move is also a +synonym); emacs is equivalent to emacs-standard. +Applications may add additional names. +The default value is emacs; +the value of the editing-mode variable also affects the +default keymap. +

+
+
keyseq-timeout
+

Specifies the duration Readline will wait for a character when +reading an ambiguous key sequence +(one that can form a complete key sequence using the input read so far, +or can take additional input to complete a longer key sequence). +If Readline doesn’t receive any input within the timeout, it uses the +shorter but complete key sequence. +Readline uses this value to determine whether or not input is +available on the current input source (rl_instream by default). +The value is specified in milliseconds, so a value of 1000 means that +Readline will wait one second for additional input. +If this variable is set to a value less than or equal to zero, or to a +non-numeric value, Readline waits until another key is pressed to +decide which key sequence to complete. +The default value is 500. +

+
+
mark-directories
+

If set to ‘on’, completed directory names have a slash appended. +The default is ‘on’. +

+
+
mark-modified-lines
+

When this variable is set to ‘on’, Readline displays an +asterisk (‘*’) at the start of history lines which have been modified. +This variable is ‘off’ by default. +

+
+
mark-symlinked-directories
+

If set to ‘on’, completed names which are symbolic links to directories +have a slash appended, subject to the value of mark-directories. +The default is ‘off’. +

+
+
match-hidden-files
+

This variable, when set to ‘on’, forces Readline to match files whose +names begin with a ‘.’ (hidden files) when performing filename +completion. +If set to ‘off’, the user must include the leading ‘.’ +in the filename to be completed. +This variable is ‘on’ by default. +

+
+
menu-complete-display-prefix
+

If set to ‘on’, menu completion displays the common prefix of the +list of possible completions (which may be empty) before cycling through +the list. +The default is ‘off’. +

+
+
output-meta
+

If set to ‘on’, Readline displays characters with the +eighth bit set directly rather than as a meta-prefixed escape +sequence. +The default is ‘off’, but Readline sets it to ‘on’ +if the locale contains characters whose encodings may include +bytes with the eighth bit set. +This variable is dependent on the LC_CTYPE locale category, and +its value may change if the locale changes. +

+
+
page-completions
+

If set to ‘on’, Readline uses an internal pager resembling +more(1) +to display a screenful of possible completions at a time. +This variable is ‘on’ by default. +

+
+
prefer-visible-bell
+

See bell-style. +

+
+
print-completions-horizontally
+

If set to ‘on’, Readline displays completions with matches +sorted horizontally in alphabetical order, rather than down the screen. +The default is ‘off’. +

+
+
revert-all-at-newline
+

If set to ‘on’, Readline will undo all changes to history lines +before returning when executing accept-line. +By default, +history lines may be modified and retain individual undo lists across +calls to readline(). +The default is ‘off’. +

+
+
search-ignore-case
+

If set to ‘on’, Readline performs incremental and non-incremental +history list searches in a case-insensitive fashion. +The default value is ‘off’. +

+
+
show-all-if-ambiguous
+

This alters the default behavior of the completion functions. +If set to ‘on’, +words which have more than one possible completion cause the +matches to be listed immediately instead of ringing the bell. +The default value is ‘off’. +

+
+
show-all-if-unmodified
+

This alters the default behavior of the completion functions in +a fashion similar to show-all-if-ambiguous. +If set to ‘on’, +words which have more than one possible completion without any +possible partial completion (the possible completions don’t share +a common prefix) cause the matches to be listed immediately instead +of ringing the bell. +The default value is ‘off’. +

+
+
show-mode-in-prompt
+

If set to ‘on’, add a string to the beginning of the prompt +indicating the editing mode: emacs, vi command, or vi insertion. +The mode strings are user-settable (e.g., emacs-mode-string). +The default value is ‘off’. +

+
+
skip-completed-text
+

If set to ‘on’, this alters the default completion behavior when +inserting a single match into the line. +It’s only active when performing completion in the middle of a word. +If enabled, Readline does not insert characters from the completion +that match characters after point in the word being completed, +so portions of the word following the cursor are not duplicated. +For instance, if this is enabled, attempting completion when the cursor +is after the first ‘e’ in ‘Makefile’ will result in +‘Makefile’ rather than ‘Makefilefile’, +assuming there is a single possible completion. +The default value is ‘off’. +

+
+
vi-cmd-mode-string
+

If the show-mode-in-prompt variable is enabled, +this string is displayed immediately before the last line of the primary +prompt when vi editing mode is active and in command mode. +The value is expanded like a key binding, so the standard set of +meta- and control- prefixes and backslash escape sequences is available. +The ‘\1’ and ‘\2’ escapes begin and end sequences of +non-printing characters, which can be used to embed a terminal control +sequence into the mode string. +The default is ‘(cmd)’. +

+
+
vi-ins-mode-string
+

If the show-mode-in-prompt variable is enabled, +this string is displayed immediately before the last line of the primary +prompt when vi editing mode is active and in insertion mode. +The value is expanded like a key binding, so the standard set of +meta- and control- prefixes and backslash escape sequences is available. +The ‘\1’ and ‘\2’ escapes begin and end sequences of +non-printing characters, which can be used to embed a terminal control +sequence into the mode string. +The default is ‘(ins)’. +

+
+
visible-stats
+

If set to ‘on’, a character denoting a file’s type +is appended to the filename when listing possible +completions. +The default is ‘off’. +

+
+
+ +
+
Key Bindings
+

The syntax for controlling key bindings in the init file is simple. +First you need to find the name of the command that you +want to change. +The following sections contain tables of the command +name, the default keybinding, if any, and a short description of what +the command does. +

+

Once you know the name of the command, simply place on a line +in the init file the name of the key +you wish to bind the command to, a colon, and then the name of the +command. +There can be no space between the key name and the colon – that will be +interpreted as part of the key name. +The name of the key can be expressed in different ways, depending on +what you find most comfortable. +

+

In addition to command names, Readline allows keys to be bound +to a string that is inserted when the key is pressed (a macro). +The difference between a macro and a command is that a macro is +enclosed in single or double quotes. +

+ +
+
keynamefunction-name or macro
+

keyname is the name of a key spelled out in English. +For example: +

+
Control-u: universal-argument
+Meta-Rubout: backward-kill-word
+Control-o: "> output"
+
+ +

In the example above, C-u is bound to the function +universal-argument, +M-DEL is bound to the function backward-kill-word, and +C-o is bound to run the macro +expressed on the right hand side (that is, to insert the text +‘> output’ into the line). +

+

This key binding syntax recognizes a number of symbolic character names: +DEL, +ESC, +ESCAPE, +LFD, +NEWLINE, +RET, +RETURN, +RUBOUT +(a destructive backspace), +SPACE, +SPC, +and +TAB. +

+
+
"keyseq": function-name or macro
+

keyseq differs from keyname above in that strings +denoting an entire key sequence can be specified, by placing +the key sequence in double quotes. +Some GNU Emacs style key escapes can be used, +as in the following example, but none of the +special character names are recognized. +

+
+
"\C-u": universal-argument
+"\C-x\C-r": re-read-init-file
+"\e[11~": "Function Key 1"
+
+ +

In the above example, C-u is again bound to the function +universal-argument (just as it was in the first example), +‘C-x C-r’ is bound to the function re-read-init-file, +and ‘ESC [ 1 1 ~’ is bound to insert +the text ‘Function Key 1’. +

+
+
+ +

The following GNU Emacs style escape sequences are available when +specifying key sequences: +

+
+
\C-
+

A control prefix. +

+
\M-
+

Adding the meta prefix or converting the following character to a meta +character, as described above under force-meta-prefix +(see Variable Settings in Readline Init File Syntax). +

+
\e
+

An escape character. +

+
\\
+

Backslash. +

+
\"
+

", a double quotation mark. +

+
\'
+

', a single quote or apostrophe. +

+
+ +

In addition to the GNU Emacs style escape sequences, a second +set of backslash escapes is available: +

+
+
\a
+

alert (bell) +

+
\b
+

backspace +

+
\d
+

delete +

+
\f
+

form feed +

+
\n
+

newline +

+
\r
+

carriage return +

+
\t
+

horizontal tab +

+
\v
+

vertical tab +

+
\nnn
+

The eight-bit character whose value is the octal value nnn +(one to three digits). +

+
\xHH
+

The eight-bit character whose value is the hexadecimal value HH +(one or two hex digits). +

+
+ +

When entering the text of a macro, single or double quotes must +be used to indicate a macro definition. +Unquoted text is assumed to be a function name. +The backslash escapes described above are expanded +in the macro body. +Backslash will quote any other character in the macro text, +including ‘"’ and ‘'’. +For example, the following binding will make ‘C-x \’ +insert a single ‘\’ into the line: +

+
"\C-x\\": "\\"
+
+ +
+
+ +
+
+
+ +

1.3.2 Conditional Init Constructs

+ +

Readline implements a facility similar in spirit to the conditional +compilation features of the C preprocessor which allows key +bindings and variable settings to be performed as the result +of tests. +There are four parser directives available. +

+
+
$if
+

The $if construct allows bindings to be made based on the +editing mode, the terminal being used, or the application using +Readline. +The text of the test, after any comparison operator, +extends to the end of the line; +unless otherwise noted, no characters are required to isolate it. +

+
+
mode
+

The mode= form of the $if directive is used to test +whether Readline is in emacs or vi mode. +This may be used in conjunction +with the ‘set keymap’ command, for instance, to set bindings in +the emacs-standard and emacs-ctlx keymaps only if +Readline is starting out in emacs mode. +

+
+
term
+

The term= form may be used to include terminal-specific +key bindings, perhaps to bind the key sequences output by the +terminal’s function keys. +The word on the right side of the +‘=’ +is tested against both the full name of the terminal and the portion +of the terminal name before the first ‘-’. +This allows xterm to match both xterm and +xterm-256color, for instance. +

+
+
version
+

The version test may be used to perform comparisons against +specific Readline versions. +The version expands to the current Readline version. +The set of comparison operators includes +‘=’ (and ‘==’), ‘!=’, ‘<=’, ‘>=’, ‘<’, +and ‘>’. +The version number supplied on the right side of the operator consists +of a major version number, an optional decimal point, and an optional +minor version (e.g., ‘7.1’). +If the minor version is omitted, it +defaults to ‘0’. +The operator may be separated from the string version and +from the version number argument by whitespace. +The following example sets a variable if the Readline version being used +is 7.0 or newer: +

+
$if version >= 7.0
+set show-mode-in-prompt on
+$endif
+
+ +
+
application
+

The application construct is used to include +application-specific settings. +Each program using the Readline +library sets the application name, and you can test for +a particular value. +This could be used to bind key sequences to functions useful for +a specific program. +For instance, the following command adds a +key sequence that quotes the current or previous word in Bash: +

+
$if Bash
+# Quote the current or previous word
+"\C-xq": "\eb\"\ef\""
+$endif
+
+ +
+
variable
+

The variable construct provides simple equality tests for Readline +variables and values. +The permitted comparison operators are ‘=’, ‘==’, and ‘!=’. +The variable name must be separated from the comparison operator by +whitespace; the operator may be separated from the value on the right hand +side by whitespace. +String and boolean variables may be tested. +Boolean variables must be +tested against the values on and off. +The following example is equivalent to the mode=emacs test described +above: +

+
$if editing-mode == emacs
+set show-mode-in-prompt on
+$endif
+
+
+
+ +
+
$else
+

Commands in this branch of the $if directive are executed if +the test fails. +

+
+
$endif
+

This command, as seen in the previous example, terminates an +$if command. +

+
+
$include
+

This directive takes a single filename as an argument and reads commands +and key bindings from that file. +For example, the following directive reads from /etc/inputrc: +

+
$include /etc/inputrc
+
+
+
+ +
+
+
+ +

1.3.3 Sample Init File

+ +

Here is an example of an inputrc file. This illustrates key +binding, variable assignment, and conditional syntax. +

+
+
# This file controls the behavior of line input editing for
+# programs that use the GNU Readline library.  Existing
+# programs include FTP, Bash, and GDB.
+#
+# You can re-read the inputrc file with C-x C-r.
+# Lines beginning with '#' are comments.
+#
+# First, include any system-wide bindings and variable
+# assignments from /etc/Inputrc
+$include /etc/Inputrc
+
+#
+# Set various bindings for emacs mode.
+
+set editing-mode emacs 
+
+$if mode=emacs
+
+Meta-Control-h:	backward-kill-word	Text after the function name is ignored
+
+#
+# Arrow keys in keypad mode
+#
+#"\M-OD":        backward-char
+#"\M-OC":        forward-char
+#"\M-OA":        previous-history
+#"\M-OB":        next-history
+#
+# Arrow keys in ANSI mode
+#
+"\M-[D":        backward-char
+"\M-[C":        forward-char
+"\M-[A":        previous-history
+"\M-[B":        next-history
+#
+# Arrow keys in 8 bit keypad mode
+#
+#"\M-\C-OD":       backward-char
+#"\M-\C-OC":       forward-char
+#"\M-\C-OA":       previous-history
+#"\M-\C-OB":       next-history
+#
+# Arrow keys in 8 bit ANSI mode
+#
+#"\M-\C-[D":       backward-char
+#"\M-\C-[C":       forward-char
+#"\M-\C-[A":       previous-history
+#"\M-\C-[B":       next-history
+
+C-q: quoted-insert
+
+$endif
+
+# An old-style binding.  This happens to be the default.
+TAB: complete
+
+# Macros that are convenient for shell interaction
+$if Bash
+# edit the path
+"\C-xp": "PATH=${PATH}\e\C-e\C-a\ef\C-f"
+# prepare to type a quoted word --
+# insert open and close double quotes
+# and move to just after the open quote
+"\C-x\"": "\"\"\C-b"
+# insert a backslash (testing backslash escapes
+# in sequences and macros)
+"\C-x\\": "\\"
+# Quote the current or previous word
+"\C-xq": "\eb\"\ef\""
+# Add a binding to refresh the line, which is unbound
+"\C-xr": redraw-current-line
+# Edit variable on current line.
+"\M-\C-v": "\C-a\C-k$\C-y\M-\C-e\C-a\C-y="
+$endif
+
+# use a visible bell if one is available
+set bell-style visible
+
+# don't strip characters to 7 bits when reading
+set input-meta on
+
+# allow iso-latin1 characters to be inserted rather
+# than converted to prefix-meta sequences
+set convert-meta off
+
+# display characters with the eighth bit set directly
+# rather than as meta-prefixed characters
+set output-meta on
+
+# if there are 150 or more possible completions for a word,
+# ask whether or not the user wants to see all of them
+set completion-query-items 150
+
+# For FTP
+$if Ftp
+"\C-xg": "get \M-?"
+"\C-xt": "put \M-?"
+"\M-.": yank-last-arg
+$endif
+
+ +
+
+
+
+ +

1.4 Bindable Readline Commands

+ + +

This section describes Readline commands that may be bound to key +sequences. +Command names without an accompanying key sequence are unbound by default. +

+

In the following descriptions, point refers to the current cursor +position, and mark refers to a cursor position saved by the +set-mark command. +The text between the point and mark is referred to as the region. +Readline +has the concept of an active region: +when the region is active, +Readline redisplay highlights the region using the +value of the +active-region-start-color +variable. +The enable-active-region variable turns this on and off. +Several commands set the region to active; those are noted below. +

+ +
+
+ +

1.4.1 Commands For Moving

+
+
beginning-of-line (C-a)
+

Move to the start of the current line. +This may also be bound to the Home key on some keyboards. +

+
+
end-of-line (C-e)
+

Move to the end of the line. +This may also be bound to the End key on some keyboards. +

+
+
forward-char (C-f)
+

Move forward a character. +This may also be bound to the right arrow key on some keyboards. +

+
+
backward-char (C-b)
+

Move back a character. +This may also be bound to the left arrow key on some keyboards. +

+
+
forward-word (M-f)
+

Move forward to the end of the next word. +Words are composed of letters and digits. +

+
+
backward-word (M-b)
+

Move back to the start of the current or previous word. +Words are composed of letters and digits. +

+ +
+
previous-screen-line ()
+

Attempt to move point to the same physical screen column on the previous +physical screen line. +This will not have the desired effect if the current +Readline line does not take up more than one physical line or if point is not +greater than the length of the prompt plus the screen width. +

+
+
next-screen-line ()
+

Attempt to move point to the same physical screen column on the next +physical screen line. +This will not have the desired effect if the current +Readline line does not take up more than one physical line or if the length +of the current Readline line is not greater than the length of the prompt +plus the screen width. +

+
+
clear-display (M-C-l)
+

Clear the screen and, if possible, the terminal’s scrollback buffer, +then redraw the current line, +leaving the current line at the top of the screen. +

+
+
clear-screen (C-l)
+

Clear the screen, +then redraw the current line, +leaving the current line at the top of the screen. +If given a numeric argument, this refreshes the current line +without clearing the screen. +

+
+
redraw-current-line ()
+

Refresh the current line. By default, this is unbound. +

+
+
+ +
+
+
+ +

1.4.2 Commands For Manipulating The History

+ +
+
accept-line (Newline or Return)
+

Accept the line regardless of where the cursor is. +If this line is non-empty, you can add it to the history list using +add_history(). +If this line is a modified history line, then restore the history line +to its original state. +

+
+
previous-history (C-p)
+

Move ‘back’ through the history list, fetching the previous command. +This may also be bound to the up arrow key on some keyboards. +

+
+
next-history (C-n)
+

Move ‘forward’ through the history list, fetching the next command. +This may also be bound to the down arrow key on some keyboards. +

+
+
beginning-of-history (M-<)
+

Move to the first line in the history. +

+
+
end-of-history (M->)
+

Move to the end of the input history, i.e., the line currently +being entered. +

+
+
reverse-search-history (C-r)
+

Search backward starting at the current line and moving ‘up’ through +the history as necessary. +This is an incremental search. +This command sets the region to the matched text and activates the region. +

+
+
forward-search-history (C-s)
+

Search forward starting at the current line and moving ‘down’ through +the history as necessary. +This is an incremental search. +This command sets the region to the matched text and activates the region. +

+
+
non-incremental-reverse-search-history (M-p)
+

Search backward starting at the current line and moving ‘up’ +through the history as necessary using a non-incremental search +for a string supplied by the user. +The search string may match anywhere in a history line. +

+
+
non-incremental-forward-search-history (M-n)
+

Search forward starting at the current line and moving ‘down’ +through the history as necessary using a non-incremental search +for a string supplied by the user. +The search string may match anywhere in a history line. +

+
+
history-search-backward ()
+

Search backward through the history for the string of characters +between the start of the current line and the point. +The search string must match at the beginning of a history line. +This is a non-incremental search. +By default, this command is unbound, but may be bound to the Page Down +key on some keyboards. +

+
+
history-search-forward ()
+

Search forward through the history for the string of characters +between the start of the current line and the point. +The search string must match at the beginning of a history line. +This is a non-incremental search. +By default, this command is unbound, but may be bound to the Page Up +key on some keyboards. +

+
+
history-substring-search-backward ()
+

Search backward through the history for the string of characters +between the start of the current line and the point. +The search string may match anywhere in a history line. +This is a non-incremental search. +By default, this command is unbound. +

+
+
history-substring-search-forward ()
+

Search forward through the history for the string of characters +between the start of the current line and the point. +The search string may match anywhere in a history line. +This is a non-incremental search. +By default, this command is unbound. +

+
+
yank-nth-arg (M-C-y)
+

Insert the first argument to the previous command (usually +the second word on the previous line) at point. +With an argument n, +insert the nth word from the previous command (the words +in the previous command begin with word 0). +A negative argument inserts the nth word from the end of +the previous command. +Once the argument n is computed, +this uses the history expansion facilities to extract the +nth word, as if the +‘!n’ history expansion had been specified. +

+
+
yank-last-arg (M-. or M-_)
+

Insert last argument to the previous command (the last word of the +previous history entry). +With a numeric argument, behave exactly like yank-nth-arg. +Successive calls to yank-last-arg move back through the history +list, inserting the last word (or the word specified by the argument to +the first call) of each line in turn. +Any numeric argument supplied to these successive calls determines +the direction to move through the history. +A negative argument switches the direction through the history +(back or forward). +This uses the history expansion facilities to extract the +last word, as if the +‘!$’ history expansion had been specified. +

+
+
operate-and-get-next (C-o)
+

Accept the current line for return to the calling application as if a +newline had been entered, +and fetch the next line relative to the current line from the history +for editing. +A numeric argument, if supplied, specifies the history entry +to use instead of the current line. +

+
+
fetch-history ()
+

With a numeric argument, fetch that entry from the history list +and make it the current line. +Without an argument, move back to the first entry in the history list. +

+
+
+ +
+
+
+ +

1.4.3 Commands For Changing Text

+ +
+
end-of-file (usually C-d)
+

The character indicating end-of-file as set, for example, by +stty. +If this character is read when there are no characters +on the line, and point is at the beginning of the line, Readline +interprets it as the end of input and returns EOF. +

+
+
delete-char (C-d)
+

Delete the character at point. +If this function is bound to the +same character as the tty EOF character, as C-d +commonly is, see above for the effects. +This may also be bound to the Delete key on some keyboards. +

+
+
backward-delete-char (Rubout)
+

Delete the character behind the cursor. +A numeric argument means +to kill the characters, saving them on the kill ring, +instead of deleting them. +

+
+
forward-backward-delete-char ()
+

Delete the character under the cursor, unless the cursor is at the +end of the line, in which case the character behind the cursor is +deleted. +By default, this is not bound to a key. +

+
+
quoted-insert (C-q or C-v)
+

Add the next character typed to the line verbatim. +This is how to insert key sequences like C-q, for example. +

+
+
tab-insert (M-TAB)
+

Insert a tab character. +

+
+
self-insert (a, b, A, 1, !, …)
+

Insert the character typed. +

+
+
bracketed-paste-begin ()
+

This function is intended to be bound to the "bracketed paste" escape +sequence sent by some terminals, and such a binding is assigned by default. +It allows Readline to insert the pasted text as a single unit without treating +each character as if it had been read from the keyboard. +The characters +are inserted as if each one was bound to self-insert instead of +executing any editing commands. +

+

Bracketed paste sets the region (the characters between point and the mark) +to the inserted text. +It sets the active region. +

+
+
transpose-chars (C-t)
+

Drag the character before the cursor forward over +the character at the cursor, moving the +cursor forward as well. +If the insertion point +is at the end of the line, then this +transposes the last two characters of the line. +Negative arguments have no effect. +

+
+
transpose-words (M-t)
+

Drag the word before point past the word after point, +moving point past that word as well. +If the insertion point is at the end of the line, this transposes +the last two words on the line. +

+ +
+
upcase-word (M-u)
+

Uppercase the current (or following) word. +With a negative argument, +uppercase the previous word, but do not move the cursor. +

+
+
downcase-word (M-l)
+

Lowercase the current (or following) word. +With a negative argument, +lowercase the previous word, but do not move the cursor. +

+
+
capitalize-word (M-c)
+

Capitalize the current (or following) word. +With a negative argument, +capitalize the previous word, but do not move the cursor. +

+
+
overwrite-mode ()
+

Toggle overwrite mode. +With an explicit positive numeric argument, switches to overwrite mode. +With an explicit non-positive numeric argument, switches to insert mode. +This command affects only emacs mode; +vi mode does overwrite differently. +Each call to readline() starts in insert mode. +

+

In overwrite mode, characters bound to self-insert replace +the text at point rather than pushing the text to the right. +Characters bound to backward-delete-char replace the character +before point with a space. +

+

By default, this command is unbound, but may be bound to the Insert +key on some keyboards. +

+
+
+ +
+
+
+ +

1.4.4 Killing And Yanking

+ +
+
kill-line (C-k)
+

Kill the text from point to the end of the current line. +With a negative numeric argument, kill backward from the cursor to the +beginning of the line. +

+
+
backward-kill-line (C-x Rubout)
+

Kill backward from the cursor to the beginning of the current line. +With a negative numeric argument, kill forward from the cursor to the +end of the line. +

+
+
unix-line-discard (C-u)
+

Kill backward from the cursor to the beginning of the current line. +

+
+
kill-whole-line ()
+

Kill all characters on the current line, no matter where point is. +By default, this is unbound. +

+
+
kill-word (M-d)
+

Kill from point to the end of the current word, or if between +words, to the end of the next word. +Word boundaries are the same as forward-word. +

+
+
backward-kill-word (M-DEL)
+

Kill the word behind point. +Word boundaries are the same as backward-word. +

+ +
+
unix-word-rubout (C-w)
+

Kill the word behind point, using white space as a word boundary, +saving the killed text on the kill-ring. +

+
+
unix-filename-rubout ()
+

Kill the word behind point, using white space and the slash character +as the word boundaries, +saving the killed text on the kill-ring. +

+
+
delete-horizontal-space ()
+

Delete all spaces and tabs around point. +By default, this is unbound. +

+
+
kill-region ()
+

Kill the text in the current region. +By default, this command is unbound. +

+
+
copy-region-as-kill ()
+

Copy the text in the region to the kill buffer, so it can be yanked +right away. +By default, this command is unbound. +

+
+
copy-backward-word ()
+

Copy the word before point to the kill buffer. +The word boundaries are the same as backward-word. +By default, this command is unbound. +

+
+
copy-forward-word ()
+

Copy the word following point to the kill buffer. +The word boundaries are the same as forward-word. +By default, this command is unbound. +

+
+
yank (C-y)
+

Yank the top of the kill ring into the buffer at point. +

+
+
yank-pop (M-y)
+

Rotate the kill-ring, and yank the new top. +You can only do this if +the prior command is yank or yank-pop. +

+
+ +
+
+
+ +

1.4.5 Specifying Numeric Arguments

+
+
digit-argument (M-0, M-1, … M--)
+

Add this digit to the argument already accumulating, or start a new +argument. +M-- starts a negative argument. +

+
+
universal-argument ()
+

This is another way to specify an argument. +If this command is followed by one or more digits, optionally with a +leading minus sign, those digits define the argument. +If the command is followed by digits, executing universal-argument +again ends the numeric argument, but is otherwise ignored. +As a special case, if this command is immediately followed by a +character that is neither a digit nor minus sign, the argument count +for the next command is multiplied by four. +The argument count is initially one, so executing this function the +first time makes the argument count four, a second time makes the +argument count sixteen, and so on. +By default, this is not bound to a key. +

+
+ +
+
+
+ +

1.4.6 Letting Readline Type For You

+ +
+
complete (TAB)
+

Attempt to perform completion on the text before point. +The actual completion performed is application-specific. +The default is filename completion. +

+
+
possible-completions (M-?)
+

List the possible completions of the text before point. +When displaying completions, Readline sets the number of columns used +for display to the value of completion-display-width, the value of +the environment variable COLUMNS, or the screen width, in that order. +

+
+
insert-completions (M-*)
+

Insert all completions of the text before point that would have +been generated by possible-completions, +separated by a space. +

+
+
menu-complete ()
+

Similar to complete, but replaces the word to be completed +with a single match from the list of possible completions. +Repeatedly executing menu-complete steps through the list +of possible completions, inserting each match in turn. +At the end of the list of completions, +menu-complete rings the bell +(subject to the setting of bell-style) +and restores the original text. +An argument of n moves n positions forward in the list +of matches; a negative argument moves backward through the list. +This command is intended to be bound to TAB, but is unbound +by default. +

+
+
menu-complete-backward ()
+

Identical to menu-complete, but moves backward through the list +of possible completions, as if menu-complete had been given a +negative argument. +This command is unbound by default. +

+
+
export-completions ()
+

Perform completion on the word before point as described above +and write the list of possible completions to Readline’s output stream +using the following format, writing information on separate lines: +

+
    +
  • the number of matches N; +
  • the word being completed; +
  • S:E, +where S and E are the start and end offsets of the word +in the Readline line buffer; then +
  • each match, one per line +
+ +

If there are no matches, the first line will be “0”, +and this command does not print any output after the S:E. +If there is only a single match, this prints a single line containing it. +If there is more than one match, this prints the common prefix of the +matches, which may be empty, on the first line after the S:E, +then the matches on subsequent lines. +In this case, N will include the first line with the common prefix. +

+

The user or application +should be able to accommodate the possibility of a blank line. +The intent is that the user or application reads N lines after +the line containing S:E to obtain the match list. +This command is unbound by default. +

+
+
delete-char-or-list ()
+

Deletes the character under the cursor if not at the beginning or +end of the line (like delete-char). +At the end of the line, it behaves identically to possible-completions. +This command is unbound by default. +

+
+
+ +
+
+
+ +

1.4.7 Keyboard Macros

+
+
start-kbd-macro (C-x ()
+

Begin saving the characters typed into the current keyboard macro. +

+
+
end-kbd-macro (C-x ))
+

Stop saving the characters typed into the current keyboard macro +and save the definition. +

+
+
call-last-kbd-macro (C-x e)
+

Re-execute the last keyboard macro defined, by making the characters +in the macro appear as if typed at the keyboard. +

+
+
print-last-kbd-macro ()
+

Print the last keyboard macro defined in a format suitable for the +inputrc file. +

+
+
+ +
+
+
+ +

1.4.8 Some Miscellaneous Commands

+
+
re-read-init-file (C-x C-r)
+

Read in the contents of the inputrc file, and incorporate +any bindings or variable assignments found there. +

+
+
abort (C-g)
+

Abort the current editing command and +ring the terminal’s bell (subject to the setting of +bell-style). +

+
+
do-lowercase-version (M-A, M-B, M-x, …)
+

If the metafied character x is upper case, run the command +that is bound to the corresponding metafied lower case character. +The behavior is undefined if x is already lower case. +

+
+
prefix-meta (ESC)
+

Metafy the next character typed. +Typing ‘ESC f’ is equivalent to typing M-f. +

+
+
undo (C-_ or C-x C-u)
+

Incremental undo, separately remembered for each line. +

+
+
revert-line (M-r)
+

Undo all changes made to this line. +This is like executing the undo +command enough times to get back to the initial state. +

+
+
tilde-expand (M-~)
+

Perform tilde expansion on the current word. +

+
+
set-mark (C-@)
+

Set the mark to the point. +If a numeric argument is supplied, set the mark to that position. +

+
+
exchange-point-and-mark (C-x C-x)
+

Swap the point with the mark. +Set the current cursor position to the saved position, +then set the mark to the old cursor position. +

+
+
character-search (C-])
+

Read a character and move point to the next occurrence of that character. +A negative argument searches for previous occurrences. +

+
+
character-search-backward (M-C-])
+

Read a character and move point to the previous occurrence of that character. +A negative argument searches for subsequent occurrences. +

+
+
skip-csi-sequence ()
+

Read enough characters to consume a multi-key sequence such as those +defined for keys like Home and End. +CSI sequences begin with a Control Sequence Indicator (CSI), usually +ESC [. +If this sequence is bound to "\e[", +keys producing CSI sequences have no effect +unless explicitly bound to a Readline command, +instead of inserting stray characters into the editing buffer. +This is unbound by default, but usually bound to +ESC [. +

+
+
insert-comment (M-#)
+

Without a numeric argument, insert the value of the comment-begin +variable at the beginning of the current line. +If a numeric argument is supplied, this command acts as a toggle: if +the characters at the beginning of the line do not match the value +of comment-begin, insert the value; otherwise delete +the characters in comment-begin from the beginning of the line. +In either case, the line is accepted as if a newline had been typed. +

+
+
dump-functions ()
+

Print all of the functions and their key bindings +to the Readline output stream. +If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an inputrc file. +This command is unbound by default. +

+
+
dump-variables ()
+

Print all of the settable variables and their values +to the Readline output stream. +If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an inputrc file. +This command is unbound by default. +

+
+
dump-macros ()
+

Print all of the Readline key sequences bound to macros and the +strings they output +to the Readline output stream. +If a numeric argument is supplied, +the output is formatted in such a way that it can be made part +of an inputrc file. +This command is unbound by default. +

+
+
execute-named-command (M-x)
+

Read a bindable Readline command name from the input and execute the +function to which it’s bound, as if the key sequence to which it was +bound appeared in the input. +If this function is supplied with a numeric argument, it passes that +argument to the function it executes. +

+ +
+
emacs-editing-mode (C-e)
+

When in vi command mode, this causes a switch to emacs +editing mode. +

+
+
vi-editing-mode (M-C-j)
+

When in emacs editing mode, this causes a switch to vi +editing mode. +

+ +
+
+ +
+
+
+
+ +

1.5 Readline vi Mode

+ +

While the Readline library does not have a full set of vi +editing functions, it does contain enough to allow simple editing +of the line. +The Readline vi mode behaves as specified in the +sh description in the POSIX standard. +

+

In order to switch interactively between emacs and vi +editing modes, use the command M-C-j (bound to emacs-editing-mode +when in vi mode and to vi-editing-mode in emacs mode). +The Readline default is emacs mode. +

+

When you enter a line in vi mode, you are already placed in +‘insertion’ mode, as if you had typed an ‘i’. Pressing ESC +switches you into ‘command’ mode, where you can edit the text of the +line with the standard vi movement keys, move to previous +history lines with ‘k’ and subsequent lines with ‘j’, and +so forth. +

+ +
+
+
+
+ +

Appendix A GNU Free Documentation License

+ +
Version 1.3, 3 November 2008 +
+ +
+
Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+http://fsf.org/
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+ +
    +
  1. PREAMBLE + +

    The purpose of this License is to make a manual, textbook, or other +functional and useful document free in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. +

    +

    This License is a kind of “copyleft”, which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. +

    +

    We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. +

    +
  2. APPLICABILITY AND DEFINITIONS + +

    This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The “Document”, below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as “you”. You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. +

    +

    A “Modified Version” of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. +

    +

    A “Secondary Section” is a named appendix or a front-matter section +of the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document’s overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. +

    +

    The “Invariant Sections” are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. +

    +

    The “Cover Texts” are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. +

    +

    A “Transparent” copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not “Transparent” is called “Opaque”. +

    +

    Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input +format, SGML or XML using a publicly available +DTD, and standard-conforming simple HTML, +PostScript or PDF designed for human modification. Examples +of transparent image formats include PNG, XCF and +JPG. Opaque formats include proprietary formats that can be +read and edited only by proprietary word processors, SGML or +XML for which the DTD and/or processing tools are +not generally available, and the machine-generated HTML, +PostScript or PDF produced by some word processors for +output purposes only. +

    +

    The “Title Page” means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, “Title Page” means +the text near the most prominent appearance of the work’s title, +preceding the beginning of the body of the text. +

    +

    The “publisher” means any person or entity that distributes copies +of the Document to the public. +

    +

    A section “Entitled XYZ” means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as “Acknowledgements”, +“Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” +of such a section when you modify the Document means that it remains a +section “Entitled XYZ” according to this definition. +

    +

    The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. +

    +
  3. VERBATIM COPYING + +

    You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. +

    +

    You may also lend copies, under the same conditions stated above, and +you may publicly display copies. +

    +
  4. COPYING IN QUANTITY + +

    If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document’s license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. +

    +

    If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. +

    +

    If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. +

    +

    It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. +

    +
  5. MODIFICATIONS + +

    You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: +

    +
      +
    1. Use in the Title Page (and on the covers, if any) a title distinct +from that of the Document, and from those of previous versions +(which should, if there were any, be listed in the History section +of the Document). You may use the same title as a previous version +if the original publisher of that version gives permission. + +
    2. List on the Title Page, as authors, one or more persons or entities +responsible for authorship of the modifications in the Modified +Version, together with at least five of the principal authors of the +Document (all of its principal authors, if it has fewer than five), +unless they release you from this requirement. + +
    3. State on the Title page the name of the publisher of the +Modified Version, as the publisher. + +
    4. Preserve all the copyright notices of the Document. + +
    5. Add an appropriate copyright notice for your modifications +adjacent to the other copyright notices. + +
    6. Include, immediately after the copyright notices, a license notice +giving the public permission to use the Modified Version under the +terms of this License, in the form shown in the Addendum below. + +
    7. Preserve in that license notice the full lists of Invariant Sections +and required Cover Texts given in the Document’s license notice. + +
    8. Include an unaltered copy of this License. + +
    9. Preserve the section Entitled “History”, Preserve its Title, and add +to it an item stating at least the title, year, new authors, and +publisher of the Modified Version as given on the Title Page. If +there is no section Entitled “History” in the Document, create one +stating the title, year, authors, and publisher of the Document as +given on its Title Page, then add an item describing the Modified +Version as stated in the previous sentence. + +
    10. Preserve the network location, if any, given in the Document for +public access to a Transparent copy of the Document, and likewise +the network locations given in the Document for previous versions +it was based on. These may be placed in the “History” section. +You may omit a network location for a work that was published at +least four years before the Document itself, or if the original +publisher of the version it refers to gives permission. + +
    11. For any section Entitled “Acknowledgements” or “Dedications”, Preserve +the Title of the section, and preserve in the section all the +substance and tone of each of the contributor acknowledgements and/or +dedications given therein. + +
    12. Preserve all the Invariant Sections of the Document, +unaltered in their text and in their titles. Section numbers +or the equivalent are not considered part of the section titles. + +
    13. Delete any section Entitled “Endorsements”. Such a section +may not be included in the Modified Version. + +
    14. Do not retitle any existing section to be Entitled “Endorsements” or +to conflict in title with any Invariant Section. + +
    15. Preserve any Warranty Disclaimers. +
    + +

    If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version’s license notice. +These titles must be distinct from any other section titles. +

    +

    You may add a section Entitled “Endorsements”, provided it contains +nothing but endorsements of your Modified Version by various +parties—for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. +

    +

    You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. +

    +

    The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. +

    +
  6. COMBINING DOCUMENTS + +

    You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. +

    +

    The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. +

    +

    In the combination, you must combine any sections Entitled “History” +in the various original documents, forming one section Entitled +“History”; likewise combine any sections Entitled “Acknowledgements”, +and any sections Entitled “Dedications”. You must delete all +sections Entitled “Endorsements.” +

    +
  7. COLLECTIONS OF DOCUMENTS + +

    You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. +

    +

    You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. +

    +
  8. AGGREGATION WITH INDEPENDENT WORKS + +

    A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an “aggregate” if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation’s users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. +

    +

    If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document’s Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. +

    +
  9. TRANSLATION + +

    Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. +

    +

    If a section in the Document is Entitled “Acknowledgements”, +“Dedications”, or “History”, the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. +

    +
  10. TERMINATION + +

    You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. +

    +

    However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. +

    +

    Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. +

    +

    Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. +

    +
  11. FUTURE REVISIONS OF THIS LICENSE + +

    The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +http://www.gnu.org/copyleft/. +

    +

    Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License “or any later version” applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy’s public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. +

    +
  12. RELICENSING + +

    “Massive Multiauthor Collaboration Site” (or “MMC Site”) means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +“Massive Multiauthor Collaboration” (or “MMC”) contained in the +site means any set of copyrightable works thus published on the MMC +site. +

    +

    “CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. +

    +

    “Incorporate” means to publish or republish a Document, in whole or +in part, as part of another Document. +

    +

    An MMC is “eligible for relicensing” if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole +or in part into the MMC, (1) had no cover texts or invariant sections, +and (2) were thus incorporated prior to November 1, 2008. +

    +

    The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. +

    +
+ +

ADDENDUM: How to use this License for your documents

+ +

To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: +

+
+
  Copyright (C)  year  your name.
+  Permission is granted to copy, distribute and/or modify this document
+  under the terms of the GNU Free Documentation License, Version 1.3
+  or any later version published by the Free Software Foundation;
+  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+  Texts.  A copy of the license is included in the section entitled ``GNU
+  Free Documentation License''.
+
+ +

If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the “with…Texts.” line with this: +

+
+
    with the Invariant Sections being list their titles, with
+    the Front-Cover Texts being list, and with the Back-Cover Texts
+    being list.
+
+ +

If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. +

+

If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. +

+ + +
+
+ + + + + diff --git a/miniconda3/share/doc/recordproto/record.xml b/miniconda3/share/doc/recordproto/record.xml new file mode 100644 index 0000000000000000000000000000000000000000..6b158957e48219bb78461f52a94e739aa73d1e1d --- /dev/null +++ b/miniconda3/share/doc/recordproto/record.xml @@ -0,0 +1,1904 @@ + + %defs; +]> + + + + + + + Record Extension Protocol Specification + X Consortium Standard + + + MarthaZimet + Network Computing Devices, Inc. + + + StephenGildea + X Consortium + + + X Version 11, Release &fullrelvers; + 1994Network Computing Devices, Inc. + + + + +Permission to use, copy, modify, distribute, and sell this +documentation for any purpose is hereby granted without fee, +provided that the above copyright notice and this permission +notice appear in all copies. Network Computing Devices, Inc. +makes no representations about the suitability for any purpose +of the information in this document. This documentation is +provided “as is” without express or implied warranty. + + + + +Copyright © 1994, 1995 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + + + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + + + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + + + +Except as contained in this notice, the name of the X Consortium and +shall not be used in advertising or otherwise to promote the sale, use +or other dealings in this Software without prior written authorization +from the X Consortium. + +X Window System is a trademark of The Open Group. + + + + +Introduction + +Several proposals have been written over the past few years that address some +of the issues surrounding the recording and playback of user actions +in the X Window System +X Window System is a trademark of The Open Group. + +: + + + + + +Some Proposals for a Minimal X11 Testing Extension, +Kieron Drake, UniSoft Ltd., April 1991 + + + + +X11 Input Synthesis Extension Proposal, Larry Woestman, +Hewlett Packard, November 1991 + + + + +XTrap Architecture, Dick Annicchiario, et al, Digital Equipment Corporation, +July 1991 + + + + +XTest Extension Recording Specification, Yochanan Slonim, +Mercury Interactive, December 1992 + + + + + +This document both unifies and extends the previous diverse approaches +to generate a proposal for an X extension that provides support for +the recording of all core X protocol and arbitrary extension protocol. +Input synthesis, or playback, has already been implemented in the +XTest extension, an X Consortium standard. Therefore, this extension +is limited to recording. + + + +In order to provide both record and playback functionality, a +hypothetical record application could use this extension to capture +both user actions and their consequences. For example, a button press +(a user action) may cause a window to be mapped and a corresponding +MapNotify +event to be sent (a consequence). This information could be +stored for later use by a playback application. + + + +The playback application could use the recorded actions as input for +the XTest extension's +XTestFakeInput +operation to synthesize the +appropriate input events. The "consequence" or synchronization +information is then used as a synchronization point during playback. +That is, the playback application does not generate specific +synthesized events until their matching synchronization condition +occurs. When the condition occurs the processing of synthesized +events continues. Determination that the condition has occurred may be +made by capturing the consequences of the synthesized events and +comparing them to the previously recorded synchronization information. +For example, if a button press was followed by a +MapNotify +event on a +particular window in the recorded data, the playback application might +synthesize the button press then wait for the +MapNotify +event on the +appropriate window before proceeding with subsequent synthesized +input. + + + +Because +it is impossible to predict what synchronization information will be +required by a particular application, the extension provides +facilities to record any subset of core X protocol and arbitrary +extension protocol. +As such, this extension does not enforce a specific +synchronization methodology; any method based on information in the X +protocol stream (e.g., watching for window mapping/unmapping, cursor +changes, drawing of certain text strings, etc.) can capture the +information it needs using RECORD facilities. + + + +Acknowledgements + +The document represents the culmination of two years of debate and +experiments done under the auspices of the X Consortium xtest working +group. Although this was a group effort, the author remains +responsible for any errors or omissions. +Two years ago, Robert Chesler of Absol-puter, Kieron Drake of UniSoft +Ltd., Marc Evans of Synergytics and Ken Miller of Digital shared the +vision of a standard extension for recording and were all instrumental +in the early protocol development. During the last two years, Bob +Scheifler of the X Consortium and Jim Fulton of NCD continuously +provided input to the protocol design, as well as encouragement to the +author. In the last few months, Stephen Gildea and Dave Wiggins, +both X Consortium staff, have spent considerable time fine tuning the +protocol design and reviewing the protocol specifications. Most +recently, Amnon Cohen of Mercury Interactive has assisted in +clarification of the recorded event policy, and Kent Siefkes of +Performance Awareness has assisted in clarification of the timestamp +policy. + + + + +Goals + + + +To provide a standard for recording, +whereby both device events and synchronization information in the +form of device event consequences are recorded. + + + + +To record contextual information used in synchronized playback +without prior knowledge of the application +that +is being recorded. + + + + +To provide the ability to record arbitrary X protocol extensions. + + + + + + + +Requirements + +The extension should function as follows: + + + + + +It should +not be dependent on other clients or extensions for its operation. + + + + +It should +not significantly impact performance. + + + + +It should +support the recording of all device input (core devices and XInput devices). + + + + +It should +be extendible. + + + + +It should +support the recording of synchronization information for user events. + + + + + + + +Design + +This section gives an overview of the RECORD extension and discusses +its overall operation and data types. + + + +Overview + +The mechanism used by this extension for recording is to intercept +core X protocol and arbitrary X extension protocol entirely within the X server +itself. When the extension has been requested to intercept specific +protocol by one or more clients, the protocol data are formatted and +returned to the recording clients. + + + +The extension provides a mechanism for capturing all events, including +input device events that go to no clients, that is analogous to a client +expressing "interest" in all events in all windows, including the root +window. Event filtering in the extension provides a mechanism for feeding +device events to recording clients; it does not provide a mechanism for +in-place, synchronous event substitution, modification, or withholding. +In addition, the +extension does not provide data compression before intercepted protocol +is returned to the recording clients. + + +Data Delivery + + + + + +Because +events are limited in size to +32 bytes, using events to return intercepted protocol data to recording +clients is prohibitive in terms of performance. Therefore, intercepted +protocol data are returned to recording clients through multiple replies +to the extension request to begin protocol interception and reporting. +This utilization is consistent with +ListFontsWithInfo , +for example, where a +single request has multiple replies. + + + +Individual requests, replies, events or errors intercepted by the extension +on behalf of recording clients cannot be split across reply packets. In order +to reduce overhead, multiple intercepted requests, replies, events and errors +might be collected +into a single reply. +Nevertheless, all data are returned to the client in a timely manner. + + + +Record Context + + + + + +The extension adds a record context resource (RC) +to the set of resources managed by the server. All the +extension operations take an RC as an argument. Although the protocol +permits sharing of RCs between clients, it is expected that clients will +use their own RCs. The attributes used in extension operations are stored +in the RCs, and these attributes include the protocol and clients to +intercept. + + + +The terms "register" and "unregister" are used to describe the +relationship between clients to intercept and the RC. To register +a client with an RC means the client is added to the list +of clients to intercept; to unregister a client means the client +is deleted from the list of clients to intercept. When the +server is requested to register or unregister clients from an RC, +it is required to do so immediately. That is, it is not permissible for +the server to wait until recording is enabled to register clients +or recording is disabled to unregister clients. + + + + +Record Client Connections + + + + + +The typical communication model for a recording client is to open +two connections to the server and use one for RC control and +the other for reading protocol data. + + + +The "control" connection can execute requests to obtain information about +the supported protocol version, create and destroy RCs, specify protocol +types to intercept and clients to be recorded, query the current state +of an RC, and to stop interception and reporting of protocol data. The +"data" connection can execute a request to +enable interception +and reporting of specified protocol for a particular RC. When the +"enable" request is issued, intercepted protocol is sent back on the +same connection, generally in more than one reply packet. Until the last +reply to the "enable" request is sent by the server, signifying that +the request execution is complete, no other requests will be executed by +the server on that connection. That is, the connection that data are being +reported on cannot issue the "disable" request until the last reply +to the "enable" request is sent by the server. Therefore, unless a +recording client never has the need to disable the interception and reporting +of protocol data, two client connections are necessary. + + + +Events + + + + + +The terms "delivered events" and "device events" are used +to describe the two event classes recording clients may +select for interception. These event classes are handled differently +by the extension. Delivered events are core X events or X extension events +the server actually delivers to one or more clients. Device events are +events generated by core X devices or extension input devices that the +server may or may not deliver to any clients. When device events +are selected for interception by a recording client, the extension +guarantees each device event is recorded and will be forwarded +to the recording client in the same order it is generated by the +device. + + + +The recording of selected device events is not affected +by server grabs. Delivered events, on the other hand, can be affected +by server grabs. +If a recording client selects both +a device event and delivered events that result from that device +event, the delivered events are recorded after the device event. +In the absence of grabs, the delivered events for a +device event precede later device events. + + + +Requests that have side effects on +devices, such as +WarpPointer +and +GrabPointer +with a confine-to window, +will cause RECORD to record an associated device event. +The XTEST extension request +XTestFakeInput +causes a device event to be recorded; the +device events are recorded in the same order that the +XTestFakeInput +requests are received by the server. + + + +If a key autorepeats, multiple +KeyPress +and +KeyRelease +device events are reported. + + + + +Timing + + + + +Requests are recorded just before +they are executed; the time associated with a request is the server +time when it is recorded. + + + + + +Types + +The following new types are used in the request definitions that appear +in section 3. + + +RC: CARD32 + + +The +"RC" +type is a resource identifier for a server record context. + + + + + + + + + + + RANGE8: + [first, last: + CARD8] + + + RANGE16: + [first, last: + CARD16] + + + EXTRANGE: + [major: + RANGE8 + + + + minor: + RANGE16] + + + + + + + + + + + + + + RECORDRANGE: + [core-requests: + RANGE8 + + + + core-replies: + RANGE8 + + + + ext-requests: + EXTRANGE + + + + ext-replies: + EXTRANGE + + + + delivered-events: + RANGE8 + + + + device-events: + RANGE8 + + + + errors: + RANGE8 + + + + client-started: + BOOL + + + + client-died: + BOOL] + + + + + + +The +"RECORDRANGE" +structure contains the protocol values to intercept. Typically, +this structure is sent by recording clients over the control connection +when creating or modifying an RC. + + + + + + + +Specifies core X protocol requests with an opcode field between first +and last inclusive. If first is equal to 0 and last is equal to 0, no +core requests are specified by this RECORDRANGE. If first is greater +than last, a +"Value" +error results. + + + + + + +Specifies replies resulting from core X protocol requests with an opcode +field between first and last inclusive. If first is equal to 0 and last +is equal to 0, no core replies are specified by this RECORDRANGE. If +first is greater than last, a +"Value" +error results. + + + + + + +Specifies extension protocol requests with a major opcode field between +major.first and major.last and a minor opcode field between minor.first +and minor.last inclusive. +If major.first and major.last are equal to 0, no +extension protocol requests are specified by this RECORDRANGE. If +major.first or major.last is less than 128 and greater than 0, +if major.first is greater than major.last, +or if minor.first +is greater than minor.last, a +"Value" +error results. + + + + + + +Specifies replies resulting from extension protocol requests with a +major opcode field between major.first and major.last and +a minor opcode field between minor.first and minor.last +inclusive. If major.first and major.last are equal to 0, +no extension protocol replies are specified by this RECORDRANGE. If +major.first or major.last is less than 128 and greater +than 0, +if major.first is greater than major.last, +or if minor.first is greater than minor.last, a +"Value" +error results. + + + + + + +This is used for both core X protocol events and arbitrary extension +events. Specifies events that are delivered to at least one client +that have a code field between first and last +inclusive. If first is equal to 0 and last is equal to 0, +no events are specified by this RECORDRANGE. +Otherwise, if first is less than 2 +or last is less than 2, or if +first is greater than last, a +"Value" +error results. + + + + + + +This is used for both core X device events and X extension device +events that may or may not be delivered to a client. +Specifies device events that have a code field between first and +last inclusive. If first is equal to 0 and last +is equal to 0, no device events are specified by this RECORDRANGE. +Otherwise, +if first is less than 2 or last is less +than 2, or if first is greater than last, a +"Value" +error results. + + + + +Because +the generated device event may or may not be associated with a +client, unlike other RECORDRANGE components, which select protocol for a +specific client, selecting for device events in any RECORDRANGE in an RC +causes the recording client to receive one instance for each device event +generated that is in the range specified. + + + + + + +This is used for both core X protocol errors and arbitrary extension +errors. Specifies errors that have a code field between first and +last inclusive. If first is equal to 0 and last is equal to 0, no +errors are specified by this RECORDRANGE. If first is greater +than last, a +"Value" +error results. + + + + + + +Specifies the connection setup reply. +If +False , +the connection setup reply is not specified by +this RECORDRANGE. + + + + + + +Specifies notification when a client disconnects. +If +False , +notification when a client disconnects is not specified by +this RECORDRANGE. + + + + + + + + + + + + + ELEMENT_HEADER: + [from-server-time: + BOOL + + + + from-client-time: + BOOL + + + + from-client-sequence: + BOOL] + + + + + + +The +ELEMENT_HEADER +structure specifies additional data that precedes each protocol +element in the data field of a +RecordEnableContext +reply. + + + + + +If from-server-time is +True , +each intercepted protocol element +with category +FromServer +is preceded by the server time when the protocol was recorded. + + + + +If from-client-time is +True , +each intercepted protocol element +with category +FromClient +is preceded by the server time when the protocol was recorded. + + + + +If from-client-sequence is +True , +each intercepted protocol +element with category +FromClient +or +ClientDied +is preceded by the +32-bit sequence number of the recorded client's most recent request +processed by the server at that time. +For +FromClient , +this will be one less than the sequence number of the +following request. +For +ClientDied , +the sequence number will be the only data, because no +protocol is recorded. + + + + + +Note that a reply containing device events is treated the same as +other replies with category +FromServer +for purposes of these flags. +Protocol with category +FromServer +is never preceded by a sequence +number because almost all such protocol has a sequence number in it anyway. + + + + +If both a server time and a sequence number have been requested for a +reply, each protocol request is +preceded first by the time and second by the sequence number. + + +XIDBASE: CARD32 + + + +The XIDBASE type is used to identify a particular client. Valid +values are any existing resource identifier +of any connected client, +in which case the client +that created the resource is specified, or the resource identifier +base sent to the target client from the server in the connection setup +reply. A value of 0 (zero) is valid when the XIDBASE is associated +with device events that may not have been delivered to a client. + + + +CLIENTSPEC: XIDBASE or {CurrentClients, +FutureClients, AllClients} + + + +The CLIENTSPEC type defines the set of clients the RC attributes are +associated with. This type is used by recording clients when creating +an RC or when changing RC attributes. XIDBASE specifies that the RC +attributes apply to a single client only. +CurrentClients +specifies +that the RC attributes apply to current client connections; +FutureClients +specifies future client connections; +AllClients +specifies all client connections, which includes current and future. + + + +The numeric values for +CurrentClients , +FutureClients +and +AllClients +are +defined such that there will be no intersection with valid XIDBASEs. + + + + +When the context is enabled, the data connection is unregistered if it +was registered. +If the context is enabled, +CurrentClients +and +AllClients +silently exclude the recording data connection. +It is an error to explicitly register the data connection. + + + + + + + + + + + CLIENT_INFO: + [client-resource: + CLIENTSPEC + + + + intercepted-protocol: + LISTofRECORDRANGE] + + + + + + +This structure specifies an intercepted client and the protocol to be +intercepted for the client. The client-resource field is a +resource base that identifies the intercepted client. The +intercepted-protocol field specifies the protocol to intercept +for the client-resource. + + + + +Errors + +RecordContext + + + + + + + +This error is returned if the value for an RC argument +in a request does not name a defined record context. + + + + + + + +Protocol Requests + + + + + +RecordQueryVersion + + + + + +major-version, +minor-version: CARD16 + + + + +-> + + + + +major-version, +minor-version: CARD16 + + + + + +This request specifies the RECORD extension protocol version the client +would like to use. When the specified protocol version is supported +by the extension, the protocol version the server expects from the +client is returned. Clients must use this request before other RECORD +extension requests. + + + +This request also determines whether or not the RECORD extension protocol +version specified by the client is supported by the extension. If the +extension supports the version specified by the client, this version number +should be returned. If the client has requested a higher version than is +supported by the server, the server's highest version should be returned. +Otherwise, if the client has requested a lower version than is supported +by the server, the server's lowest version should be returned. This document +defines major version one (1), +minor version thirteen (13). + + + +RecordCreateContext + + + + + + + + + +context: RC + + + + +element-header: ELEMENT_HEADER + + + + +client-specifiers: LISTofCLIENTSPEC + + + + +ranges: LISTofRECORDRANGE + + + + +Errors: +Match , +Value , +IDChoice , +Alloc + + + + + + + +This request creates a new +record context +within the server and assigns the identifier context to +it. After the context is created, this request registers the +set of clients in client-specifiers with the context and +specifies the protocol to intercept for those clients. +The recorded protocol elements will be preceded by data as specified +by element-header. +Typically, +this request is used by a recording client over the control +connection. Multiple RC +objects can exist simultaneously, containing overlapping sets of +protocol and clients to intercept. + + + +If any of the values in +element-header or +ranges is invalid, a +"Value" +error results. Duplicate items in the list of client-specifiers are +ignored. If any item in the client-specifiers list is not a valid +CLIENTSPEC, a +"Match" +error results. Otherwise, each item in the client-specifiers list is +processed as follows: + + + + + +If the item is an XIDBASE identifying a particular client, the +specified client is registered with the context and the protocol +to intercept for the client is then set to ranges. + + + + +If the item is +CurrentClients , +all existing clients are registered with the +context at this time. +The protocol to intercept for all clients registered +with the context is then set to ranges. + + + + +If the item is +FutureClients , +all clients that connect to the server +after this request executes will be automatically registered with the +context. The protocol to intercept for such clients will be set to +ranges in the context. + + + + +If the item is +AllClients , +the effect is as if the actions described +for +FutureClients +are performed, followed by the actions for +CurrentClients . + + + + + +The +"Alloc" +error results when the server is unable to allocate the necessary +resources. + + + +RecordRegisterClients + + + + + + + + + +context: RC + + + + +element-header: ELEMENT_HEADER + + + + +client-specifiers: LISTofCLIENTSPEC + + + + +ranges: LISTofRECORDRANGE + + + + +Errors: +Match , +Value , +RecordContext , +Alloc + + + + + + + +This request registers the set of clients in client-specifiers with +the given context and specifies the protocol to intercept for those +clients. +The header preceding each recorded protocol element is set as specified +by element-header. +These flags affect the entire +context; their effect is not limited to the clients registered by +this request. +Typically, this request is used by a recording client over +the control connection. + + + +If context does not name a valid RC, a +"RecordContext" +error results. If any of the values in +element-header or ranges is invalid, a +"Value" +error results. Duplicate items in the list of client-specifiers are +ignored. If any item in the list of client-specifiers is not a +valid CLIENTSPEC, a +"Match" +error results. +If the context is enabled and the XID of the enabling connection +is specified, a +"Match" +error results. +Otherwise, each item in the client-specifiers list is +processed as follows: + + + + + +If the item is an XIDBASE identifying a particular client, the +specified client is registered with the context if it is not already +registered. The protocol to intercept for the client is then set to +ranges. + + + + +If the item is +CurrentClients , +all existing clients that are not +already registered with the specified context, +except the enabling connection if the context is enabled, +are registered at this +time. The protocol to intercept for all clients registered with the +context is then set to ranges. + + + + +If the item is +FutureClients , +all clients that connect to the server +after this request executes will be automatically registered with the +context. The protocol to intercept for such clients will be set to +ranges in the context. +The set of clients that are registered with the +context and their corresponding sets +of protocol to intercept are left intact. + + + + +If the item is +AllClients , +the effect is as if the actions described +for +FutureClients +are performed, followed by the actions for +CurrentClients . + + + + +The +"Alloc" +error results when the server is unable to allocate the necessary +resources. + + + +RecordUnregisterClients + + + + + + + + + +context: RC + + + + +client-specifiers: LISTofCLIENTSPEC + + + + +Errors: +Match , +RecordContext + + + + + + + + +This request removes the set of clients in client-specifiers from the +given context's set of registered clients. Typically, this request is +used by a recording client over the control connection. + + + +If context does not name a valid RC, a +"RecordContext" +error results. Duplicate items in the list of client-specifiers are +ignored. If any item in the list is not a valid CLIENTSPEC, a +"Match" +error results. Otherwise, each item in the client-specifiers list is +processed as follows: + + + + + +If the item is an XIDBASE identifying a particular client, and the +specified client is currently registered with the context, it is +unregistered, and the set of protocol to intercept for the client is +deleted from the context. If the specified client is not registered +with the context, the item has no effect. + + + + +If the item is +CurrentClients , +all clients currently registered with +the context are unregistered from it, and their corresponding sets of +protocol to intercept are deleted from the context. + + + + +If the item is +FutureClients , +clients that connect to the server after +this request executes will not automatically be registered with the +context. The set of clients that are registered with this context +and their corresponding sets of protocol that will be +intercepted are left intact. + + + + +If the item is +AllClients , +the effect is as if the actions described +for +FutureClients +are performed, followed by the actions for +CurrentClients . + + + + + +A client is unregistered automatically when it disconnects. + + + +RecordGetContext + + + + + + + + + +context: RC + + + + +-> + + + + +enabled: BOOL + + + + +element-header: ELEMENT_HEADER + + + + +intercepted-clients: LISTofCLIENT_INFO + + + + +Errors: + + + + +RecordContext + + + + + + + +This request queries the current state of the specified context +and is typically used by a recording client over the control connection. +The enabled field +specifies the state of data transfer between the extension and the +recording client, and is either enabled +( True ) +or disabled +( False ). +The initial state is disabled. +When enabled, all core X protocol and +extension protocol received from (requests) or sent to (replies, +errors, events) a particular client, and requested to be intercepted +by the recording client, is reported to the recording client over the +data connection. +The element-header specifies the header that precedes each +recorded protocol element. +The +intercepted-clients field specifies the list of clients currently +being recorded and the protocol associated with each client. +If future clients will be automatically registered with the context, +one of the returned CLIENT_INFO structures has a client-resource value +of FutureClients and an intercepted-protocol giving the protocol to +intercept for future clients. +Protocol ranges may be decomposed, coalesced, or otherwise modified +by the server from how they were specified by the client. +All CLIENTSPECs registered with the server are returned, even if the +RECORDRANGE(s) associated with them specify no protocol to record. + + + +When the context argument is not valid, a +RecordContext +error results. + + + +RecordEnableContext + + + + + + + + +context: RC + + + + +->+ + + + + +category: +{FromServer, FromClient, +ClientStarted, ClientDied, +StartOfData, +EndOfData} + + + + + +element-header: ELEMENT_HEADER + + + + +client-swapped: BOOL + + + + +id-base: XIDBASE + + + + +server-time: TIMESTAMP + + + + +recorded-sequence-number: CARD32 + + + + +data: LISTofBYTE + + + + +Errors: +Match, +RecordContext + + + + + + + +This request enables data transfer between the recording client +and the extension and returns the protocol data the recording client +has previously expressed interest in. Typically, this request is +executed by the recording client over the data connection. + + + +If the client is registered on the context, it is unregistered +before any recording begins. + + + +Once the server receives this request, it begins intercepting +and reporting to the recording client all core and extension protocol +received from or sent to clients registered with the RC that the +recording client has expressed interest in. All intercepted protocol data +is returned in the byte-order of the recorded client. Therefore, +recording clients are responsible for all byte swapping, if required. +More than one recording client cannot enable data transfer on the +same RC at the same time. Multiple intercepted requests, replies, +events and errors might be packaged into a single reply before +being returned to the recording clients. + + + +The +category field determines the possible +types of the data. +When a context is enabled, the server will immediately send a reply of +category +StartOfData +to notify the client that recording is enabled. +A category of +FromClient +means the data are from the client +(requests); +FromServer +means data are from the server (replies, +errors, events, or device events). +For a new client, the category is +ClientStarted +and the data are the connection setup reply. +When +the recorded client connection is closed, category is +set to the value +ClientDied +and no protocol is included in this reply. +When the disable request is made over the control connection, +a final reply is sent over the data connection with category +EndOfData +and no protocol. + + + +The element-header field returns the value currently set for the +context, which tells what header information precedes each recorded +protocol element in this reply. + + + +The client-swapped field is +True +if the byte order of +the protocol being recorded +is swapped +relative to the recording client; +otherwise, client-swapped is +False . +The recorded protocol +is in the byte order of the client being +recorded; device events are in the byte order of the +recording client. +For replies of category +StartOfData +and +EndOfData +the +client-swapped bit is set +according +to the byte order of the server relative to the recording client. +The id-base field is the resource identifier base +sent to the client from the server in the +connection setup reply, and hence, identifies the client being +recorded. The id-base field is 0 (zero) when the protocol +data being +returned are device events. +The server-time field is set to the time of the +server when the first protocol element in this reply was intercepted. +The server-time +of reply N+1 is greater than or equal to the server-time of reply N, +and is greater than or equal to the time of the last protocol +element in reply N. + + + +The recorded-sequence-number field is set to the sequence number +of the recorded client's most recent request processed by the server. + + + +The data field +contains the raw protocol data being returned to the recording client. +If requested by the element-header of this record context, each +protocol element may be preceded by a 32-bit timestamp and/or +a 32-bit sequence number. +If present, both the timestamp and sequence number are always in the +byte order of the recording client. + + + +For the core X events +KeyPress , +KeyRelease , +ButtonPress , +and +ButtonRelease , +the fields of a device event that contain +valid information are time and detail. +For the core X event +MotionNotify , +the fields of a device event that contain +valid information are time, root, +root-x and root-y. +The time field refers to the time the event was generated by the +device. + + + +For the extension input device events +DeviceKeyPress , +DeviceKeyRelease , +DeviceButtonPress , +and +DeviceButtonRelease , +the fields of a device event that contain valid information are +device, time and detail. +For +DeviceMotionNotify , +the valid device event fields are +device and time. +For the extension input device events +ProximityIn +and +ProximityOut , +the fields of a device event that contain valid +information are device and time. +For the extension input device event +DeviceValuator , +the fields of a device event that contain valid information are +device, +num_valuators, first_valuator, and valuators. +The time field refers to the time the event was generated by the +device. + + + +The error +"Match" +is returned when data transfer is already enabled. +When the context argument is not valid, a +RecordContext +error results. + + + +RecordDisableContext + + + + + + + + + +context: RC + + + + +Errors: +RecordContext + + + + + + + +This request is typically executed by the recording client over the +control connection. This request directs the extension to immediately +send any complete protocol elements currently buffered, +to send a final reply with category +EndOfData , +and to discontinue +data transfer between the extension and the recording client. +Protocol reporting is disabled +on the data connection that is currently enabled for the given +context. Once the extension completes +processing this request, no additional recorded protocol will +be reported to the recording client. If a data connection is not +currently enabled when this request is executed, then this request has +no affect on the state of data transfer. +An RC is disabled automatically when the connection to the enabling +client is closed down. + + + +When the context argument is not valid, a +RecordContext +error results. + + + +RecordFreeContext + + + + + +context RC + + + + + +Errors: +RecordContext + + + + + +This request deletes the association between the resource ID and the +RC and destroys the RC. +If a client has enabled data transfer on this context, the actions +described in +RecordDisableContext +are performed before the context +is freed. + + + +An RC is destroyed automatically when the connection to the creating client +is closed down and the close-down mode is DestroyAll. When the +context argument is not valid, a +RecordContext +error results. + + + + +Encoding + +Please refer to the X11 Protocol Encoding document as this document uses +conventions established there. + + + +The name of this extension is "RECORD". + + + +Types + +RC: CARD32 + + + +RANGE8 + 1 CARD8 first + 1 CARD8 last + + + +RANGE16 + 2 CARD16 first + 2 CARD16 last + + + +EXTRANGE + 2 RANGE8 major + 4 RANGE16 minor + + + +RECORDRANGE + 2 RANGE8 core-requests + 2 RANGE8 core-replies + 6 EXTRANGE ext-requests + 6 EXTRANGE ext-replies + 2 RANGE8 delivered-events + 2 RANGE8 device-events + 2 RANGE8 errors + 1 BOOL client-started + 1 BOOL client-died + + + +ELEMENT_HEADER + 1 CARD8 + 0x01 from-server-time + 0x02 from-client-time + 0x04 from-client-sequence + + + +XIDBASE: CARD32 + + + +CLIENTSPEC + 4 XIDBASE client-id-base + 1 CurrentClients + 2 FutureClients + 3 AllClients + + + +CLIENT_INFO + 4 CLIENTSPEC client-resource + 4 CARD32 n, number of record ranges in + intercepted-protocol + 24n LISTofRECORDRANGE intercepted-protocol + + + + +Errors + + +RecordContext + 1 0 Error + 1 CARD8 extension's base error code + 0 + 2 CARD16 sequence number + 4 CARD32 invalid record context + 24 unused + + + + +Requests + + +RecordQueryVersion + 1 CARD8 major opcode + 1 0 minor opcode + 2 2 request length + 2 CARD16 major version + 2 CARD16 minor version + => + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 2 CARD16 major version + 2 CARD16 minor version + 20 unused + + + +RecordCreateContext + 1 CARD8 major opcode + 1 1 minor opcode + 2 5+m+6n request length + 4 RC context + 1 ELEMENT_HEADER element-header + 3 unused + 4 CARD32 m, number of client-specifiers + 4 CARD32 n, number of ranges + 4m LISTofCLIENTSPEC client-specifiers + 24n LISTofRECORDRANGE ranges + + + +RecordRegisterClients + 1 CARD8 major opcode + 1 2 minor opcode + 2 5+m+6n request length + 4 RC context + 1 ELEMENT_HEADER element-header + 3 unused + 4 CARD32 m, number of client-specifiers + 4 CARD32 n, number of ranges + 4m LISTofCLIENTSPEC client-specifiers + 24n LISTofRECORDRANGE ranges + + + +RecordUnregisterClients + 1 CARD8 major opcode + 1 3 minor opcode + 2 3+m request length + 4 RC context + 4 CARD32 m, number of client-specifiers + 4m LISTofCLIENTSPEC client-specifiers + + + +RecordGetContext + 1 CARD8 major opcode + 1 4 minor opcode + 2 2 request length + 4 RC context + => + 1 1 Reply + 1 BOOL enabled + 2 CARD16 sequence number + 4 j reply length + 1 ELEMENT_HEADER element-header + 3 unused + 4 CARD32 n, number of intercepted-clients + 16 unused + 4j LISTofCLIENT_INFO intercepted-clients + + + +RecordEnableContext + 1 CARD8 major opcode + 1 5 minor opcode + 2 2 request length + 4 RC context + =>+ + 1 1 Reply + 1 category + 0 FromServer + 1 FromClient + 2 ClientStarted + 3 ClientDied + 4 StartOfData + 5 EndOfData + 2 CARD16 sequence number + 4 n reply length + 1 ELEMENT_HEADER element-header + 1 BOOL client-swapped + 2 unused + 4 XIDBASE id-base + 4 TIMESTAMP server-time + 4 CARD32 recorded-sequence-number + 8 unused + 4n BYTE data + + + +RecordDisableContext + 1 CARD8 major opcode + 1 6 minor opcode + 2 2 request length + 4 RC context + + + +RecordFreeContext + 1 CARD8 major opcode + 1 7 minor opcode + 2 2 request length + 4 RC context + + + + + diff --git a/miniconda3/share/doc/scrnsaverproto/saver.xml b/miniconda3/share/doc/scrnsaverproto/saver.xml new file mode 100644 index 0000000000000000000000000000000000000000..b19f0f91cf8ee4f5fa5d77dd2d0f1b369e9d9fdf --- /dev/null +++ b/miniconda3/share/doc/scrnsaverproto/saver.xml @@ -0,0 +1,943 @@ + + %defs; +]> + + + + + X11 Screen Saver Extension + MIT X Consortium Proposed Standard + X Version 11, Release &fullrelvers; + Version 1.0 + + + JimFulton + Network Computing Devices, Inc + + + KeithPackard + +X Consortium, Laboratory for Computer Science, Massachusetts Institute of Technology + + + + + 1992 + Massachusetts Institute of Technology + Network Computing Devices, Inc + + + + + +Permission to use, copy, modify, and distribute this documentation for any +purpose and without fee is hereby granted, provided that the above copyright +notice and this permission notice appear in all copies. MIT and +Network Computing Devices, Inc. make no +representations about the suitability for any purpose of the information in +this document. This documentation is provided "as is" without express or +implied warranty. + + + + + + +Introduction + +The X Window System provides support for changing the image on a display screen +after a user-settable period of inactivity to avoid burning the cathode ray +tube phosphors. However, no interfaces are provided for the user to control +the image that is drawn. This extension allows an external "screen saver" +client to detect when the alternate image is to be displayed and to provide the +graphics. + + +Current X server implementations typically provide at least one form of +"screen saver" image. Historically, this has been a copy of the X logo +drawn against the root background pattern. However, many users have asked +for the mechanism to allow them to write screen saver programs that provide +capabilities similar to those provided by other window systems. In +particular, such users often wish to be able to display corporate logos, +instructions on how to reactivate the screen, and automatic screen-locking +utilities. This extension provides a means for writing such clients. + + + + +Assumptions + +This extension exports the notion of a special screen saver window that is +mapped above all other windows on a display. This window has the +override-redirect attribute set so that it is not subject to manipulation by +the window manager. Furthermore, the X identifier for the window is never +returned by QueryTree requests on the root window, so it is typically +not visible to other clients. + + + + +Overview + +The core +SetScreenSaver +request can be used to set the length of time without +activity on any input devices after which the screen saver should "activate" +and alter the image on the screen. This image periodically "cycles" to +reduce +the length of time that any particular pixel is illuminated. Finally, the +screen saver is "deactivated" in response to activity on any of the input +devices +or particular X requests. + + + +Screen saving is typically done by disabling video output to the display tube +or by drawing a changing pattern onto the display. If the server chooses the +latter approach, a window with a special identifier is created and mapped at +the top of the stacking order where it remains until the screen saver +deactivates. At this time, the window is unmapped and is not accessible to any +client requests. + + +The server's default mechanism is referred to as the internal screen +saver. An external +screen saver client requires a means of determining the window +id for the screen saver window and setting the attributes (e.g. size, +location, visual, colormap) to be used when the window is mapped. These +requirements form the basis of this extension. + + + + +Issues + +This extension raises several interesting issues. First is the question of +what should be done if some other client has the server grabbed when the screen +saver is supposed to activate? This commonly occurs with window managers that +automatically ask the user to position a window when it is first mapped by +grabbing the server and drawing XORed lines on the root window. + + +Second, a screen saver program must control the actual RGB values sent to the +display tube to ensure that the values change periodically to avoid phosphor +burn in. Thus, the client must have a known colormap installed whenever the +screen saver window is displayed. To prevent screen flashing, the visual type +of the screen saver window should also be controllable. + + +Third, some implementations may wish to destroy the screen saver window when +it is not mapped so that it need not be avoided during event delivery. Thus, +screen saver clients may find that the requests that reference the screen +saver window may fail when the window is not displayed. + + + + +Protocol + +The Screen Saver extension is as follows: + + + +Types + +In addition to the common types described in the core protocol, the following +type is used in the request and event definitions in subsequent sections. + + + + + + + + + + Name + Value + + + + + SCREENSAVEREVENT + ScreenSaverNotify, + ScreenSaverCycle + + + + + + + +Errors + +The Screen Saver extension adds no errors beyond the core protocol. + + + + +Requests + +The Screen Saver extension adds the following requests: + + + +ScreenSaverQueryVersion + client-major-version: CARD8 + client-minor-version: CARD8 +-> + server-major-version: CARD8 + server-minor-version: CARD8 + + + +This request allows the client and server to determine which version of +the protocol should be used. The client sends the version that it +prefers; if the server understands that +version, it returns the same values and interprets subsequent requests +for this extension according to the specified version. Otherwise, +the server returns the closest version of the protocol that it can +support and interprets subsequent requests according to that version. +This document describes major version 1, minor version 0; the major +and minor revision numbers should only be incremented in response to +incompatible and compatible changes, respectively. + + + +ScreenSaverQueryInfo +drawable DRAWABLE + +saver-window: WINDOW +state: {Disabled, Off, On} +kind: {Blanked, Internal, External} +til-or-since: CARD32 +idle: CARD32 +event-mask: SETofSCREENSAVEREVENT + +Errors: Drawable + + + +This request returns information about the state of the screen +saver on the screen associated with drawable. The saver-window +is the XID that is associated with the screen saver window. This +window is not guaranteed to exist +except when external screen saver is active. Although it is a +child of the root, this window is not returned by +QueryTree +requests on the root. Whenever this window is mapped, it is always above +any of its siblings in the stacking order. XXX - TranslateCoords? + + +The state field specifies whether or not the screen saver is currently +active and how the til-or-since value should be interpreted: + + + + + + + + + + Off + +The screen is not currently being saved; +til-or-since +specifies the number of milliseconds until the screen saver is expected to +activate. + + + + On + +The screen is currently being saved; +til-or-since specifies +the number of milliseconds since the screen saver activated. + + + + Disabled + +The screen saver is currently disabled; +til-or-since is zero. + + + + + + + +The kind field specifies the mechanism that either is currently being +used or would have been were the screen being saved: + + + + + + + + + + Blanked + The video signal to the display monitor was disabled. + + + Internal + A server-dependent, built-in screen saver image was displayed; either no + client had set the screen saver window attributes or a different client + had the server grabbed when the screen saver activated. + + + External + The screen saver window was mapped with attributes set by a + client using the ScreenSaverSetAttributes request. + + + + + + +The idle field specifies the number of milliseconds since the last +input was received from the user on any of the input devices. + + + +The event-mask field specifies which, if any, screen saver +events this client has requested using ScreenSaverSelectInput. + + + +If drawable is not a valid drawable identifier, a Drawable +error is returned and the request is ignored. + + + +ScreenSaverSelectInput +drawable: DRAWABLE +event-mask: SETofSCREENSAVEREVENT + + + +Errors: +Drawable, +Match + + + +This request specifies which Screen Saver extension events on the screen +associated with drawable should be generated for this client. If +no bits are set in event-mask, then no events will be generated. +Otherwise, any combination of the following bits may be set: + + + + + + + + + + ScreenSaverNotify + +If this bit is set, ScreenSaverNotify events are generated whenever +the screen saver is activated or deactivated. + + + + ScreenSaverCycle + +If this bit is set, ScreenSaverNotify events are generated whenever +the screen saver cycle interval passes. + + + + + + + +If drawable is not a valid drawable identifier, a Drawable +error is returned. If any undefined bits are set in event-mask, +a Value error is returned. If an error is returned, +the request is ignored. + + + +ScreenSaverSetAttributes + + +drawable: DRAWABLE +class: +{InputOutput, InputOnly, CopyFromParent} +depth: CARD8 +visual: VISUALID or CopyFromParent +x, y: INT16 +width, height, border-width: CARD16 +value-mask: BITMASK +value-list: LISTofVALUE + +Access, Window, Pixmap, Colormap, Cursor, Match, Value, Alloc + + + +This request sets the attributes that this client would like to see +used in creating the screen saver window on the screen associated +with drawable. If another client currently has the attributes set, +an Access error is generated and the request is ignored. + + + +Otherwise, the specified window attributes are checked as if +they were used in a core CreateWindow request whose +parent is the root. The override-redirect field is ignored as +it is implicitly set to True. If the window attributes result in an +error according to the rules for CreateWindow, the request is ignored. + + +Otherwise, the attributes are stored and will take effect on the next +activation that occurs when the server is not grabbed by another client. +Any resources specified for the +background-pixmap or cursor attributes may be +freed immediately. The server is free to copy the background-pixmap +or cursor resources or to use them in place; therefore, the effect of +changing the contents of those resources is undefined. If the +specified colormap no longer exists when the screen saver activates, +the parent's colormap is used instead. If no errors are generated by this +request, any previous +screen saver window attributes set by this client are released. + + +When the screen saver next activates and the server is not grabbed by +another client, the screen saver window is +created, if necessary, and set to the specified attributes and events +are generated as usual. The colormap +associated with the screen saver window is +installed. Finally, the screen saver window is mapped. + + +The window remains mapped and at the top of the stacking order +until the screen saver is deactivated in response to activity on +any of the user input devices, a ForceScreenSaver request with +a value of Reset, or any request that would cause the window to be +unmapped. + + +If the screen saver activates while the server is grabbed by another +client, the internal saver mechanism is used. The ForceScreenSaver +request may be used with a value of Active to +deactivate the internal saver and activate the external saver. + + +If the screen saver client's connection to the server is broken +while the screen saver is activated and the client's close down mode has not +been RetainPermanent or RetainTemporary, the current screen saver +is deactivated and the internal screen saver is immediately activated. + + +When the screen saver deactivates, the screen saver window's colormap +is uninstalled and the window is unmapped (except as described below). +The screen saver XID is disassociated +with the window and the server may, but is not required to, +destroy the window along with any children. + + +When the screen saver is being deactivated and then immediately +reactivated (such as when switching screen savers), the server +may leave the screen saver window mapped (typically to avoid +generating exposures). + + + +ScreenSaverUnsetAttributes + + + +drawble: DRAWABLE + +Errors: Drawable + + + +This request notifies the server that this client no longer +wishes to control the screen saver window. Any screen saver +attributes set by this client and any descendents of the screen +saver window created by this client should be released +immediately if the screen saver is not active, else upon +deactivation. + + +This request is ignored if the client has not previously set the screen saver +window attributes. + + + + +Events + +The Screen Saver extension adds one event: + + +ScreenSaverNotify + + + +root: WINDOW +window: WINDOW +state: {Off, On, Cycle} +kind: { Blanked, Internal , External } +forced: BOOL +time: TIMESTAMP + + +This event is delivered to clients that have requested +ScreenSaverNotify events using the ScreenSaverSelectInput request +whenever the screen saver activates or deactivates. + + +The root field specifies root window of the screen for +which the event was generated. The window field specifies +the value that is returned by ScreenSaverQueryInfo as +the identifier for the screen saver window. This window is not +required to exist if the external screen saver is not active. + + +The state field specifies the cause of the event: + + + + + + + + + + Off + +The screen saver deactivated; this event is sent if the client has set the +ScreenSaverNotify bit in its event mask. + + + + On + +The screen saver activated. This event is sent if the client has set the +ScreenSaverNotify bit in its event mask. + + + + Cycle + +The cycle interval passed and the client is expected to change the image on +the screen. This event is sent if the client has set the +ScreenSaverCycle bit in its event mask. + + + + + + + +If state is set to +On or +Off +then forced indicates whether or not +activation or deactivation was caused by a core +ForceScreenSaver +request; otherwise, forced is set to False. + + + +The kind field specifies mechanism that was used to save the screen +when the screen saver was activated, as described in +ScreenSaverQueryInfo. + + + +The time field indicates the server time +when the event was generated. + + + + + +Encoding + +Please refer to the X11 Protocol Encoding document as this document uses +conventions established there. + + +The name of this extension is "SCREEN-SAVER". + + + +Common Types + +SETofSCREENSAVEREVENT + #x00000001 ScreenSaverNotifyMask + #x00000002 ScreenSaverCycleMask + + + + +Requests + +ScreenSaverQueryVersion +1 CARD8 screen saver opcode +1 0 minor opcode +2 2 request length +1 CARD8 client major version +1 CARD8 client minor version +2 unused +-> +1 1 Reply +1 unused +2 CARD16 sequence number +4 0 reply length +1 CARD8 server major version +1 CARD8 server minor version +22 unused + +ScreenSaverQueryInfo +1 CARD8 screen saver opcode +1 1 minor opcode +2 2 request length +4 DRAWABLE drawable associated with screen +-> +1 1 Reply +1 CARD8 state + 0 Off + 1 On + 3 Disabled +2 CARD16 sequence number +4 0 reply length +4 WINDOW saver window +4 CARD32 milliseconds until saver or since saver +4 CARD32 milliseconds since last user device input +4 SETofSCREENSAVEREVENT event mask +1 CARD8 kind + 0 Blanked + 1 Internal + 2 External +10 unused + +ScreenSaverSelectInput +1 CARD8 screen saver opcode +1 2 minor opcode +2 3 request length +4 DRAWABLE drawable associated with screen +4 SETofSCREENSAVEREVENT event mask + +ScreenSaverSetAttributes +1 CARD8 screen saver opcode +1 3 minor opcode +2 6+n request length +4 DRAWABLE drawable associated with screen +2 INT16 x +2 INT16 y +2 CARD16 width +2 CARD16 height +2 CARD16 border-width +1 class + 0 CopyFromParent + 1 InputOutput + 2 InputOnly +1 CARD8 depth +4 VISUALID visual + 0 CopyFromParent +4 BITMASK value-mask (has n bits set to 1) + encodings are the same as for core CreateWindow +4n LISTofVALUE value-list + encodings are the same as for core CreateWindow + +ScreenSaverUnsetAttributes +1 CARD8 screen saver opcode +1 4 minor opcode +2 3 request length +4 DRAWABLE drawable associated with screen + + + + +Events + + +ScreenSaverNotify +1 CARD8 code assigned by core +1 CARD8 state + 0 Off + 1 On + 2 Cycle +2 CARD16 sequence number +4 TIMESTAMP time +4 WINDOW root +4 WINDOW screen saver window +1 CARD8 kind + 0 Blanked + 1 Internal + 2 External +1 BOOL forced +14 unused + + + + + +Inter-Client Communications Conventions + +Screen saver clients should create at least one resource value whose +identifier can be stored in a property named +_SCREEN_SAVER_ID +on the root of each screen it is managing. +This property should have one 32-bit value corresponding to the resource +identifier; the type of the property should indicate the type of the +resource and should be one of the following: +WINDOW, +PIXMAP, +CURSOR, +FONT, or +COLORMAP. + + + + +C language binding + + +The C binding for this extension simply provide access to the protocol; they +add no semantics beyond what is described above. + + + +The include file for this extension is +<X11/extensions/scrnsaver.h>. + + + + + + Bool XScreenSaverQueryExtension + Display *display + int *event_base + int *error_base + + + + +This routine returns +True +if the specified display supports the +SCREEN-SAVER extension; otherwise it returns +False. +If the extension is supported, the event number for +ScreenSaverNotify +events is returned in the value pointed to by +event_base. Since +no additional errors are defined by this extension, the results +of error_base are not defined. + + + + + Status XScreenSaverQueryVersion + Display *display + int *major + int *minor + + + + +If the specified display supports the +extension, the version numbers of the protocol +expected by the server are returned in +major and +minor and +a non-zero value is returned. Otherwise, the arguments are not +set and 0 is returned. + + +XScreenSaverInfo * +XScreenSaverAllocInfo() + + +This routine allocates and returns an +XScreenSaverInfo structure +for use in calls to . +All fields in the +structure are initialized to zero. If insufficient memory is available, +NULL is returned. The results of this routine can be released +using XFree. + + + + + Status XScreenSaverQueryInfo + Display *display + Drawable drawable + XScreenSaverInfo *saver_info + + + + +If the specified display supports the extension, +information about the current state of the +screen server is returned in saver_info and a non-zero value is +returned. The XScreenSaverInfo structure is +defined as follows: + + + +typedef struct { + Window window; /* screen saver window */ + int state; /* ScreenSaver{Off,On,Disabled} */ + int kind; /* ScreenSaver{Blanked,Internal,External} */ + unsigned long til_or_since; /* milliseconds */ + unsigned long idle; /* milliseconds */ + unsigned long event_mask; /* events */ +} XScreenSaverInfo; + + + +See the ScreenSaverQueryInfo request for a +description of the fields. If the extension is not supported, +saver_info is not changed and 0 +is returned. + + + + + void XScreenSaverSelectInput + Display *display + Drawable drawable + unsigned long event_mask + + + + +If the specified display supports the extension, +this routine asks that events related to +the screen saver be generated for this client. +The format of the events generated is: + + + +typedef struct { + int type; /* of event */ + unsigned long serial; /* # of last request processed by server */ + Bool send_event; /* true if this came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Window window; /* screen saver window */ + Window root; /* root window of event screen */ + int state; /* ScreenSaver{Off,On,Cycle} */ + int kind; /* ScreenSaver{Blanked,Internal,External} */ + Bool forced; /* extents of new region */ + Time time; /* event timestamp */ +} XScreenSaverNotifyEvent; + + + +See the definition of the +ScreenSaverSelectInput request for descriptions +of the allowed event masks. + + + + + void XScreenSaverSetAttributes + Display *dpy + Drawable drawable + int x + int y + unsigned int width + unsigned int height + unsigned int border_width + int depth + unsigned int class + Visual *visual + unsigned long valuemask + XSetWindowAttributes *attributes + + + + +If the specified display supports the +extension, this routine sets the attributes to be used +the next time the external screen saver is activated. See the definition +of the ScreenSaverSetAttributes request for a +description of each of the arguments. + + + + + void XScreenSaverUnsetAttributes + Display *display + Drawable drawable + + + + +If the specified display supports the +extension, this routine instructs the server to discard +any previous screen saver window attributes set by this client. + + + + + Status XScreenSaverRegister + Display *display + int screen + XID xid + Atom type + + + + +This routine stores the given XID in the +_SCREEN_SAVER_ID property (of the given +type) on the root window of the specified +screen. It returns zero if an error +is encountered and the property is not changed, otherwise it returns +non-zero. + + + + + Status XScreenSaverUnregister + Display *display + int screen + + + + +This routine removes any _SCREEN_SAVER_ID from the +root window of the specified screen. +It returns zero if an error is encountered and the property is changed, +otherwise it returns non-zero. + + + + + Status XScreenSaverGetRegistered + Display *display + int screen + XID *xid + ATOM *type + + + + + +This routine returns the +XID and +type stored in the +_SCREEN_SAVER_ID property on the +root window of the specified screen. +It returns zero if an error +is encountered or if the property does not exist or is not of the correct +format; otherwise it returns non-zero. + + + + diff --git a/miniconda3/share/doc/xcmiscproto/xc-misc.xml b/miniconda3/share/doc/xcmiscproto/xc-misc.xml new file mode 100644 index 0000000000000000000000000000000000000000..f2dfec2b8f4b0dfbd57467410f0949a865d60c5d --- /dev/null +++ b/miniconda3/share/doc/xcmiscproto/xc-misc.xml @@ -0,0 +1,201 @@ + + %defs; +]> + + + + + + XC-MISC Extension + X Consortium Standard + + + BobScheifler + X Consortium + + + DavidP.Wiggins + X Consortium + + + X Version 11, Release &fullrelvers; + Version 1.1 + 1994X Consortium + + + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium. + +X Window System is a trademark of The Open Group. + + + + + +Overview + +When an X client connects to an X server, it receives a fixed range of +resource IDs to use to identify the client's resources inside the X +server. Xlib hands these out sequentially as needed. When it +overruns the end of the range, an IDChoice protocol error results. +Long running clients, or clients that use resource IDs at a rapid +rate, may encounter this circumstance. When it happens, there are +usually many resource IDs available, but Xlib doesn't know about them. + +One approach to solving this problem would be to have Xlib notice when +a resource is freed and recycle its ID for future use. This strategy +runs into difficulties because sometimes freeing one resource causes +others to be freed (for example, when a window is destroyed, so are +its children). To do a complete job, Xlib would have to maintain a +large amount of state that currently resides only in the server (the +entire window tree in the above example). Even if a less +comprehensive strategy was adopted, such as recycling only those IDs +that Xlib can identify without maintaining additional state, the +additional bookkeeping at resource creation and destruction time +would likely introduce unacceptable overhead. + +To avoid the problems listed above, the server's complete knowledge of +all resource IDs in use by a client is leveraged. This extension +provides two ways for Xlib to query the server for available resource +IDs. Xlib can use these extension requests behind the scenes when it has +exhausted its current pool of resource IDs. + + + +Requests + + +XCMiscGetVersion + + + client_major_version: CARD16 + client_minor_version: CARD16 + + => + + client_major_version: CARD16 + client_minor_version: CARD16 + + +If supplied, the client_major_version and +client_minor_version indicate what version of +the protocol the client wants the server to implement. The server version +numbers returned indicate the protocol this extension actually supports. This +might not equal the version sent by the client. An implementation can +(but need not) support more than one version simultaneously. The +server_major_version and the server_minor_version are a +mechanism to support future revisions of the XC-MISC protocol +which may be necessary. In general, the major version would increment +for incompatible changes, and the minor version would increment for +small, upward-compatible changes. Servers that support the protocol +defined in this document will return a +server_major_version of one (1), and a +server_minor_version of one (1). + +XCMiscGetXIDRange + + => + + start_id: XID + count: CARD32 + + +This request returns a range of available resource IDs for the client +issuing the request. start_id is the first +ID in the range. count is the number of IDs +in the range. The returned range may or may not be the largest possible +range. + +XCMiscGetXIDList + + + count: CARD32 + + => + + ids: LISTofXID + + +This request returns the a list of individual resource IDs in +ids. +count is the number of resource IDs requested. +The number returned may be smaller than the number requested. + + + +Events and Errors + +No new events or errors are defined by this extension. + + + +Encoding + +Please refer to the X11 Protocol Encoding document as this document uses +conventions established there. + +The name of this extension is “XC-MISC”. + + +XCMiscGetVersion + 1 CARD8 opcode + 1 0 XC-MISC opcode + 2 2 request length + 2 CARD16 client_major_version + 2 CARD16 client_minor_version + + => + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 length + 2 CARD16 server_major_version + 2 CARD16 server_minor_version + 20 unused + + + +XCMiscGetXIDRange + 1 CARD8 opcode + 1 1 XC-MISC opcode + 2 1 request length + + => + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 length + 4 XID start_id + 4 CARD32 count + 16 unused + + + + +XCMiscGetXIDList + 1 CARD8 opcode + 1 2 XC-MISC opcode + 2 2 request length + 4 CARD32 count + + => + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 CARD32 length + 4 CARD32 number of XIDs in ids + 20 unused + 4n LISTofXID ids + + + + diff --git a/miniconda3/share/doc/xextproto/appendix.xml b/miniconda3/share/doc/xextproto/appendix.xml new file mode 100644 index 0000000000000000000000000000000000000000..b6c0f1de3205533ce8368ed9a05dc6be72f0e090 --- /dev/null +++ b/miniconda3/share/doc/xextproto/appendix.xml @@ -0,0 +1,61 @@ + + + +System Window Encodings + + +The AppGroupCreateAssoc request has the following possible variations: + + + +AppGroupCreateAssoc (X11) + 1 CARD8 opcode + 1 6 XC-APPGROUP opcode + 2 n length + 4 WINDOW window + 2 0 window_type + 2 4 system_window_len + 4 WINDOW Window + + + +AppGroupCreateAssoc (Macintosh) + 1 CARD8 opcode + 1 6 XC-APPGROUP opcode + 2 n length + 4 WINDOW window + 2 1 window_type + 2 12 system_window_len + 4 CARD32 WindowPtr + 2 INT16 Rect.top + 2 INT16 Rect.left + 2 INT16 Rect.bottom + 2 INT16 Rect.right + + + +AppGroupCreateAssoc (Win32) + 1 CARD8 opcode + 1 6 XC-APPGROUP opcode + 2 n length + 4 WINDOW window + 2 2 window_type + 2 4 system_window_len + 4 CARD32 HWND + + + +AppGroupCreateAssoc (Win16) + 1 CARD8 opcode + 1 6 XC-APPGROUP opcode + 2 n length + 4 WINDOW window + 2 3 window_type + 2 4 system_window_len + 2 CARD16 HWND offset + 2 CARD16 HWND segment + + + diff --git a/miniconda3/share/doc/xextproto/appgrp.xml b/miniconda3/share/doc/xextproto/appgrp.xml new file mode 100644 index 0000000000000000000000000000000000000000..5e27a63fcde8f0f6782525588ae642f6de447782 --- /dev/null +++ b/miniconda3/share/doc/xextproto/appgrp.xml @@ -0,0 +1,1041 @@ + + %defs; +]> + +
+ + + Application Group Extension to the X Protocol + X Consortium Standard + + + Kaleb + S. + KEITHLEY + X Consortium, Inc + kaleb@x.org + + + X Version 11, Release &fullrelvers; + Version 1.0 + 1996X Consortium, Inc. + + + + +All Rights Reserved. + + + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT +OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE +OR THE USE OF OR OTHER DEALINGS IN THE SOFTWARE. + + +Except as contained in this notice, the name of the X Consortium shall not be used in advertising +or otherwise to promote the sale, use or other dealings in this Software without prior written +authorization from the X Consortium. + +X Window System is a trademark of The OpenGroup. + + +27 September 1996 + + + +The Application Group Extension to the X protocol is intended to provide a framework to allow +more than one program to manage X applications on the desktop. The initial use of this extension +will be to insert or embed the windows of X programs into the windows of another program, such +as a web browser. This extension is not intended to address larger embedding issues that, for +example, OpenDoc does, such as shared menu bars, etc. + + + + + +Purpose and Goals + + +The Application Group Extension to the X protocol is intended to provide +a framework to allow more than one program to manage X applications on +the desktop. The initial use of this extension will be to insert or embed +the windows of X programs into the windows of another program, such as a +web browser. This extension is not intended to address larger embedding +issues that, for example, OpenDoc does, such as shared menu bars, etc. +Using X programs on the World Wide Web allows for greater control of the +presentation and takes advantage of the existing body of X programs rather +than re-implement them in another language. In addition it allows the +embedding of non-X programs into web browsers by using third party products +like Wabi, MAE, and WinCenter. + +Wabi is a trademark of Sun Microsystems, Inc. MAE is a trademark of Apple +Computer, Inc. WinCenter is a trademark of Network Computing Devices, Inc. + + + + + + +Overview of the protocol. + + +This extension introduces the concept of an Application Group. An Application Group is a set of one or more applications that are primarily managed by a special application known as the Application Group Leader, which, for example, might be a web browser. The primary purpose of Application Groups is to provide a means of sharing the Substructure-Redirect attribute of the root window between the window manager and one or more Application Group Leaders. + + + +To join an Application Group an application must present the proper authorization during the connection setup. Authorizations are generated by the X server at the request of an Application Group Leader, and are then stored for the application to use to establish its connection to the X server. To generate an authorization the Application Group Leader sends a request to the server naming the Application Group to which the authorization will be bound, and any applications that connect using that authorization will automatically become part of the associated Application Group. The protocol to generate an authorization is defined in the Security Extension specification. + + + +As a member of an Application Group, when an application creates and maps a window as a child of the root window, the MapRequest and ConfigureRequest events are delivered to the Application Group Leader instead of the window manager. The Application Group Leader may then reparent the window into its own window hierarchy; or reissue the map request, in which case the window comes under the control of the window manager. + + + + +Requests + + +AppGroupQueryVersion + + + + + + + + client_major_version: CARD16 + + + client_minor_version: CARD16 + + + => + + + server_major_version: CARD16 + + + server_minor_version: CARD16 + + + + + + +If supplied, the client_major_version and client_minor_version indicate what version of the protocol the application wants the server to implement. The server version numbers returned indicate the version of the protocol the X server actually supports. This may not match the versions requested by the application. An implementation may (but need not) support more than one version simultaneously. The server_major_version and server_minor_version numbers are a mechanism to support any future revisions of the Application Group extension protocol which may be necessary. In general, the major version would increment for incompatible changes, and the minor version would increment for small, upward-compatible changes. X servers that support the protocol defined in this document will return a server_major_version of 1 and a server_minor_version of 0. + + + +AppGroupCreate + + + + + + + + app_group: APPGROUP + + + value_mask: BITMASK + + + value_list: LISTofVALUE + + + + + + +This request creates an Application Group using app_group as the Application Group ID. + + + + +  + + + + +The value_mask and value_list specify attributes of the Application Group that are to be explicitly initialized. The attributes, their types, and the default values are: + + + + + + + + + + + Attribute + Type + Default + + + app_group_leader + Bool + True + + + single_screen + Bool + True + + + default_root + Window + None + + + root_visual + VisualID + None + + + default_colormap + Colormap + None + + + black_pixel + Pixel + 0 + + + white_pixel + Pixel + 0 + + + + + + +If the single_screen attribute is True then the number of video screens returned to a program in the Application Group in the connection setup message is one, irrespective of how many video screens the server actually has. If a server supports both video and print screens, then all print screens will always be returned. If single_screen is specified as True then the connection setup message will contain only the information about the video screen which has default_root as its root window, plus any print screens. + + + +The intent is to allow an embedding manager to ensure that it will be able to reparent any top-level windows that Application Group members create. By hiding the fact that there are other screens it can be reasonably assured that applications will only create top-level windows on the same screen that it itself appears on. An embedding manager should take care not to supply an invalid display, e.g. :0.1, to a program that will be in an Application Group where the single_screen attribute is True. + + + +If single_screen is set to True default_root specifies which screen will be returned as screen zero in the connection setup message for applications in the Application Group. If set to None, then the real screen zero is used, otherwise the screen which has default_root as its root window will be used. + + + + +If single_screen is set to True the root_visual and default_colormap attributes may be used to over-ride the default values that are returned in the connection setup information returned to new programs in the Application Group. If None is specified for root_visual or default_colormap then the normal default values for the screen (possibly specified by default_root) are used, otherwise the specified values are used. If root_visual and/or default_colormap are specified they must be valid, i.e. root_visual must be a visual type available on the screen, and the colormap, if specified, must be a valid colormap for the visual that is used. + + + +IF single_screen is set to True and default_colormap is not specified as None, the black_pixel and white_pixel attributes must be specified, and they will over-ride the default values that are returned in the connection setup returned to new programs in the Application Group. If default_colormap is specified as None and black_pixel and/or white_pixel are specified, they will be ignored. + + + +The app_group_leader attribute is used to identify the Application Group Leader program for the app_group. By specifying True the server will identify the program making the request as the Application Group Leader for the application group. The Application Group Leader receives MapRequest and ConfigureRequest events from the server when an attempt is made to map or configure top-level windows of a program in an Application Group, instead of being sent to a window manager that has selected SubstructureRedirect events on the root window. The parent window field in these events will contain the Application Group ID. + + +AppGroupDestroy + +app_group: APPGROUP + + + +This request destroys the app_group. If the app_group_leader attribute for the app_group is True, then any applications in the Application Group that are still connected will be killed as if a KillClient request had been received for that application. + + + +If the application that created a non-embedded Application Group exits, and therefore any Authorizations to be cancelled, and any applications that attempt to open new connections to the X server using one of those Authorizations will be unable to do so. + + +AppGroupGetAttr + + + + + + + + + >app_group: APPGROUP + + + => + + + LISTofVALUE + + + + + + +This request returns the application group attributes for app_group. + + +AppGroupQuery + + + + + + + + resource: XID + + + => + + + app_group: APPGROUP + + + + + + +This request returns the Application Group ID of the application that created resource or None if that application is not associated with any Application Group. The resource value may be the resource base of the application. + + +AppGroupCreateAssociation + + + + + + + + window: WINDOW + + + window_type: CARD32 + + + system_window: LISTofCARD8 + + + + + + +This request associates window with system_window. The window_type indicates the native window system of the application making the request. For non-X window_types both the embedding manager and the server must be executing on the same host. When system_window is Microsoft Windows or OS/2 Presentation Manager, the system_window is an HWND; when the native window system is Macintosh, the system_window is a WindowPtr and a Rect. The window may be used for any X request that takes a Window. + + +AppGroupDestroyAssociation + + + + + + + + window: WINDOW + + + + + + +This request destroys the association created with AppGroupCreateAssociation. The window is destroyed. The system_window that was specified in the AppGroupCreateAssociation request is not affected. + + + + + +Changes to Existing Requests + + +MapWindow + + +If the override-redirect attribute of the window is False and if the window is a child of a root window and if the window belongs to an application that is in an application group and if some other application is the application group leader for that group, then a MapRequest event is generated and the window remains unmapped. Otherwise, the core protocol semantics apply. + + + + +ConfigureWindow + + +If the override-redirect attribute of the window is False and if the window is a child of a root window and if the window belongs to an application that is in an application group and if some other application is the application group leader for that group, then a ConfigureRequest event is generated and the window remains unchanged. Otherwise, the core protocol semantics apply. + + + + +CreateWindow + + +When a program in an Application Group creates a window that is a child of a root window and specifies CopyFromParent for the Visual, if the single_screen attribute is True and the root_visual attribute is set to something other than None, then the window will be created using the Application Group’s root_visual, otherwise core protocol semantics apply. + + + +When a program in an Application Group creates a window that is a child of a root window and specifies CopyFromParent for the Colormap, if the single_screen attribute is True, the default_colormap attribute is set to something other than None, and the window’s Visual is the same as the Application Group’s root_visual attribute, then the window will be created using the Application Group’s default_colormap, otherwise core protocol semantics apply. + + + + + +ChangeWindowAttributes + + +When a program in an Application Group changes the attributes of a window that is a child of a root window and specifies CopyFromParent for the Colormap, if the single_screen attribute is True, the default_colormap attribute is set to something other than None, and the window’s Visual is the same as the Application Group’s root_visual attribute, then the window will be created using the Application Group’s default_colormap, otherwise core protocol semantics apply. + + + + + + + +Changes to Existing Events + + +When the top-level window of an application that is a member of an Application Group is the target of a MapWindow or ConfigureWindow request, if there is an Application Group Leader then MapRequest and ConfigureRequest events are automatically delivered to it, otherwise the core protocol semantics apply, i.e. they are delivered to the client, if any, that has SubstructureRedirect set in its root-window event mask, e.g. the window manager. + + + +The Application Group Leader must not select SubstructuRedirect events on a root window as doing so would result in a core protocol error; only one client is permitted to do so, and that is usually the window manager. + + + + +MapRequest + + +When a MapWindow request is received for a window whose override-redirect attribute is set to False and whose parent is the root window and the window belongs to an application that is in an application group and there is an application group leader for the group, then this event is delivered to the Application Group Leader with the parent field in the event set to the AppGroup ID. Otherwise the core protocol semantics apply. + + + + +ConfigureRequest + + +When a ConfigureWindow request is received for a window whose override-redirect attribute is set to False and whose parent is the root window and the window belongs to an application that is in an application group and there is an application group leader for the group, then this event is delivered to the Application Group Leader with the parent field in the event set to the AppGroup ID. Otherwise the core protocol semantics apply. + + + + + + +Errors + + +AppGroupQueryVersion + + +There are no errors for AppGroupQueryVersion. + + + + + +AppGroupCreate + + +A Window error is returned if default_root is specified and is not a valid root window.. + + + +A Color error is returned default_colormap is specified but default_colormap is not a valid colormap for the screen of default_root. + + + +A Match error is returned if root_visual and default_colormap are both specified, but + + + +default_colormap’s visual is not root_visual. + + + +A Match error is returned if root_visual does not exist for the screen of the default_root. + + + + + +AppGroupDestroy + + +An AppGroup error is returned if app_group is not a valid Application Group. + + + +An Access error is returned if an untrusted application attempts to destroy an Application Group created by a trusted application. + + + + + +AppGroupGetAttr + + +An AppGroup error is returned if app_group is not a valid Application Group. + + + +An Access error is returned if an untrusted application attempts to get the attributes of an Application Group created by a trusted application. + + + + + +AppGroupQuery + + +An Access error is returned if an untrusted application attempts to query the Application Group of a trusted application. + + + + + +AppGroupCreateAssociation + + +A Match error is returned if the X server does not support the window_type. + + + +An Access error may be returned if the X server only supports the window_type on the local host and the program making the request is on a non-local host. + + + +A Window error may be returned for system-specific errors related to system_window, e.g. system_window does not represent a valid native window. + + + + + +AppGroupDestroyAssociation + + +A Window error is returned if window was not specified in a previous AppGroupCreateAssociation request. + + + + + + +Encoding + + +Please refer to the X11 Protocol encoding document as this document uses conventions established there. + + + + +The name of this extension is XC-APPGROUP + + + + +AppGroupQueryVersion + 1 CARD8 opcode + 1 0 XC-APPGROUP opcode + 2 3 length + 2 CARD16 client_major_version + 2 CARD16 client_minor_version +=> + 1 1 Reply + 1 unused + 2 CARD16 sequence_number + 4 0 length + 2 CARD16 server_major_version + 2 CARD16 server_minor_version + 20 unused + + + + +AppGroupCreate + 1 CARD8 opcode + 1 1 XC-APPGROUP opcode + 2 8+n length + 4 XID app_group + 4 BITMASK attrib_mask + #x00000001 app_group_leader + #x00000002 single_screen + #0x0000004 default_root + #x00000008 root_visual + #x00000010 default_colormap + #x00000020 black_pixel + #x00000040 white_pixel + n LISTofVALUE value-list +VALUEs + 4 BOOL app_group_leader + 4 BOOL single_screen + 4 WINDOW default_root + 4 VISUALID root_visual + 4 COLORMAP default_colormap + 4 CARD32 black_pixel + 4 CARD32 white_pixel + + + + +AppGroupDestroy + 1 CARD8 opcode + 1 2 XC-APPGROUP opcode + 2 2 length + 4 XID app_group + + + +AAppGroupGetAttr + 1 CARD8 opcode + 1 4 XC-APPGROUP opcode + 2 2 length + 4 XID app_group +=> + 1 1 Reply + 1 unused + 2 CARD16 sequence_number + 4 0 length + 4 WINDOW default_root + 4 VISUALID root_visual + 4 COLORMAP default_colormap + 4 CARD32 black_pixel + 4 CARD32 whte_pixel + 1 BOOL single_screen + 1 BOOL app_group_leader + 2 unused + + + + +AppGroupQuery + 1 CARD8 opcode + 1 5 XC-APPGROUP opcode + 2 2 length + 4 XID resource +=> + 1 1 Reply + 1 unused + 2 CARD16 sequence_number + 4 0 length + 4 XID app_group + 20 unused + + + +AppGroupCreateAssoc + 1 CARD8 opcode + 1 6 XC-APPGROUP opcode + 2 n length + 4 WINDOW window + 2 CARD16 window_type + #0 X11 + #1 Macintosh + #2 Win32, OS/2 PM 2.x + #3 Win16, OS/2 PM 1.x + 2 n system_window_len + n LISTofCARD8 system_window + + + + +AppGroupDestroyAssoc + 1 CARD8 opcode + 1 7 XC-APPGROUP opcode + 2 2 length + 4 WINDOW window + + + + + +Library API + + + + + + + + +Status XagQueryVersion ( xkb, keycode) /* macro */ + + + + +Display dpy; + + + + +int * major_version_return; + + + + +int * minor_version_return; + + + + + + + +XagQueryVersion sets major_version_return and minor_version_return to the major and minor Application Group protocol version supported by the server. If the Xag library is compatible with the version returned by the server it returns non-zero. If dpy does not support the Application Group extension, or if the server and library protocol versions are incompatible, or if there was an error during communication with the server, it returns zero. No other Xag functions may be called before this function. If a program violates this rule, the effects of all subsequent Xag calls that it makes are undefined. + + + +An embedding manager in, e.g. a Personal Computer Web Browser, will need to open a connection to the Personal Computer X server by calling XOpenDisplay() before using the Application Group extension. + + + +An embedding manager such as a web browser that intends to embed programs in an Application Group should create the Application Group with XagCreateEmbeddedApplicationGroup. + + + + + + + + + + +Status XagCreateEmbeddedApplicationGroup( + + + + + Display* dpy, + + + + + VisualID root_visual, + + + + + Colormap default_colormap, + + + + + unsigned long black_pixel, + + + + + unsigned long white_pixel, + + + + + XAppGroup* app_group_return); + + + + + + + + +XagCreateEmbeddedApplicationGroup creates an Application Group for an embedding manager with the attributes specified. It also sets the default_root attribute to DefaultRoot(dpy, DefaultsScreen(dpy)) and the single_screen and app_group_leader attributes to True. It returns the Application Group ID in app_group_return. + + + +You can create an Application Group without intending to do embedding. One reason for doing this is to give a group of clients their own font-path. + + + +A special font-path can be created by creating an Application Group, getting an Authorization using XSecurityGenerateAuthorization, and then running ‘xset fp+ <new font path>’ as a member of the Application Group. Font-path elements added in this way will be "private" to the Application Group. + + + + + + + + + +Status XagCreateNonembeddedApplicationGroup( + + + + + Display* dpy, + + + + + XAppGroup* app_group_return); + + + + + + + +An Application Group created with XagCreateNonembeddedApplicationGroup will have the default_root, root_visual, and default_colormap attributes all set to None; the single_screen and app_group_leader attributes are set to False, and the black_pixel and white_pixel attributes are not used since the default_colormap attribute is None. + + + +To destroy an Application Group use XagDestroyApplicationGroup. + + + + + + + + + +Status XagDestroyApplicationGroup( + + + + + Display* dpy, + + + + + XAppGroup app_group); + + + + + + + +The Application Group specified by app_group is destroyed. If the Application Group was created using XagCreateEmbeddingApplicationGroup, i.e. and therefore the app_group_leader attribute is True, all programs that are members of the Application Group are killed as if a KillClient request had been issued. + + + + +To retrieve the attributes of an Application Group use XagGetApplicationGroupAttributes. + + + + + + + + + + +Status XagGetApplicationGroupAttributes( + + + + + Display* dpy, + + + + + XAppGroup app_group, + + + + + ...); + + + + + + + + + +XagGetApplicationGroupAttributes is a varargs function that retrieves the Application Group’s attributes specified in the vararg parameter list. + + + +The attributes that may be specified are: XagNappGroupLeader, XagNsingleScreen, XagNdefaultRoot, XagNrootVisual, XagNdefaultColormap, XagNblackPixel, and XagNwhitePixel; which correspond to app_group_leader, single_screen, default_root, root_visual, default_colormap, black_pixel, and white_pixel respectively. See AppGroupCreate in Section 3 for a description of each attribute. + + + +The types for each of the parameters are pointers to the following: + + + + single_screen Bool + default_root Window + root_visual VisualID + default_colormap Colormap + black_pixel unsigned long + white_pixel unsigned long + app_group_leader Bool + + + +Example: + ... + Boolean app_group_leader, single_screen; + Window default_root; + VisualID root_visual; + Colormap default_colormap; + Pixel black_pixel, white_pixel; + ... + status = XagGetApplicationGroupAttributes(dpy, app_group, + XagNappGroupLeader, &app_group_leader, + XagNsingleScreen, &single_screen, + XagNdefault_root, &default_root, + XagNrootVisual, &root_visual, + XagNdefaultColormap, &default_colormap, + XagNblackPixel, &black_pixel, + XagNwhitePixel, &white_pixel, + NULL); + ... + + + + +To determine which Application Group a resource (such as a window) belongs to, use XagQueryApplicationGroup. + + + + + + + + + +Status XagQueryApplicationGroup( + + + + + Display* dpy, + + + + + XID resource, + + + + + XAppGroup* app_group_return); + + + + + + + + +The Application Group is returned in app_group_return, if the resource is not in any Application Group then app_group_return will be set to None. + + + +To associate an X Window ID with a system-specific window ID, such as a HWND or a WindowPtr, use XagCreateAssociation. + + + + + + + + + +Status XagCreateAssociation( + + + + + Display* dpy, + + + + + Window* window_return, + + + + + void* system_window); + + + + + + + + +The window_ret may be used as the target for a ReparentWindow request. + + + +Because XReparentWindow is not constrained in the same way that Win32’s SetParent and the Macintosh are, there is no reason to call XagCreateAssociation in an X-based embedding manager. As such if XagCreateAssociation is called in a native X program, the window_return will be the same as the system_window, and the implementation may even elect to not generate any protocol. + + +To create an association on the Macintosh: + + + struct { + WindowPtr win; + Rect rect; + } system_window; + system_window.win = win_ptr; + system_window.rect.top = system_window.rect.left = 20; + system_window.rect.bottom = 180; + system_window.rect.right = 380; + + + + status = XagCreateAssociation (dpy, &window, (void*)&system_window); + + + +To create an association using a Win16, Win32, or OS/2 PM: + + + + HWND system_window; + status = XagCreateAssociation (dpy, &window, (void*)&system_window); + + + +To destroy the association created with XagCreateAssociation use XagDestroyAssociation. + + + + + + + + + + +Status XagDestroyAssociation( + + + + + Display* dpy, + + + + + Window window); + + + + + + + +After calling XagDestroyAssociation the window may no longer be used to +reparent windows with XReparentWindow. + + + +Like XagCreateAssociation, if the native window system is X11 the implementation may elect to not generate any protocol as a result of this function call in order to avoid unintentionally destroying the the system_window that was specified in the prior XagCreateAssociation call. + + + +
diff --git a/miniconda3/share/doc/xextproto/dbe.xml b/miniconda3/share/doc/xextproto/dbe.xml new file mode 100644 index 0000000000000000000000000000000000000000..f0b345c3a0099c3f72c3dccdd0ecfb1cdf613fe6 --- /dev/null +++ b/miniconda3/share/doc/xextproto/dbe.xml @@ -0,0 +1,1069 @@ + + %defs; +]> + + + + + + + + Double Buffer Extension Protocol + X Consortium Standard + + + IanElliott + Hewlett-Packard Company + + + DavidP.Wiggins + X Consortium + + + 1989199219931994 + X Consortium, Inc. + + 1989Digital Equipment Corporation + 1992Intergraph Corporation + 1993Silicon Graphics, Inc. + 1994Hewlett-Packard Company + X Version 11, Release &fullrelvers; + Version 1.0 + + + +Permission to use, copy, modify, and distribute this documentation for any +purpose and without fee is hereby granted, provided that the above copyright +notice and this permission notice appear in all copies. Digital Equipment +Corporation, Intergraph Corporation, Silicon Graphics, Hewlett-Packard, and +the X Consortium make no representations about the suitability for any purpose +of the information in this document. This documentation is provided “as is” +without express or implied warranty. + + + + + +Introduction +The Double Buffer Extension (DBE) provides a standard way to utilize +double-buffering within the framework of the X Window System. Double-buffering +uses two buffers, called front and back, which hold images. The front buffer +is visible to the user; the back buffer is not. Successive frames of an +animation are rendered into the back buffer while the previously rendered +frame is displayed in the front buffer. When a new frame is ready, the back +and front buffers swap roles, making the new frame visible. Ideally, this +exchange appears to happen instantaneously to the user and with no visual +artifacts. Thus, only completely rendered images are presented to the user, +and they remain visible during the entire time it takes to render a new frame. +The result is a flicker-free animation. + + + + +Goals +This extension should enable clients to: + + + + + Allocate and deallocate double-buffering for a window. + + + +Draw to and read from the front and back buffers associated with a window. + + + + Swap the front and back buffers associated with a window. + + + +Specify a wide range of actions to be taken when a window is swapped. +This includes explicit, simple swap actions (defined below), and more +complex actions (for example, clearing ancillary buffers) that can be put +together within explicit "begin" and "end" requests (defined below). + + + + +Request that the front and back buffers associated with multiple +double-buffered windows be swapped simultaneously. + + + + + +In addition, the extension should: + + + + + +Allow multiple clients to use double-buffering on the same window. + + + +Support a range of implementation methods that can capitalize on existing +hardware features. + + + + Add no new event types. + + + +Be reasonably easy to integrate with a variety of direct graphics hardware +access (DGHA) architectures. + + + + + + + +Concepts + + +Normal windows are created using the core CreateWindow +request, which allocates a set of window attributes and, for InputOutput +windows, a front buffer, into which an image can be drawn. The contents of +this buffer will be displayed when the window is visible. + + +This extension enables applications to use double-buffering with a window. +This involves creating a second buffer, called a back buffer, and associating +one or more back buffer names (XIDs) with the window for use when referring to +(that is, drawing to or reading from) the window's back buffer. The back +buffer name is a DRAWABLE of type BACKBUFFER. + + + +DBE provides a relative double-buffering model. One XID, the window, always +refers to the front buffer. One or more other XIDs, the back buffer names, +always refer to the back buffer. After a buffer swap, the window continues to +refer to the (new) front buffer, and the back buffer name continues to refer +to the (new) back buffer. Thus, applications and toolkits that want to just +render to the back buffer always use the back buffer name for all drawing +requests to the window. Portions of an application that want to render to +the front buffer always use the window XID for all drawing requests to the +window. + + + +Multiple clients and toolkits can all use double-buffering on the same +window. DBE does not provide a request for querying whether a window has +double-buffering support, and if so, what the back buffer name is. Given +the asynchronous nature of the X Window System, this would cause race +conditions. Instead, DBE allows multiple back buffer names to exist for +the same window; they all refer to the same physical back buffer. The first +time a back buffer name is allocated for a window, the window becomes +double-buffered and the back buffer name is associated with the window. +Subsequently, the window already is a double-buffered window, and nothing +about the window changes when a new back buffer name is allocated, except +that the new back buffer name is associated with the window. The window +remains double-buffered until either the window is destroyed or until all of +the back buffer names for the window are deallocated. + + + +In general, both the front and back buffers are treated the same. In +particular, here are some important characteristics: + + + + + +Only one buffer per window can be visible at a time (the front buffer). + + + + +Both buffers associated with a window have the same visual type, depth, +width, height, and shape as the window. + + + + +Both buffers associated with a window are "visible" (or "obscured") in +the same way. When an Expose event is generated for a window, both +buffers should be considered to be damaged in the exposed area. Damage +that occurs to either buffer will result in an Expose event on the window. +When a double-buffered window is exposed, both buffers are tiled with the +window background, exactly as stated by the core protocol. Even though +the back buffer is not visible, terms such as obscure apply to the back +buffer as well as to the front buffer. + + + + +It is acceptable at any time to pass a BACKBUFFER in any +request, notably any core or extension drawing request, that expects +a DRAWABLE. This enables an application to draw directly into +BACKBUFFERs in the same fashion as it would draw into any other +DRAWABLE. + + + + +It is an error (Window) to pass a BACKBUFFER in a core request that +expects a Window. + + + + +A BACKBUFFER will never be sent by core X in a reply, event, or error +where a Window is specified. + + + + +If core X11 backing-store and save-under applies to a double-buffered +window, it applies to both buffers equally. + + + + +If the core ClearArea request is executed on a +double-buffered window, the same area in both the front and back buffers +is cleared. + + + + +The effect of passing a window to a request that accepts a DRAWABLE is +unchanged by this extension. The window and front buffer are synonymous with +each other. This includes obeying the GetImage semantics +and the subwindow-mode semantics if a core graphics context is involved. +Regardless of whether the window was explicitly passed in a +GetImage request, or implicitly referenced (that is, +one of the windo's ancestors was passed in the request), the front (that is, +visible) buffer is always referenced. Thus, DBE-naive screen dump clients will +always get the front buffer. GetImage on a back buffer +returns undefined image contents for any obscured regions of the back buffer +that fall within the image. + + + +Drawing to a back buffer always uses the clip region that would be used to +draw to the front buffer with a GC subwindow-mode of +ClipByChildren. If an +ancestor of a double-buffered window is drawn to with a core GC having a +subwindow-mode of IncludeInferiors, the effect on the +double-buffered window's back buffer depends on the depth of the +double-buffered window and the ancestor. If the depths are the same, the +contents of the back buffer of the double-buffered window are not changed. +If the depths are different, the contents of the back buffer of the +double-buffered window are undefined for the pixels that the +IncludeInferiors drawing touched. + + + +DBE adds no new events. DBE does not extend the semantics of any existing +events with the exception of adding a new DRAWABLE type called BACKBUFFER. If +events, replies, or errors that contain a DRAWABLE (for example, +GraphicsExpose) are generated in response to a request, +the DRAWABLE returned will be the one specified in the request. + + + +DBE advertises which visuals support double-buffering. + + + +DBE does not include any timing or synchronization facilities. +Applications that need such facilities (for example, to maintain a constant +frame rate) should investigate the Synchronization Extension, an X +Consortium standard. + + + +Window Management Operations + + +The basic philosophy of DBE is that both buffers are treated the same by core +X window management operations. + + + +When the core DestroyWindow is executed on a +double-buffered window, both buffers associated with the window are +destroyed, and all back buffer names associated with the window are freed. + + + +If the core ConfigureWindow request changes the size of +a window, both buffers assume the new size. If the windo's size increases, +the effect on the buffers depends on whether the implementation honors bit +gravity for buffers. If bit gravity is implemented, then the contents of +both buffers are moved in accordance with the windo's bit gravity (see the +core ConfigureWindow request), and the remaining areas +are tiled with the window background. If bit gravity is not implemented, then +the entire unobscured region of both buffers is tiled with the window +background. In either case, Expose events are generated +for the region that is tiled with the window background. + + + +If the core GetGeometry request is executed on a +BACKBUFFER, the returned x, y, and border-width will be zero. + + + +If the Shape extension ShapeRectangles, +ShapeMask, +ShapeCombine, or +ShapeOffset +request is executed on a double-buffered window, both buffers are reshaped +to match the new window shape. The region difference is the following: + + + + D = newshape - oldshape + + + +It is tiled with the window background in both buffers, and +Expose events are generated for D. + + + + + +Complex Swap Actions + +DBE has no explicit knowledge of ancillary buffers (for example, depth +buffers or alpha buffers), and only has a limited set of defined swap +actions. Some applications may need a richer set of swap actions than DBE +provides. Some DBE implementations have knowledge of ancillary buffers, +and/or can provide a rich set of swap actions. Instead of continually +extending DBE to increase its set of swap actions, DBE provides a flexible +"idiom" mechanism. If an application's needs are served by the defined swap +actions, it should use them; otherwise, it should use the following method +of expressing a complex swap action as an idiom. Following this policy will +ensure the best possible performance across a wide variety of implementations. + + + +As suggested by the term "idiom," a complex swap action should be expressed +as a group/series of requests. Taken together, this group of requests may be +combined into an atomic operation by the implementation, in order to maximize +performance. The set of idioms actually recognized for optimization is +implementation dependent. To help with idiom expression and interpretation, +an idiom must be surrounded by two protocol requests: +DBEBeginIdiom and +DBEEndIdiom. Unless this begin-end pair +surrounds the idiom, it may not be recognized by a given implementation, and +performance will suffer. + + + +For example, if an application wants to swap buffers for two windows, and +use core X to clear only certain planes of the back buffers, the application +would issue the following protocol requests as a group, and in the following +order: + + + + + DBEBeginIdiom request. + + + +DBESwapBuffers request with XIDs for two windows, each of which uses +a swap action of Untouched. + + + + +Core X PolyFillRectangle request to the back buffer of one window. + + + + +Core X PolyFillRectangle request to the back buffer of the other window. + + + + DBEEndIdiom request. + + + + +The DBEBeginIdiom and DBEEndIdiom +requests do not perform any actions themselves. They are treated as markers +by implementations that can combine certain groups/series of requests as +idioms, and are ignored by other implementations or for nonrecognized +groups/series of requests. If these requests are sent out of order, or are +mismatched, no errors are sent, and the requests are executed as usual, +though performance may suffer. + + + +An idiom need not include a DBESwapBuffers request. For +example, if a swap action of Copied is desired, but only some of the planes +should be copied, a core X +CopyArea request may be used instead of +DBESwapBuffers. +If DBESwapBuffers is included in an idiom, it should +immediately follow the DBEBeginIdiom request. Also, when +the DBESwapBuffers is included in an idiom, that +request's swap action will still be valid, and if the swap action might +overlap with another request, then the final result of the idiom must be as if +the separate requests were executed serially. For example, if the specified +swap action is Untouched, and if a PolyFillRectangle +using a client clip rectangle is done to the windo's back buffer after the +DBESwapBuffers request, then the contents of the new +back buffer (after the idiom) will be the same as if the idiom was not +recognized by the implementation. + + + +It is highly recommended that Application Programming Interface (API) +providers define, and application developers use, "convenience" functions +that allow client applications to call one procedure that encapsulates +common idioms. These functions will generate the +DBEBeginIdiom request, the idiom requests, and +DBEEndIdiom request. Usage of these functions will +ensure best possible performance across a wide variety of implementations. + + + + + + +Requests +The DBE defines the following requests. + + +DBEGetVersion + +This request returns the major and minor version numbers of this extension. + + +DBEGetVersion + + + + + + + + client-major-version + CARD8 + + + client-minor-version + CARD8 + + + => + + + + server-major-version + CARD8 + + + server-minor-version + CARD8 + + + + + + +The client-major-version and client-minor-version numbers indicate what +version of the protocol the client wants the server to implement. The +server-major-version and the server-minor-version numbers returned indicate +the protocol this extension actually supports. This might not equal the +version sent by the client. An implementation can (but need not) support +more than one version simultaneously. The server-major-version and +server-minor-version allow the creation of future revisions of the DBE +protocol that may be necessary. In general, the major version +would increment for incompatible changes, and the minor version would increment +for small, upward-compatible changes. Servers that support the protocol +defined in this document will return a server-major-version of one (1), and a +server-minor-version of zero (0). + + + +The DBE client must issue a DBEGetVersion request before any other double +buffering request in order to negotiate a compatible protocol version; +otherwise, the client will get undefined behavior (DBE may or may not work). + + + + + +DBEGetVisualInfo + +This request returns information about which visuals support double buffering. + + +DBEGetVisualInfo + + + + + + + + + screen-specifiers + LISTofDRAWABLE + + + => + + + + visinfo + LISTofSCREENVISINFO + + + + +where: + + + + + + + + + SCREENVISINFO + LISTofVISINFO + + + VISINFO + [ visual: VISUALID + + + + depth: CARD8 + + + + perflevel: CARD8 ] + + + + + +Errors: Drawable + + +All of the values passed in screen-specifiers must be valid DRAWABLEs (or a +Drawable error results). For each drawable in +screen-specifiers, the reply will contain a list of VISINFO structures for +visuals that support double-buffering on the screen on which the drawable +resides. The visual member specifies the VISUALID. The depth member specifies +the depth in bits for the visual. The perflevel is a performance hint. The +only operation defined on a perflevel is comparison to a perflevel of another +visual on the same screen. The visual having the higher perflevel is likely +to have better double-buffer graphics performance than the visual having the +lower perflevel. Nothing can be deduced from any of the following: the +magnitude of the difference of two perflevels, a perflevel value in isolation, +or comparing perflevels from different servers. + + + +If the list of screen-specifiers is empty, information for all screens is +returned, starting with screen zero. + + + + + +DBEAllocateBackBufferName + + +This request allocates a drawable ID used to refer to the back buffer of a +window. + + +DBEAllocateBackBufferName + + + + + + + + + window + WINDOW + + + back-buffer-name + BACKBUFFER + + + swap-action-hint + SWAPACTION + + + + + + +Errors: Alloc, Value, IDChoice, Match, Window + + + +If the window is not already a double-buffered window, the window becomes +double-buffered, and the back-buffer-name is associated with the window. The +swap-action-hint tells the server which swap action is most likely to be +used with the window in subsequent DBESwapBuffers +requests. The swap-action-hint must have one of the values specified for type +SWAPACTION (or a Value error results). See the description of the +DBESwapBuffers request for a complete discussion of +swap actions and the SWAPACTION type. + + + +If the window already is a double-buffered window, nothing about the window +changes, except that an additional back-buffer-name is associated with the +window. The window remains double-buffered until either the window is +destroyed, or until all of the back buffer names for the window are +deallocated. + + + +The window passed into the request must be a valid WINDOW (or a Window error +results). The window passed into the request must be an InputOutput window (or +a Match error results). The visual of the window must be in the list returned +by DBEGetVisualInfo (or a Match error results). The +back-buffer-name must be in the range assigned to the client, and must not +already be in use (or an IDChoice error results). If the server cannot +allocate all resources associated with turning on double-buffering for the +window, an Alloc error results, the windo's double-buffer status (whether it +is already double-buffered or not) remains unchanged, and the +back-buffer-name is freed. + + + + +DBEDeallocateBackBufferName + +This request frees a drawable ID that was obtained by +DBEAllocateBackBufferName. + + +DBEDeallocateBackBufferName + + + + + + + + + back-buffer-name + BACKBUFFER + + + + + +Errors: Buffer + + +The back-buffer-name passed in the request is freed and no longer associated +with the window. If this is the last back-buffer-name associated with the +window, then the back buffer is no longer accessible to clients, and all +double-buffering resources associated with the window may be freed. The +window's current front buffer remains the front buffer. + + + +The back-buffer-name must be a valid BACKBUFFER associated with a window (or +a Buffer error results). + + + + +DBESwapBuffers + +This request swaps the buffers for all windows listed, applying the +appropriate swap action for each window. + + +DBESwapBuffers + + + + + + + + + windows + LISTofSWAPINFO + + + + +where: + + + + + + + + SWAPINFO + [ window: WINDOW + + + + swap-action: SWAPACTION ] + + + SWAPACTION + { Undefined, Background, Untouched, Copied } + + + + + +Errors: Match, Window, Value + + +Each window passed into the request must be a valid WINDOW (or a +Window error results). Each window passed into the +request must be a double-buffered window (or a Match +error results). Each window passed into the request must only be listed +once (or a Match error results). Each swap-action in +the list must have one of the values specified for type SWAPACTION (or a +Value error results). If an error results, none of +the valid double-buffered windows will have their buffers swapped. + + + +The swap-action determines what will happen to the new back buffer of the +window it is paired with in the list in addition to making the old back +buffer become visible. The defined actions are as follows: + + + + + Undefined + +The contents of the new back buffer become undefined. This may be the +most efficient action since it allows the implementation to discard the +contents of the buffer if it needs to. + + + + Background + +The unobscured region of the new back buffer will be tiled with the window +background. The background action allows devices to use a fast clear +capability during a swap. + + + + Untouched + +The unobscured region of the new back buffer will be unmodified by the swap. + + + + Copied + +The unobscured region of the new back buffer will be the contents of the +old back buffer. + + + + + +If DBESwapBuffers is included in a "swap and clear" +type of idiom, it must immediately follow the +DBEBeginIdiom request. + + + + +DBEBeginIdiom + +This request informs the server that a complex swap will immediately follow +this request. + + +DBEBeginIdiom + + +As previously discussed, a complex swap action is a group/series of +requests that, taken together, may be combined into an atomic operation by +the implementation. The sole function of this request is to serve as a +"marker" that the server can use to aid in idiom processing. The server is +free to implement this request as a no-op. + + + + +DBEEndIdiom + + + +This request informs the server that a complex swap has concluded. + + +DBEEndIdiom + + +The sole function of this request is to serve as a "marker" that the server +can use to aid in idiom processing. The server is free to implement this +request as a no-op. + + + + + +DBEGetBackBufferAttributes + +This request returns information about a back buffer. + +DBEGetBackBufferAttributes + + + + + + + + + back-buffer-name + BACKBUFFER + + + => + + + + attributes + BUFFER_ATTRIBUTES + + + + + +where: + +BUFFER_ATTRIBUTES: [ window: WINDOW ] + + +If back-buffer-name is a valid BACKBUFFER, the window field of the +attributes in the reply will be the window which has the back buffer that +back-buffer-name refers to. If back-buffer-name is not a valid BACKBUFFER, +the window field of the attributes in the reply will be None. + + + + + + +Encoding + +Please refer to the X11 Protocol Encoding document as this section uses +syntactic conventions and data types established there. + + +The name of this extension is "DOUBLE-BUFFER". + + +Type +The following new types are used by the extension. + + +BACKBUFFER: XID +SWAPACTION + +#x00 Undefined +#x01 Background +#x02 Untouched +#x03 Copied + + +SWAPINFO + +4 WINDOW window +1 SWAPACTION swap action +3 unused + + +VISINFO + +4 VISUALID visual +1 CARD8 depth +1 CARD8 perflevel +2 unused + + +SCREENVISINFO + +4 CARD32 n, number in list +8n LISTofVISINFO n VISINFOs + + +BUFFER_ATTRIBUTES + +4 WINDOW window + + + + +Error +Buffer + +1 0 error +1 error base + 0 code +2 CARD16 sequence number +4 CARD32 bad buffer +2 CARD16 minor-opcode +1 CARD8 major-opcode +21 unused + + + + +Request + +DBEGetVersion + +1 CARD8 major-opcode +1 0 minor-opcode +2 2 request length +1 CARD8 client-major-version +1 CARD8 client-minor-version +2 unused +=> +1 unused +2 CARD16 sequence number +4 0 reply length +1 CARD8 server-major-version +1 CARD8 server-minor-version +22 unused + + +DBEAllocateBackBufferName + +1 CARD8 major-opcode +1 1 minor-opcode +2 4 request length +4 WINDOW window +4 BACKBUFFER back buffer name +1 SWAPACTION swap action hint +3 unused + + +DBEDeallocateBackBufferName + +1 CARD8 major-opcode +1 2 minor-opcode +2 2 request length +4 BACKBUFFER back buffer name + + + +DBESwapBuffers + +1 CARD8 major-opcode +1 3 minor-opcode +2 2+2n request length +4 CARD32 n, number of window/swap action pairs in list +8n LISTofSWAPINFO window/swap action pairs + + + +DBEBeginIdiom + +1 CARD8 major-opcode +1 4 minor-opcode +2 1 request length + + +DBEEndIdiom + +1 CARD8 major-opcode +1 5 minor-opcode +2 1 request length + + +DBEGetVisualInfo + +1 CARD8 major-opcode +1 6 minor-opcode +2 2+n request length +4 CARD32 n, number of screen specifiers in list +4n LISTofDRAWABLE n screen specifiers +=> +1 1 Reply +1 unused +2 CARD16 sequence number +4 CARD32 j, reply length +4 CARD32 m, number of SCREENVISINFOs in list +20 unused +4j LISTofSCREENVISINFO m SCREENVISINFOs + + +DBEGetBackBufferAttributes + +1 CARD8 major-opcode +1 7 minor-opcode +2 2 request length +4 BACKBUFFER back-buffer-name +=> +1 unused +2 CARD16 sequence number +4 0 reply length +4 BUFFER_ATTRIBUTES attributes +20 unused + + + + + + +Acknowledgements + +We wish to thank the following individuals who have contributed their time +and talent toward shaping the DBE specification: + +T. Alex Chen, IBM; Peter Daifuku, Silicon Graphics, Inc.; +Ian Elliott, Hewlett-Packard Company; Stephen Gildea, X Consortium, Inc.; +Jim Graham, Sun; Larry Hare, AGE Logic; Jay Hersh, X Consortium, Inc.; +Daryl Huff, Sun; Deron Dann Johnson, Sun; Louis Khouw, Sun; +Mark Kilgard, Silicon Graphics, Inc.; Rob +Lembree, Digital Equipment Corporation; Alan Ricker, Metheus; Michael +Rosenblum, Digital Equipment Corporation; Bob Scheifler, X Consortium, Inc.; +Larry Seiler, Digital Equipment Corporation; Jeanne Sparlin Smith, IBM; +Jeff Stevenson, Hewlett-Packard Company; Walter Strand, Metheus; Ken +Tidwell, Hewlett-Packard Company; and David P. Wiggins, X Consortium, Inc. + + + +Mark provided the impetus to start the DBE project. Ian wrote the first +draft of the specification. David served as architect. + + + + +References + +Jeffrey Friedberg, Larry Seiler, and Jeff Vroom, "Multi-buffering Extension +Specification Version 3.3." + +Tim Glauert, Dave Carver, Jim Gettys, and David P. Wiggins, +"X Synchronization Extension Version 3.0." + + + diff --git a/miniconda3/share/doc/xextproto/dpms.xml b/miniconda3/share/doc/xextproto/dpms.xml new file mode 100644 index 0000000000000000000000000000000000000000..7edfe5c2595c247f61029ae3bc2493bcef474cfd --- /dev/null +++ b/miniconda3/share/doc/xextproto/dpms.xml @@ -0,0 +1,663 @@ + + %defs; +]> + + + + + X Display Power Management Signaling (DPMS) Extension Protocol Specification + X Project Team Standard + + + Rob Lembree + Digital Equipment Corporation + lembree@zk3.dec.com + + + X Version 11, Release &fullrelvers; + Version 1.0 + 1996Digital Equipment Corporation + + + +Permission to use, copy, modify, distribute, and sell this +documentation for any purpose is hereby granted without fee, +provided that the above copyright notice and this permission +notice appear in all copies. Digital Equipment Corporation +makes no representations about the suitability for any purpose +of the information in this document. This documentation is +provided “as is” without express or implied warranty. + + + + + + +Overview + +This extension provides X Protocol control over the VESA Display +Power Management Signaling (DPMS) characteristics of video boards +under control of the X Window System. + +X Window System is a trademark of The Open Group. + + + + + + + +Traditionally, the X Window System has provided for both blanking and +non-blanking screen savers. Timeouts associated with these built-in +screen saver mechanisms are limited to idle (dwell) time, and a change +timeout that specifies the change interval for non-blanking screen savers. + + + +The United States' Environmental Protection Agency (EPA) Energy Star program +requires that monitors power down after some idle time by default. +While it is possible to simply overload the existing screen saver timeouts, +this solution leaves the non-privileged user little to no control over +the DPMS characteristics of his or her system. For example, disabling +DPMS would require some unintended side effect in the core screen saver, +such as disabling the changing of a non-blanking screen saver. Providing +clients with this control requires an extension to the core X Window System +Protocol, and this extension seeks to fill this gap. + + + +The design goal of the DPMS extension is to be a logical extension to +the traditional screen saver. The protocol and sample implementation is +designed to use the same date types and time units as the screen saver. +The sample implementation works independently from the screen saver so that +policy as it pertains to the interaction between screen saver and DPMS can +be deferred to the user or screen saver application. The extension has +been tested with and shown to work correctly with both the internal blanking +and non-blanking screen savers, as well as with screen saver extension +clients. + + +The DPMS extension is designed to be simple, yet export sufficient +VESA DPMS information to enable full function clients to be written. +Included is the ability to sense DPMS capability, set and get DPMS timeouts, +enable and disable individual DPMS modes, enable and disable DPMS (without +destroying timeout values), and sense current DPMS on/off state and +power level. + + +There are four power levels specified by the Video Electronics Standards +Association (VESA) Display Power Management Signaling (DPMS) standard. +These are: + + + +DPMS Extension Power Levels + 0 DPMSModeOn In use + 1 DPMSModeStandby Blanked, low power + 2 DPMSModeSuspend Blanked, lower power + 3 DPMSModeOff Shut off, awaiting activity + + + +It is logical to assume that successive DPMS modes be chronologically +at the same time or later than one another, and the protocol is designed +to enforce this rule. + + + +Note however that a conscious decision is made to decouple the timeouts +associated with screen saver from the DPMS timeouts. While it might be +considered logical to require that the first non-zero DPMS timeout be +greater than or equal to the screen saver timeout, this is intentionally +omitted, leaving this policy decision to the user or the screen saver +application. In the case of a laptop where power may be scarce, the +importance of power savings should supersede the screen saver. If the +laptop user plugs the unit in and power is no longer a scarce commodity, +it may be decided to make DPMS less aggressive, or disable it completely. + + + + +Requests + +DPMSGetVersion + + + + + + + + + +client_major_version: CARD16 + + + + +client_minor_version: CARD16 + + + + => + + + +server_major_version: CARD16 + + + + +server_minor_version: CARD16 + + + + + + + +If supplied, the client_major_version and +client_minor_version indicate what version +of the protocol the +client wants the server to implement. The server version numbers +returned indicate the protocol this extension actually supports. This +might not equal the version sent by the client. An implementation can +(but need not) support more than one version simultaneously. The +server_major_version and the +server_minor_version are a +mechanism to support future revisions of the Display Power Management +Signaling protocol which may be necessary. In general, the major version +would increment for incompatible changes, and the minor version would +increment for small, upward-compatible changes. Servers that support the +protocol defined in this document will return a +server_major_version +of one (1), and a server_minor_version +of two (2). + + + +DPMSCapable + + + + + + + + + => + + + +capable: BOOL + + + + + + + +This request is used to determine whether or not the currently running +server's devices are capable of DPMS operations. The truth value of this +request is implementation defined, but is generally based on the capabilities +of the graphic card and monitor combination. Also, the return value in the +case of heterogeneous multi-head servers is implementation defined. + + + +DPMSGetTimeouts + + + + + + + + + => + + + +standby_timeout: CARD16 + + + + +suspend_timeout: CARD16 + + + + +off_timeout: CARD16 + + + + + + + +This request returns the current values of the DPMS timeout values. All +values are in units of seconds. + + + +standby_timeout is the amount of time +of inactivity before standby +mode is invoked. The actual effects of this mode are implementation defined, +but in the case of DPMS compliant hardware, it is implemented by shutting off +the horizontal sync signal, and pulsing the vertical sync signal. Standby +mode provides the quickest monitor recovery time. Note also that many +monitors implement this mode identically to suspend mode. A value of +zero indicates that this mode is disabled. + + + +suspend_timeout is the amount of time +of inactivity before the second +level of power savings is invoked. Suspend mode's physical and electrical +characteristics are implementation defined, but in DPMS compliant hardware, +results in the pulsing of the horizontal sync signal, and shutting off of +the vertical sync signal. Suspend mode recovery is considered to be slower +than standby mode, but faster than off mode, however this is monitor +dependent. As noted above, many monitors implement this mode identically to +standby mode. A value of zero indicates that this mode is disabled. + + + +off_timeout is the amount of time of +inactivity before the third and +final level of power savings is invoked. Off mode's physical and electrical +characteristics are implementation defined, but in DPMS compliant hardware, +is implemented by shutting off both horizontal and vertical sync signals, +resulting in the power-down of the monitor. Recovery time is implementation +dependent, but frequently is similar to the power-up time of the monitor. A +value of zero indicates that this mode is disabled. + + + +DPMSSetTimeouts + + + + + + + + + +standby_timeout: CARD16 + + + + +suspend_timeout: CARD16 + + + + +off_timeout: CARD16 + + + + => + + + + + + + +All values are in units of seconds. +standby_timeout is the amount of +time of inactivity before standby mode will be invoked. This is the +lightest level of power savings, and the monitor is generally immediately +ready upon detection of user activity. This is most often implemented by +shutting off the horizontal sync signal to the monitor. +A value of zero disables this mode. + + + +The suspend_timeout specifies the amount +of time of inactivity +before the screen is placed into suspend mode. Suspend mode is the +middle level of power savings, resulting in a slightly longer recovery +upon detection of activity. Suspend mode is most often implemented by +pulsing the horizontal sync signal, and removing the vertical sync +signal. A value of zero disables this mode. + + + +The off_timeout specifies the amount of +time of inactivity before +the monitor is shut off. Off mode is the deepest level of power management, +resulting in the greatest power savings and the longest recovery time. +Off mode is most often implemented by removing both the horizontal and +vertical signals. A value of zero disables this mode. + + +The values of successive power levels must be greater than or equal +to the value of the previous (non-zero) level. A BadValue error is generated +if an illegal combination is detected. + + +DPMSEnable + + +=> + + + +This request enables the DPMS characteristics of the server, using the +server's currently stored timeouts. If DPMS is already enabled, no change is +effected. + + + +DPMSDisable + + +=> + + + +This request disables the DPMS characteristics of the server. It does +not affect the core or extension screen savers. If DPMS is already +disabled, no change is effected. This request is provided so that DPMS +may be disabled without damaging the server's stored timeout values. + + + +DPMSForceLevel + + + + + + + + + +power_level: CARD16 + + + + => + + + + + + +This request forces a specific DPMS level on the server. If DPMS is +disabled, a BadMatch error is generated. If an erroneous power level +is specified, a BadValue error is returned, and the error value contains +the bad value. If the power level specified is already in effect, no +changes occur. Power Level must be one of DPMSModeOn, DPMSModeStandby, +DPMSModeSuspend or DPMSModeOff. + + + +DPMSInfo + + + + + + + + + => + + + +power_level: CARD16 + + + + +state: BOOL + + + + + + + +This request returns information about the current DPMS state of the +display. state is one of DPMSEnabled +or DPMSDisabled. +If state is DPMSEnabled, +power_level is returned as one +of DPMSModeOn, DPMSModeStandby, DPMSModeSuspend or DPMSModeOff, otherwise +it is undefined. + + + +DPMSSelectInput + + + + + + + + + +event_mask: CARD32 + + + + => + + + + + + +This request specifies whether DPMS extension events should be generated for this client. +If DPMSInfoNotifyMask is set in event-mask, then DPMSInfoNotifyEvent +events will be generated whenever the current DPMS on/off state or power level changes. +If no bits are set, then no events will be generated. + + + + + + +Events + +The DPMS extension adds one event: + + +DPMSInfoNotifyEvent + + + + + + + + + +timestamp: TIMESTAMP + + + + +power_level: CARD16 + + + + +state: BOOL + + + + + + + +This event is delivered to clients that have requested +DPMSInfoNotifyMask events using the DPMSSelectInput request +whenever the current DPMS on/off state or power level changes. +state is one of DPMSEnabled or DPMSDisabled. +If state is DPMSEnabled, +power_level is one +of DPMSModeOn, DPMSModeStandby, DPMSModeSuspend or DPMSModeOff, otherwise +it is undefined. + + + + + +Encoding + +Please refer to the X11 Protocol Encoding document as this document uses +conventions established there. + + + +The name of this extension is "DPMS". + + + +DPMSGetVersion + 1 CARD8 opcode + 1 0 DPMS opcode + 2 2 request length + 2 CARD16 client_major_version + 2 CARD16 client_minor_version +=> + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 length + 2 CARD16 server_major_version + 2 CARD16 server_minor_version + 20 unused + + + +DPMSCapable + 1 CARD8 opcode + 1 1 DPMS opcode + 2 1 request length +=> + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 length + 1 BOOL capable + 23 unused + + + +DPMSGetTimeouts + 1 CARD8 opcode + 1 2 DPMS opcode + 2 1 request length +=> + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 length + 2 CARD16 standby_timeout + 2 CARD16 suspend_timeout + 2 CARD16 off_timeout + 18 unused + + + +DPMSSetTimeouts + 1 CARD8 opcode + 1 3 DPMS opcode + 2 3 request length + 2 CARD16 standby_timeout + 2 CARD16 suspend_timeout + 2 CARD16 off_timeout + 2 unused +=> + + + +DPMSEnable + 1 CARD8 opcode + 1 4 DPMS opcode + 2 1 request length + => + + + +DPMSDisable + 1 CARD8 opcode + 1 5 DPMS opcode + 2 1 request length + => + + + +DPMSForceLevel + 1 CARD8 opcode + 1 6 DPMS opcode + 2 2 request length + 2 power_level + 0 DPMSModeOn + 1 DPMSModeStandby + 2 DPMSModeSuspend + 3 DPMSModeOff + 2 unused +=> + + + +DPMSInfo + 1 CARD8 opcode + 1 7 DPMS opcode + 2 1 request length +=> + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 length + 2 power_level + 0 DPMSModeOn + 1 DPMSModeStandby + 2 DPMSModeSuspend + 3 DPMSModeOff + 1 BOOL state + 21 unused + + + + +DPMSSelectInput + 1 CARD8 opcode + 1 8 DPMS opcode + 2 2 request length + 4 event mask + 0 no events + 1 DPMSInfoNotifyMask + + + +DPMSInfoNotifyEvent + 1 GenericEvent type + 1 CARD8 DPMS extension offset + 2 CARD16 sequence number + 4 0 length + 2 DPMSInfoNotify evtype + 2 unused + 4 TIMESTAMP timestamp + 2 power_level + 0 DPMSModeOn + 1 DPMSModeStandby + 2 DPMSModeSuspend + 3 DPMSModeOff + 1 BOOL state + 13 unused + + + diff --git a/miniconda3/share/doc/xextproto/evi.xml b/miniconda3/share/doc/xextproto/evi.xml new file mode 100644 index 0000000000000000000000000000000000000000..e47feb1d08de986a3a01f099a1e277f9566062e3 --- /dev/null +++ b/miniconda3/share/doc/xextproto/evi.xml @@ -0,0 +1,519 @@ + + %defs; +]> + + + + + + Extended Visual Information Extension + X Project Team Standard + + + PeterDaifuku + Silicon Graphics, Inc. + + + X Version 11, Release &fullrelvers; + Version 1.0 + 1986-1997The Open Group + + + + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this +software and associated documentation files (the Software), to use the +Software without restriction, including, without limitation, the rights to +copy, modify, merge, publish, distribute and sublicense the Software, +to make, have made, license and distribute derivative works thereof, and +to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + + + +The above copyright notice and the following permission notice shall be +included in all copies of the Software: + + + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON- +INFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER USEABILITIY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OF OTHER DEALINGS IN +THE SOFTWARE. + + + +Except as contained in this notice, the name of The Open Group shall not +be used in advertising or otherwise to promote the use or other dealings +in this Software without prior written authorization from The Open Group. + + + +X Window System is a trademark of The Open Group. + + + + + + +Introduction + +EVI (Extended Visual Information extension) allows a client to determine +information about core X visuals beyond what the core protocol provides. + + + + +Goals + +As the X Window System has evolved, it has become clear that the information +returned by the core X protocol regarding Visuals is often insufficient for a +client to determine which is the most appropriate visual for its needs. This +extension allows clients to query the X server for additional visual +information, specifically as regards colormaps and framebuffer levels. + + + +This extension is meant to address the needs of pure X clients only. It is +specifically and purposefully not designed to address the needs of X +extensions. Extensions that have an impact on visual information should provide +their own mechanisms for delivering that information. For example, the Double +Buffering Extension (DBE) provides its own mechanism for determining which +visuals support double-buffering. + + + + +Requests + +GetVersion + + + + + + + + + +client_major_version: CARD8 + + + + +client_minor_version: CARD8 + + + + +=> + + + + +server_major_version: CARD8 + + + + +server_minor_version: CARD8 + + + + + + + + + +If supplied, the client_major_version and client_minor_version indicate +what version of the protocol the client wants the server to implement. +The server version numbers returned indicate the protocol this extension +actually supports. This might not equal the version sent by the client. +An implementation can (but need not) support more than one version +simultaneously. The server_major_version and the server_minor_version +are a mechanism to support future revisions of the EVI protocol that +may be necessary. In general, the major version would increment for +incompatible changes, and the minor version would increment for small +upward-compatible changes. Servers that support the protocol defined in +this document will return a server_major_version of one (1), and a +server_minor_version of zero (0). + + + + GetVisualInfo + + + + + + + + + +visual_list: LISTofVISUALID + + + + +=> + + + + +per_visual_info: LISTofVISUALINFO + + + + + + + +where: + + + + + + + + + +VISUALINFO: [core_visual_id: VISUALID + + + + +screen: CARD8 + + + + +level: INT8 + + + + +transparency_type: CARD8 + + + + +unused: CARD8 + + + + +transparency_value: CARD32 + + + + +min_hw_colormaps: CARD8 + + + + +max_hw_colormaps: CARD8 + + + + +num_colormap_conflicts: CARD16 + + + + +colormap_conflicts: LISTofVISUALID] + + + + + + + + + +level is 0 for normal planes, > 0 for overlays, < 0 for underlays. + + + + +transparency_type is 0 for none, 1 for transparent pixel, 2 for +transparent mask. + + + + +transparency_value: value to get transparent pixel if transparency +supported. + + + + +min_hw_colormaps: minimum number of hardware colormaps backing up the +visual. + + + + +max_hw_colormaps: maximum number of hardware colormaps backing up the +visual. + + + (architectures with static colormap allocation/reallocation would have min += max) + + + + +num_colormap_conflicts: number of elements in colormap_conflicts. + + + + +colormap_conflicts: list of visuals that may conflict with this one. For +example, if a 12-bit colormap is overloaded to support 8-bit visuals, the +8-bit visuals would conflict with the 12-bit visuals. + + + + + + +Events and Errors + +No new events or errors are defined by this extension. + + + + +Changes to existing protocol. + +None. + + + + +Encoding + +The name of this extension is "Extended-Visual-Information". + + + +The conventions used here are the same as those for the core X11 +Protocol Encoding. + + + +GetVersion + 1 CARD8 opcode + 1 0 EVI opcode + 2 2 request length + 2 CARD16 client_major_version + 2 CARD16 client_minor_version +=> + 1 1 reply + 1 unused + 2 CARD16 sequence number + 4 0 length + 2 CARD16 server_major_version + 2 CARD16 server_minor_version + 20 unused + + + +GetVisualInfo + 1 CARD8 opcode + 1 1 EVI opcode + 2 2+n request length + 4 CARD32 n_visual + 4n CARD32 visual_ids +=> + 1 1 reply + 1 unused + 2 CARD16 sequence number + 4 n length + 4 CARD32 n_info + 4 CARD32 n_conflicts + 16 unused + 16n LISTofVISUALINFO items + + + +VISUALINFO + 4 VisualID core_visual_id + 1 INT8 screen + 1 INT8 level + 1 CARD8 transparency_type + 1 CARD8 unused + 4 CARD32 transparency_value + 1 CARD8 min_hw_colormaps + 1 CARD8 max_hw_colormaps + 2 CARD16 num_colormap_conflicts + + + + +C Language Binding + + +The C functions provide direct access to the protocol and add no additional +semantics. For complete details on the effects of these functions, refer +to the appropriate protocol request, which can be derived by deleting Xevi +at the start of the function. All functions that have return type Status +will return nonzero for success and zero for failure. + + + +The include file for this extension is: +< X11/extensions/XEVI.h>. + + + + + Bool XeviQueryVersion + Display *display + int *major_version_return + int *minor_version_return + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + major_version_return + + + +Returns the major version supported by the server. + + + + + + minor_version_return + + + +Returns the minor version supported by the server. + + + + + + +XeviQueryVersion sets major_version_return and minor_version_return to +the major and minor EVI protocol version supported by the server. If +the EVI library is compatible with the version returned by the server, +it returns nonzero. If dpy does not support the EVI extension, or if +there was an error during communication with the server, or if the server +and library protocol versions are incompatible, it returns zero. No other +Xevi functions may be called before this function. If a client violates +this rule, the effects of all subsequent Xevi calls that it makes are +undefined. + + + +To get the extended information for any subset of visuals use +XeviGetVisualInfo. + + + + + int XeviGetVisualInfo + Display *display + VisualID *visual + int n_visual + ExtendedVisualInfo **evi_return + int *n_info_return + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + visual + + + +If NULL, then information for all visuals of all +screens is returned. Otherwise, a pointer to a list of visuals for which +extended visual information is desired. + + + + + + n_visual + + + +If 0, then information for all visuals of all screens is returned. Otherwise, +the number of elements in the array visual. + + + + + + evi_return + + + +Returns a pointer to a list of ExtendedVisualInfo. When done, the client +should free the list using XFree. + + + + + + n_info_return + + + +Returns the number of elements in the list of +ExtendedVisualInfo. + + + + + + +XeviGetVisualInfo returns a list of ExtendedVisualInfo structures that describe +visual information beyond that supported by the core protocol. This includes +layer information relevant for systems supporting overlays and/or underlay +planes, and information that allows applications better to determine the level +of hardware support for multiple colormaps. XeviGetVisualInfo returns Success +if successful, or an X error otherwise. + + + + diff --git a/miniconda3/share/doc/xextproto/geproto.xml b/miniconda3/share/doc/xextproto/geproto.xml new file mode 100644 index 0000000000000000000000000000000000000000..4cca9acf8f388c968911a72b06a7cb1e89f2cda5 --- /dev/null +++ b/miniconda3/share/doc/xextproto/geproto.xml @@ -0,0 +1,126 @@ + + %defs; +]> + + + X Generic Event Extension + + Peter + Hutterer + peter.hutterer@who-t.net + + X Version 11, Release &fullrelvers; + Version 1.0 + 2007Peter Hutterer + + + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + + + The above copyright notice and this permission notice (including the next + paragraph) shall be included in all copies or substantial portions of the + Software. + + + + THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + + + + + + Introduction + + X was designed to provide 64 event opcodes for all extensions. These + events are limited to 32 bytes. + + The Generic Event Extension provides a template event for extensions + to re-use a single event opcode. GE only provide headers and the most + basic functionality, leaving the extensions to interpret the events in + their specific context. + + GenericEvents may be longer than 32 bytes. If so, the number of 4 + byte units following the initial 32 bytes must be specified in the length + field of the event. + + + + Extension Initialization + + The name of this extension is "Generic Event Extension" + + GEQueryVersion + client-major-version: CARD16 + client-minor-version: CARD16 +==> + major-version: CARD16 + minor-version: CARD16 + + The client sends the highest supported version to the server and the + server sends the highest version it supports, but no higher than the + requested version. Major versions changes can introduce incompatibilities + in existing functionality, minor version changes introduce only backward + compatible changes. It is the clients responsibility to ensure that the + server supports a version which is compatible with its + expectations. + + As of version 1.0, no other requests are provided by this extension. + + + + + Events + + GE defines a single event, to be used by all extensions. The event's + structure is similar to a reply. This is a core protocol event, ID 35, and + is not itself an extension event. + + GenericEvent + type: BYTE always GenericEvent (35) + extension: CARD8 extension offset + sequenceNumber: CARD16 low 16 bits of request seq. number + length: CARD32 length + evtype: CARD16 event type + + The field 'extension' is to be set to the major opcode of the + extension. The 'evtype' field is the actual opcode of the event. The + length field specifies the number of 4-byte blocks after the initial 32 + bytes. If length is 0, the event is 32 bytes long. + + + + Notes + + Although the wire event is of arbitrary length, the actual size of + an XEvent is restricted to sizeof(XEvent) [96 bytes, see Xlib.h]. If an + extension converts a wire event to an XEvent > 96 bytes, it will + overwrite the space allocated for the event. See struct _XSQEvent in + Xlibint.h for details. + + Extensions need to malloc additional data and fill the XEvent + structure with pointers to the malloc'd data. The client then needs to + free the data, only the XEvent structure will be released by Xlib. + + The server must not send GenericEvents longer than 32 bytes until it + has verified that the client is able to interpret these events. If a long + event is sent to a client unable to process GenericEvents, future + interpretation of replies and events by this client will fail. + + diff --git a/miniconda3/share/doc/xextproto/lbx.xml b/miniconda3/share/doc/xextproto/lbx.xml new file mode 100644 index 0000000000000000000000000000000000000000..87060b74755dad5a189368934cca9cad8ea9f3b5 --- /dev/null +++ b/miniconda3/share/doc/xextproto/lbx.xml @@ -0,0 +1,6346 @@ + + %defs; +]> + +
+ + + Low Bandwidth X Extension + X Consortium Standard + + + Donna + Converse + + + Jim + Fulton + + + David + Lemke + + + Ralph + Mor + + + Keith + Packard + + + Ray + Tice + + + Dale + Tonogai + + + X Version 11, Release &fullrelvers; + Version 1.0 + 1996X Consortium + + + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated +documentation files (the "Software"), to deal in the Software without +restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and +sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to +the following conditions: + + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions +of the Software. + + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X +CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +Except as contained in this notice, the name of the X Consortium shall not be +used in advertising or otherwise +to promote the sale, use or other dealings in this Software without prior +written authorization from the +X Consortium. + +X Window System is a trademark of The OpenGroup. + + + + +Introduction + + +Low Bandwidth X (LBX) is a network-transparent protocol for running X Window +System applications over transport channels whose bandwidth and latency are +significantly worse than that used in local area networks. It combines a +variety of caching and reencoding techniques to reduce the volume of data that +must be sent over the wire. It can be used with existing clients by placing a +proxy between the clients and server, so that the low bandwidth/high latency +communication occurs between the proxy and server. + + + + +This extension was designed and implemented by Jim Fulton, David Lemke, Keith +Packard, and Dale Tonogai, all of Network Computing Devices (NCD). Chris Kent +Kantarjiev (Xerox PARC) participated in early design discussions. Ralph Mor (X +Consortium) designed and implemented additional sections. Donna Converse (X +Consortium) authored the protocol description and encoding from design notes +and the implementation. Ray Tice (X Consortium) resolved the open issues in the +design and specification. Bob Scheifler (X Consortium) helped out in many areas. + + + + +The extension name is "LBX". + + + + + +Description + + +The design center for LBX is to use a proxy as an intermediary between the +client and server. The proxy reencodes and compresses requests, events, replies +and errors, as well as the resulting data stream. Additionally, the proxy can +cache information from the server to provide low-latency replies to clients. +This reply generation by the proxy is known as short-circuiting. A proxy can +handle multiple clients for a given server, but does not prevent clients from +connecting directly to the server. The design allows the proxy to multiplex +multiple clients into a single data stream to the server. + + + + +Much of LBX is implemented as an extension. The compression and reencoding +changes can be isolated to the transport and dispatch portions of the server, +while short-circuiting requires minor changes to the server’s colormap and +property code. + + + + +LBX employs several different compression and short-circuiting methods. Use of +these methods is negotiable, and in some cases, the algorithm used by a given +method is negotiable as well. LBX also provides for negotiation of extensions +to LBX. + + + + +Data Flow + + +The LBX data stream goes through a number of layers: + + + + + +Client requests + + +Read by LBX and potential byte-swapping + + +Request-specific compression + + +Potential byte swapping + + +Multiplexing of client request streams + + +Delta replacement + + +Stream compression + + + + +Transport + + + + + +Stream decompression + + +Delta substitution + + +Demultiplexing of client request streams + + +Potential byte swapping + + +Reencoding + + +Request processing + + + + +The reverse process occurs with X server replies, events, and errors. + + + + + +Tags + + +Tags are used to support caching of large data items that are expected to be +queried multiple times. Such things as the keyboard map and font metrics are +often requested by multiple clients. Rather than send the data each time, the +first time the data is sent it includes a tag. The proxy saves this data, so +that subsequent requests can send only the tag to refer to that same data. The +different types of tags are used for connection information, keyboard maps, +modifier maps, fonts information and properties. + + + + +Tag usage is negotiated as a boolean in the +LbxStartProxy + message. The proxy controls how many tags are stored in the proxy. The server +may wish to observe the proxy’s InvalidateTag behavior to limit how many tags +are cached at any one time. Tagged data is not shared across types of tags, but +the number space used for the tag ids is. The tag ids are generated by the +server. + + + + +The X server keeps track of what tags are known to the proxy. The proxy can +invalidate a tag if no tag bearing replies of that type are pending. The proxy +sends an +LbxInvalidateTag + message to release the tagged data. The proxy must not invalidate connection +tags unless instructed to do so by the server. + + + + +If the server wishes to discard tagged data, it must either have received an + +LbxInvalidateTag + request from the proxy or send an +LbxInvalidateTag + event to the proxy for that tag. + + + + +Tag Substitution in Requests + + +Many substitution requests have a tag field, followed by fields marked +optional. For these requests, if the optional fields are present, the +data in them is stored in the indicated tag, unless the tag is 0. If +the optional fields are absent, the tag field indicates the tag that +contains the data for the "optional" fields. + + + + + +Property Tags + + +Property data makes special use of tags. A common use of properties is for +inter-client communication. If both clients use the proxy, it is wasteful to +send the data to the server and then back, when the server may never need it. + +LbxChangeProperty + request does the same work as the core +ChangeProperty + request, but it does not send the data. The reply to this request contains a +tag id corresponding to the data. If the property information is used locally, +the server responds to +LbxGetProperty + with the tag, and the property data need never be sent to the server. If the +server does require the data, it can issue an +LbxQueryTag + message. The proxy can also send the data on at any time if it judges it +appropriate (i.e., when the wire goes idle). Since the proxy owns the property +data, it must not invalidate the tag before sending the data back to the server +via an +LbxTagData + request. + + + + + + +Short-circuiting + + +Short-circuiting is used to handle constant data. This includes atoms, color +name/RGB mappings, and +AllocColor + calls. Atoms and color name/RGB mappings stay constant for the life of the +server. +AllocColor + + +replies are constant for each colormap. Short-circuiting replaces round-trip +requests with one-way requests, and can sometimes use one in place of many. + + + + +Atoms are used heavily for ICCCM communication. Once the proxy knows the string +to atom mapping, it has no need to send subsequent requests for this atom to +the server. + + + + +Colorname/RGB mappings are constant, so once the proxy sees the response from + +LookupColor +, it need not forward any subsequent requests. + + + + +Clients often use the same color cells, so once a read-only color allocation +has occurred, the proxy knows what RGB values should be returned to the client. +The proxy doesn't need to forward any +AllocColor + requests it can resolve, but it must tell the server to modify the color +cell's reference count. +LbxIncrementPixel + is used to support this. + + + + +For all three classes of short-circuiting, the proxy must still tell the server +a request has occurred, so that the request sequence numbers stay in sync. This +is done with +LbxModifySequence +. + + + + +Sequence numbers cause the major complication with short-circuiting. X +guarantees that any replies, events or errors generated by a previous request +will be sent before those of a later request. This means that any requests that +can be handled by the proxy must have their reply sent after any previous +events or errors. + + + + +If a proxy’s applications do not require strict adherence to the X protocol +ordering of errors or events, a proxy might provide further optimization by +avoiding the overhead of maintaining this ordering, however, the resulting +protocol is not strictly X11 compliant. + + + + + +Graphics Re-encoding + + +The LBX proxy attempts to reencode PolyPoint, +PolyLine, PolySegment, +PolyRectangle, PolyArc, +FillPoly, PolyFillRectangle, +PolyFillArc, CopyArea, +CopyPlane, PolyText8, +PolyText16, ImageText8, +and ImageText16 requests. If the request can be +reencoded, it may be replaced by an equivalent LBX form of the request. +The requests are reencoded by attempting to reduce 2-byte coordinate, +length, width and angle fields to 1 byte. Where applicable, the +coordinate mode is also converted to Previous + to improve the compressibility of the resulting data. In image requests, +the image data may also be compressed. + + + + +Motion events + + +To prevent clogging the wire with MotionNotify + events, the server and proxy work together to control the number +of events on the wire. This is done with the +LbxAllowMotion + request. The request adds an amount to an allowed motion count in +the server, which is kept on a per-proxy basis. Every motion notify +event sent to the proxy decrements the allowed motion counter. If +the allowed motion count is less than or equal to zero, motion +events not required by the X protocol definition are not sent to the +proxy. The allowed motion counter has a minimum value of -2^31. + + + + +Event Squishing + + +In the core protocol, all events are padded as needed to be 32 bytes long. The +LBX extension reduces traffic by removing padding at the end of events, and +implying the event length from its type. This is known as squishing. + + + + +Master Client + + +When the initial X connection between the proxy and the server is converted to +LBX mode, the proxy itself becomes the master client. New client requests and +some tag messages are sent in the context of the master client. + + + + + +Multiplexing of Clients + + +The LBX proxy multiplexes the data streams of all its clients into one stream, +and then splits them apart again when they are received. The +LbxSwitch + message is used to tell each end which client is using the wire at the time. + + + + +The server should process delta requests in the order that they appear on the +LBX connection. If the server does not maintain the interclient request order +for requests sent by the proxy, it must still obey the semantics implied by the +interclient request order so that the delta cache functions correctly. + + + + +The server can affect the multiplexing of clients by the proxy using the + +LbxListenToOne + and +LbxListenToAll + messages. This is useful during grabs, since the master connection can not be +blocked during grabs like other clients. The proxy is responsible for tracking +server grabs issued by its clients so that the proxy can multiplex the client +streams in an order executable by the server. + + + + +Replies must be ordered in the multiplexed data stream from the server to the +proxy such that the reply carrying tagged data precedes replies that refer to +that tagged data. + + + + + +Swapping + + +Swapping is handled as with any X extension, with one caveat. Since a proxy can +be supporting clients with different byte orders, and they all share the same +wire, the length fields of all messages between the server and proxy are +expressed in the proxy byte order. This prevents any problems with length +computation that may occur when clients are switched. + + + + + +Delta cache + + +LBX takes advantage of the fact that an X message may be very similar to one +that has been previously sent. For example, a +KeyPress + event may differ from a previous +KeyPress + event in just a few bytes. By sending just the bytes that differ (or +"deltas"), the number of bytes sent over the wire can be substantially reduced. +Delta compaction is used on requests being sent by the proxy as well as on +replies and events being sent by the server. + + + + +The server and the proxy each keep per-proxy request and response caches. The +response cache contains events, errors and replies. All messages are saved in +the appropriate delta cache if they are of an appropriate type and more than 8 +bytes long but fit within the delta cache. The number of entries in the delta +cache and the maximum saved message size are negotiated in the +LbxStartProxy + request. + + + + +The LBX requests that are never stored in the request delta cache are the + +LbxQueryVersion +, +LbxStartProxy +, +LbxSwitch +, +LbxNewClient +, +LbxAllowMotion +, +LbxDelta +, +LbxQueryExtension +, +LbxPutImage +, +LbxGetImage +, +LbxBeginLargeRequest +, +LbxLargeRequestData +, +LbxEndLargeRequest + and +LbxInternAtoms + requests. The responses that are never stored in the response cache are + +LbxSwitchEvent + and +LbxDeltaResponse +. The message carried by a +delta +message is also cached, if it meets the other requirements. Messages after the + +LbxStartProxy + request are cached starting at index 0, and incrementing the index, modulo the +number of entries, thereafter. The request and response caches are +independently indexed. + + + + +If the current message is cachable and the same length as a message in the +corresponding delta cache, a delta message may be substituted in place of the +original message in the protocol stream. + + + + + +Stream Compression + + +Before being passed down to the transport layer messages can be passed through +a general purpose data compressor. The choice of compression algorithm is +negotiated with See LbxStartProxy. The proxy +and server are not required to support any specific stream compressor. As an +example, however, the X Consortium implementation of a ZLIB based compressor is +described below. + + + +The XC-ZLIB compressor is presented with a simple byte stream - the X and LBX +message boundaries are not apparent. The data is broken up into fixed sized +blocks. Each block is compressed using zlib 1.0 (by Gailly & Adler), then a +two byte header is prepended, and then the entire packet is transmitted. The +header has the following information: + + + out[0] = (length & 0xfff) >> 8 | ((compflag) ? 0x80 : 0); + out[1] = length & 0xff; + + + + +Authentication Protocols + + +The current version of LBX does not support multipass authentication protocols +for clients of the proxy. These authentication protocols return an +Authenticate + message in response to a connection setup request, and require additional +authentication data from the client after the +LbxNewClient + request, and before the reply to +LbxNewClient +. One example of such a protocol is XC-QUERY-SECURITY-1. + + + + + + +C Library Interfaces + + +The C Library routines for LBX are in the Xext library. The prototypes are +located in a file named "XLbx.h". + + + + +Application Library Interfaces + + +In a proxy environment, applications do not need to call these routines to take +advantage of LBX. Clients can, however, obtain information about the LBX +extension to the server using this interface. Use of this routine may be +altered when connected through a proxy, as described in See C Library Interfaces. + + + + +XLbxQueryVersion + + +To determine the version of LBX supported by the X server, call +XLbxQueryVersion +. + + + + +Bool XLbxQueryVersion + Display * display + int * major_version_return + int * minor_version_return + + + + + + display + Specifies the connection to the X server. + + + major_version_return + Returns the extension major version number. + + + minor_version_return + Returns the extension minor version number. + + + + +The +XLbxQueryVersion + function determines if the LBX extension is present. If the extension is not +present, +XLbxQueryVersion + returns +False +; otherwise, it returns +True +. If the extension is present, +XLbxQueryVersion + returns the major and minor version numbers of the extension as supported by +the X server. + + + + + + +Proxy Library Interfaces + + +The following interfaces are intended for use by the proxy. + + + +XLbxQueryExtension + + +To determine the dynamically assigned codes for the extension, use the Xlib +function +XQueryExtension + or the LBX function +XLbxQueryExtension +. + + + + +Bool XLbxQueryExtension + Display * display + int * major_opcode_return + int * first_event_return + int * first_error_return + + + + + + display + Specifies the connection to the X server. + + + major_opcode_return + Returns the major opcode. + + + first_event_return + Returns the first event code. + + + first_error_return + Returns the first error code. + + + + +The +XLbxQueryExtension + function determines if the LBX extension is present. If the extension is not +present, +XLbxQueryExtension + returns +False +; otherwise, it returns +True +. If the extension is present, +XLbxQueryExtension + returns the major opcode for the extension to major_opcode_return, the base +event type code to first_event_return, and the base error code to +first_error_return; otherwise, the return values are undefined. + + + + + +XLbxGetEventBase + +To determine the base event type code, use the Xlib function +XQueryExtension + or the LBX function +XLbxGetEventBase. + + + + + +int XLbxGetEventBase + Display * display + + + + + + display + Specifies the connection to the X server. + + + + +The XLbxGetEventBase +function returns the base event type code if the extension is +present; otherwise, it returns -1. + + + + + + + + +Protocol + + +Syntactic Conventions and Common Types + + +Please refer to the X Window System Protocol specification, +as this document uses the syntactic conventions established +there and references types defined there. + + + + +The following additional types are defined by this extension: + + + +DIFFITEM +1 CARD8 offset +1 CARD8 diff + + + +LBXANGLE: CARD8 or 2 BYTE + where (in order of precedence): + (0 <= in <= A(95)) && !(in % A(5)) out = 0x5a + (in / +A(5)) + A(105) <= in <= A(360) && !(in % A(15)) out = 0x67 + +(in / A(15)) + -A(100) <= in <= -A(5) && !(in % A(5)) out = 0xa6 + +(in / A(5)) + -A(360) < in <= -A(105) && !(in % A(15)) out = 0x98 + +(in / A(15)) + -A(360) < in <= A(360) out[0] = in >> 8; out[1] = in + + + +LBXARC: + [x, y: LBXINT16, + width, height: LBXCARD16, + angle1, angle2: LBXANGLE] + + + +Within a list of arcs, after the first arc, x and y are +relative to the corresponding fields of the prior arc. + + + +LBXCARD16: CARD8 or 2 BYTE + where: + 0x0000 <= in < 0x00F0 CARD8 + 0x00F0 <= in < 0x10F0 out[0] = 0xF0 | ((in - 0xF0) >> +8) + out[1] = in - 0xF0 + + + +LBXGCANDDRAWENT +[ gc-cache-index, drawable-cache-index: CARD4 ] + + + +LBXGCANDDRAWUPDATE + drawable: DRAWABLE /* present only if +drawable-cache-index + == 0 */ +gc: GC] /* present only if gc-cache-index == 0 */ + + + +LBXGCANDDRAWABLE + cache-entries: LBXGCANDDRAWENT + updates: LBXGCANDDRAWUPDATE + + + +LBXINT16: INT8 or 2 BYTE + where: + 0xF790 <= in < 0xFF90 out[0] = 0x80 | (((in + 0x70) >> +8) & 0x0F) + out[1] = in + 0x70 + 0xFF90 <= in < 0x0080 CARD8 + 0x0080 <= in < 0x0880 out[0] = 0x80 | (((in - 0x80) >> +8) & 0x0F) + out[1] = in - 0x80 + + + +LBXPINT16: CARD8 or 2 BYTE /* for +usually positive numbers */ + where: + 0xFE00 <= in < 0x0000 out[0] = 0xF0 | (((in + 0x1000) +>> 8) & 0x0F) + out[1] = in + 0x1000 + 0x0000 <= in < 0x00F0 CARD8 + 0x00F0 <= in < 0x0EF0 out[0] = 0xF0 | ((in - 0xF0) >>8) + out[1] = in - 0xF0 + + + +LBXPOINT: [x, y: LBXINT16] + Within a list of points, after the first rectangle, x and y are +relative to the corresponding fields of the prior point. + + + +LBXRECTANGLE: + [x, y: LBXINT16, + width, height: LBXCARD16] + + + +Within a list of rectangles, after the first rectangle, x and +y are relative to the corresponding fields of the prior rectangle. + + + +MASK: CARD8 + + + + + +Errors + + +As with the X11 protocol, when a request terminates with an error, +the request has no side effects (that is, there is no partial execution). + + + + +There is one error, +LbxClient +. This error indicates that the client field of an LBX request was invalid, or +that the proxy’s connection was in an invalid state for a start or stop proxy +request. + + + + + +Requests + + +There is one request that is expected to be used only by the client: +LbxQueryVersion + + + + +There is one request that is expected to be used by the client or the proxy: + +LbxQueryExtension +. + + + + +The following requests are expected to be used only by the proxy, and are +instigated by the proxy: +LbxStartProxy +, +LbxStopProxy +, +LbxNewClient +, +LbxSwitch +, +LbxCloseClient +, +LbxModifySequence +, +LbxAllowMotion +, +LbxInvalidateTag +, +LbxTagData + and +LbxQueryTag +. + + + + +All other requests are sent by the proxy to the LBX server and are instigated +by reception of an X request from the client. They replace the X request. + + + + +Requests Initiated by the Proxy or by the Client + + + + + + + + LbxQueryVersion + + + + + =>; + + + majorVersion: CARD16 + + + minorVersion: CARD16 + + + + + + +This request returns the major and minor version numbers of the LBX protocol. + + + + +The encoding of this request is on See +LbxQueryVersion. + + + + + + +Requests Initiated or Substituted by the Proxy + + + + + + + + LbxQueryExtension + + + + + +nbytes +: CARD32 + + + +name +: STRING8 + + + => + + + num-requests: CARD8 + + + present: BOOL + + + major-opcode: CARD8 + + + first-event: CARD8 + + + first-error: CARD8 + + + reply-mask: LISTofMASK /* optional */ + + + event-mask:LISTofMASK /* optional */ + + + Errors: +Alloc + + + + + + + +This request is identical to the +QueryExtension + request, with an additional field, and two optional additional fields. When +the client issues an +QueryExtension + request, the proxy will substitute an +LbxQueryExtension + request. + + + + +This request determines if the named extension is present. If so, the major +opcode for the extension is returned, if it has one. Otherwise, zero is +returned. Any minor opcode and the request formats are specific to the +extension. If the extension involves additional event types, the base event +type code is returned. Otherwise, zero is returned. The format of events is +specific to the extension. If the extension involves additional error codes, +the base error code is returned. Otherwise, zero is returned. The format of +additional data in the errors is specific to the extension. + + + + +In addition, the number of requests defined by the named extension is returned. +If the number of requests is nonzero, and if the information is available, +reply-mask and event-mask will be included in the reply. The reply-mask +represents a bit-wise one-to-one correspondence with the extension requests. +The least significant bit corresponds to the first request, and the next bit +corresponds to the next request, and so on. Each element in the list contains +eight meaningful bits, except for the last element, which contains eight or +fewer meaningful bits. Unused bits are not guaranteed to be zero. The bit +corresponding to a request is set if the request could generate a reply, +otherwise it is zero. In the same way, the event-mask represents a bit-wise +one-to-one correspondence with the extension requests. A bit is set if the +corresponding request could result in the generation of one or more extension +or X11 events. If reply-mask is present in the reply, event-mask will also be +present. + + + + +The encoding of this request is on See +LbxQueryExtension. + + + + + + +Control Requests Initiated by the Proxy + + + + + + + + LbxStartProxy + + + + + +options +: LISTofOPTION + + + => + + + choices: LISTofCHOICE + + + Errors: +LbxClient +, +Alloc + + + + where: + + + OPTION [optcode: CARD8, + + + len: OPTLEN, + + + option: (See See StartProxy Options) ] + + + CHOICE [optcode: CARD8, + + + len: OPTLEN, + + + choice: (See See StartProxy Options) ] + + + + + + + + + StartProxy Options + + + + + + + + + optcode + option + choice + default + + + + + delta-proxy + DELTAOPT + DELTACHOICE + entries=16, maxlen=64 + + + delta-server + DELTAOPT + DELTACHOICE + entries=16, maxlen=64 + + + stream-comp + LISTofNAMEDOPT + INDEXEDCHOICE + No Compression + + + bitmap-comp + LISTofSTRING8 + LISTofINDEXEDOPT + No Compression + + + pixmap-comp + LISTofPIXMAPMETHOD + LISTofPIXMAPCHOICE + No Compression + + + use-squish + BOOL + BOOL + True + + + use-tags + BOOL + BOOL + True + + + colormap + LISTofSTRING8 + INDEXEDCHOICE + No Colormap Grabbing + + + extension + NAMEDOPT + INDEXEDCHOICE + Extension Disabled + + + +
+ + + + + + + +   + + + DELTAOPT [minN, maxN, prefN: CARD8 + + + minMaxMsgLen, maxMaxMsgLen, prefMaxMsgLen: +CARD8] + + + DELTACHOICE [entries, maxlen: +CARD8] + + + INDEXEDCHOICE [index: CARD8, + + + data: LISTofBYTE] + + + INDEXEDOPT [index, opcode: CARD8] + + + NAMEDOPT [name: STRING8, + + + detail: LISTofBYTE] + + + OPTLEN 1 or 3 CARD8 + + + where: + + + (0 < in <= 0xFF): out = +in + + + (0 <= in<= 0xFFFF): out[0] = +0; out[1] = in >> 8; out[2] = in& 0xFF; + + + PIXMAPMETHOD [name: STRING8, + + + format-mask: BITMASK, + + + depths: LISTofCARD8] + + + PIXMAPCHOICE [index, opcode: CARD8, + + + format-mask: BITMASK, + + + depths: LISTofCARD8] + + + + + + + + + +This request negotiates LBX protocol options, and switches the proxy-server +connection from X11 protocol to LBX protocol. + + + + +The proxy gives the preferred protocol options in the request. The server +chooses from the given options and informs the proxy which to use. The options +may be listed in any order, and the proxy may choose which options to +negotiate. If an option is not successfully negotiated, the default is used. + + + + +The server delta cache and proxy delta caches can be configured for number of +entries, and the length of entries. (See See Delta +cache for details.) The delta caches are configured using the +delta-server + and +delta-proxy + options. To configure a cache, the proxy sends the minimum, maximum and +preferred values for the number of cache entries, ( +minN, maxN, prefN +), and the length of the cache entries, ( +minMaxMsgLen, maxMaxMsgLen, prefMaxMsgLen +). The server’s reply fields, +entries + and +maxlen +, contains the values to use. These values must be within the ranges specified +by the proxy. The server may also specify an +entries + value of 0 to disable delta caching. The cache entry lengths are specified in +units of 4 bytes. + + + + +The stream compression algorithm is selected using the +stream-comp +option. (Stream compression is described in See +Stream Compression.) Each algorithm has a name that follows the naming +conventions in See Algorithm Naming. To +negotiate using the stream-comp option, the proxy lists its available +compressors. For each candidate algorithm, the proxy sends the name in the + +name + field, and uses the +detail + field to send any additional data specific to each compression algorithm. The +reply contains a 0-based index into the list of algorithms to indicate which +algorithm to use, followed by data specific to that algorithm. + + + + +Bitmap compression is negotiated using the +bitmap-comp + option. The proxy sends a list of names of available algorithms, and the +server reply lists the algorithms to use. For each bitmap algorithm in the +reply, a 0-based index into the list of algorithms indicates the algorithm, and +the +opcode + field gives the value for use in requests. The algorithm names follow the +conventions in See Algorithm Naming. + + + + +Pixmap compression is negotiated using the +pixmap-comp + option. The proxy sends a list of available algorithms. For each algorithm, +the list includes, the name, a bitmask of supported formats, and a list of +depths that the format supports. The server reply lists the algorithms to use. +For each pixmap algorithm in the reply, the reply contains a 0-based index into +the list of proxy algorithms, the opcode to use in requests when referring to +this algorithm, a mask of valid formats, and a list of valid depths. Algorithm +names follow the conventions in See Algorithm +Naming. + + + + +Squishing is negotiated using the use-squish option. If the proxy desires +squishing, it sends a true value. The reply from the server indicates whether +to do squishing, and will indicate squishing only if +use-squish + is set to true in the request. + + + + +Tag caching, described in See Tags, is +negotiated using the use-tag option. If the proxy desires tag caching, it sends +a true value. The reply from the server indicates whether to do tag caching, +and will demand caching only if +use-tag + is set to true in the request. + + + + +The colormap option is used to negotiate what color matching algorithm will be +used by the proxy when the proxy uses the +LbxAllocColor + request to allocate pixels in a grabbed colormap. To negotiate using the +colormap option, the proxy lists the names of available colormap algorithms. +The choice in the reply contains a 0-based index into the list of algorithms to +indicate which algorithm to use, followed by data specific to that algorithm. +If no colormap algorithm is successfully negotiated, then the +LbxAllocColor +, +LbxGrabCmap +, and +LbxReleaseCmap + requests will not be used. + + + + +The extension option is used to control extensions to LBX. These extensions +may, for example, enable other types of compression. To negotiate an extension, +the name of the extension is sent, followed by any data specific to that +extension. The extension name follows the conventions in See Algorithm Naming. The extension option may +occur multiple times in the start proxy message, since multiple extensions can +be negotiated. The reply to an extension option contains the zero-based index +of the extension option, as counted in the +LbxStartProxy + message. This index is followed by extension-specific information. The server +does not respond to extensions it does not recognize. + + + + +An +LbxClient + error is returned when a client which is already communicating through an LBX +proxy to the X server sends a +LbxStartProxy + request. + + + + +The encoding for this request is on See +LbxStartProxy. + + + + + + + + + + LbxStopProxy + + + + + Errors: +LbxClient + + + + + + + +This request terminates the connection between the proxy and X server, and +terminates any clients connected through the proxy. + + + + +The encoding for this request is on See +LbxStopProxy. + + + + +An +LbxClient + error is returned if the requesting client is not an LBX proxy. + + + + + + + + + + LbxNewClient + + + + + +byte-order +: CARD8 + + + +client-id +: CARD32 + + + +protocol-major-version +: CARD16 + + + +protocol-minor-version: + CARD16 + + + +authorization-protocol-name +: STRING8 + + + +authorization-protocol-data +: STRING8 + + + => + + + Core X reply (if connection is rejected) + + +   + + + OR + + +   + + + success: BOOL + + + change-type: {NoDeltas, NormalClientDeltas, +AppGroupDeltas} + + + protocol-major-version: CARD16 + + + protocol-minor-version: CARD16 + + + tag-id: CARD32 + + + length: CARD16 + + + connection-data: CONINFO or CONDIF or +CONDIFROOT + + +   + + + where: + + + CONINFO: (the "additional data" +portion of the core connection reply for successes) + + + CONDIF: [resource-id-base: CARD32, + + + root-input-masks: LISTofSETofEVENT] + + + CONDIFROOT: [resource-id-base: +CARD32, + + + root: WINDOW + + + root-visual: VISUALID + + + default-colormap: COLORMAP + + + white-pixel, black-pixel: CARD32 + + + root-input-masks: LISTofSETofEVENT] + + + + + + +Errors: LbxClient, Alloc + + + + +This request, which is sent by the proxy over the control connection, creates a +new virtual connection to the server. + + + + +Much of the information in the +LbxNewClient + request and reply is identical to the connection setup and reply information +in the core X protocol. + + + + +For the +LbxNewClient + request, the field unique to LBX is client-id. For the +LbxNewClient + reply, +tag-id + and +change-type + are fields unique to LBX, and the contents of connection-data may be different +in LBX from the core X protocol (see below). + + + + +The proxy assigns each virtual connection a unique identifier using the + +client-id + field in the +LbxNewClient + request. This client-id is used in the LBX protocol to specify the current +client (see the +LbxSwitch + request and the +LbxSwitchEvent +). client-id 0 is reserved for the proxy control connection. An +LbxClient + error will result if the +LbxNewClient + request contains a client-id of 0 or an already in use client-id. + + + + +If the server rejects this new virtual connection, the server sends a core X +connection failure reply to the proxy. The current version of LBX does not +support the return of an +Authenticate + reply. + + + + +If the +change-type + field is set to +NoDeltas +, then +connection-data + is sent using the CONINFO structure, which is identical to the additional data +of the core connection reply. If the +tag-id + is non-zero, then the connection-data is stored by the proxy using this tag +value. Tagged connection data must be stored by the proxy, and can not be +invalidated by the proxy until an +LbxInvalidateTag + event is received for that tag. + + + + +When the +change-type + field is not set to +NoDeltas +, then connection data is sent as changes against connection information +previously sent to the proxy. The +tag-id + field, if non-zero, has the tag of the previously sent data to apply the +changes to. A zero tag-id indicates that the changes are with respect to the +connection information sent when the proxy connected to the server. + + + + +If the +change-type + field is set to +NormalClientDeltas +, then +connection-data + is sent using the CONDIF structure. The values in the CONDIF structure are +substituted for the identically named fields of the connection information for +the new connection. + + + + +If the +change-type + field is set to +AppGroupDeltas +, then +connection-data + is sent using the CONDIFROOT structure. The +root +, +root-visual +, and +default-colormap + fields, when nonzero, are substituted for the corresponding fields in the +reference connection information. The +white-pixel + and +black-pixel + fields are substituted only when the +default-colormap + field of the reply is non-zero. When +default-colormap + field of the reply is zero, so are +white-pixel + and +black-pixel +. The first entry in the +root-input-masks + field is the current-input-mask for the default root window. The remaining +entries in +root-input-masks + are input masks for non-video screens, as defined by the X Print Extension. +The number of non-video screens is one less than the number of entries in + +root-input-masks +. These screens are at the end of screen list in the reference connection +information. + + + + +The encoding for this request is on See The +description of this request is on page 13.. + + + + + + + + + + LbxCloseClient + + + + + +client +: CARD32 + + + + Errors: +LbxClient + + + + + + + +This requests the server to close down the connection represented by the +specified proxy’s client identifier. If the specified client wasn’t +previously registered with the server by a +LbxNewClient + request, the server will send the +LbxClient + error. + + + + +The encoding for this request is on See The +description of this request is on page 12.. + + + + + + + + + + LbxSwitch + + + + + +client +: CARD32 + + + + Errors: +LbxClient + + + + + + + +This request causes the X server to treat subsequent requests as being from a +connection to the X server represented by the specified client identifier. + + + + +If the client making the request is not the proxy, or if the client identifier +sent in the request was not previously sent in a +LbxNewClient + request, an +LbxClient + error is returned. + + + + +The encoding for this request is on See +LbxSwitch. + + + + + + + + + + LbxSync + + + + + => + + + + + + +The sync request causes the server to send a reply when all requests before the +sync request have been processed. + + + + +The encoding for this client is on See +LbxSync. + + + + + + + + + + LbxModifySequence + + + + + +adjust +: CARD32 + + + + Errors: None + + + + + + +This request advances the sequence number of the virtual client connection by +the specified amount. The proxy sends the +LbxModifySequence + request to the server when it replies to a client request without forwarding +the client request on to the X server. + + + + +The encoding for this client is on See The +description of this request is on page 13.. + + + + + + + + + + LbxAllowMotion + + + + + +num +: CARD32 + + + + Errors: None + + + + + + +This request controls the delivery of optional motion notify events, as +described in See Motion events. The num +field specifies an increase in the allowed number of motion notify events sent. + + + + +The encoding for this request is on See The +description of this request is on page 14.. + + + + + + + + + + LbxInvalidateTag + + + + + +tag +: CARD32 + + + + + + +The LBX proxy sends this notification to the X server when it refuses to store +tagged data, or when it releases tagged data which was previously stored and +which was not invalidated by a notification from the X server. + + + + +The encoding for this request is on See +LbxInvalidateTag. + + + + + + + + + + LbxTagData + + + + + +tag +: CARD32 + + + +real-length +: CARD32 + + + +data +: LISTofBYTE + + + + + + +This request specifies the data associated with a previously assigned tag. It +is sent in two circumstances: in response to receiving a +SendTagDataEvent +, and spontaneously, when the proxy must rely on the server to store data which +was not previously received from the server. The data is carried in the byte +order and structure as would have originally been sent in the core protocol +request. + + + + +The encoding for this request is on See +LbxTagData. + + + + + + + + + + LbxGrabCmap + + + + + +cmap +: Colormap + + + => + + + + +smart-grab +: BOOL + + + +large-pixel: +BOOL /* optional */ + + + +auto-release: +BOOL /* optional */ + + + +three-channels +: BOOL /* optional */ + + + +bits-per-rgb: +CARD4 /* optional */ + + + +cells +: LISTofCHAN /* optional */ + + +   + + + where: + + + CHAN: LISTofLBXPIXEL + + + LBXPIXEL: PIXELPRIVATE or PIXELPRIVATERANGE +or + + + PIXELALLOC or PIXELALLOCRANGE + + + PIXEL: CARD8 or CARD16 + + + PIXELPRIVATE: [ pixel: PIXEL ] + + + PIXELPRIVATERANGE: [ first-pixel, +last-pixel: PIXEL] + + + PIXELALLOC: [ pixel: PIXEL, + + + color: COLORSINGLE or COLORTRIPLE] + + + PIXELALLOCRANGE: [ first-pixel, +last-pixel: PIXEL, + + + colors: LISTofCOLORSINGLE or +LISTofCOLORTRIPLE] + + + COLORSINGLE: [ value: CARD8 or CARD16 +] + + + COLORTRIPLE: [ r, g, b: +COLORSINGLE] + + + + Errors: +Colormap + + + + + + + +This request asks the server for control of allocating new colormap cells in +the specified colormap. The server grants control by replying to this request. +If no changes have occurred since the last time this proxy grabbed this +colormap, then the +smart-grab + field of the reply is set to true, and the optional fields are not sent. +Otherwise, the current contents of the colormap are placed in the reply, as +described later in this section. + + + + +Once the proxy has received the reply, it can use the +LbxAllocColor + request to allocate new colormap cells without the performance penalty of +round trips. The proxy is still permitted to use the normal colormap and + +LbxIncrementPixel + requests while the colormap is grabbed. The grab is valid across all virtual +connections of the proxy. + + + + +The +LbxGrabCmap + request is limited to colormaps for the visual types negotiated as part of the +colormap algorithm negotiation in the start proxy request at connection setup. + + + + +The server and other proxies may not allocate new colormap cells in the +colormap while the colormap is grabbed by this proxy. If the server or another +proxy needs to allocate new colormap cells, the server sends a Lbx +ReleaseCmap + event to the proxy holding the grab, which then issues an +LbxReleaseCmap + request. + + + + +The server and other proxies may free colormap cells in a colormap grabbed by a +proxy. The server will send an +LbxFreeCells + event to the proxy that currently has the colormap grabbed when the cell +reference count reaches 0. + + + + +If the colormap is a of a static visual type, such as +StaticGray +, +StaticColor +, +GrayScale +, or +TrueColor +, then the proxy’s grab is immediately released by the server, and the proxy +must use +LbxIncrementPixel + requests in place of +LbxAllocColor + requests for this colormap. + + + + +If the cmap field does not refer to a valid colormap or the colormap is already +grabbed by this proxy then a +Colormap + error is generated. + + + + +The reply describes the contents of the colormap via several arguments and a +descriptive list containing one or three channels, with each channel describing +allocations in the colormap. + + + + +The +large-pixel + argument, if True, specifies that PIXEL indices will be listed as CARD16 +quantities instead of CARD8. The + auto-release + field, if True, indicates that this colormap is of a static visual type and +the proxy’s grab is immediately released by the server. + + + + +If +three-channels + is False, a single channel is enclosed and color values are described using +COLORTRIPLE, which has fields for red, green and blue. A single channel is used +when the visual type is not +DirectColor + or +TrueColor +. + + + + +If +three-channels + is True, separate red, green and blue channel lists are enclosed, for +describing a +DirectColor + or +TrueColor + colormap. Color values for entries in each channel are sent using COLORSINGLE +and the corresponding PIXEL value refers to the RGB subfield of the current +channel, as defined by the corresponding red-mask, green-mask and blue-mask of +the visual. + + + + +The +bits-per-rgb + value is one less than the bits-per-rgb-value field of the visual that the +colormap belongs to. If the value is 7 or less, then COLORSINGLE values in the +descriptive list are sent using CARD8 fields. Otherwise these values are sent +using CARD16 fields. + + + + +The list describing current colormap allocations contains entries of the +following types: + + + + +An LBXPIXELPRIVATE entry indicates that the pixel in the +pixel +field is unavailable for allocation. + + + + +An LBXPIXELPRIVATERANGE entry indicates that a contiguous range of pixels are +unavailable for allocation. The range is +first-pixel + to +last-pixel +, and includes +last-pixel +. + + + + +An LBXPIXELALLOC entry indicates that the pixel in the +pixel +field is allocated as a read-only pixel. The +color + field carries the color information of the pixel. + + + + +An LBXPIXELALLOCRANGE entry indicates that a contiguous range of pixels are +allocated as read-only. The range starts +first-pixel + to +last-pixel +, and includes +last-pixel +. These fields are followed by a list of COLORSINGLE or COLORTRIPLE, depending +on the value of +three-channels +. + + + + +A NEXTCHANNEL entry indicates that the next channel of the colormap will be +described. + + + + +A LISTEND entry indicates the end of the colormap description. + + + + +All pixels not described in the reply are unallocated. + + + + +The encoding for this request is on See +LbxGrabCmap. + + + + + + + + + + + LbxReleaseCmap + + + + + +cmap +: Colormap + + + + + + +This request releases the specified grabbed colormap. If the +cmap + field does not refer to a colormap, a +BadColormap + error is produced. + + + + +The proxy must remember the state of the colormap when the +LbxReleaseCmap + request is issued if this proxy may at some future time issue another + +LbxGrabCmap + request on this colormap before the state of the colormap changes. + + + + +The encoding for this request is on See +LbxReleaseCmap. + + + + + + + + + + LbxInternAtoms + + + + + +count +: CARD16 + + + +names: LISTofSTRING8 + + + + => + + + + +atoms +: LISTofATOM + + + + Errors: +Alloc + + + + + + + +This request allows the proxy to intern a group of atoms in a single round +trip. The server will create any atoms that do not exist. + + + + +The encoding for this request is on See +LbxInternAtoms. + + + + +
+ +Substitution Requests + + + + + + + + LbxAllocColor + + + + + +cmap +: Colormap + + + +pixel +: CARD32 + + + +red +, +green +, +blue +: CARD16 + + + + + + +This request is sent by a proxy that has given colormap grabbed to allocate a +new read-only cell in the colormap. The proxy may substitute this request for +the core +AllocColor + and +AllocNamedColor + requests. + + + + +The +pixel + field identifies the colormap cell to allocate. The +red +, +green +, and +blue + fields are the hardware specific color values of the corresponding fields of +the core +AllocColor + request. The mapping to hardware specific colormap values by the proxy is +performed using the color algorithm negotiated by +LbxStartProxy +. + + + + +For colormaps of static visual types, the +LbxIncrementPixel + request is used instead of LBX +AllocColor +. + + + + +If the +cmap + field does not identify a grabbed colormap then a +BadAccess + error is produced. If the +pixel + field refers to a read-write entry, or the pixel field refers to a pixel +outside of the range of this colormap, a +BadAlloc + error is produced. + + + + +The encoding for this request is on See +LbxAllocColor. + + + + + + + + + + LbxIncrementPixel + + + + + +cmap +: COLORMAP + + + +pixel +: CARD32 + + + + Errors: None + + + + + + +This request replaces the +AllocColor + request for read-only pixels currently allocated for the current client. If +the visual type of the colormap is of a static type, this request may be used +on currently unallocated pixels. The colormap is not required to be grabbed to +use this request. + + + + +The encoding for this request is on See The +description of this request is on page 14.. + + + + + + + + + + LbxDelta + + + + + +count +: CARD8 + + + +cache-index +: CARD8 + + + +diffs +: LISTofDIFFITEM + + + + + + +This request contains a minimal amount of information relative to a similar +prior request. The information is in the form of a difference comparison to a +prior request. The prior request is specified by an index to a cache, +independently maintained by both the proxy and the server. + + + + +The encoding for this request is on See The +description of this request is on page 18.. + + + + + + + + + + LbxGetModifierMapping + + + + + => + + + + +keyspermod +: CARD8 + + + +tag +: CARD32 + + + +keycodes +: LISTofKEYCODE /* optional */ + + + + + + +This request is identical to the core +GetModifierMapping + request, with the addition of a tag being returned in the reply. See See Tag Substitution in Requests for a description +of the +tag + field and optional fields. + + + + +The encoding for this request is on See +LbxGetModifierMapping. + + + + + + + + + + LbxGetKeyboardMapping + + + + + +firstKeyCode +: KEYCODE + + + +count +: CARD8 + + + => + + + + +keysperkeycode +: CARD8 + + + +tag +: CARD32 + + + +keysyms +: LISTofKEYSYM /* optional */ + + + + Errors: +Value + + + + + + + +This request is identical to the X +GetKeyboardMapping + protocol request, with the addition that a tag is returned in the reply. See +See Tag Substitution in Requests for a +description of the +tag + field and optional fields. + + + + +The encoding for this request is on See +LbxGetKeyboardMapping. + + + + + + + + + + + LbxGetWinAttrAndGeom + + + + + +window +: WINDOW + + + => + + + + visual: VISUALID + + + class: {InputOutput, InputOnly} + + + bit-gravity: BITGRAVITY + + + win-gravity: WINGRAVITY + + + backing-store: {NotUseful, WhenMapped, +Always} + + + backing-planes: CARD32 + + + backing-pixel: CARD32 + + + save-under: BOOL + + + colormap: COLORMAP or None + + + map-is-installed: BOOL + + + map-state: {Unmapped, Unviewable, +Viewable} + + + all-event-masks, your-event-mask: +SETofEVENT + + + do-not-propagate-mask: SETofDEVICEEVENT + + + override-redirect: BOOL + + + root: WINDOW + + + depth: CARD8 + + + x, y: INT16 + + + width, height, border-width: CARD16 + + + + Errors: +Window + + + + + + + + +GetWindowAttributes + and +GetGeometry + are frequently used together in the X protocol. +LbxGetWinAttrAndGeom + allows the proxy to request the same information in one round trip. + + + + +The encoding for this request is on See +LbxGetWinAttrAndGeom. + + + + + + + + + + + LbxQueryFont + + + + + +font +: FONTABLE + + + => + + + compression: BOOL + + + tag: CARD32 + + + font-info: FONTINFO /* optional +*/ + + + char-infos: LISTofCHARINFO or LISTofLBXCHARINFO + /* optional */ + + + where: + + + LBXCHARINFO: [left-side-bearing: +INT6 + + + right-side-bearing: INT7 + + + character-width: INT6 + + + ascent: INT6 + + + descent: INT7] + + + + Errors: +Font,Alloc + + + + + + + +This request is used to replace the core +QueryFont + request and has identical semantics. + + + + +See See Tag Substitution in Requests for a +description of the +tag + field and optional fields. + + + + +The +compression + field is True if the +char-infos + field is represented using LBXCHARINFO. + + + + +The per-character information will be encoded in an LBXCHARINFO when, for every +character, the character-width, left-side-bearing, and ascent can each be +represented in not more than 6 bits, and the right-side-bearing and descent can +each be represented in not more than 7 bits, and the attributes field is +identical the attributes field of the max_bounds of the +font_info + field of the font. + + + + +The encoding for this request is on See +LbxQueryFont. + + + + + + + + + + + LbxChangeProperty + + + + + +window +: WINDOW + + + +property +: ATOM + + + +type +: ATOM + + + +format +: {0,8,16,32} + + + +mode +: {Replace, Prepend, Append} + + + +nUnits +: CARD32 + + + => + + + tag: CARD32 + + + + + + +This request is sent to the server when the client sends an X +ChangeProperty +request through the proxy. The size of the data is sent with this request, but +not the property data itself. The server reply contains a tag identifier for +the data, which is stored in the proxy. The proxy must not discard this data +before it is sent to the server, or invalidated by the server. This means that +before issuing an +LbxStopProxy + request, or exiting, the proxy must send Lbx +TagData + requests for these items. If the server loses the connection before the +information is sent back, the server should revert the property value to its +last known value, if possible. + + + + +If the +mode + field is +Prepend + or +Append +, the tag refers only to the prepended or appended data. + + + + +If the tag in the reply is zero, then the change was ignored by the server, as +defined in the security extension. The proxy should dump the associated data, +since the server will never ask for it. + + + + +The encoding for this request is on See +LbxChangeProperty. + + + + + + + + + + LbxGetProperty + + + + + +window +: WINDOW + + + +property +: ATOM + + + +type +: ATOM or AnyPropertyType + + + +long-offset +: CARD32 + + + +long-length +: CARD32 + + + +delete +: CARD8 + + + => + + + + type: ATOM or None + + + format: {0, 8, 16, 32} + + + bytes-after: CARD32 + + + nItems: CARD32 + + + tag: CARD32 + + + value: LISTofINT8 or LISTofINT16 or +LISTofINT32 + + + + + + +This request may be used by the proxy as a substitution for a core +GetProperty + request. It allows tags to be used for property data that is unlikely to +change often in value, but is likely to be fetched by multiple clients. + + + + +The +LbxGetProperty + request has the same arguments as the core +GetProperty + request. The reply for +LbxGetProperty + has all of the fields from the core +GetProperty + reply, but has the additional fields of +nItems + and +tag +. + + + + +In order to utilize tags in +LbxGetProperty + for a specific property, the server must first send the complete property data +to the proxy and associate this data with a tag. More precisely, the server +sends an +LbxGetProperty + reply with a new +tag +, +nItems + set to the number of items in the property, the size of the property data in +the reply length field, and the complete property data in value. The proxy +stores the property data in its tag cache and associates it with the specified +tag. + + + + +In response to future +LbxGetProperty + requests for the same property, if the server thinks that the proxy has the +actual property data in its tag cache, it may choose to send an +LbxGetProperty + reply without the actual property data. In this case, the reply would include +a non-zero +tag +, a zero reply length, and no data for value. + + + + +If the server chooses not to generate a tagged reply to +LbxGetProperty +, or for some reason is unable to do so, it would send a reply with a +tag + of zero, the size of the property data in the reply length field, and the +complete property data in value. + + + + +The encoding for this request is on See +LbxGetProperty. + + + + + + + + + + LbxPolyPoint + + + + + +gc-and-drawable: +LBXGCANDDRAWABLE + + + +points +: LISTofLBXPOINT + + + + Errors: +Alloc + and those given for the corresponding X request. + + + + + + +This request replaces the +PolyPoint + request. Not all +PolyPoint + requests can be represented as +LbxPolyPoint + requests. + + + + +The proxy will convert the representation of the points to be relative to the +previous point, as described by previous coordinate mode in the X protocol. + + + + +The encoding for this request is on See +LbxPolyPoint. + + + + + + + + + + LbxPolyLine + + + + + +gc-and-drawable: +LBXGCANDDRAWABLE + + + +points +: LISTofLBXPOINT + + + + Errors: +Alloc + and those given for the corresponding X request. + + + + + + +This request replaces the +PolyLine + request. Not all +PolyLine + requests can be represented as +LbxPolyline + requests. + + + + +The proxy will convert the representation of the points to be relative to the +previous point, as described by previous coordinate mode in the X protocol. + + + + +The encoding for this request is on See The +description of this request is on page 21.. + + + + + + + + + + LbxPolySegment + + + + + +gc-and-drawable: +LBXGCANDDRAWABLE + + + +segments +: LISTofLBXSEGMENT + + +   + + + where: + + + LBXSEGEMENT; [x1, y1, x2, y2: LBXINT16] + + + + Errors: +Alloc + and those given for the corresponding X request. + + + + + + +This request replaces the +PolySegment + request. Not all +PolySegment + requests can be represented as +LbxPolySegment + requests. + + + + +For segments other than the first segment of the request, [x1, y1] is +relative to [x1, y1] of the previous segment. For all segments, [x2, y2] is +relative to that segment’s [x1, y1]. + + + + +The encoding for this request is on See +LbxPolySegment. + + + + + + + + + + LbxPolyRectangle + + + + + +gc-and-drawable: +LBXGCANDDRAWABLE + + + +rectangles +: LISTofLBXRECTANGLE + + + + Errors: +Alloc + and those given for the corresponding X request. + + + + + + +This request replaces the +PolyRectangle + request. Not all +PolyRectangle + requests can be represented as +LbxPolyRectangle + requests. + + + + +The encoding for this request is on See The +description of this request is on page 22.. + + + + + + + + + + LbxPolyArc + + + + + +gc-and-drawable: +LBXGCANDDRAWABLE + + + +arcs +: LISTofLBXARC + + + + Errors: +Alloc + and those given for the corresponding X request. + + + + + + +This request replaces the +PolyArc + request. Not all +PolyArc + requests can be represented as +LbxPolyArc + requests. + + + + +The encoding for this request is on See +LbxPolyArc. + + + + + + + + + + LbxPolyFillRectangle + + + + + +gc-and-drawable: +LBXGCANDDRAWABLE + + + +rectangles +: LISTofLBXRECTANGLE + + + + Errors: +Alloc + and those given for the corresponding X request. + + + + + + +This request replaces the +PolyFillRectangle + request. Not all +PolyFillRectangle + requests can be represented as +LbxPolyFillRectangle + requests. + + + + +The encoding for this request is on See +LbxPolyFillRectangle. + + + + + + + + + + LbxPolyFillArc + + + + + +gc-and-drawable: +LBXGCANDDRAWABLE + + + +arcs +: LISTofLBXARC + + + + Errors: +Alloc + and those given for the corresponding X request. + + + + + + +This request replaces the +PolyFillArc + request. Not all +PolyFillArc + requests can be represented as +LbxPolyFillArc + requests. + + + + +The encoding for this request is on See The +description of this request is on page 22.. + + + + + + + + + + LbxFillPoly + + + + + +gc-and-drawable: +LBXGCANDDRAWABLE + + + +shape +: BYTE + + + +points +: LISTofLBXPOINT + + + + Errors: +Alloc + and those given for the corresponding X request. + + + + + + +This request replaces the +FillPoly + request. Not all +FillPoly + requests can be represented as +LbxFillPoly + requests. + + + + +The proxy will convert the representation of the points to be relative to the +previous point, as described by previous coordinate mode in the X protocol. + + + + +The encoding for this request is on See +LbxFillPoly. + + + + + + + + + + LbxCopyArea + + + + + +srcCache +: CARD8 /* source drawable */ + + + +gc-and-drawable: +LBXGCANDDRAWABLE + + + +src-Drawable +: CARD32 + + + +src-x +: LBXPINT16 + + + +src-y +: LBXPINT16 + + + +width +: LBXCARD16 + + + +height +: LBXCARD16 + + + +dst-x +: LBXPINT16 + + + +dst-y +: LBXPINT16 + + + + Errors: Those given for the corresponding X +request. + + + + + + +This request replaces the +CopyArea + request for requests within its encoding range. + + + + +The encoding for this request is on See +LbxCopyArea. + + + + + + + + + + LbxCopyPlane + + + + + +bit-plane +: CARD32 + + + +src-cache +: CARD8 /* cache reference for source drawable */ + + + +gc-and-drawable: +LBXGCANDDRAWABLE + + + +src-drawable +: CARD32 + + + +src-x +: LBXPINT16 + + + +src-y +: LBXPINT16 + + + +width +: LBXCARD16 + + + +height +: LBXCARD16 + + + +dst-x +: LBXPINT16 + + + +dst-y +: LBXPINT16 + + + + Errors: Those given for the corresponding X +request. + + + + + + +This request replaces the +CopyPlane + request for requests within its coding range. + + + + +The encoding for this request is on See +LbxCopyPlane. + + + + + + + + + + LbxPolyText8 + + + + + +gc-and-drawable: +LBXGCANDDRAWABLE + + + +x +: LBXPINT16 + + + +y +: LBXPINT16 + + + +items +: LISTofTEXTITEM8 + + + + Errors: +Alloc +, and those given for the corresponding X request. + + + + + + +This request replaces the +PolyText8 + request for requests within its encoding range. + + + + +The encoding for this request is on See The +description of this request is on page 23.. + + + + + + + + + + LbxPolyText16 + + + + + +gc-and-drawable: +LBXGCANDDRAWABLE + + + +x: + LBXPINT16 + + + +y +: LBXPINT16 + + + +items +: LISTofTEXTITEM16 + + + + Errors: +Alloc +, and those given for the corresponding X request. + + + + + + +This request replaces the +PolyText16 + request for requests within its encoding range. + + + + +The encoding for this request is on See The +description of this request is on page 24.. + + + + + + + + + + LbxImageText8 + + + + + +gc-and-drawable: +LBXGCANDDRAWABLE + + + +nChars +: CARD8 + + + +x +: LBXPINT16 + + + +y +: LBXPINT16 + + + +string +: STRING8 + + + + Errors: +Alloc +, and those given for the corresponding X request. + + + + + + +This request replaces the +ImageText8 + request for requests within its encoding range. + + + + +The encoding for this request is on See The +description of this request is on page 24.. + + + + + + + + + + LbxImageText16 + + + + + +nChars +: CARD8 + + + +gc-and-drawable: +LBXGCANDDRAWABLE + + + x: LBXPINT16 + + + +y +: LBXPINT16 + + + +string +: STRING16 + + + + Errors: +Alloc +, and those given for the corresponding X request. + + + + + + +This request replaces the +ImageText16 + request for requests within its encoding range. + + + + +The encoding for this request is on See The +description of this request is on page 24.. + + + + + + + + + + LbxPutImage + + + + + +compression-method +: CARD8 + + + +format +: { +Bitmap +, +XYPixmap +, +ZPixmap +} /* packed */ + + + +gc-and-drawable: +LBXGCANDDRAWABLE + + + +width +, +height +: LBXCARD16 + + + +dst-x +, +dst-y +: LBXPINT16 + + + +depth +: CARD8 /* packed */ + + + +left-pad +: CARD8 /* packed */ + + + +pad-bytes +: CARD8 /* packed */ + + + +data +:LISTofBYTE + + + + Errors: +Alloc +, +Value + + + + + + + +When the request can be usefully compressed, this request replaces the + +PutImage + request. The +compression-method + parameter contains the opcode of a compression method returned in the + +LbxStartProxy + reply. The +pad-bytes + parameter gives the number of unused pad bytes that follow the compressed +image data. All other parameters are as in the X request. If the specified +compression method is not recognized, the server returns a +Value + error. + + + + +The encoding for this request is on See +LbxPutImage. + + + + + + + + + + LbxGetImage + + + + + +drawable +: DRAWABLE + + + +x +, +y +: INT16 + + + +width +, +height +: CARD16 + + + +plane-mask +: CARD32 + + + +format +: {XYPixmap, ZPixmap} + + + => + + + depth: CARD8 + + + x-length: CARD32 + + + visual: VISUALID or None + + + compression-method: CARD8 + + + data: LISTofBYTE + + + + Errors: +Alloc,Match,Value + + + + + + + +This request can replace the +GetImage + request. The same semantics apply, with the following exceptions. + + + + +The +compression-method + field contains the opcode of the compression method used in the reply. The +compression opcodes are supplied in the +LbxStartProxy + reply. The +x-length +field + +contains the length of the uncompressed version of the reply in 4 byte units. + + + + +A +Value + error is returned if the format is not recognized by the X server. A +Match + error is returned under the same circumstances as described by the +GetImage + request. + + + + +The encoding for this request is on See +LbxGetImage. + + + + + + + + + + + LbxBeginLargeRequest + + + + + +large-request-length +: CARD32 + + + + Errors: +Alloc + + + + + + + +This request, along with the Lbx +LargeRequestData + and Lbx +EndLargeRequest + requests, is used to transport a large request in pieces. The smaller size of +the resulting requests allows smoother multiplexing of clients on a single low +bandwidth connection to the server. The resulting finer-grained multiplexing +improves responsiveness for the other clients. + + + + +After a +LbxBeginLargeRequest + request is sent, multiple +LbxLargeRequestData + requests are sent to transport all of the data in the large request, and +finally an +LbxEndLargeRequest + request is sent. The large-request-length field expresses the total length of +the transported large request, expressed as the number of bytes in the +transported request divided by four. + + + + +The encoding for this request is on See The +description of this request is on page 25.. + + + + + + + + + + LbxLargeRequestData + + + + + +data +: LISTofBYTE + + + + Errors: +Alloc + + + + + + + +This request is used to carry the segments of a larger request, as described in +the definition of +LbxBeginLargeRequest +. The data must be carried in order, starting with the request header, and each +segment must be multiples of 4 bytes long. If the +LbxLargeRequestData + is not preceded by a corresponding +LbxBeginLargeRequest +, a +BadAlloc + error is generated. + + + + +The encoding for this request is on See The +description of this request is on page 26.. + + + + + + + + + + LbxEndLargeRequest + + + + + Errors: +Length, Alloc + + + + + + + +As described in the definition of +LbxBeginLargeRequest +, +LbxEndLargeRequest + is used to signal the end of a series of +LargeRequestData + requests. If the total length of the data transported by the +LbxLargeRequestData + requests does not match the large-request-length field of the preceding + +LbxBeginLargeRequest + request, then a +Length + error occurs. If the +LbxEndLargeRequest + is not preceded by a corresponding +LbxBeginLargeRequest +, a +BadAlloc + error is generated. The request is executed in order for that client as if it +were the request after the request preceding +LbxEndLargeRequest +. + + + + +The encoding for this request is on See +LbxEndLargeRequest. + + + + + +
+ +Events + + + + + + + + LbxSwitchEvent + + + + + +client +: CARD32 + + + + + + +Notify the proxy that the subsequent replies, events, and errors are relative +to the specified client. + + + + +The encoding for this event is on See +LbxSwitchEvent. + + + + + + + + + + LbxCloseEvent + + + + + +client +: CARD32 + + + + + + +Notify the proxy that the specified client's connection to the server is closed. + + + + +The encoding for this event is on See The +description of this event is on page 27.. + + + + + + + + + + LbxInvalidateTagEvent + + + + + +tag +: CARD32 + + + +tag-type +: {Modmap, Keymap, Property, Font, ConnInfo} + + + + + + +This message informs the proxy that the tag and the server data referenced by +the tag are obsolete, and should be discarded. The tag type may be one of the +following values: +LbxTagTypeModmap +, +LbxTagTypeKeymap +, +LbxTagTypeProperty +, +LbxTagTypeFont +, +LbxTagTypeConnInfo +. + + + + +The encoding for this event is on See +LbxInvalidateTagEvent. + + + + + + + + + + LbxSendTagDataEvent + + + + + +tag +: CARD32 + + + +tag-type +: {Property} + + + + + + +The server sends this event to the proxy to request a copy of tagged data which +is being stored by the proxy. The request contains a tag which was previously +assigned to the data by the server. The proxy should respond to +SendTagData + by sending a +TagData + request to the server. The tag type may be one of the following values: + +LbxTagTypeProperty +. + + + + +The encoding for this event is on See +LbxSendTagDataEvent. + + + + + + + + + + LbxListenToOne + + + + + +client +: CARD32 or +0xffffffff + + + + + + + +When the server is grabbed, +ListenToOne + is sent to the proxy. As an X client, the proxy itself is unaffected by grabs, +in order that it may respond to requests for data from the X server. + + + + +When the client grabbing the server is managed through the proxy, the proxy +will permit messages from itself and the grabbing client to be sent immediately +to the server, and may buffer requests from other clients of the proxy. The +client is identified in the event. + + + + +When the client grabbing the server is not managed through the proxy, the +client field in the event will be +0xffffffff +. The proxy will communicate with the server, and it may buffer requests from +other clients. The proxy will continue to handle new connections while the +server is grabbed. + + + + +The server will send +ListenToAll + to the proxy when the server is ungrabbed. There is no time-out for this +interval in the protocol. + + + + +The encoding for this event is on See The +description of this event is on page 27.. + + + + + + + + + + LbxListenToAll + + + + + + +Notify the proxy that the server has been ungrabbed, and that the proxy may now +send all buffered client requests on to the server. + + + + +The encoding for this event is on See The +description of this event is on page 27.. + + + + + + + + + + LbxQuickMotionDeltaEvent + + + + + +deltaTime +: CARD8 + + + +deltaX +: INT8 + + + +deltaY +: INT8 + + + + + + +This event is used as a replacement for the +MotionNotify + event when possible. The fields are used as deltas to the most recent + +MotionNotify + event encoded as a +MotionNotify + event, +LbxQuickMotionDeltaEvent +, or +LbxMotionDeltaEvent +. Not every +MotionNotify + event can be encoded as a +LbxQuickMotionDeltaEvent +. + + + + +The encoding for this event is on See +LbxQuickMotionDeltaEvent. + + + + + + + + + + LbxMotionDeltaEvent + + + + + +deltaX +: INT8 + + + +deltaY +: INT8 + + + +deltaTime +: CARD16 + + + +deltaSequence +: CARD16 + + + + + + +This event is used as a replacement for the +MotionNotify + event when possible. The fields are used as deltas to the most recent + +MotionNotify + event encoded as a +MotionNotify + event, +LbxQuickMotionDeltaEvent +, or +LbxMotionDeltaEvent +. Not every +MotionNotify + event can be encoded as +a LbxMotionDeltaEvent +. + + + + +The encoding for this event is on See +LbxMotionDeltaEvent. + + + + + + + + + + LbxReleaseCmapEvent + + + + + +colormap +: Colormap + + + + + + +This event notifies the proxy that it must release the grab on this colormap +via the ReleaseCmap request. See +LbxReleaseCmap + + + + +The encoding for this event is on See +LbxReleaseCmapEvent. + + + + + + + + + + LbxFreeCellsEvent + + + + + +colormap +: Colormap + + + +pixelStart, pixelEnd +: CARD32 + + + + + + +The +LbxFreeCells + event is sent to a proxy that has a colormap grabbed to notify the proxy that +the reference count of the described cells were decremented to zero by the +server or another proxy. The reference count includes those by this proxy. The +proxy must update its copy of the colormap state accordingly if the colormap is +still grabbed, or if the proxy may in the future grab the colormap using +smart-grab mode. See LbxGrabCmap + + + + +The pixelStart and pixelEnd fields of the event denote a continuous range of +cells that were freed. + + + + +The encoding for this event is on See +LbxFreeCellsEvent. + + + + +Responses + + +Responses are messages from the server to the proxy that not, strictly +speaking, events, replies or errors. + + + + + + + + + LbxDeltaResponse + + + + + +count +: CARD8 + + + +cache-index +: CARD8 + + + +diffs +: LISTofDIFFITEM + + + + + + +This response carries an event, reply, or error that has been encoded relative +to a message in the response delta cache. The +cache-index + field is the index into the cache. Each entry in +diffs + provides a byte offset and replacement value to use in reconstructing the +response. + + + + +The encoding for this event is on See +LbxDeltaResponse. + + + + +
+ +Algorithm Naming + + +To avoid potential clashes between different but similar algorithms for stream, +bitmap, and pixmap compression, the following naming scheme will be adhered to: + + + + +Each algorithm has a unique name, which is a STRING8, of the following form: + + + + + <organization>-<some-descriptive-name> + + + + +The organization field above is the organization name as registered in section +1 of the X Registry (the registry is provided as a free service by the X +Consortium.) This prevents conflicts among different vendor’s extensions. + + + + +As an example, the X Consortium defines a zlib-based stream compression +algorithm called XC-ZLIB. + + + + + +Encoding + + +The syntax and types used in the encoding are taken from the X protocol +encoding. Where LBX defines new types, they are defined earlier in this +document. + + + + +As in the X protocol, in various cases, the number of bytes occupied by a +component will be specified by a lowercase single-letter variable name instead +of a specific numeric value, and often some other component will have its value +specified as a simple numeric expression involving these variables. Components +specified with such expressions are always interpreted as unsigned integers. +The scope of such variables is always just the enclosing request, reply, error, +event, or compound type structure. + + + + +For unused bytes, the encode-form is: + + + +N unused + + + +If the number of unused bytes is variable, the encode-form typically is: + + + +p unused, p=pad(E) + + + +where E is some expression, and pad(E) is the number of bytes needed to round E +up to a multiple of four. + + + + +pad(E) = (4 - (E mod 4)) mod 4 + + + + +In many of the encodings, the length depends on many variable length fields. +The variable L is used to indicate the number of padded 4 byte units needed to +carry the request. Similarly, the variable Lpad indicates the number of bytes +needed to pad the request to a 4 byte boundary. + + + +For counted lists there is a common encoding of NLISTofFOO: + + + +NLISTofFOO +1 m num items +m LISTofFOO items + + + +For cached GC and Drawables: + + + +LBXGCANDDRAWUPDATE +4 or 0 DRAWBLE optional drawable +4 or 0 GC optional GC + + + + + +LBXGCANDDRAWABLE +8 LBXGCANDDRAWENT cache-entries +8 unused +m LBXGCANDDRAWUPDATE optional GC and Drawable + + + + +Errors + + +LbxClient +1 0 Error +1 CARD8 error-base + 0 +2 CARD16 sequence number +4 unused +2 CARD16 lbx opcode +1 CARD8 major opcode +21 unused + + + + +Requests + + +LbxQueryVersion +1 CARD8 opcode +1 0 lbx opcode +2 1 request length +=> +1 1 Reply +1 unused +2 CARD16 sequence number +4 0 reply length +2 CARD16 major version +2 CARD16 minor version +20 unused + + + +The description of this request is on See +LbxQueryVersion. + + + + +LbxStartProxy +1 CARD8 opcode +1 1 lbx opcode +2 L request length +n NLISTofOPTION-REQUEST options +p unused, p=pad(n) + +OPTION-REQUEST +1 OPTCODE option-code +m OPTLEN option-request-byte-length, (b=m+a+1) +a DELTAOPT or option + NLISTofNAMEDOPT or + NLISTofSTR or + NLISTofPIXMAPMETHOD or + BOOL + + + +The encoding of the option field depends on the option-code. +See See StartProxy Options. + + + +1 OPTCODE option-code +0 LbxOptionDeltaProxy +1 LbxOptionDeltaServer +2 LbxOptionStreamCompression +3 LbxOptionBitmapCompression +4 LbxOptionPixmapCompression +5 LbxOptionMessageCompression /* also known as squishing */ +6 LbxOptionUseTags +7 LbxOptionColormapAllocation +255 LbxOptionExtension + + + +OPTLEN has two possible encodings, depending on the size of the value carried: + + + +OPTLEN +1 CARD8 b (0 < b <= 255) + +OPTLEN +1 0 long length header +1 c length0, c = b >> 8 +1 d length1, d= b & #xff + +DELTAOPT +1 CARD8 min-cache-size +1 CARD8 max-cache-size +1 CARD8 preferred-cache-size +1 CARD8 min-message-length +1 CARD8 max-message-length (in 4-byte units) +1 CARD8 preferred-message-length + +NAMEDOPT +f STR type-name +1 g+1 option-data-length +g LISTofBYTE option-data (option specific) + +PIXMAPMETHOD +h STR name +1 BITMASK format mask +1 j depth count +j LISTofCARD8 depths + +=> +=> + +1 1 Reply +1 CARD8 count + +0xff options in request cannot be decoded +2 CARD16 sequence number +4 (a+p-32)/4 reply length +a LISTofCHOICE options-reply +p unused, if (n<24) p=24-n else p=pad(n) + +CHOICE +1 CARD8 request-option-index +b OPTLEN reply-option-byte-length +c DELTACHOICE or choice + INDEXEDCHOICE or + NLISTofINDEXEDOPT or + NLISTofPIXMAPCHOICE or + BOOL or + INDEXEDCHOICE + + + +The encoding of the choice field depends on the option-code. See See StartProxy Options. + + + +DELTACHOICE +1 CARD8 preferred cache size +1 CARD8 preferred message length in 4-byte units + +INDEXEDCHOICE +1 CARD8 index +d LISTofBYTE data + +PIXMAPCHOICE +1 CARD8 index +1 CARD8 opcode +1 BITMASK format mask +e NLISTofCARD8 depths + + + +The description of this request is on See +LbxStartProxy. + + + + +LbxStopProxy +1 CARD8 opcode +1 2 lbx opcode +2 1 request length + + + +The description of this request is on See +LbxStopProxy. + + + + +LbxSwitch +1 CARD8 opcode +1 3 lbx opcode +2 2 request length +4 CARD32 client + + + +The description of this request is on +See LbxSwitch. + + + + +LbxNewClient +1 CARD8 opcode +1 4 lbx opcode +2 L request length +4 CARD32 client +The remaining bytes of the request are the core connection setup. +=> +If the connection is rejected, a core connection reply is sent. Otherwise the +reply has the form: +1 BOOL success +1 change type + 0 no-deltas + 1 normal-client-deltas + 2 app-group-deltas +2 CARD16 major version +2 CARD16 minor version +2 1 + a length +4 CARD32 tag id + + + +The remaining bytes depend on the value of change-type and length. + + + +For no-deltas, the remaining bytes are the "additional data" +bytes of the core reply. (a = length of core reply, in 4 byte quantities). + + + +For normal-client-deltas, the additional bytes have the form, with a length (a += 1 +b): + + + +4 CARD32 resource id base +4b LISTofSETofEVENT root input masks + + + +For app-group-deltas, the additional bytes have the following form, with a +length of (a = 1 + 4c): + + + +4 CARD32 resource id base +4 WINDOW root id base +4 VISUALID visual +4 COLORMAP colormap +4 CARD32 white pixel +4 CARD32 black pixel +4c LISTofSETofEVENT root input masks + + + +The description of this request is on +See LbxNewClient. + + + + +LbxCloseClient +1 CARD8 opcode +1 5 lbx opcode +2 2 request length +4 CARD32 client + + + +The description of this request is on +See LbxCloseClient. + + + + +LbxModifySequence +1 CARD8 opcode +1 6 lbx opcode +2 2 request length +4 CARD32 offset to sequence number + + + +The description of this request is on See +LbxModifySequence. + + + + +LbxAllowMotion +1 CARD8 opcode +1 7 lbx opcode +2 2 request length +4 CARD32 number of MotionNotify events + + + +The description of this request is on See +LbxAllowMotion. + + + + +LbxIncrementPixel +1 CARD8 opcode +1 8 lbx opcode +2 3 request length +4 COLORMAP colormap +4 CARD32 pixel + + + +The description of this request is on See +LbxIncrementPixel. + + + + +LbxDelta +1 CARD8 opcode +1 9 lbx opcode +2 1+(2n +p+2)/4 request length +1 n count of diffs +1 CARD8 cache index +2n LISTofDIFFITEM offsets and differences +p unused, p=pad(2n + 2) + + + +The description of this request is on See +LbxDelta. + + + + +LbxGetModifierMapping +1 CARD8 opcode +1 10 lbx opcode +2 1 request length +=> +1 1 Reply +1 n keycodes-per-modifier +2 CARD16 sequence number +4 2n reply length +4 CARD32 tag +20 unused +8n LISTofKEYCODE keycodes + + + +The description of this request is on See +LbxGetModifierMapping. + + + + +LbxInvalidateTag +1 CARD8 opcode +1 12 lbx opcode +2 2 request length +4 CARD32 tag + + + +The description of this request is on See +LbxInvalidateTag. + + + + +LbxPolyPoint +1 CARD8 opcode +1 13 lbx opcode +2 1+(m+n+p)/4 request length +m LBXGCANDDRAWABLE cache entries +n LISTofLBXPOINT points (n is data-dependent) +p 0 unused, p=Lpad + + + +The description of this request is on See +LbxPolyPoint. + + + + +LbxPolyLine +1 CARD8 opcode +1 14 lbx opcode +2 1+(m+n+p)/4 request length +m LBXGCANDDRAWABLE cache entries +n LISTofLBXPOINT points (n is data-dependent) +p 0 unused, p=Lpad + + + +The description of this request is on See +LbxPolyLine. + + + + +LbxPolySegment +1 CARD8 opcode +1 15 lbx opcode +2 1+(m+n+p)/4 request length +m LBXGCANDDRAWABLE cache entries +n LISTofLBXSEGMENT segments (n is data-dependent) +p 0 unused, p=Lpad + + + +The description of this request is on See +LbxPolySegment. + + + + +LbxPolyRectangle +1 CARD8 opcode +1 16 lbx opcode +2 1+(m+n+p)/4 request length +m LBXGCANDDRAWABLE cache entries +n LISTofLBXRECTANGLE rectangles (n is data-dependent) +p 0 unused, p=pad(m+n) + + + +The description of this request is on See +LbxPolyRectangle. + + + + +LbxPolyArc +1 CARD8 opcode +1 17 lbx opcode +2 1+(m+n+p)/4 request length +m LBXGCANDDRAWABLE cache entries +n LISTofLBXARCS arcs (n is data-dependent) +p 0 unused, p=Lpad + + + +The description of this request is on See +LbxPolyArc. + + + + +LbxFillPoly +1 CARD8 opcode +1 18 lbx opcode +2 1+(3+m+n+p)/4 request length +1 LBXGCANDDRAWENT cache entries +1 shape +0 Complex +1 Nonconvex +2 Convex +1 p pad byte count +m LBXGCANDDRAWUPDATE optional gc and drawable +n LISTofLBXPOINT points (n is data-dependent) +p 0 unused, p=Lpad + + + +The description of this request is on See +LbxFillPoly. + + + + +LbxPolyFillRectangle +1 CARD8 opcode +1 19 lbx opcode +2 1+(m+n+p)/4 request length +m LBXGCANDDRAWABLE cache entries +n LISTofLBXRECTANGLE rectangles (n is data-dependent) +p 0 unused, p=Lpad + + + +The description of this request is on See +LbxPolyFillRectangle. + + + + +LbxPolyFillArc +1 CARD8 opcode +1 20 lbx opcode +2 1+(m+n+p)/4 request length +m LBXGCANDDRAWABLE cache entries +n LISTofLBXARC arcs (n is data-dependent) +p 0 unused, p=Lpad + + + +The description of this request is on See +LbxPolyFillArc. + + + + +LbxGetKeyboardMapping +1 CARD8 opcode +1 21 lbx opcode +2 2 request length +1 KEYCODE first keycode +1 m count +2 unused +=> +1 1 Reply +1 n keysyms-per-keycode +2 CARD16 sequence number +4 nm reply length (m = count field from the request) +4 CARD32 tag +20 unused +4nm LISTofKEYSYM keysyms + + + +The description of this request is on See +LbxGetKeyboardMapping. + + + + +LbxQueryFont +1 CARD8 opcode +1 22 lbx opcode +2 2 request length +4 FONTABLE font +=> +1 1 Reply +1 BOOL compression +2 CARD16 sequence number +4 L reply length +4 CARD32 tag +20 unused +All of the following is conditional: +12 CHARINFO min-bounds +4 unused +12 CHARINFO max-bounds +4 unused +2 CARD16 min-char-or-byte2 +2 CARD16 max-char-or-byte2 +2 CARD16 default-char +2 n number of FONTPROPs in properties +1 draw-direction +0 LeftToRight +1 RightToLeft +1 CARD8 min-byte1 +1 CARD8 max-byte1 +1 BOOL all-chars-exist +2 INT16 font-ascent +2 INT16 font-descent +4 m number of elements in char-infos +8n LISTofFONTPROP properties +and either +12m LISTofCHARINFO char-infos +or +m LISTofLBXCHARINFO char-infos + + + +The description of this request is on See +LbxQueryFont. + + + + +LbxChangeProperty +1 CARD8 opcode +1 23 lbx opcode +2 6 request length +4 WINDOW window +4 ATOM property +4 ATOM type +1 CARD8 format +1 mode +0 Replace +1 Preprend +2 Append +2 unused +4 CARD32 length of data in format units + (= n for format = 8) + (= n/2 for format = 16) + (= n/4 for format = 32) +=> +1 1 Reply +1 unused +2 CARD16 sequence number +4 0 reply length +4 CARD32 tag +20 unused + + + +The description of this request is on See +LbxChangeProperty. + + + + +LbxGetProperty +1 CARD8 opcode +1 24 lbx opcode +2 7 request length +4 WINDOW window +4 ATOM property +4 ATOM type +0 AnyPropertyType +1 CARD8 delete +3 unused +4 CARD32 long-offset +4 CARD32 long-length +=> +1 1 Reply +1 CARD8 format +2 CARD16 sequence number +4 CARD32 reply length +4 ATOM type +0 None +4 CARD32 bytes-after +4 CARD32 length of value in format units + (= 0 for format = 0) + (= n for format = 8) + (= n/2 for format = 16) + (= n/4 for format = 32) +4 CARD32 tag +8 unused + + + +The description of this request is on See +LbxGetProperty. + + + + +LbxTagData +1 CARD8 opcode +1 25 lbx opcode +2 3+(n+p)/4 request length +4 CARD32 tag +4 CARD32 length of data in bytes +n LISTofBYTE data +p unused, p=pad(n) + + + +The description of this request is on See +LbxTagData. + + + + +LbxCopyArea +1 CARD8 opcode +1 26 lbx opcode +2 L request length +1 CARD8 source drawable cache entry +1 LBXGCANDDRAWENT cache entries +4 or 0 DRAWABLE optional source drawable +b LBXGCANDDRAWUPDATE optional gc and dest drawable +c LBXPINT16 src-x +d LBXPINT16 src-y +e LBXPINT16 dst-x +f LBXPINT16 dst-y +g LBXCARD16 width +h LBXCARD16 height +p unused, p=Lpad + + + +The description of this request is on See +LbxCopyArea. + + + + +LbxCopyPlane +1 CARD8 opcode +1 27 lbx opcode +2 L request length +4 CARD32 bit plane +1 CARD8 source drawable cache entry +1 LBXGCANDDRAWENT cache entries +4 or 0 DRAWABLE optional source drawable +b LBXGCANDDRAWUPDATE optional gc and dest drawable +c LBXPINT16 src-x +d LBXPINT16 src-y +e LBXPINT16 dst-x +f LBXPINT16 dst-y +g LBXCARD16 width +h LBXCARD16 height +p unused, p=Lpad + + + +The description of this request is on See +LbxCopyPlane. + + + + +LbxPolyText8 +1 CARD8 opcode +1 28 lbx opcode +2 L request length +1 LBXGCANDDRAWENT cache entries +a LBXGCANDDRAWUPDATE optional gc and drawable +b LBXPINT16 x +c LBXPINT16 y +n LISTofTEXTITEM8 items +p unused, p=Lpad + + + +The description of this request is on See +LbxPolyText8. + + + + +LbxPolyText16 +1 CARD8 opcode +1 29 lbx opcode +2 L request length +1 LBXGCANDDRAWENT cache entries +a LBXGCANDDRAWUPDATE optional gc and drawable +b LBXPINT16 x +c LBXPINT16 y +2n LISTofTEXTITEM16 items +p unused, p=Lpad + + + +The description of this request is on See +LbxPolyText16. + + + + +LbxImageText8 +1 CARD8 opcode +1 30 lbx opcode +2 L request length +1 LBXGCANDDRAWENT cache entries +a LBXGCANDDRAWUPDATE optional gc and drawable +b LBXPINT16 x +c LBXPINT16 y +n STRING8 string +p unused, p=Lpad + + + +The description of this request is on See +LbxImageText8. + + + + +LbxImageText16 +1 CARD8 opcode +1 31 lbx opcode +2 L request length +1 LBXGCANDDRAWENT cache entries +a LBXGCANDDRAWUPDATE optional gc and drawable +b LBXPINT16 x +c LBXPINT16 y +2n STRING16 string +p unused, p=Lpad + + + +The description of this request is on See +LbxImageText16. + + + + +LbxQueryExtension +1 CARD8 opcode +1 32 lbx opcode +2 2+(n+p)/4 request length +4 n length of extension name +n STRING8 extension name +p unused, p=pad(n) +=> +1 1 Reply +1 n number of requests in the extension +2 CARD16 sequence number +4 0 or 2*(m + p) reply length, m = (n+7)/8 +1 BOOL present +1 CARD8 major opcode +1 CARD8 first event +1 CARD8 first error +20 unused +m LISTofMASK optional reply-mask +p unused, p=pad(m) +m LISTofMASK optional event-mask +p unused, p=pad(m) + + + +The description of this request is on See +LbxQueryExtension. + + + + +LbxPutImage +1 CARD8 opcode +1 33 lbx opcode +2 L request length +1 CARD8 compression method +1 LBXGCANDDRAWENT cache entries +a PIPACKED bit-packed +b LBXGCANDDRAWUPDATE optional gc and drawable +c LBXCARD16 width +d LBXCARD16 height +e LBXPINT16 x +f LBXPINT16 y +n LISTofBYTE compressed image data +p unused, p=Lpad + + + +If there is no left padding and the depth is less than or equal to nine, +PIPPACKED is encoded as follows: + + + +PIPACKED +1 #x80 | (format << 5) | ((depth -1) << 2) + + + +Otherwise PIPACKED is defined as: + + + +PIPACKED +1 (depth -1) << 2) +1 (format << 5) | left-pad + + + +The description of this request is on See +LbxPutImage. + + + + +LbxGetImage +1 CARD8 opcode +1 34 lbx opcode +2 6 request length +4 DRAWABLE drawable +2 INT16 x +2 INT16 y +2 CARD16 width +2 CARD16 height +4 CARD32 plane mask +1 CARD8 format +3 unused +=> +1 1 Reply +1 CARD8 depth +2 CARD16 sequence number +4 (n+p)/4 reply length +4 (m+p)/4 X reply length; if uncompressed, m=n +4 VISUALID visual +0 None +1 compression method +15 unused +n LISTofBYTE data +p unused, p=pad(n) + + + +The description of this request is on See +LbxGetImage. + + + + +LbxBeginLargeRequest +1 CARD8 opcode +1 35 lbx opcode +2 2 request length +4 CARD32 large request length + + + +The description of this request is on See +LbxBeginLargeRequest. + + + + +LbxLargeRequestData +1 CARD8 opcode +1 36 lbx opcode +2 1+n request length +4n LISTofBYTE data + + + +The description of this request is on See +LbxLargeRequestData. + + + + +LbxEndLargeRequest +1 CARD8 opcode +1 37 lbx opcode +2 1 request length + + + +The description of this request is on See +LbxEndLargeRequest. + + + + +LbxInternAtoms +1 CARD8 opcode +1 38 lbx opcode +2 1+(2+m+n+p)/4 request length +2 m num-atoms +n LISTofLONGSTR names +p pad p=Lpad +=> +1 1 Reply +1 unused +2 CARD16 sequence number +4 a reply length, a = MAX(m - 6, 0) +4*m LISTofATOM atoms +p pad p = MAX(0, 4*(6 - m)) +  +LONGSTR +2 c string length +c STRING8 string + + + +The description of this request is on See +LbxInternAtoms. + + + + +LbxGetWinAttrAndGeom +1 CARD8 opcode +1 39 lbx opcode +2 2 request length +4 CARD32 window id +=> +1 1 Reply +1 backing store +0 NotUseful +1 WhenMapped +2 Always +2 CARD16 sequence number +4 7 reply length +4 VISUALID visual id +2 class +1 InputOutput +2 InputOnly +1 BITGRAVITY bit gravity +1 WINGRAVITY window gravity +4 CARD32 backing bit planes +4 CARD32 backing pixel +1 BOOL save under +1 BOOL map installed +1 map state +0 Unmapped +1 Unviewable +2 Viewable +1 BOOL override +4 COLORMAP colormap +4 SETofEVENT all events mask +4 SETofEVENT your event mask +2 SETofDEVICEEVENT do not propagate mask +2 unused +4 WINDOW root +2 INT16 x +2 INT16 y +2 CARD16 width +2 CARD16 height +2 CARD16 border width +1 CARD8 depth +1 unused + + + +The description of this request is on See +LbxGetWinAttrAndGeom. + + + + +LbxGrabCmap +1 CARD8 opcode +1 40 lbx opcode +2 2 request length +4 COLORMAP colormap +=> + + + +If smart-grab is true, the reply is as follows: + + + +1 1 Reply +1 #x80 flags +2 CARD16 sequence number +4 0 reply length +24 unused + +If smart-grab is false, the reply is as follows: + +1 1 Reply +1 flags (set of) + #x40 auto-release + #x20 three-channels + #x10 two-byte-pixels +lower four bits specifies bits-per-pixel +2 CARD16 sequence number +4 L reply length +m CHAN or CHANNELS cells (CHAN if !three-channels) +p 0 pad(m) + +CHANNELS +a CHAN red +1 5 next channel +b CHAN green +1 5 next channel +c CHAN blue +1 0 list end + +CHAN +d LISTofLBXPIXEL + +LBXPIXEL +e PIXELPRIVATE or + PIXELPRIVATERANGE or + PIXELALLOC or + PIXELALLOCRANGE + +PIXELPRIVATE +1 1 pixel-private +f PIXEL pixel + +PIXEL +f CARD8 or CARD16 (CARD8 if !two-byte-pixels) + +PIXELPRIVATERANGE +1 2 pixel-private-range +f PIXEL fist-pixel +f PIXEL last-pixel + +PIXELALLOC +1 3 pixel-private +f PIXEL pixel +g COLORSINGLE or COLORTRIPLE color (COLORSINGLE if +three-channels) + +COLORSINGLE +h CARD8 or CARD16 value (CARD8 if bits-per-rgb =< 7) + +COLORTRIPLE +h COLORSINGLE red +h COLORSINGLE green +h COLORSINGLE blue + +PIXELALLOCRANGE +1 4 pixel-private +f PIXEL first-pixel +f PIXEL last-pixel +j LISTofCOLORSINGLE or color (COLORSINGLE if three-channels) + LISTofCOLORTRIPLE + + + +The description of this request is on See +LbxGrabCmap. + + + + +LbxReleaseCmap +1 CARD8 opcode +1 41 lbx opcode +2 2 request length +4 COLORMAP cmap + + + +The description of this request is on See +LbxReleaseCmap. + + + + +LbxAllocColor +1 CARD8 opcode +1 42 lbx opcode +2 5 request length +4 COLORMAP colormap +4 CARD32 pixel +2 CARD16 red +2 CARD16 green +2 CARD16 blue +2 unused + + + +The description of this request is on See +LbxAllocColor. + + + + +LbxSync +1 CARD8 opcode +1 43 lbx opcode +2 1 request length +=> +1 1 Reply +1 n unused +2 CARD16 sequence number +4 0 reply length +24 unused + + + +The description of this request is on See +LbxSync. + + + + + + +Events + + +LbxSwitchEvent +1 base + 0 code +1 0 lbx type +2 CARD16 sequence number +4 CARD32 client +24 unused + + + +The description of this event is on See +LbxSwitchEvent. + + + + +LbxCloseEvent +1 base + 0 code +1 1 lbx type +2 CARD16 sequence number +4 CARD32 client +24 unused + + + +The description of this event is on See +LbxCloseEvent. + + + + +LbxInvalidateTagEvent +1 base + 0 code +1 3 lbx type +2 CARD16 sequence number +4 CARD32 tag +4 tag-type +1 LbxTagTypeModmap +2 LbxTagTypeKeymap +3 LbxTagTypeProperty +4 LbxTagTypeFont +5 LbxTagTypeConnInfo +20 unused + + + +The description of this event is on See +LbxInvalidateTagEvent. + + + + +LbxSendTagDataEvent +1 base + 0 code +1 4 lbx type +2 CARD16 sequence number +4 CARD32 tag +4 tag-type +3 LbxTagTypeProperty +20 unused + + + +The description of this event is on See +LbxSendTagDataEvent. + + + + +LbxListenToOne +1 base + 0 code +1 5 lbx type +2 CARD16 sequence number +4 CARD32 client +#xFFFFFFFF +a client not managed by the proxy +24 unused + + + +The description of this event is on See +LbxListenToOne. + + + + +LbxListenToAll +1 base + 0 code +1 6 lbx type +2 CARD16 sequence number +28 unused + + + +The description of this event is on See +LbxListenToAll. + + + + +LbxQuickMotionDeltaEvent +1 base + 1 code +1 CARD8 delta-time +1 INT8 delta-x +1 INT8 delta-y + + + +This event is not padded to 32 bytes. + + + + +The description of this event is on See +LbxQuickMotionDeltaEvent. + + + + +LbxMotionDeltaEvent +1 base + 0 code +1 7 lbx type +1 INT8 delta-x +1 INT8 delta-y +2 CARD16 delta-time +2 CARD16 delta-sequence + + + +This event is not padded to 32 bytes. + + + + +The description of this event is on See +LbxMotionDeltaEvent. + + + + +LbxReleaseCmapEvent +1 base + 0 code +1 8 lbx type +2 CARD16 sequence number +4 COLORMAP colormap +24 unused + + + +The description of this event is on See +LbxReleaseCmapEvent. + + + + +LbxFreeCellsEvent +1 base + 0 code +1 9 lbx type +2 CARD16 sequence number +4 COLORMAP colormap +4 PIXEL pixel start +4 PIXEL pixel end +16 unused + + + +The description of this event is on See +LbxFreeCellsEvent. + + + + + +Re-encoding of X Events + + +The X protocol requires all X events to be 32 bytes. The LBX server reduces the +number of bytes sent between the server and the proxy for some X events by not +appending unused pad bytes to the event data. The offsets of X event data are +unchanged. The proxy will pad the events to 32 bytes before passing them on to +the client. + + + + +LBX reencodes X event representations into the following sizes, if squishing is +enabled: + + + +KeyOrButton 32 +EnterOrLeave 32 +Keymap 32 +Expose 20 +GraphicsExposure 24 +NoExposure 12 +VisibilityNotify 12 +CreateNotify 24 +DestroyNotify 12 +UnmapNotify 16 +MapNotify 16 +MapRequest 12 +Reparent 24 +ConfigureNotify 28 +ConfigureRequest 28 +GravityNotify 16 +ResizeRequest 12 +Circulate 20 +Property Notify 20 +SelectionClear 20 +SelectionRequest 28 +SelectionNotify 24 +Colormap Notify 16 +MappingNotify 8 +ClientMessage 32 +Unknown 32 + + + + +Responses + + +LbxDeltaResponse +1 event_base + 0 event code +1 2 lbx type +2 1+(2+2n+p)/4 request length +1 n count of diffs +1 CARD8 cache index +2n LISTofDIFFITEM offsets and differences +p unused, p=pad(2n) + + + +The description of this response is on See +LbxDeltaResponse. + + + + +
diff --git a/miniconda3/share/doc/xextproto/multibuf.xml b/miniconda3/share/doc/xextproto/multibuf.xml new file mode 100644 index 0000000000000000000000000000000000000000..9e2b0659472bd2d399efd85522bb2600cad21f64 --- /dev/null +++ b/miniconda3/share/doc/xextproto/multibuf.xml @@ -0,0 +1,1628 @@ + + %defs; +]> + + + + + + + Extending X for Double-Buffering, Multi-Buffering, and Stereo + + + JeffreyFriedberg + + + LarrySeiler + + + JeffVroom + + + 1989Digital Equipment Corporation + X Version 11, Release &fullrelvers; + Version 3.3 + + + +Permission to use, copy, modify, and distribute this documentation for any +purpose and without fee is hereby granted, provided that the above copyright +notice and this permission notice appear in all copies. +Digital Equipment Corporation makes no representations +about the suitability for any purpose of the information in +this document. This documentation is provided "as is" +without express or implied warranty. This document +is subject to change. + + + + +Copyright © 1989, 1994 X Consortium + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the ``Software''), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +Except as contained in this notice, the name of the X Consortium shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from the X Consortium. + +X Window System is a trademark of The OpenGroup. + + + + +Warning + +The Multi-Buffering extension described here +was a draft standard of the X Consortium prior to Release 6.1. It has been +superseded by the Double Buffer +Extension (DBE). DBE is an X Consortium Standard as of Release 6.1. + + + + +Introduction + + +Several proposals have been written that address some of the +issues surrounding the support of double-buffered, multi-buffered, +and stereo windows in the X Window System: + + + + + +Extending X for Double-Buffering, +Jeffrey Friedberg, Larry Seiler, Randi Rost. + + + + +(Proposal for) Double-Buffering Extensions, +Jeff Vroom. + + + + +An Extension to X.11 for Displays with Multiple Buffers, +David S.H. Rosenthal. + + + + +A Multiple Buffering/Stereo Proposal, +Mark Patrick. + + + + + +The authors of this proposal have tried to unify the above documents +to yield a proposal that incorporates support for double-buffering, +multi-buffering, and stereo in a way that is acceptable to all concerned. + + + + +Goals + + +Clients should be able to: + + + + + +Associate multiple buffers with a window. + + + + +Paint in any buffer associated with a window. + + + + +Display any buffer associated with a window. + + + + +Display a series of buffers in a window in rapid succession +to achieve a smooth animation. + + + + +Request simultaneous display of different buffers in different windows. + + + + + +In addition, the extension should: + + + + + +Allow existing X applications to run unchanged. + + + + +Support a range of implementation methods that can capitalize on +existing hardware features. + + + + + + + +Image Buffers + + +Normal windows are created using the standard +CreateWindow request: + + + +CreateWindow + parent : WINDOW + w_id : WINDOW + depth : CARD8 + visual : VISUALID or CopyFromParent + x, y : INT16 + width, height : INT16 + border_width : INT16 + value_mask : BITMASK + value_list : LISTofVALUE + + + +This request allocates a set of window attributes and +a buffer into which an image can be drawn. +The contents of this image buffer will +be displayed when the window is mapped to the screen. + + + +To support double-buffering and multi-buffering, +we introduce the notion that additional image buffers can +be created and bound together to form groups. +The following rules will apply: + + + + + +All image buffers in a group will have the same +visual type, depth, and geometry (ie: width and height). + + + + +Only one image buffer per group can be displayed +at a time. + + + + +Draw operations can occur to any image buffer at +any time. + + + + +Window management requests (MapWindow, DestroyWindow, +ConfigureWindow, etc...) +affect all image buffers associated with a window. + + + + +Appropriate resize and exposure events will be generated +for every image buffer that is affected by a window +management operation. + + + + + +By allowing draw operations to occur on any image buffer at any time, +a client could, on a multi-threaded multi-processor server, +simultaneously build up images for display. +To support this, each buffer must have its own resource ID. +Since buffers are different than windows and pixmaps +(buffers are not hierarchical and pixmaps cannot be displayed) +a new resource, Buffer, is introduced. +Furthermore, a Buffer is also a Drawable, thus +draw operations may also be performed on buffers simply +by passing a buffer ID to the existing pixmap/window +interface. + + + +To allow existing X applications to work unchanged, we assume +a window ID passed in a draw request, for a multi-buffered +window, will be an alias for the ID of the currently +displayed image buffer. Any draw requests (eq: GetImage) on +the window will be relative to the displayed image buffer. + + + +In window management requests, only a window ID will be +accepted. Requests like QueryTree, will continue to +return only window ID's. Most events will return +just the window ID. Some new events, described in a subsequent +section, will return a buffer ID. + + + +When a window has backing store the contents of the window +are saved off-screen. Likewise, when the contents of an image +buffer of a multi-buffer window is saved off-screen, it is +said to have backing store. This applies to all image buffers, +whether or not they are selected for display. + + + +In some multi-buffer implementations, undisplayed buffers might be +implemented using pixmaps. Since the contents of pixmaps exist +off-screen and are not affected by occlusion, these image buffers +in effect have backing store. + + + +On the other hand, both the displayed and undisplayed image buffers +might be implemented using a subset of the on-screen pixels. +In this case, unless the contents of an image buffer are saved +off-screen, these image buffers in effect do not have backing store. + + + +Output to any image buffer of an unmapped multi-buffered window +that does not have backing store is discarded. Output to any +image buffer of a mapped multi-buffer window will be performed; +however, portions of an image buffer may be occluded or clipped. + + + +When an unmapped multi-buffered window becomes mapped, the contents +of any image buffer buffer that did not have backing store is +tiled with the background and zero or more exposure events are +generated. If no background is defined for the window, then +the screen contents are not altered and the contents of any +undisplayed image buffers are undefined. If backing store was +maintained for an image buffer, then no exposure events are generated. + + + + +New Requests + + +The new request, CreateImageBuffers, creates a group of +image buffers and associates them with a normal X window: + + + +CreateImageBuffers + w_id : WINDOW + buffers : LISTofBUFFER + update_action : {Undefined,Background,Untouched,Copied} + update_hint : {Frequent,Intermittent,Static} + => + number_buffers : CARD16 + + (Errors: Window, IDChoice, Value) + + + +One image buffer will be associated with each ID passed in +buffers. +The first buffer of the list is referred to as buffer[0], the next +buffer[1], and so on. Each buffer will have the same visual type +and geometry as the window. +Buffer[0] will refer to the image buffer already associated +with the window ID and its contents will not be modified. +The displayed image buffer attribute is set to buffer[0]. + + + +Image buffers for the remaining ID's (buffer[1],...) are allocated. +If the window is mapped, or if these image buffers have backing +store, their contents will be tiled with the window background +(if no background is defined, the buffer contents are undefined), +and zero or more expose events will be generated for each of these +buffers. The contents of an image buffer is undefined when +the window is unmapped and the buffer does not have backing store. + + + +If the window already has a group of image buffers +associated with it (ie: from a previous CreateImageBuffers request) +the actions described for DestroyImageBuffers are performed first +(this will delete the association of the previous buffer ID's and +their buffers as well as de-allocate all buffers except for the +one already associated with the window ID). + + + +To allow a server implementation to efficiently allocate the +buffers, the total number of buffers required and +the update action (how they will behave during an update) +is specified "up front" in the request. +If the server cannot allocate all the buffers requested, the +total number of buffers actually allocated will be returned. +No Alloc errors will be generated \- buffer[0] can +always be associated with the existing displayed image buffer. + + + +For example, an application that wants to animate a short movie +loop may request 64 image buffers. The server may only be able to +support 16 image buffers of this type, size, and depth. +The application can then decide 16 buffers is sufficient and may +truncate the movie loop, or it may decide it really needs +64 and will free the buffers and complain to the user. + + + +One might be tempted to provide a request that inquires whether +n +buffers of a particular type, size, and depth +could be allocated. +But if the query is decoupled from the actual allocation, +another client could sneak in and take the buffers before the +original client has allocated them. + + + +While any buffer of a group can be selected for display, +some applications may display buffers in a predictable order +(ie: the movie loop application). The +list order +(buffer[0], buffer[1], ...) will be used as a hint by the +server as to which buffer will be displayed next. +A client displaying buffers in this order may see a +performance improvement. + + + +update_action indicates what should happen to a previously +displayed buffer when a different buffer becomes displayed. +Possible actions are: + + + + + Undefined + + +The contents of the buffer that was +last displayed will become undefined after the update. This +is the most efficient action since it allows the implementation +to trash the contents of the buffer if it needs to. + + + + + Background + + +The contents of the buffer that was +last displayed will be set to the background of the window after the update. +The background action allows devices to use a fast clear +capability during an update. + + + + + Untouched + + +The contents of the buffer that was +last displayed will be untouched after the update. Used +primarily when cycling through images that have already +been drawn. + + + + + Copied + + +The contents of the buffer that was +last displayed will become the same as those that are being +displayed after the update. This is useful when incrementally +adding to an image. + + + + + + + + +update_hint indicates how often the client will +request a different buffer to be displayed. +This hint will allow smart server implementations to choose the +most efficient means to support a multi-buffered window based +on the current need of the application (dumb implementations +may choose to ignore this hint). Possible hints are: + + + + + Frequent + + +An animation or movie loop is +being attempted and the fastest, most efficient means for +multi-buffering should be employed. + + + + + Intermittent + + +The displayed image will be +changed every so often. This is common for images that are +displayed at a rate slower than a second. For example, a +clock that is updated only once a minute. + + + + + Static + + +The displayed image buffer will +not be changed any time soon. Typically set by an application +whenever there is a pause in the animation. + + + + + + +To display an image buffer the following request can be used: + + + +DisplayImageBuffers + buffers : LISTofBUFFER + min_delay : CARD16 + max_delay : CARD16 + + (Errors: Buffer, Match) + + + +The image buffers listed will become displayed as simultaneously +as possible and the update action, bound at +CreateImageBuffers +time, will be performed. + + + +A list of buffers is specified to +allow the server to efficiently change the display of more than one +window at a time (ie: when a global screen swap method is used). +Attempting to simultaneously display +multiple image buffers from the same window is an error +(Match) since it violates the rule that only one +image buffer per group can be displayed at a time. + + + +If a specified buffer is already displayed, +any delays and update action will still be +performed for that buffer. In this instance, +only the update action of Background +(and possibly +Undefined) will have any affect on the +contents of the displayed buffer. These semantics allow +an animation application to successfully execute +even when there is only a single buffer available +for a window. + + + +When a DisplayImageBuffers request is made to an unmapped +multi-buffered window, the effect of the update action depends +on whether the image buffers involved have backing store. +When the target of the update action is an image buffer that +does not have backing store, output is discarded. When the +target image buffer does have backing store, the update is performed; +however, when the source of the update is an image buffer does not +have backing store (as in the case of update action +Copied), the +contents of target image buffer will become undefined. + + + +min_delay and +max_delay put a bound on how long the +server should wait before processing the display request. +For each of the windows to be updated by this request, at least +min_delay milli-seconds should elapse since +the last +time any of the windows were updated; conversely, no window +should have to wait more than max_delay +milli-seconds before being updated. + + + +min_delay allows an application to +slow down an animation or movie loop so that +it appears +synchronized at a rate the server can support given the current load. +For example, a min_delay of 100 indicates the +server should +wait at least 1/10 of a second since the last time any of the +windows were updated. A min_delay of zero +indicates no waiting is necessary. + + + +max_delay can be thought of as an additional +delay beyond min_delay the server is allowed +to wait +to facilitate such things as efficient update of multiple windows. +If max_delay would require an update before +min_delay +is satisfied, then the server should process the display request as +soon as the min_delay requirement is met. A +typical value for max_delay is zero. + + + +To implement the above functionality, the time since the last +update by a DisplayImageBuffers request for each +multi-buffered +window needs to be saved as state by the server. +The server may delay execution of the DisplayImageBuffers +request until the appropriate time (e.g. by requeuing the +request after computing the timeout); +however, the entire request must be processed in one operation. +Request execution indivisibility must be maintained. When +a server is implemented with internal concurrency, the +extension must adhere to the same concurrency semantics +as those defined for the core protocol. + + + +To explicitly clear a rectangular area of an image buffer to +the window background, the following request can be used: + + + +ClearImageBufferArea + buffer : BUFFER + x, y : INT16 + w, h : CARD16 + exposures : BOOL + + (Errors: Buffer, Value) + + + +Like the X ClearArea request, +x and y +are relative to +the window's origin and specify the upper-left corner of the rectangle. +If width is zero, it is replaced with the +current window width +minus x. If +height is zero it is replaced with the current +window height minus y. If the window has a +defined background tile, the rectangle is tiled with a plane mask of all ones, +a function of Copy, and a subwindow-mode of +ClipByChildren. +If the window has background None, the +contents of the buffer +are not changed. In either case, if +exposures is true, then one or +more exposure events are generated for regions of the rectangle that are +either visible or are being retained in backing store. + + + + +The group of image buffers allocated by a +CreateImageBuffers +request can be destroyed with the following request: + + + +DestroyImageBuffers + w_id : WINDOW + + (Error: Window) + + + +The association between the buffer ID's and their corresponding +image buffers are deleted. Any image buffers not selected for +display are de-allocated. If the window is not multi-buffered, +the request is ignored. + + + + + +Attributes + + +The following attributes will be associated with each window that +is multi-buffered: + + + + displayed_buffer : CARD16 + update_action : {Undefined,Background,Untouched,Copied} + update_hint : {Frequent,Intermittent,Static} + window_mode : {Mono,Stereo} + buffers : LISTofBUFFER + + + +displayed_buffer is set to the +index of the currently +displayed image buffer (for stereo windows, this will be +the index of the left buffer \- the index of the right buffer +is simply index+1). +window_mode indicates whether this window is +Mono or Stereo. +The ID for each buffer associated with the window is recorded +in the buffers list. +The above attributes can be queried with the following request: + + + +GetMultiBufferAttributes + w_id : WINDOW + => + displayed_buffer : CARD16 + update_action : {Undefined,Background,Untouched,Copied} + update_hint : {Frequent,Intermittent,Static} + window_mode : {Mono,Stereo} + buffers : LISTofBUFFER + + (Errors: Window, Access, Value) + + + +If the window is not multi-buffered, a Access error +will be generated. +The only multi-buffer attribute that can be explicitly set +is update_hint. Rather than have a specific +request to set this attribute, a generic set request is provided to +allow for future expansion: + + + +SetMultiBufferAttributes + w_id : WINDOW + value_mask : BITMASK + value_list : LISTofVALUE + + (Errors: Window, Match, Value) + + + +If the window is not multi-buffered, a Match error +will be generated. +The following attributes are maintained for each buffer of a +multi-buffered window: + + + + window : WINDOW + event_mask : SETofEVENT + index : CARD16 + side : {Mono,Left,Right} + + + +window indicates the window this buffer is +associated with. +event_mask specifies which events, relevant to +buffers, will be sent back to the client via the associated buffer ID +(initially no events are selected). +index is the list position (0, 1, ...) of the +buffer. +side indicates whether this buffer is +associated with +the left side or right side of a stereo window. +For non-stereo windows, this attribute will be set to +Mono. +These attributes can be queried with the following request: + + + +GetBufferAttributes + buffer : BUFFER + => + window : WINDOW + event_mask : SETofEVENT + index : CARD16 + side : {Mono,Left,Right} + + (Errors: Buffer, Value) + + + +The only buffer attribute that can be explicitly set +is event_mask. +The only events that are valid are +Expose and the new +ClobberNotify and UpdateNotify +event (see Events section below). +A Value error will be generated if an event not +selectable for a buffer is specified in an event mask. +Rather than have a specific request +to set this attribute, a generic set request is provided to +allow for future expansion: + + + +SetBufferAttributes + buffer : BUFFER + value_mask : BITMASK + value_list : LISTofVALUE + + (Errors: Buffer, Value) + + + +Clients may want to query the server about basic multi-buffer +and stereo capability on a per screen basis. The following request +returns a large list of information +that would most likely be read once by Xlib for each screen, and used as a +data base for other Xlib queries: + + + +GetBufferInfo + root : WINDOW + => + info : LISTofSCREEN_INFO + + + +Where SCREEN_INFO and +BUFFER_INFO are defined as: + + + + SCREEN_INFO : [ normal_info : LISTofBUFFER_INFO, + stereo_info : LISTofBUFFER_INFO ] + + BUFFER_INFO : [ visual : VISUALID, + max_buffers : CARD16, + depth : CARD8 ] + + + +Information regarding multi-buffering of normal (mono) windows +is returned in the normal_info list. +The stereo_info +list contains information about stereo windows. +If the stereo_info list is empty, stereo +windows are +not supported on the screen. If +max_buffers is zero, +the maximum number of buffers for the depth and visual is +a function of the size of the created window and current +memory limitations. + + + +The following request returns the major and minor version numbers +of this extension: + + + +GetBufferVersion + => + major_number : CARD8 + minor_number : CARD8 + + + +The version numbers are an escape hatch in case future revisions of +the protocol are necessary. In general, the major version would +increment for incompatible changes, and the minor version would +increment for small upward compatible changes. Barring changes, the +major version will be 1, and the minor version will be 1. + + + + +Events + + +All events normally generated for single-buffered +windows are also generated for multi-buffered windows. +Most of these events (ie: ConfigureNotify) will +only be generated for the window and not for each buffer. +These events will return a window ID. + + + +Expose events will be generated for both the window +and any buffer affected. When this event is generated for +a buffer, the same event structure will be used +but a buffer ID is returned instead of a window ID. +Clients, when processing these events, will know whether an +ID returned in an event structure is for a window or a buffer +by comparing the returned ID to the ones returned when the +window and buffer were created. + + + +GraphicsExposure and +NoExposure are generated +using whatever ID is specified in the graphics operation. +If a window ID is specified, the event will contain the +window ID. If a buffer ID is specified, the event will +contain the buffer ID. + + +In some implementations, moving a window +over a multi-buffered window may cause one or more of its buffers +to get overwritten or become unwritable. To allow a +client drawing into one of these buffers the opportunity +to stop drawing until some portion of the buffer is +writable, the following event is added: + + + +ClobberNotify + buffer : BUFFER + state : {Unclobbered,PartiallyClobbered,FullyClobbered} + + + +The ClobberNotify event is reported to clients selecting +ClobberNotify on a buffer. When a buffer +that was fully +or partially clobbered becomes unclobbered, an event with +Unclobbered +is generated. When a buffer that was unclobbered becomes +partially clobbered, an event with +PartiallyClobbered +is generated. When a buffer that was unclobbered or +partially clobbered becomes fully clobbered, an event with +FullyClobbered is generated. + + + +ClobberNotify events on a given buffer are +generated before any Expose events on that buffer, +but it is not required that all ClobberNotify +events on all buffers be generated before all +Expose events on all buffers. + + + +The ordering of ClobberNotify events with respect +to VisibilityNotify events is not constrained. + + + +If multiple buffers were used as an image FIFO between an image +server and the X display server, then the FIFO manager would like +to know when a buffer that was previously displayed, has been +undisplayed and updated, as the side effect of a +DisplayImageBuffers +request. This allows the FIFO manager to load up a future frame as +soon as a buffer becomes available. To support this, +the following event is added: + + + +UpdateNotify + buffer : BUFFER + + + +The UpdateNotify event is reported to clients selecting +UpdateNotify on a buffer. Whenever a buffer +becomes updated +(e.g. its update action is performed as part of a +DisplayImageBuffers +request), an UpdateNotify event is generated. + + + + +Errors + + +The following error type has been added to support +this extension: + + + +Buffer + +A value for a BUFFER argument does not name a defined BUFFER. + + + + +Double-Buffering Normal Windows + + +The following pseudo-code fragment illustrates how to create and display +a double-buffered image: + + + +/* + * Create a normal window + */ +CreateWindow( W, ... ) + +/* + * Create two image buffers. Assume after display, buffer + * contents become "undefined". Assume we will "frequently" + * update the display. Abort if we don't get two buffers, + */ +n = CreateImageBuffers( W, [B0,B1], Undefined, Frequent ) +if (n != 2) <abort> + +/* + * Map window to the screen + */ +MapWindow( W ) + +/* + * Draw images using alternate buffers, display every + * 1/10 of a second. Note we draw B1 first so it will + * "pop" on the screen + */ +while animating +{ + <draw picture using B1> + DisplayImageBuffers( [B1], 100, 0 ) + + <draw picture using B0> + DisplayImageBuffers( [B0], 100, 0 ) +} + +/* + * Strip image buffers and leave window with + * contents of last displayed image buffer. + */ +DestroyImageBuffers( W ) + + + + + +Multi-Buffering Normal Windows + + +Multi-buffered images are also supported by these requests. +The following pseudo-code fragment illustrates how to create a +a multi-buffered image and cycle through the images to +simulate a movie loop: + + + +/* + * Create a normal window + */ +CreateWindow( W, ... ) + +/* + * Create 'N' image buffers. Assume after display, buffer + * contents are "untouched". Assume we will "frequently" + * update the display. Abort if we don't get all the buffers. + */ +n = CreateImageBuffers( W, [B0,B1,...,B(N-1)], Untouched, Frequent ) +if (n != N) <abort> + +/* + * Map window to screen + */ +MapWindow( W ) + +/* + * Draw each frame of movie one per buffer + */ +foreach frame + <draw frame using B(i)> + +/* + * Cycle through frames, one frame every 1/10 of a second. + */ +while animating +{ + foreach frame + DisplayImageBuffers( [B(i)], 100, 0 ) +} + + + + + +Stereo Windows + +How stereo windows are supported on a server +is implementation +dependent. A server may contain specialized hardware that allows +left and right images to be toggled at field or frame rates. The +stereo affect may only be perceived with the aid of special +viewing glasses. The display of a +stereo picture should +be independent of how often the contents of the picture are +updated by an application. Double and +multi-buffering +of images should be possible regardless of whether the image +is displayed normally or in stereo. + + + +To achieve this goal, a simple extension to normal windows +is suggested. Stereo windows are just like normal windows +except the displayed image is made up of a left image +buffer and a right image buffer. To create a stereo window, +a client makes the following request: + + + +CreateStereoWindow + parent : WINDOW + w_id : WINDOW + left, right : BUFFER + depth : CARD8 + visual : VISUALID or CopyFromParent + x, y : INT16 + width, height : INT16 + border_width : INT16 + value_mask : BITMASK + value_list : LISTofVALUE + + (Errors: Alloc, Color, Cursor, Match, + Pixmap, Value, Window) + + + +This request, modeled after the CreateWindow request, +adds just two new parameters: left and +right. +For stereo, it is essential that one can distinguish whether +a draw operation is to occur on the left image or right image. +While an internal mode could have been added to achieve this, +using two buffer ID's allows clients to simultaneously build up +the left and right components of a stereo image. These +ID's always refer to (are an alias for) the left and right +image buffers that are currently displayed. + + + +Like normal windows, the window ID is used whenever a window +management operation is to be performed. Window queries would +also return this window ID (eg: QueryTree) as would most +events. Like the window ID, the left and right buffer ID's +each have their own event mask. They can be set and queried +using the Set/GetBufferAttributes requests. + + + +Using the window ID of a stereo window in a draw request +(eg: GetImage) results in pixels that are +undefined. +Possible semantics are that both left and right images get +drawn, or just a single side is operated on (existing applications +will have to be re-written to explicitly use the left and right +buffer ID's in order to successfully create, fetch, and store +stereo images). + + + +Having an explicit CreateStereoWindow request is helpful +in that a server implementation will know from the onset whether +a stereo window is desired and can return appropriate status +to the client if it cannot support this functionality. + + + +Some hardware may support separate stereo and non-stereo modes, +perhaps with different vertical resolutions. For example, the +vertical resolution in stereo mode may be half that of non-stereo +mode. Selecting one mode or the other must be done through some +means outside of this extension (eg: by providing a separate +screen for each hardware display mode). The screen attributes +(ie: x/y resolution) for a screen that supports normal windows, +may differ from a screen that supports stereo windows; +however, all windows, regardless of type, displayed on the +same screen must have the same screen attributes +(ie: pixel aspect ratio). + + + +If a screen that supports stereo windows also supports +normal windows, then the images presented to the left and +right eyes for normal windows should be the same +(ie: have no stereo offset). + + + + + +Single-Buffered Stereo Windows + + +The following shows how to create and display a single-buffered +stereo image: + + +/* + * Create the stereo window, map it the screen, + * and draw the left and right images + */ +CreateStereoWindow( W, L, R, ... ) + +MapWindow( W ) + +<draw picture using L,R> + + + + +Double-Buffering Stereo Windows + + +Additional image buffers may be added to a stereo window +to allow double or multi-buffering of stereo images. +Simply use the the CreateImageBuffers request. +Even numbered buffers (0,2,...) will be left buffers. +Odd numbered buffers (1,3,...) will be right buffers. +Displayable stereo images are formed by consecutive +left/right pairs of image buffers. For example, +(buffer[0],buffer[1]) form the first displayable +stereo image; (buffer[2],buffer[3]) the next; +and so on. + + + +The CreateImageBuffers request will only create +pairs of left and right image buffers for stereo windows. +By always pairing left and right image +buffers together, implementations might be able to +perform some type of optimization. If an odd number +of buffers is specified, a Value error is generated. +All the rules mentioned at the start of this proposal +still apply to the image buffers supported by a stereo window. + + + +To display a image buffer pair of a multi-buffered stereo image, +either the left buffer ID or right buffer ID may be specified in a +DisplayImageBuffers request, but not both. + + + +To double-buffer a stereo window: + + + +/* + * Create stereo window and map it to the screen + */ +CreateStereoWindow( W, L, R, ... ) + +/* + * Create two pairs of image buffers. Assume after display, + * buffer contents become "undefined". Assume we will "frequently" + * update the display. Abort if we did get all the buffers. + */ +n = CreateImageBuffers( W, [L0,R0,L1,R1], Undefined, Frequently ) +if (n != 4) <abort> + +/* + * Map window to the screen + */ +MapWindow( W ) + +/* + * Draw images using alternate buffers, + * display every 1/10 of a second. + */ +while animating +{ + <draw picture using L1,R1> + DisplayImageBuffers( [L1], 100, 0 ) + + <draw picture using L0,R0> + DisplayImageBuffers( [L0], 100, 0 ) +} + + + + + +Multi-Buffering Stereo Windows + + +To cycle through N stereo images: + + + +/* + * Create stereo window + */ +CreateStereoWindow( W, L, R, ... ) + +/* + * Create N pairs of image buffers. Assume after display, + * buffer contents are "untouched". Assume we will "frequently" + * update the display. Abort if we don't get all the buffers. + */ +n = CreateImageBuffers( W, [L0,R0,...,L(N-1),R(N-1)], Untouched, Frequently ) +if (n != N*2) <abort> + +/* + * Map window to screen + */ +MapWindow( W ) + +/* + * Draw the left and right halves of each image + */ +foreach stereo image + <draw picture using L(i),R(i)> + +/* + * Cycle through images every 1/10 of a second + */ +while animating +{ + foreach stereo image + DisplayImageBuffers( [L(i)], 100, 0 ) +} + + + + +Protocol Encoding + + +The official name of this extension is "Multi-Buffering". +When this string passed to QueryExtension the +information returned should be interpreted as follows: + + + + + major-opcode + + +Specifies the major opcode of this extension. +The first byte of each extension request should +specify this value. + + + + + first-event + + +Specifies the code that will be returned when +ClobberNotify events are generated. + + + + + first-error + + +Specifies the code that will be returned when +Buffer errors are generated. + + + + + + +The following sections describe the protocol +encoding for this extension. + + + + + +TYPES + + +BUFFER_INFO + +4 VISUALID visual +2 CARD16 max-buffers +1 CARD8 depth +1 unused + + + +SETofBUFFER_EVENT + + #x00008000 Exposure + #x02000000 ClobberNotify + #x04000000 UpdateNotify + + + + + +EVENTS + + +ClobberNotify +1 see first-event code +1 unused +2 CARD16 sequence number +4 BUFFER buffer +1 state + 0 Unclobbered + 1 PartiallyClobbered + 2 FullyClobbered +23 unused + + + +UpdateNotify +1 first-event+1 code +1 unused +2 CARD16 sequence number +4 BUFFER buffer +24 unused + + + + +ERRORS + + +Buffer +1 0 Error +1 see first-error code +2 CARD16 sequence number +4 CARD32 bad resource id +2 CARD16 minor-opcode +1 CARD8 major-opcode +21 unused + + + + + +REQUESTS + + +GetBufferVersion +1 see major-opcode major-opcode +1 0 minor-opcode +2 1 request length +-> +1 1 Reply +1 unused +2 CARD16 sequencenumber +4 0 reply length +1 CARD8 majorversion number +1 CARD8 minorversion number +22 unused + + +CreateImageBuffers + +1 see major-opcode major-opcode +1 1 minor-opcode +2 3+n requestlength +4 WINDOW wid +1 update-action + 0 Undefined + 1 Background + 2 Untouched + 3 Copied +1 update-hint + 0 Frequent + 1 Intermittent + 2 Static +2 unused +4n LISTofBUFFER buffer-list +-> +1 1 Reply +1 unused +2 CARD16 sequencenumber +4 0 reply length +2 CARD16 number-buffers +22 unused + + +DestroyImageBuffers + +1 see major-opcode major-opcode +1 2 minor-opcode +2 2 request length +4 WINDOW wid + + +DisplayImageBuffers + + +1 see major-opcode major-opcode +2 2+n requestlength +2 CARD16 min-delay +2 CARD16 max-delay +4n LISTofBUFFER buffer-list + + +SetMultiBufferAttributes + +1 see major-opcode major-opcode +1 4 minor-opcode +2 3+n requestlength +4 WINDOW wid +4 BITMASK value-mask (has n bits set to 1) + #x00000001 update-hint +4n LISTofVALUE value-list +VALUEs +1 update-hint + 0 Frequent + 1 Intermittent + 2 Static + + +GetMultiBufferAttributes + +1 see major-opcode major-opcode +1 5 minor-opcode +2 2 request length +4 WINDOW wid +® +1 1 Reply +1 unused +2 CARD16 sequencenumber +4 n reply length +2 CARD16 displayed-buffer +1 update-action + 0 Undefined + 1 Background + 2 Untouched + 3 Copied +1 update-hint + 0 Frequent + 1 Intermittent + 2 Static +1 window-mode + 0 Mono + 1 Stereo +19 unused +4n LISTofBUFFER buffer list + + +SetBufferAttributes + +1 see major-opcode major-opcode +1 6 minor-opcode +2 3+n requestlength +4 BUFFER buffer +4 BITMASK value-mask (has n bits set to 1) + #x00000001 event-mask +4n LISTofVALUE value-list +VALUEs +4 SETofBUFFER_EVENT event-mask + +GetBufferAttributes + +1 see major-opcode major-opcode +1 7 minor-opcode +2 2 request length +4 BUFFER buffer +-> +1 1 Reply +1 unused +2 CARD16 sequencenumber +4 0 reply length +4 WINDOW wid +4 SETofBUFFER_EVENT event-mask +2 CARD16 index + 1 side + 0 Mono + 1 Left + 2 Right +13 unused + +GetBufferInfo + +1 see major-opcode major-opcode +1 8 minor-opcode +2 2 request length +4 WINDOW root +® +1 1 Reply +1 unused +2 CARD16 sequencenumber +4 2(n+m) replylength +2 n number BUFFER_INFO in normal-info +2 m number BUFFER_INFO in stereo-info +20 unused +8n LISTofBUFFER_INFO normal-info +8m LISTofBUFFER_INFO stereo-info + +CreateStereoWindow + +1 see major-opcode major-opcode +1 9 minor-opcode +2 11+n requestlength +3 unused +1 CARD8 depth +4 WINDOW wid +4 WINDOW parent +4 BUFFER left +4 BUFFER right +2 INT16 x +2 INT16 y +2 CARD16 width +2 CARD16 height +2 CARD16 border-width +2 class + 0 CopyFromParent + 1 InputOutput + 2 InputOnly +4 VISUALID visual + 0 CopyFromParent +4 BITMASK value-mask (has n bits set to 1) + encodings are the same + as for CreateWindow +4n LISTofVALUE value-list + encodings are the same + as for CreateWindow + + +ClearImageBufferArea + +1 see major-opcode major-opcode +1 10 minor-opcode +2 5 request length +4 WINDOW buffer +2 INT16 x +2 INT16 y +2 CARD16 width +2 CARD16 height +3 unused +1 BOOL exposures + + + + + diff --git a/miniconda3/share/doc/xextproto/security.xml b/miniconda3/share/doc/xextproto/security.xml new file mode 100644 index 0000000000000000000000000000000000000000..35f3395e4e20fea4f9a3d4445e128b8bab522f04 --- /dev/null +++ b/miniconda3/share/doc/xextproto/security.xml @@ -0,0 +1,1467 @@ + + %defs; +]> + + + + + + Security Extension Specification + X Consortium Standard + + + DavidP.Wiggins + X Consortium + + + X Version 11, Release &fullrelvers; + Version 7.1 + 1996X Consortium + + + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the “Software”), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +Except as contained in this notice, the name of the X Consortium shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from the X Consortium. + +X Window System is a trademark of The OpenGroup. + + +November 15, 1996 + + + + +Introduction + + +The Security extension contains new protocol needed to provide enhanced X +server security. The Security extension should not be exposed to untrusted +clients (defined below). + + + + + +Requests + + +SecurityQueryVersion + +This request returns the major and minor version numbers of this extension. + + +SecurityQueryVersion + + + + + + + + + + client-major-version + + + CARD16 + + + + + client-minor-version + + + CARD16 + + + + + => + + + + + server-major-version + + + CARD16 + + + + + server-minor-version + + + CARD16 + + + + + + + +The client-major-version and client-minor-version numbers indicate what +version of the protocol the client wants the server to implement. The +server-major-version and the server-minor-version numbers returned +indicate the protocol this extension actually supports. This might not +equal the version sent by the client. An implementation can (but need not) +support more than one version simultaneously. The server-major-version +and server-minor-version allow the creation of future revisions of the +Security protocol that may be necessary. In general, the major version +would increment for incompatible changes, and the minor version would +increment for small, upward-compatible changes. Servers that support +the protocol defined in this document will return a server-major-version +of one (1), and a server-minor-version of zero (0). + + + +Clients using the Security extension must issue a SecurityQueryVersion +request before any other Security request in order to negotiate a compatible +protocol version; otherwise, the client will get undefined behavior +(Security may or may not work). + + + + +SecurityGenerateAuthorization + + +This request causes the server to create and return a new authorization with +specific characteristics. Clients can subsequently connect using the new +authorization and will inherit some of the characteristics of the +authorization. + + + +SecurityGenerateAuthorization + + + + + + + + + + authorization-protocol-name + + + STRING8 + + + + + authorization-protocol-data + + + STRING8 + + + + + value-mask + + + BITMASK + + + + + value-list + + + LISTofVALUE + + + + + => + + + + + + + authorization-id + + + AUTHID + + + + + authorization-data-return + + + STRING8 + + + + + + + +Errors: AuthorizationProtocol, Value, Alloc + + + +authorization-protocol-name is the name of the authorization method for +which the server should generate a new authorization that subsequent +clients can use to connect to the server. If the authorization-protocol-name +is not one that the server supports, or if authorization-protocol-data +does not make sense for the given authorization-protocol-name, an +AuthorizationProtocol error results. + + + +authorization-protocol-data is authorization-method specific data that can +be used in some way to generate the authorization. + + + +In this version of the extension, the only authorization method +required to be supported is "MIT-MAGIC-COOKIE-1" with any amount +of authorization-protocol-data (including none). The server may use the +authorization-protocol-data as an additional source of randomness used +to generate the authorization. Other authorization methods can supply +their own interpretation of authorization-protocol-data. + + + +The value-mask and value-list specify attributes of the authorization +that are to be explicitly initialized. The possible values are: + + + + + + + + + + + Attribute + Type + Default + + + + + + timeout + + + CARD32 + + + 60 + + + + + group + + + XID or None + + + None + + + + + trust-level + + + {SecurityClientTrusted, + + + + + + + + SecurityClientUntrusted} + + + SecurityClientUntrusted + + + + + event-mask + + + SecurityAuthorizationRevoked, + + + + + + + + or None + + + None + + + + + + + +timeout is the timeout period in seconds for this authorization. A +timeout value of zero means this authorization will never expire. For +non-zero timeout values, when timeout seconds have elapsed since the +last time that the authorization entered the state of having no +connections authorized by it, and if no new connections used the +authorization during that time, the authorization is automatically purged. +(Note that when an authorization is created, it enters the state of having no +connections authorized by it.) Subsequent connection attempts using that +authorization will fail. This is to facilitate "fire and forget" launching of +applications. + + + +group is an application group ID as defined by the Application Group +extension, or None. Any other values will cause a Value error. When a +group is destroyed, all authorizations specifying that group are revoked +as described under the SecurityRevokeAuthorization request. The Application +Group extension attaches additional semantics to the group. + + + +trust-level tells whether clients using the authorization are trusted or +untrusted. If trust-level is not one of the constants SecurityClientTrusted +or SecurityClientUntrusted, a Value error results. + + + +event-mask defines which events the client is interested in for this +authorization. When the authorization expires or is revoked if event-mask +contains SecurityAuthorizationRevoked a SecurityAuthorizationRevoked event +is reported to the client. + + + +The SecurityAuthorizationRevoked event contains the following field: + + + + + + + + + + Field + Type + + + + + + authorization-id + + + AUTHID + + + + + + + +where authorization-id is the identification of the authorization that was +revoked. + + +If an invalid value-mask is specified, a Value error occurs. + + + +The returned authorization-id is a non-zero value that uniquely identifies +this authorization for use in other requests. The value space for type +AUTHID is not required to be disjoint from values spaces of other core +X types, e.g. resource ids, atoms, visual ids, and keysyms. Thus, a given +numeric value might be both a valid AUTHID and a valid atom, for example. + + + +authorization-data-return is the data that a client should use in some +authorization-method-specific way to make a connection with this +authorization. For "MIT-MAGIC-COOKIE-1," authorization-data-return should +be sent as the authorization-protocol-data in the connection setup message. +It is not required that other authorization methods use +authorization-data-return this way. + + + + + +SecurityRevokeAuthorization + + +This request deletes an authorization created by SecurityGenerateAuthorization. + + + +SecurityRevokeAuthorization + + + + + + + + + + + authorization-id + + + AUTHID + + + + + + + +Errors: Authorization + + + +If authorization-id does not name a valid authorization, an Authorization +error occurs. Otherwise, this request kills all clients currently connected +using the authorization specified by authorization-id. The authorization is +deleted from the server's database, so future attempts by clients to connect +with this authorization will fail. + + + + + + +Changes to Core Requests + + +A server supporting this extension modifies the handling of some core +requests in the following ways. + + +Resource ID Usage + + +If an untrusted client makes a request that specifies a resource ID that is +not owned by another untrusted client, a protocol error is sent to the +requesting client indicating that the specified resource does not exist. +The following exceptions apply. An untrusted client can: + + + + + +use the QueryTree, GetGeometry, and TranslateCoordinates requests +without restriction. + + + + +use colormap IDs that are returned in the default-colormap field of its +connection setup information in any colormap requests. + + + + specify a root window as: + + + +the drawable field of CreatePixmap, CreateGC, and QueryBestSize. + + + + the parent field of CreateWindow. + + + +the window field of CreateColormap, ListProperties, and GetWindowAttributes. + + + + the grab-window or confine-to fields of GrabPointer. + + + + the grab-window field of UngrabButton. + + + +the destination of SendEvent, but only if all of the following are true. +(These conditions cover all the events that the ICCCM specifies with +a root window destination.) + + + + The propagate field of SendEvent is False. + + + +The event-mask field of SendEvent is ColormapChange, +StructureNotify, or the logical OR of SubstructureRedirect with +SubstructureNotify. + + + + +The event type being sent is UnmapNotify, ConfigureRequest, or +ClientMessage. + + + + + + +the window field of ChangeWindowAttributes, but only if the value-mask +contains only event-mask and the corresponding value is StructureNotify, +PropertyChange, or the logical OR of both. + + + + + + + + +ISSUE: are root window exceptions needed for these? WarpPointer, ReparentWindow +(parent), CirculateWindow, QueryPointer (emacs does this), GetMotionEvents. + + + + + +Extension Security + + +This extension introduces the notion of secure and insecure extensions. A +secure extension is believed to be safe to use by untrusted clients; that +is, there are no significant security concerns known that an untrusted +client could use to destroy, modify, or steal data of trusted clients. This +belief may be founded on a careful analysis of the extension protocol, +its implementation, and measures taken to "harden" the extension to close +security weaknesses. All extensions not considered secure are called +insecure. The implementation details of how an extension is identified as +secure or insecure are beyond the scope of this specification. + + + +ListExtensions will only return names of secure +extensions to untrusted clients. + + + +If an untrusted client uses QueryExtension on an +insecure extension that the server supports, the reply will have the +present field set to False and the major-opcode field set to zero to +indicate that the extension is not supported. + + + +If an untrusted client successfully guesses the major opcode of an +insecure extension, attempts by it to execute requests with that major +opcode will fail with a Request error. + + + + + +Keyboard Security + + + +The protocol interpretation changes in this section are intended to prevent +untrusted applications from stealing keyboard input that was meant for +trusted clients and to prevent them from interfering with the use of the +keyboard. + + + +The behavior of some keyboard-related requests and events is modified when +the client is untrusted depending on certain server state at the time of +request execution or event generation. Specifically, if a hypothetical +keyboard event were generated given the current input focus, pointer +position, keyboard grab state, and window event selections, and if that +keyboard event would not be delivered to any untrusted client, the +following changes apply: + + + + + +The bit vector representing the up/down state of the keys returned by +QueryKeymap and +KeymapNotify is all zeroes. + + + + GrabKeyboard returns a status of AlreadyGrabbed. + + + +SetInputFocus does nothing. Note that this means the +Globally Active +Input and WM_TAKE_FOCUS mechanisms specified in the ICCCM will +not work with untrusted clients. + + + + +Passive grabs established by GrabKey that would otherwise have activated +do not activate. + + + + + +If an untrusted client attempts to use any of the following requests, the +only effect is that the client receives an Access error: SetModifierMapping, +ChangeKeyboardMapping, ChangeKeyboardControl. + + + +If an InputOnly window owned by an untrusted client has a parent owned by a +trusted client, all attempts to map the window will be ignored. This includes +mapping attempts resulting from MapWindow, MapSubwindows, ReparentWindow, +and save-set processing. + + +However, if the parent of an InputOnly window owned by an untrusted client +is the root window, attempts to map that window will be performed as +expected. This is in line with the root window exceptions above. + + + + +Image Security + + +It should be impossible for an untrusted client to retrieve the image +contents of a trusted window unless a trusted client takes action to allow +this. We introduce the following defenses in support of this requirement. + + + +The restrictions on resource ID usage listed above prevent untrusted clients +from using GetImage directly on windows not belonging to trusted clients. + + + +If an untrusted client tries to set the background-pixmap attribute of an +untrusted window to None, the server will instead use a server-dependent +background which must be different than None. + + + +The X protocol description of GetImage states that the +returned contents of regions of a window obscured by noninferior windows are +undefined if the window has no backing store. Some implementations return the +contents of the obscuring windows in these regions. When an untrusted client +uses GetImage, this behavior is forbidden; the server must +fill the obscured regions in the returned image with a server-dependent pattern. + + + +If an untrusted window has trusted inferiors, their contents are vulnerable +to theft via GetImage on the untrusted parent, as well +as being vulnerable to destruction via drawing with subwindow-mode +IncludeInferiors on the untrusted parent. An untrusted window having trusted +inferiors can only occur at the request of a trusted client. It is expected +to be an unusual configuration. + + + + + +Property Security + + +Unlike the other security provisions described in this document, security for +property access is not amenable to a fixed policy because properties are +used for inter-client communication in diverse ways and may contain data of +varying degrees of sensitivity. Therefore, we only list the possible +restrictions the server may decide to impose on use of properties on trusted +windows by untrusted clients. How the server chooses which restrictions from +this list to apply to a particular property access is implementation dependent + +In the X Consortium server implementation, property access is controlled by +a configuration file; see the -sp option in the Xserver(1) manual page. + . + + +The X Protocol property requests are +ChangeProperty, +GetProperty, +DeleteProperty, +RotateProperties, and +ListProperties. For these requests, the server can +allow the request to execute normally (as if it had been issued by a +trusted client), ignore the request completely (as if it were a NoOperation), +or ignore the request except to send an Atom error to the client. Ignoring +a ListProperties request means replying that +the window has no properties. ListProperties may also +reply with a subset of the existing properties if the server is doing +property hiding; see below. An ignored GetProperty +request may reply that the property does not exist, or that it exists but +contains no data. + + + +The server may decide to hide certain properties on certain windows from +untrusted clients + +The X Consortium server implementation does not currently provide a way to +hide properties. + . +If a property is to be hidden, it must be done consistently to avoid +confusing clients. This means that for untrusted clients: + + + + + +That property should not be returned by +ListProperties. + + + + +PropertyNotify events should not be sent for that +property. + + + +GetProperty on that property should reply that the +property does not exist (the return type is None, the format and +bytes-after are zero, and the value is empty). + + + + + +For a property that the server is protecting but not hiding, consistency +must also be maintained: + + + + + +That property should be returned by ListProperties. + + + + +PropertyNotify events should be sent for that property. + + + + +GetProperty on that property should reply that the +property exists (if it really does) but the value is empty +(return type and format are their real values, and the "length of value" +field in the reply is zero). + + + + + + + +Miscellaneous Security + + +If an untrusted client attempts to use +ChangeHosts, +ListHosts, or +SetAccessControl, +the only effect is that the client receives an Access error. + + + +If an untrusted client attempts to use ConvertSelection +on a selection with a trusted selection owner window, the server generates +a SelectionNotify event to the requestor with property None. + + + + + +New Authorization Method + + +This extension includes a new authorization method named +"XC-QUERY-SECURITY-1". Its purpose is to allow an external agent such as +the X firewall proxy to probe an X server to determine whether that server +meets certain security criteria without requiring the agent to have its +own authorization for that server. The agent may use the returned information +to make a decision. For example, the X firewall proxy may choose not to +forward client connections to servers that do not meet the criteria. + + + +To use this authorization method, the client (or proxy) sends +"XC-QUERY-SECURITY-1" as the authorization-protocol-name in the initial +connection setup message. The authorization-protocol-data may be empty or +may contain additional security criteria described below. If the success +field of the server's reply is Authenticate, the server supports the +security extension, and the server meets all specified additional security +criteria. In this case, the client should resend the initial connection +setup message substituting the authorization protocol name and data +that should be used to authorize the connection. If the success field of the +server's reply is anything other than Authenticate, either the server does not +support the security extension, does not meet (or cannot determine if it +meets) all of the additional security criteria, or chooses for internal reasons +not to answer with Authenticate. In this case, the client should close the +connection. + + + +If the authorization-protocol-data sent with "XC-QUERY-SECURITY-1" is not +empty, it specifies additional security criteria for the server to check, as +follows. + + + +authorization-protocol-data + + + + + + + + + + + policy-mask + + + BITMASK + + + + + policies + + + LISTofSECURITYPOLICY + + + + + + + +The policy-mask field is any logical-OR combination of the constants +Extensions and SitePolicies. For each bit set in policy-mask, there is a +SECURITYPOLICY element in policies. The nth element in policies corresponds +to the nth 1-bit in policy-mask, counting upward from bit 0. + + +SECURITYPOLICY + + + + + + + + + + policy-type + + + {Disallow, Permit} + + + + + names + + + LISTofSTR + + + + + + + +For a SECURITYPOLICY corresponding to policy-mask Extensions, if +policy-type is Disallow the server is required to consider as insecure +all extensions given in names. No policy is specified for extensions +not listed in names. If policy-type is Permit the server may consider +only those extensions given in names to be secure; all other extensions +must be treated as insecure. If these constraints are not met, the server +should not return Authenticate in the success field of the reply. +Servers can but need not dynamically configure themselves in response +to an Extensions SECURITYPOLICY; a conforming server might simply compare +the policy with a compiled-in table of extensions and their security status. + + + +For a SECURITYPOLICY corresponding to policy-mask SitePolicies, policy-type +Disallow means the server must not have been configured with any of the site +policies given in names. Policy-type Permit means the server must have +been configured with at least one of the site policies given in names. If +these constraints are not met, the server should not return Authenticate in +the success field of the reply. + + + +SitePolicies provide a way to express new forms of security-relevant +information that could not be anticipated at the time of this writing. +For example, suppose the server is found to have a critical security defect. +When a fix is developed, a site policy string could be associated with the +fix. Servers with the fix would advertise that site policy, and the X +firewall proxy would specify that site policy in a SECURITYPOLICY with +policy-type Permit. + + + + + +Encoding + + +Please refer to the X11 Protocol Encoding document as this section +uses syntactic conventions and data types established there. + + + +The name of this extension is "SECURITY". + + + +Types + +AUTHID: CARD32 + + + + +Request Encoding + + +SecurityQueryVersion + + +1 CARD8 major-opcode +1 0 minor-opcode +2 2 request length +2 CARD16 client-major-version +2 CARD16 client-minor-version +=> +1 1 Reply +1 unused +2 CARD16 sequence number +4 0 reply length +2 CARD16 server-major-version +2 CARD16 server-minor-version +20 unused + + + +SecurityRevokeAuthorization + + + +1 CARD8 major-opcode +1 2 minor-opcode +2 2 request length +4 AUTHID authorization-id + + + +SecurityGenerateAuthorization + + + +1 CARD8 major-opcode +1 1 minor-opcode +2 3 + (m+n+3)/4 + s request length +2 CARD16 m, number of bytes in authorization protocol name +2 CARD16 n, number of bytes in authorization data +m STRING8 authorization protocol name +n STRING8 authorization protocol data +p unused, p=pad(m+n) +4 BITMASK value-mask (has s bits set to 1) + #x00000001 timeout + #x00000002 trust-level + #x00000004 group + #x00000008 event-mask +4s LISTofVALUE value-list + + + +VALUES + + +4 CARD32 timeout +4 trust-level + 0 SecurityClientTrusted + 1 SecurityClientUntrusted +4 XID group +0 None +4 CARD32 event-mask + #x00000001 SecurityAuthorizationRevoked +=> +1 1 Reply +1 unused +2 CARD16 sequence number +4 (q+3)/4 reply length +4 AUTHID authorization-id +2 CARD16 data-length +18 unused +q STRING8 authorization-data-return +r unused, r=pad(q) + + + + + +Event Encoding + +SecurityAuthorizationRevoked + + + +1 0+extension event base code +1 unused +2 CARD16 sequence number +4 AUTHID authorization id +24 unused + + + + + +Authorization Method Encoding + + +For authorization-protocol-name "XC-QUERY-SECURITY-1", the +authorization-protocol-data is interpreted as follows: + + + +authorization-protocol-data + + +1 BITMASK policy-mask + #x00000001 Extensions + #x00000002 SitePolicies +m LISTofSECURITYPOLICY policies + + + +SECURITYPOLICY + + + +1 policy-type + 0 Permit + 1 Disallow +1 CARD8 number of STRs in names +n LISTofSTR names + + + +LISTofSTR has the same encoding as in the X protocol: each STR is a single +byte length, followed by that many characters, and there is no padding or +termination between STRs. + + + + + +C Language Binding + + +The header for this extension is <X11/extensions/security.h>. All +identifier names provided by this header begin with XSecurity. + + + +All functions that have return type Status will return nonzero for +success and zero for failure. + + + + + Status XSecurityQueryExtension + Display *dpy + int *major_version_return + int *minor_version_return + + + + + sets major_version_return and +minor_version_return to the major and minor Security protocol version +supported by the server. If the Security library is compatible with the +version returned by the server, it returns nonzero. If dpy does not support +the Security extension, or if there was an error during communication with +the server, or if the server and library protocol versions are incompatible, +it returns zero. No other XSecurity functions may be called before this +function. If a client violates this rule, the effects of all subsequent +XSecurity calls that it makes are undefined. + + + + + Xauth *XSecurityAllocXauth + void + + + +In order to provide for future evolution, Xauth structures are used to +pass and return authorization data, and the library provides ways to +allocate and deallocate them. + + + + must be used to allocate the +Xauth structure that is passed to +. + + + +For the purposes of the Security extension, the Xauth structure has +the following fields: + + + + + + + + + + + Type + Field name + Description + + + + + + unsigned short + + + name_length + + + number of bytes in name + + + + + char * + + + name + + + authorization protocol name + + + + + unsigned short + + + data_length + + + number of bytes in data + + + + + char * + + + data + + + authorization protocol data + + + + + + +The Xauth structure returned by this function is initialized as follows: +name_length and data_length are zero, and name and data are NULL. + + + + + void XSecurityFreeXauth + Xauth *auth + + + + + must be used to free Xauth +structures allocated by + or returned by +. It is the +caller's responsibility to fill in the name and data fields of Xauth structures +allocated with , so this function +will not attempt to free them. In contrast, all storage associated with +Xauth structures returned from + will be freed by this +function, including the name and data fields. + + + + + + Bool XSecurityRevokeAuthorization + Display *dpy + XSecurityAuthorization auth_id + + + + + deletes the authorization +specified by auth_id, which must be a value returned in the auth_id_return +parameter of . All +clients that connected with that authorization are be killed. Subsequently, +clients that attempt to connect using that authorization will be refused. + + + + + + Xauth *XSecurityGenerateAuthorization + Display *dpy + Xauth *auth_in + unsigned long valuemask + XSecurityAutorizationAttributes *attributes + XSecurityAutorization *auth_id_return + + + + + creates a new +authorization with the specified attributes. The auth_in argument must be +allocated by . The +name and name_length fields of auth_in should be initialized to the +authorization protocol name and its length in characters respectively. +If there is authorization data, the data and data_length fields of +auth_in should be initialized to the data and its length in characters +respectively. The library does not assume that name and data are +null-terminated strings. The auth_in argument must be freed with +. + + + +The XSecurityAuthorizationAttributes structure has the following fields: + + + + + + + + + + + Type + Field name + Mask + + + + + + unsigned int + + + trust_level + + + XSecurityTrustLevel + + + + + unsigned int + + + timeout + + + XSecurityTimeout + + + + + XID + + + group + + + XSecurityGroup + + + + + long + + + event_mask + + + XSecurityEventMask + + + + + + + +These correspond to the trust-level, timeout, group, and event-mask +described in the SecurityGenerateAuthorization protocol request. The +caller can fill in values for any subset of these attributes. The valuemask +argument must be the bitwise OR of the symbols listed in the Mask column +for all supplied attributes. The event_mask attribute can be None, +XSecurityAuthorizationRevokedMask, or XSecurityAllEventMasks. In this +revision of the protocol specification XSecurityAllEventMasks is equivalent +to XSecurityAuthorizationRevokedMask. If the caller does not need to +specify any attributes, the attributes argument can be NULL, and the +valuemask argument must be zero. + + +If the function fails, NULL is returned and auth_id_return is filled in +with zero. Otherwise, a pointer to an Xauth structure is returned. The name +and name_length fields of the returned Xauth structure will be copies of the +name that was passed in, and the data and data_length fields will be set to +the authorization data returned by the server. The caller should not assume +that name and data are null-terminated strings. If no authorization data was +returned by the server, the data and data_length fields will be set to NULL +and zero respectively. The returned Xauth structure must be freed with +; the caller should not use any other +means free the structure or any of its components. The auth_id_return +argument will be filled in with the non-zero authorization id of the created +authorization. + + + +The XSecurityAuthorizationRevokedEvent structure has the following fields: + + + + + + + + + + + Type + Field name + Description + + + + + + int + + + type + + + event base + XSecurityAuthorizationRevoked + + + + + unsigned long + + + serial + + + # of last request processed by server + + + + + Bool + + + send_event + + + true if this came from SendEvent + + + + + Display* + + + display + + + Display the event was read from + + + + + XSecurityAuthorization + + + auth_id + + + revoked authorization id + + + + + + + diff --git a/miniconda3/share/doc/xextproto/shape.xml b/miniconda3/share/doc/xextproto/shape.xml new file mode 100644 index 0000000000000000000000000000000000000000..16751ffdbc8898e6d11f47c1741b5371f38b2107 --- /dev/null +++ b/miniconda3/share/doc/xextproto/shape.xml @@ -0,0 +1,1244 @@ + + %defs; +]> + + + + + + + X Nonrectangular Window Shape Extension Protocol + X.Org Standard + + + KeithPackard + MIT X Consortium + Intel Corporation + + + HidekiHiura + SunSoft, Inc. + + + X Version 11, Release &fullrelvers; + Version 1.1 + 19892004The Open Group + 2006Keith Packard + + + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +Except as contained in this notice, the name of the copyright holders +shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from the +copyright holders. + + + + + +Overview + + +This extension provides arbitrary window and border shapes within the X11 +protocol. + + + +The restriction of rectangular windows within the X protocol is a significant +limitation in the implementation of many styles of user interface. For +example, many transient windows would like to display a "drop shadow'' to +give the illusion of 3 dimensions. As another example, some user interface +style guides call for buttons with rounded corners; the full simulation of a +nonrectangular shape, particularly with respect to event distribution and +cursor shape, is not possible within the core X protocol. As a final +example, round clocks and nonrectangular icons are desirable visual addition +to the desktop. + + + +This extension provides mechanisms for changing both the visible and interactive shape of a +window to arbitrary, possibly disjoint, nonrectangular forms. The intent +of the extension is to supplement the existing semantics, not replace them. +In particular, it is desirable for clients that are unaware of the +extension to still be able to cope reasonably with shaped windows. For +example, window managers should still be able to negotiate screen +real estate in rectangular pieces. Toward this end, any shape specified for +a window is clipped by the bounding rectangle for the window as specified by +the window's geometry in the core protocol. An expected convention would be +that client programs expand their shape to fill the area offered by the +window manager. + + + + +Description + +Each window (even with no shapes specified) is defined by three regions: the +bounding region, the clip +region and the input region. The +bounding region is the area of the +parent window that the window will occupy (including border). The clip region +is the subset of the bounding region that is available for subwindows and +graphics. The area between the bounding region and the clip region is defined +to be the border of the window. The input region is the subset of the +bounding region that can "contain" the pointer. + + + +A nonshaped window will have a bounding region that is a rectangle +spanning the window, including its border; the clip region will be a rectangle +filling the inside dimensions (not including the border); the input +region will match the bounding region. In this document, +these areas are referred to as the +default bounding region, the +default clip region and the +default input region. For a window with inside +size of width by +height and border width +bwidth, the default bounding, clip +and input regions are the rectangles (relative to the window origin): + + + +bounding.x = -bwidth +bounding.y = -bwidth +bounding.width = width + 2 * bwidth +bounding.height = height + 2 * bwidth + +clip.x = 0 +clip.y = 0 +clip.width = width +clip.height = height + +input.x = -bwidth +input.y = -bwidth +input.width = width + 2 * bwidth +input.height = height + 2 * bwidth + + + +This extension allows a client to modify any combination of the bounding, +clip or input regions by specifying new regions that combine with the default +regions. These new regions are called the +client bounding region, +the client clip region and the +client input region. They are specified +relative to the origin of +the window and are always defined by offsets relative to the window origin +(that is, region adjustments are not required when the window is moved). +Three mechanisms for specifying regions are provided: a list of rectangles, +a bitmap, and an existing bounding or clip region from a window. This is +modeled on the specification of regions in graphics contexts in the core +protocol and allows a variety of different uses of the extension. + + + +When using an existing window shape as an operand in specifying a new shape, +the client region is used, unless none has been set, in which case the +default region is used instead. + + + +The effective bounding region of a window +is defined to be the intersection of +the client bounding region with the default bounding region. Any portion of +the client bounding region that is not included in the default bounding +region will not be included in the effective bounding region on the screen. +This means that window managers (or other geometry managers) used to dealing +with rectangular client windows will be able to constrain the client to a +rectangular area of the screen. + + + +Construction of the effective bounding region is dynamic; the client bounding +region is not mutated to obtain the effective bounding region. If a client +bounding region is specified that extends beyond the current default bounding +region, and the window is later enlarged, the effective bounding region will +be enlarged to include more of the client bounding region. + + + +The effective clip region of a window is defined to be the intersection of the +client clip region with both the default clip region and the client bounding +region. Any portion of the client clip region that is not included in both +the default clip region and the client bounding region will not be included in +the effective clip region on the screen. + + + +Construction of the effective clip region is dynamic; the client clip region is +not mutated to obtain the effective clip region. If a client clip region is +specified that extends beyond the current default clip region and the +window or its bounding region is later enlarged, the effective clip region will +be enlarged to include more of the client clip region if it is included in +the effective bounding region. + + + +The border of a window is defined to be the difference between the effective +bounding region and the effective clip region. If this region is empty, no +border is displayed. If this region is nonempty, the border is filled +using the border-tile or border-pixel of the window as specified in the core +protocol. Note that a window with a nonzero border width will never be able +to draw beyond the default clip region of the window. Also note that a zero +border width does not prevent a window from having a border, since the clip +shape can still be made smaller than the bounding shape. + + + +All output to the window and visible regions of any subwindows will be +clipped to the effective clip region. The server must not retain window +contents beyond the effective bounding region with backing store. The window's +origin (for graphics operations, background tiling, and subwindow placement) +is not affected by the existence of a bounding region or clip region. + + + +The effective input region of a window is +defined to be the intersection of the +client input region with both the default input region and the client bounding +region. Any portion of the client input region that is not included in both +the default input region and the client bounding region will not be included in +the effective input region on the screen. + + + +Construction of the effective input region is dynamic; the client input region is +not mutated to obtain the effective input region. If a client input region is +specified that extends beyond the current default input region and the +window or its bounding region is later enlarged, the effective input region will +be enlarged to include more of the client input region if it is included in +the effective bounding region. + + + +Areas that are inside the default bounding region but outside the effective +bounding region are not part of the window; these areas of the screen will +be occupied by other windows. Input events that occur within the default +bounding region but outside the effective bounding region will be delivered as +if the window was not occluding the event position. Events that occur in +a nonrectangular border of a window will be delivered to that window, just +as for events that occur in a normal rectangular border. + + + +An +InputOnly +window can have its bounding or input region set, but it is a +Match +error to attempt to set a clip region on an +InputOnly +window or to specify its clip region as a source to a request +in this extension. + + + +The server must accept changes to the clip and input regions of a root window, but +the server is permitted to ignore requested changes to the bounding region +of a root window. If the server accepts bounding region changes, the contents +of the screen outside the bounding region are implementation dependent. + + + + +Types + + +The following types are used in the request and event definitions in +subsequent sections. + + + +SHAPE_KIND: +{ Bounding, +Clip, +Input } + + + +SHAPE_OP: +{ Set, +Union, +Intersect, +Subtract, +Invert } + + + +Set +indicates that the region specified as an explicit source in the request is +stored unaltered as the new destination client region. +Union +indicates that the source and destination regions are unioned together to +produce the new destination client region. +Intersect +indicates that the source and destination regions are intersected together to +produce the new destination client region. +Subtract +indicates that the source region is subtracted from the destination region to +produce the new destination region. +Invert +indicates that the destination region is subtracted from the source region to +produce the new destination region. + + + + +Requests + +ShapeQueryVersion + + + + => + + + +majorVersion: CARD16 + + +minorVersion: CARD16 + + + +This request can be used to ensure that the server version of the SHAPE +extension is usable by the client. This document defines major version one +(1), minor version one (1). + + + +ShapeRectangles + + + + + + + + + dest: WINDOW + + + destKind: SHAPE_KIND + + + op: SHAPE_OP + + + xOff, yOff: INT16 + + + rectangles: LISTofRECTANGLES + + + ordering: +{ UnSorted, +YSorted, +YXSorted, +YXBanded } + + + + +Errors: +Window, +Length, +Match, +Value + + + + + + + +This request specifies an array of rectangles, relative to the origin of the +window plus the specified offset (xOff and yOff) that together +define a region. This region is combined (as specified by the operator +op) with the existing client region (specified by destKind) of the +destination window, and the result is stored as the specified client region of +the destination window. Note that the list of rectangles can be empty, +specifying an empty region; this is not the same as passing +None to +ShapeMask, + + + +If known by the client, +ordering relations on the rectangles can be specified with the ordering +argument. +This may provide faster operation by the server. +The meanings of the ordering values are the same as in the core protocol +SetClipRectangles +request. +If an incorrect ordering is specified, +the server may generate a +Match +error, but it is not required to do so. +If no error is generated, +the graphics results are undefined. +Except for +UnSorted , +the rectangles should be nonintersecting, or the resulting region will +be undefined. +UnSorted +means that the rectangles are in arbitrary order. +YSorted +means that the rectangles are nondecreasing in their Y origin. +YXSorted +additionally constrains +YSorted +order in that all rectangles with an equal Y origin are +nondecreasing in their X origin. +YXBanded +additionally constrains +YXSorted +by requiring that, for every possible Y scanline, +all rectangles that include that scanline have identical Y origins and Y +extents. + + + +ShapeMask + + + + + + + + + +dest: WINDOW +destKind: SHAPE_KIND +op: SHAPE_OP +xOff, yOff: INT16 +source: PIXMAP or +None + + + + +Errors: +Window, +Pixmap, +Match, +Value + + + + + + + +The source in this request is a 1-bit deep pixmap, or +None . +If source is +None , +the specified client region is removed from the window, causing the effective +region to revert to the default region. The +ShapeNotify +event generated by this request and subsequent +ShapeQueryExtents +will report that a client shape has not been specified. +If a valid pixmap is specified, it is converted +to a region, with bits set to one included in the region and bits set to +zero excluded, and an offset from the window origin as specified by +xOff and yOff. The resulting region is then combined (as +specified by the operator op) with the existing client region +(indicated by destKind) of the destination window, and the result is +stored as the specified client region of the destination window. The source +pixmap and destination window must have been created on the same screen, +or else a +Match +error results. + + + +ShapeCombine + + + + + + + + + +dest: WINDOW + + + + +destKind: SHAPE_KIND + + + + +op: SHAPE_OP + + + + +xOff, yOff: INT16 + + + + +source: WINDOW + + + + +sourceKind: SHAPE_KIND + + + + +Errors: +Window, +Match, +Value + + + + + + + +The client region, indicated by sourceKind, of the source window is +offset from the window origin by xOff and yOff and combined with +the client region, indicated by destKind, of the destination window. +The result is stored as the specified client region of the destination +window. +The source and destination windows must be on the same screen, or else a +Match +error results. + + + +ShapeOffset + + + + + + + + + +dest: WINDOW + + + + +destKind: SHAPE_KIND + + + + +xOff, yOff: INT16 + + + + +Errors: +Window, +Match, +Value + + + + + + + +The client region, indicated by destKind, is moved relative to its +current position by the amounts xOff and yOff. + + + +ShapeQueryExtents + + + + + + + + + +dest: WINDOW + + + + + + + + => + + + + + + + + + +boundingShaped: BOOL + + + + +clipShaped: BOOL + + + + +xBoundingShape: INT16 + + + + +yBoundingShape: INT16 + + + + +widthBoundingShape: CARD16 + + + + +heightBoundingShape: CARD16 + + + + +xClipShape: INT16 + + + + +yClipShape: INT16 + + + + +widthClipShape: CARD16 + + + + +heightClipShape: CARD16 + + + + +Errors: +Window + + + + + + + +The boundingShaped and clipShaped results are +True +if the corresponding client regions have been specified, else they are +False . +The x, y, width, and height values define the extents of the client regions, +when a client region has not been specified, the extents of the +corresponding default region are reported. + + + +ShapeSelectInput + + + + + + + + + +window: WINDOW + + + + +enable: BOOL + + + + +Errors: +Window, +Value + + + + + + + +Specifying enable as +True +causes the server to send the requesting client a +ShapeNotify +event whenever the bounding, clip or input region of the specified window is +altered by any client. +Specifying enable as +False +causes the server to stop sending such events. + + + +ShapeInputSelected + + + + + + + + + +window: WINDOW + + + + +=> +enable: BOOL + + + + +Errors: +Window + + + + + + + +If enable is +True, then +ShapeNotify +events for the window are generated for this client. + + + +ShapeGetRectangles + + + + + + + + + +window: WINDOW + + + + +kind: SHAPE_KIND + + + + + => +rectangles: LISTofRECTANGLE + + + + +ordering: +{ UnSorted, +YSorted, +YXSorted, +YXBanded } + + + + +Errors: +Window, +Match + + + + + + + +A list of rectangles describing the region indicated by kind, and the +ordering of those rectangles, is returned. The meaning of the ordering +values is the same as in the +ShapeRectangles +request. + + + + +Events + +ShapeNotify + + + + + + + + + +window: WINDOW + + + + +kind: SHAPE_KIND + + + + +shaped: BOOL + + + + +x, y: INT16 + + + + +width, +height: CARD16 + + + + +time: TIMESTAMP + + + + + + + +Whenever the client bounding, clip or input shape of a window is modified, a +ShapeNotify +event is sent to each client that has used +ShapeSelectInput +to request it. + + + +Kind indicates which client region (bounding or clip) has been modified; +shaped is +True +when the window has a client shape of type kind, and is +False +when the window no longer has a client shape of this type. +The x, y, width, and height indicate the extents of the +current shape. When shaped is +False +these will indicate the extents of the default region. The timestamp +indicates the server time when the shape was changed. + + + + +Encoding + +Please refer to the X11 Protocol Encoding document as this document uses +conventions established there. + + + +The name of this extension is "SHAPE". + + + +New Types + + +SHAPE_KIND + 0 Bounding + 1 Clip + 2 Input + + + +SHAPE_OP + 0 Set + 1 Union + 2 Intersect + 3 Subtract + 4 Invert + + + + +Requests + +ShapeQueryVersion + 1 CARD8 opcode + 1 0 shape opcode + 2 1 request length + +=> + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 length + 2 CARD16 major version + 2 CARD16 minor version + 20 unused + + + +ShapeRectangles + 1 CARD8 opcode + 1 1 shape opcode + 2 4+2n request length + 1 SHAPE_OP operation + 1 SHAPE_KIND destination kind + 1 ordering + 0 UnSorted + 1 YSorted + 2 YXSorted + 3 YXBanded + 1 unused + 4 WINDOW destination window + 2 INT16 x offset + 2 INT16 y offset + 8n LISTofRECTANGLE rectangles + + + + +ShapeMask + 1 CARD8 opcode + 1 2 shape opcode + 2 5 request length + 1 SHAPE_OP operation + 1 SHAPE_KIND destination kind + 2 unused + 4 WINDOW destination window + 2 INT16 x offset + 2 INT16 y offset + 4 PIXMAP source bitmap + 0 None + + + + +ShapeCombine + 1 CARD8 opcode + 1 3 shape opcode + 2 5 request length + 1 SHAPE_OP operation + 1 SHAPE_KIND destination kind + 1 SHAPE_KIND source kind + 1 unused + 4 WINDOW destination window + 2 INT16 x offset + 2 INT16 y offset + 4 WINDOW source window + + + +ShapeOffset + 1 CARD8 opcode + 1 4 shape opcode + 2 4 request length + 1 SHAPE_KIND destination kind + 3 unused + 4 WINDOW destination window + 2 INT16 x offset + 2 INT16 y offset + + + +ShapeQueryExtents + 1 CARD8 opcode + 1 5 shape opcode + 2 2 request length + 4 WINDOW destination window + + => + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 1 BOOL bounding shaped + 1 BOOL clip shaped + 2 unused + 2 INT16 bounding shape extents x + 2 INT16 bounding shape extents y + 2 CARD16 bounding shape extents width + 2 CARD16 bounding shape extents height + 2 INT16 clip shape extents x + 2 INT16 clip shape extents y + 2 CARD16 clip shape extents width + 2 CARD16 clip shape extents height + 4 unused + + + +ShapeSelectInput + 1 CARD8 opcode + 1 6 shape opcode + 2 3 request length + 4 WINDOW destination window + 1 BOOL enable + 3 unused + + + +ShapeInputSelected + 1 CARD8 opcode + 1 7 shape opcode + 2 2 request length + 4 WINDOW destination window + => + 1 1 Reply + 1 BOOL enabled + 2 CARD16 sequence number + 4 0 reply length + 24 unused + + + +ShapeGetRectangles + 1 CARD8 opcode + 1 8 shape opcode + 2 3 request length + 4 WINDOW window + 1 SHAPE_KIND source kind + 3 unused + => + 1 1 Reply + 1 ordering + 0 UnSorted + 1 YSorted + 2 YXSorted + 3 YXBanded + 2 CARD16 sequence number + 4 2n reply length + 4 CARD32 nrects + 20 unused + 8n LISTofRECTANGLE rectangles + + + + +Events + +ShapeNotify + 1 CARD8 type (0 + extension event base) + 1 SHAPE_KIND shape kind + 2 CARD16 sequence number + 4 WINDOW affected window + 2 INT16 x value of extents + 2 INT16 y value of extents + 2 CARD16 width of extents + 2 CARD16 height of extents + 4 TIMESTAMP server time + 1 BOOL shaped + 11 unused + + + + + +Glossary + + bounding region + + +The area of the parent window that this window will occupy. This area is +divided into two parts: the border and the interior. + + + + + + clip region + + +The interior of the window, as a subset of the bounding region. This +region describes the area that will be painted with the window background +when the window is cleared, will contain all graphics output to the window, +and will clip any subwindows. + + + + + + input region + + +The subset of the bounding region which can ``contain'' the +pointer. + + + + + + default bounding region + + +The rectangular area, as described by the core protocol window size, that +covers the interior of the window and its border. + + + + + + default clip region + + +The rectangular area, as described by the core protocol window size, that +covers the interior of the window and excludes the border. + + + + + + default input region + + +The rectangular area, as described by the core protocol window size, that +covers the interior of the window and its border. + + + + + + client bounding region + + +The region associated with a window that is directly modified via this +extension when specified by + ShapeBounding . +This region is used in conjunction with the default bounding region +to produce the effective bounding region. + + + + + + client clip region + + +The region associated with a window that is directly modified via this +extension when specified by + ShapeClip . +This region is used in conjunction with the default clip region +and the client bounding region to produce the effective clip region. + + + + + + client input region + + +The region associated with a window that is directly modified via this +extension when specified by + ShapeInput . +This region is used in conjunction with the default input region +and the client bounding region to produce the effective input region. + + + + + + effective bounding region + + +The actual shape of the window on the screen, including border and interior +(but excluding the effects of overlapping windows). When a window has a client +bounding region, the effective bounding region is the intersection of the +default bounding region and the client bounding region. Otherwise, the +effective bounding region is the same as the default bounding region. + + + + + + effective clip region + + +The actual shape of the interior of the window on the screen (excluding the +effects of overlapping windows). When a window has a client clip region or +a client bounding region, the effective clip region is the intersection of +the default clip region, the client clip region (if any) and the client +bounding region (if any). Otherwise, the effective clip region is the +same as the default clip region. + + + + + + effective input region + + +The actual shape of the window on the screen (excluding the +effects of overlapping windows) which can ``contain'' the pointer. +When a window has a client input region or +a client bounding region, the effective input region is the intersection of +the default input region, the client input region (if any) and the client +bounding region (if any). Otherwise, the effective input region is the +same as the default input region. + + + + + + + diff --git a/miniconda3/share/doc/xextproto/shm.xml b/miniconda3/share/doc/xextproto/shm.xml new file mode 100644 index 0000000000000000000000000000000000000000..8e04e7d50fe7efb965daf247ea1c7d4843e0a1ca --- /dev/null +++ b/miniconda3/share/doc/xextproto/shm.xml @@ -0,0 +1,476 @@ + + %defs; +]> + + + + + + + MIT-SHM(The MIT Shared Memory Extension) + How the shared memory extension works + + + JonathanCorbet + + National Center for Atmospheric Research + Atmospheric Technology Division + + corbet@ncar.ucar.edu + + + KeithPackard + MIT X Consortium + + + X Version 11, Release &fullrelvers; + Version 1.0 + 1991X Consortium + + + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +Except as contained in this notice, the name of the X Consortium shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from the X Consortium. + +X Window System is a trademark of The OpenGroup. + + + + +This document briefly describes how to use the MIT-SHM shared memory +extension. I have tried to make it accurate, but it would not surprise me +if some errors remained. If you find anything wrong, do let me know and I +will incorporate the corrections. Meanwhile, please take this document "as +is" (eman improvement over what was there before, but certainly not the +definitive word.) + + + + + + +REQUIREMENTS + +The shared memory extension is provided only by some X servers. To find out +if your server supports the extension, use xdpyinfo(1). In particular, to +be able to use this extension, your system must provide the SYSV shared +memory primitives. There is not an mmap-based version of this extension. +To use shared memory on Sun systems, you must have built your kernel with +SYSV shared memory enabled -- which is not the default configuration. +Additionally, the shared memory maximum size will need to be increased on +both Sun and Digital systems; the defaults are far too small for any useful +work. + + + + +WHAT IS PROVIDED + + +The basic capability provided is that of shared memory XImages. This is +essentially a version of the ximage interface where the actual image data +is stored in a shared memory segment, and thus need not be moved through +the Xlib interprocess communication channel. For large images, use of this +facility can result in some real performance increases. + + + +Additionally, some implementations provided shared memory pixmaps. These +are 2 dimensional arrays of pixels in a format specified by the X server, +where the image data is stored in the shared memory segment. Through use of +shared memory pixmaps, it is possible to change the contents of these +pixmaps without using any Xlib routines at all. Shared memory pixmaps can +only be supported when the X server can use regular virtual memory for +pixmap data; if the pixmaps are stored in some magic graphics hardware, your +application will not be able to share them with the server. Xdpyinfo(1) +doesn't print this particular nugget of information. + + + + +HOW TO USE THE SHARED MEMORY EXTENSION + +Code which uses the shared memory extension must include a number of header +files: + + + +#include <X11/Xlib.h> /* of course */ +#include <sys/ipc.h> +#include <sys/shm.h> +#include <X11/extensions/XShm.h> + + + +Of course, if the system you are building on does not support shared +memory, the file XShm.h may not be present. You may want to make +liberal use of #ifdefs. + + + +Any code which uses the shared memory extension should first check to see +that the server provides the extension. You could always be running over +the net, or in some other environment where the extension will not work. +To perform this check, call either + + + + + Status XShmQueryExtension + Display *display + + + + +or + + + + + Status XShmQueryVersion + Display *display + int *major + int *minor + Bool *pixmaps + + + + +Where "display" is, of course, the display on which you are running. If +the shared memory extension may be used, the return value from either +function will be True; otherwise your program should operate using +conventional Xlib calls. When the extension is available, +\fCXShmQueryVersion\fP also returns "major" and "minor" which are the +version numbers of the extension implementation, and "pixmaps" which is +True iff shared memory pixmaps are supported. + + + + +USE OF SHARED MEMORY XIMAGES + +The basic sequence of operations for shared memory XImages is as follows: + + + + + +Create the shared memory XImage structure + + + + +Create a shared memory segment to store the image data + + + + +Inform the server about the shared memory segment + + + + +Use the shared memory XImage, much like a normal one. + + + + + +To create a shared memory XImage, use: + + + + + XImage *XShmCreateImage + Display *display + Visual *visual + unsigned int depth + int format + char *data + XShmSegmentInfo *shminfo + unsigned int width + unsigned int height + + + + +Most of the arguments are the same as for XCreateImage; I will not go +through them here. Note, however, that there are no "offset", "bitmap_pad", +or "bytes_per_line" arguments. These quantities will be defined by the +server itself, and your code needs to abide by them. Unless you have already +allocated the shared memory segment (see below), you should pass in NULL for +the "data" pointer. + + + +There is one additional argument: "shminfo", which is a pointer to a +structure of type XShmSegmentInfo. You must allocate one of these +structures such that it will have a lifetime at least as long as that of +the shared memory XImage. There is no need to initialize this structure +before the call to XShmCreateImage. + + + +The return value, if all goes well, will be an XImage structure, which you +can use for the subsequent steps. + + + +The next step is to create the shared memory segment. This is +best done after the creation of the XImage, since you need to make use of +the information in that XImage to know how much memory to allocate. To +create the segment, you need a call like: + + + + +shminfo.shmid = shmget (IPC_PRIVATE, + image->bytes_per_line * image->height, IPC_CREAT|0777); + + + +(assuming that you have called your shared memory XImage "image"). You +should, of course, follow the Rules and do error checking on all of these +system calls. Also, be sure to use the bytes_per_line field, not the width +you used to create the XImage as they may well be different. + + + +Note that the shared memory ID returned by the system is stored in the +shminfo structure. The server will need that ID to attach itself to the +segment. + + + +Also note that, on many systems for security reasons, the X server +will only accept to attach to the shared memory segment if it's +readable and writeable by "other". On systems where the X server is +able to determine the uid of the X client over a local transport, the +shared memory segment can be readable and writeable only by the uid of +the client. + + + +Next, attach this shared memory segment to your process: + + + +shminfo.shmaddr = image->data = shmat (shminfo.shmid, 0, 0); + + + +The address returned by shmat should be stored in *both* the XImage +structure and the shminfo structure. + + + +To finish filling in the shminfo structure, you need to decide how you want +the server to attach to the shared memory segment, and set the "readOnly" +field as follows. Normally, you would code: + + +shminfo.readOnly = False; + + + +If you set it to True, the server will not be able to write to this +segment, and thus XShmGetImage calls will fail. + + + +Finally, tell the server to attach to your shared memory segment with: + + + +Status XShmAttach (display, shminfo); + + + +If all goes well, you will get a non-zero status back, and your XImage is +ready for use. + + + +To write a shared memory XImage into an X drawable, use XShmPutImage: + + + + + Status XShmPutImage + Display *display + Drawable d + GC gc + XImage *image + int src_x + int src_y + int dest_x + int dest_y + unsigned int width + unsigned int height + bool send_event + + + + +The interface is identical to that of XPutImage, so I will spare my fingers +and not repeat that documentation here. There is one additional parameter, +however, called "send_event". If this parameter is passed as True, the +server will generate a "completion" event when the image write is complete; +thus your program can know when it is safe to begin manipulating the shared +memory segment again. + + + +The completion event has type XShmCompletionEvent, which is defined as the +following: + + + +typedef struct { + int type; /* of event */ + unsigned long serial; /* # of last request processed */ + Bool send_event; /* true if came from a SendEvent request */ + Display *display; /* Display the event was read from */ + Drawable drawable; /* drawable of request */ + int major_code; /* ShmReqCode */ + int minor_code; /* X_ShmPutImage */ + ShmSeg shmseg; /* the ShmSeg used in the request */ + unsigned long offset; /* the offset into ShmSeg used */ +} XShmCompletionEvent; + + + +The event type value that will be used can be determined at run time with a +line of the form: + + + +int CompletionType = XShmGetEventBase (display) + ShmCompletion; + + + +If you modify the shared memory segment before the arrival of the +completion event, the results you see on the screen may be inconsistent. + + + +To read image data into a shared memory XImage, use the following: + + + + + Status XShmGetImage + Display *display + Drawable d + XImage *image + int x + int y + unsigned long plane_mask + + + + +Where "display" is the display of interest, "d" is the source drawable, +"image" is the destination XImage, "x" and "y" are the offsets within +"d", and "plane_mask" defines which planes are to be read. + + + +To destroy a shared memory XImage, you should first instruct the server to +detach from it, then destroy the segment itself, as follows: + + + +XShmDetach (display, shminfo); +XDestroyImage (image); +shmdt (shminfo.shmaddr); +shmctl (shminfo.shmid, IPC_RMID, 0); + + + + + +USE OF SHARED MEMORY PIXMAPS + +Unlike X images, for which any image format is usable, the shared memory +extension supports only a single format (i.e. XYPixmap or ZPixmap) for the +data stored in a shared memory pixmap. This format is independent of the +depth of the image (for 1-bit pixmaps it doesn't really matter what this +format is) and independent of the screen. Use XShmPixmapFormat to get the +format for the server: + + + + + int XShmPixmapFormat + Display *display + + + + +If your application can deal with the server pixmap data format (including +bits-per-pixel et al.), create a shared memory segment and "shminfo" +structure in exactly the same way as is listed above for shared memory +XImages. While it is, not strictly necessary to create an XImage first, +doing so incurs little overhead and will give you an appropriate +bytes_per_line value to use. + + + +Once you have your shminfo structure filled in, simply call: + + + + + Pixmap XShmCreatePixmap + Display *display + Drawable d + char *data + XShmSegmentInfo *shminfo + unsigned int width + unsigned int height + unsigned int depth + + + + +The arguments are all the same as for XCreatePixmap, with two additions: +"data" and "shminfo". The second of the two is the same old shminfo +structure that has been used before. The first is the pointer to the shared +memory segment, and should be the same as the shminfo.shmaddr field. I am +not sure why this is a separate parameter. + + + +If everything works, you will get back a pixmap, which you can manipulate in +all of the usual ways, with the added bonus of being able to tweak its +contents directly through the shared memory segment. Shared memory pixmaps +are destroyed in the usual manner with XFreePixmap, though you should detach +and destroy the shared memory segment itself as shown above. + + + diff --git a/miniconda3/share/doc/xextproto/sync.xml b/miniconda3/share/doc/xextproto/sync.xml new file mode 100644 index 0000000000000000000000000000000000000000..afb07838c55ab1d0c76df0aa6b024f6235382941 --- /dev/null +++ b/miniconda3/share/doc/xextproto/sync.xml @@ -0,0 +1,1274 @@ + + %defs; +]> + + + + + + + + X Synchronization Extension Protocol + X Consortium Standard + + + TimGlauert + + Olivetti Research + MultiWorks + + + + Dave + Carver + + Digital Equipment Corporation + MIT/Project Athena + + + + Jim + Gettys + + Digital Equipment Corporation + Cambridge Research Laboratory + + + + David + P. + Wiggins + X Consortium, Inc. + + + James + Jones + NVIDIA Corporation + + + X Version 11, Release &fullrelvers; + Version 3.1 + 1991 + Olivetti Research Limited, Cambridge England + Digital Equipment Corporation, Maynard, Massachusetts + X Consortium + + 2010NVIDIA Corporation + + + +Permission to use, copy, modify, and distribute this documentation for any +purpose and without fee is hereby granted, provided that the above +copyright notice appear in all copies. Olivetti, Digital, MIT, the +X Consortium, and NVIDIA make no representations about the suitability for +any purpose of the information in this document. This documentation is +provided as is without express or implied warranty. + + + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files +(the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO +EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or other +dealings in this Software without prior written authorization from the X +Consortium. + + + + + +Synchronization Protocol + +The core X protocol makes no guarantees about the relative order of execution +of requests for different clients. This means that any synchronization between +clients must be done at the client level in an operating system-dependent and +network-dependent manner. Even if there was an accepted standard for such +synchronization, the use of a network introduces unpredictable delays between +the synchronization of the clients and the delivery of the resulting requests +to the X server. + + + +The core X protocol also makes no guarantees about the time at which requests +are executed, which means that all clients with real-time constraints must +implement their timing on the host computer. Any such timings are subject to +error introduced by delays within the operating system and network and are +inefficient because of the need for round-trip requests that keep the client +and server synchronized. + + + +The synchronization extension provides primitives that allow synchronization +between clients to take place entirely within the X server. This removes any +error introduced by the network and makes it possible to synchronize clients +on different hosts running different operating systems. This is important for +multimedia applications, where audio, video, and graphics data streams are +being synchronized. The extension also provides internal timers within the +X server to which client requests can be synchronized. This allows simple +animation applications to be implemented without any round-trip requests and +makes best use of buffering within the client, network, and server. + + + +Description + +The mechanism used by this extension for synchronization within the X +server is to block the processing of requests from a client until a +specific synchronization condition occurs. When the condition occurs, the +client is released and processing of requests continues. Multiple clients +may block on the same condition to give inter-client synchronization. +Alternatively, a single client may block on a condition such as an animation +frame marker. + + + +The extension adds Counter, Alarm, +and Fence to the set of resources managed by the +server. A counter has a 64-bit integer value that may be increased or +decreased by client requests or by the server internally. A client can block +by sending an Await request that waits until one of a set of synchronization +conditions, called TRIGGERs, becomes TRUE. Alarms generate events when +counter values go through a specified transition. A fence has two possible +states: triggered and not triggered. Client requests can put the fence in +either of these states. A client can block until one of a set of fences +becomes triggered by sending an AwaitFence request. Fences are bound to a +particular screen at creation time. + + + +The CreateCounter request allows a client to create a +Counter that can be changed by explicit +SetCounter and ChangeCounter +requests. These can be used to implement synchronization between different +clients. + + + +There are some counters, called System Counters, that +are changed by the server internally rather than by client requests. The +effect of any change to a system counter is not visible until the server +has finished processing the current request. In other words, system +counters are apparently updated in the gaps between the execution of +requests rather than during the actual execution of a request. The extension +provides a system counter that advances with the server time as defined by +the core protocol, and it may also provide counters that advance with the +real-world time or that change each time the CRT screen is refreshed. +Other extensions may provide their own extension-specific system counters. + + + +The extension provides an Alarm mechanism that allows +clients to receive an event on a regular basis when a particular counter +is changed. + + + +The CreateFence request allows a client to create a +Fence that can be triggered and reset using +TriggerFence and ResetFence +requests, respectively. CreateFence takes a drawable +argument that implies which screen the fence should be created on. The +TriggerFence request changes the fence's state only +after all previous rendering commands affecting objects owned by the given +fence's screen have completed. Note that while fence objects are bound +to a screen and the simple trigger operation provided by this extension +operates at screen granularity, other extensions may add more fine-grained +trigger operations based on any number of events. The screen binding +merely establishes an upper bound for the scope of fence operations. + + + + +Types + +Please refer to the X11 Protocol specification as this document uses +syntactic conventions established there and references types defined there. + + +The following new types are used by the extension. + + +INT64: 64-bit signed integer +COUNTER: XID +VALUETYPE: {Absolute,Relative}; +TESTTYPE: {PositiveTransition,NegativeTransition, + PositiveComparison,NegativeComparison} +TRIGGER: [ + counter:COUNTER, + value-type:VALUETYPE, + wait-value:INT64, + test-type:TESTTYPE + ] +WAITCONDITION: [ + trigger:TRIGGER, + event-threshold:INT64 + ] +SYSTEMCOUNTER: [ + name:STRING8, + counter:COUNTER, + resolution:INT64 + ] +ALARM: XID +ALARMSTATE: {Active,Inactive,Destroyed} +FENCE: XID + + + +The COUNTER type defines the client-side handle on a server +Counter. The value of a counter is an INT64. + + + +The TRIGGER type defines a test on a counter that is either TRUE or FALSE. The +value of the test is determined by the combination of a test value, the value +of the counter, and the specified test-type. + + + +The test value for a trigger is calculated using the value-type and +wait-value fields when the trigger is initialized. If the value-type field +is not one of the named VALUETYPE constants, the request that initialized the +trigger will return a Value error. If the value-type +field is Absolute, the test value is given by the +wait-value field. If the value-type field is Relative, +the test value is obtained by adding the wait-value field to the value of the +counter. If the resulting test value would lie outside the range for an +INT64, the request that initialized the trigger will return a +Value error. If counter is None +and the value-type is Relative, the request that +initialized the trigger will return a Match error. If +counter is not None and does not name a valid counter, a Counter error is +generated. + + + +If the test-type is PositiveTransition, the trigger is +initialized to FALSE, and it will become TRUE when the counter changes from +a value less than the test value to a value greater than or equal to the +test value. If the test-type is NegativeTransition, +the trigger is initialize to FALSE, and it will become TRUE when the counter +changes from a value greater than the test value to a value less than or +equal to the test value. If the test-type is +PositiveComparison, the trigger is TRUE if the +counter is greater than or equal to the test value and FALSE otherwise. If the +test-type is NegativeComparison, the trigger is TRUE +if the counter is less than or equal to the test value and FALSE otherwise. +If the test-type is not one of the named TESTTYPE constants, the request that +initialized the trigger will return a Value error. A trigger with a counter +value of None and a valid test-type is always TRUE. + + + +The WAITCONDITION type is simply a trigger with an associated event-threshold. +The event threshold is used by the Await request to +decide whether or not to generate an event to the client after the trigger has +become TRUE. By setting the event-threshold to an appropriate value, it is +possible to detect the situation where an Await request +was processed after the TRIGGER became TRUE, which usually indicates that +the server is not processing requests as fast as the client expects. + + + +The SYSTEMCOUNTER type provides the client with information about a +SystemCounter. The name field is the textual name of +the counter that identifies the counter to the client. The counter field +is the client-side handle that should be used in requests that require a +counter. The resolution field gives the approximate step size of the system +counter. This is a hint to the client +that the extension may not be able to resolve two wait conditions with test +values that differ by less than this step size. A microsecond clock, for +example, may advance in steps of 64 microseconds, so a counter based on this +clock would have a resolution of 64. + + + +The only system counter that is guaranteed to be present is called SERVERTIME, +which counts milliseconds from some arbitrary starting point. The least +significant 32 bits of this counter track the value of Time used by the +server in Events and Requests. Other system counters may be provided by +different implementations of the extension. The X Consortium will maintain a +registry of system counter names to avoid collisions in the name space. + + + +An ALARM is the client-side handle on an Alarm resource. + + + +The FENCE type defines the client-side handle on a server +Fence. A fence can only be in one of two states, +represented by a BOOL. If the value is TRUE, the fence is in the triggered +state. Otherwise, the fence is in the not triggered state. + + + + + +Errors + + + + Counter + + +This error is generated if the value for a COUNTER argument in a request +does not name a defined COUNTER. + + + + + Alarm + + +This error is generated if the value for an ALARM argument in a request +does not name a defined ALARM. + + + + + Fence + + +This error is generated if the value for a FENCE argument in a request +does not name a defined FENCE. + + + + + + + +Requests + + + + Initialize + + +version-major,version-minor: CARD8 +=> +version-major,version-minor: CARD8 + + + +This request must be executed before any other requests for this extension. If a +client violates this rule, the results of all SYNC requests that it issues are +undefined. The request takes the version number of the extension that the +client wishes to use and returns the actual version number being implemented +by the extension for this client. The extension may return different +version numbers to a client depending of the version number supplied by +that client. This request should be executed only once for each client +connection. + + +Given two different versions of the SYNC protocol, v1 and v2, v1 is +compatible with v2 if and only if v1.version_major = v2.version_major +and v1.version_minor <= v2.version_minor. Compatible means that the +functionality is fully supported in an identical fashion in the two versions. + + +This document describes major version 3, minor version 1 of the SYNC protocol. + + + + + ListSystemCounters + + +=> +system-counters: LISTofSYSTEMCOUNTER +Errors: Alloc + + +This request returns a list of all the system counters that are available at +the time the request is executed, which includes the system counters +that are maintained by other extensions. The list returned by this +request may change as counters are created and destroyed by other extensions. + + + + + CreateCounter + + +id: COUNTER +initial-value: INT64 +Errors: IDChoice,Alloc + + +This request creates a counter and assigns the specified id to it. The counter +value is initialized to the specified initial-value and there are no clients +waiting on the counter. + + + + + DestroyCounter + + +counter: COUNTER +Errors: Counter,Access + + +This request destroys the given counter and sets the counter fields for all +triggers that specify this counter to None. All clients +waiting on the counter are released and a CounterNotify +event with the destroyed field set to TRUE is sent to each waiting client, +regardless of the event-threshold. All alarms specifying the counter become +Inactive and an AlarmNotify +event with a state field of Inactive is generated. A +counter is destroyed automatically when the connection to the creating client +is closed down if the close-down mode is Destroy. An +Access error is generated if counter is a system +counter. A Counter error is generated if counter does +not name a valid counter. + + + + + QueryCounter + + +counter: COUNTER +=> +value: INT64 +Errors: Counter + + +This request returns the current value of the given counter or a generates +Counter error if counter does not name a valid counter. + + + + + Await + + +wait-list: LISTofWAITCONDITION +Errors: Counter,Alloc,Value + + +When this request is executed, the triggers in the wait-list are initialized +using the wait-value and value-type fields, as described in the definition of +TRIGGER above. The processing of further requests for the client is blocked +until one or more of the triggers becomes TRUE. This may happen immediately, +as a result of the initialization, or at some later time, as a result of +a subsequent SetCounter, +ChangeCounter or +DestroyCounter request. + + +A Value error is generated if wait-list is empty. + + +When the client becomes unblocked, each trigger is checked to determine +whether a CounterNotify event should be generated. +The difference between the counter and the test value is calculated by +subtracting the test value from the value of the counter. If the test-type +is PositiveTransition or +PositiveComparison, a +CounterNotify event is generated if the difference is +at least event-threshold. If the test-type is +NegativeTransition or +NegativeComparison, a +CounterNotify event is generated if the difference +is at most event-threshold. If the difference lies outside the range for an +INT64, an event is not generated. + + +This threshold check is made for each trigger in the list and a +CounterNotify event is generated for every trigger for +which the check succeeds. The check for +CounterNotify events is performed even if one of the +triggers is TRUE when the request is first executed. Note that a +CounterNotify event may be generated for a trigger +that is FALSE if there are multiple triggers in the request. A +CounterNotify event with the destroyed flag set to +TRUE is always generated if the counter for one of the triggers is +destroyed. + + + + + ChangeCounter + + +counter: COUNTER +amount: INT64 +Errors: Counter,Access,Value + + +This request changes the given counter by adding amount to the current +counter value. If the change to this counter satisfies a trigger for which a client +is waiting, that client is unblocked and one or more +CounterNotify events may be generated. If the change to +the counter satisfies the trigger for an alarm, an +AlarmNotify event is generated and the +alarm is updated. An Access error is generated if +counter is a system counter. A Counter error is +generated if counter does not name a valid counter. If the resulting value +for the counter would be outside the range for an INT64, a +Value error is generated and the counter is not changed. + + +It should be noted that all the clients whose triggers are satisfied by this +change are unblocked, so this request cannot be used to implement mutual +exclusion. + + + + + SetCounter + + +counter: COUNTER +value: INT64 +Errors: Counter,Access + + +This request sets the value of the given counter to value. The effect is +equivalent to executing the appropriate ChangeCounter request to change +the counter value to value. An Access error is generated if counter names a +system counter. A Counter error is generated if counter does not name a valid +counter. + + + + + CreateAlarm + + +id: ALARM +values-mask: CARD32 +values-list: LISTofVALUE +left">Errors: IDChoice,Counter,Match,Value,Alloc + + +This request creates an alarm and assigns the identifier id to it. The +values-mask and values-list specify the attributes that are to be explicitly +initialized. The attributes for an Alarm and their defaults are: + + + + + + + + + + + Attribute + Type + Default + + + + + trigger + TRIGGER + counter + None + + + + + value-type + Absolute + + + + + value + 0 + + + + + test-type + PositiveComparison + + + delta + INT64 + 1 + + + events + BOOL + TRUE + + + + + +The trigger is initialized as described in the definition of TRIGGER, with an +error being generated if necessary. + + +If the counter is None, the state of the alarm is set +to Inactive, else it is set to Active. + + +Whenever the trigger becomes TRUE, either as a result of this request or as the +result of a SetCounter, +ChangeCounter, DestroyCounter, or +ChangeAlarm request, an +AlarmNotify event is generated and the alarm is +updated. The alarm is updated by repeatedly adding delta to the value of the +trigger and reinitializing it until it becomes FALSE. If this update would +cause value to fall outside the range for an INT64, or if the counter +value is None, or if the delta is 0 and test-type +is PositiveComparison or +NegativeComparison, no change is made to value and +the alarm state is changed to Inactive before the +event is generated. No further events are generated by an +Inactive alarm until a ChangeAlarm +or DestroyAlarm request is executed. + + +If the test-type is PositiveComparison or +PositiveTransition and delta is less than zero, or +if the test-type is NegativeComparison or +NegativeTransition and delta is greater than zero, +a Match error is generated. + + +The events value enables or disables delivery of +AlarmNotify events +to the requesting client. The alarm keeps a separate event flag for +each client so that other clients may select to receive events from this +alarm. + + +An AlarmNotify event is always generated at some time +after the execution of a CreateAlarm request. This +will happen immediately if the trigger is TRUE, or it will happen later +when the trigger becomes TRUE or the Alarm is destroyed. + + + + + ChangeAlarm + + +id: ALARM +values-mask: CARD32 +values-list: LISTofVALUE +Errors: Alarm,Counter,Value,Match + + +This request changes the parameters of an Alarm. All of the parameters +specified for the CreateAlarm request may be changed +using this request. The trigger is reinitialized and an +AlarmNotify event is generated if appropriate, as +explained in the description of the CreateAlarm request. + + +Changes to the events flag affect the event delivery to the requesting +client only and may be used by a client to select or deselect event delivery +from an alarm created by another client. + + +The order in which attributes are verified and altered is server-dependent. +If an error is generated, a subset of the attributes may have been altered. + + + + + DestroyAlarm + + +alarm: ALARM +Errors: Alarm + + +This request destroys an alarm. An alarm is automatically destroyed when the +creating client is closed down if the close-down mode is +Destroy. When an alarm is destroyed, an +AlarmNotify event is generated with a state value of +Destroyed. + + + + + QueryAlarm + + +alarm: ALARM +=> +trigger: TRIGGER +delta: INT64 +events: ALARMEVENTMASK +state: ALARMSTATE +Errors: Alarm + + This request retrieves the current parameters for an Alarm. + + + + SetPriority + + +client-resource: XID +priority: INT32 +Errors: Match + + +This request changes the scheduling priority of the client that created +client-resource. If client-resource is None, then +the priority for the client making the request is changed. A +Match error is generated if client-resource is not +None and does not name an existing resource in the +server. For any two priority values, A and B, A is higher priority if +and only if A is greater than B. + + +The priority of a client is set to 0 when the initial client connection is + made. + + +The effect of different client priorities depends on the particular +implementation of the extension, and in some cases it may have no effect at +all. However, the intention is that higher priority clients will have +their requests executed before those of lower priority clients. + + +For most animation applications, it is desirable that animation clients be +given priority over nonrealtime clients. This improves the smoothness of the +animation on a loaded server. Because a server is free to implement very strict +priorities, processing requests for the highest priority client to the +exclusion of all others, it is important that a client that may potentially +monopolize the whole server, such as an animation that produces continuous +output as fast as it can with no rate control, is run at low rather than high +priority. + + + + + GetPriority + + +client-resource: XID +=> +priority: INT32 +Errors: Match + + +This request returns the scheduling priority of the client that created +client-resource. If client-resource is None, then the +priority for the client making the request is returned. A +Match error is generated if client-resource is +not None and does not name an existing resource in the +server. + + + + + CreateFence + + +drawable: DRAWABLE +id: FENCE +initially-triggered: BOOL +Errors: IDChoice,Alloc + + +This request creates a fence on the screen associated with drawable and +assigns the specified id to it. The fence is in the triggered state iff +initially-triggered is TRUE. There are no clients waiting on the fence. + + + + + TriggerFence + + +fence: FENCE +Errors: Fence + + +This request puts the given fence in the triggered state after all rendering +from previous requests that affects resources owned by the fence's screen has +completed. This includes requests from other clients if those requests have +been dispatched. This request has no visible effects if the fence was already +in the triggered state. A Fence error is generated if +fence does not name a valid fence. + + +Note that the given fence's state is not necessarily directly modified by this +request. The state change need only be queued to occur after the required +rendering has completed. Clients should take care to not assume the fence will +be in the triggered state in subsequent requests, such as those that operate +on the given fence immediately. AwaitFence should first +be issued if subsequent requests require the fence to be in the triggered +state. + + + + + ResetFence + + +fence: FENCE +Errors: Fence,Match + + +This request immediately puts the given fence in the not triggered state. +A Match error is generated if the fence is not in the +triggered state. A Fence error is generated if fence +does not name a valid fence. + + +See the warnings above regarding TriggerFence's delayed +effect. In particular, a TriggerFence request +immediately followed by a ResetFence request is likely +to result in a Match error. An +AwaitFence request should be issued between the two. + + + + + DestroyFence + + +fence: FENCE +Errors: Fence + + +This request destroys the given fence. All clients waiting on this fence are +released. A fence is destroyed automatically when the connection to the client +that created the fence is closed if the close-down mode is +DestroyAll. A Fence error is +generated if fence does not name a valid fence. + + + + + QueryFence + + +fence: FENCE +=> +triggered: BOOL +Errors: Fence + + +This request returns TRUE if the given fence is triggered, or FALSE if it +is not triggered. A Fence error is generated if +fence does not name a valid fence. + + + + + AwaitFence + + +fence-list: LISTofFENCE +Errors: Fence,Alloc + + +When this request is executed, the processing of further requests for the +client is blocked until one or more of the fences in fence-list reaches the +triggered state. If any of the fences are already in the triggered state, +request processing resumes immediately. A Fence error +is generated if any member of fence-list does not name a valid fence. + + + + + + + +Events + + + + CounterNotify + + +counter: COUNTER +wait-value: INT64 +counter-value: INT64 +time: TIME +count: CARD16 +destroyed: BOOL + + +CounterNotify events may be generated when a client +becomes unblocked after an Await request has been +processed. The wait-value is the value being waited for, and counter-value +is the actual value of the counter at the time the event was generated. +The destroyed flag is TRUE if this request was generated as the result of +the destruction of the counter and FALSE otherwise. The time is the server +time at which the event was generated. + + +When a client is unblocked, all the CounterNotify +events for the Await request are generated contiguously. If count is 0, +there are no more events to follow for this request. If count is n, +there are at least n more events to follow. + + + + + AlarmNotify + + +alarm: ALARM +counter-value: INT64 +alarm-value: INT64 +state: ALARMSTATE +time: TIME + + +An AlarmNotify event is generated when an alarm is +triggered. alarm-value is the test value of the trigger in the alarm when +it was triggered, counter-value is the value of the counter that triggered +the alarm, and time is the server time at which the event was generated. +The state is the new state of the alarm. If state is +Inactive, no more events will be generated by this +alarm until a ChangeAlarm request is executed, the alarm +is destroyed, or the counter for the alarm is destroyed. + + + + + + + + +Encoding + +Please refer to the X11 Protocol Encoding document as this section uses +syntactic conventions established there and references types defined there. + +The name of this extension is "SYNC". + + +Encoding New Types + +The following new types are used by the extension. + + + +ALARM: CARD32 +ALARMSTATE: + 0 Active + 1 Inactive + 2 Destroyed +COUNTER: CARD32 +INT64: 64-bit signed integer +SYSTEMCOUNTER: + 4 COUNTER counter + 8 INT64 resolution + 2 n length of name in bytes + n STRING8 name + p pad,p=pad(n+2) +TESTTYPE: + 0 PositiveTransition + 1 NegativeTransition + 2 PositiveComparison + 3 NegativeComparison +TRIGGER: + 4 COUNTER counter + 4 VALUETYPE wait-type + 8 INT64 wait-value + 4 TESTTYPE test-type VALUETYPE: + 0 Absolute + 1 Relative +WAITCONDITION: + 20 TRIGGER trigger + 8 INT64 event threshold +FENCE: CARD32 + + + +An INT64 is encoded in 8 bytes with the most significant 4 bytes +first followed by the least significant 4 bytes. Within these 4-byte +groups, the byte ordering determined during connection setup is used. + + + + +Encoding Errors + +Counter + 1 0 Error + 1 Base + 0 code + 2 CARD16 sequence number + 4 CARD32 bad counter + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused +Alarm + 1 0 Error + 1 Base + 1 code + 2 CARD16 sequence number + 4 CARD32 bad alarm + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused +Fence + 1 0 Error + 1 Base + 2 code + 2 CARD16 sequence number + 4 CARD32 bad fence + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + + + + + +Encoding Requests + + +Initialize + 1 CARD8 major opcode + 1 0 minor opcode + 2 2 request length + 1 CARD8 major version + 1 CARD8 minor version + 2 unused +=> + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 1 CARD8 major version + 1 CARD8 minor version + 2 unused + 20 unused + +ListSystemCounters + 1 CARD8 major opcode + 1 1 minor opcode + 2 1 request length +=> + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 4 INT32 list length + 20 unused + 4n list of SYSTEMCOUNTER system counters + +CreateCounter + 1 CARD8 major opcode + 1 2 minor opcode + 2 4 request length + 4 COUNTER id + 8 INT64 initial value + +DestroyCounter + 1 CARD8 major opcode + 1 6 minor opcodeA previous version of this document gave an incorrect minor opcode + 2 2 request length + 4 COUNTER counter +=> + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 8 INT64 counter value + 16 unused + +Await + 1 CARD8 major opcode + 1 7 minor opcodeA previous version of this document gave an incorrect minor opcode. + 2 1 + 7*n request length + 28n LISTofWAITCONDITION wait conditions + +ChangeCounter + 1 CARD8 major opcode + 1 4 minor opcodeA previous version of this document gave an incorrect minor opcode. + 2 4 request length + 4 COUNTER counter + 8 INT64 amount + +SetCounter + 1 CARD8 major opcode + 1 3 minor opcodeA previous version of this document gave an incorrect minor opcode. + 2 4 request length + 4 COUNTER counter + 8 INT64 value + +CreateAlarm + 1 CARD8 major opcode + 1 8 minor opcode + 2 3+n request length + 4 ALARM id + 4 BITMASK values mask + + #x00000001 counter + #x00000002 value-type + #x00000004 value + #x00000008 test-type + #x00000010 delta + #x00000020 events + + 4n LISTofVALUE values + +VALUES + 4 COUNTER counter + 4 VALUETYPE value-type + 8 INT64 value + 4 TESTTYPE test-type + 8 INT64 delta + 4 BOOL events + +ChangeAlarm + 1 CARD8 major opcode + 1 9 minor opcode + 2 3+n request length + 4 ALARM id + 4 BITMASK values mask + encodings as for CreateAlarm + 4n LISTofVALUE values + encodings as for CreateAlarm + +DestroyAlarm + 1 CARD8 major opcode + 1 11 minor opcodeA previous version of this document gave an incorrect minor opcode. + 2 2 request length + 4 ALARM alarm + +QueryAlarm + 1 CARD8 major opcode + 1 10 minor opcodeA previous version of this document gave an incorrect minor opcode. + 2 2 request length + 4 ALARM alarm +=> + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 2 reply length + 20 TRIGGER trigger + 8 INT64 delta + 1 BOOL events + 1 ALARMSTATE state + 2 unused + +SetPriority + 1 CARD8 major opcode + 1 12 minor opcode + 2 3 request length + 4 CARD32 id + 4 INT32 priority + +GetPriority + 1 CARD8 major opcode + 1 13 minor opcode + 2 1 request length + 4 CARD32 id +=> + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 4 INT32 priority + 20 unused + +CreateFence + 1 CARD8 major opcode + 1 14 minor opcode + 2 4 request length + 4 DRAWABLE drawable + 4 FENCE id + 1 BOOL initially triggered + 3 unused + +TriggerFence + 1 CARD8 major opcode + 1 15 minor opcode + 2 2 request length + 4 FENCE id + +ResetFence + 1 CARD8 major opcode + 1 16 minor opcode + 2 2 request length + 4 FENCE id + +DestroyFence + 1 CARD8 major opcode + 1 17 minor opcode + 2 2 request length + 4 FENCE id + +QueryFence + 1 CARD8 major opcode + 1 18 minor opcode + 2 2 request length + 4 FENCE id +=> + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 1 BOOL triggered + 23 unused + +AwaitFence + 1 CARD8 major opcode + 1 19 minor opcode + 2 1 + n request length + 4*n LISTofFENCE wait conditions + + + + + + +Encoding Events + + +CounterNotify + 1 Base + 0 code + 1 0 kind + 2 CARD16 sequence number + 4 COUNTER counter + 8 INT64 wait value + 8 INT64 counter value + 4 TIME timestamp + 2 CARD16 count + 1 BOOL destroyed + 1 unused + +AlarmNotify + 1 Base + 1 code + 1 1 kind + 2 CARD16 sequence number + 4 ALARM alarm + 8 INT64 counter value + 8 INT64 alarm value + 4 TIME timestamp + 1 ALARMSTATE state + 3 unused + + + + diff --git a/miniconda3/share/doc/xextproto/tog-cup.xml b/miniconda3/share/doc/xextproto/tog-cup.xml new file mode 100644 index 0000000000000000000000000000000000000000..c59e7687ee13e98bb5c0ba8bf61da33c0dacf088 --- /dev/null +++ b/miniconda3/share/doc/xextproto/tog-cup.xml @@ -0,0 +1,564 @@ + + %defs; +]> + + + + + + Colormap Utilization Policy and Extension + X Project Team Standard + X Version 11, Release &fullrelvers; + Version 1.0 + + + Kaleb + S. + Keithley + The Open Group + + + 1986-1997The Open Group + + + + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this +software and associated documentation files (the Software), to use the +Software +without restriction, including, without limitation, the rights to copy, +modify, merge, +publish, distribute and sublicense the Software, to make, have made, +license and +distribute derivative works thereof, and to permit persons to whom the +Software is +furnished to do so, subject to the following conditions: + + +The above copyright notice and the following permission notice shall be +included in all copies of the Software: + + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON- +INFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF, OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OF OTHER DEALINGS IN +THE SOFTWARE. + + +Except as contained in this notice, the name of The Open Group shall not be +used in +advertising or otherwise to promote the use or other dealings in this +Software without prior written authorization from The Open Group. + + +X Window System is a trademark of The Open Group. + + + + + + +Overview + +This extension has three purposes: a) to provide mechanism for a special +application (a colormap manager) to discover any special colormap +requirements, e.g. the colormap entries that are nominally reserved for +desktop colors in the MS-Windows environment and initialize the default +colormap so that it can be more easily shared; and b) to encourage colormap +sharing and reduce colormap flashing on low-end 8-bit frame buffers by +providing a policy for sharing; and c) when colormaps aren't shared, +define a behavior in the X server color allocation scheme to reduce +colormap flashing. + + + +To encourage colormap sharing and accommodate special colormap requirements +two new protocols are defined: the first provides a way to query the +server for a list of reserved colormap entries, and the second is a way +to initialize read-only (shareable) colormap entries at specific locations +in a colormap. + + + +To minimize colormap flashing when the root window's default visual is one +of GrayScale, PseudoColor, or DirectColor, and a private colormap for the +default visual is being used, a minor (but compatible) change to the +server implementation of the AllocColor and AllocNamedColor requests is +required. Where the core protocol says nothing about the pixel values +returned, when this extension is in effect, the AllocColor and AllocNamedColor +requests will first look for a matching color in the default colormap, and, +if a match is found and the same cell in the private colormap has not +already been allocated, the color will be allocated in the private colormap +at the same locaton as in the default colormap (instead of in the first +available location.) + + + + +Requests + +QueryVersion + + + + + + + + + +client_major_version: CARD16 + + + + +client_minor_version: CARD16 + + + + +=> + + + + +server_major_version: CARD16 + + + + +server_minor_version: CARD16 + + + + + + + +If supplied, the client_major_version and client_minor_version indicate +what version of the protocol the client wants the server to implement. +The server version numbers returned indicate the protocol this extension +actually supports. This might not equal the version sent by the client. +An implementation can (but need not) support more than one version +simultaneously. The server_major_version and the server_minor_version +are a mechanism to support future revisions of the TOG-CUP protocol that +may be necessary. In general, the major version would increment for +incompatible changes, and the minor version would increment for small +upward-compatible changes. Servers that support the protocol defined in +this document will return a server_major_version of one (1), and a +server_minor_version of zero (0). + + + +GetReservedColormapEntries + + + + + + + + + +screen: CARD32 + + + + +=> + + + + +entries: LISTofCOLORITEM + + + + + + + +This request returns a list of colormap entries (pixels) that are reserved +by the system, e.g. MS-Windows reserved desktop colors. This list will, at a +minimum, contain entries for the BlackPixel and WhitePixel of the specified +screen. The do-red, do-green, and do-blue elements of the COLORITEMs are +unused in this reply. + + + +Rationale: There are colormap entries (pixels) that, e.g., MS-Windows +desktop reserves as desktop colors, that should not be altered. If they +are altered then X programs will cause colormap flashing between X and +MS-Windows applications running/displaying on the same desktop. + + + +StoreColors + + + + + + + + + +cmap: COLORMAP + + + + +items: LISTofCOLORITEM + + + + +=> + + + + +items: LISTofCOLORITEM + + + + + + + +This request changes the colormap entries of the specified pixels. The +colormap entries are allocated as if by an AllocColor request. The do-red, +do-green, and do-blue elements of the COLORITEMs are unused in this request. +A boolean alloc-ok element (a bit) is returned indicating whether the +particular pixel was successfully allocated or not. If successfully +allocated the RGB and pixel are returned. + + + +A Value error is generated if a pixel is not a valid index into cmap. A +BadMatch error is generated if if cmap does not belong to a GrayScale, +PseudoColor, or DirectColor visual. + + + + + +Events and Errors + +No new events or errors are defined by this extension. + + + + +Changes to existing protocol. + +None. + + + + +Encoding + +The name of this extension is "TOG-CUP". + + + +The conventions used here are the same as those for the core X11 +Protocol Encoding. + + + +QueryVersion + 1 CARD8 opcode + 1 0 TOG-CUP opcode + 2 2 request length + 2 CARD16 client_major_version + 2 CARD16 client_minor_version +=> + 1 1 reply + 1 unused + 2 CARD16 sequence number + 4 0 length + 2 CARD16 server_major_version + 2 CARD16 server_minor_number + 20 unused + + + +GetReservedColormapEntries + 1 CARD8 opcode + 1 1 TOG-CUP opcode + 2 2 request length + 4 CARD32 screen +=> + 1 1 reply + 1 unused + 2 CARD16 sequence number + 4 3n length + 24 unused + 12n LISTofCOLORITEM items + + + +StoreColors + 1 CARD8 opcode + 1 2 TOG-CUP opcode + 2 2+3n request length + 4 COLORMAP cmap + 12n LISTofCOLORITEM items +=> + 1 1 reply + 1 unused + 2 CARD16 sequence number + 4 3n length + 24 unused + 12n LISTofCOLORITEM items + + + +(The definition of COLORITEM here is only for the purpose of defining the +additional alloc-ok member in the CUPStoreColors reply.) + + + + COLORITEM + 4 CARD32 pixel + 2 CARD16 red + 2 CARD16 green + 2 CARD16 blue + 1 alloc-ok + #x07 unused + #x08 alloc-ok (1 is True, 0 is False) + #xF0 unused + 1 unused + + + + +C Language Binding + + +The C functions provide direct access to the protocol and add no additional +semantics. For complete details on the effects of these functions, refer +to the appropriate protocol request, which can be derived by deleting XCup +at the start of the function. All functions that have return type Status +will return nonzero for success and zero for failure. + + + +The include file for this extension is +<X11/extensions/Xcup.h>. + + + + + Status XCupQueryVersion + Display* display + int* major_version_return + int* minor_version_return + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + major_version_return + + + +Returns the major version supported by the server. + + + + + + minor_version_return + + + +Returns the minor version supported by the server. + + + + + + + +XCupQueryVersions sets major_version_return and minor_version_return to +the major and minor TOG-CUP protocol version supported by the server. If +the TOG-CUP library is compatible with the version returned by the server, +it returns nonzero. If dpy does not support the TOG-CUP extension, or if +there was an error during communication with the server, or if the server +and library protocol versions are incompatible, it returns zero. No other +XCup functions may be called before this function. If a client violates +this rule, the effects of all subsequent XCup calls that it makes are +undefined. + + + +To get the list of reserved colormap entries, use +XCupGetReservedColormapEntries. + + + + + Status XCupGetReservedColormapEntries + Display* display + int screen + XColor** colors_out + int* ncolors + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + colors_out + + + +Returns the values reserved by the server. + + + + + + ncolors + + + +Returns the number of items in colors_out. + + + + + + +The XCupGetReservedColormapEntries function gets system specific colormap +entries. E.g. the MS-Windows desktop uses N colormap entries at the beginning +(0..N) and end (256-N..255) of the colormap. Use XFree to free colors_out. + + + +To allocate one or more read-only color cells with RGB values, use +XCupStoreColors. + + + + + Status XCupStoreColors + Display* display + Colormap colormap + XColor* colors_in_out + int ncolors + + + + + + + display + + + +Specifies the connection to the X server. + + + + + + colormap + + + +Specifies the colormap. + + + + + + colors_in_out + + + +Specifies and returns the values actually used in the colormap. + + + + + + ncolors + + + +Specifies the number of items in colors_in_out. + + + + + + +The XCupStoreColors function changes the colormap entries of the pixel +values specified in the pixel members of the XColor structures. The colormap +entries are allocated as if an AllocColor had been used instead, i.e. the +colors are read-only (shareable). XCupStoreColors returns the number of +colors that were successfully allocated in the colormap. + + + + + +Using the TOG-CUP extension and Colormap Utilization Policy + +The X server preallocates any hardware or desktop special colors in the +default colormap; e.g. UNIX X servers preallocate Black and White pixels. +PC X servers should also preallocate the MS-Windows desktop colors. (Note +to implementors: in the Sample Implementation special colors are allocated +in the default colormap in cfbCreateDefColormap for dumb memory framebuffers.) + + + +To minimize colormap flash an application which installs its own private +colormap should query the special colors by calling +XCupGetReservedColormapEntries, and can then store those entries (in the +proper location) in its private colormap using XCupStoreColors. + + + +Applications which allocate many colors in a screen's default colormap, e.g. +a color-cube or a gray-ramp, should allocate them with XCupStoreColors. By +using XCupStoreColors the colors will be allocated shareable (read-only) and +any other application which allocates the same color will share that color +cell. + + + + diff --git a/miniconda3/share/doc/xextproto/xtest.xml b/miniconda3/share/doc/xextproto/xtest.xml new file mode 100644 index 0000000000000000000000000000000000000000..4893b883d0404e6e99916236b13a3e4f03eb062a --- /dev/null +++ b/miniconda3/share/doc/xextproto/xtest.xml @@ -0,0 +1,723 @@ + + %defs; +]> + + + + + XTEST Extension Protocol + X Consortium Standard + + + KieronDrake + UniSoft Ltd. + + + X Version 11, Release &fullrelvers; + Version 2.2 + 1992UniSoft Group Ltd. + 19921994X Consortium + + + +Permission to use, copy, modify, and distribute this documentation for any +purpose and without fee is hereby granted, provided that the above copyright +notice and this permission notice appear in all copies. UniSoft makes no +representations about the suitability for any purpose of the information in +this document. This documentation is provided "as is" without express or +implied warranty. + + + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + + + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + + + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +Except as contained in this notice, the name of the X Consortium shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from the X Consortium. + + + + + + +Overview + +This extension is a minimal set of client and server extensions +required to completely test the X11 server with no user intervention. + + + +This extension is not intended to support general journaling and +playback of user actions. This is a difficult area [XTrap, 89] as it attempts +to synchronize synthetic user interactions with their effects; it is at the +higher level of dialogue recording/playback rather than at the strictly lexical +level. We are interested only in the latter, simpler, case. A more detailed +discussion and justification of the extension functionality is given in +[Drake, 91]. + + + +We are aiming only to provide a minimum set of facilities that +solve immediate testing and validation problems. The testing extension +itself needs testing, where possible, and so should be as simple as possible. + + + +We have also tried to: + + + + + +Confine the extension to an appropriate high level within the server +to minimize portability problems. In practice this means that the extension +should be at the DIX level or use the DIX/DDX interface, or both. This +has effects, in particular, on the level at which "input synthesis" +can occur. + + + + +Minimize the changes required in the rest of the server. + + + + +Minimize performance penalties on normal server operation. + + + + + + +Description + +The functions provided by this extension fall into two groups: + + + + + Client Operations + + +These routines manipulate otherwise hidden client-side behavior. The +actual implementation will depend on the details of the actual language +binding and what degree of request buffering, GContext caching, and so on, is +provided. +In the C binding, defined in "XTEST Extension Library", routines are +provided to access the internals of two opaque data structures +-- GCs +and +Visuals -- +and to discard any requests pending within the +output buffer of a connection. The exact details can be expected to differ for +other language bindings. + + + + + Server Requests + + +The first of these requests is similar to that provided in most +extensions: it allows a client to specify a major and minor version +number to the server and for the server to respond with major and minor +versions of its own. The remaining two requests allow the following: + + + + + +Access to an otherwise "write-only" server resource: the cursor +associated with a given window + + + + +Perhaps most importantly, limited synthesis of input device events, +almost as if a cooperative user had moved the pointing device +or pressed a key or button. + + + + + + + + + + +Types + +The following types are used in the request and event definitions in +subsequent sections: + + + + + + + + + +FAKE_EVENT_TYPE +{ KeyPress, +KeyRelease, +MotionNotify, +ButtonPress, +ButtonRelease } + + + + + + + FAKE_EVENT + [type: FAKE_EVENT_TYPE, + + + + detail: BYTE, + + + + time: TIME, + + + + root: WINDOW, + + + + rootX, rootY: INT16] + + + + + + +CURSOR { CurrentCursor, None } +or a cursor as defined by the X11 Protocol. + + + + + +Client Operations + + +These are abstract definitions of functionality. They refer to client-side +objects such as "GC" and "VISUAL" that are quoted to +denote their abstract nature. Concrete versions of these functions are +defined only for particular language bindings. In some circumstances +a particular language binding may not implement the relevant abstract +type or may provide it as a transparent, rather than opaque, type, with +the result that the corresponding function does not make sense or is +not required, respectively. + + + +XTestSetGContextOfGC + + + + + + + + +gc: "GC" + + + + +gid: GCONTEXT + + + + + + + +Sets the GCONTEXT within the "GC" gc to have +the value specified by gid. + + + +XTestSetVisualIDOfVisual + + + + + + + + +visual: "VISUAL" + + + + +visualid: VISUALID + + + + + + + +Sets the VISUALID within the "VISUAL" visual to have +the value specified by visualid. + + + +XTestDiscard + + + + + + + + +dpy: "CONNECTION" + + + + +=> + + + + +status: BOOL + + + + + + + +Discards any requests that are present in the request buffer associated with +the "CONNECTION" dpy. +The status returned is +True +if there were one or more requests +in the buffer and +False +otherwise. + + + + +Server Requests + +XTestGetVersion + + + + + + + + +clientMajorVersion: CARD16 + + + + +clientMinorVersion: CARD16 + + + + + => + + + + +serverMajorVersion: CARD16 + + + + +serverMinorVersion: CARD16 + + + + +Errors: Length + + + + + + + + +This request can be used to ensure that the server version of the XTEST +extension is usable by the client. This document defines major version two +(2), minor version one (1). + + + +XTestCompareCursor + + + + + + + + +window: WINDOW + + + + +cursor-id: CURSOR or +CurrentCursor +or +None + + + + +=> + + + + +same: BOOL + + + + +Errors: +Window, +Length, +Cursor + + + + + + + +This request looks up the cursor associated with the window and +compares it with either the null cursor if cursor-id is +None , +or the current cursor (that is, the one being displayed), +or the cursor whose ID is cursor-id, and returns +the result of the comparison in same. + + + +XTestFakeInput + + + + + + + + +events: LISTofFAKE_EVENT + + + + +Errors: +Window, +Length, +Alloc, +Value + + + + + + + +This request simulates the limited set of core protocol +events within the set FAKE_EVENT_TYPE. Only the following event fields, +defined in FAKE_EVENT, are interpreted: + + + + + + type + + + +This must be one of +KeyPress, +KeyRelease, +MotionNotify, +ButtonPress, +or +ButtonRelease, +or else a +Value +error occurs. + + + + + + detail + + + +For key events, this field is interpreted as the physical keycode. +If the keycode is less than min-keycode or greater than max-keycode, +as returned in the connection setup, then a +Value +error occurs. +For button events, this field is interpreted as the physical (or core) button, +meaning it will be mapped to the corresponding logical button according to +the most recent +SetPointerMapping +request. +If the button number is less than one or greater than the number of physical +buttons, then a +Value +error occurs. +For motion events, if this field is +True , +then rootX and rootY +are relative distances from the current pointer location; if this field is +False, +then they are absolute positions. + + + + + + time + + + +This is either +CurrentTime +(meaning no delay) +or the delay in milliseconds that the server should wait before +simulating this event. No other requests from this client will be +processed until this delay, if any, has expired and subsequent processing +of the simulated event has been completed. + + + + + + root + + + +In the case of motion events this field is the ID of the root window on +which the new motion is to take place. If +None +is specified, the root window of the screen the pointer is currently on +is used instead. +If this field is not a valid window, then a +Window +error occurs. + + + + + + rootX & + rootY + + + +In the case of motion events these fields indicate relative distance or +absolute pointer coordinates, according to the setting of detail. +If the specified coordinates are off-screen, the closest on-screen +coordinates will be substituted. + + + + + + +When the simulated event(s) are processed, they cause event propagation, +passive grab activation, and so on, just as if the corresponding input device +action had occurred. However, motion events might not be recorded in the +motion history buffer. + + + +For the currently supported event types, the event list must have length one, +otherwise a +BadLength +error occurs. + + + +XTestGrabControl + + + + + + + + +impervious: BOOL + + + + + + + +If impervious is +True, +then the executing client becomes impervious to server grabs; +that is, it can continue executing requests even if another client +grabs the server. +If impervious is +False, +then the executing client returns to the normal state of being +susceptible to server grabs. + + + + +Encoding + +Please refer to the X11 Protocol Encoding document as this document uses +conventions established there. + + + +The name of this extension is "XTEST". + + + +New Types + +FAKE_EVENT_TYPE + 2 KeyPress + 3 KeyRelease + 4 ButtonPress + 5 ButtonRelease + 6 MotionNotify + + + +NOTE that the above values are defined to be the same as those for +the corresponding core protocol event types. + + + + +Requests + + +XTestGetVersion + 1 CARD8 opcode + 1 0 xtest opcode + 2 2 request length + 1 CARD8 client major version + 1 unused + 2 CARD16 client minor version +=> + 1 1 Reply + 1 CARD8 server major version + 2 CARD16 sequence number + 4 0 reply length + 2 CARD16 server minor version + 22 unused + + + +XTestCompareCursor + 1 CARD8 opcode + 1 1 xtest opcode + 2 3 request length + 4 WINDOW window + 4 CURSOR cursor-id + 0 None + 1 CurrentCursor +=> + 1 1 Reply + 1 BOOL cursors are the same + 2 CARD16 sequence number + 4 0 reply length + 24 unused + + + +XTestFakeInput + 1 CARD8 opcode + 1 2 xtest opcode + 2 1+(1*8) request length + 1 FAKE_EVENT_TYPE fake device event type + 1 BYTE detail: button or keycode + 2 unused + 4 TIME delay (milliseconds) + 0 CurrentTime + 4 WINDOW root window for MotionNotify + 0 None + 8 unused + 2 INT16 x position for MotionNotify + 2 INT16 y position for MotionNotify + 8 unused + + + +XTestGrabControl + 1 CARD8 opcode + 1 3 xtest opcode + 2 2 request length + 1 BOOL impervious + 3 unused + + + + + +References + +Annicchiarico, D., et al., +XTrap: The XTrap Architecture. +Digital Equipment Corporation, July 1991. + + + +Drake, K. J., +Some Proposals for a +Minimum X11 Testing Extension. +UniSoft Ltd., June 1991. + + + + diff --git a/miniconda3/share/doc/xorgproto/compositeproto.txt b/miniconda3/share/doc/xorgproto/compositeproto.txt new file mode 100644 index 0000000000000000000000000000000000000000..c1a78780fc2fa12dc9db6e6793eb074722ee90eb --- /dev/null +++ b/miniconda3/share/doc/xorgproto/compositeproto.txt @@ -0,0 +1,305 @@ + Composite Extension + Version 0.4 + 2007-7-3 + Keith Packard + keithp@keithp.com + Deron Johnson + deron.johnson@sun.com + +1. Introduction + +Many user interface operations would benefit from having pixel contents of +window hierarchies available without respect to sibling and antecedent +clipping. In addition, placing control over the composition of these pixel +contents into a final screen image in an external application will enable +a flexible system for dynamic application content presentation. + +2. Acknowledgements + +This small extension has been brewing for several years, contributors to +both early prototypes and the final design include: + + + Bill Haneman for motivating the ability to magnify occluded windows + with his work on accessibility + + + Carsten Haitzler for Enlightenment, the original eye-candy window + manager which demonstrated that clever hacks are an awfully + close substitute for changes in the underlying system. + + + Jim Gettys for key insights into the relationship between damage + events and per-window pixmap usage + + + Mike Harris and Owen Taylor for figuring out what to call it. + + + Deron Johnson for the Looking Glass implementation and + a prototype of the coordinate transformation mechanism. + + + Ryan Lortie for helping figure out reasonable parent clipping + semantics in the presence of manual redirected children. + +3. Architecture + +The composite extension provides three related mechanisms: + + 1. Per-hierarchy storage. The rendering of an entire hierarchy of windows + is redirected to off-screen storage. The pixels of that hierarchy + are available whenever it is viewable. Storage is automatically + reallocated when the top level window changes size. Contents beyond + the geometry of the top window are not preserved. + + 2. Automatic shadow update. When a hierarchy is rendered off-screen, + the X server provides an automatic mechanism for presenting those + contents within the parent window. The implementation is free to + make this update lag behind actual rendering operations by an + unspecified amount of time. This automatic update mechanism may + be disabled so that the parent window contents can be completely + determined by an external application. + + 3. External parent - child pointer coordinate transformation. + When a hierarchy is under manual compositing, the relationship + of coordinates within the parent to those in the child may + not be known within the X server. This mechanism provides + for redirection of these transformations through a client. + +Per-hierarchy storage may be created for individual windows or for all +children of a window. Manual shadow update may be selected by only a single +application for each window; manual update may also be selected on a +per-window basis or for each child of a window. Detecting when to update +may be done with the Damage extension. + +The off-screen storage includes the window contents, its borders and the +contents of all descendants. + +3.1 NameWindowPixmap + +Version 0.2 of the protocol introduces a mechanism for associating an XID +with the off-screen pixmap used to store these contents. This can be used +to hold onto window contents after the window is unmapped (and hence animate +it's disappearance), and also to access the border of the window, which is +not reachable through the Window ID itself. A new pixmap is created each +time the window is mapped or resized; as these events are nicely signalled +with existing events, no additional notification is needed. The old pixmap +will remain allocated as long as the Pixmap ID is left valid, it is +important that the client use the FreePixmap request when it is done with +the contents and to create a new name for the newly allocated pixmap. + +In automatic update mode, the X server is itself responsible for presenting +the child window contents within the parent. It seems reasonable, then, for +rendering to the parent window to be clipped so as not to interfere with any +child window content. In an environment with a mixture of manual and +automatic updating windows, rendering to the parent in the area nominally +occupied by a manual update window should be able to affect parent pixel +values in those areas, but such rendering should be clipped to automatic +update windows, and presumably to other manual update windows managed by +other applications. In any of these cases, it should be easy to ensure that +rendering has no effect on any non-redirected windows. + +Instead of attempting to define new clipping modes for rendering, the +Composite extension instead defines ClipByChildren rendering to the parent +to exclude regions occupied by redirected windows (either automatic or +manual). The CreateRegionFromBorderClip request can be used along with +IncludeInferiors clipping modes to restrict manual shadow updates to the +apporpriate region of the screen. Bracketing operations with +GrabServer/UngrabServer will permit atomic sequences that can update the +screen without artifact. As all of these operations are asynchronous, +network latency should not adversely affect update latency. + +3.2 Composite Overlay Window + +Version 0.3 of the protocol adds the Composite Overlay Window, which +provides compositing managers with a surface on which to draw without +interference. This window is always above normal windows and is always +below the screen saver window. It is an InputOutput window whose width +and height are the screen dimensions. Its visual is the root visual +and its border width is zero. Attempts to redirect it using the +composite extension are ignored. This window does not appear in the +reply of the QueryTree request. It is also an override redirect window. +These last two features make it invisible to window managers and other X11 +clients. The only way to access the XID of this window is via the +CompositeGetOverlayWindow request. Initially, the Composite Overlay +Window is unmapped. + +CompositeGetOverlayWindow returns the XID of the Composite Overlay +Window. If the window has not yet been mapped, it is mapped by this +request. When all clients who have called this request have terminated +their X11 connections the window is unmapped. + +Composite managers may render directly to the Composite Overlay +Window, or they may reparent other windows to be children of this +window and render to these. Multiple clients may render to the +Composite Overlay Window, create child windows of it, reshape it, and +redefine its input region, but the specific arbitration rules followed +by these clients is not defined by this specification; these policies +should be defined by the clients themselves. + +3.3 Clipping semantics redefined + +Version 0.4 of the protocol changes the semantics of clipping in the +presence of manual redirect children. In version 0.3, a parent was always +clipped to child windows, independent of the kind of redirection going on. +With version 0.4, the parent is no longer clipped to child windows which are +manually redirected. This means the parent can draw in the child region without using +IncludeInferiors mode, and (perhaps more importantly), it will receive +expose events in those regions caused by other actions. This new behaviour +is not selectable. + +4. Errors + +The composite extension does not define any new errors. + +5. Types + + UPDATETYPE { Automatic, Manual } + + CompositeCoordinate + child: Window + x, y: CARD16 + +7. Extension Initialization + +The client must negotiate the version of the extension before executing +extension requests. Otherwise, the server will return BadRequest for any +operations other than QueryVersion. + + QueryVersion + + client-major-version: CARD32 + client-minor-version: CARD32 + + -> + + major-version: CARD32 + minor-version: CARD32 + + The client sends the highest supported version to the server and + the server sends the highest version it supports, but no higher than + the requested version. Major versions changes can introduce + incompatibilities in existing functionality, minor version + changes introduce only backward compatible changes. It is + the client's responsibility to ensure that the server supports + a version which is compatible with its expectations. Servers + are encouraged to support multiple versions of the extension. + +8. Hierarchy Redirection + + RedirectWindow + + window: Window + update: UPDATETYPE + + errors: Window, Access, Match + + The hierarchy starting at 'window' is directed to off-screen + storage. 'update' specifies whether the contents are mirrored to + the parent window automatically or not. Only one client may specify + an update type of Manual, another attempt will result in an + Access error. When all clients enabling redirection terminate, + the redirection will automatically be disabled. + + The root window may not be redirected. Doing so results in a Match + error. + + RedirectSubwindows + + window: Window + update UPDATETYPE + + errors: Window, Access + + Hierarchies starting at all current and future children of window + will be redirected as in RedirectWindow. If update is Manual, + then painting of the window background during window manipulation + and ClearArea requests is inhibited. + + UnredirectWindow: + + window: Window + update: UPDATETYPE + + errors: Window, Value + + Redirection of the specified window will be terminated. If + the specified window was not selected for redirection by the + current client, or if the update type does not match the + current client's previously requested update type, a 'Value' + error results. + + UnredirectSubwindows: + + window: Window + update: UPDATETYPE + + errors: Window, Value + + Redirection of all children of window will be terminated. If + the specified window was not selected for sub-redirection by the + current client, or if the update type does not match the + current client's previously requested update type, a 'Value' + error results. + +9. Clip lists + + CreateRegionFromBorderClip + + region: Region + window: Window + + errors: Window, IDChoice + + This request creates a region containing the "usual" border clip + value; that is the area of the window clipped against siblings and + the parent. This region can be used to restrict rendering to + suitable areas while updating only a single window. The region + is copied at the moment the request is executed; future changes + to the window hierarchy will not be reflected in this region. + +10. Associating a Pixmap ID with the off-screen storage (0.2 and later) + + NameWindowPixmap + + window: Window + pixmap: Pixmap + + errors: Window, Match, IDChoice + + This request makes 'pixmap' a reference to the off-screen storage + for 'window'. This pixmap will remain allocated until freed, even + if 'window' is unmapped, reconfigured or destroyed. However, + 'window' will get a new pixmap allocated each time it is + mapped or resized, so this request will need to be reinvoked for + the client to continue to refer to the storage holding the current + window contents. Generates a 'Match' error if 'window' is not + redirected or is not visible. + +11. Composite Overlay Window (0.3 and later) + + CompositeGetOverlayWindow + + window: Window + + -> + + overlayWin: Window + + This request returns the XID of the Composite Overlay Window for + the screen specified by the argument 'window'. This request + indicates that the client wishes to use the Composite Overlay + Window of this screen. If this Composite Overlay Window has not + yet been mapped, it is mapped by this request. + + The Composite Overlay Window for a particular screen will be + unmapped when all clients who have invoked this request have + also invoked CompositeReleaseOverlayWindow for that screen. Also, + CompositeReleaseOverlayWindow for a screen will be implicitly + called when a client using the Composite Overlay Window on that + screen terminates its X11 connection. + + + CompositeReleaseOverlayWindow + + window: Window + + This request specifies that the client is no longer using the + Composite Overlay Window on the screen specified by the + argument 'window'. A screen's Composite Overlay Window is + unmapped when there are no longer any clients using it. diff --git a/miniconda3/share/doc/xorgproto/damageproto.txt b/miniconda3/share/doc/xorgproto/damageproto.txt new file mode 100644 index 0000000000000000000000000000000000000000..cea232252279de50fee1087b027539c562d14883 --- /dev/null +++ b/miniconda3/share/doc/xorgproto/damageproto.txt @@ -0,0 +1,222 @@ + The DAMAGE Extension + Protocol Version 1.1 + Document Revision 1 + 2007-01-08 + + Keith Packard + keithp@keithp.com + + Eric Anholt + eric@anholt.net + Open Source Technology Center + Intel Corporation +1. Introduction + +Monitoring the regions affected by rendering has wide-spread use, from +VNC-like systems scraping the screen to screen magnifying applications +designed to aid users with limited visual acuity. The DAMAGE extension is +designed to make such applications reasonably efficient in the face of +server-client latency. + +2. Acknowledgements + +As usual, the author had significant input from many people, in particular: + + + Havoc Pennington who designed and implemented a Damage extension + last year which was then lost to the mists of time. + + + Bill Haneman whose work on accessibility in the Gnome environment + is legendary. + + + Jim Gettys who found a way to avoid streaming damage rectangles + to the client in many cases. + + + Owen Taylor who suggested that streaming damage rectangles may + be warranted in some cases after all. + +3. Damage Model + +We call changes made to pixel contents of windows and pixmaps 'damage' +throughout this extension. Another notion of 'damage' are drawable regions +which are in need of redisplay to repair the effects of window manipulation +or other data loss. This extension doesn't deal with this second notion at +all; suggestions on a better term which isn't easily conflated with existing +notions are eagerly solicited. + +Damage accumulates as drawing occurs in the drawable. Each drawing operation +'damages' one or more rectangular areas within the drawable. The rectangles +are guaranteed to include the set of pixels modified by each operation, but +may include significantly more than just those pixels. The desire is for +the damage to strike a balance between the number of rectangles reported and +the extraneous area included. A reasonable goal is for each primitive +object drawn (line, string, rectangle) to be represented as a single +rectangle and for the damage area of the operation to be the union of these +rectangles. + +The DAMAGE extension allows applications to either receive the raw +rectangles as a stream of events, or to have them partially processed within +the X server to reduce the amount of data transmitted as well as reduce the +processing latency once the repaint operation has started. + +Damage to a window reflects both drawing within the window itself as well as +drawing within any inferior window that affects pixels seen by +IncludeInferiors rendering operations. To reduce the computational +complexity of this, the DAMAGE extension allows the server to monitor all +rendering operations within the physical target pixel storage that fall +within the bounds of the window. In a system with a single frame buffer +holding all windows, this means that damage will accumulate for all +rendering operations that lie within the visible part of the window. + +The precise reason for this architecture is to enable the Composite +extension which provides multiple pixel storage areas for the screen +contents. + +3.1 Additions in the 1.1 version of the protocol + +Damage is automatically computed by the X Server for X rendering operations, +but direct rendering extensions have allowed clients to perform rendering +outside of the control of the X Server. The 1.1 version of the protocol +added a request to allow direct rendering clients to report damage to a +drawable. Some direct rendering clients, due to architectural limitations, +always perform rendering to the root window, even in when it should be +performed to the backing pixmap in the Composite case. To provide +less-incorrect rendering in this cases, the direct rendering client should +translate its damage region to screen coordinates and report the damage against +the root window rather than the drawable. + +4. Data types + +The "Damage" object holds any accumulated damage region and reflects the +relationship between the drawable selected for damage notification and the +drawable for which damage is tracked. + +5. Errors + +Damage + A value for a DAMAGE argument does not name a defined DAMAGE. + +6. Types + + DAMAGE 32-bit value (top three bits guaranteed to be zero) + + DamageReportLevel { DamageReportRawRectangles, + DamageReportDeltaRectangles, + DamageReportBoundingBox, + DamageReportNonEmpty } + + DamageReportRawRectangles + + Delivers DamageNotify events each time the screen + is modified with rectangular bounds that circumscribe + the damaged area. No attempt to compress out overlapping + rectangles is made. + + DamageReportDeltaRectangles + + Delivers DamageNotify events each time damage occurs + which is not included in the damage region. The + reported rectangles include only the changes to that + area, not the raw damage data. + + DamageReportBoundingBox + + Delivers DamageNotify events each time the bounding + box enclosing the damage region increases in size. + The reported rectangle encloses the entire damage region, + not just the changes to that size. + + DamageReportNonEmpty + + Delivers a single DamageNotify event each time the + damage rectangle changes from empty to non-empty, and + also whenever the result of a DamageSubtract request + results in a non-empty region. + +7. Events + +DamageNotify + + level: DamageReportLevel + drawable: Drawable + damage: DAMAGE + more: Bool + timestamp: Timestamp + area: Rectangle + drawable-geometry: Rectangle + + 'more' indicates whether there are subsequent damage events + being delivered immediately as part of a larger damage region + +8. Extension Initialization + +The client must negotiate the version of the extension before executing +extension requests. Otherwise, the server will return BadRequest for any +operations other than QueryVersion. + +QueryVersion + + client-major-version: CARD32 + client-minor-version: CARD32 + + -> + + major-version: CARD32 + minor-version: CARD32 + + The client sends the highest supported version to the server and + the server sends the highest version it supports, but no higher than + the requested version. Major versions changes can introduce + incompatibilities in existing functionality, minor version + changes introduce only backward compatible changes. It is + the clients responsibility to ensure that the server supports + a version which is compatible with its expectations. Servers + are encouraged to support multiple versions of the extension. + +9. Enable Monitoring + +DamageCreate + + damage: DAMAGE + drawable: Drawable + level: DamageReportLevel + + Creates a damage object to monitor changes to Drawable + +DamageDestroy + damage: DAMAGE + + Destroys damage. + +DamageSubtract + + damage: DAMAGE + repair: Region or None + parts: Region or None + + Synchronously modifies the regions in the following manner: + + If repair is None: + + 1) if parts is not None, parts = damage + 2) damage = + + Otherwise: + + 1) tmp = damage INTERSECT repair + 2) damage = damage - tmp + 3) if parts is not None, parts = tmp + 4) Generate DamageNotify for remaining damage areas + +DamageAdd + + drawable: Drawable + region: Region + + Reports damage of the region within the given drawable. This may be + used by direct rendering clients to report damage that the server would + otherwise be unaware of. The damage region is relative to the origin + of the drawable. + + Damage posted in this way will appear in DamageNotify events as normal, + and also in server internal damage tracking (for shadow framebuffer + updates, pixmap damage, and other uses). diff --git a/miniconda3/share/doc/xorgproto/dri2proto.txt b/miniconda3/share/doc/xorgproto/dri2proto.txt new file mode 100644 index 0000000000000000000000000000000000000000..0e581714b02250ba3f5b9ecac760cc2b60bb0a47 --- /dev/null +++ b/miniconda3/share/doc/xorgproto/dri2proto.txt @@ -0,0 +1,909 @@ + The DRI2 Extension + Version 2.0 + 2008-09-04 + + Kristian Høgsberg + krh@redhat.com + Red Hat, Inc + + +1. Introduction + +The DRI2 extension is designed to associate and access auxiliary +rendering buffers with an X drawable. + +DRI2 is a essentially a helper extension to support implementation of +direct rendering drivers/libraries/technologies. + +The main consumer of this extension will be a direct rendering OpenGL +driver, but the DRI2 extension is not designed to be OpenGL specific. +Direct rendering implementations of OpenVG, Xv, cairo and other +graphics APIs should find the functionality exposed by this extension +helpful and hopefully sufficient. + +Relation to XF86DRI + + +1.1. Acknowledgements + +Kevin E. Martin +Keith Packard +Eric Anholt +Keith Whitwell +Jerome Glisse +Ian Romanick +Michel Dänzer +Jesse Barnes + + + ⚙ ⚙ ⚙ ⚙ ⚙ ⚙ + + +2. DRI2 Concepts + + +2.1. Attachment points + +Stolen from OpenGL FBOs, I guess. + + +2.2. Kernel rendering manager + +This specification assumes a rendering architecture, where an +underlying kernel rendering manager that can provide 32 bit integer +handles to video memory buffers. These handles can be passed between +processes, which, through a direct rendering driver, submit rendering +to the kernel rendering manager, targeting and/or sourcing from these +buffers. This extension provides a means to communicate about such +buffers as associated with an X drawable. + +The details of how the direct rendering driver use the buffer names +and submit the rendering requests is outside the scope of this +specification. However, Appendix B does discuss implementation of +this specification on the Graphics Execution Manager (GEM). + + +2.3. Request ordering + +No ordering between swap buffers and X rendering. X rendering to src +buffers will block if they have a vblank pending. + + +2.4 Authentication model + +The purpose of the DRM authentication scheme is to grant access to the +kernel rendering manager buffers created by the X server if, and only +if, the client has access to the X server. This is achieved in a +three-step protocol: + + 1) The client gets a token from the kernel rendering manager + that uniquely identifies it. The token is a 32 bit integer. + + 2) The client passes the token to the X server in the + DRI2Authenticate request. This request is a round trip to + make sure the X server has received and processed the + authentication before the client starts accessing the DRM. + + 3) The X server authorizes the client by passing the token to + the kernel rendering manager. + +A kernel rendering manager can choose not to implement any +authentication and just allow access to all buffers. + + +2.5 Rendering to the X front buffer + +OpenGL allows the client to render to the front buffer, either by +using a single-buffered configuration or but explicitly setting the +draw buffer to GL_FRONT_LEFT. Not allowed! + +The client must ask for a fake front buffer, render to that and then +use DRI2CopyRegion to copy contents back and forth between the fake +front buffer and the real front buffer. When X and direct rendering +to a front buffer is interleaved, it is the responsibility of the +application to synchronize access using glXWaitGL and glXWaitX. A +DRI2 implementation of direct rendering GLX, should use these entry +points to copy contents back and forth to as necessary to ensure +consistent rendering. + +The client may also use the DRI2SwapBuffers function to request a swap +of the front and back buffers. If the display server supports it, this +operation may be preferred, since it may be easier and/or more performant +for the server to perform a simple buffer swap rather than a blit. + +2.6 Synchronizing rendering + +DRI2 provides several methods for synchronizing drawing with various events. +The protocol for these methods is based on the SGI_video_sync and +OML_sync_control GLX extensions. Using the DRI2WaitMSC request, a client +can wait for a specific frame count or divisor/remainder before continuing +its processing. With the DRI2WaitSBC request, clients can block until a given +swap count is reached (as incremented by DRI2SwapBuffers). Finally, using +DRI2SwapBuffers, clients can limit their frame rate by specifying a swap +interval using the swap interval call (currently only available through GLX) +or by using the OML swap buffers routine. + +2.7 Events + +DRI2 provides an event to indicate when a DRI2SwapBuffers request has +been completed. This can be used to throttle drawing on the client +side and tie into application main loops. + +Another event is generated when the validity of the requested buffers +changes. + + ⚙ ⚙ ⚙ ⚙ ⚙ ⚙ + + +3. Data Types + +The server side region support specified in the Xfixes extension +version 2 is used in the CopyRegion request. + + + ⚙ ⚙ ⚙ ⚙ ⚙ ⚙ + + +4. Errors + +No errors are defined by the DRI2 extension. + + + ⚙ ⚙ ⚙ ⚙ ⚙ ⚙ + +5. Events + +The only events provided by DRI2 are DRI2_BufferSwapComplete +and DRI2InvalidateBuffers. + + + ⚙ ⚙ ⚙ ⚙ ⚙ ⚙ + + +6. Protocol Types + +DRI2DRIVER { DRI2DriverDRI + DRI2DriverVDPAU } + + These values describe the type of driver the client will want + to load. The server sends back the name of the driver to use + for the screen in question. + +DRI2ATTACHMENT { DRI2BufferFrontLeft + DRI2BufferBackLeft + DRI2BufferFrontRight + DRI2BufferBackRight + DRI2BufferDepth + DRI2BufferStencil + DRI2BufferAccum + DRI2BufferFakeFrontLeft + DRI2BufferFakeFrontRight + DRI2BufferDepthStencil + DRI2BufferHiz } + + These values describe various attachment points for DRI2 + buffers. + +DRI2BUFFER { attachment: CARD32 + name: CARD32 + pitch: CARD32 + cpp: CARD32 + flags: CARD32 } + + The DRI2BUFFER describes an auxiliary rendering buffer + associated with an X drawable. 'attachment' describes the + attachment point for the buffer, 'name' is the name of the + underlying kernel buffer, + + +DRI2ATTACH_FORMAT { attachment: CARD32 + format: CARD32 } + + The DRI2ATTACH_FORMAT describes an attachment and the associated + format. 'attachment' describes the attachment point for the buffer, + 'format' describes an opaque, device-dependent format for the buffer. + + ⚙ ⚙ ⚙ ⚙ ⚙ ⚙ + + +7. Extension Initialization + +The name of this extension is "DRI2". + +┌─── + DRI2QueryVersion + client-major-version: CARD32 + client-minor-version: CARD32 + ▶ + major-version: CARD32 + minor-version: CARD32 +└─── + + The client sends the highest supported version to the server + and the server sends the highest version it supports, but no + higher than the requested version. Major versions changes can + introduce incompatibilities in existing functionality, minor + version changes introduce only backward compatible changes. + It is the clients responsibility to ensure that the server + supports a version which is compatible with its expectations. + + Backwards compatible changes included addition of new + requests, but also new value types in the DRI2CopyRegion + request. When new values are introduced, the minor version + will be increased so the client can know which values the X + server understands from the version number. + + + ⚙ ⚙ ⚙ ⚙ ⚙ ⚙ + + +8. Extension Requests + +┌─── + DRI2Connect + window: WINDOW + driverType: DRI2DRIVER + ▶ + driver: STRING + device: STRING +└─── + + Returns the driver name and device file to use for the + specified driver type for the screen associated with 'window'. + + 'type' identifies the type of driver to query for. + + 'driver' is the name of the driver to load. The client is + assumed to know where to look for the drivers and what to do + with it. + + 'device' is the filename of the DRM device file. + + If the client is not local, or the request driver type is + unknown or not available, 'driver' and 'device' will be empty + strings. We are not using an regular X + error here to indicate failure, which will allow the client + fall back to other options more easily. + + ISSUE: We could add the list of supported attachments and the + supported DRI2CopyRegion values here (just the bitmask of all + supported values). + +┌─── + DRI2Authenticate + window: WINDOW + token: CARD32 + ▶ + authenticated: CARD32 +└─── + Errors: Window + + Request that the X server authenticates 'token', allowing the + client to access the DRM buffers created by the X server on + the screen associated with 'window'. + + Authentication shouldn't fail at this point, except if an + invalid token is passed, in which case authenticated is False. + +┌─── + DRI2GetBuffers + drawable: DRAWABLE + attachments: LISTofDRI2ATTACHMENTS + ▶ + width, height: CARD32 + buffers: LISTofDRI2BUFFER +└─── + Errors: Window + + Get buffers for the provided attachment points for the given + drawable. + + If the DDX driver does not support one or more of the + specified attachment points, a Value error is generated, with + the first unsupported attachment point as the error value. + + 'width' and 'height' describes the dimensions of the drawable. + + 'buffers' is a list of DRI2BUFFER for the given DRI2 + attachment points. + +┌─── + DRI2CopyRegion + drawable: DRAWABLE + region: REGION + source: DRI2ATTACHMENT + destination: DRI2ATTACHMENT + ▶ +└─── + Errors: Window, Value + + Schedule a copy from one DRI2 buffer to another. + + The DRICopyRegion request has a reply but it is empty. The + reply is there to let the direct rendering client wait until + the server has seen the request before proceeding with + rendering the next frame. + +┌─── + DRI2SwapBuffers + drawable: DRAWABLE + target_msc: two CARD32s + divisor: two CARD32s + remainder: two CARD32s + ▶ + swap: two CARD32s +└─── + Errors: Window + + Schedule a swap of the front and back buffers with the display + server. + + Returns the swap count value when the swap will actually occur (e.g. + the last queued swap count + (pending swap count * swap interval)). + + This request is only available with protocol version 1.2 or + later. + +┌─── + DRI2GetBuffersWithFormat + drawable: DRAWABLE + attachments: LISTofDRI2ATTACH_FORMAT + ▶ + width, height: CARD32 + buffers: LISTofDRI2BUFFER +└─── + Errors: Window + + Get buffers for the provided attachment points with the specified + formats for the given drawable. + + If the DDX driver does not support one or more of the + specified attachment points or formats, a Value error is generated, + with the first unsupported attachment point as the error value. + + 'width' and 'height' describes the dimensions of the drawable. + + 'buffers' is a list of DRI2BUFFER for the given DRI2 + attachment points. + + This request is only available with protocol version 1.1 or + later. + +┌─── + DRI2GetMSC + drawable: DRAWABLE + ▶ + ust, msc, sbc: CARD64 +└─── + Errors: Window + + Get the current media stamp counter (MSC) and swap buffer count (SBC) + along with the unadjusted system time (UST) when the MSC was last + incremented. + + This request is only available with protocol version 1.2 or + later. + +┌─── + DRI2WaitMSC + drawable: DRAWABLE + target_msc: two CARD32s + divisor: two CARD32s + remainder: two CARD32s + ▶ + ust, msc, sbc: CARD64 +└─── + Errors: Window + + Blocks the client until either the frame count reaches target_msc or, + if the frame count is already greater than target_msc when the request + is received, until the frame count % divisor = remainder. If divisor + is 0, the client will be unblocked if the frame count is greater than + or equal to the target_msc. + + Returns the current media stamp counter (MSC) and swap buffer count + (SBC) along with the unadjusted system time (UST) when the MSC was last + incremented. + + This request is only available with protocol version 1.2 or + later. + +┌─── + DRI2WaitSBC + drawable: DRAWABLE + target_sbc: two CARD32s + ▶ + ust, msc, sbc: CARD64 +└─── + Errors: Window + + Blocks the client until the swap buffer count reaches target_sbc. If + the swap buffer count is already greater than or equal to target_sbc + when the request is received, this request will return immediately. + + If target_sbc is 0, this request will block the client until all + previous DRI2SwapBuffers requests have completed. + + Returns the current media stamp counter (MSC) and swap buffer count + (SBC) along with the unadjusted system time (UST) when the MSC was last + incremented. + + This request is only available with protocol version 1.2 or + later. + +┌─── + DRI2SwapInterval + drawable: DRAWABLE + interval: CARD32 + ▶ +└─── + Errors: Window + + Sets the swap interval for DRAWABLE. This will throttle + DRI2SwapBuffers requests to swap at most once per interval frames, + which is useful useful for limiting the frame rate. + +┌─── + DRI2GetParam + drawable: DRAWABLE + param: CARD32 + ▶ + is_param_recognized: BOOL + value: CARD64 +└─── + Errors: Drawable + + Get the value of a parameter. The parameter's value is looked up on + the screen associated with 'drawable'. + + Parameter names in which the value of the most significant byte is + 0 are reserved for the X server. Currently, no such parameter names + are defined. (When any such names are defined, they will be defined in + this extension specification and its associated headers). + + Parameter names in which the byte's value is 1 are reserved for the + DDX. Such names are private to each driver and shall be defined in the + respective driver's headers. + + Parameter names in which the byte's value is neither 0 nor 1 are + reserved for future use. + + Possible values of 'is_param_recognized' are true (1) and false (0). + If false, then 'value' is undefined. + + This request is only available with protocol version 1.4 or later. + + ⚙ ⚙ ⚙ ⚙ ⚙ ⚙ + +9. Extension Events + +┌─── + DRI2BufferSwapComplete + ▶ + event_type: CARD16 + drawable: CARD32 + ust: CARD64 + msc: CARD64 + sbc: CARD64 +└─── + + This event reports the status of the last DRI2SwapBuffers event to + the client. The event type should be one of DRI2_EXCHANGE_COMPLETE, + indicating a successful buffer exchange, DRI2_BLIT_COMPLETE, indicating + the swap was performed with a blit, and DRI2_FLIP_COMPLETE, indicating + a full page flip was completed. + +┌─── + DRI2InvalidateBuffers + ▶ + drawable: CARD32 +└─── + + This event is generated when the buffers the client had + requested for 'drawable' (with DRI2GetBuffers or + DRI2GetBuffersWithFormat) become inappropriate because they + don't match the drawable dimensions anymore, or a buffer swap + has been performed. + + Note that the server is only required to warn the client once + about this condition, until the client takes care of bringing + them back up-to-date with another GetBuffers request. + + ⚙ ⚙ ⚙ ⚙ ⚙ ⚙ + +10. Extension Versioning + +The DRI2 extension has undergone a number of revisions before + + 1.0: Released, but never used. Relied on a number of + constructs from the XF86DRI extension, such as a + shared memory area (SAREA) to communicate changes in + cliprects and window sizes, and + + 1.99.1: Move the swap buffer functionality into the X server, + introduce SwapBuffer request to copy back buffer + contents to the X drawable. + + 1.99.2: Rethink the SwapBuffer request as an asynchronous + request to copy a region between DRI2 buffers. Drop + CreateDrawable and DestroyDrawable, update Connect to + support different driver types and to send the + authentication group. + + 1.99.3: Drop the bitmask argument intended to indicate + presence of optional arguments for CopyRegion. + + 2.0: Awesomeness! + + 2.1: True excellence. Added DRI2GetBuffersWithFormat to allow + more flexible object creation. + + 2.2: Approaching perfection. Added requests for swapbuffers, + MSC and SBC related requests, and events. + + 2.3: Added the DRI2InvalidateBuffers event. + + 2.6: Enlightenment attained. Added the DRI2BufferHiz attachment. + + 2.7: Added the DRI2GetParam request. + +Compatibility up to 2.0 is not preserved, but was also never released. + + + ⚙ ⚙ ⚙ ⚙ ⚙ ⚙ + + +11. Relationship with other extensions + +As an extension designed to support other extensions, there is +naturally some interactions with other extensions. + + +11.1 GLX + +The GL auxiliary buffers map directly to the DRI2 buffers... eh + + +11.2 DBE + +The DBE back buffer must correspond to the DRI2_BUFFER_FRONT_LEFT +DRI2 buffer for servers that support both DBE and DRI2. + + +11.3 XvMC / Xv + +We might add a DRI2_BUFFER_YUV to do vsynced colorspace conversion +blits. Maybe... not really sure. + + + ⚙ ⚙ ⚙ ⚙ ⚙ ⚙ + + +Appendix A. Protocol Encoding + +Syntactic Conventions + +This document uses the same syntactic conventions as the core X +protocol encoding document. + + +A.1 Common Types + +┌─── + DRI2DRIVER + 0x0 DRI2DriverDRI + 0x1 DRI2DriverVDPAU +└─── + +┌─── + DRI2ATTACHMENT + 0x0 DRI2BufferFrontLeft + 0x1 DRI2BufferBackLeft + 0x2 DRI2BufferFrontRight + 0x3 DRI2BufferBackRight + 0x4 DRI2BufferDepth + 0x5 DRI2BufferStencil + 0x6 DRI2BufferAccum + 0x7 DRI2BufferFakeFrontLeft + 0x8 DRI2BufferFakeFrontRight + 0x9 DRI2BufferDepthStencil + 0xa DRI2BufferHiz +└─── + Used to encode the possible attachment points. The attachment + DRI2BufferDepthStencil is only available with protocol version 1.1 or + later. + +┌─── + DRI2BUFFER + 4 CARD32 attachment + 4 CARD32 name + 4 CARD32 pitch + 4 CARD32 cpp + 4 CARD32 flags +└─── + A DRI2 buffer specifies the attachment, the kernel memory + manager name, the pitch and chars per pixel for a buffer + attached to a given drawable. + +┌─── + DRI2ATTACH_FORMAT + 4 CARD32 attachment + 4 CARD32 format +└─── + Used to describe the attachment and format requested from the server. + This data type is only available with protocol version 1.1 or + later. + +A.2 Protocol Requests + +┌─── + DRI2QueryVersion + 1 CARD8 major opcode + 1 0 DRI2 opcode + 2 3 length + 4 CARD32 major version + 4 CARD32 minor version + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 4 CARD32 major version + 4 CARD32 minor version + 16 unused +└─── + +┌─── + DRI2Connect + 1 CARD8 major opcode + 1 1 DRI2 opcode + 2 3 length + 4 WINDOW window + 4 CARD32 driver type + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 (n+m+p+q)/4 reply length + 4 n driver name length + 4 m device name length + 16 unused + n CARD8 driver name + p unused, p=pad(n) + m CARD8 device name + q unused, q=pad(m) +└─── + +┌─── + DRI2Authenticate + 1 CARD8 major opcode + 1 2 DRI2 opcode + 2 3 length + 4 WINDOW window + 4 CARD32 authentication token + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 4 CARD32 authenticated + 20 unused +└─── + +┌─── + DRI2GetBuffers + 1 CARD8 major opcode + 1 5 DRI2 opcode + 2 3 length + 4 DRAWABLE drawable + 4 n number of attachments + 4n LISTofDRI2ATTACHMENTS attachments + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 4 CARD32 width of drawable + 4 CARD32 height of drawable + 4 CARD32 buffer count + 12 unused + 5n LISTofDRI2BUFFER buffers +└─── + +┌─── + DRI2CopyRegion + 1 CARD8 major opcode + 1 6 DRI2 opcode + 2 3 length + 4 DRAWABLE drawable + 4 REGION region + 4 DRI2ATTACHMENT source + 4 DRI2ATTACHMENT destination + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 24 unused +└─── + +┌─── + DRI2GetBuffersWithFormat + 1 CARD8 major opcode + 1 7 DRI2 opcode + 2 3 length + 4 DRAWABLE drawable + 4 n number of attachments + 8n LISTofDRI2ATTACH_FORMAT attachments and formats + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 4 CARD32 width of drawable + 4 CARD32 height of drawable + 4 CARD32 buffer count + 12 unused + 5n LISTofDRI2BUFFER buffers +└─── + +┌─── + DRI2SwapBuffers + 1 CARD8 major opcode + 1 8 DRI2 opcode + 2 8 length + 4 DRAWABLE drawable + 4 CARD32 target_msc_hi + 4 CARD32 target_msc_lo + 4 CARD32 divisor_hi + 4 CARD32 divisor_lo + 4 CARD32 remainder_hi + 4 CARD32 remainder_lo + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 4 CARD32 swap_hi + 4 CARD32 swap_lo + 20 unused +└─── + +┌─── + DRI2GetMSC + 1 CARD8 major opcode + 1 9 DRI2 opcode + 2 8 length + 4 DRAWABLE drawable + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 4 CARD32 ust_hi + 4 CARD32 ust_lo + 4 CARD32 msc_hi + 4 CARD32 msc_lo + 4 CARD32 sbc_hi + 4 CARD32 sbc_lo +└─── + +┌─── + DRI2WaitMSC + 1 CARD8 major opcode + 1 10 DRI2 opcode + 2 8 length + 4 DRAWABLE drawable + 4 CARD32 target_msc_hi + 4 CARD32 target_msc_lo + 4 CARD32 divisor_hi + 4 CARD32 divisor_lo + 4 CARD32 remainder_hi + 4 CARD32 remainder_lo + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 4 CARD32 ust_hi + 4 CARD32 ust_lo + 4 CARD32 msc_hi + 4 CARD32 msc_lo + 4 CARD32 sbc_hi + 4 CARD32 sbc_lo +└─── + +┌─── + DRI2WaitSBC + 1 CARD8 major opcode + 1 11 DRI2 opcode + 2 8 length + 4 DRAWABLE drawable + 4 CARD32 swap_hi + 4 CARD32 swap_lo + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 4 CARD32 ust_hi + 4 CARD32 ust_lo + 4 CARD32 msc_hi + 4 CARD32 msc_lo + 4 CARD32 sbc_hi + 4 CARD32 sbc_lo +└─── + +┌─── + DRI2SwapInterval + 1 CARD8 major opcode + 1 12 DRI2 opcode + 2 8 length + 4 DRAWABLE drawable + 4 CARD32 interval + ▶ +└─── + +┌─── + DRI2GetParam + 1 CARD8 major opcode + 1 13 DRI2 opcode + 2 8 length + 4 DRAWABLE drawable + 4 CARD32 param + ▶ + 1 1 Reply + 1 BOOL is_param_recognized + 2 CARD16 sequence number + 4 0 reply length + 4 CARD32 value_hi + 4 CARD32 value_lo + 16 unused +└─── + +A.3 Protocol Events + +The DRI2 extension specifies DRI2_BufferSwapComplete and +DRI2_InvalidateBuffers events. + +┌─── + DRI2_BufferSwapComplete + 1 CARD8 type + 1 CARD8 extension + 2 CARD16 sequenceNumber + 2 CARD16 event_type + 4 DRAWABLE drawable + 4 CARD32 ust_hi + 4 CARD32 ust_lo + 4 CARD32 msc_hi + 4 CARD32 msc_lo + 4 CARD32 sbc_hi + 4 CARD32 sbc_lo +└─── + + +┌─── + DRI2_InvalidateBuffers + 1 CARD8 type + 1 CARD8 extension + 2 CARD16 sequenceNumber + 4 DRAWABLE drawable + 4 CARD32 unused + 4 CARD32 unused + 4 CARD32 unused + 4 CARD32 unused + 4 CARD32 unused + 4 CARD32 unused +└─── + +A.4 Protocol Errors + +The DRI2 extension specifies no errors. + + + ⚙ ⚙ ⚙ ⚙ ⚙ ⚙ + + +Appendix B. Implementation on GEM + +Where to begin... diff --git a/miniconda3/share/doc/xorgproto/dri3proto.txt b/miniconda3/share/doc/xorgproto/dri3proto.txt new file mode 100644 index 0000000000000000000000000000000000000000..f1f74c482a1c07fa815b0a0ec10b9796371c668a --- /dev/null +++ b/miniconda3/share/doc/xorgproto/dri3proto.txt @@ -0,0 +1,762 @@ + The DRI3 Extension + Version 1.4 + 2021-11-30 + + Keith Packard + keithp@keithp.com + Intel Corporation + + Daniel Stone + daniels@collabora.com + Collabora + + +1. Introduction + +The DRI3 extension provides mechanisms to translate between direct +rendered buffers and X pixmaps. When combined with the Present extension, +a complete direct rendering solution for hardware-accelerated devices +such as GPUs is provided. + +The direct rendered buffers are passed across the protocol via +standard POSIX file descriptor passing mechanisms. On Linux, these +buffers are DMA-BUF objects. + +DRI3 also includes a mechanism to translate between Linux Futexes +and X Sync extension Fences. This provides a synchronization mechanism +which can be used to serialize access to shared render buffers. + +1.1. Acknowledgments + +Eric Anholt +Dave Airlie +Kristian Høgsberg +James Jones +Arthur Huillet +Louis-Francis Ratté-Boulianne +Austin Shafer + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +2. Data Types + +The DRI3 extension uses the RandR extension Provider data type to +select among multiple GPUs on a single screen and the Sync extension +fence object to provide graphics object synchronization. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +4. Errors + +DRI3 defines no errors. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +5. Events + +DRI3 defines no events. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +6. Protocol Types + +SYNCOBJ { XID } + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +7. Extension Initialization + +The name of this extension is "DRI3" + +┌─── + DRI3QueryVersion + client-major-version: CARD32 + client-minor-version: CARD32 + ▶ + major-version: CARD32 + minor-version: CARD32 +└─── + + The client sends the highest supported version to the server + and the server sends the highest version it supports, but no + higher than the requested version. Major versions changes can + introduce incompatibilities in existing functionality, minor + version changes introduce only backward compatible changes. + It is the clients responsibility to ensure that the server + supports a version which is compatible with its expectations. + + Backwards compatible changes included addition of new + requests. + + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +8. Extension Requests + +┌─── + DRI3Open + drawable: DRAWABLE + provider: PROVIDER + ▶ + nfd: CARD8 + device: FD +└─── + Errors: Drawable, Value, Match + + This requests that the X server open the direct rendering + device associated with drawable and RandR provider. The + provider must support SourceOutput or SourceOffload. + + The file descriptor for the device is returned in + 'device'. 'nfd' will be set to one (this is strictly a + convenience for XCB which otherwise would need + request-specific information about how many file descriptors + were associated with this reply). + +┌─── + DRI3PixmapFromBuffer + pixmap: PIXMAP + drawable: DRAWABLE + size: CARD32 + width, height, stride: CARD16 + depth, bpp: CARD8 + buffer: FD +└─── + Errors: Alloc, Drawable, IDChoice, Value, Match + + Creates a pixmap for the direct rendering object associated + with 'buffer' and the screen associated with 'drawable'. + Changes to pixmap will be visible in that direct rendered + object and changes to the direct rendered object will be + visible in the pixmap. + + 'size' specifies the total size of the buffer bytes. 'width', + 'height' describe the geometry (in pixels) of the underlying + buffer. 'stride' specifies the number of bytes per scanline in + the buffer. The pixels within the buffer are not required to + be arranged in a simple linear fashion, but 'size' will be at + least 'height' * 'stride'. + + Precisely how any additional information about the buffer is + shared is outside the scope of this extension. + + If buffer cannot be used with the screen associated with + drawable, a Match error is returned. + + If depth or bpp are not supported by the screen, a Value error + is returned. + + For information on synchronization of buffer access between + the client and the X server, please see section 12. + +┌─── + DRI3BufferFromPixmap + pixmap: PIXMAP + ▶ + nfd: CARD8 + size: CARD32 + width, height, stride: CARD16 + depth, bpp: CARD8 + buffer: FD +└─── + Errors: Pixmap, Match + + Pass back a direct rendering object associated with + pixmap. Changes to pixmap will be visible in that + direct rendered object and changes to the direct rendered + object will be visible in the pixmap. + + 'size' specifies the total size of the buffer bytes. 'width', + 'height' describe the geometry (in pixels) of the underlying + buffer. 'stride' specifies the number of bytes per scanline in + the buffer. The pixels within the buffer are not required to + be arranged in a simple linear fashion, but 'size' will be at + least 'height' * 'stride'. + + Precisely how any additional information about the buffer is + shared is outside the scope of this extension. + + If buffer cannot be used with the screen associated with + drawable, a Match error is returned. + + For information on synchronization of buffer access between + the client and the X server, please see section 12. + +┌─── + DRI3FenceFromFD + drawable: DRAWABLE + fence: FENCE + initially-triggered: BOOL + fd: FD +└─── + Errors: IDchoice, Drawable + + Creates a Sync extension Fence that provides the regular Sync + extension semantics along with a file descriptor that provides + a device-specific mechanism to manipulate the fence directly. + Details about the mechanism used with this file descriptor are + outside the scope of the DRI3 extension. + + For information on synchronization of buffer access between + the client and the X server, please see section 12. + +┌─── + DRI3FDFromFence + drawable: DRAWABLE + fence: FENCE + ▶ + fd: FD +└─── + Errors: IDchoice, Drawable, Match + + Given a Sync extension Fence that provides the regular Sync + extension semantics, returns a file descriptor that provides a + device-specific mechanism to manipulate the fence directly. + Details about the mechanism used with this file descriptor are + outside the scope of the DRI3 extension. 'drawable' must be + associated with a direct rendering device that 'fence' can + work with, otherwise a Match error results. + + For information on synchronization of buffer access between + the client and the X server, please see section 12. + +┌─── + DRI3GetSupportedModifiers + window: WINDOW + depth: CARD8 + bpp: CARD8 + ▶ + num_window_modifiers: CARD32 + num_screen_modifiers: CARD32 + window_modifiers: ListOfCARD64 + screen_modifiers: ListOfCARD64 +└─── + Errors: Window, Match + + Return supported DRM FourCC modifiers for the specified + 'window'. + + The first list of 'window_modifiers' contains a set of + modifiers which the server considers optimal for the window's + current configuration. Using these modifiers to allocate, even + if locally suboptimal to the client driver, may result in a + more optimal display pipeline, e.g. by avoiding composition. + + The second list of 'screen_modifiers', is the total set of + modifiers which are acceptable for use on the Screen associated + with 'window'. This set of modifiers will not change over the + lifetime of the client. Using this set of modifiers to allocate + may not result in a globally optimal pipeline, if separate + 'window_modifiers' are available. + + It is expected that a client calling this request will obtain + the modifiers for a particular window, allocate buffers using + the preferred modifier set as described above, create a Pixmap + referring to the storage of those buffers using the + DRI3BuffersFromPixmap request, then make the content visible + in the storage of those buffers visible with a request such as + the Present extension's PresentPixmap. + + The meaning of any modifier is canonically defined in + drm_fourcc.h. + +┌─── + DRI3PixmapFromBuffers + pixmap: PIXMAP + window: WINDOW + num_buffers: CARD8 + width, height: CARD16 + stride0, offset0: CARD32 + stride1, offset1: CARD32 + stride2, offset2: CARD32 + stride3, offset3: CARD32 + depth, bpp: CARD8 + modifier: CARD64 + buffers: ListOfFD +└─── + Errors: Alloc, Window, IDChoice, Value, Match + + Creates a pixmap for the direct rendering object associated + with 'buffers' and the screen associated with 'window'. + Changes to pixmap will be visible in that direct rendered + object and changes to the direct rendered object will be + visible in the pixmap. The pixmap will be available for + presentation to the window. + + In contrast to PixmapFromBuffer, multiple buffers may be + combined to specify a single logical source for pixel + sampling: 'num_buffers' may be set from 1 (single buffer, + akin to PixmapFromBuffer) to 4. This is the number of file + descriptors which will be sent with this request; one per + buffer. + + Modifiers allow explicit specification of non-linear sources, + such as tiled or compressed buffers. The combination of bpp, + depth, and modifier allows unambiguous declaration of the + buffer layout in a manner defined by the DRM tokens. + + If 'modifier' is DRM_FORMAT_MOD_INVALID, the client does + not have information on the buffer layout. In this case, the + buffer may only have a single plane. The driver may make its + own inference through unspecified means to determine the exact + buffer layout, however this is neither required nor defined + by the specification, and is considered an implementation + detail of the particular driver. + + 'width' and 'height' describe the geometry (in pixels) of the + logical pixel-sample source. + + 'strideN' and 'offsetN' define the number of bytes per logical + scanline, and the distance in bytes from the beginning of the + buffer passed for that plane until the start of the sample + source for that plane, respectively for plane N. If the plane + is not used according to the format and modifier specification, + both values for that plane must be zero. + + Precisely how any additional information about the buffer (such + as memory placement) is shared is outside the scope of this + extension. + + If the buffer(s) cannot be used with the screen associated with + 'window', a Match error is returned. + + If the bpp, depth, and modifier combination is not supported by + the screen, a Value error is returned. + + For information on synchronization of buffer access between + the client and the X server, please see section 12. + +┌─── + DRI3BuffersFromPixmap + pixmap: PIXMAP + ▶ + nfd: CARD8 + width, height: CARD16 + depth, bpp: CARD8 + modifier: CARD64 + strides: ListOfCARD32 + offsets: ListOfCARD32 + buffers: ListOfFD +└─── + Errors: Pixmap, Match + + Returns direct rendering objects associated with 'pixmap'. + Changes to 'pixmap' will be visible in the direct rendered + objects and changes to the direct rendered objects will be + visible in 'pixmap' after flushing and synchronization. + + 'width' and 'height' describe the geometry (in pixels) of the + logical pixel-sample source from combining the direct rendering + objects. + + See PixmapFromBuffers for more details on DRM modifiers usage. + + 'nfd' describes the number of buffers returned for the pixmap, + which must be combined together according to 'depth', 'bpp', and + 'modifier'. + + For each buffer, there is an entry in the 'strides', + 'offsets', and 'buffers' list. 'buffer' contains a single file + descriptor referring to the buffer. 'stride' specifies the + number of bytes per logical scanline for this plane, and + 'offset' specifies the distance in bytes from the beginning + of 'buffer' until the start of the sample source for that + plane. + + Precisely how any additional information about the buffer is + shared is outside the scope of this extension. + + If buffers cannot be exported from the the screen associated + with 'pixmap', a Match error is returned. + + For information on synchronization of buffer access between + the client and the X server, please see section 12. + +┌─── + DRI3SetDRMDeviceInUse + window: WINDOW + drmMajor: CARD32 + drmMinor: CARD32 +└─── + Errors: Window + + This request provides a hint to the server about the device + in use by this window. This is used to provide + DRI3GetSupportedModifiers with a hint of what device to + return modifiers for in the window_modifiers return value. + Using this hint allows for device-specific modifiers to + be returned by DRI3GetSupportedModifiers, for example + when an application is renderoffloaded and eligible for + direct scanout. + + This is only a hint, and may or may not be reflected in + the modifier list returned. + + If the window specified was not found, a Window error will + be returned. + + +┌─── + DRI3ImportSyncobj + syncobj: SYNCOBJ + drawable: DRAWABLE + fd: FD +└─── + Errors: IDchoice, Drawable + + Imports the DRM synchronization object bound to the given 'fd'. This + may then be used to enable explicit synchronization with the + server-side direct rendering device associated with 'drawable'. + + The provided syncobj must be a timeline syncobj. + + If 'drawable' is not found, a Drawable error will be returned. + + +┌─── + DRI3FreeSyncobj + syncobj: SYNCOBJ +└─── + Errors: Value + + Indicates that any resources associated with the given 'syncobj' should + be released by the server. The actual release may be deferred until any + pending operations that depend on the object have completed. + + If 'syncobj' is not found, a Value error will be returned. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +9. Extension Events + +DRI3 defines no events. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +10. Extension Versioning + +The DRI3 extension is adapted from the DRI2 extension. + + 1.0: First published version + + 1.1: Cosmetic changes + + 1.2: Add GetSupportedModifiers, + PixmapFromBuffers, and BuffersFromPixmap requests. + + 1.3: Add SetDRMDeviceInUse + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + + +11. Relationship with other extensions + +As an extension designed to support other extensions, there is +naturally some interactions with other extensions. + +11.1 GLX + +GLX is both an application interface and an X extension. OpenGL +applications using the GLX API will use the GLX extension, DRI3 and +Present when doing direct rendering. + +11.2 Present + +The Present extension provides a way to synchronize the display of pixmap +contents to the screen. When used in conjunction with DRI3, they +provide a complete direct rendering solution for OpenGL or other APIs. + +11.3 DRI2 + +DRI3 provides similar functionality to the DRI2Connect and +DRI2GetBuffersWithFormat requests, however DRI3 uses file descriptors +to refer to the direct rendering device and buffers. + +Present and DRI3 are designed in conjunction to replace DRI2 + +11.2 XvMC / Xv + +It might be nice to be able to reference YUV formatted direct rendered +objects from the X server. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +12. Synchronization + +Synchronization of access to buffers shared between processes is not +currently explicitly controlled by this protocol. + +Without the use of additional extensions not defined by the DRI3 +protocol as of version 1.2, synchronization between multiple +processes and contexts is considered to follow the implicit model. + +In this model, the driver is required to have a global view of +access requests issued by all processes with a reference to the +buffer, and control scheduling of all operations on that buffer, +whether performed by the CPU or auxiliary hardware. + +The driver is responsible for enforcing a strict ordering to protect +against write-after-read or read-after-write hazards, such that any +reads requested by one process or context, are fulfilled before any +writes requested by another process or context, as long as that read +was definitively submitted before the write. + +A similar dependency exists for reads submitted after writes: the +driver must ensure that the write is fully visible and coherent to +the read request. + +As a purely illustrative example, if two processes share a buffer, +where one process reads from a buffer using an OpenGL texture +sampler and submits this work by calling 'glFlush', and the other +process submits work to the driver to write to that buffer, the +driver is responsible for ensuring that the results of the latter +write are not visible to the texture sampler. + +The Sync fences provided by DRI3 control only this submission of +work and ensuing global visibility of the requests, rather than the +completion of the work within any hardware. To further the example +above, a fence used to prevent any writes to the buffer before the +sampler had completed access, the fence would be signaled when +'glFlush' had been called, at which point the request has become +globally visible to the driver's request-scheduling and +synchronization mechanisms. The logical ordering of requests made +by software has been preserved, and the driver then takes care +to ensure that these requests are scheduled such they do not +observe effects from requests made later in time. + +This presents a fully coherent in-order FIFO-like model across +processes, where synchronzation is handled externally to the DRI3 +client with no explicit intervention. + +This restriction also applies for cross-device usage. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +Appendix A. Protocol Encoding + +Syntactic Conventions + +This document uses the same syntactic conventions as the core X +protocol encoding document. + + +A.1 Common Types + +None. + +A.2 Protocol Requests + +┌─── + DRI3QueryVersion + 1 CARD8 major opcode + 1 0 DRI3 opcode + 2 3 length + 4 CARD32 major version + 4 CARD32 minor version + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 4 CARD32 major version + 4 CARD32 minor version + 16 unused +└─── + + +┌─── + DRI3Open + 1 CARD8 major opcode + 1 1 DRI3 opcode + 2 4 length + 4 DRAWABLE drawable + 4 PROVIDER provider + ▶ + 1 1 Reply + 1 1 nfd + 2 CARD16 sequence number + 4 0 reply length + 24 unused + + 0 FD device +└─── + +┌─── + DRI3PixmapFromBuffer + 1 CARD8 major opcode + 1 2 DRI3 opcode + 2 6 length + 4 Pixmap pixmap + 4 Drawable drawable + 4 CARD32 size + 2 CARD16 width + 2 CARD16 height + 2 CARD16 stride + 1 CARD8 depth + 1 CARD8 bpp + + 0 FD buffer +└─── + +┌─── + DRI3BufferFromPixmap + 1 CARD8 major opcode + 1 3 DRI3 opcode + 2 2 length + 4 Pixmap pixmap + ▶ + 1 1 Reply + 1 1 nfd + 2 CARD16 sequence number + 4 0 reply length + 4 CARD32 size + 2 CARD16 width + 2 CARD16 height + 2 CARD16 stride + 1 CARD8 depth + 1 CARD8 bpp + 12 unused + + 0 FD buffer +└─── + +┌─── + DRI3FenceFromFD + 1 CARD8 major opcode + 1 4 DRI3 opcode + 2 4 length + 4 Drawable drawable + 4 Fence fence + 1 BOOL initially triggered + 3 unused + + 0 FD fence fd +└─── + +┌─── + DRI3FDFromFence + 1 CARD8 major opcode + 1 5 DRI3 opcode + 2 3 length + 4 Drawable drawable + 4 Fence fence + ▶ + 1 1 Reply + 1 1 nfd + 2 CARD16 sequence number + 4 0 reply length + 24 unused + + 0 FD fence fd +└─── + +┌─── + DRI3GetSupportedModifiers + 1 CARD8 major opcode + 1 6 DRI3 opcode + 2 3 length + 4 Window window + 1 CARD8 depth + 1 CARD8 bpp + 2 unused + ▶ + 1 1 Reply + 1 0 unused + 2 CARD16 sequence number + 4 CARD32 reply length + 4 CARD32 num_window_modifiers + 4 CARD32 num_screen_modifiers + 16 unused + + 4 ListOfCARD64 window_modifiers[num_window_modifiers] + 4 ListOfCARD64 screen_modifiers[num_screen_modifiers] +└─── + +┌─── + DRI3PixmapFromBuffers + 1 CARD8 major opcode + 1 7 DRI3 opcode + 2 8 length + 4 Pixmap pixmap + 4 Window window + 1 CARD8 num_buffers + 3 unused + 2 CARD16 width + 2 CARD16 height + 4 CARD32 stride0 + 4 CARD32 offset0 + 4 CARD32 stride1 + 4 CARD32 offset1 + 4 CARD32 stride2 + 4 CARD32 offset2 + 4 CARD32 stride3 + 4 CARD32 offset3 + 1 CARD8 depth + 1 CARD8 bpp + 2 unused + 8 CARD64 modifier + + 0 ListOfFD buffers[num_buffers] +└─── + +┌─── + DRI3BuffersFromPixmap + 1 CARD8 major opcode + 1 8 DRI3 opcode + 2 2 length + 4 Pixmap pixmap + ▶ + 1 1 Reply + 1 CARD8 nfd + 2 CARD16 sequence number + 4 CARD32 reply length + 2 CARD16 width + 2 CARD16 height + 4 CARD8 unused + 8 CARD64 modifier + 1 CARD8 depth + 1 CARD8 bpp + 6 unused + + 0 ListOfFD buffer[nfd] + 4 ListOfCARD32 strides[nfd] + 4 ListOfCARD32 offsets[nfd] +└─── + +┌─── + DRI3SetDRMDeviceInUse + 1 CARD8 major opcode + 1 9 DRI3 opcode + 2 4 length + 4 Window window + 4 CARD32 drmMajor + 4 CARD32 drmMinor +└─── + +┌─── + DRI3ImportSyncobj + 1 CARD8 major opcode + 1 11 DRI3 opcode + 2 3 length + 4 SYNCOBJ syncobj + 4 Drawable drawable + 0 FD syncobj fd +└─── + +┌─── + DRI3FreeSyncobj + 1 CARD8 major opcode + 1 12 DRI3 opcode + 2 2 length + 4 SYNCOBJ syncobj +└─── + +A.3 Protocol Events + +The DRI3 extension defines no events. + +A.4 Protocol Errors + +The DRI3 extension defines no errors. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ diff --git a/miniconda3/share/doc/xorgproto/fixesproto.txt b/miniconda3/share/doc/xorgproto/fixesproto.txt new file mode 100644 index 0000000000000000000000000000000000000000..f462606d6fd00408fa4aaa37265ff3ffadad8291 --- /dev/null +++ b/miniconda3/share/doc/xorgproto/fixesproto.txt @@ -0,0 +1,734 @@ + The XFIXES Extension + Version 6.1 + Document Revision 1 + 2010-11-15 + Keith Packard + keithp@keithp.com + +1. Introduction + +X applications have often needed to work around various shortcomings in the +core X window system. This extension is designed to provide the minimal +server-side support necessary to eliminate problems caused by these +workarounds. + +2. Acknowledgements + +This extension is a direct result of requests made by application +developers, in particular, + + + Owen Taylor for describing the issues raised with the XEMBED + mechanisms and SaveSet processing and his initial extension + to handle this issue, and for pointer barriers + + + Bill Haneman for the design for cursor image tracking. + + + Havoc Pennington + + + Fredrik Höglund for cursor names + + + Deron Johnson for cursor visibility + +3. Basic Premise + +Requests in this extension may seem to wander all over the map of X server +capabilities, but they are tied by a simple rule -- resolving issues raised +by application interaction with core protocol mechanisms that cannot be +adequately worked around on the client side of the wire. + +4. Extension initialization + +The client must negotiate the version of the extension before executing +extension requests. Behavior of the server is undefined otherwise. + +QueryVersion + + client-major-version: CARD32 + client-minor-version: CARD32 + + -> + + major-version: CARD32 + minor-version: CARD32 + + The client sends the highest supported version to the server and + the server sends the highest version it supports, but no higher than + the requested version. Major versions changes can introduce + new requests, minor version changes introduce only adjustments to + existing requests or backward compatible changes. It is + the clients responsibility to ensure that the server supports + a version which is compatible with its expectations. + +************* XFIXES VERSION 1 OR BETTER *********** + +5. Save Set processing changes + +Embedding one application within another provides a way of unifying +disparate documents and views within a single framework. From the X +protocol perspective, this appears similar to nested window managers; the +embedding application "manages" the embedded windows much as a window +manager does for top-level windows. To protect the embedded application +from embedding application failure, it is reasonable to use the core SaveSet +mechanism so that embedding application failure causes embedded windows to +be preserved instead of destroyed. + +The core save set mechanism defines the target for each save set member +window as the nearest enclosing window not owned by the terminating client. +For embedding applications, this nearest window is usually the window +manager frame. The problem here is that the window manager will not +generally expect to receive and correctly manage new windows appearing within +that window by the save set mechanism, and will instead destroy the frame +window in response to the client window destruction. This causes the +embedded window to be destroyed. + +An easy fix for this problem is to change the target of the save set member +to a window which won't be affected by the underlying window destruction. +XFIXES chooses the root window as the target. + +Having embedded windows suddenly appear at the top level can confuse users, +so XFIXES also lets the client select whether the window should end up +unmapped after the save set processing instead of unconditionally making +them be mapped. + +5.1 Requests + +ChangeSaveSet + + window: Window + mode: { Insert, Delete } + target: { Nearest, Root } + map: { Map, Unmap } + + ChangeSaveSet is an extension of the core protocol ChangeSaveSet + request. As in that request, mode specifies whether the indicated + window is inserted or deleted from the save-set. Target specifies + whether the window is reparented to the nearest non-client window as + in the core protocol, or reparented to the root window. Map + specifies whether the window is mapped as in the core protocol or + unmapped. + +6. Selection Tracking + +Applications wishing to monitor the contents of current selections must +poll for selection changes. XFIXES improves this by providing an event +delivered whenever the selection ownership changes. + +6.1 Types + + SELECTIONEVENT { SetSelectionOwner, + SelectionWindowDestroy, + SelectionClientClose } + +6.1 Events + +SelectionNotify + + subtype: SELECTIONEVENT + window: Window + owner: Window + selection: Atom + timestamp: Timestamp + selection-timestamp: Timestamp + +6.2 Requests + +SelectSelectionInput + + window: Window + selection: Atom + event-mask: SETofSELECTIONEVENT + + Selects for events to be delivered to window when various causes of + ownership of selection occur. Subtype indicates the cause of the + selection ownership change. Owner is set to the current selection + owner, or None. Timestamp indicates the time the event was + generated while selection-timestamp indicates the timestamp used to + own the selection. + +7. Cursor Image Monitoring + +Mirroring the screen contents is easily done with the core protocol or VNC +addons, except for the current cursor image. There is no way using the core +protocol to discover which cursor image is currently displayed. The +cursor image often contains significant semantic content about the user +interface. XFIXES provides a simple mechanism to discover when the cursor +image changes and to fetch the current cursor image. + +As the current cursor may or may not have any XID associated with it, there +is no stable name available. Instead, XFIXES returns only the image of the +current cursor and provides a way to identify cursor images to avoid +refetching the image each time it changes to a previously seen cursor. + +7.1 Types + CURSOREVENT { DisplayCursor } + +7.2 Events + +CursorNotify + + subtype: CURSOREVENT + window: Window + cursor-serial: CARD32 + timestamp: Timestamp + name: Atom (Version 2 only) + +7.3 Requests + +SelectCursorInput + + window: Window + event-mask: SETofCURSOREVENT + + This request directs cursor change events to the named window. + Events will be delivered irrespective of the screen on which they + occur. Subtype indicates the cause of the cursor image change + (there is only one subtype at present). Cursor-serial is a number + assigned to the cursor image which identifies the image. Cursors + with different serial numbers may have different images. Timestamp + is the time of the cursor change. + + Servers supporting the X Input Extension Version 2.0 or higher only + notify the clients of cursor change events for the ClientPointer, not + of any other master pointer (see Section 4.4. in the XI2 protocol + specification). + +GetCursorImage + + -> + + x: INT16 + y: INT16 + width: CARD16 + height: CARD16 + x-hot: CARD16 + y-hot: CARD16 + cursor-serial: CARD32 + cursor-image: LISTofCARD32 + + GetCursorImage returns the image of the current cursor. X and y are + the current cursor position. Width and height are the size of the + cursor image. X-hot and y-hot mark the hotspot within the cursor + image. Cursor-serial provides the number assigned to this cursor + image, this same serial number will be reported in a CursorNotify + event if this cursor image is redisplayed in the future. + + The cursor image itself is returned as a single image at 32 bits per + pixel with 8 bits of alpha in the most significant 8 bits of the + pixel followed by 8 bits each of red, green and finally 8 bits of + blue in the least significant 8 bits. The color components are + pre-multiplied with the alpha component. + +************* XFIXES VERSION 2 OR BETTER *********** + +8. Region Objects + +The core protocol doesn't expose regions as a primitive object and this +makes many operations more complicated than they really need to be. Adding +region objects simplifies expose handling, the Shape extension and other +operations. These operations are also designed to support a separate +extension, the X Damage Extension. + +8.1 Types + + Region: XID + WINDOW_REGION_KIND: { Bounding, Clip } + +8.2 Errors + + Region The specified region is invalid + +8.3 Requests + +CreateRegion + + region: REGION + rects: LISTofRECTANGLE + + Creates a region initialized to the specified list of rectangles. + The rectangles may be specified in any order, their union becomes + the region. The core protocol allows applications to specify an + order for the rectangles, but it turns out to be just as hard to + verify the rectangles are actually in that order as it is to simply + ignore the ordering information and union them together. Hence, + this request dispenses with the ordering information. + + Errors: IDChoice + +CreateRegionFromBitmap + + region: REGION + bitmap: PIXMAP + + Creates a region initialized to the set of 'one' pixels in bitmap + (which must be depth 1, else Match error). + + Errors: Pixmap, IDChoice, Match + +CreateRegionFromWindow + + window: Window + kind: WINDOW_REGION_KIND + region: Region + + Creates a region initialized to the specified window region. See the + Shape extension for the definition of Bounding and Clip regions. + + Errors: Window, IDChoice, Value + +CreateRegionFromGC + + gc: GContext + region: Region + + Creates a region initialized from the clip list of the specified + GContext. + + Errors: GContext, IDChoice + +CreateRegionFromPicture + + picture: Picture + region: Region + + + Creates a region initialized from the clip list of the specified + Picture. + + Errors: Picture, IDChoice + +DestroyRegion + + region: Region + + Destroys the specified region. + + Errors: Region + +SetRegion + + region: Region + rects: LISTofRECTANGLE + + This replaces the current contents of region with the region formed + by the union of rects. + +CopyRegion + source: Region + destination: Region + + This replaces the contents of destination with the contents of + source. + +UnionRegion +IntersectRegion +SubtractRegion + + source1: Region + source2: Region + destination: Region + + Combines source1 and source2, placing the result in destination. + Destination may be the same as either source1 or source2. + + Errors: Region, Value + +InvertRegion + + source: Region + bounds: RECTANGLE + destination: Region + + The source region is subtracted from the region specified by + bounds. The result is placed in destination, replacing its contents. + + Errors: Region + +TranslateRegion + + region: Region + dx, dy: INT16 + + The region is translated by dx, dy in place. + + Errors: Region + +RegionExtents + + source: Region + destination: Region + + The extents of the source region are placed in the destination + +FetchRegion + + region: Region + -> + extents: RECTANGLE + rectangles: LISTofRECTANGLE + + The region is returned as a list of rectangles in YX-banded order. + + Errors: Region + +SetGCClipRegion + + gc: GCONTEXT + clip-x-origin, clip-y-origin: INT16 + region: Region or None + + This request changes clip-mask in gc to the specified region and + sets the clip origin. Output will be clipped to remain contained + within the region. The clip origin is interpreted relative to the + origin of whatever destination drawable is specified in a graphics + request. The region is interpreted relative to the clip origin. + Future changes to region have no effect on the gc clip-mask. + + Errors: GContext, Region + +SetWindowShapeRegion + + dest: Window + destKind: SHAPE_KIND + xOff, yOff: INT16 + region: Region or None + + This request sets the specified (by destKind) Shape extension region + of the window to region, offset by xOff and yOff. Future changes to + region have no effect on the window shape. + + Errors: Window, Value, Region + +SetPictureClipRegion + + picture: Picture + clip-x-origin, clip-y-origin: INT16 + region: Region or None + + This request changes clip-mask in picture to the specified region + and sets the clip origin. Input and output will be clipped to + remain contained within the region. The clip origin is interpreted + relative to the origin of the drawable associated with picture. The + region is interpreted relative to the clip origin. Future changes + to region have no effect on the picture clip-mask. + + Errors: Picture, Region + +9. Cursor Names + +Attaching names to cursors permits some abstract semantic content to be +associated with specific cursor images. Reflecting those names back to +applications allows that semantic content to be related to the user through +non-visual means. + +9.1 Events + +CursorNotify + + subtype: CURSOREVENT + window: Window + cursor-serial: CARD32 + timestamp: Timestamp + name: Atom or None + + In Version 2 of the XFIXES protocol, this event adds the atom + of any name associated with the current cursor (else None). + +9.2 Requests + +SetCursorName + + cursor: CURSOR + name: LISTofCARD8 + + This request interns name as an atom and sets that atom as the name + of cursor. + + Errors: Cursor + +GetCursorName + + cursor: CURSOR + -> + atom: ATOM or None + name: LISTofCARD8 + + This request returns the name and atom of cursor. If no name is + set, atom is None and name is empty. + + Errors: Cursor + +GetCursorImageAndName + + -> + + x: INT16 + y: INT16 + width: CARD16 + height: CARD16 + x-hot: CARD16 + y-hot: CARD16 + cursor-serial: CARD32 + cursor-atom: ATOM + cursor-image: LISTofCARD32 + cursor-name: LISTofCARD8 + + This is similar to GetCursorImage except for including both + the atom and name of the current cursor. + +ChangeCursor + + source, destination: CURSOR + + This request replaces all references to the destination with a + reference to source. Any existing uses of the destination cursor + object will now show the source cursor image. + +ChangeCursorByName + + src: CURSOR + name: LISTofCARD8 + + This request replaces the contents of all cursors with the specified + name with the src cursor. + +************* XFIXES VERSION 3 OR BETTER *********** + +10. Region Expansion + +This update provides another operation on the region objects defined in +Section 8 of this document. + +10.1 Requests + +ExpandRegion + source: REGION + destination: REGION + left, right, top, bottom: CARD16 + + Creates destination region containing the area specified by + expanding each rectangle in the source region by the specified + number of pixels to the left, right, top and bottom. + +************* XFIXES VERSION 4 OR BETTER *********** + +11. Cursor Visibility + +Composite managers may want to render the cursor themselves instead of +relying on the X server sprite drawing, this provides a way for them to +do so without getting a double cursor image. + +11.1 Requests + +HideCursor + + window: WINDOW + + A client sends this request to indicate that it wants the + cursor image to be hidden (i.e. to not be displayed) when + the sprite is on the same screen as the specified window. + The sprite will be hidden if one or more clients have called + HideCursor and not ShowCursor. + + Note that even though cursor hiding causes the cursor image + to be invisible, CursorNotify events will still be sent + normally, as if the cursor image were visible. + + When a client with outstanding cursor hiding requests + terminates its connection these requests will be deleted. + + Servers supporting the X Input Extension Version 2.0 or higher hide + all visible cursors in response to a HideCursor request. If a master + pointer is created while the cursors are hidden, this master pointer's + cursor will be hidden as well. + +ShowCursor + + window: WINDOW + + A client sends this request to indicate that it wants the + cursor image to be displayed when the sprite is on the same + screen as the specified window. The sprite will be hidden + if one or more clients have called HideCursor and not ShowCursor. + + If the client has made no outstanding HideCursor requests + a BadMatch error is generated. + + Servers supporting the X Input Extension Version 2.0 or higher show + all visible cursors in response to a ShowCursor request. + +************* XFIXES VERSION 5 OR BETTER *********** + +12. Pointer Barriers + +Compositing managers and desktop environments may have UI elements in +particular screen locations such that for a single-headed display they +correspond to easy targets according to Fitt's Law, for example, the top +left corner. For a multi-headed environment these corners should still be +semi-impermeable. Pointer barriers allow the application to define +additional constraint on cursor motion so that these areas behave as +expected even in the face of multiple displays. + +Absolute positioning devices like touchscreens do not obey pointer barriers. +There's no advantage to target acquisition to do so, since on a touchscreen +all points are in some sense equally large, whereas for a relative +positioning device the edges and corners are infinitely large. + +WarpPointer and similar requests do not obey pointer barriers, for +essentially the same reason. + +12.1 Types + + BARRIER: XID + + BarrierDirections + + BarrierPositiveX: 1 << 0 + BarrierPositiveY: 1 << 1 + BarrierNegativeX: 1 << 2 + BarrierNegativeY: 1 << 3 + +12.2 Errors + + Barrier + +12.3 Requests + +CreatePointerBarrier + + barrier: BARRIER + window: Window + x1, y2, x2, y2: INT16 + directions: CARD32 + devices: LISTofDEVICEID + + Creates a pointer barrier along the line specified by the given + coordinates on the screen associated with the given window. The + barrier has no spatial extent; it is simply a line along the left + or top edge of the specified pixels. Barrier coordinates are in + screen space. + + The coordinates must be axis aligned, either x1 == x2, or + y1 == y2, but not both. The varying coordinates may be specified + in any order. For x1 == x2, either y1 > y2 or y1 < y2 is valid. + If the coordinates are not valid BadValue is generated. + + Motion is allowed through the barrier in the directions specified: + setting the BarrierPositiveX bit allows travel through the barrier + in the positive X direction, etc. Nonsensical values (forbidding Y + axis travel through a vertical barrier, for example) and excess set + bits are ignored. + + If the server supports the X Input Extension version 2 or higher, + the devices element names a set of master device to apply the + barrier to. If XIAllDevices or XIAllMasterDevices are given, the + barrier applies to all master devices. If a slave device is named, + BadDevice is generated; this does not apply to slave devices named + implicitly by XIAllDevices. Naming a device multiple times is + legal, and is treated as though it were named only once. If a + device is removed, the barrier continues to apply to the remaining + devices, but will not apply to any future device with the same ID + as the removed device. Nothing special happens when all matching + devices are removed; barriers must be explicitly destroyed. + + Errors: IDChoice, Window, Value, Device + +DestroyPointerBarrier + + barrier: BARRIER + + Destroys the named barrier. + + Errors: Barrier + +************* XFIXES VERSION 6 OR BETTER *********** + +13. Disconnect mode + +The X11 server is capable of terminating itself once all X11 clients are +gone. + +Yet, in a typical user session, there are a number of X11 clients running +continuously (e.g. Xsettings daemon, IBus, etc.). Those always-running +clients will prevent the X11 server from terminating, because the actual +number of X11 clients will never drop to 0. + +Disconnect mode allows the X11 clients themselves to specify that they +should not be accounted for when checking the remaining clients prior +to terminate the X11 server. + +This can be particularly useful for Wayland compositors which are able to +start Xwayland on demand, as this allows Xwayland to terminate automatically +when the relevant X11 clients have quit. + +13.1 Types + + XFixesClientDisconnectFlags + + XFixesClientDisconnectFlagDefault: 0 + XFixesClientDisconnectFlagTerminate: 1 << 0 + XFixesClientDisconnectFlagForceTerminate: 1 << 1 + + XFixesClientDisconnectFlagDefault is the default behavior for + regular clients: the X11 server won't terminate as long as such + clients are still connected and no other clients trigger + termination. + + XFixesClientDisconnectFlagTerminate indicates to the X11 server that + it can ignore the client and terminate itself even though the client + is still connected to the X11 server. + + If XFixesClientDisconnectFlagForceTerminate is set at the time the + client disconnects, the X11 server MUST terminate and/or reset without + delivering further events to clients, even if other clients that have + not set XFixesClientDisconnectFlagTerminate are still connected. + Screen lockers SHOULD use this flag to ensure that the screen does not + unlock if they exit, which would create a security vulnerability. + Programs SHOULD NOT use this flag unless unexpected termination would + create a security vulnerability or other severe problem. + + Because XFixesClientDisconnectFlagForceTerminate allows the client to + cause the server to terminate, it is subject to security checks to + prevent unauthorized use. Servers that support the X Access Control + Extension (XACE) MUST deny attempts to set + XFixesClientDisconnectFlagForceTerminate, unless the client has + DixManageAccess to the server. Servers that support the SECURITY + extension MUST forbid untrusted clients from setting + XFixesClientDisconnectFlagForceTerminate. Servers MAY refuse to allow + clients to set this flag for other reasons. For instance, a server + might only allow the flag to be set by local clients. If the server + refuses to allow the client to set this flag, an Access error results. + + XFixesClientDisconnectFlagForceTerminate is only available in XFixes + versions 6.1 and better. + +13.2 Requests + +SetClientDisconnectMode + + disconnect-mode: CARD32 + + Sets the disconnect mode for the client. + + The disconnect-mode is a bit mask of XFixesClientDisconnectFlags. + + +GetClientDisconnectMode + + Gets the disconnect mode for the client. + + -> + + disconnect-mode: CARD32 + + The disconnect-mode is a bit mask of XFixesClientDisconnectFlags. + + +99. Future compatibility + +This extension is not expected to remain fixed. Future changes will +strive to remain compatible if at all possible. The X server will always +support version 1 of the extension protocol if requested by a client. + +Additions to the protocol will always by marked by minor version number +changes so that applications will be able to detect what requests are +supported. diff --git a/miniconda3/share/doc/xorgproto/presentproto.txt b/miniconda3/share/doc/xorgproto/presentproto.txt new file mode 100644 index 0000000000000000000000000000000000000000..56c20d4d58f9d5aef3e9213e36045735ae26a2d3 --- /dev/null +++ b/miniconda3/share/doc/xorgproto/presentproto.txt @@ -0,0 +1,931 @@ + The Present Extension + Version 1.4 + 2023-06-13 + + Keith Packard + keithp@keithp.com + Intel Corporation + +1. Introduction + +The Present extension provides a way for applications to update their +window contents from a pixmap in a well defined fashion, synchronizing +with the display refresh and potentially using a more efficient +mechanism than copying the contents of the source pixmap. + +1.1. Future Present extension versions + +This document includes speculation about future 'redirect' support +within the Present extension. All such information is subject to +change and is provided only as an aid to further Present development. + +1.2. Acknowledgments + +Eric Anholt +Owen Taylor +James Jones +Louis-Francis Ratté-Boulianne + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +2. Data Types + +PRESENTEVENTID { XID } + + Defines a unique event delivery target for Present + events. Multiple event IDs can be allocated to provide + multiple distinct event delivery contexts. + +PRESENTNOTIFY { + window: WINDOW + serial: CARD32 + } + + A list of these is passed to PresentPixmap; when the indicated + PresentPixmap completes, PresentCompletNotify events will be + delivered both to the PresentPixmap window/serial parameter as + well as each of the entries in the list of PRESENTNOTIFY parameter. + +PRESENTEVENTTYPE { PresentConfigureNotify, + PresentCompleteNotify, + PresentIdleNotify } + +PRESENTEVENTMASK { PresentConfigureNotifyMask, + PresentCompleteNotifyMask, + PresentIdleNotifyMask } + +PRESENTOPTION { PresentOptionAsync, + PresentOptionCopy, + PresentOptionUST, + PresentOptionSuboptimal, + PresentOptionAsyncMayTear } + +PRESENTCAPABILITY { PresentCapabilityAsync, + PresentCapabilityFence, + PresentCapabilityUST, + PresentCapabilityAsyncMayTear, + PresentCapabilitySyncobj } + +PRESENTCOMPLETEKIND { PresentCompleteKindPixmap, + PresentCompleteKindMSCNotify } + +PRESENTCOMPLETEMODE { PresentCompleteModeCopy, + PresentCompleteModeFlip, + PresentCompleteModeSkip, + PresentCompleteModeSuboptimalCopy } + +The Present extension also uses the Sync extension Fence data type to +provide synchronization for pixmaps. + +2.1. Data Types proposed for a later Present extension version + +PRESENTEVENTTYPE { ... + PresentRedirectNotify } + +PRESENTEVENTMASK { ... + PresentSubredirectNotifyMask } + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +3. Errors + +EventID + A value for an EventID argument does not name a defined EventID + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +5. Events + +ConfigureNotify events inform clients about window configuration +changes which can affect the allocation of window-related buffers. + +CompleteNotify events inform clients about the completion of a pending +PresentPixmap request. + +IdleNotify events inform clients when pixmaps are available for re-use. + +5.1. Events proposed for a later Present extension version + +RedirectNotify events inform clients about other clients PresentPixmap +requests. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +6. Extension Initialization + +The name of this extension is "Present" + +┌─── + PresentQueryVersion + client-major-version: CARD32 + client-minor-version: CARD32 + ▶ + major-version: CARD32 + minor-version: CARD32 +└─── + + The client sends the highest supported version to the server + and the server sends the highest version it supports, but no + higher than the requested version. Major versions changes can + introduce incompatibilities in existing functionality, minor + version changes introduce only backward compatible changes. + It is the clients responsibility to ensure that the server + supports a version which is compatible with its expectations. + + Backwards compatible changes include addition of new + requests. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +7. Extension Requests + +┌─── + PresentPixmap + window: WINDOW + pixmap: PIXMAP + serial: CARD32 + valid-area: REGION or None + update-area: REGION or None + x-off, y-off: INT16 + target-crtc: CRTC or None + wait-fence: FENCE + idle-fence: FENCE + options: SETofPRESENTOPTION + target-msc: CARD64 + divisor: CARD64 + remainder: CARD64 + notifies: LISTofPRESENTNOTIFY +└─── + Errors: Window, Pixmap, Match + + Provides new content for the specified window, to be made + visible at the specified time (defined by 'target-msc', 'divisor' + and 'remainder'). If the depth of 'pixmap' and 'window' do not + match, a Match error will be generated. + + 'serial' is an arbitrary client-specified value which will + be returned in the associated PresentCompleteNotify event so + that the client can associate the event and request. + + 'valid-area' defines the portion of 'pixmap' which contains + valid window contents, or None if the pixmap contains valid + contents for the whole window. + + 'update-area' defines the subset of the window to be updated, + or None if the whole window is to be updated. + + PresentPixmap may use any region of 'pixmap' which contains + 'update-area' and which is contained by 'valid-area'. In other + words, areas inside 'update-area' will be presented from + 'pixmap', areas outside 'valid-area' will not be presented + from 'pixmap' and areas inside 'valid-area' but outside + 'update-area' may or may not be presented at the discretion of + the X server. + + 'x-off' and 'y-off' define the location in the window where + the 0,0 location of the pixmap will be presented. valid-area + and update-area are relative to the pixmap. + + PresentPixmap will block until 'wait-fence' is triggered. + + When the X server has finished using 'pixmap' for this + operation, it will send a PresentIdleNotify event and arrange + for any 'idle-fence' to be triggered. This may be at any time + following the PresentPixmap request -- the contents may be + immediately copied to another buffer, copied just in time for + the vblank interrupt or the pixmap may be used directly for + display (in which case it will be busy until some future + PresentPixmap operation). + + If 'idle-fence' is not None, then the client guarantees to the + X server that it will wait for that fence to be signalled + before it uses the pixmap again. If 'idle-fence' is None, then + the X server must arrange for the pixmap to be re-usable by + the client as soon as the PresentIdleNotify event has been + received. Note that if PresentCapabilityFence is set for the + associated CRTC, then clients should use fences to improve + overall system performance. If PresentCapabilityFence is not + set, then using fences offers no benefit, but also no cost. + + If 'target-msc' is greater than the current msc for 'window', + the presentation will occur at (or after) the 'target-msc' + field. Otherwise, the presentation will occur after the next + field where msc % 'divisor' == 'remainder'. + + If 'target-crtc' is None, then the X server will choose a + suitable CRTC for synchronization. + + If 'options' contains PresentOptionAsync, and the 'target-msc' + is less than or equal to the current msc for 'window', then + the operation will be performed as soon as possible, not + necessarily waiting for the next vertical blank interval. If + the target-crtc does not support PresentCapabilityAsyncMayTear, + this may result in tearing. + + If the target-crtc supports PresentCapabilityAsyncMayTear, + 'options' contains PresentOptionAsyncMayTear, and the 'target-msc' + is less than or equal to the current msc for 'window', then + the operation will be performed as soon as possible, not + necessarily waiting for the next vertical blank interval, and + possibly resulting in tearing. + + If 'options' contains PresentOptionCopy, then 'pixmap' will be + idle, and 'idle-fence' triggered as soon as the operation occurs. + + If 'options' contains PresentOptionUST, then target-msc, + divisor and remainder will all be interpreted as UST values + instead of MSC values and the frame update will be scheduled + for the specified UST time, If the target-crtc supports + PresentCapabilityUST, then the swap time will be as close to + the target time as the driver can manage. Otherwise, the + server will take the target UST time and convert it to a + suitable target MSC value. + + If 'options' contains PresentOptionSuboptimal, then the + PresentCompleteNotify event can have mode + PresentCompleteModeSuboptimalCopy as the client supports it. + + After the presentation occurs, a PresentCompleteNotify event + with kind PresentCompleteKindPixmap will be generated, both to + 'window' as well as all members of 'notifies'. + + If 'window' is destroyed before the presentation occurs, then + the presentation action will not be completed. + + PresentPixmap holds a reference to 'pixmap' until the + presentation occurs, so 'pixmap' may be immediately freed + after the request executes, even if that is before the + presentation occurs. + + If 'idle-fence' is destroyed before the presentation occurs, + then idle-fence will not be signaled but the presentation will + occur normally. + + If 'wait-fence' is destroyed before it becomes triggered, then + the presentation operation will no longer wait for it and will + occur when the other conditions are satisfied. + +┌─── + PresentNotifyMSC + window: WINDOW + serial: CARD32 + target-msc: CARD64 + divisor: CARD64 + remainder: CARD64 +└─── + Errors: Window + + Delivers a PresentCompleteNotifyEvent with kind + PresentCompleteKindNotifyMSC after the time specified by + 'target-msc', 'divisor' and 'remainder'. + + 'serial' is an arbitrary client-specified value which will be + returned in the event so that the client can associate the + event and request. + + If 'target-msc' is greater than the current msc for 'window', + the event will be delivered at (or after) the 'target-msc' + field. Otherwise, the event delivery will occur after the next + field where msc % 'divisor' == 'remainder'. + + If 'window' is destroyed before the event is delivered, then + the event delivery will not be completed. + +┌─── + PresentSelectInput + event-id: PRESENTEVENTID + window: WINDOW + eventMask: SETofPRESENTEVENT +└─── + Errors: Window, Value, Match, IDchoice, Access + + Selects the set of Present events to be delivered for the + specified window and event context. PresentSelectInput can + create, modify, or delete event contexts. An event context is + associated with a specific window; using an existing event + context with a different window generates a Match error. + + If eventContext specifies an existing event context, then if + eventMask is empty, PresentSelectInput deletes the specified + context, otherwise the specified event context is changed to + select a different set of events. + + If eventContext is an unused XID, then if eventMask is empty + no operation is performed. Otherwise, a new event context is + created selecting the specified events. + +┌─── + PresentQueryCapabilities + target: CRTC or WINDOW + ▶ + capabilities: SETofPRESENTCAPABILITY +└─── + Errors: Window, CRTC + + Returns the supported capabilities for the target CRTC. If + 'target' is a CRTC, then it is used as the target CRTC. If + 'target' is a WINDOW, then the target CRTC is selected by the + X server from among the CRTCs on the screen specified by the window. + + PresentCapabilityAsyncMayTear means that the target device may be + able to flip the scanout buffer mid-frame instead of waiting for + a vertical blank interval. The precise latency between the flip + request and the actual scanout transition is not defined by this + specification, but is intended to be no more than a few + scanlines. + + If PresentCapabilityAsyncMayTear is not supported, + PresentCapabilityAsync means the same as + PresentCapabilityAsyncMayTear described above. + + If PresentCapabilityAsyncMayTear is supported, + PresentCapabilityAsync means that even if there is already a flip + pending in the target device, it may be possible to replace that + flip before the next vertical blank interval. The scanout buffer + does not change mid-frame though, i.e. there is no tearing. + + PresentCapabilityFence means that the target device can take + advantage of SyncFences in the Present operations to improve + GPU throughput. The driver must operate correctly in the + absence of fences, but may have reduced performance. Using + fences for drivers not advertising this capability should have + no performance impact. + + PresentCapabilityUST means that the target device can scanout + the image at an arbitrary UST time value, and is not driven by + a periodic scanout timer. Applications specifying UST times + for PresentPixmap can expect that their image will appear to + the user within a short amount of time from that specified in + the request. The precise accuracy of the scanout time is not + defined by the extension, but is expected to be on the order + of milliseconds or less. + + PresentCapabilitySyncobj means that the target device supports + explicit synchronization using timeline DRM synchronization + objects. See the PresentPixmapSynced request for details. + +┌─── + PresentPixmapSynced + window: WINDOW + pixmap: PIXMAP + serial: CARD32 + valid-area: REGION or None + update-area: REGION or None + x-off, y-off: INT16 + target-crtc: CRTC or None + acquire-syncobj: SYNCOBJ or None + release-syncobj: SYNCOBJ or None + acquire-point: CARD64 + release-point: CARD64 + options: SETofPRESENTOPTION + target-msc: CARD64 + divisor: CARD64 + remainder: CARD64 + notifies: LISTofPRESENTNOTIFY +└─── + Errors: Window, Pixmap, Match, Value + + Identical to the PresentPixmap request, except that instead of the + 'wait-fence' and 'idle-fence' arguments it accepts mandatory + 'acquire-syncobj' and 'release-syncobj' arguments, along with + corresponding acquire and release points, to be used for explicit + timeline-based GPU synchronization. The 'acquire-point' and + 'release-point' are assumed to correspond to timeline points on the + respective DRM syncobjs. + + The contents of the Pixmap will not be accessed by the server until the + 'acquire-point' on the acquire timeline has been signaled by the + client. The fence need not be submitted at the time the + PresentPixmapSynced request is issued. + + Once the 'release-point' on the release timeline has been signaled, the + client may assume that no further GPU or CPU access to the Pixmap by + the server will occur as part of the originating PresentPixmapSynced + request. Note that this is a stronger guarantee than what is provided + by the 'idle-fence' argument of the PresentPixmap request or the + delivery of a PresentIdleNotify event, as those do not necessarily + imply that the Pixmap is idle on the GPU. + + The server may wait for the acquire point and signal the release point + itself, as will typically happen if the request is executed by copying + the Pixmap's contents. Alternatively, it may forward the timelines, + acquire, and release points to an output sink directly, provided that + sink also supports explicit synchronization using DRM syncobjs. + + The server may signal the release point without waiting for the acquire + point if the Pixmap's contents are never accessed while servicing the + request. This may happen, for example, if a request is discarded due to + it being fully occluded by a later request. + + Beware that, if multiple Pixmaps are presented using the same release + timeline, the server makes no guarantees on the order in which the + release points will be signaled. Of particular concern is that, if the + later of the two release points is signaled before the earlier one, it + may appear to the client as though the Pixmap with the earlier release + point has been released before the server has finished its access to + it. Therefore, in general, clients are strongly advised to avoid using + the same release timeline with different Pixmaps. + + If the server does not support PresentCapabilitySyncobj, a Value error + is generated. + + If either 'acquire-syncobj' or 'release-syncobj' are None or do not + refer to previously imported syncobjs, a Value error is generated. + + If 'acquire-point' or 'release-point' is zero, a Value error is + generated. + + If 'acquire-syncobj' is equal to 'release-syncobj' and 'acquire-point' + is greater than or equal to 'release-point', a Value error is + generated. + + +7.1 Requests proposed for a later Present extension version + + These are not part of the standard and represent future plans + for the Present extension. + +┌─── + PresentSelectInput + ... +└─── + ... + + Specifying PresentSubredirectNotify Mask causes PresentPixmap + requests on any child of 'window' from other clients to + generate PresentRedirectNotify events to 'window' instead of + actually performing the operation. However, only one client at + a time can select for PresentRedirect on a window. An attempt + to violate this restriction results in an Access error. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +8. Extension Events + +┌─── + PresentConfigureNotify + type: CARD8 XGE event type (35) + extension: CARD8 Present extension request number + sequence-number: CARD16 + length: CARD32 2 + evtype: CARD16 Present_ConfigureNotify + eventID: PRESENTEVENTID + window: WINDOW + x: INT16 + y: INT16 + width: CARD16 + height: CARD16 + off_x: INT16 + off_y: INT16 + pixmap_width: CARD16 + pixmap_height: CARD16 + pixmap_flags: CARD32 +└─── + + PresentConfigureNotify events are sent when the window + configuration changes if PresentSelectInput has requested + it. PresentConfigureNotify events are XGE events and so do not + have a unique event type. + + 'x' and 'y' are the parent-relative location of 'window'. + +┌─── + PresentCompleteNotify + type: CARD8 XGE event type (35) + extension: CARD8 Present extension request number + sequence-number: CARD16 + length: CARD32 2 + evtype: PRESENTEVENTTYPE PresentCompleteNotify + eventID: PRESENTEVENTID + window: WINDOW + kind: PRESENTCOMPLETEKIND + mode: PRESENTCOMPLETEMODE + serial: CARD32 + ust: CARD64 + msc: CARD64 +└─── + + CompleteNotify events are delivered when a PresentPixmap or + PresentNotifyMSC operation has completed. + + 'kind' is PresentCompleteKindPixmap when generated by a + PresentPixmap operation completion or + PresentCompleteKindNotifyMsc when generated by a + PresentNotifyMSC operation completion. + + 'mode' is PresentCompleteModeCopy when the source pixmap + contents are taken from the pixmap and the pixmap is idle + immediately after the presentation completes. 'mode' is + PresentCompleteModeSuboptimalCopy when the source pixmap + contents are copied but it would be possible to flip the + pixmap if the buffer format/modifier was different (options + given to PresentPixmap must contain PresentOptionSuboptimal). + 'mode' is PresentCompleteModeFlip when the pixmap remains in-use + even after the presentation completes. It will become idle no + later than when the next PresentPixmap operation targeting the + same window by any client completes. If the presentation + operation was skipped because some later operation made it + irrelevant, then 'mode' will be PresentCompleteModeSkip. + + 'serial' is the value provided in the generating PresentPixmap + request. + + 'msc' and 'ust' indicate the frame count and system time when + the presentation actually occurred. + +┌─── + PresentIdleNotify + type: CARD8 XGE event type (35) + extension: CARD8 Present extension request number + sequence-number: CARD16 + length: CARD32 0 + evtype: PRESENTEVENTTYPE PresentIdleNotify + eventID: PRESENTEVENTID + window: WINDOW + serial: CARD32 + pixmap: PIXMAP + idle-fence: FENCE +└─── + + IdleNotify events are delivered when a pixmap used in a + PresentPixmap operation may be re-used by the client. + + 'window' is the window from the PresentPixmap to which this + event is delivered. + + 'serial' is the value provided in the associated PresentPixmap + request. + + 'pixmap' is the pixmap which is ready for re-use. + + 'idle-fence' is the fence which was provided in the + originating PresentPixmap request and is used to synchronize + rendering between the client and the X server's use of the + buffer. If not None, then the client must wait for the fence + to be signaled before using the pixmap. + +8.1. Extension Events proposed for a later Present extension version + +┌─── + PresentRedirectNotify + type: CARD8 XGE event type (35) + extension: CARD8 Present extension request number + sequence-number: CARD16 + length: CARD32 17 + 2 n + evtype: CARD16 Present_RedirectNotify + update-window: BOOL + + eventID: PRESENTEVENTID + event-window: WINDOW + window: WINDOW + pixmap: PIXMAP + serial: CARD32 + + valid-area: REGION + update-area: REGION + valid-rect: RECTANGLE + update-rect: RECTANGLE + x-off, y-off: INT16 + target-crtc: CRTC + wait-fence: FENCE + idle-fence: FENCE + options: SETofPRESENTOPTION + target-msc: CARD64 + divisor: CARD64 + remainder: CARD64 + notifies: LISTofPRESENTNOTIFY +└─── + + RedirectNotify events are delivered when the client has + selected for SubredirectNotify the parent of the target + window. All of the values provided to the PresentPixmap + request are provided. If the client simply passes these + parameters back to the X server, the effect will be as if the + original client executed the request. + + If 'update-window' is TRUE, then there are clients who have + requested composite automatic redirect on the window and who + presumably expect the window buffer to eventually contain + the application provided contents. The compositing manager + should at least occasionally update the window buffer with + suitable contents. The precise update interval is left to the + discretion of the client receiving this event. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +9. Extension Versioning + + 1.0: First published version + + 1.2: Added PresentCompleteModeSuboptimalCopy flag and + PresentOptionSuboptimal option + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + + +10. Relationship with other extensions + +As an extension designed to support other extensions, there is +naturally some interactions with other extensions. + +10.1 GLX + +GLX is both an application interface and an X extension. OpenGL +applications using the GLX API will use the GLX extension and may use +the Present extension to display application contents. + +10.2 DRI3 + +The DRI3 extension provides a way to share direct rendered pixel data +with the X server as X pixmaps. When used in conjunction with Present, +they provide a complete direct rendering solution for OpenGL or other +APIs. + +10.3 DRI2 + +Present provides similar functionality to the DRI2SwapBuffers and +requests, however Present uses X pixmaps to refer to the new window +contents instead of the DRI2 buffer attachments. + +Present and DRI3 are designed in conjunction to replace DRI2. + +10.4 XvMC / Xv + +It might be nice to be able to use YUV formatted objects as Present +sources. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +Appendix A. Protocol Encoding + +Syntactic Conventions + +This document uses the same syntactic conventions as the core X +protocol encoding document. + + +A.1 Common Types +┌─── + PresentEventType + 0 PresentConfigureNotify + 1 PresentCompleteNotify + 2 PresentIdleNotify +└─── + +┌─── + PresentEventMask + 1 PresentConfigureNotifyMask + 2 PresentCompleteNotifyMask + 4 PresentIdleNotifyMask +└─── + +┌─── + PresentOption + 1 PresentOptionAsync + 2 PresentOptionCopy; + 4 PresentOptionUST + 8 PresentOptionSuboptimal + 16 PresentOptionAsyncMayTear +└─── + +┌─── + PresentCapability + 1 PresentCapabilityAsync + 2 PresentCapabilityFence + 4 PresentCapabilityUST + 8 PresentCapabilityAsyncMayTear +└─── + +┌─── + PresentCompleteKind + 0 PresentCompleteKindPixmap + 1 PresentCompleteKindMSCNotify +└─── + +┌─── + PresentCompleteMode + 0 PresentCompleteModeCopy + 1 PresentCompleteModeFlip + 2 PresentCompleteModeSkip + 3 PresentCompleteModeSuboptimalCopy +└─── + +┌─── + PresentNotify + 4 Window window + 4 CARD32 serial +└─── + +A.1.1 Common Types proposed for a later Present extension version + +┌─── + PresentEventType + ... + 3 PresentRedirectNotify +└─── + +┌─── + PresentEventMask + ... + 8 PresentSubredirectNotifyMask +└─── + +A.2 Protocol Requests + +┌─── + PresentQueryVersion + 1 CARD8 major opcode + 1 0 Present opcode + 2 3 length + 4 CARD32 major version + 4 CARD32 minor version + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 4 CARD32 major version + 4 CARD32 minor version + 16 unused +└─── + +┌─── + PresentPixmap + 1 CARD8 major opcode + 1 1 Present opcode + 2 18+2n length + 4 Window window + 4 Pixmap pixmap + 4 CARD32 serial + 4 Region valid-area + 4 Region update-area + 2 INT16 x-off + 2 INT16 y-off + 4 CRTC target-crtc + 4 SyncFence wait-fence + 4 SyncFence idle-fence + 4 CARD32 options + 4 unused + 8 CARD64 target-msc + 8 CARD64 divisor + 8 CARD64 remainder + 8n LISTofPresentNotify notifies +└─── + +┌─── + PresentNotifyMSC + 1 CARD8 major opcode + 1 2 Present opcode + 2 10 length + 4 Window window + 4 CARD32 serial + 4 unused + 8 CARD64 target-msc + 8 CARD64 divisor + 8 CARD64 remainder +└─── + +┌─── + PresentSelectInput + 1 CARD8 major opcode + 1 3 Present opcode + 2 4 length + 4 EventID event-id + 4 Window window + 4 SETofPRESENTEVENTMASK event-mask +└─── + +┌─── + PresentQueryCapabilities + 1 CARD8 major opcode + 1 4 Present opcode + 2 2 length + 4 CRTC or Window target + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 4 SETofPRESENTCAPABILITY capabilities +└─── + +┌─── + PresentPixmapSynced + 1 CARD8 major opcode + 1 5 Present opcode + 2 22+2n length + 4 Window window + 4 Pixmap pixmap + 4 CARD32 serial + 4 Region valid-area + 4 Region update-area + 2 INT16 x-off + 2 INT16 y-off + 4 CRTC target-crtc + 4 SYNCOBJ acquire-syncobj + 4 SYNCOBJ release-syncobj + 8 CARD64 acquire-point + 8 CARD64 release-point + 4 CARD32 options + 4 unused + 8 CARD64 target-msc + 8 CARD64 divisor + 8 CARD64 remainder + 8n LISTofPresentNotify notifies +└─── + +A.3 Protocol Events + +┌─── + PresentConfigureNotify + 1 35 XGE + 1 CARD8 Present extension opcode + 2 CARD16 sequence number + 4 2 length + 2 0 PresentConfigureNotify + 2 unused + 4 CARD32 event id + 4 Window window + 2 INT16 x + 2 INT16 y + 2 CARD16 width + 2 CARD16 height + 2 INT16 off x + 2 INT16 off y + + 2 CARD16 pixmap width + 2 CARD16 pixmap height + 4 CARD32 pixmap flags +└─── + +┌─── + PresentCompleteNotify + 1 35 XGE + 1 CARD8 Present extension opcode + 2 CARD16 sequence number + 4 2 length + 2 1 PresentCompleteNotify + 1 CARD8 kind + 1 CARD8 mode + 4 CARD32 event id + 4 Window window + 4 CARD32 serial + 8 CARD64 ust + + 8 CARD64 msc +└─── + +┌─── + PresentIdleNotify + 1 35 XGE + 1 CARD8 Present extension opcode + 2 CARD16 sequence number + 4 0 length + 2 2 PresentIdleNotify + 2 unused + 4 CARD32 event id + 4 Window window + 4 CARD32 serial + 4 Pixmap pixmap + 4 SyncFence idle-fence +└─── + +A.3.1 Protocol Events proposed for later Present extension version + +┌─── + PresentRedirectNotify + 1 35 XGE + 1 CARD8 Present extension opcode + 2 CARD16 sequence number + 4 18+2n length + 2 3 PresentRedirectNotify + 1 BOOL update-window + 1 unused + 4 CARD32 event id + 4 Window event-window + 4 Window window + 4 Pixmap pixmap + 4 CARD32 serial + + 4 Region valid-area + 4 Region update-area + 8 Rectangle valid-rect + 8 Rectangle update-rect + 2 INT16 x-off + 2 INT16 y-off + 4 CRTC target-crtc + 4 SyncFence wait-fence + 4 SyncFence idle-fence + 4 CARD32 options + 4 unused + 8 CARD64 target-msc + 8 CARD64 divisor + 8 CARD64 remainder + 8n LISTofPRESENTNOTIFY notifies +└─── + +A.4 Protocol Errors + +The Present extension defines no errors. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ diff --git a/miniconda3/share/doc/xorgproto/randrproto.txt b/miniconda3/share/doc/xorgproto/randrproto.txt new file mode 100644 index 0000000000000000000000000000000000000000..7156e929a5c22a29a51f3172f7e17a83f7940241 --- /dev/null +++ b/miniconda3/share/doc/xorgproto/randrproto.txt @@ -0,0 +1,3435 @@ + The X Resize, Rotate and Reflect Extension + Version 1.6.0 + 2017-04-01 + + Jim Gettys + Jim.Gettys@hp.com + Cambridge Research Laboratory + HP Labs + Hewlett Packard Company + + Keith Packard + keithp@keithp.com + +1. Introduction + +The X Resize, Rotate and Reflect Extension, called RandR for short, +brings the ability to resize, rotate and reflect the root window of a +screen. It is based on the X Resize and Rotate Extension as specified +in the Proceedings of the 2001 Usenix Technical Conference [RANDR]. + +RandR as implemented and integrated into the X server differs in +one substantial fashion from the design discussed in that paper: that +is, RandR 1.0 does not implement the depth switching described in that +document, and the support described for that in the protocol in that +document and in the implementation has been removed from the +protocol described here, as it has been overtaken by events. + +These events include: + ► Modern toolkits (in this case, GTK+ 2.x) have progressed to the point + of implementing migration between screens of arbitrary depths + ► The continued advance of Moore's law has made limited amounts of VRAM + less of an issue, reducing the pressure to implement depth switching + on laptops or desktop systems + ► The continued decline of legacy toolkits whose design would have + required depth switching to support migration + ► The lack of depth switching implementation experience in the + intervening time, due to events beyond our control + +Additionally, the requirement to support depth switching might +complicate other re-engineering of the device independent part of the +X server that is currently being contemplated. + +Rather than further delaying RandR's widespread deployment for a feature +long wanted by the community (resizing of screens, particularly on laptops), +or the deployment of a protocol design that might be flawed due to lack of +implementation experience, we decided to remove depth switching from the +protocol. It may be implemented at a later time if resources and +interests permit as a revision to the protocol described here, which will +remain a stable base for applications. The protocol described here has been +implemented in the main X.org server, and more fully in the hw/kdrive +implementation in the distribution, which fully implements resizing, +rotation and reflection. + +1.2 Introduction to version 1.2 of the extension + +One of the significant limitations found in version 1.1 of the RandR +protocol was the inability to deal with the Xinerama model where multiple +monitors display portions of a common underlying screen. In this environment, +zero or more video outputs are associated with each CRT controller which +defines both a set of video timings and a 'viewport' within the larger +screen. This viewport is independent of the overall size of the screen, and +may be located anywhere within the screen. + +The effect is to decouple the reported size of the screen from the size +presented by each video output, and to permit multiple outputs to present +information for a single screen. + +To extend RandR for this model, we separate out the output, CRTC and screen +configuration information and permit them to be configured separately. For +compatibility with the 1.1 version of the protocol, we make the 1.1 requests +simultaneously affect both the screen and the (presumably sole) CRTC and +output. The set of available outputs are presented with UTF-8 encoded names +and may be connected to CRTCs as permitted by the underlying hardware. CRTC +configuration is now done with full mode information instead of just size +and refresh rate, and these modes have names. These names also use UTF-8 +encoding. New modes may also be added by the user. + +Additional requests and events are provided for this new functionality. + + ┌────────────────────────────────┬──────────┐ + ┏━━━━━━━┳───────────────┐ ╔════════╗ ╔════════╗ + ┃ 1 ┃ │ ║ A ║ ║ B ║ + ┃ ┏━━━╋━━━━━━━━━━━━━━━┫ ║ ║ ║ ║ + ┣━━━╋━━━┛ ┃ ╚════════╝ ╚════════╝ + │ ┃ 2 ┃─────────────────┐ + │ ┃ ┃ ╔═══════════════════╗ + │ ┃ ┃ ║ ║ + │ ┗━━━━━━━━━━━━━━━━━━━┫ ║ C ║ + └───────────────────────┘ ║ ║ + ┌──────┐ ┏━━━━┓ ╔══════╗ ║ ║ + │screen│ ┃CRTC┃ ║output║ ╚═══════════════════╝ + └──────┘ ┗━━━━┛ ╚══════╝ + +In this picture, the screen is covered (incompletely) by two CRTCs. CRTC1 +is connected to two outputs, A and B. CRTC2 is connected to output C. +Outputs A and B will present exactly the same region of the screen using +the same mode line. Output C will present a different (larger) region of +the screen using a different mode line. + +RandR provides information about each available CRTC and output; the +connection between CRTC and output is under application control, although +the hardware will probably impose restrictions on the possible +configurations. The protocol doesn't try to describe these restrictions, +instead it provides a mechanism to find out what combinations are supported. + +1.3 Introduction to version 1.3 of the extension + +Version 1.3 builds on the changes made with version 1.2 and adds some new +capabilities without fundamentally changing the extension again. The +following features are added in this version: + + • Projective Transforms. The implementation work for general rotation + support made it trivial to add full projective transformations. These + can be used to scale the screen up/down as well as perform projector + keystone correct or other effects. + + • Panning. It was removed with RandR 1.2 because the old semantics didn't + fit any longer. With RandR 1.3 panning can be specified per crtc. + +1.4 Introduction to version 1.4 of the extension + +Version 1.4 adds an optional Border property. + + • An optional Border property. This property allows a client to + specify that the viewport of the CRTC is smaller than the active + display region described its mode. This is useful, for example, + for compensating for the overscan behavior of certain + televisions. + +Version 1.4 adds a new object called a provider object. A provider object +represents a GPU or virtual device providing services to the X server. +Providers have a set of abilities and a set of possible roles. + +Provider objects are used to control multi-GPU systems. Provider roles can +be dynamically configured to provide support for: + + 1) Output slaving: plug in a USB device, but have its output rendered + using the main GPU. On some dual-GPU laptops, the second GPU isn't + connected to the LVDS panel, so we need to use the first GPU as an output + slave for the second GPU. + + 2) offload - For dual-GPU laptops, allow direct rendered applications to be run + on the second GPU and display on the first GPU. + + 3) GPU switching - Allow switching between two GPUs as the main screen + renderer. + + 4) multiple GPU rendering - This replaces Xinerama. + +1.5. Introduction to version 1.5 of the extension + +Version 1.5 adds an optional TILE property to outputs. + + • An optional TILE property. + This property is used to denote individual tiles in a tiled monitor + configuration, as exposed via DisplayID v1.3. + +Version 1.5 adds monitors + + • A 'Monitor' is a rectangular subset of the screen which represents + a coherent collection of pixels presented to the user. + + • Each Monitor is associated with a list of outputs (which may be + empty). + + • When clients define monitors, the associated outputs are removed from + existing Monitors. If removing the output causes the list for that + monitor to become empty, that monitor will be deleted. + + • For active CRTCs that have no output associated with any + client-defined Monitor, one server-defined monitor will + automatically be defined of the first Output associated with them. + + • When defining a monitor, setting the geometry to all zeros will + cause that monitor to dynamically track the bounding box of the + active outputs associated with them + +This new object separates the physical configuration of the hardware +from the logical subsets of the screen that applications should +consider as single viewable areas. + +1.5.1. Relationship between Monitors and Xinerama + +Xinerama's information now comes from the Monitors instead of directly +from the CRTCs. The Monitor marked as Primary will be listed first. + +1.5.2. Clarification of Output lifetimes + +With dynamic connectors being a possibility with the introduction of +DisplayPort multistream (MST), a lot of RandR clients can't handle the +XID BadMatch when a RandR output disappears. This is to clarify that +going forward the X server will not remove outputs dynamically, +just mark them as disconnected. + +1.6. Introduction to version 1.6 of the extension + +Version 1.6 adds resource leasing and non desktop output management. + + • A “Lease” is a collection of crtcs and outputs which are made + available to a client for direct access via kernel KMS and DRM + APIs. This is done by passing a suitable file descriptor back to + the client which has access to those resources. While leased, those + resources aren't used by the X server. + + • A “non-desktop” output is a device which should not normally be + considered as part of the desktop environment. Head-mounted + displays and the Apple "Touch Bar" are examples of such + devices. A desktop environment should be able to discover which + outputs are connected to such devices and, by default, not present + normal desktop applications on them. This is done by having + RRGetOutputInfo report such devices as Disconnected while reporting + all other information about the device correctly. + +1.99 Acknowledgments + +Our thanks to the contributors to the design found on the xpert mailing +list, in particular: + +Alan Hourihane for work on the early implementation +Andrew C. Aitchison for help with the XFree86 DDX implementation +Andy Ritger for early questions about how mergefb/Xinerama work with RandR +Carl Worth for editing the specification and Usenix paper +David Dawes for XFree86 DDX integration work +Thomas Winischhofer for the hardware-accelerated SiS rotation implementation +Matthew Tippett and Kevin Martin for splitting outputs and CRTCs to more +fully expose what video hardware can do +Dave Airlie for the 1.4.0 protocol changes and for working through the +implications of MST monitors and encouraging the introduction of the +'Monitor' concept. + + ❧❧❧❧❧❧❧❧❧❧❧ + +2. Screen change model + +Screens may change dynamically, either under control of this extension, or +due to external events. Examples include: monitors being swapped, pressing a +button to switch from internal display to an external monitor on a laptop, +or, eventually, the hotplug of a display card entirely on buses such as +Cardbus or Express Card which permit hot-swap (which will require other work +in addition to this extension). + +Since the screen configuration is dynamic and asynchronous to the client and +may change at any time RandR provides mechanisms to ensure that your clients +view is up to date with the configuration possibilities of the moment and +enforces applications that wish to control the configuration to prove that +their information is up to date before honoring requests to change the +screen configuration (by requiring a timestamp on the request). + +Interested applications are notified whenever the screen configuration +changes, providing the current size of the screen and subpixel order (see +the Render extension [RENDER]), to enable proper rendering of subpixel +decimated client text to continue, along with a time stamp of the +configuration change. A client must refresh its knowledge of the screen +configuration before attempting to change the configuration after a +notification, or the request will fail. + +To avoid multiplicative explosion between orientation, reflection and sizes, +the sizes are only those sizes in the normal (0) rotation. + +Rotation and reflection and how they interact can be confusing. In Randr, +the coordinate system is rotated in a counter-clockwise direction relative +to the normal orientation. Reflection is along the window system coordinate +system, not the physical screen X and Y axis, so that rotation and +reflection do not interact. The other way to consider reflection is to is +specified in the "normal" orientation, before rotation, if you find the +other way confusing. + +We expect that most clients and toolkits will be oblivious to changes to the +screen structure, as they generally use the values in the connections Display +structure directly. By toolkits updating the values on the fly, we believe +pop-up menus and other pop up windows will position themselves correctly in +the face of screen configuration changes (the issue is ensuring that pop-ups +are visible on the reconfigured screen). + + ❧❧❧❧❧❧❧❧❧❧❧ + +3. Data Types + +The subpixel order and transform data types are shared with the Render +extension, and are documented there. + +The only datatype defined in the original extension is the screen size, +defined in the normal (0 degree) orientation. Several more are added +in later revisions. + + ❧❧❧❧❧❧❧❧❧❧❧ + +4. Errors + +Errors are sent using core X error reports. + +Output + A value for an OUTPUT argument does not name a defined OUTPUT. +CRTC + A value for a CRTC argument does not name a defined CRTC. +Mode + A value for a MODE argument does not name a defined MODE. +Provider + A value for a PROVIDER argument does not name a defined PROVIDER. +Lease + A value for a LEASE argument does not name a defined LEASE + + ❧❧❧❧❧❧❧❧❧❧❧ + +5. Protocol Types + +RRCONFIGSTATUS { Success + InvalidConfigTime + InvalidTime + Failed } + + A value of type RRCONFIGSTATUS returned when manipulating the output + configuration or querying information from the server that has some + time-dependency. + + InvalidConfigTime indicates that the supplied configuration + timestamp does not match the current X server configuration + timestamp. Usually this means that the output configuration has + changed since the timestamp was received by the application. + + InvalidTime indicates that the supplied output reconfiguration time + is earlier than the most recent output reconfiguration request. + Generally this indicates that another application has reconfigured + the output using a later timestamp. + + Failed is returned whenever the operation is unsuccessful for some + other reason. This generally indicates that the requested output + configuration is unsupported by the hardware. The goal is to make + these limitations expressed by the protocol, but when that isn't + possible it is correct to return this error value. If, as a + implementer, you find this error code required, please submit the + hardware constraints that exist so that a future version of the + extension can correctly capture the configuration constraints in + your system. + +ROTATION { Rotate_0 + Rotate_90 + Rotate_180 + Rotate_270 + Reflect_X + Reflect_Y } + + These values are used both to indicate a set of allowed rotations + and reflections as well as to indicate a specific rotation and + reflection combination. + +RRSELECTMASK { RRScreenChangeNotifyMask + RRCrtcChangeNotifyMask (New in version 1.2) + RROutputChangeNotifyMask (New in version 1.2) + RROutputPropertyNotifyMask (New in version 1.2) + RRProviderChangeNotifyMask (New in version 1.4) + RRProviderPropertyNotifyMask (New in version 1.4) + RRResourceChangeNotifyMask (New in version 1.4) } + +SIZEID { CARD16 } + +MODE { XID or None } + +CRTC { XID } + +OUTPUT { XID } + +CONNECTION { Connected, Disconnected, UnknownConnection } + + This value provides an indication of whether an output is actually + connected to a monitor or other presentation device. + + +SCREENSIZE [ widthInPixels, heightInPixels: CARD16 + widthInMillimeters, heightInMillimeters: CARD16 ] + +MODEFLAG { HSyncPositive + HSyncNegative + VSyncPositive + VSyncNegative + Interlace + DoubleScan + CSync + CSyncPositive + CSyncNegative + HSkewPresent + BCast + PixelMultiplex + DoubleClock + ClockDivideBy2 } + +MODEINFO [ id: MODE + name: STRING + width, height: CARD16 + dotClock: CARD32 + hSyncStart, hSyncEnd, hTotal, hSkew: CARD16 + vSyncStart, vSyncEnd, vTotal: CARD16 + modeFlags: SETofMODEFLAG ] + +REFRESH [ rates: LISTofCARD16 ] + + ❧❧❧❧❧❧❧❧❧❧❧ + +5.1 Data Types defined by the Render extension + +These data types use the Render extension definitions; they are shown here +only for convenience: + +SUBPIXELORDER { SubPixelUnknown + SubPixelHorizontalRGB + SubPixelHorizontalBGR + SubPixelVerticalRGB + SubPixelVerticalBGR + SubPixelNone } + +FIXED 32-bit value (top 16 are integer portion, bottom 16 are fraction) + +TRANSFORM [ + p11, p12, p13: FIXED + p21, p22, p23: FIXED + p31, p32, p33: FIXED + ] + + ❧❧❧❧❧❧❧❧❧❧❧ + +5.5. Protocol Types added in version 1.4 of the extension + +PROVIDER { XID } + +PROVIDER_CAPS { SourceOutput, SinkOutput, SourceOffload, SinkOffload } + Capabilities for this provider: + SourceOutput: This device can source output buffers. + SinkOutput: This device can sink output buffers. + SourceOffload: This device can source offload buffers. + SinkOffload: This device can sink offload buffers. + + ❧❧❧❧❧❧❧❧❧❧❧ + +5.6. Protocol Types added in version 1.5 of the extension + +MONITORINFO { name: ATOM + primary: BOOL + automatic: BOOL + x: INT16 + y: INT16 + width: CARD16 + height: CARD16 + width-in-millimeters: CARD32 + height-in-millimeters: CARD32 + outputs: LISTofOUTPUT } + + ❧❧❧❧❧❧❧❧❧❧❧ + +5.7. Protocol Types added in version 1.6 of the extension + +LEASE { XID } + + ❧❧❧❧❧❧❧❧❧❧❧ + +6. Extension Initialization + +The name of this extension is "RANDR". + +┌─── + RRQueryVersion + client-major-version: CARD32 + client-minor-version: CARD32 + ▶ + major-version: CARD32 + minor-version: CARD32 +└─── + + The client sends the highest supported version to the server + and the server sends the highest version it supports, but no + higher than the requested version. Major versions changes can + introduce incompatibilities in existing functionality, minor + version changes introduce only backward compatible changes. + It is the clients responsibility to ensure that the server + supports a version which is compatible with its expectations. + + ❧❧❧❧❧❧❧❧❧❧❧ + +7. Extension Requests + +┌─── + RRSelectInput + window: WINDOW + enable: SETofRRSELECTMASK +└─── + Errors: Window, Value + + If 'enable' is RRScreenChangeNotifyMask, RRScreenChangeNotify events + will be sent when the screen configuration changes, either from + this protocol extension, or due to detected external screen + configuration changes. RRScreenChangeNotify may also be sent when + this request executes if the screen configuration has changed since + the client connected, to avoid race conditions. + + New for version 1.2: + + If 'enable' contains RRCrtcChangeNotifyMask, RRCrtcChangeNotify events + will be sent when the configuration for a CRTC associated with the + screen changes, either through this protocol extension or due to + detected external changes. RRCrtcChangeNotify may also be sent when + this request executes if the CRTC configuration has changed since + the client connected, to avoid race conditions. + + If 'enable' contains RROutputChangeNotifyMask, RROutputChangeNotify + events will be sent when the configuration for an output associated with + the screen changes, either through this protocol extension or due to + detected external changes. RROutputChangeNotify may also be sent when + this request executes if the output configuration has changed since the + client connected, to avoid race conditions. + + If 'enable' contains RROutputPropertyNotifyMask, + RROutputPropertyNotify events will be sent when properties change on + this output. + + New for version 1.4: + + If 'enable' contains RRProviderChangeNotifyMask, + RRProviderChangeNotify events will be sent whenever the role for a + provider object has changed. + + If 'enable' contains RRProviderPropertyNotifyMask, + RRProviderPropertyNotify events will be sent when properties change + on a provider object. + + If 'enable' contains RRResourceChangeNotifyMask, + RRResourceChangeNotify events will be sent whenever the set of + available RandR resources associated with the screen has changed. + +┌─── + RRSetScreenConfig + window: WINDOW + timestamp: TIMESTAMP + config-timestamp: TIMESTAMP + size-id: SIZEID + rotation: ROTATION + rate: CARD16 + ▶ + status: RRCONFIGSTATUS + new-timestamp: TIMESTAMP + config-timestamp: TIMESTAMP + root: WINDOW + subpixelOrder: SUBPIXELORDER +└─── + Errors: Value, Match + + If 'timestamp' is less than the time when the configuration was last + successfully set, the request is ignored and InvalidTime returned in + status. + + If 'config-timestamp' is not equal to when the server's screen + configurations last changed, the request is ignored and + InvalidConfigTime returned in status. This could occur if the + screen changed since you last made a RRGetScreenInfo request, + perhaps by a different piece of display hardware being installed. + Rather than allowing an incorrect call to be executed based on stale + data, the server will ignore the request. + + 'rate' contains the desired refresh rate. If it is zero, the server + selects an appropriate rate. + + This request may fail for other indeterminate reasons, in which case + 'status' will be set to Failed and no configuration change will be + made. + + This request sets the screen to the specified size, rate, rotation + and reflection. + + When this request succeeds, 'status' contains Success and the + requested changes to configuration will have been made. + + 'new-time-stamp' contains the time at which this request was + executed. + + 'config-timestamp' contains the time when the possible screen + configurations were last changed. + + 'root' contains the root window for the screen indicated by the + window. + + 'subpixelOrder' contains the resulting subpixel order of the screen + to allow correct subpixel rendering. + + Value errors are generated when 'rotation', 'rate' or 'size-id' + are invalid. + +┌─── + RRGetScreenInfo + window: WINDOW + ▶ + rotations: SETofROTATION + root: WINDOW + timestamp: TIMESTAMP + config-timestamp: TIMESTAMP + size-id: SIZEID + rotation: ROTATION + rate: CARD16 + sizes: LISTofSCREENSIZE + refresh: LISTofREFRESH +└─── + + Errors: Window + + RRGetScreenInfo returns information about the current and available + configurations for the screen associated with 'window'. + + 'rotations' contains the set of rotations and reflections supported + by the screen. + + 'root' is the root window of the screen. + + 'config-timestamp' indicates when the screen configuration + information last changed: requests to set the screen will fail + unless the timestamp indicates that the information the client + is using is up to date, to ensure clients can be well behaved + in the face of race conditions. + + 'timestamp' indicates when the configuration was last set. + + 'size-id' indicates which size is active. + + 'rate' is the current refresh rate. This is zero when the refresh + rate is unknown or on devices for which refresh is not relevant. + + 'sizes' is the list of possible frame buffer sizes (at the normal + orientation). Each size indicates both the linear physical size of + the screen and the pixel size. + + 'refresh' is the list of refresh rates for each size. Each element + of 'sizes' has a corresponding element in 'refresh'. An empty list + indicates no known rates, or a device for which refresh is not + relevant. + + The default size of the screen (the size that would become the + current size when the server resets) is the first size in the + list. + +7.1. Extension Requests added in version 1.2 of the extension + +As introduced above, version 1.2 of the extension splits the screen size +from the crtc and output configuration, permitting the subset of the screen +presented by multiple outputs to be configured. As a separate notion, the +size of the screen itself may be arbitrarily configured within a defined +range. As crtcs and outputs are added and removed from the system, the set +returned by the extension will change so that applications can detect +dynamic changes in the display environment. + +┌─── + RRGetScreenSizeRange + window: WINDOW + ▶ + CARD16 minWidth, minHeight + CARD16 maxWidth, maxHeight +└─── + Errors: Window + + Returns the range of possible screen sizes. The screen may be set to + any size within this range. + +┌─── + RRSetScreenSize + window: WINDOW + width: CARD16 + height: CARD16 + width-in-millimeters: CARD32 + height-in-millimeters: CARD32 +└─── + Errors: Window, Match, Value + + Sets the screen to the specified size. 'width' and 'height' must be + within the range allowed by GetScreenSizeRanges, otherwise a Value + error results. All active monitors must be configured to display a + subset of the specified size, else a Match error results. + + 'width-in-millimeters' and 'height-in-millimeters' can be set to + reflect the physical size of the screen reported both through this + extension and the core protocol. They must be non-zero, or Value + error results. + + If panning is enabled, the width and height of the panning and the + tracking areas are adapted to the new size and clamped afterwards. + Disabled panning axes remain disabled. + Panning borders are disabled if their requirements are no longer met + (see RRSetPanning). + +┌─── + RRGetScreenResources + window: WINDOW + ▶ + timestamp: TIMESTAMP + config-timestamp: TIMESTAMP + crtcs: LISTofCRTC + outputs: LISTofOUTPUT + modes: LISTofMODEINFO +└─── + Errors: Window + + RRGetScreenResources returns the list of outputs and crtcs connected + to the screen associated with 'window'. + + 'timestamp' indicates when the configuration was last set. + + 'config-timestamp' indicates when the configuration information last + changed. Requests to configure the output will fail unless the + timestamp indicates that the information the client is using is up + to date, to ensure clients can be well behaved in the face of race + conditions. + + 'crtcs' contains the list of CRTCs associated with the screen. + + 'outputs' contains the list of outputs associated with the screen. + + 'modes' contains the list of modes associated with the screen + + This request explicitly asks the server to ensure that the + configuration data is up-to-date wrt the hardware. If that requires + polling, this is when such polling would take place. If the + current configuration is all that's required, use + RRGetScreenResourcesCurrent instead. + +┌─── + RRGetOutputInfo + output: OUTPUT + config-timestamp: TIMESTAMP + ▶ + status: RRCONFIGSTATUS + timestamp: TIMESTAMP + crtc: CRTC + + name: STRING + connection: CONNECTION + subpixel-order: SUBPIXELORDER + widthInMillimeters, heightInMillimeters: CARD32 + crtcs: LISTofCRTC + clones: LISTofOUTPUT + modes: LISTofMODE + num-preferred: CARD16 +└─── + Errors: Output + + RRGetOutputInfo returns information about the current and available + configurations 'output'. + + If 'config-timestamp' does not match the current configuration + timestamp (as returned by RRGetScreenResources), 'status' is set to + InvalidConfigTime and the remaining reply data is empty. Otherwise, + 'status' is set to Success. + + 'timestamp' indicates when the configuration was last set. + + 'crtc' is the current source CRTC for video data, or Disabled if the + output is not connected to any CRTC. + + 'name' is a UTF-8 encoded string designed to be presented to the + user to indicate which output this is. E.g. "S-Video" or "DVI". + + 'connection' indicates whether the hardware was able to detect a + device connected to this output. If the hardware cannot determine + whether something is connected, it will set this to + UnknownConnection. + + 'subpixel-order' contains the resulting subpixel order of the + connected device to allow correct subpixel rendering. + + 'widthInMillimeters' and 'heightInMillimeters' report the physical + size of the displayed area. If unknown, or not really fixed (e.g., + for a projector), these values are both zero. + + 'crtcs' is the list of CRTCs that this output may be connected to. + Attempting to connect this output to a different CRTC results in a + Match error. + + 'clones' is the list of outputs which may be simultaneously + connected to the same CRTC along with this output. Attempting to + connect this output with an output not in the 'clones' list + results in a Match error. + + 'modes' is the list of modes supported by this output. Attempting to + connect this output to a CRTC not using one of these modes results + in a Match error. + + The first 'num-preferred' modes in 'modes' are preferred by the + monitor in some way; for fixed-pixel devices, this would generally + indicate which modes match the resolution of the output device. + + Changes in version 1.6 of the protocol: + + When a “non-desktop” device is connected, the 'connection' + field will report Disconnected but the remaining fields will + report information about the connected device. + +┌─── + RRListOutputProperties + output:OUTPUT + ▶ + atoms: LISTofATOM +└─── + Errors: Output + + This request returns the atoms of properties currently defined on + the output. + + Changes in version 1.6 of the protocol: + + When a “non-desktop” device is connected, the property list + will be correct for the device, even though RRGetOutputInfo + reports the device as disconnected. + +┌─── + RRQueryOutputProperty + output: OUTPUT + property: ATOM + ▶ + pending: BOOL + range: BOOL + immutable: BOOL + valid-values: LISTofINT32 +└─── + Errors: Name, Atom, Output + + If the specified property does not exist for the specified output, + then a Name error is returned. + + If 'pending' is TRUE, changes made to property values with + RRChangeOutputProperty will be saved in the pending property value + and be automatically copied to the current value on the next + RRSetCrtcConfig request involving the named output. If 'pending' is + FALSE, changes are copied immediately. + + If 'range' is TRUE, then the valid-values list will contain + precisely two values indicating the minimum and maximum allowed + values. If 'range' is FALSE, then the valid-values list will contain + the list of possible values; attempts to set other values will + result in a Value error. + + If 'immutable' is TRUE, then the property configuration cannot be + changed by clients. Immutable properties are interpreted by the X + server. + + Changes in version 1.6 of the protocol: + + When a “non-desktop” device is connected, the property information + will be correct for the device, even though RRGetOutputInfo + reports the device as disconnected. + +┌─── + RRConfigureOutputProperty + output: OUTPUT + property: ATOM + pending: BOOL + range: BOOL + valid-values: LISTofINT32 +└─── + Errors: Access, Name, Atom, Output + + If the specified property is 'immutable', an Access error is + returned. + + Otherwise, the configuration of the specified property is changed to + the values provided in this request. + + If the specified property does not exist for the specified output, + it is created with an empty value and None type. + +┌─── + RRChangeOutputProperty + output: OUTPUT + property, type: ATOM + format: {8, 16, 32} + mode: { Replace, Prepend, Append } + data: LISTofINT8 or LISTofINT16 or LISTofINT32 +└─── + Errors: Alloc, Atom, Match, Value, Output + + This request alters the value of the property for the specified + output. If the property is marked as a 'pending' property, only the + pending value of the property is changed. Otherwise, changes are + reflected in both the pending and current values of the property. + The type is uninterpreted by the server. The format specifies + whether the data should be viewed as a list of 8-bit, 16-bit, or + 32-bit quantities so that the server can correctly byte-swap as + necessary. + + If the mode is Replace, the previous property value is discarded. + If the mode is Prepend or Append, then the type and format must + match the existing property value (or a Match error results). If + the property is undefined, it is treated as defined with the correct + type and format with zero-length data. + + For Prepend, the data is tacked on to the beginning of the existing + data, and for Append, it is tacked on to the end of the existing data. + + This request generates a OutputPropertyNotify + + The lifetime of a property is not tied to the storing client. + Properties remain until explicitly deleted, until the output is + destroyed, or until server reset (see section 10). + + The maximum size of a property is server-dependent and may vary + dynamically. + +┌─── + RRDeleteOutputProperty + output: OUTPUT + property: ATOM +└─── + Errors: Atom, Output + + This request deletes the property from the specified window if the + property exists and generates a OutputPropertyNotify event unless + the property does not exist. + +┌─── + RRGetOutputProperty + output: OUTPUT + property: ATOM + type: ATOM or AnyPropertyType + long-offset, long-length: CARD32 + delete: BOOL + pending: BOOL + ▶ + type: ATOM or None + format: {0, 8, 16, 32} + bytes-after: CARD32 + value: LISTofINT8 or LISTofINT16 or LISTofINT32 +└─── + Errors: Atom, Value, Output + + If the specified property does not exist for the specified output, + then the return type is None, the format and bytes-after are zero, + and the value is empty. The delete argument is ignored in this + case. + + If the specified property exists but its type does not match the + specified type, then the return type is the actual type of the + property, the format is the actual format of the property (never + zero), the bytes-after is the length of the property in bytes (even + if the format is 16 or 32), and the value is empty. The delete + argument is ignored in this case. + + If the specified property exists and either AnyPropertyType is + specified or the specified type matches the actual type of the + property, then the return type is the actual type of the property, + the format is the actual format of the property (never zero), and + the bytes-after and value are as follows, given: + + N = actual length of the stored property in bytes + (even if the format is 16 or 32) + I = 4 × offset + T = N - I + L = MINIMUM(T, 4 × long-length) + A = N - (I + L) + + If 'pending' is true, and if the property holds a pending value, + then the value returned will be the pending value of the property + rather than the current value. The returned value starts at byte + index I in the property (indexing from 0), and its length in bytes + is L. However, it is a Value error if long-offset is given such + that L is negative. The value of bytes-after is A, giving the + number of trailing unread bytes in the stored property. If delete + is True and the bytes-after is zero, the property is also deleted + from the output, and a RROutputPropertyNotify event is generated. + + Changes in version 1.6 of the protocol: + + When a “non-desktop” device is connected, the property value + will be correct for the device, even though RRGetOutputInfo + reports the device as disconnected. + +┌─── + RRCreateMode + window: WINDOW + modeinfo: MODEINFO + ▶ + mode: MODE +└─── + Errors: Window, Name, Value + + 'modeinfo' provides a new mode for outputs on the screen + associated with 'window'. If the name of 'modeinfo' names an + existing mode, a Name error is returned. If some parameter of the + mode is not valid in some other way, a Value error is returned. + + The returned 'mode' provides the id for the mode. + +┌─── + RRDestroyMode + mode: MODE +└─── + Errors: Mode, Access + + The user-defined 'mode' is destroyed. 'mode' must name a mode + defined with RRCreateMode, else an Match error is returned. If + 'mode' is in use by some CRTC or Output, then an Access error is + returned. + +┌─── + RRAddOutputMode + output: OUTPUT + mode: MODE +└─── + Errors: Output, Mode, Match + + 'output' indicates which output is to be configured. + + 'mode' specifies which mode to add. If 'mode' is not valid for + 'output', then a Match error is generated. + + This request generates OutputChangeNotify events. + +┌─── + RRDeleteOutputMode + output: OUTPUT + mode: MODE +└─── + Errors: Output, Mode + + 'output' indicates which output is to be configured. + + 'mode' specifies which mode to delete. 'mode' must have been added + with RRAddOutputMode, else an Access error is returned. 'mode' must + not be active, else a Match error is returned. + + This request generates OutputChangeNotify events. + +┌─── + RRGetCrtcInfo + crtc: CRTC + config-timestamp: TIMESTAMP + ▶ + status: RRCONFIGSTATUS + timestamp: TIMESTAMP + x, y: INT16 + width, height: CARD16 + mode: MODE + rotation: ROTATION + outputs: LISTofOUTPUT + + rotations: SETofROTATION + possible-outputs: LISTofOUTPUT +└─── + + Errors: Window + + RRGetCrtcInfo returns information about the current and available + configurations for the specified crtc connected to the screen + associated with 'window'. + + If 'config-timestamp' does not match the current configuration + timestamp (as returned by RRGetScreenResources), 'status' is set to + InvalidConfigTime and the remaining reply data is empty. Otherwise, + 'status' is set to Success. + + 'timestamp' indicates when the configuration was last set. + + 'x' and 'y' indicate the position of this CRTC within the screen + region. They will be set to 0 when the CRTC is disabled. + + 'width' and 'height' indicate the size of the area within the screen + presented by this CRTC. This may be different than the size of the + mode due to rotation, the projective transform, and the Border property + described below. They will be set to 0 when the CRTC is disabled. + + 'mode' indicates which mode is active, or None indicating that the + CRTC has been disabled and is not displaying the screen contents. + + 'rotation' indicates the active rotation. It is set to Rotate_0 + when the CRTC is disabled. + + 'outputs' is the list of outputs currently connected to this CRTC + and is empty when the CRTC is disabled. + + 'rotations' contains the set of rotations and reflections supported + by the CRTC. + + 'possible-outputs' lists all of the outputs which may be connected + to this CRTC. + +┌─── + RRSetCrtcConfig + crtc: CRTC + timestamp: TIMESTAMP + config-timestamp: TIMESTAMP + x, y: INT16 + mode: MODE + rotation: ROTATION + outputs: LISTofOUTPUT + ▶ + status: RRCONFIGSTATUS + new-timestamp: TIMESTAMP +└─── + Errors: Value, Match + + If 'timestamp' is less than the time when the configuration was last + successfully set, the request is ignored and InvalidTime returned in + status. + + If 'config-timestamp' is not equal to when the monitor's + configuration last changed, the request is ignored and + InvalidConfigTime returned in status. This could occur if the + monitor changed since you last made a RRGetScreenInfo request, + perhaps by a different monitor being connected to the machine. + Rather than allowing an incorrect call to be executed based on stale + data, the server will ignore the request. + + 'x' and 'y' contain the desired location within the screen for this + monitor's content. 'x' and 'y' must be within the screen size, else + a Value error results. + + 'mode' is either the desired mode or None indicating the CRTC should + be disabled. If 'mode' is not one of these values, a Value + error results. 'mode' must be valid for all of the configured outputs, + else a Match error. + + 'rotation' contains the desired rotation along with which + reflections should be enabled. The rotation and reflection values + must be among those allowed for this monitor, else a Value error + results. + + 'outputs' contains the set of outputs that this CRTC should be + connected to. The set must be among the list of acceptable output + sets for this CRTC or a Match error results. + + If 'mode' is None, then 'outputs' must be empty, else a Match error + results. Conversely, if 'mode' is not None, then 'outputs' must not be + empty, else a Match error results. + + This request may fail for other indeterminate reasons, in which case + 'status' will be set to Failed and no configuration change will be + made. + + This request sets the CRTC to the specified position, mode, rotation + and reflection. The entire area of the CRTC must fit within the + screen size, else a Match error results. As an example, rotating the + screen so that a single CRTC fills the entire screen before and + after may necessitate disabling the CRTC, resizing the screen, + then re-enabling the CRTC at the new configuration to avoid an + invalid intermediate configuration. + + If panning is enabled, the width and height of the panning and the + tracking areas are clamped to the new mode size. + Disabled panning axes remain disabled. + Panning borders are disabled if their requirements are no longer met + (see RRSetPanning). + + When this request succeeds, 'status' contains Success and the + requested changes to configuration will have been made. + + 'new-time-stamp' contains the time at which this request was + executed. + +┌─── + RRGetCrtcGammaSize + crtc: CRTC + ▶ + size: CARD16 +└─── + Errors: Crtc + + This request returns the size of the gamma ramps used by 'crtc'. + +┌─── + RRGetCrtcGamma + crtc: CRTC + ▶ + red: LISTofCARD16 + green: LISTofCARD16 + blue: LISTofCARD16 +└─── + Errors: Crtc + + This request returns the currently set gamma ramps for 'crtc'. All + three lists will be the size returned by the RRGetCrtcGammaSize + request. + +┌─── + RRSetCrtcGamma + crtc: CRTC + red: LISTofCARD16 + green: LISTofCARD16 + blue: LISTofCARD16 +└─── + Errors: Crtc, Match + + This request sets the gamma ramps for 'crtc'. All three lists + must be the size returned by RRGetCrtcGammaSize else a Value error + results. + +7.2. Extension Requests added in version 1.3 of the extension + +┌─── + RRGetScreenResourcesCurrent + window: WINDOW + ▶ + timestamp: TIMESTAMP + config-timestamp: TIMESTAMP + crtcs: LISTofCRTC + outputs: LISTofOUTPUT + modes: LISTofMODEINFO +└─── + Errors: Window + + RRGetScreenResourcesCurrent returns the list of outputs and crtcs + connected to the screen associated with 'window'. + + 'timestamp' indicates when the configuration was last set. + + 'config-timestamp' indicates when the configuration information last + changed. Requests to configure the output will fail unless the + timestamp indicates that the information the client is using is up + to date, to ensure clients can be well behaved in the face of race + conditions. + + 'crtcs' contains the list of CRTCs associated with the screen. + + 'outputs' contains the list of outputs associated with the screen. + + 'modes' contains the list of modes associated with the screen. + + Unlike RRGetScreenResources, this merely returns the current + configuration, and does not poll for hardware changes. + +┌─── + RRSetCrtcTransform + crtc: CRTC + transform: TRANSFORM + filter: STRING8 + values: LISTofFIXED +└─── + Errors: Crtc, Match + + This request provides a mechanism that is more general than the + existing rotation and reflection values for describing the + transformation from frame buffer image to crtc presentation. + 'transform' is a full 2D projective transformation from screen + coordinate space to crtc coordinate space. This transformation is + applied before the rotation and reflection values to compute the + complete transform. + + 'filter' and 'values' specify a Render filter that may be used by the + server when transforming data from frame buffer to crtc. + + This request sets the transform to be used at the next + RRSetCrtcConfig request execution; it does not cause any change to + occur in the current configuration. + + When a non-identity transformation is in use, the rectangle returned + by RRGetCrtcInfo defines the bounding rectangle of the screen that is + projected to the crtc. It is this projected rectangle which must be + within the area of the screen when the mode is set. + +┌─── + RRGetCrtcTransform + crtc: CRTC + ▶ + pending-transform: TRANSFORM + pending-filter: STRING8 + pending-values: LISTofFIXED + current-transform: TRANSFORM + current-filter: STRING8 + current-values: LISTofFIXED +└─── + + This request returns the pending and current transforms for the + specified CRTC. The pending transform will be the same as the current + transform if no new pending transform has been set since the last call + to RRSetCrtcConfig. + +┌─── + RRGetPanning + crtc: CRTC + ▶ + status: RRCONFIGSTATUS + timestamp: TIMESTAMP + left, top, width, height: CARD16 + track_left, track_top, track_width, track_height: CARD16 + border_left, border_top, border_right, border_bottom: INT16 +└─── + + Errors: Crtc + + Version 1.3 adds panning support again. If multiple crtcs are active + the panning behavior can be defined per crtc individually. + RRGetPanning returns information about the currently set panning + configuration for the specified crtc. If the CRTC does not support + panning, all fields (except timestamp) will be 0. + + 'timestamp' indicates when the configuration was last set. + + All other entries are explained for RRSetPanning. + +┌─── + RRSetPanning + crtc: CRTC + timestamp: TIMESTAMP + left, top, width, height: CARD16 + track_left, track_top, track_width, track_height: CARD16 + border_left, border_top, border_right, border_bottom: INT16 + ▶ + status: RRCONFIGSTATUS + new-timestamp: TIMESTAMP +└─── + Errors: Crtc, Match + + This request sets the panning parameters. As soon as panning is + enabled, the CRTC position can change with every pointer move. + RRCrtcChangeNotify events are sent to the clients requesting those. + + If 'timestamp' is less than the time when the configuration was last + successfully set, the request is ignored and InvalidTime returned in + status. + + ┌──┳━━━━━━━━━━━━━━┳─────┬ ─ ─ ─ ─ ─ ┐ + │ ┃ CRTC ┃ │ + │ ┃ ┃ │ │ + │ ┃ X┃→ │ + │ ┃ ┃ │ │ framebuffer + │ ┗━━━━━━━━━━━━━━┛ │ + │ │ │ + │panning area │ + └───────────────────────┴ ─ ─ ─ ─ ─ ┘ + + 'left', 'top', 'width', and 'height' contain the total panning area + for this CRTC. 'width' has to be larger than or equal to the CRTC's + width or 0, and 'left'+'width' must be within the screen size, else a + Match error results. Equivalent restrictions for the height exist. + 'width' or 'height' set to 0 indicate that panning should be disabled + on the according axis. Setting 'width'/'height' to the CRTC's + width/height will disable panning on the X/Y axis as well, but + RRSetScreenSize will silently enable panning if the screen size is + increased. This does not happen if set to 0. + + ┌────────┳━━━━━━━━━━━━━━┳ ─ ─ ─ ─ ─ ┐ + │ ┃ CRTC ┃ + │ ┃ ┃ │ + │ ┃ ┃ + │ ┃ ┃ │ tracking area + │ ┗━━━━━━━━━━━━━━┫ X + │ ↓ │ ↓ │ + │panning area │ + └───────────────────────┴ ─ ─ ─ ─ ─ ┘ + + 'track_left', 'track_top', 'track_width', and 'track_height' contain + the pointer area for which the panning region is updated. For normal + use cases it should enclose the panning area minus borders, and is + typically set to either the panning area minus borders, or to the + total screen size. If set to the total screen size, the CRTC will pan + in the remaining axis even if the pointer is outside the panning area + on a different CRTC, as shown in the figure above. If the pointer is + outside the tracking area, the CRTC will not pan. Zero can be used as + an alias for the total screen size. + + ┌──┳━━━━━━━━━━━━━━┳────────────┐ + │ ┃ CRTC ┃ │ + │ ┃ ┃ │ + │ ┃ ┃→ │ + │ ┃ X←→┃ │ + │ ┃ border_right │ + │ ┗━━━━━━━━━━━━━━┛ │ + │ │ + │panning area │ + └──────────────────────────────┘ + + 'border_left', 'border_top', 'border_right', and 'border_bottom' + define the distances from the CRTC borders that will activate panning + if the pointer hits them. If the borders are 0, the screen will pan + when the pointer hits the CRTC borders (behavior of pre-RandR Xserver + panning). If the borders are positive, the screen will pan when the + pointer gets close to the CRTC borders, if they are negative, the + screen will only pan when the pointer is already way past the CRTC + borders. Negative values might confuse users and disable panning to + the very edges of the screen. Thus they are discouraged. + border_left + border_right has to be lower or equal than the CRTC's + width, else a Match error results. An equivalent restriction for the + height exists. + + Screen size changes update the panning and the tracking areas to the + new size. Both screen size changes and mode changes clamp these areas + to the current CRTC size. In these cases panning borders are disabled + if their requirements are no longer met. + + When this request succeeds, 'status' contains Success and the + requested changes to configuration will have been made. + + 'new-time-stamp' contains the time at which this request was + executed. + +┌─── + RRSetOutputPrimary + window: WINDOW + output: OUTPUT +└─── + Errors: Match, Output, Window + + RRSetOutputPrimary marks 'output' as the primary output for the + screen with the same root window as 'window'. This output's CRTC + will be sorted to the front of the list in Xinerama and RANDR + geometry requests for the benefit of older applications. The + default primary output is None, and None is a legal value to pass + to RRSetOutputPrimary. This request is expected to be used by + desktop environments to mark the screen that should hold the primary + menu bar or panel. + + As this changes the logical layout of the screen, ConfigureNotify + and RRScreenChangeNotify will be generated on the appropriate root + window when the primary output is changed by this call. This request + also generates RROutputChangeNotify events on the outputs that gained + and lost primary status. + + If an output is disconnected asynchronously (eg. due to recabling), + the primary status does not change, but RROutputChangeNotify events + will be generated if the hardware is capable of detecting this; + clients are expected to reconfigure if appropriate. + + If an output is deleted (eg. due to device hotplug), the server will + act as though None was passed to RRSetOutputPrimary, including + generating the appropriate events. + +┌─── + RRGetOutputPrimary + window: WINDOW + ▶ + output: OUTPUT +└─── + Errors: Window + + RRGetOutputPrimary returns the primary output for the screen. + + ❧❧❧❧❧❧❧❧❧❧❧ + +7.4 Extension Requests added in version 1.4 of the extension. + +┌─── + RRGetProviders + window : WINDOW + ▶ + timestamp: TIMESTAMP + providers: LISTofPROVIDER +└─── + Errors: Window + + RRGetProviders returns the list of providers connected to the screen + associated with 'window'. + + 'timestamp' indicates when the configuration was last set. + + 'providers' contains the list of PROVIDERs associated with the + screen. + +┌─── + RRGetProviderInfo + provider: PROVIDER + ▶ + capabilities: PROVIDER_CAPS + name: STRING + crtcs: LISTofCRTC + outputs: LISTofOUTPUT + associated_providers: LISTofPROVIDERS + associated_provider_capability: LISTofPROVIDER_CAPS +└─── + Errors: Provider + + RRGetProviderInfo return information about the specified provider. + The capabilities of the current provider are returned, along with + the list of providers currently associated with this provider and + the capability they are associated with. It also provides the list + of crtcs and outputs that this provider is responsible for. + + 'name' is a UTF-8 encoded string to be presented to the user to + indicate the device or driver supplied name. + +┌─── + RRSetProviderOffloadSink + provider: PROVIDER + sink_provider: PROVIDER + config-timestamp: TIMESTAMP +└─── + Errors: Provider + + RRSetOffloadSink sets the offload sink for this provider to the + specified provider. + +┌─── + RRSetProviderOutputSource + provider: PROVIDER + source_provider: PROVIDER + config-timestamp: TIMESTAMP +└─── + Errors: Provider + + RRSetOutputSource sets the output source for this provider to the + specified provider. + +┌─── + RRListProviderProperties + provider:PROVIDERS + ▶ + atoms: LISTofATOM +└─── + Errors: Provider + + This request returns the atoms of properties currently defined on + the provider. + +┌─── + RRQueryProviderProperty + provider: PROVIDER + property: ATOM + ▶ + pending: BOOL + range: BOOL + immutable: BOOL + valid-values: LISTofINT32 +└─── + Errors: Name, Atom, Provider + + If the specified property does not exist for the specified provider, + then a Name error is returned. + + If 'pending' is TRUE, changes made to property values with + RRChangeProviderProperty will be saved in the pending property value + and be automatically copied to the current value on the next + RRSetCrtcConfig request on a crtc attached to that provider. + If 'pending' is FALSE, changes are copied immediately. + + If 'range' is TRUE, then the valid-values list will contain + precisely two values indicating the minimum and maximum allowed + values. If 'range' is FALSE, then the valid-values list will contain + the list of possible values; attempts to set other values will + result in a Value error. + + If 'immutable' is TRUE, then the property configuration cannot be + changed by clients. Immutable properties are interpreted by the X + server. + +┌─── + RRConfigureProviderProperty + provider: PROVIDER + property: ATOM + pending: BOOL + range: BOOL + valid-values: LISTofINT32 +└─── + Errors: Access, Name, Atom, Provider + + If the specified property is 'immutable', an Access error is + returned. + + Otherwise, the configuration of the specified property is changed to + the values provided in this request. + + If the specified property does not exist for the specified provider, + it is created with an empty value and None type. + +┌─── + RRChangeProviderProperty + provider: PROVIDER + property, type: ATOM + format: {8, 16, 32} + mode: { Replace, Prepend, Append } + data: LISTofINT8 or LISTofINT16 or LISTofINT32 +└─── + Errors: Alloc, Atom, Match, Value, Provider + + This request alters the value of the property for the specified + provider. If the property is marked as a 'pending' property, only the + pending value of the property is changed. Otherwise, changes are + reflected in both the pending and current values of the property. + The type is uninterpreted by the server. The format specifies + whether the data should be viewed as a list of 8-bit, 16-bit, or + 32-bit quantities so that the server can correctly byte-swap as + necessary. + + If the mode is Replace, the previous property value is discarded. + If the mode is Prepend or Append, then the type and format must + match the existing property value (or a Match error results). If + the property is undefined, it is treated as defined with the correct + type and format with zero-length data. + + For Prepend, the data is tacked on to the beginning of the existing + data, and for Append, it is tacked on to the end of the existing data. + + This request generates a ProviderPropertyNotify + + The lifetime of a property is not tied to the storing client. + Properties remain until explicitly deleted, until the provider is + destroyed, or until server reset (see section 10). + + The maximum size of a property is server-dependent and may vary + dynamically. +┌─── + RRDeleteProviderProperty + provider: Provider + property: ATOM +└─── + Errors: Atom, Provider + + This request deletes the property from the specified provider if the + property exists and generates a ProviderPropertyNotify event unless + the property does not exist. + +┌─── + RRGetProviderProperty + provider: PROVIDER + property: ATOM + type: ATOM or AnyPropertyType + long-offset, long-length: CARD32 + delete: BOOL + pending: BOOL + ▶ + type: ATOM or None + format: {0, 8, 16, 32} + bytes-after: CARD32 + value: LISTofINT8 or LISTofINT16 or LISTofINT32 +└─── + Errors: Atom, Value, Provider + + If the specified property does not exist for the specified provider, + then the return type is None, the format and bytes-after are zero, + and the value is empty. The delete argument is ignored in this + case. + + If the specified property exists but its type does not match the + specified type, then the return type is the actual type of the + property, the format is the actual format of the property (never + zero), the bytes-after is the length of the property in bytes (even + if the format is 16 or 32), and the value is empty. The delete + argument is ignored in this case. + + If the specified property exists and either AnyPropertyType is + specified or the specified type matches the actual type of the + property, then the return type is the actual type of the property, + the format is the actual format of the property (never zero), and + the bytes-after and value are as follows, given: + + N = actual length of the stored property in bytes + (even if the format is 16 or 32) + I = 4 × offset + T = N - I + L = MINIMUM(T, 4 × long-length) + A = N - (I + L) + + If 'pending' is true, and if the property holds a pending value, + then the value returned will be the pending value of the property + rather than the current value. The returned value starts at byte + index I in the property (indexing from 0), and its length in bytes + is L. However, it is a Value error if long-offset is given such + that L is negative. The value of bytes-after is A, giving the + number of trailing unread bytes in the stored property. If delete + is True and the bytes-after is zero, the property is also deleted + from the provider, and a RRProviderPropertyNotify event is generated. + + + ❧❧❧❧❧❧❧❧❧❧❧ + +7.5. Extension Requests added in version 1.5 of the extension. + +┌─── + RRGetMonitors + window : WINDOW + get_active : BOOL + ▶ + timestamp: TIMESTAMP + monitors: LISTofMONITORINFO +└─── + Errors: Window + + Returns the list of Monitors for the screen containing + 'window'. If 'get_active' is set it returns only active + monitors (non-0x0 monitors). 'get_active' should always + be set by toolkits, and not by configuration clients. + + 'timestamp' indicates the server time when the list of + monitors last changed. + +┌─── + RRSetMonitor + window : WINDOW + info: MONITORINFO +└─── + Errors: Window, Output, Atom, Value + + Create a new monitor. Any existing Monitor of the same name is deleted. + + 'name' must be a valid atom or an Atom error results. + + 'name' must not match the name of any Output on the screen, or + a Value error results. + + If 'info.outputs' is non-empty, and if x, y, width, height are all + zero, then the Monitor geometry will be dynamically defined to + be the bounding box of the geometry of the active CRTCs + associated with them. + + If 'name' matches an existing Monitor on the screen, the + existing one will be deleted as if RRDeleteMonitor were called. + + If an 'info.output' contains only the automatically generated default + monitor, this is replaced by the new monitor. If the 'info.output' already + contains a user-defined monitor, the new monitor will be added. + This allows to have more than one monitor on an output (e.g. to split an + output into multiple virtual monitors). + + Only one monitor per screen may be primary. If 'info.primary' + is true, then the primary value will be set to false on all + other monitors on the screen. + + RRSetMonitor generates a ConfigureNotify event on the root + window of the screen. + +┌─── + RRDeleteMonitor + window : WINDOW + name: ATOM +└─── + Errors: Window, Atom, Value + + Deletes the named Monitor. + + 'name' must be a valid atom or an Atom error results. + + 'name' must match the name of a Monitor on the screen, or a + Value error results. + + If the last user-defined monitor is removed from an 'info.output', + the automatically generated default monitor will be restored. It is not + possible to delete the automatically generated default monitor. + + RRDeleteMonitor generates a ConfigureNotify event on the root + window of the screen. + + ❧❧❧❧❧❧❧❧❧❧❧ + +7.6. Extension Requests added in version 1.6 of the extension. + +┌─── + RRCreateLease + window : WINDOW + lid: LEASE + crtcs: LISTofCRTC + outputs: LISTofOUTPUT + ▶ + nfd: CARD8 + lease: FD +└─── + Errors: IdChoice, Window, Access, Value, CRTC, Output + + Creates a new Lease called 'lid' for the specified crtcs and + outputs from the screen defined by 'window'. Returns a KMS/DRM + file descriptor which can control the leased objects directly + through the kernel. While leased, all resources will appear to + be 'useless' to clients other than the leasing client as + follows: + + • Crtcs are reported as having no 'possible-outputs' and all + other values reported as if the crtc were disabled. + + • Outputs are reported as having no crtcs they can be + connected to, no clones they can share a crtc with, will + report a connection status of Disconnected, and will show + the current crtc as if it were disabled. + + The lease remains in effect until the file descriptor is + closed, even if the client holding the lease disconnects from + the X server. + + Returns an Access error if any of the named resources are + already leased to another client. + +┌─── + RRFreeLease + lid: LEASE + terminate: BOOL +└─── + Errors: Lease + + Frees the reference to the lease 'lid'. If 'terminate' is + true, then the lease is terminated and all leased resources + returned to the X server. If 'terminate' is false, then the + lease remains in effect, but the X server no longer has a name + for it. + + ❧❧❧❧❧❧❧❧❧❧❧ +8. Extension Events + +Clients MAY select for ConfigureNotify on the root window to be +informed of screen changes. This may be advantageous if all your +client needs to know is the size of the root window, as it avoids +round trips to set up the extension. + +RRScreenChangeNotify is sent if RRSelectInput has requested it +whenever properties of the screen change, which may be due to external +factors, such as re-cabling a monitor, etc. + +┌─── + RRScreenChangeNotify + + rotation: ROTATION; new rotation + sequenceNumber: CARD16 low 16 bits of request seq. number + timestamp: TIMESTAMP time screen was changed + configTimestamp: TIMESTAMP time config data was changed + root: WINDOW root window of screen + window: WINDOW window requesting notification + size-id: SIZEID index of new SCREENSIZE + subpixelOrder: SUBPIXELORDER order of subpixels + widthInPixels: CARD16 width in pixels of the new SCREENSIZE + heightInPixels: CARD16 height in pixels of the new SCREENSIZE + widthInMillimeters: CARD16 width in mm of the new SCREENSIZE + heightInMillimeters: CARD16 height in mm of the new SCREENSIZE +└─── + This event is generated whenever the screen configuration is changed + and sent to requesting clients. 'timestamp' indicates when the + screen configuration was changed. 'configTimestamp' says when the + last time the configuration was changed. 'root' is the root of the + screen the change occurred on, 'window' is window selecting for this + event. 'size-id' contains the index of the current size. + + This event is sent whenever the screen's configuration changes + or if a new screen configuration becomes available that was + not available in the past. In this case (config-timestamp in + the event not being equal to the config-timestamp returned in + the last call to RRGetScreenInfo), the client MUST call + RRGetScreenInfo to update its view of possible screen + configurations to have a correct view of possible screen + organizations. + + Clients which select screen change notification events may be + sent an event immediately if the screen configuration was + changed between when they connected to the X server and + selected for notification. This is to prevent a common race + that might occur on log-in, where many applications start up + just at the time when a display manager or log in script might + be changing the screen size or configuration. + + Note that the sizes in this event reflect the new SCREENSIZE and + thus will appear rotated by the 'rotation' parameter from the sizes + of the screen itself. In other words, when rotation is 90 or 270, + widthInPixels in this event will be the same as the height value + from a ConfigureNotify that reflects the same size change. This + will probably confuse developers. + +8.1 Events added in version 1.2 of the RandR extension + +┌─── + RROutputChangeNotify: + timestamp: TIMESTAMP time screen was reconfigured + config-timestamp: TIMESTAMP time available config data was changed + window: WINDOW window requesting notification + output: OUTPUT output affected by change + crtc: CRTC connected CRTC or None + mode: MODE mode in use on CRTC or None + connection: CONNECTION connection status +└─── + + This event is generated whenever the available output configurations + have changed and is sent to requesting clients. 'timestamp' + indicates when the crtc configuration was changed by a client. + 'config-timestamp' says when the last time the available + configurations changed. 'root' is the root of the screen the change + occurred on, 'window' is window selecting for this event. The + precise change can be detected by examining the new state of the + system. + + Changes in version 1.6 of the protocol: + + When a “non-desktop” device is connected, this event will be + delivered when the connection status of the output changes, + however the 'connection' value will be set to 'Disconnected'. + +┌─── + RROutputPropertyNotify: + window: WINDOW window requesting notification + output: OUTPUT output affected by change + atom: ATOM affected property + time: TIMESTAMP time property was changed + subpixel-order: SUBPIXELORDER order of subpixels + state: { NewValue, Deleted } new property state +└─── + + This event is reported to clients selecting RROutputPropertyChange + on the window and is generated with state NewValue when a property + of the window is changed using RRChangeOutputProperty even when + adding zero-length data and when replacing all or part of a property + with identical data. It is generated with state Deleted when a + property of the window is deleted using either + RRDeleteOutputProperty or RRGetOutputProperty. The timestamp + indicates the server time when the property was changed. + +┌─── + RRCrtcChangeNotify + timestamp: TIMESTAMP time monitor was changed + window: WINDOW window requesting notification + crtc: CRTC CRTC which changed + mode: MODE new mode + rotation: ROTATION; new rotation + x: INT16 x position of CRTC within screen + y: INT16 y position of CRTC within screen + width: CARD16 width of new configuration + height: CARD16 height of new configuration +└─── + This event is generated whenever the CRTC configuration is changed + and sent to requesting clients. 'timestamp' indicates when the + CRTC configuration was changed. 'window' is window selecting for this + event. 'mode' is the new mode, or None if the crtc is disabled. + 'x' and 'y' mark the location in the screen where this CRTC + is reading data. 'width' and 'height' indicate the size of the + CRTC viewport, which is the mode size adjusted by the optional + Border output property described below. 'x', 'y, 'width' and + 'height' are all zero when 'mode' is None. + + This event is sent whenever the monitor's configuration changes + or if a new monitor configuration becomes available that was + not available in the past. In this case, the client MUST call + RRGetCrtcInfo to update its view of possible monitor + configurations to have a correct view of possible monitor + organizations. + + Clients which select monitor change notification events may be + sent an event immediately if the monitor configuration was + changed between when they connected to the X server and + selected for notification. This is to prevent a common race + that might occur on log-in, where many applications start up + just at the time when a display manager or log in script might + be changing the monitor size or configuration. + +8.2 Events added in version 1.4 of the RandR extension + +┌─── + RRProviderChangeNotify: + timestamp: TIMESTAMP time screen was reconfigured + window: WINDOW window requesting notification + provider: PROVIDER provider affected by change +└─── + + This event is generated whenever the role for a provider has changed + and is sent to requesting clients. 'timestamp' indicates when the + provider configuration was changed by a client. 'window' is the + window selecting for this event. The precise change can be detected + by examining the new state of the system. + +┌─── + RRProviderPropertyNotify: + window: WINDOW window requesting notification + provider: PROVIDER provider affected by change + atom: ATOM affected property + time: TIMESTAMP time property was changed + state: { NewValue, Deleted } new property state +└─── + + This event is reported to clients selecting RRProviderPropertyChange + on the window and is generated with state NewValue when a property + of the window is changed using RRChangeProviderProperty even when + adding zero-length data and when replacing all or part of a property + with identical data. It is generated with state Deleted when a + property of the window is deleted using either + RRDeleteProviderProperty or RRGetProviderProperty. The timestamp + indicates the server time when the property was changed. + +┌─── + RRResourceChangeNotify: + window: WINDOW window requesting notification + time: TIMESTAMP time property was changed +└─── + + This event is reported to clients selecting RRResourceChange + on the window and is generated whenever the set of available + RandR resources associated with the screen has changed, either + created or destroyed. Querying the list of available resources + with RRGetScreenResources and RRGetProviders will return the new set. + +8.3 Events added in version 1.6 of the RandR extension + +┌─── + RRLeaseNotify: + timestamp : TIMESTAMP time screen was reconfigured + window : WINDOW window requesting notification + lease : LEASE lease + created : BOOL created/destroyed indicator +└─── + + This event is generated whenever a lease has been created or + destroyed and is sent to requesting clients. 'timestamp' + indicates when the change happened. 'window' is the window + selecting for this event. + + ❧❧❧❧❧❧❧❧❧❧❧ + +9. Properties + +Properties are used for output specific parameters, and for announcing +static or rarely changing data. Announced data is typically +immutable. Properties are also used for evaluating new parameters +before adding them to the RandR protocol. + +The following properties are hereby declared official, and drivers SHOULD +prefix driver specific properties with '_', unless they are planned to be +added to this specification. List values, that are not declared by the table +below, and will remain driver specific or are not planned to be added to this +specification, SHOULD be prefixed with "_" as well in order to avoid name +space or semantics clashes with future extensions of these values. + +Beginning with version 1.3 of the RandR extension, certain properties +are mandatory and MUST be provided by implementations. Earlier +versions of the RandR extension MAY provide these properties as well, +as long as the semantics are not altered. Clients SHOULD fall back +gracefully to lower version functionality, though, if the driver +doesn't handle a mandatory property correctly. + +Changes in version 1.6 of the protocol: + +When a “non-desktop” device is connected, the property information +will be correct for the device, even though RRGetOutputInfo +reports the device as disconnected. The “non-desktop” property will be +set to 1 for such devices and not present on other devices. + +9.1 Known properties + + "Backlight" aka RR_PROPERTY_BACKLIGHT + Type: INTEGER + Format: 32 + Num. items: 1 + Flags: - + Range/List: 0-x (driver specific) + + This property controls the brightness on laptop panels and equivalent + displays with a backlight controller. The driver specific maximum + value MUST turn the backlight to full brightness, 1 SHOULD turn the + backlight to minimum brightness, 0 SHOULD turn the backlight off. + + "CloneList" aka RR_PROPERTY_CLONE_LIST + Type: ATOM + Format: 32 + Num. items: 2*n + Flags: Immutable + Range/List: 0- + + Some combinations of outputs on some cards cannot be served + independently from each other, because they are wired up to the same + encoder outputs. + This property lists all output + signal format pairs that are + driven together with this output, and thus can only be programmed in + clone mode with the same CRTC. + This property MUST be symmetric, but may change with changing signal + format. I.e. if the property for DVI-1/VGA specifies VGA-1/VGA to be + cloned, VGA-1/VGA has to list DVI-1/VGA as well. + Outputs / format pairs listed in this property MUST be included in the + CompatibilityList. + + "CompatibilityList" aka RR_PROPERTY_COMPATIBILITY_LIST + Type: ATOM + Format: 32 + Num items: 2*n + Flags: Immutable + Range/List: 0- + + Some combinations of outputs on some cards cannot be served at all, + because the according encoder is only capable of driving one output at + a time. + This property lists all output + signal format pairs that can be + driven together with this output. NULL atoms specify any output / any + signal format, respectively. + This property MUST be symmetric, but may change with changing signal + format. I.e. if the property for DVI-1/TMDS specifies VGA-1/VGA to be + available, VGA-1/VGA has to list DVI-1/TMDS as well. + + "ConnectorNumber" aka RR_PROPERTY_CONNECTOR_NUMBER + Type: INTEGER + Format: 32 + Num items: 1 + Flags: Immutable, Static + Range/List: 0- + + Outputs that route their signal to the same connector MUST + have the same connector number. Outputs with the same + connector number MUST route their signal to the same + connector, except if it is 0, which indicates unknown + connectivity. 1 is called the primary connector, 2 the + secondary. 3 is typically a TV connector, but that is completely + driver / hardware dependent. + Outputs with the same connector number SHOULD have the same + connector type. Meaning and client behavior for mismatching + connector types is undefined at the moment. + + "ConnectorType" aka RR_PROPERTY_CONNECTOR_TYPE + Type: ATOM + Format: 32 + Num items: 1 + Flags: Immutable, Static + Range/List: unknown VGA DVI DVI‐I DVI‐A DVI‐D HDMI Panel + TV TV-Composite TV-SVideo TV-Component + TV-SCART TV-C4 DisplayPort + + Connector type, as far as known to the driver. + Values with dashes (TV‐Composite) describe more specific versions of + the base values (TV). The former SHOULD be used if the connector is + not capable of producing other signal formats. The later SHOULD be + used if the exact connector is unknown, or the connector is a + multi‐format connector that is not described otherwise. DVI, for + instance, SHOULD be handled like a DVI‐I connector, unless additional + information is available to the user agent. PANEL describes + laptop‐internal (normally LVDS) displays. TV, TV‐SCART, TV‐Component, + and TV‐C4 with signal format VGA are valid combinations and describe + RGB TV signals. + + "EDID" aka RR_PROPERTY_RANDR_EDID + Type: INTEGER + Format: 8 + Num items: n + Flags: Immutable + Range/List: - + + Raw EDID data from the device attached to the according + output. Should include main EDID data and all extension + blocks. Previously known as EdidData. + + “non-desktop” aka RR_PROPERTY_NON_DESKTOP + Type: INTEGER + Format: 32 + Num items: 1 + Flags Immutable + Range/List: 0-1 + + Indicates whether the device attached to this output should not + be considered part of the normal desktop. When set to 0 or not + present, the output should be presented as part of the + desktop. + + When set to 1, the output should not be presented as part of + the desktop. To not present an output as part of the desktop, + the normal desktop environment should not be shown on this + output, nor should desktop applications be positioned on it. + + When set to 1, RRGetOutputInfo will always report connection status + Disconnected, but RROutputChangeNotify events will still be + delivered when the connection status changes and all other + information about the output and connected device will be + reported correctly. + + "SignalFormat" aka RR_PROPERTY_SIGNAL_FORMAT + Type: ATOM + Format: 32 + Num items: 1 + Flags: - + Range/List: unknown VGA TMDS LVDS Composite Composite-PAL + Composite-NTSC Composite-SECAM SVideo + Component DisplayPort + + Signal format / physical protocol format that is used for the + specified output. valid-values lists all possible formats on this + output, which SHOULD be a subset of the list above and MUST be static. + Values with dashes (Composite-PAL) describe more specific versions of + the base values (Composite) and SHOULD be used if known to the driver. + A driver MAY change this property of an output if the underlying + hardware indicates a protocol change (e.g. TV formats). Clients are + allowed to change the signal format in order to select a different + signal format (e.g. Composite etc.) or physical protocol (e.g. VGA or + TMDS on DVI-I). + Laptop panels SHOULD not be detected with this property, but rather by + ConnectorType. + + "SignalProperties" aka RR_PROPERTY_SIGNAL_FORMAT + Type: ATOM + Format: 32 + Num items: n + Flags: - + Range/List: For Composite signals: + NTSC NTSC-M NTSC-J NTSC-N NTSC-4.43 NTSC-film + PAL PAL-B PAL-G PAL-H PAL-H PAL-I PAL-M PAL-D + PAL-N PAL-Nc PAL-L PAL-60 + SECAM SECAM-L SECAM-B SECAM-G SECAM-D SECAM-K + SECAM-H SECAM-K + For TMDS signals: + SingleLink DualLink + For DisplayPort signals: + Lane1 Lane2 Lane4 LowSpeed HiSpeed + + Properties of the signal format that is currently used for the + specified output. valid-values lists all possible properties on this + output, which SHOULD be a subset of the list above. It will change if + SignalFormat changes. Multiple properties are allowed. + Values with dashes (PAL-B) describe more specific versions of the base + values (PAL) and SHOULD be used if known to the driver. A driver MAY + change this property of an output if the underlying hardware indicates + a signal change (e.g. TV formats). Clients are allowed to change the + properties in order to select a different signal subformat. + + "Border" aka RR_PROPERTY_BORDER + Type: CARDINAL + Format: 16 + Num items: 0, 1, 2, or 4 + Flags: Immutable + Range/List: 0- + + This property is a list of integers specifying adjustments for the edges + of the displayed image. How this property is applied depends on the + number of elements in the list: + + 0 = No border is applied + 1 = A border of Border[0] is applied to all four sides of the image. + 2 = A border of Border[0] is applied to the left and right sides of + the image, and a border of Border[1] is applied to the top and + bottom. + 4 = The border dimensions are as follows: + Border[0]: left + Border[1]: top + Border[2]: right + Border[3]: bottom + + Note that how many configuration dimensions are actually supported is + specified by the BorderDimensions property described below. If more than + BorderDimensions values are specified, the extra values are ignored. + + These border dimensions shrink the region of pixels displayed by the + CRTC by the corresponding number of rows or columns, and is applied + after the CRTC transform. For example, a mode with a 1920x1080 active + region, border dimensions of [ 10, 20, 30, 40 ], and a ½x scaling + transform would display a rectangle of 940x510 pixels from the scanout + pixmap scaled to 1880x1020 raster pixels positioned at (10, 20) in + display raster space. + + Raster pixels in the border are black. + + This property is created with pending == TRUE, so changes are not + applied immediately and instead take effect at the next RRSetCrtcConfig. + + If multiple outputs with different border settings are bound to the same + CRTC when the configuration is changed, the behavior is undefined. + + If the length of the property is less than four when the CRTC is + configured, the missing values are assumed to be zero. If the length is + greater than four, the extra values are ignored. + + If the width of the mode is less than or equal to the sum of the left + and right borders, then the left and right border settings are ignored. + Likewise, if the height of the mode is less than or equal to the sum of + the top and bottom borders, the top and bottom borders are ignored. + + "BorderDimensions" aka RR_PROPERTY_BORDER_DIMENSIONS + Type: CARDINAL + Format: 8 + Num items: 1 + Flags: Immutable, Static + Range/List: 0, 1, 2, or 4 + + This property lists how many border adjustment parameters can actually + be used: + + 0 = no borders are supported + 1 = a single border value is applied to all four sides of the image + 2 = left/right and top/bottom borders can be specified independently + 4 = all four borders can be specified independently + + "GUID" aka RR_PROPERTY_GUID + Type: INTEGER + Format: 8 + Num items: 16 + Flags: Immutable + Range/List: - + + Some display devices, such as DisplayPort 1.2 devices, have globally + unique identifiers. When such an identifier is available, this property + contains its raw bytes. + + "TILE" aka RR_PROPERTY_RANDR_TILE + Type: INTEGER + Format: 32 + Num items: 8 + Flags: Immutable + Range/List: - + + Tile monitors have an array of values describing the tiling, + based on DisplayID v1.3 + + The 8 elements are: + 0: group id - The tile group identifier + 1: flags - flags for tile group + 0x1 = single monitor enclosure + 2: number of horizontal tiles in tile group + 3: number of vertical tiles in tile group + 4: horizontal tile location for this tile + 5: vertical tile location for this tile + 6: horizontal tile size for this tile + 7: vertical tile size for this tile + +9.2 Properties introduced with version 1.2 of the RandR extension + +Property Immutable Mandatory since +──────── ───────── ─────────────── +EDID yes n/a + +EDID is provided by the RandR frontend, thus not driver specific. + + +9.3 Properties introduced with version 1.3 of the RandR extension + +Property Immutable Mandatory since +──────── ───────── ─────────────── +CloneList yes not mandatory +CompatibilityList yes not mandatory +ConnectorNumber yes: static not mandatory +ConnectorType yes: static RandR 1.3 +SignalFormat no RandR 1.3 +SignalProperties no not mandatory + +9.4 Properties introduced with version 1.3.1 of the RandR extension + +Property Immutable Mandatory since +──────── ───────── ─────────────── +Backlight no not mandatory + +9.5 Properties introduced with version 1.4.0 of the RandR extension + +Property Immutable Mandatory since +──────── ───────── ─────────────── +Border yes not mandatory +BorderDimensions yes: static not mandatory + +9.6 Properties introduced with version 1.4.1 of the RandR extension + +Property Immutable Mandatory since +──────── ───────── ─────────────── +GUID yes not mandatory + +9.7 Properties introduced with version 1.5 of the RandR extension + +Property Immutable Mandatory since +──────── ───────── ─────────────── +TILE yes not mandatory + +9.8 Properties introduced with version 1.6 of the RandR extension + +Property Immutable Mandatory since +──────── ───────── ─────────────── +non-desktop yes not mandatory + + ❧❧❧❧❧❧❧❧❧❧❧ + +10. Extension Versioning + +The RandR extension was developed in parallel with the implementation +to ensure the feasibility of various portions of the design. As +portions of the extension are implemented, the version number of the +extension has changed to reflect the portions of the standard provided. +This document describes the version 1.4 of the specification, the +partial implementations have version numbers less than that. Here's a +list of what each version provided: + + 0.0: This prototype implemented resize and rotation in the + TinyX server Used approximately the protocol described in + the Usenix paper. Appeared in the TinyX server in + XFree86 4.2, but not in the XFree86 main server. + + 0.1: Added subpixel order, added an event for subpixel order. + This version was never checked in to XFree86 CVS. + + 1.0: Implements resize, rotation, and reflection. Implemented + both in the XFree86 main server (size change only at this + date), and fully (size change, rotation, and reflection) + in XFree86's TinyX server. + + 1.1: Added refresh rates + + 1.2: Separate screens from CRTCs and outputs, switch to full VESA + modes + + 1.3: Added cheap version of RRGetScreenResources. Added CRTC + transformations. Added panning. Added primary outputs. + Added standard properties. + + 1.4: Added provider objects for handling multi-GPU systems. + + 1.5: Added Monitors + + 1.6: Added Leases and non-desktop output information. + +Compatibility between 0.0 and 1.0 was *NOT* preserved, and 0.0 clients +will fail against 1.0 servers. The wire encoding op-codes were +changed for GetScreenInfo to ensure this failure in a relatively +graceful way. Version 1.1 servers and clients are cross compatible with +1.0. Version 1.1 is considered to be stable and we intend upward +compatibility from this point. Version 1.2 offers an extended model of the +system with multiple output support. Version 1.3 adds a cheap version of +GetScreenResources to avoid expensive DDC operations, CRTC transformations, +panning, and the primary output concept. Versions 1.2 through 1.6 are +backward-compatible with 1.1. + + ❧❧❧❧❧❧❧❧❧❧❧ + +11. Relationship with other extensions + +Two other extensions have a direct relationship with this extension. This +section attempts to explain how these three are supposed to work together. + +11.1 XFree86-VidModeExtension + +XFree86-VidModeExtension changes the configuration of a single monitor +attached to the screen without changing the configuration of the screen +itself. It provides the ability to specify new mode lines for the server to +use along with selecting among existing mode lines. As it uses screen +numbers instead of window identifiers, it can be used to affect multiple +monitors in a single-screen Xinerama configuration. However, the association +between screen numbers and root windows in a multi-Screen environment is not +defined by the extension. Version 2.0 of this extension added the ability to +adjust the DAC values in a TrueColor server to modify the brightness curves +of the display. + +All of the utility of this extension is subsumed by RandR version 1.2, RandR +should be used in preference to XFree86-VidModeExtension where both are +present. + +11.2 Xinerama + +Xinerama provides a mechanism for describing the relationship between the +overall screen display and monitors placed within that area. As such, it +provides the query functionality of RandR 1.2 without any of the +configuration functionality. Applications using Xinerama to discover +monitor geometry can continue to do so, with the caveat that they will not be +informed of changes when they occur. However, Xinerama configuration data +will be updated, so applications selecting for RandR notification and +re-querying the configuration with the Xinerama extension will get updated +information. It is probably better to view RandR as a superset of Xinerama +at this point and use it in preference to Xinerama where both are present. + + ❧❧❧❧❧❧❧❧❧❧❧ + +Appendix A. Protocol Encoding + +Syntactic Conventions + +This document uses the same syntactic conventions as the core X +protocol encoding document. + +A.1 Common Types + +┌─── + ROTATION + 0x0001 Rotate_0 + 0x0002 Rotate_90 + 0x0004 Rotate_180 + 0x0008 Rotate_270 + 0x0010 Reflect_X + 0x0020 Reflect_Y +└─── + Used to encode both sets of possible rotations and individual + selected rotations. + +┌─── + RRSELECTMASK + 0x0001 ScreenChangeNotifyMask + 0x0002 CrtcChangeNotifyMask Added in version 1.2 + 0x0004 OutputChangeNotifyMask Added in version 1.2 + 0x0008 OutputPropertyNotifyMask Added in version 1.2 + 0x0010 ProviderChangeNotifyMask Added in version 1.4 + 0x0020 ProviderPropertyNotifyMask Added in version 1.4 + 0x0040 ResourceChangeNotifyMask Added in version 1.4 + 0x0080 LeaseNotifyMask Added in version 1.6 + +└─── + Event select mask for RRSelectInput + +┌─── + RRCONFIGSTATUS + 0x0 Success + 0x1 InvalidConfigTime + 0x2 InvalidTime + 0x3 Failed +└─── + Return status for requests which depend on time. + +┌─── + MODEINFO (32) Added in version 1.2 + 4 CARD32 id + 2 CARD16 width in pixels + 2 CARD16 height in pixels + 4 CARD32 dot clock + 2 CARD16 h sync start + 2 CARD16 h sync end + 2 CARD16 h total + 2 CARD16 h skew + 2 CARD16 v sync start + 2 CARD16 v sync end + 2 CARD16 v total + 2 CARD16 name length + 4 SETofMODEFLAG mode flags +└─── + + An output mode specifies the complete CRTC timings for + a specific mode. The vertical and horizontal synchronization rates + can be computed given the dot clock and the h total/v total + values. If the dot clock is zero, then all of the timing + parameters and flags are not used, and must be zero as this + indicates that the timings are unknown or otherwise unused. + The name itself will be encoded separately in each usage. + +┌─── + MODEFLAG + 0x00000001 HSyncPositive + 0x00000002 HSyncNegative + 0x00000004 VSyncPositive + 0x00000008 VSyncNegative + 0x00000010 Interlace + 0x00000020 DoubleScan + 0x00000040 CSync + 0x00000080 CSyncPositive + 0x00000100 CSyncNegative + 0x00000200 HSkewPresent + 0x00000400 BCast + 0x00000800 PixelMultiplex + 0x00001000 DoubleClock + 0x00002000 ClockDivideBy2 +└─── +┌─── + CONNECTION + 0 Connected + 1 Disconnected + 2 UnknownConnection +└─── + +┌─── + PROVIDER_CAPS Added in version 1.4 + 0x00000001 SourceOutput + 0x00000002 SinkOutput + 0x00000004 SourceOffload + 0x00000008 SinkOffload +└─── + +A.1.1 Common Types added in version 1.5 of the protocol + +┌─── + MONITORINFO (16 + 4*n) + 4 ATOM name + 1 BOOL primary + 1 BOOL automatic + 2 CARD16 noutputs + 2 INT16 x + 2 INT16 y + 2 CARD16 width in pixels + 2 CARD16 height in pixels + 4 CARD32 width in millimeters + 4 CARD32 height in millimeters + 4*n OUTPUT outputs +└─── + +A.2 Protocol Requests + +Opcodes 1 and 3 were used in the 0.0 protocols, and will return +errors if used in version 1.0. + +┌─── + RRQueryVersion + + 1 CARD8 major opcode + 1 0 RandR opcode + 2 3 length + 4 CARD32 major version + 4 CARD32 minor version + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 1 CARD32 major version + 1 CARD32 minor version +└─── +┌─── + RRSetScreenConfig + + 1 CARD8 major opcode + 1 2 RandR opcode + 2 6 length + 4 WINDOW window on screen to be configured + 4 TIMESTAMP timestamp + 4 TIMESTAMP config timestamp + 2 SIZEID size index + 2 ROTATION rotation/reflection + 2 CARD16 refresh rate (1.1 only) + 2 CARD16 pad + ▶ + 1 1 Reply + 1 RRCONFIGSTATUS status + 2 CARD16 sequence number + 4 0 reply length + 4 TIMESTAMP new timestamp + 4 TIMESTAMP new configuration timestamp + 4 WINDOW root + 2 SUBPIXELORDER subpixel order defined in Render + 2 CARD16 pad4 + 4 CARD32 pad5 + 4 CARD32 pad6 +└─── +┌─── + RRSelectInput + + 1 CARD8 major opcode + 1 4 RandR opcode + 2 3 length + 4 WINDOW window + 2 SETofRRSELECTMASK enable + 2 CARD16 pad +└─── +┌─── + RRGetScreenInfo + + 1 CARD8 major opcode + 1 5 RandR opcode + 2 2 length + 4 WINDOW window + ▶ + 1 1 Reply + 1 CARD8 set of Rotations + 2 CARD16 sequence number + 4 0 reply length + 4 WINDOW root window + 4 TIMESTAMP timestamp + 4 TIMESTAMP config timestamp + 2 CARD16 number of SCREENSIZE following + 2 SIZEID current size index + 2 ROTATION current rotation and reflection + 2 CARD16 current rate (added in version 1.1) + 2 CARD16 length of rate info (number of CARD16s) + 2 CARD16 pad + + SCREENSIZE + 2 CARD16 width in pixels + 2 CARD16 height in pixels + 2 CARD16 width in millimeters + 2 CARD16 height in millimeters + + REFRESH + 2 CARD16 number of rates (n) + 2n CARD16 rates +└─── + +A.2.1 Protocol Requests added with version 1.2 + +┌─── + RRGetScreenSizeRange + 1 CARD8 major opcode + 1 6 RandR opcode + 2 2 length + 4 WINDOW window + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 2 CARD16 minWidth + 2 CARD16 minHeight + 2 CARD16 maxWidth + 2 CARD16 maxHeight + 16 unused +└─── +┌─── + RRSetScreenSize + 1 CARD8 major opcode + 1 7 RandR opcode + 2 5 length + 4 WINDOW window + 2 CARD16 width + 2 CARD16 height + 4 CARD32 width in millimeters + 4 CARD32 height in millimeters +└─── +┌─── + RRGetScreenResources + 1 CARD8 major opcode + 1 8 RandR opcode + 2 2 length + 4 WINDOW window + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 c+o+8m+(b+p)/4 reply length + 4 TIMESTAMP timestamp + 4 TIMESTAMP config-timestamp + 2 c number of CRTCs + 2 o number of outputs + 2 m number of modeinfos + 2 b total bytes in mode names + 8 unused + 4c LISTofCRTC crtcs + 4o LISTofOUTPUT outputs + 32m LISTofMODEINFO modeinfos + b STRING8 mode names + p unused, p=pad(b) +└─── +┌─── + RRGetOutputInfo + 1 CARD8 major opcode + 1 9 RandR opcode + 2 3 length + 4 OUTPUT output + 4 TIMESTAMP config-timestamp + ▶ + 1 1 Reply + 1 RRCONFIGSTATUS status + 2 CARD16 sequence number + 4 1+c+m+(n+p)/4 reply length + 4 TIMESTAMP timestamp + 4 CRTC current connected crtc + 4 CARD32 width in millimeters + 4 CARD32 height in millimeters + 1 CONNECTION connection + 1 SUBPIXELORDER subpixel-order + 2 c number of CRTCs + 2 m number of modes + 2 p number of preferred modes + 2 o number of clones + 2 n length of name + 4c LISTofCRTC crtcs + 4m LISTofMODE modes + 4o LISTofOUTPUT clones + n STRING8 name + p unused, p=pad(n) +└─── +┌─── + RRListOutputProperties + 1 CARD8 major opcode + 1 10 RandR opcode + 2 2 length + 4 OUTPUT output + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 n reply length + 2 n number of ATOMs in atoms + 22 unused + 4n LISTofATOM atoms +└─── +┌─── + RRQueryOutputProperty + 1 CARD8 major opcode + 1 11 RandR opcode + 2 3 request length + 4 OUTPUT output + 4 ATOM property + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 n reply length + 1 BOOL pending + 1 BOOL range + 1 BOOL immutable + 21 unused + 4n LISTofINT32 valid values +└─── +┌─── + RRConfigureOutputProperty + 1 CARD8 major opcode + 1 12 RandR opcode + 2 4+n request length + 4 OUTPUT output + 4 ATOM property + 1 BOOL pending + 1 BOOL range + 2 unused + 4n LISTofINT32 valid values +└─── +┌─── + RRChangeOutputProperty + 1 CARD8 major opcode + 1 13 RandR opcode + 2 6+(n+p)/4 request length + 4 OUTPUT output + 4 ATOM property + 4 ATOM type + 1 CARD8 format + 1 mode + 0 Replace + 1 Prepend + 2 Append + 2 unused + 4 CARD32 length of data in format units + (= n for format = 8) + (= n/2 for format = 16) + (= n/4 for format = 32) + n LISTofBYTE data + (n is a multiple of 2 for format = 16) + (n is a multiple of 4 for format = 32) + p unused, p=pad(n) +└─── +┌─── + RRDeleteOutputProperty + 1 CARD8 major opcode + 1 14 RandR opcode + 2 3 request length + 4 OUTPUT output + 4 ATOM property +└─── +┌─── + RRGetOutputProperty + 1 CARD8 major opcode + 1 15 RandR opcode + 2 7 request length + 4 OUTPUT output + 4 ATOM property + 4 ATOM type + 0 AnyPropertyType + 4 CARD32 long-offset + 4 CARD32 long-length + 1 BOOL delete + 1 BOOL pending + 2 unused + ▶ + 1 1 Reply + 1 CARD8 format + 2 CARD16 sequence number + 4 (n+p)/4 reply length + 4 ATOM type + 0 None + 4 CARD32 bytes-after + 4 CARD32 length of value in format units + (= 0 for format = 0) + (= n for format = 8) + (= n/2 for format = 16) + (= n/4 for format = 32) + 12 unused + n LISTofBYTE value + (n is zero for format = 0) + (n is a multiple of 2 for format = 16) + (n is a multiple of 4 for format = 32) + p unused, p=pad(n) +└─── +┌─── + RRCreateMode + 1 CARD8 major opcode + 1 16 RandR opcode + 2 10+(n+p)/4 length + 4 WINDOW window + 32 MODEINFO mode + n STRING8 mode name + p unused, p=pad(n) + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 4 MODE mode + 20 unused +└─── +┌─── + RRDestroyMode + 1 CARD8 major opcode + 1 17 RandR opcode + 2 2 length + 4 MODE mode +└─── +┌─── + RRAddOutputMode + 1 CARD8 major opcode + 1 18 RandR opcode + 2 3 length + 4 OUTPUT output + 4 MODE mode +└─── +┌─── + RRDeleteOutputMode + 1 CARD8 major opcode + 1 19 RandR opcode + 2 3 length + 4 OUTPUT output + 4 MODE mode +└─── +┌─── + RRGetCrtcInfo + 1 CARD8 major opcode + 1 20 RandR opcode + 2 3 length + 4 CRTC crtc + 4 TIMESTAMP config-timestamp + ▶ + 1 1 Reply + 1 RRCONFIGSTATUS status + 2 CARD16 sequence number + 4 o+p reply length + 4 TIMESTAMP timestamp + 2 INT16 x + 2 INT16 y + 2 CARD16 width + 2 CARD16 height + 4 MODE mode + 2 ROTATION current rotation and reflection + 2 ROTATION set of possible rotations + 2 o number of outputs + 2 p number of possible outputs + 4o LISTofOUTPUT outputs + 4p LISTofOUTPUT possible outputs +└─── +┌─── + RRSetCrtcConfig + 1 CARD8 major opcode + 1 21 RandR opcode + 2 7+n length + 4 CRTC crtc + 4 TIMESTAMP timestamp + 4 TIMESTAMP config timestamp + 2 INT16 x + 2 INT16 y + 4 MODE mode + 2 ROTATION rotation/reflection + 2 unused + 4n LISTofOUTPUT outputs + ▶ + 1 1 Reply + 1 RRCONFIGSTATUS status + 2 CARD16 sequence number + 4 0 reply length + 4 TIMESTAMP new timestamp + 20 unused +└─── +┌─── + RRGetCrtcGammaSize + 1 CARD8 major opcode + 1 22 RandR opcode + 2 2 length + 4 CRTC crtc + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 2 CARD16 size + 22 unused +└─── +┌─── + RRGetCrtcGamma + 1 CARD8 major opcode + 1 23 RandR opcode + 2 2 length + 4 CRTC crtc + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 (6n+p)/4 reply length + 2 n size + 20 unused + 2n LISTofCARD16 red + 2n LISTofCARD16 green + 2n LISTofCARD16 blue + p unused, p=pad(6n) +└─── +┌─── + RRSetCrtcGamma + 1 CARD8 major opcode + 1 24 RandR opcode + 2 3+(6n+p)/4 length + 4 CRTC crtc + 2 n size + 2 unused + 2n LISTofCARD16 red + 2n LISTofCARD16 green + 2n LISTofCARD16 blue + p unused, p=pad(6n) +└─── + +A.2.2 Protocol Requests added with version 1.3 + +┌─── + RRGetScreenResourcesCurrent + 1 CARD8 major opcode + 1 25 RandR opcode + 2 2 length + 4 WINDOW window + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 c+o+8m+(b+p)/4 reply length + 4 TIMESTAMP timestamp + 4 TIMESTAMP config-timestamp + 2 c number of CRTCs + 2 o number of outputs + 2 m number of modeinfos + 2 b total bytes in mode names + 8 unused + 4c LISTofCRTC crtcs + 4o LISTofOUTPUT outputs + 32m LISTofMODEINFO modeinfos + b STRING8 mode names + p unused, p=pad(b) +└─── + +┌─── + RRSetCrtcTransform + 1 CARD8 major opcode + 1 26 RandR opcode + 2 12+(n+p)/4+v length + 4 CRTC crtc + 36 TRANSFORM transform + 2 CARD16 filter length + 2 unused + n STRING8 filter name + p unused, p=pad(n) + 4v FIXED filter params +└─── + +┌─── + RRGetCrtcTransform + 1 CARD8 major opcode + 1 27 RandR opcode + 2 2 length + 4 CRTC crtc + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 16+(pn+pnp)/4+(cn+cnp)/4+pf+cf reply length + 36 TRANSFORM pending transform + 1 BOOL has transforms + 3 unused + 36 TRANSFORM current transform + 4 unused + 2 pn pending filter name length + 2 pf pending filter num params + 2 cn current filter name length + 2 cf current filter num params + pn STRING8 pending filter name + pnp unused, pnp=pad(pn) + 4*pf FIXED pending filter params + cn STRING8 current filter name + cnp unused, cnp=pad(cn) + 4*cf FIXED current filter params +└─── + +┌─── + RRGetPanning + 1 CARD8 major opcode + 1 28 RandR opcode + 2 2 length + 4 CRTC crtc + ▶ + 1 1 Reply + 1 RRCONFIGSTATUS status + 2 CARD16 sequence number + 4 1 reply length + 4 TIMESTAMP timestamp + 2 CARD16 left + 2 CARD16 top + 2 CARD16 width + 2 CARD16 height + 2 CARD16 track_left + 2 CARD16 track_top + 2 CARD16 track_width + 2 CARD16 track_height + 2 INT16 border_left + 2 INT16 border_top + 2 INT16 border_right + 2 INT16 border_bottom +└─── +┌─── + RRSetPanning + 1 CARD8 major opcode + 1 29 RandR opcode + 2 9 length + 4 CRTC crtc + 4 TIMESTAMP timestamp + 2 CARD16 left + 2 CARD16 top + 2 CARD16 width + 2 CARD16 height + 2 CARD16 track_left + 2 CARD16 track_top + 2 CARD16 track_width + 2 CARD16 track_height + 2 INT16 border_left + 2 INT16 border_top + 2 INT16 border_right + 2 INT16 border_bottom + ▶ + 1 1 Reply + 1 RRCONFIGSTATUS status + 2 CARD16 sequence number + 4 0 reply length + 4 TIMESTAMP new timestamp + 20 unused +└─── + +┌─── + RRSetOutputPrimary + 1 CARD8 major opcode + 1 30 RandR opcode + 2 3 length + 4 WINDOW window + 4 OUTPUT output +└─── + +┌─── + RRGetOutputPrimary + 1 CARD8 major opcode + 1 31 RandR opcode + 2 2 length + 4 WINDOW window + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 CARD32 length + 4 OUTPUT output + 4 CARD32 pad1 + 4 CARD32 pad2 + 4 CARD32 pad3 + 4 CARD32 pad4 +└─── + +A.2.3 Protocol Requests added with version 1.4 + +┌─── + RRGetProviders + 1 CARD8 major opcode + 1 32 RandR opcode + 2 2 length + 4 WINDOW window + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 p length + 4 TIMESTAMP timestamp + 2 p number of Providers + 18 unused + 4p LISTofPROVIDERS providers +└─── +┌─── + RRGetProviderInfo + 1 CARD8 major opcode + 1 33 RandR opcode + 2 3 length + 4 PROVIDER provider + 4 TIMESTAMP config-timestamp + ▶ + 1 1 Reply + 1 RRCONFIGSTATUS status + 2 CARD16 sequence number + 4 1+c+o+(a*2)+(n+p)/4 reply length + 4 TIMESTAMP timestamp + 4 CARD32 capabilities + 2 c number of crtcs + 2 o number of outputs + 2 a number of associated providers + 2 n length of name + 8 unused + 4c LISTofCRTC crtcs + 4o LISTofOUTPUT outputs + 4a LISTofPROVIDER associated providers + 4a CARD32 associated provider capability + n STRING8 name + p unused, p=pad(n) +└─── +┌─── + RRSetProviderOffloadSink + 1 CARD8 major opcode + 1 34 RandR opcode + 2 4 length + 4 PROVIDER provider + 4 PROVIDER offload sink provider + 4 TIMESTAMP timestamp +└─── +┌─── + RRSetProviderOutputSource + 1 CARD8 major opcode + 1 35 RandR opcode + 2 4 length + 4 PROVIDER provider + 4 PROVIDER output source provider + 4 TIMESTAMP timestamp +└─── +┌─── + RRListProviderProperties + 1 CARD8 major opcode + 1 36 RandR opcode + 2 2 length + 4 PROVIDER provider + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 n reply length + 2 n number of ATOMs in atoms + 22 unused + 4n LISTofATOM atoms +└─── +┌─── + RRQueryProviderProperty + 1 CARD8 major opcode + 1 37 RandR opcode + 2 3 request length + 4 PROVIDER provider + 4 ATOM property + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 n reply length + 1 BOOL pending + 1 BOOL range + 1 BOOL immutable + 21 unused + 4n LISTofINT32 valid values +└─── +┌─── + RRConfigureProviderProperty + 1 CARD8 major opcode + 1 38 RandR opcode + 2 4+n request length + 4 PROVIDER provider + 4 ATOM property + 1 BOOL pending + 1 BOOL range + 2 unused + 4n LISTofINT32 valid values +└─── +┌─── + RRChangeProviderProperty + 1 CARD8 major opcode + 1 39 RandR opcode + 2 6+(n+p)/4 request length + 4 PROVIDER provider + 4 ATOM property + 4 ATOM type + 1 CARD8 format + 1 mode + 0 Replace + 1 Prepend + 2 Append + 2 unused + 4 CARD32 length of data in format units + (= n for format = 8) + (= n/2 for format = 16) + (= n/4 for format = 32) + n LISTofBYTE data + (n is a multiple of 2 for format = 16) + (n is a multiple of 4 for format = 32) + p unused, p=pad(n) +└─── +┌─── + RRDeleteProviderProperty + 1 CARD8 major opcode + 1 40 RandR opcode + 2 3 request length + 4 PROVIDER provider + 4 ATOM property +└─── +┌─── + RRGetProviderProperty + 1 CARD8 major opcode + 1 41 RandR opcode + 2 7 request length + 4 PROVIDER provider + 4 ATOM property + 4 ATOM type + 0 AnyPropertyType + 4 CARD32 long-offset + 4 CARD32 long-length + 1 BOOL delete + 1 BOOL pending + 2 unused + ▶ + 1 1 Reply + 1 CARD8 format + 2 CARD16 sequence number + 4 (n+p)/4 reply length + 4 ATOM type + 0 None + 4 CARD32 bytes-after + 4 CARD32 length of value in format units + (= 0 for format = 0) + (= n for format = 8) + (= n/2 for format = 16) + (= n/4 for format = 32) + 12 unused + n LISTofBYTE value + (n is zero for format = 0) + (n is a multiple of 2 for format = 16) + (n is a multiple of 4 for format = 32) + p unused, p=pad(n) +└─── + +A.2.4 Protocol Requests added with version 1.5 + +┌─── + RRGetMonitors + 1 CARD8 major opcode + 1 42 RandR opcode + 2 2 request length + 4 WINDOW window + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 6*n + o reply length + 4 TIMESTAMP timestamp + 4 n nmonitors + 4 o noutputs + 12 unused + n*24+o*4 LISTofMONITORINFO monitors +└─── +┌─── + RRSetMonitor + 1 CARD8 major opcode + 1 43 RandR opcode + 2 6 + o request length + 4 WINDOW window + 24+o MONITORINFO monitorinfo +└─── +┌─── + RRDeleteMonitor + 1 CARD8 major opcode + 1 44 RandR opcode + 2 3 request length + 4 WINDOW window + 4 ATOM name +└─── + +A.3 Protocol Events + +┌─── + RRScreenChangeNotify + 1 Base + 0 code + 1 ROTATION new rotation and reflection + 2 CARD16 sequence number + 4 TIMESTAMP timestamp + 4 TIMESTAMP configuration timestamp + 4 WINDOW root window + 4 WINDOW request window + 2 SIZEID size ID + 2 SUBPIXELORDER subpixel order defined in Render + 2 CARD16 width in pixels + 2 CARD16 height in pixels + 2 CARD16 width in millimeters + 2 CARD16 height in millimeters +└─── + +A.3.1 Protocol Events added with version 1.2 + +┌─── + RRCrtcChangeNotify + 1 Base + 1 code + 1 0 sub-code + 2 CARD16 sequence number + 4 TIMESTAMP timestamp + 4 WINDOW request window + 4 CRTC crtc affected + 4 MODE mode in use + 2 ROTATION new rotation and reflection + 2 unused + 2 INT16 x + 2 INT16 y + 2 CARD16 width + 2 CARD16 height +└─── +┌─── + RROutputChangeNotify + 1 Base + 1 code + 1 1 sub-code + 2 CARD16 sequence number + 4 TIMESTAMP timestamp + 4 TIMESTAMP configuration timestamp + 4 WINDOW request window + 4 OUTPUT output affected + 4 CRTC crtc in use + 4 MODE mode in use + 2 ROTATION rotation in use + 1 CONNECTION connection status + 1 SUBPIXELORDER subpixel order +└─── +┌─── + RROutputPropertyNotify + 1 Base + 1 code + 1 2 sub-code + 2 CARD16 sequence number + 4 WINDOW window + 4 OUTPUT output + 4 ATOM atom + 4 TIMESTAMP time + 1 state + 0 NewValue + 1 Deleted + 11 unused +└─── + +A.3.2 Protocol Events added with version 1.4 +┌─── + RRProviderChangeNotify + 1 Base + 1 code + 1 3 sub-code + 2 CARD16 sequence number + 4 TIMESTAMP timestamp + 4 WINDOW request window + 4 PROVIDER provider affected + 16 unused +└─── +┌─── + RRProviderPropertyNotify + 1 Base + 1 code + 1 4 sub-code + 2 CARD16 sequence number + 4 WINDOW window + 4 PROVIDER provider + 4 ATOM atom + 4 TIMESTAMP time + 1 state + 0 NewValue + 1 Deleted + 11 unused +└─── +┌─── + RRResourceChangeNotify + 1 Base + 1 code + 1 5 sub-code + 2 CARD16 sequence number + 4 TIMESTAMP time + 4 WINDOW window + 20 unused +└─── +A.4 Protocol Errors + +┌─── + ERRORS + Base + 0 Output + Base + 1 Crtc + Base + 2 Mode + Base + 3 Provider +└─── + +Bibliography + +[RANDR] Gettys, Jim and Keith Packard, "The X Resize and Rotate + Extension - RandR", Proceedings of the 2001 USENIX Annual + Technical Conference, Boston, MA + +[RENDER] + Packard, Keith, "The X Rendering Extension", work in progress, + https://gitlab.freedesktop.org/xorg/proto/xorgproto/raw/master/renderproto.txt diff --git a/miniconda3/share/doc/xorgproto/renderproto.txt b/miniconda3/share/doc/xorgproto/renderproto.txt new file mode 100644 index 0000000000000000000000000000000000000000..b589c85b4d413406ebc01554899382acfa1e62a5 --- /dev/null +++ b/miniconda3/share/doc/xorgproto/renderproto.txt @@ -0,0 +1,1214 @@ + The X Rendering Extension + Version 0.11 + 2009-07-15 + Keith Packard + keithp@keithp.com + +1. Introduction + +The X Rendering Extension (Render) introduces digital image composition as +the foundation of a new rendering model within the X Window System. +Rendering geometric figures is accomplished by client-side tessellation into +either triangles or trapezoids. Text is drawn by loading glyphs into the +server and rendering sets of them. + +2. Acknowledgments + +This extension was the work of many people, in particular: + + + Thomas Porter and Tom Duff for their formal description + of image compositing. + + + Rob Pike and Russ Cox who designed the Plan 9 window system from + which the compositing model was lifted. + + + Juliusz Chroboczek and Raph Levien whose proposal for client-side + glyph management eliminated font handling from the X server. + + + Jon Leech, Brad Grantham and Allen Akin for patiently explaining + how OpenGL works. + + + Carl Worth for providing the sample implementation of + trapezoid rendering and showing how broken the spec was + + + Sam Pottle and Jamey Sharp for helping demonstrate the correctness + of the trapezoid specification. + + + Owen Taylor for helping specify projective transformations + +3. Rendering Model + +Render provides a single rendering operation which can be used in a variety of +ways to generate images: + + dest = (source IN mask) OP dest + +Where 'IN' is the Porter/Duff operator of that name and 'OP' is any of the +list of compositing operators described below, among which can be found all +of the Porter/Duff binary operators. + +To use this operator several additional values are required: + + + The destination rectangle. This is a subset of the destination + within which the rendering is performed. + + + The source location. This identifies the coordinate in the + source aligned with the upper left corner of the + destination rectangle. + + + The mask location. This identifies the coordinate in the + mask aligned with the upper left corner of the + destination rectangle. + + + A clip list. This limits the rendering to the intersection of the + destination rectangle with this clip list. + + + The OP to use + + + Whether the source should be repeated to cover the destination + rectangle, extended with a constant pixel value or extended by + using the nearest available source pixel. + + + Whether the mask should be repeated to cover the destination + rectangle, extended with a constant pixel value or extended by + using the nearest available mask pixel. + + + Whether the mask has a single alpha value for all four channels or + whether each mask channel should affect the associated source/dest + channels. + + + Whether the source should be reshaped with a projective + transformation, and if so, what filter to apply while + resampling the data. + + + Whether the mask should be reshaped with a projective + transformation, and if so, what filter to apply while + resampling the data. + +These parameters are variously attached to the operands or included in each +rendering request. + +4. Data types + +The core protocol rendering system uses a pixel model and applies color only +in the final generation of the video signal. A compositing model operates +on colors, not pixel values so a new datatype is needed to interpret data as +color instead of just bits. + +The "PictFormat" object holds information needed to translate pixel values +into red, green, blue and alpha channels. The server has a list of picture +formats corresponding to the various visuals on the screen. There are two +classes of formats, Indexed and Direct. Indexed PictFormats hold a list of +pixel values and RGBA values while Direct PictFormats hold bit masks for each +of R, G, B and A. + +The "Picture" object contains a Drawable, a PictFormat and some +rendering state. More than one Picture can refer to the same Drawable. + +5. Errors + +Errors are sent using core X error reports. + +PictFormat + A value for a PICTFORMAT argument does not name a defined PICTFORMAT. + +Picture + A value for a PICTURE argument does not name a defined PICTURE. + +PictOp + A value for a PICTOP argument does not name a defined PICTOP. + +GlyphSet + A value for a GLYPHSET argument does not name a defined GLYPHSET. + +Glyph + A value for a GLYPH argument does not name a defined GLYPH in the + glyphset. + +6. Protocol Types + +PICTURE 32-bit value (top three bits guaranteed to be zero) +PICTFORMAT 32-bit value (top three bits guaranteed to be zero) +PICTTYPE { Indexed, Direct } +PICTOP { Clear, Src, Dst, Over, OverReverse, In, InReverse, + Out, OutReverse, Atop, AtopReverse, Xor, Add, Saturate, + DisjointClear, DisjointSrc, DisjointDst, DisjointOver, + DisjointOverReverse, DisjointIn, DisjointInReverse, + DisjointOut, DisjointOutReverse, DisjointAtop, + DisjointAtopReverse, DisjointXor, + ConjointClear, ConjointSrc, ConjointDst, ConjointOver, + ConjointOverReverse, ConjointIn, ConjointInReverse, + ConjointOut, ConjointOutReverse, ConjointAtop, + ConjointAtopReverse, ConjointXor, + Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, + ColorBurn, HardLight, SoftLight, Difference, Exclusion, + HSLHue, HSLSaturation, HSLColor, HSLLuminosity + } +SUBPIXEL { Unknown, HorizontalRGB, HorizontalBGR, + VerticalRGB, VerticalBGR, None + } +COLOR [ + red, green, blue, alpha: CARD16 + ] +CHANNELMASK [ + shift, mask: CARD16 + ] +DIRECTFORMAT [ + red, green, blue, alpha: CHANNELMASK + ] +INDEXVALUE [ + pixel: Pixel; + red, green, blue, alpha: CARD16 + ] +PICTFORMINFO [ + id: PICTFORMAT + type: PICTTYPE + depth: CARD8 + direct: DIRECTFORMAT + colormap: COLORMAP or None + ] + +PICTVISUAL [ + visual: VISUALID or None + format: PICTFORMAT + ] + +PICTDEPTH [ + depth: CARD8 + visuals: LISTofPICTVISUAL + ] + +PICTSCREEN LISTofPICTDEPTH + +FIXED 32-bit value (top 16 are integer portion, bottom 16 are fraction) +TRANSFORM [ + p11, p12, p13: FIXED + p21, p22, p23: FIXED + p31, p32, p33: FIXED + ] +POINTFIX [ + x, y: FIXED + ] +POLYEDGE { Sharp, Smooth } +POLYMODE { Precise, Imprecise } +REPEAT { None, Regular, Pad, Reflect } +COLORPOINT [ + point: POINTFIX + color: COLOR + ] +SPANFIX [ + left, right, y: FIXED + ] +COLORSPANFIX [ + left, right, y: FIXED + left_color: COLOR + right_color: COLOR +QUAD [ + p1, p2, p3, p4: POINTFIX + ] +TRIANGLE [ + p1, p2, p3: POINTFIX + ] +LINEFIX [ + p1, p2: POINTFIX + ] +TRAP [ + top, bottom: SPANFIX + ] +TRAPEZOID [ + top, bottom: FIXED + left, right: LINEFIX + ] +(TRAPEZOID is deprecated) +GLYPHSET 32-bit value (top three bits guaranteed to be zero) +GLYPH 32-bit value +GLYPHINFO [ + width, height: CARD16 + x, y: INT16 + off-x, off-y: INT16 + ] +PICTGLYPH [ + info: GLYPHINFO + x, y: INT16 + ] +GLYPHABLE GLYPHSET or FONTABLE +GLYPHELT8 [ + dx, dy: INT16 + glyphs: LISTofCARD8 + ] +GLYPHITEM8 GLYPHELT8 or GLYPHABLE +GLYPHELT16 [ + dx, dy: INT16 + glyphs: LISTofCARD16 + ] +GLYPHITEM16 GLYPHELT16 or GLYPHABLE +GLYPHELT32 [ + dx, dy: INT16 + glyphs: LISTofCARD32 + ] +GLYPHITEM32 GLYPHELT32 or GLYPHABLE + +ANIMCURSORELT [ + cursor: CURSOR + delay: CARD32 + ] +7. Standard PictFormats + +The server must support a Direct PictFormat with 8 bits each of red, green, +blue and alpha as well as a Direct PictFormat with 8 bits of red, green and +blue and 0 bits of alpha. The server must also support Direct PictFormats +with 1, 4 and 8 bits of alpha and 0 bits of r, g and b. + +Pixel component values lie in the close range [0,1]. These values are +encoded in a varying number of bits. Values are encoded in a straight +forward manner. For a component encoded in m bits, a binary encoding b +is equal to a component value of b/(2^m-1). + +A Direct PictFormat with zero bits of alpha component is declared to have +alpha == 1 everywhere. A Direct PictFormat with zero bits of red, green and +blue is declared to have red, green, blue == 0 everywhere. If any of red, +green or blue components are of zero size, all are of zero size. Direct +PictFormats never have colormaps and are therefore screen independent. + +Indexed PictFormats never have alpha channels and the direct component is all +zeros. Indexed PictFormats always have a colormap in which the specified +colors are allocated read-only and are therefore screen dependent. Drawing +to in Indexed Picture uses only pixel values listed by QueryPictIndexValues. +Reading from an Indexed Picture uses red, green and blue values from the +colormap and alpha values from those listed by QueryPictIndexValues. Pixel +values not present in QueryPictIndexValues are given alpha values of 1. + +8. Compositing Operators + +For each pixel, the four channels of the image are computed with: + + C = Ca * Fa + Cb * Fb + +where C, Ca, Cb are the values of the respective channels and Fa and Fb +come from the following table: + + PictOp Fa Fb + -------------------------------------------------- + Clear 0 0 + Src 1 0 + Dst 0 1 + Over 1 1-Aa + OverReverse 1-Ab 1 + In Ab 0 + InReverse 0 Aa + Out 1-Ab 0 + OutReverse 0 1-Aa + Atop Ab 1-Aa + AtopReverse 1-Ab Aa + Xor 1-Ab 1-Aa + Add 1 1 + Saturate min(1,(1-Ab)/Aa) 1 + DisjointClear 0 0 + DisjointSrc 1 0 + DisjointDst 0 1 + DisjointOver 1 min(1,(1-Aa)/Ab) + DisjointOverReverse min(1,(1-Ab)/Aa) 1 + DisjointIn max(1-(1-Ab)/Aa,0) 0 + DisjointInReverse 0 max(1-(1-Aa)/Ab,0) + DisjointOut min(1,(1-Ab)/Aa) 0 + DisjointOutReverse 0 min(1,(1-Aa)/Ab) + DisjointAtop max(1-(1-Ab)/Aa,0) min(1,(1-Aa)/Ab) + DisjointAtopReverse min(1,(1-Ab)/Aa) max(1-(1-Aa)/Ab,0) + DisjointXor min(1,(1-Ab)/Aa) min(1,(1-Aa)/Ab) + ConjointClear 0 0 + ConjointSrc 1 0 + ConjointDst 0 1 + ConjointOver 1 max(1-Aa/Ab,0) + ConjointOverReverse max(1-Ab/Aa,0) 1 + ConjointIn min(1,Ab/Aa) 0 + ConjointInReverse 0 min(Aa/Ab,1) + ConjointOut max(1-Ab/Aa,0) 0 + ConjointOutReverse 0 max(1-Aa/Ab,0) + ConjointAtop min(1,Ab/Aa) max(1-Aa/Ab,0) + ConjointAtopReverse max(1-Ab/Aa,0) min(1,Aa/Ab) + ConjointXor max(1-Ab/Aa,0) max(1-Aa/Ab,0) + +Saturate and DisjointOverReverse are the same. They match OpenGL +compositing with FUNC_ADD, SRC_ALPHA_SATURATE, ONE, except that Render uses +premultiplied alpha while Open GL uses non-premultiplied alpha. + +The result of any compositing operator is always limited to the range +[0,1] for each component. Components whose value would be greater than 1 +are set to 1. + +For operations involving division, when the divisor is zero, define the +quotient to be positive infinity. The result is always well defined +because the division is surrounded with a max or min operator which will +give a finite result. + +When the mask contains separate alpha values for each channel, the +alpha value resulting from the combination of that value with the source +alpha channel is used in the final image composition. + +9. Source and Mask Transformations + +When fetching pixels from the source or mask pictures, Render provides four +options for pixel values which fall outside the drawable (this includes +pixels within a window geometry obscured by other windows). + + + None. Missing values are replaced with transparent. + + + Pad. Replace missing pixels with the nearest available + pixel. Where multiple pixels are equidistant, select + those with smallest Y and then smallest X coordinates + + + Normal. Select the pixel which would appear were the + drawable tiled to enclose the missing coordinate. If + the tiling doesn't cover the coordinate, use the + selected Constant or Nearest mode. + + * Reflect. Select the pixel which would appear were the + drawable tiled to enclose the missing coordinate in such a + way that tiles in even numbered columns are reflected in the Y + axis, and tiles in even numbered rows are reflected in the X + axis. Tiles that in both an even numbered row and an even + numbered column are reflected in both axes. + +To construct the source and mask operands, the computed pixels values are +transformed through a homogeneous matrix, filtered and then used in the +fundamental rendering operator described above. Each screen provides a list +of supported filter names. There are a few required filters, and several +required filter alias which must map to one of the available filters. + +10. Polygon Rasterization + +Render provides only two kinds of polygons, trapezoids and triangles. To +improve efficiency, several different wire encodings exist for each. + +All trapezoids must be convex. Rendering of concave trapezoids is unspecified +except that the result must obey the clipping rules. + +Composite +Polygons are rasterized by implicit generating an alpha mask and using that +in the general compositing operator along with a supplied source image: + + tmp = Rasterize (polygon) + Composite (op, dst, src, tmp) + +When rasterized with Sharp edges, the mask is computed with a depth of 1 so +that all of the mask values are either 0 or 1. + +When rasterized with Smooth edges, the mask is generated by creating a square +around each pixel coordinate and computing the amount of that square covered +by the polygon. This ignores sampling theory but it provides a precise +definition which is close to the right answer. This value is truncated to +the alpha width in the fallback format before application of the compositing +operator. + +Rasterization +Alpha values are generated by point sampling the coverage of a square +surrounding the center of each pixel by the polygon. + +In Precise poly mode, the sample points are located in a regular grid. When +alpha depth 'e' is even, the regular grid is 2**(e/2) + 1 samples wide and +2**(e/2) -1 samples high. For odd alpha depth 'o', the sample grid is 2**o +- 1 samples wide and 1 sample high. Note that odd alpha depth usually +occurs only at depth 1, so this misshapen sample grid has no ill effects. +The sample grid is centered within the pixel and then each sample point is +rounded down to a point on the sub-pixel coordinate grid. + +In Imprecise mode, the location of the sample points is not specified, but +the implementation must conform to the following constraints: + + + Abutting edges must match precisely. When specifying two polygons + abutting along a common edge, if that edge is specified with the + same coordinates in each polygon then the sum of alpha values for + pixels inside the union of the two polygons must be precisely one. + + + Translationally invariant. The pixelization of the polygon must + be the same when either the polygon or the target drawable + are translated by any whole number of pixels in any direction. + + + Sharp edges are honored. When the polygon is rasterized with Sharp + edges, the implicit alpha mask will contain only 1 or 0 for + each pixel. + + + Order independent. Two identical polygons specified with vertices + in different orders must generate identical results. + +11. Image Filtering + +When computing pixels from source and mask images, a filter may be applied +to the data. This is usually used with a non-identity transformation +matrix, but filtering may be applied with an identity transformation. + +Each filter is given a unique name encoded as an ISO Latin-1 string. +Filters may be configured with a list of fixed point values; the number of +parameters and their interpretation is currently left to conventions passed +outside of the protocol. A set of standard filters are required to be +provided: + + Filter Name Description + + nearest Nearest neighbor filtering + bilinear Linear interpolation in two dimensions + +Additional names may be provided for any filter as aliases. A set of +standard alias names are required to be mapped to a provided filter so that +applications can use the alias names without checking for availability. + + Alias name Intended interpretation + + fast High performance, quality similar to Nearest + good Reasonable performance, quality similar to Bilinear + best Highest quality available, performance may not + be suitable for interactive use + +Aliases must map directly to a non-aliased filter name. + +There is also a set of standard filters which are not required but may be +provided. If they are provided, using the standard name, they must match +the definition specified here. + + Filter Name Description + + convolution MxN convolution filter. The values specified + in SetPictureFilter are M, N and then M * N + filter parameters. M and N must be integers + represented as fixed point numbers. + gaussian Gaussian blur. The value specified is a radius + in pixels (which can be fractional). A standard + Gaussian 2D convolution filter will be applied. + binomial Binomial blur. An approximation of a Gaussian + blur using binomial coefficients + +12. Glyph Rendering + +Glyphs are small alpha masks which can be stored in the X server and +rendered by referring to them by name. A set of glyphs can be rendered in a +single request. Glyphs are positioned by subtracting the x, y elements of +the GLYPHINFO from the requested rendering position. The next glyph +rendering position is set to the current rendering position plus the off-x +and off-y elements. + +Glyphs are stored in GlyphSets and are named within the GlyphSet with +client-specified 32-bit numbers. + +Glyphs can be stored in any PictFormat supported by the server. All glyphs +in a GlyphSet are stored in the same format. + +13. Extension Initialization + +The client must negotiate the version of the extension before executing +extension requests. Behavior of the server is undefined otherwise. + +QueryVersion + + client-major-version: CARD32 + client-minor-version: CARD32 + + -> + + major-version: CARD32 + minor-version: CARD32 + + The client sends the highest supported version to the server and + the server sends the highest version it supports, but no higher than + the requested version. Major versions changes can introduce + incompatibilities in existing functionality, minor version + changes introduce only backward compatible changes. It is + the clients responsibility to ensure that the server supports + a version which is compatible with its expectations. + +QueryPictFormats + + -> + + formats: LISTofPICTFORMINFO + screens: LISTofPICTSCREEN + ndepths: CARD32 + nvisuals: CARD32 + subpixels: LISTofSUBPIXEL + + Errors: + + + The server responds with a list of supported PictFormats and + a list of which PictFormat goes with each visual on each screen. + Every PictFormat must match a supported depth, but not every + PictFormat need have a matching visual. + + The total number of PICTDEPTH and PICTVISUAL objects is this reply + is given in 'ndepths' and 'nvisuals'. + + The relationship between the red, green and blue elements making + up each pixel indexed by screen is returned in subpixels. + This list is not present in servers advertising protocol + versions earlier than 0.6. This list may be shorter than + the number of screens, in which case the remaining screens + are given sub pixel order Unknown. + +QueryPictIndexValues + + format: PICTFORMAT + + -> + + values: LISTofINDEXVALUE + + Errors: + PictFormat, Match + + Returns the mapping from pixel values to RGBA values for the + specified Indexed PictFormat. If 'format' does not refer to + an Indexed PictFormat a Match error is generated. + +QueryFilters + + drawable: DRAWABLE + + -> + + filters: LISTofSTRING8 + aliases: LISTofCARD16 + + This request gets the names of available filters that can be used on the + given drawable. Filters are applied using a SetPictureFilter request. + + 'aliases' contains a value for each filter name which is the index into + 'filters' if this name is an alias. Non-aliased filter have this value + set to 0xFFFF. + +14. Extension Requests + +CreatePicture + + pid: PICTURE + drawable: DRAWABLE + format: PICTFORMAT + value-mask: BITMASK + value-list: LISTofVALUE + + Errors: + Alloc, Drawable, IDChoice, Match, Pixmap, Picture, + PictFormat, Value + + This request creates a Picture object associated with the specified + drawable and assigns the identifier pid to it. Pixel data in the + image are interpreted according to 'format'. It is a Match error + to specify a format with a different depth than the drawable. If + the drawable is a Window then the Red, Green and Blue masks must + match those in the visual for the window else a Match error is + generated. + + The value-mask and value-list specify attributes of the picture that + are to be explicitly initialized. The possible values are: + + repeat: REPEAT + alpha-map: PICTURE or None + alpha-x-origin: INT16 + alpha-y-origin: INT16 + clip-x-origin: INT16 + clip-y-origin: INT16 + clip-mask: PIXMAP or None + graphics-exposures: BOOL + subwindow-mode: { ClipByChildren, IncludeInferiors } + poly-edge: POLYEDGE + poly-mode: POLYMODE + dither: ATOM or None + component-alpha: BOOL + + When used as a source or mask operand, Repeat indicates how the + drawable contents should be extended in both directions. + + The alpha channel of alpha-map is used in place of any alpha channel + contained within the drawable for all rendering operations. The + alpha-mask origin is interpreted relative to the origin of drawable. + Rendering is additionally clipped by the geometry and clip mask of + alpha-map. Exposures to the window do not affect the contents of + alpha-map. Alpha-map must refer to a picture containing a Pixmap, + not a Window (or a Match error results). If the alpha-map picture + itself already has an alpha-map, the result is undefined. + + The clip-mask restricts reads and writes to drawable. Only pixels + where the clip-mask has bits set to 1 are read or written. Pixels + are not accessed outside the area covered by the clip-mask or where + the clip-mask has bits set to 0. The clip-mask affects all graphics + requests, including sources. The clip-mask origin is interpreted + relative to the origin of the picture. If a pixmap is specified as + the clip-mask, it must have depth 1 and have the same root as the + drawable (or a Match error results). If clip-mask is None, then + pixels are always drawn, regardless of the clip origin. The + clip-mask can also be set with the SetPictureClipRectangles request. + Transformations, filters and repeat modes do not affect the clip + mask. + + When a window is used as a destination, the subwindow_mode + determines what happens to pixels obscured by inferior + windows. For ClipByChildren the window is clipped by inferiors + and siblings. For IncludeInferior, the window is clipped by + siblings, but not by inferiors. + + When a window is used as source or mask, the subwindow_mode is + ignored. Pixels that are obscured by other windows, whether + siblings or inferiors, have undefined contents. + + The graphics-exposures flag is ignored. GraphicsExposure events are + never generated by this extension. + + Poly-edge and poly-mode control the rasterization of polygons as + described above. + + Dither is ignored. + + Component-alpha indicates whether each image component is intended as + a separate alpha value when the picture is used as a mask operand. + + The default component values are + + Component Default + ------------------------------- + repeat None + clip-x-origin 0 + clip-y-origin 0 + clip-mask None + subwindow-mode ClipByChildren + poly-edge Smooth + poly-mode Precise + component-alpha False + +ChangePicture + + pid: PICTURE + value-mask: BITMASK + value-list: LISTofVALUE + + Errors: + Picture, Alloc, Pixmap, PictOp, Value + + The value-mask and value-list specify which attributes are to be + changed. The values and restrictions are the same as for + CreatePicture. + +SetPictureClipRectangles + + picture: PICTURE + clip-x-origin: INT16 + clip-y-origin: INT16 + rectangles: LISTofRECTANGLE + + Errors: + Alloc, Picture + + This request changes clip-mask in picture to the specified list of + rectangles and sets the clip origin. Input and output will be + clipped to remain contained within the rectangles. The clip origin + is interpreted relative to the origin of picture after + transformations and repeats have been applied. The rectangle + coordinates are interpreted relative to the clip origin. + + The list of rectangles can be empty, which effectively disables + output. This is the opposite of passing None as the clip-mask in + CreatePicture and ChangePicture. + + Note that output is clipped to the union of all of the rectangles + and that no particular ordering among the rectangles is required. + +SetPictureTransform + + picture: PICTURE + transform: TRANSFORM + + Errors: + Alloc, Value, Picture + + This request changes the projective transformation used to + map coordinates when 'picture' is used as the source or + mask in any compositing operation. The transform + maps from destination pixel geometry back to the source pixel + geometry. + + The matrix must be invertable, else a Value error is generated. + +SetPictureFilter + + picture: PICTURE + filter: STRING8 + values: LISTofFIXED + + Errors: + Value, Match, Picture + + This request sets the current filter used when picture is a source + or mask operand. Filter must be one of the filters supported + for the screen associated with picture, else a Match error + is generated. If the filter accepts additional parameters, + they can be provided in values, incorrect values generate Value + errors, too many values generate Match errors. Too few values + cause the filter to assume default values for the missing + parameters. + + When created, Pictures are set to the Nearest filter. + +FreePicture + + pid: PICTURE + + Errors: + Picture + + This request deletes the association between the resource ID and the + picture. The picture storage will be freed when no other resource + references it. + +Composite + + op: PICTOP + src: PICTURE + mask: PICTURE or None + dst: PICTURE + src-x, src-y: INT16 + mask-x, mask-y: INT16 + dst-x, dst-y: INT16 + width, height: CARD16 + + This request combines the specified rectangle of the transformed + src and mask operands with the specified rectangle of dst using op + as the compositing operator. The coordinates are relative their + respective (transformed) drawable's origin. Rendering is clipped + to the geometry of the dst drawable and then to the dst clip-list. + + Pixels outside the geometry of src or mask needed for this + computation are substituted as described in the Source and Mask + Transformations section above. + + If src, mask and dst are not in the same format, and one of their + formats can hold all without loss of precision, they are converted + to that format. Alternatively, the server will convert each + operand to the fallback format. + + If mask is None, it is replaced by a constant alpha value of 1. + +FillRectangles + + op: PICTOP + dst: PICTURE + color: COLOR + rects: LISTofRECTANGLE + + This request combines color with the destination drawable in the + area specified by rects. Each rectangle is combined separately; + overlapping areas will be rendered multiple times. The effect is + equivalent to compositing with a repeating source picture filled with + the specified color. + +Trapezoids + + op: PICTOP + src: PICTURE + src-x, src-y: INT16 + dst: PICTURE + mask-format: PICTFORMAT or None + traps: LISTofTRAPEZOID + + This request rasterizes the list of trapezoids. + + For each trap, the area between the left and right edges is filled + from the top to the bottom. src-x and src-y register the pattern to + the floor of the top x and y coordinate of the left edge of the + first trapezoid, they are adjusted for subsequent trapezoids so that + the pattern remains globally aligned within the destination. + + When mask-format is not None, trapezoids are rendered in the + following way with the effective mask computed in mask-format: + + tmp = temporary alpha picture (in mask-format) + Combine (Zero, tmp, tmp, None) + for each trapezoid + Combine (Add, tmp, trapezoid, None) + Combine (op, dst, source, tmp) + + When mask-format is None, trapezoids are rendered in the order + specified directly to the destination: + + for each trapezoid + Combine (op, dst, source, trapezoid) + + (The Trapezoids request is deprecated) + +Triangles + + op: PICTOP + src: PICTURE + src-x, src-y: INT16 + dst: PICTURE + mask-format: PICTFORMAT or None + triangles: LISTofTRIANGLE + + This request rasterizes the list of triangles in the order they + occur in the list. + + When mask-format is not None, triangles are rendered in the + following way with the effective mask computed in mask-format: + + tmp = temporary alpha picture (in mask-format) + Combine (Zero, tmp, tmp, None) + for each triangle + Combine (Add, tmp, triangle, None) + Combine (op, dst, source, tmp) + + When mask-format is None, triangles are rendered in the order + specified directly to the destination: + + for each triangle + Combine (op, dst, source, triangle) + +TriStrip + + op: PICTOP + src: PICTURE + src-x, src-y: INT16 + dst: PICTURE + mask-format: PICTFORMAT or None + points: LISTofPOINTFIX + + Triangles are formed by initially using the first three points and + then by eliminating the first point and appending the next point in + the list. If fewer than three points are provided, this request does + nothing. + + When mask-format is not None, triangles are rendered in the + following way with the effective mask computed in mask-format: + + tmp = temporary alpha picture (in mask-format) + Combine (Zero, tmp, tmp, None) + for each triangle + Combine (Add, tmp, triangle, None) + Combine (op, dst, source, tmp) + + When mask-format is None, triangles are rendered in the order + specified directly to the destination: + + for each triangle + Combine (op, dst, source, triangle) + +TriFan + op: PICTOP + src: PICTURE + src-x, src-y: INT16 + dst: PICTURE + mask-format: PICTFORMAT or None + points: LISTofPOINTFIX + + Triangles are formed by initially using the first three points and + then by eliminating the second point and appending the next point + int the list. If fewer than three points are provided, this request + does nothing. + + When mask-format is not None, triangles are rendered in the + following way with the effective mask computed in mask-format: + + tmp = temporary alpha picture (in mask-format) + Combine (Zero, tmp, tmp, None) + for each triangle + Combine (Add, tmp, triangle, None) + Combine (op, dst, source, tmp) + + When mask-format is None, triangles are rendered in the order + specified directly to the destination: + + for each triangle + Combine (op, dst, source, triangle) + +CreateGlyphSet + + gsid: GLYPHSET + format: PICTFORMAT + + Errors: + Alloc, IDChoice, PictFormat, Match + + This request creates a container for glyphs. The glyphset and + all contained glyphs are destroyed when gsid and any other names + for the glyphset are freed. Format must be a Direct format, when + it contains RGB values, the glyphs are composited using + component-alpha True, otherwise they are composited using + component-alpha False. + +ReferenceGlyphSet + + gsid: GLYPHSET + existing: GLYPHSET + + Errors: + Alloc, IDChoice, GlyphSet + + This request creates an additional name for the existing glyphset. + The glyphset will not be freed until all references to it are + destroyed. + +FreeGlyphSet + + glyphset: GLYPHSET + + Errors: + GlyphSet + + This request frees the name for the glyphset. When all names have + been freed, the glyphset and all contained glyphs are freed. + +AddGlyphs + glyphset: GLYPHSET + glyphids: LISTofCARD32 + glyphs: LISTofGLYPHINFO + data: LISTofBYTE + + Errors: + GlyphSet, Alloc + + This request adds glyphs to glyphset. The image for the glyphs + are stored with each glyph in a separate Z-format image padded to a + 32-bit boundary. Existing glyphs with the same names are replaced. + +FreeGlyphs + + glyphset: GLYPHSET + glyphs: LISTofGLYPH + + Errors: + GlyphSet, Match + + This request removes glyphs from glyphset. Each glyph must exist + in glyphset (else a Match error results). + +CompositeGlyphs8 +CompositeGlyphs16 +CompositeGlyphs32 + + op: PICTOP + src: PICTURE + dst: PICTURE + mask-format: PICTFORMAT or None + glyphset: GLYPHABLE + src-x, src-y: INT16 + glyphcmds: LISTofGLYPHITEM8 CompositeGlyphs8 + glyphcmds: LISTofGLYPHITEM16 CompositeGlyphs16 + glyphcmds: LISTofGLYPHITEM32 CompositeGlyphs32 + + Errors: + Picture, PictOp, PictFormat, GlyphSet, Glyph + + The src-x and src-y coordinates are relative to the drawable's + origin and specify the baseline starting position (the initial glyph + origin). Each glyph item is processed in turn. A glyphset item + causes the glyphset to be used for subsequent glyphs. Switching + among glyphsets does not affect the next glyph origin. A glyph + element delta-x and delta-y specify additional changes in the + position along the x and y axes before the string is drawn; the + deltas are always added to the glyph origin. + + All contained GLYPHSETs are always transmitted most significant byte + first. + + If a GlyphSet error is generated for an item, the previous items may + have been drawn. + + When mask-format is not None, glyphs are rendered in the following + way with the effective mask computed in mask-format: + + tmp = temporary alpha picture + Combine (Zero, tmp, tmp, None) + for each glyph + Combine (Add, tmp, glyph, None) + Combine (op, dst, source, tmp) + + When mask-format is None, glyphs are rendered in the order specified + directly to the destination: + + for each glyph + Combine (op, dst, source, glyph) + +CreateCursor + + cid: CURSOR + source: PICTURE + x, y: CARD16 + + Errors: Alloc, IDChoice, Match, Picture + + This request creates a cursor and associates identifier cid with it. + The x and y coordinates define the hotspot relative to the source's + origin and must be a point within the source (or a Match error + results). The resulting picture will nominally be drawn to the + screen with PictOpOver. + + The components of the cursor may be transformed arbitrarily to meet + display limitations. In particular, if the display supports only + two colors cursors without translucency, the cursor will be + transformed so that areas less than .5 alpha will be transparent, + else opaque, and areas darker than 50% gray will be black else white. + + The source picture can be freed immediately if no further explicit + references to it are to be made. + + Subsequent drawing in the source has an undefined effect on the + cursor. The server might or might not make a copy of the picture. + +CreateAnimCursor + cid: CURSOR + cursors: LISTofANIMCURSORELT + + Errors: Alloc, IDChoice, Cursor + + This request creates a cursor and associates identifier cid with it. + When active, the cursor image on the screen will cycle through + 'cursors', showing each cursor in the element for the number of + milliseconds indicated by the 'delay' member of that element. + +AddTraps + picture: PICTURE + off-x, off-y: INT16 + trapezoids: LISTofTRAP + + Errors: Match + + Each trap is PictOpAdd'ed to 'picture'. 'off-x', 'off-y' + are added to each coordinate. + + 'picture' must be an alpha-only picture else a 'Match' error is + returned. + +CreateSolidFill + pid: PICTURE + color: COLOR + + Creates a Source picture that represents a solid fill with + the specified color. + +CreateLinearGradient + pid: PICTURE + p1, p2: POINTFIX + nstops: CARD32 + stops: LISTofFIXED + stop_colors: LISTofCOLOR + + Errors: Alloc, Value + + Creates a source picture representing a linear Gradient. The gradients + bounds are defined by the two end points p1 and p2. + + The gradient has nstops stop points between 0 and 1, each + having a stop color defined in stop_colors. + + The array of stops has to contain values between 0 and 1 (inclusive) and + has to be ordered in increasing size or a Value error is generated. If + p1 == p2 a Value error is generated. + + The colors are non premultiplied. + +CreateRadialGradient + pid: PICTURE + inner_center: POINTFIX + outer_center: POINTFIX + inner_radius: FIXED + outer_radius: FIXED + nstops: CARD32 + stops: LISTofFIXED + stop_colors: LISTofCOLOR + + Errors: Alloc, Value + + Creates a source picture representing a radial Gradient. The + gradients bounds are defined by a center point, a focal point and a + radius around the center. + + The gradient has nstops stop points between 0 and 1, each + having a stop color defined in stop_colors. + + The array of stops has to contain values between 0 and 1 (inclusive) and + has to be ordered in increasing size or a Value error is generated. The inner + circle has to be completely contained inside the outer one or a Value error is + generated. + + The colors are non premultiplied. + +CreateConicalGradient + pid: PICTURE + center: POINTFIX + angle: FIXED + nstops: CARD32 + stops: LISTofFIXED + stop_colors: LISTofCOLOR + + Errors: Alloc, Value + + Creates a source picture representing a conical Gradient. The + gradient is defined by a center point and an angle (in degrees). + + The gradient has nstops stop points between 0 and 1, each + having a stop color defined in stop_colors. + + The array of stops has to contain values between 0 and 1 (inclusive) and + has to be ordered in increasing size or a Value error is generated. + + The colors are non premultiplied. + + +15. Extension Versioning + +The Render extension was developed in parallel with the implementation to +ensure the feasibility of various portions of the design. As portions of +the extension are implemented, the version number of the extension has +changed to reflect the portions of the standard provided. This document +describes the intent for version 1.0 of the specification, the partial +implementations have version numbers less than that. Here's a list of +what each version before 1.0 implemented: + + 0.0: + No disjoint/conjoint operators + No component alpha + Composite + CreateGlyphSet + FreeGlyphSet + AddGlyphs + CompositeGlyphs + + 0.1: + Component alpha + FillRectangles + + 0.2: + Disjoint/Conjoint operators + + 0.3: + FreeGlyphs + + 0.4: + Trapezoids + Triangles + TriStrip + TriFan + + 0.5: + CreateCursor + + 0.6: + SetPictureTransform + QueryFilters + SetPictureFilter + subpixels member of QueryPictFormats + + 0.7: + QueryPictIndexValues + 0.8: + CreateAnimCursor + 0.9: + AddTrapezoids + + 0.10: + CreateSolidFill + CreateLinearGradient + CreateRadialGradient + CreateConicalGradient + + The repeat picture attribute now supports Pad and + Reflect, older versions only supported None and Normal. + + 0.11: + Blend mode operators + diff --git a/miniconda3/share/doc/xorgproto/resproto.txt b/miniconda3/share/doc/xorgproto/resproto.txt new file mode 100644 index 0000000000000000000000000000000000000000..8b322ff88c548c6e902be11c375857321a13f64a --- /dev/null +++ b/miniconda3/share/doc/xorgproto/resproto.txt @@ -0,0 +1,462 @@ + DRAFT FOR REVIEW + The X Resource Extension + Version 1.2 + Rami Ylimäki + rami.ylimaki@vincit.fi + + ❧❧❧❧❧❧❧❧❧❧❧ + +1. Introduction + +The protocol description of X Resource Extension version 1.1 has been +either lost or has never been written. This specification documents +version 1.0 based on reverse engineered library and server +code. Version 1.1 has been accidentally released from the version +control and while it doesn't have differences to version 1.0, this +version is labeled 1.2 in order to remove the risk of confusion. In +addition to the 1.0 description, this document introduces a new 1.2 +version of the extension. + +Version 1.2 is a minor release and therefore the changes are +compatible with the previous version. Main enhancements over version +1.0 are: + +- Client identification is now possible. For example, servers + supporting version 1.2 may report PID of local clients. + +- Size of any resource can be queried from the server. Servers may not + necessarily support size calculation for every resource. However, + clients have now at least the chance to let the server do resource + size estimation for them. + + ❧❧❧❧❧❧❧❧❧❧❧ + +2. Notations used in this document + +Notation for data types and requests follows the guidelines set in +sections 2-4 of X Window System Protocol standard. + + ❧❧❧❧❧❧❧❧❧❧❧ + +3. Interoperability between version 1.1 and 1.2 + +Version 1.2 only introduces two new requests. However, these requests +could be seen as generalized versions of existing requests. Even +though we aren't deprecating any old requests, libraries could +implement some old requests using the new ones. + +The new XResQueryClientIds request could be used instead of +XResQueryClients. + +The new XResQueryResourceBytes request could be used instead of +XResQueryClientPixmapBytes. + +Using the old requests is still acceptable because we don't want to +change the semantics of existing requests between version 1.1 and 1.2. + + ❧❧❧❧❧❧❧❧❧❧❧ + +4. Data types + +4.1 Types in version 1.0 + +CLIENTXIDRANGE [ resource_base: CARD32 + resource_mask: CARD32 ] + +This type is used for reply of XResQueryClients in version 1.1. It +represents the range of resource allocated for a client and can be +also used for client identification. + +resource_base + First resource ID reserved for a client. Used also to identify the + clients themselves. +resource_mask + Mask that can be used to identify a client from some resource + ID. Just zero the bits indicated by this mask from any resource ID + to identify the client that owns the resource. + +CLIENTXID [ client: XID ] + +This type identifies a single client by a resource owned by that +client or by the first resource ID allocated for the client +(resource_base of CLIENTXIDRANGE). Whenever a resource ID is used, it +is masked by resource_mask of CLIENTXIDRANGE to find out the client +that owns the resource. + +CLIENTRESOURCETYPECOUNT [ resource_type: ATOM + count: CARD32 ] + +This type is used for reply of XResQueryClientResources in version +1.1. It represents the number of certain type of resources that are +owned by some client. + +resource_type + Atom specifying the type of a resource. +count + Number of resources of the given type owned by a client. + +4.2 Types in version 1.2 + +4.2.1 Types used by XResQueryClientIds + +CLIENTIDMASK { ClientXid = 0x1, LocalClientPid = 0x2 } + +A bitmask specifying a client identification method. Currently only +the PID of local clients is supported in the form of +LocalClientPid. ClientXid is provided for backward compatibility with +version 1.0 so that the new 1.2 requests (XResQueryClientIds) can be +used in place of the older ones (XResQueryClients). + +CLIENTIDSPEC [ client: CLIENTXID or None + mask: SETofCLIENTIDMASK or None ] + +A data structure for selecting client IDs. + +client + ID of a resource allocated for some client. Only the part + identifying a client is actually used. The resource_base of + CLIENTXIDRANGE can be used if the client doesn't own any + resources. However, any resource ID is accepted because that makes + identifying the owners of existing resources easy. The null + resource None can be used to select all clients. +mask + Collection of identification methods that should be applied on the + client. The special value None can be used to apply all supported + identification methods. + +CLIENTIDVALUE [ spec: CLIENTIDSPEC + length: CARD32 + value: LISTofCARD32 ] + +A data structure specifying a single client ID. + +spec + A unique identifier for a specific ID of some client. Wildcards + such as None and bitmask unions aren't allowed. The data structure + must always identify a single client and single ID type. However, + the client doesn't have to be specified as the resource_base of + CLIENTXIDRANGE and can be any resource owned by the client. +length + Specifies the length of an ID in units of CARD32. The length + depends on the ID type. In version 1.2 the lengths are 0 for + ClientXid and 4 for LocalClientPid. The length of ClientXid is 0 + because that is already stored in the spec field. +value + Actual ID data. In version 1.2 this is missing for ClientXid and + consists of a single CARD32 for LocalClientPid. + +4.2.2 Types used by XResQueryResourceBytes + +To better understand how resources are related to each other, it's +useful to introduce the concepts of main resource and cross +reference. By main resource we just mean a normal resource that has a +valid XID. By cross reference we mean a resource that is used by some +other resource. + +The same resource may have both of these roles depending on the +context. For example, there could be an ordinary pixmap resource. When +we talk about this resource in isolation the term main resource is +used. We call the exact same resource a cross reference when we are +concentrating on some higher level resource, such as window or +graphics context, that is using the lower level resource. Cross +references may also be internal server resources that don't have a +valid XID. + +RESOURCEIDSPEC [ resource: XID or None + type: ATOM or None/AnyPropertyType ] + +A data structure for selecting or identifying resources. The +interpretation of fields changes depending on the context. The +differences in interpretation are described below. + +resource + An XID of a resource. The null resource None can be used to select + all resources matching some type if the data structure is used in + XResQueryResourceBytes request. The null resource None can be used + to mark private server resources if the data structure is used in + a cross reference of XResQueryResourceBytes reply. +type + An atom identifying the resource type. The null atom + None/AnyPropertyType can be used to select all resource types + matching some resource ID if the data structure is used in + XResQueryResourceBytes request. + +RESOURCESIZESPEC [ spec: RESOURCEIDSPEC + bytes: CARD32 + ref_count: CARD32 + use_count: CARD32 ] + +A data structure specifying the size of a single resource. + +spec + Uniquely identifies a single resource. Wildcards such as None and + AnyPropertyType aren't allowed for main resources. In cross + references, None is used to mark internal server resources. +bytes + Number of bytes allocated for the resource. The size of a resource + is never divided by a reference count. This is the number of bytes + released in server when there are no more references left to the + resource. +ref_count + Number of total users of the resource. Typically the reference + count is 1 but for pixmaps and other resources used from different + contexts the count may be larger. +use_count + Number of times the resource is used by some other resource. For + main resources this is typically 1, because a resource doesn't + usually use itself recursively. For cross references this is the + number of times the resource is used and is also 1 usually. + +RESOURCESIZEVALUE [ size: RESOURCESIZESPEC + num_cross_references: CARD32 + cross_references: LISTofRESOURCESIZESPEC ] + +A data structure specifying sizes of cross references to other +resources in addition to the main resource size. + +size + Size of a main resource. +num_cross_references + Number of cross references to other resources from the main + resource. Currently resources can only have pixmaps as cross + references but this can be extended to other types in the + future. For simple resources this field is therefore 0 and the + cross_references list is missing. +cross_references: + Size specifications for cross references. Note that cross + references may contain resources that don't have a valid XID. For + example, a DRI2 drawable might have a cross reference to a private + pixmap that is used internally in the server only. These private + cross references are contained in this list also. This makes it + possible to emulate XResGetClientPixmapBytes with + XResGetResourceBytes. + + ❧❧❧❧❧❧❧❧❧❧❧ + +5. Requests + +5.1 Requests in version 1.0 + +┌─── + XResQueryVersion + client_major: CARD8 + client_minor: CARD8 + ▶ + server_major: CARD16 + server_minor: CARD16 +└─── + +The client sends the highest supported version to the server and the +server sends the highest version it supports, but no higher than the +requested version. Major version changes can introduce +incompatibilities in existing functionality, minor version changes +introduce only backward compatible changes. It is the client's +responsibility to ensure that the server supports a version which is +compatible with its expectations. + +client_major + Major X Resource Extension version supported by client. +client_minor + Minor X Resource Extension version supported by client. +server_major + Highest version supported by server that is compatible with + client. +server_minor + Highest version supported by server that is compatible with + client. + +┌─── + XResQueryClients + ▶ + num_clients: CARD32 + clients: LISTofCLIENTXIDRANGE +└─── + +The request asks X server to return the list of all currently +connected clients. + +num_clients + Number of currently connected clients. +clients + List of XID ranges allocated for the connected clients. + +┌─── + XResQueryClientResources + client: CLIENTXID + ▶ + num_types: CARD32 + types: LISTofCLIENTRESOURCETYPECOUNT + + Errors: Value +└─── + +This request can be used to ask the number of resources owned by a +client. The server will return the counts of each type of resource. + +client + An XID in the resource range of a client. This identifies the + client and not some specific resource. +num_types + Number of different resource types owned by the client. +types + A list of counts for each resource type. + +A value error is generated if invalid resource or client XID is given +in the request. + +┌─── + XResQueryClientPixmapBytes + client: CLIENTXID + ▶ + bytes: CARD32 + bytes_overflow: CARD32 + + Errors: Value +└─── + +This request is used to get the pixmap usage of some client. The +returned number is a sum of memory usage of each pixmap that can be +attributed to the given client. Ideally the server goes through all +pixmaps and divides each pixmap size by the pixmap reference count to +get a pixmap reference size. The reference size is then added to the +returned sum if the client happens to be referencing that pixmap. In +practice some pixmap references may be missed, because it would be too +difficult to keep track of all pixmap references. However, the server +will check the most important client resources that are using pixmaps +and tries to estimate the pixmap usage as well as is possible. In +other words, the server need only make a best-effort attempt to +calculate resource source, so actual resource size may differ from +that reported in practice. + +client + Identifies a client by an ID in its resource ID range. +bytes: + Number of bytes attributed to pixmap references from the client + resources. +bytes_overflow: + Higher order word for the bytes field in case the sum of pixmap + reference sizes doesn't fit in CARD32. + +A value error is generated if invalid resource or client XID is given +in the request. + +5.2 Requests in version 1.2 + +┌─── + XResQueryClientIds + num_specs: CARD32 + client_specs: LISTofCLIENTIDSPEC + ▶ + num_ids: CARD32 + client_ids: LISTofCLIENTIDVALUE + + Errors: Value +└─── + +XResQueryClientIds can be used to identify a given set of clients with +some identification method. The request sends a list of specifiers +that select clients and identification methods to server. The server +then tries to identify the chosen clients using the identification +methods specified for each client. The server returns IDs for those +clients that were successfully identified. It's not an error condition +if some identification method couldn't be applied to a client. If the +server is unable to identify some clients, they simply aren't included +in the returned list. + +The request supports wildcards in the client specifications so that in +the most general case all IDs of all clients can be queried with a +single CLIENTIDSPEC. + +The CLIENTIDSPEC of request and CLIENTIDSPEC of CLIENTIDVALUE in reply +usually match each other. For example, if a request selected a client +by a resource ID owned by the client, then the client is identified by +the same resource ID in the reply. This has been done so that it would +be easy to identify an owner of some resource. + +However, the CLIENTIDSPEC of returned CLIENTIDVALUE never contains any +wildcards. If the request used a wildcard to specify all clients in a +single CLIENTIDSPEC, then the reply has expanded the wildcard and +returns separate CLIENTIDVALUE records for each client. In this case +wildcarded clients are identified by resource_base of CLIENTXIDRANGE. + +The LocalClientPid type of IDs are included in the reply list only if +the client executing the request asked for it and was also a local +client itself. It doesn't make sense for remote clients to ask PIDs of +local clients. + +num_specs + Number of client ID specifications. +client_specs + A list specifying identification methods for clients. Supports + multiple identification methods and clients in a single + specification. See CLIENTIDSPEC for details. +num_ids + Number of IDs that were successfully determined. Can be different + from num_specs or even zero if the server didn't support any + identification methods for the given clients. +client_ids + A list specifying ID information for successfully identified + clients. If wildcards were used in a single CLIENTIDSPEC of + client_specs, then multiple CLIENTIDVALUE records may be returned + for that CLIENTIDSPEC. See CLIENTIDVALUE for details. + +A Value error is returned if the request specifies an invalid client +XID or invalid identification method type. + +┌─── + XResQueryResourceBytes + client: CLIENTXID or None + num_specs: CARD32 + resource_specs: LISTofRESOURCEIDSPEC + ▶ + num_sizes: CARD32 + sizes: LISTofRESOURCESIZEVALUE + + Errors: Atom, Value +└─── + +XResQueryResourceBytes can be used to ask the sizes of resources from +X server. The request sends a list of specifiers that selects +resources for size calculation. The server tries to calculate the +sizes of chosen resources and returns an estimate for a resource only +if the size could be determined. It's not an error condition if a size +couldn't be calculated. In that case the resources simply aren't +included in the returned list. + +The request supports wildcards so that in the most general case sizes +of all resources of all clients can be queried with a single +RESOURCEIDSPEC. However, the reply has all wildcards expanded and +reports a size of a single resource in each RESOURCESIZEVALUE. + +client + An ID of a client can be given to limit the query to resources of + that client. Just like in CLIENTIDSPEC, any resource ID can be + given to identify a client and None can be used if the query + shouldn't be limited to a specific client. Note that in some cases + this field is redundant because resource_specs already fully + determines which resources are selected. If the client ID doesn't + match the owner of any resource in resource_specs, no sizes are + returned and no error is generated. +num_specs + Number of resource specifications. +resource_specs + A list of resource specifications. Each specification can either + uniquely identify a single resource or multiple resources if + wildcarding is used. See RESOURCEIDSPEC for details. +num_sizes + Number of resources whose size could be determined. Can be + different from num_specs or even zero if the server didn't support + size calculation for the given resources. +sizes + A list of resource sizes. Each resource size is linked to a unique + resource. Wildcards are never used in the returned size + records. For example, it's not possible to receive a single + RESOURCESIZEVALUE that would specify the size of all pixmaps if + the sizes of pixmap type resources were asked. Instead, a single + RESOURCESIZEVALUE would be returned for each pixmap in that case. + +An Atom error is returned if the request specifies an invalid resource +type. A Value error is returned if the request specifies an invalid +XID for a client or a resource. + + ❧❧❧❧❧❧❧❧❧❧❧ diff --git a/miniconda3/share/doc/xorgproto/xv-protocol-v2.txt b/miniconda3/share/doc/xorgproto/xv-protocol-v2.txt new file mode 100644 index 0000000000000000000000000000000000000000..d863185b7bfb746a2fccb1f1152dbc95169ccefb --- /dev/null +++ b/miniconda3/share/doc/xorgproto/xv-protocol-v2.txt @@ -0,0 +1,654 @@ + + + + + + + + + + X Video Extension + Protocol Description + + Version 2 + + 25-JUL-91 + + David Carver + + Digital Equipment Corporation + Workstation Engineering/Project Athena + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts, + and the Massachusetts Institute of Technology, Cambridge, Massachusetts. + + All Rights Reserved + + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, provided + that the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting + documentation, and that the names of Digital or MIT not be used in + advertising or publicity pertaining to distribution of the software + without specific, written prior permission. + + DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL + DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER + IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + Preface + ------- + + The following is an outline for an X video extension protocol. It + is preliminary and subject to change. My goal in writing this was + to fix some the shortcomings of existing overly simplistic + extensions while avoiding pitfalls in an overly complex extension. + + Your feedback is desired, and since the major design directions + have been stable for some time, feel free to hammer on the details + of the protocol. + + When you receive a revision of the document, refer to the changes + and issues sections to guide your review and analysis. + + + Acknowledgements + --------------- + + The following people have made major contributions to the design of + the Xv protocol: + + Branko Gerovac (DEC/Corporate Research) + Russ Sasnett (GTE/Project Athena) + Ralph Swick (DEC/Project Athena) + + Many ideas and approaches in Xv were the product of discussions + with several groups, including + + Project Athena's Visual Computing Group + The MIT X Consortium + The MIT Media Lab's Interactive Cinema Group + + + + Changes + ------- + + From version 1.3 to 2.0 + + -- Changed SetPortControl and GetPortControl to GetPortAttribute + and SetPortAttribute. + + -- Changed QueryBestSize + + -- Simplified SelectVideoNotify and SelectPortNotify requests. + + -- Changed the way SetPortControl and GetPortControl works. + + -- Added a QueryExtension request to return the version and + revision information of the extension. + + -- Changed the name of the QueryVideo request to QueryAdaptors; + Removed the list of encodings from QueryVideo and added a + QueryEncodings request. + + -- Added a PortNotify event that notifies interested clients that + a port control has been changed. + + -- Added SelectPortNotify request to select for PortNotify events. + + -- The XvInterruped reason has been replaced by two new reasons: + one for when video is preempted by another video request and + one for when video is terminated because of hard transmission + or reception errors. + + -- Changed the wording of the QueryBestSize request. Added issue + about whether or not returned sizes should maintain the + requested aspect ratio. + + + + Introduction + ------------ + + Video technology is moving very quickly. Standards for processing + high resolution video are currently a hot topic of discussion + internationally, and it will soon be possible to process video + entirely within the digital domain. The Xv extension, however, + does not attempt to address issues of digital video. Its purpose + is to provide a mechanism for support of current and near term + interactive video technology. + + It is somewhat ironic that Xv contains nothing particularly + innovative. It takes a minimalistic approach, and without a doubt + it could have been defined years ago, and with several revisions. + So, the life expectancy of Xv is not long. Nevertheless, it may + undergo further revision and experimentation that will help our + progress towards digital video systems. + + One premise of the Xv extension is that the X server is not alone. + A separate video server is often used to manage other aspects of + video processing, though the partition between what the X server + does and what a video server does is a matter of great debate. + + + Model + ----- + + This extension models video monitor capabilities in the X Window + System. Some advanced monitors support the simultaneous display + of multiple video signals (into separate windows), and that is + represented here through the ability to display video from + multiple video input adaptors into X drawables. + + Some monitors support multiple video encodings (mostly for + internationalization purposes) either through switches or + automatic detection, thus each video adaptor specifies the set of + encodings it supports. + + The requests to display video from an adaptor into a drawable are + modeled after the core PutImage request, though extended to + support scaling and source clipping. + + Video output is also supported and is symmetric with the video + input function, though fewer GC components are used. + + + Mechanism + --------- + + The Xv extension does the following: + + -- lists available video adaptors + -- identifies the number of ports each adaptor supports + -- describes what drawable formats each adaptor supports + -- describes what video encodings each adaptor supports + -- displays video from a port to a drawable + -- captures video from a drawable to a port + -- grabs and ungrabs ports + -- sets and gets port attributes + -- delivers event notification + + + + Adaptors + -------- + + A display may have multiple video input and output adaptors. An + adaptor may support multiple simultaneously active ports, and in + some cases the number of ports has no fixed limit. + + An input port receives encoded video data and converts it to a + stream of data used to update a drawable. An output port samples + data from a drawable and produces a stream of encoded video data. + + The ADAPTORINFO structure is used to describe a video adaptor. + + ADAPTORINFO: + [base-id: PORT + num-ports: CARD16 + type: SETofADAPTORTYPE + formats: LISTofFORMAT + name: STRING] + + ADAPTORTYPE: {Input, Output} + + FORMAT: + [depth: CARD8 + visual: VISUALID] + + The base-id field specifies the XID of the first port of the + adaptor. The `num-ports' field specifies how many ports the + adaptor supports. The ports of the adaptor have XIDs in the range + [base-id..base-id + num-ports - 1] + + The type attribute determines if the adaptor can process video + input, output, or input and output. The if the adaptor can + process input then Input is asserted, if the adaptor can process + output then Output is asserted. + + The drawable depths and visual types supported by the adaptor are + listed in `formats'. Note: that when video is being processed for + pixmaps the visual format is taken to be the visual of the first + pair that matches the depth of the pixmap. + + The name field contains an a vendor specific string that + identifies the adaptor. + + It should be noted that the existence of separate adaptors doesn't + necessarily imply that simultaneous operation is supported. + + + + Errors + ------ + + Port + + A Port error is returned if any request names a PORT that does not + exist. + + + Encoding + + An Encoding error is returned if any request names an ENCODINGID + that does not exist. + + + + + Query Requests + ------------------- + + QueryExtension + ==> + version: CARD16 + revision: CARD16 + + The QueryExtension request returns the extension version and + revision numbers. + + + QueryAdaptors + win: WINDOW + ==> + adaptors: LISTofADAPTORINFO + + The QueryAdaptors request returns the video adaptor information for + the screen of the specified window. + + Errors: {Window} + + + QueryEncodings + port: PORT + ==> + encodings: LISTofENCODINGINFO + + The QueryEncodings request returns the list of encodings supported + by the port adaptor. Use the SetPortAttribute request to set + which encoding a port is to process. The ENCODINGINFO record + describes an encoding: + + ENCODINGINFO: + [encoding: ENCODINGID + name: STRING + width, height: CARD16 + rate: FRACTION] + + The `encoding' field identifies an encoding supported by a port. + Its value is unique for a screen. Width and height specify the + size of the video image and rate specifies the rate at which + fields of image information are encoded. + + An encoding is identified by a string that names the encoding. + Encoding naming conventions need to be established (i.e., + something along the lines of font naming, but simpler) + + FRACTION + [numerator, denominator: INT32] + + The FRACTION structure is used to specify a fractional number. + + Errors: {Port} + + + + Put Video Requests + ------------------ + + PutVideo + port: PORT + drawable: DRAWABLE + gc: GCONTEXT + vid-x, vid-y: INT16 + vid-w, vid-h: CARD16 + drw-x, drw-y: INT16 + drw-w, drw-h: CARD16 + + The PutVideo request writes video into a drawable. The position + and size of the source rectangle is specified by vid-x, vid-y, + vid-w, and vid-h. The position and size of the destination + rectangle is specified by drw-x, drw-y, drw-w, drw-h. + + Video data is clipped to the bounds of the video encoding, scaled + to the requested drawable region size (or the closest size + supported), and clipped to the bounds of the drawable. + + If video is successfully initiated, a VideoNotify event with + detail Started is generated for the drawable. If the port is + already in use, its video is preempted, and if the new drawable is + different than the old, a VideoNotify event with detail Preempted + is generated for the old drawable. If the port is grabbed by + another client, this request is ignored, and a VideoNotify event + with detail Busy is generated for the drawable. If the port is + not receiving a valid video signal or if the video signal is + interrupted while video is active a VideoNotify event with detail + HardError is generated for the drawable. + + GC components: subwindow-mode, clip-x-origin, clip-y-origin, clip-mask. + + Errors: {Match, Value, GContext, Port, Alloc} + + + PutStill + port: PORT + drawable: DRAWABLE + gc: GCONTEXT + vid-x, vid-y: INT16 + vid-w, vid-h: CARD16 + drw-x, drw-y: INT16 + drw-w, drw-h: CARD16 + + The PutStill request writes a single frame of video into a + drawable. The position and size of the source rectangle is + specified by vid-x, vid-y, vid-w, and vid-h. The position and + size of the destination rectangle is specified by drw-x, drw-y, + drw-w, drw-h. + + Video data is clipped to the bounds of the video encoding, scaled + to the requested drawable region size (or the closest size + supported) and clipped to the bounds of the drawable. + + If the port is grabbed by another client, this request is ignored, + and a VideoNotify event with detail Busy is generated for the + drawable. If the port is not receiving a valid video signal a + VideoNotify event with detail HardError is generated for the + drawable. + + GC components: subwindow-mode, clip-x-origin, clip-y-origin, clip-mask. + + Errors: {Match, Value, GContext, Port, Alloc} + + + + Get Video Requests + ------------------ + + GetVideo + port: PORT + drawable: DRAWABLE + gc: GCONTEXT + vid-x, vid-y: INT16 + vid-w, vid-h: CARD16 + drw-x, drw-y: INT16 + drw-w, drw-h: CARD16 + + The GetVideo request outputs video from a drawable. The position + and size of the destination rectangle is specified by vid-x, + vid-y, vid-w, and vid-h. The position and size of the source + rectangle is specified by drw-x, drw-y, drw-w, and drw-h. + + Drawable data is clipped to the bounds of the drawable, scaled to + the requested video region size (or the closest size supported) + and clipped to the bounds of the video encoding. The contents of + any region not updated with drawable data is undefined. + + If video is successfully initiated, a VideoNotify event with + detail Started is generated for the drawable. If the port is + already in use, its video is preempted, and if the new drawable is + different than the old, a VideoNotify event with detail Preempted + is generated for the old drawable. If the port is grabbed by + another client, this request is ignored, and a VideoNotify event + with detail Busy is generated for the drawable. + + GC components: subwindow-mode, clip-x-origin, clip-y-origin, + clip-mask. + + Errors: {Match, Value, GContext, Port, Alloc} + + + GetStill + port: PORT + drawable: DRAWABLE + gc: GCONTEXT + vid-x, vid-y: INT16 + vid-w, vid-h: CARD16 + drw-x, drw-y: INT16 + drw-w, drw-h: CARD16 + + The GetStill request outputs video from a drawable. The position + and size of the destination rectangle is specified by vid-x, + vid-y, vid-w, and vid-h. The position and size of the source + rectangle is specified by drw-x, drw-y, drw-w, and drw-h. + + Drawable data is clipped to the bounds of the drawable, scaled to + the requested video region size (or the closest size supported) + and clipped to the bounds of the video encoding. The contents of + any region not updated with drawable data is undefined. + + If the still is successfully captured a VideoNotify event with + detail Still is generated for the drawable. If the port is + grabbed by another client, this request is ignored, and a + VideoNotify event with detail Busy is generated for the drawable. + + GC components: subwindow-mode, clip-x-origin, clip-y-origin, + clip-mask. + + Errors: {Match, Value, GContext, Port, Alloc} + + + + + Grab Requests + ------------- + + GrabPort + port: PORT + timestamp: {TIMESTAMP, CurrentTime} + ==> + status: {Success, AlreadyGrabbed, InvalidTime} + + The GrabPort request grabs a port. While a port is grabbed, only + video requests from the grabbing client are permitted. + + If timestamp specifies a time older than the current port time, a + status of InvalidTime is returned. If the port is already grabbed + by another client, a status of AlreadyGrabbed is returned. + Otherwise a status of Success is returned. The port time is + updated when the following requests are processed: GrabPort, + UngrabPort, PutVideo, PutStill, GetVideo, GetStill + + If the port is actively processing video for another client, the + video is preempted, and an VideoNotify event with detail Preempted + is generated for its drawable. + + Errors: {Port} + + + UngrabPort + port: PORT + timestamp: {TIMESTAMP, CurrentTime} + + The UngrabPort request ungrabs a port. If timestamp specifies a + time before the last connection request time of this port, the + request is ignored. + + Errors: {Port} + + + + Other Requests + -------------- + + StopVideo + port: PORT + drawable: DRAWABLE + + The StopVideo request stops active video for the specified port + and drawable. If the port isn't processing video, or if it is + processing video in a different drawable, the request is ignored. + When video is stopped a VideoNotify event with detail Stopped is + generated for the associated drawable. + + Errors: {Drawable, Port} + + + SelectVideoNotify + drawable: DRAWABLE + onoff: BOOL + + The SelectVideoNotify request enables or disables VideoNotify + event delivery to the requesting client. VideoNotify events are + generated when video starts and stops. + + Errors: {Drawable} + + + SelectPortNotify + port: PORT + onoff: BOOL + + The SelectPortNotify request enables or disables PortNotify event + delivery to the requesting client. PortNotify events are + generated when port attributes are changed using SetPortAttribute. + + Errors: {Port} + + + QueryBestSize + port: PORT + motion: BOOL + vid-w, vid-h: CARD16 + drw-w, drw-h: CARD16 + ==> + actual-width, actual-height: CARD16 + + The QueryBestSize request returns, for the given source size and + desired destination size, the closest destination size that the + port adaptor supports. The returned size will be equal + or smaller than the requested size if one is supported. If motion + is True then the requested size is intended for use with full + motion video. If motion is False, the requested size is intended + for use with stills only. + + The returned size is also chosen to maintain the requested aspect ratio + if possible. + + Errors: {Port} + + + + SetPortAttribute + port: PORT + attribute: ATOM + value: INT32 + + The SetPortAttribute request sets the value of a port attribute. + The port attribute is identified by the attribute atom. The + following strings are guaranteed to generate valid atoms using the + InternAtom request. + + String Type + ----------------------------------------------------------------- + + "XV_ENCODING" ENCODINGID + "XV_HUE" [-1000..1000] + "XV_SATURATION" [-1000..1000] + "XV_BRIGHTNESS" [-1000..1000] + "XV_CONTRAST" [-1000..1000] + + + If the given attribute doesn't match an attribute supported by the + port adaptor a Match error is generated. The supplied encoding + must be one of the encodings listed for the adaptor, otherwise an + Encoding error is generated. + + If the adaptor doesn't support the exact hue, saturation, + brightness, and contrast levels supplied, the closest levels + supported are assumed. The GetPortAttribute request can be used + to query the resulting levels. + + When a SetPortAttribute request is processed a PortNotify event is + generated for all clients that have requested port change + notification using SelectPortNotify. + + Errors: {Port, Match, Value} + + + GetPortAttribute + port: PORT + attribute: ATOM + ==> + value: INT32 + + + The GetPortAttribute request returns the current value of the + attribute identified by the given atom. If the given atom + doesn't match an attribute supported by the adaptor a Match + error is generated. + + Errors: {Port, Match} + + + + Events + ------ + + VideoNotify + drawable: DRAWABLE + port: PORT + reason: REASON + time: TIMESTAMP + + REASON: {Started, Still, Stopped, Busy, Preempted, HardError} + + A VideoNotify event is generated when video activity is started, + stopped, or unable to proceed in a drawable. + + A Started reason is generated when video starts in a drawable. + + A Stopped reason is generated when video is stopped in a + drawable upon request. + + A Busy reason is generated when a put or get request cannot + proceed because the port is grabbed by another client. + + A Preempted reason is generated when video is stopped by a + conflicting request. + + A HardError reason is generated when the video port cannot + initiate or continue processing a video request because of an + underlying transmission or reception error. + + + PortNotify + port: PORT + attribute: ATOM + value: INT32 + time: TIMESTAMP + + The PortNotify event is generated when a SetPortAttribute request + is processed. The event is delivered to all clients that have + performed a SelectPortNotify request for the port. The event + contains the atom identifying the attribute that changed, and the + new value of that attribute. diff --git a/miniconda3/share/doc/xorgproto/xwaylandproto.txt b/miniconda3/share/doc/xorgproto/xwaylandproto.txt new file mode 100644 index 0000000000000000000000000000000000000000..25fdf87437191dc3df33b4e121ee3355e86afbed --- /dev/null +++ b/miniconda3/share/doc/xorgproto/xwaylandproto.txt @@ -0,0 +1,96 @@ + The XWAYLAND Extension + Version 1.0 + 2022-07-29 + +1. Introduction + +The XWAYLAND extension allows clients to reliably identify whether an X server +is Xwayland. It does not provide any functionality beyond the absolute minimum +to identify as extension. + +Only Xwayland initializes this extension. Thus, if the extension is present, +the X server is Xwayland. Clients should not need the protocol detailed in this +document, a QueryExtension or ListExtensions request is sufficient to check +whether the extension is present. + +The protocol detailed in this document is merely to future-proof this extension +in case actual functionality is added in the future. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ +2. Version History + +- 1.0, July 2022: QueryVersion request only + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +3. Events and Errors + +XWAYLAND defines no events or errrors + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +4. Extension initialization + +The name of this extension is "XWAYLAND" + +┌─── + XwlQueryVersion + client-major-version: CARD16 + client-minor-version: CARD16 + ▶ + major-version: CARD16 + minor-version: CARD16 +└─── + + The client sends the highest supported version to the server + and the server replies with the highest version it supports, + but no higher than the requested version. Major versions changes + can introduce incompatibilities in existing functionality, minor + version changes introduce only backward compatible changes. + It is the clients responsibility to ensure that the server + supports a version which is compatible with its expectations. + + Backwards compatible changes include addition of new + requests. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ + +Appendix A. Protocol Encoding + +Syntactic Conventions + +This document uses the same syntactic conventions as the core X +protocol encoding document. + +A.1 Common Types + +None. + +A.2 Protocol Requests + +┌─── + XwlQueryVersion + 1 CARD8 major opcode + 1 0 XWAYLAND opcode + 2 2 length + 2 CARD16 major version + 2 CARD16 minor version + ▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 2 CARD16 major version + 2 CARD16 minor version + 20 unused +└─── + +A.3 Protocol Events + +The XWAYLAND extension defines no events. + +A.4 Protocol Errors + +The XWAYLAND extension defines no errors. + + ❄ ❄ ❄ ❄ ❄ ❄ ❄ diff --git a/miniconda3/share/doc/xproto/encoding.xml b/miniconda3/share/doc/xproto/encoding.xml new file mode 100644 index 0000000000000000000000000000000000000000..0c6ef028ec8ce36e2025e5890882af4cac0596bb --- /dev/null +++ b/miniconda3/share/doc/xproto/encoding.xml @@ -0,0 +1,3268 @@ + +Protocol Encoding + + +Syntactic Conventions + + +All numbers are in decimal, +unless prefixed with #x, in which case they are in hexadecimal (base 16). + + + +The general syntax used to describe requests, replies, errors, events, and +compound types is: + + + + NameofThing + encode-form + ... + encode-form + + + +Each encode-form describes a single component. + + +For components described in the protocol as: + + + name: TYPE + + + +the encode-form is: + + + + N TYPE name + + + +N is the number of bytes occupied in the data stream, +and TYPE is the interpretation of those bytes. +For example, + + + + depth: CARD8 + + + +becomes: + + + + 1 CARD8 depth + + + +For components with a static numeric value the encode-form is: + + + + N value name + + + +The value is always interpreted as an N-byte unsigned integer. +For example, +the first two bytes of a +Window +error are always zero (indicating an +error in general) and three (indicating the +Window +error in particular): + + + + 1 0 Error + 1 3 code + + + +For components described in the protocol as: + + + +name: +{ Name1,..., +NameI} + + + +the encode-form is: + + + + N name + value1 Name1 + ... + valueI NameI + + + +The value is always interpreted as an N-byte unsigned integer. +Note that the size of N is sometimes larger than that strictly required +to encode the values. +For example: + + + +class: +{ InputOutput, +InputOnly, +CopyFromParent } + + + +becomes: + + + +2 class + 0 CopyFromParent + 1 InputOutput + 2 InputOnly + + + +For components described in the protocol as: + + + +NAME: TYPE or +Alternative1 ...or +AlternativeI + + + +the encode-form is: + + + +N TYPE NAME + value1 Alternative1 + ... + valueI AlternativeI + + + +The alternative values are guaranteed not to conflict with the encoding +of TYPE. +For example: + + + +destination: WINDOW or +PointerWindow +or +InputFocus + + + +becomes: + + + +4 WINDOW destination + 0 PointerWindow + 1 InputFocus + + + +For components described in the protocol as: + + + + value-mask: BITMASK + + + +the encode-form is: + + + +N BITMASK value-mask + mask1 mask-name1 + ... + maskI mask-nameI + + + +The individual bits in the mask are specified and named, +and N is 2 or 4. +The most-significant bit in a BITMASK is reserved for use in defining +chained (multiword) bitmasks, as extensions augment existing core requests. +The precise interpretation of this bit is not yet defined here, +although a probable mechanism is that a 1-bit indicates that another N bytes +of bitmask follows, with bits within the overall mask still interpreted +from least-significant to most-significant with an N-byte unit, +with N-byte units +interpreted in stream order, and with the overall mask being byte-swapped +in individual N-byte units. + + + +For LISTofVALUE encodings, the request is followed by a section of the form: + + + + VALUEs + encode-form + ... + encode-form + + + +listing an encode-form for each VALUE. +The NAME in each encode-form keys to the corresponding BITMASK bit. +The encoding of a VALUE always occupies four bytes, +but the number of bytes specified in the encoding-form indicates how +many of the least-significant bytes are actually used; +the remaining bytes are unused and their values do not matter. + + + +In various cases, the number of bytes occupied by a component will be +specified +by a lowercase single-letter variable name instead of a specific numeric +value, and often some other component will have its value specified as a +simple numeric expression involving these variables. +Components specified with such expressions are always interpreted +as unsigned integers. +The scope of such variables is always just the enclosing request, reply, +error, event, or compound type structure. +For example: + + + +2 3+n request length +4n LISTofPOINT points + + + +For unused bytes (the values of the bytes are undefined and do no matter), +the encode-form is: + + + + N unused + + + + +If the number of unused bytes is variable, the encode-form typically is: + + + + p unused, p=pad(E) + + + +where E is some expression, + +Padding +and pad(E) is the number of bytes needed to round E up to a multiple of four. + + + + + pad(E) = (4 - (E mod 4)) mod 4 + + + + +Common Types +Typesencoding + + + + LISTofFOO + + +In this document the LISTof notation strictly means some number of repetitions +of the FOO encoding; +the actual length of the list is encoded elsewhere. + + + + + SETofFOO + + +A set is always represented by a bitmask, with a 1-bit indicating presence in +the set. + + + + + + + + + + + +BITMASK: CARD32 + + + + +WINDOW: CARD32 + + + + +PIXMAP: CARD32 + + + + +CURSOR: CARD32 + + + + +FONT: CARD32 + + + + +GCONTEXT: CARD32 + + + + +COLORMAP: CARD32 + + + + +DRAWABLE: CARD32 + + + + +FONTABLE: CARD32 + + + + +ATOM: CARD32 + + + + +VISUALID: CARD32 + + + + +BYTE: 8-bit value + + + + +INT8: 8-bit signed integer + + + + +INT16: 16-bit signed integer + + + + +INT32: 32-bit signed integer + + + + +CARD8: 8-bit unsigned integer + + + + +CARD16: 16-bit unsigned integer + + + + +CARD32: 32-bit unsigned integer + + + + +TIMESTAMP: CARD32 + + + + + + + + +BITGRAVITY + 0 Forget + 1 NorthWest + 2 North + 3 NorthEast + 4 West + 5 Center + 6 East + 7 SouthWest + 8 South + 9 SouthEast + 10 Static + +WINGRAVITY + 0 Unmap + 1 NorthWest + 2 North + 3 NorthEast + 4 West + 5 Center + 6 East + 7 SouthWest + 8 South + 9 SouthEast + 10 Static + +BOOL + 0 False + 1 True + +SETofEVENT + #x00000001 KeyPress + #x00000002 KeyRelease + #x00000004 ButtonPress + #x00000008 ButtonRelease + #x00000010 EnterWindow + #x00000020 LeaveWindow + #x00000040 PointerMotion + #x00000080 PointerMotionHint + #x00000100 Button1Motion + #x00000200 Button2Motion + #x00000400 Button3Motion + #x00000800 Button4Motion + #x00001000 Button5Motion + #x00002000 ButtonMotion + #x00004000 KeymapState + #x00008000 Exposure + #x00010000 VisibilityChange + #x00020000 StructureNotify + #x00040000 ResizeRedirect + #x00080000 SubstructureNotify + #x00100000 SubstructureRedirect + #x00200000 FocusChange + #x00400000 PropertyChange + #x00800000 ColormapChange + #x01000000 OwnerGrabButton + #xFE000000 unused but must be zero + +SETofPOINTEREVENT + encodings are the same as for SETofEVENT, except with + #xFFFF8003 unused but must be zero + +SETofDEVICEEVENT + encodings are the same as for SETofEVENT, except with + #xFFFFC0B0 unused but must be zero + +KEYSYM: CARD32 +KEYCODE: CARD8 +BUTTON: CARD8 + +SETofKEYBUTMASK + #x0001 Shift + #x0002 Lock + #x0004 Control + #x0008 Mod1 + #x0010 Mod2 + #x0020 Mod3 + #x0040 Mod4 + #x0080 Mod5 + #x0100 Button1 + #x0200 Button2 + #x0400 Button3 + #x0800 Button4 + #x1000 Button5 + #xE000 unused but must be zero + +SETofKEYMASK + encodings are the same as for SETofKEYBUTMASK, except with + #xFF00 unused but must be zero +STRING8: LISTofCARD8 +STRING16: LISTofCHAR2B + +CHAR2B + 1 CARD8 byte1 + 1 CARD8 byte2 + +POINT + 2 INT16 x + 2 INT16 y + +RECTANGLE + 2 INT16 x + 2 INT16 y + 2 CARD16 width + 2 CARD16 height + +ARC + 2 INT16 x + 2 INT16 y + 2 CARD16 width + 2 CARD16 height + 2 INT16 angle1 + 2 INT16 angle2 + +HOST + 1 family + 0 Internet + 1 DECnet + 2 Chaos + 5 ServerInterpreted + 6 InternetV6 + 1 unused + 2 n length of address + n LISTofBYTE address + p unused, p=pad(n) + +STR + 1 n length of name in bytes + n STRING8 name + + + + + +Errors +Error reportencoding + + +Request + 1 0 Error + 1 1 code + 2 CARD16 sequence number + 4 unused + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + +Value + 1 0 Error + 1 2 code + 2 CARD16 sequence number + 4 <32-bits> bad value + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + +Window + 1 0 Error + 1 3 code + 2 CARD16 sequence number + 4 CARD32 bad resource id + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + +Pixmap + 1 0 Error + 1 4 code + 2 CARD16 sequence number + 4 CARD32 bad resource id + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + +Atom + 1 0 Error + 1 5 code + 2 CARD16 sequence number + 4 CARD32 bad atom id + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + +Cursor + 1 0 Error + 1 6 code + 2 CARD16 sequence number + 4 CARD32 bad resource id + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + +Font + 1 0 Error + 1 7 code + 2 CARD16 sequence number + 4 CARD32 bad resource id + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + +Match + 1 0 Error + 1 8 code + 2 CARD16 sequence number + 4 unused + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + +Drawable + 1 0 Error + 1 9 code + 2 CARD16 sequence number + 4 CARD32 bad resource id + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + +Access + 1 0 Error + 1 10 code + 2 CARD16 sequence number + 4 unused + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + +Alloc + 1 0 Error + 1 11 code + 2 CARD16 sequence number + 4 unused + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + +Colormap + 1 0 Error + 1 12 code + 2 CARD16 sequence number + 4 CARD32 bad resource id + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + +GContext + 1 0 Error + 1 13 code + 2 CARD16 sequence number + 4 CARD32 bad resource id + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + +IDChoice + 1 0 Error + 1 14 code + 2 CARD16 sequence number + 4 CARD32 bad resource id + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + +Name + 1 0 Error + 1 15 code + 2 CARD16 sequence number + 4 unused + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + +Length + 1 0 Error + 1 16 code + 2 CARD16 sequence number + 4 unused + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + +Implementation + 1 0 Error + 1 17 code + 2 CARD16 sequence number + 4 unused + 2 CARD16 minor opcode + 1 CARD8 major opcode + 21 unused + + + + +Keyboards + + +KEYCODE values are always greater than 7 (and less than 256). + + + +KEYSYM values with the bit #x10000000 set are reserved as vendor-specific. + + + +The names and encodings of the standard KEYSYM values are contained in +Appendix A, Keysym Encoding. + + + + +Pointers + + +BUTTON values are numbered starting with one. + + + + +Predefined Atoms +Atompredefined + + +PRIMARY 1 WM_NORMAL_HINTS 40 +SECONDARY 2 WM_SIZE_HINTS 41 +ARC 3 WM_ZOOM_HINTS 42 +ATOM 4 MIN_SPACE 43 +BITMAP 5 NORM_SPACE 44 +CARDINAL 6 MAX_SPACE 45 +COLORMAP 7 END_SPACE 46 +CURSOR 8 SUPERSCRIPT_X 47 +CUT_BUFFER0 9 SUPERSCRIPT_Y 48 +CUT_BUFFER1 10 SUBSCRIPT_X 49 +CUT_BUFFER2 11 SUBSCRIPT_Y 50 +CUT_BUFFER3 12 UNDERLINE_POSITION 51 +CUT_BUFFER4 13 UNDERLINE_THICKNESS 52 +CUT_BUFFER5 14 STRIKEOUT_ASCENT 53 +CUT_BUFFER6 15 STRIKEOUT_DESCENT 54 +CUT_BUFFER7 16 ITALIC_ANGLE 55 +DRAWABLE 17 X_HEIGHT 56 +FONT 18 QUAD_WIDTH 57 +INTEGER 19 WEIGHT 58 +PIXMAP 20 POINT_SIZE 59 +POINT 21 RESOLUTION 60 +RECTANGLE 22 COPYRIGHT 61 +RESOURCE_MANAGER 23 NOTICE 62 +RGB_COLOR_MAP 24 FONT_NAME 63 +RGB_BEST_MAP 25 FAMILY_NAME 64 +RGB_BLUE_MAP 26 FULL_NAME 65 +RGB_DEFAULT_MAP 27 CAP_HEIGHT 66 +RGB_GRAY_MAP 28 WM_CLASS 67 +RGB_GREEN_MAP 29 WM_TRANSIENT_FOR 68 +RGB_RED_MAP 30 +STRING 31 +VISUALID 32 +WINDOW 33 +WM_COMMAND 34 +WM_HINTS 35 +WM_CLIENT_MACHINE 36 +WM_ICON_NAME 37 +WM_ICON_SIZE 38 +WM_NAME 39 + + + + +Connection Setup + + +For TCP connections, +displays on a given host are numbered starting from 0, +and the server for display N listens and accepts connections on port 6000 + N. +For DECnet connections, +displays on a given host are numbered starting from 0, +and the server for display N listens and accepts connections on the object +name obtained by concatenating "X$X" with the decimal representation of N, +for example, X$X0 and X$X1. + + + +Information sent by the client at connection setup: + + + + 1 byte-order + #x42 MSB first + #x6C LSB first + 1 unused + 2 CARD16 protocol-major-version + 2 CARD16 protocol-minor-version + 2 n length of authorization-protocol-name + 2 d length of authorization-protocol-data + 2 unused + n STRING8 authorization-protocol-name + p unused, p=pad(n) + d STRING8 authorization-protocol-data + q unused, q=pad(d) + + + +Except where explicitly noted in the protocol, +all 16-bit and 32-bit quantities sent by the client must be transmitted +with the specified byte order, +and all 16-bit and 32-bit quantities returned by the server will be transmitted +with this byte order. + + + +Information received by the client if the connection is refused: + + + + 1 0 Failed + 1 n length of reason in bytes + 2 CARD16 protocol-major-version + 2 CARD16 protocol-minor-version + 2 (n+p)/4 length in 4-byte units of "additional data" + n STRING8 reason + p unused, p=pad(n) + + + +Information received by the client if further authentication is required: + + + + 1 2 Authenticate + 5 unused + 2 (n+p)/4 length in 4-byte units of "additional data" + n STRING8 reason + p unused, p=pad(n) + + + +Information received by the client if the connection is accepted: + + + + 1 1 Success + 1 unused + 2 CARD16 protocol-major-version + 2 CARD16 protocol-minor-version + 2 8+2n+(v+p+m)/4 length in 4-byte units of + "additional data" + 4 CARD32 release-number + 4 CARD32 resource-id-base + 4 CARD32 resource-id-mask + 4 CARD32 motion-buffer-size + 2 v length of vendor + 2 CARD16 maximum-request-length + 1 CARD8 number of SCREENs in roots + 1 n number for FORMATs in + pixmap-formats + 1 image-byte-order + 0 LSBFirst + 1 MSBFirst + 1 bitmap-format-bit-order + 0 LeastSignificant + 1 MostSignificant + 1 CARD8 bitmap-format-scanline-unit + 1 CARD8 bitmap-format-scanline-pad + 1 KEYCODE min-keycode + 1 KEYCODE max-keycode + 4 unused + v STRING8 vendor + p unused, p=pad(v) + 8n LISTofFORMAT pixmap-formats + m LISTofSCREEN roots (m is always a multiple of 4) + + + +FORMAT + 1 CARD8 depth + 1 CARD8 bits-per-pixel + 1 CARD8 scanline-pad + 5 unused + + + +SCREEN + 4 WINDOW root + 4 COLORMAP default-colormap + 4 CARD32 white-pixel + 4 CARD32 black-pixel + 4 SETofEVENT current-input-masks + 2 CARD16 width-in-pixels + 2 CARD16 height-in-pixels + 2 CARD16 width-in-millimeters + 2 CARD16 height-in-millimeters + 2 CARD16 min-installed-maps + 2 CARD16 max-installed-maps + 4 VISUALID root-visual + 1 backing-stores + 0 Never + 1 WhenMapped + 2 Always + 1 BOOL save-unders + 1 CARD8 root-depth + 1 CARD8 number of DEPTHs in allowed-depths + n LISTofDEPTH allowed-depths (n is always a + multiple of 4) + + + +DEPTH + 1 CARD8 depth + 1 unused + 2 n number of VISUALTYPES in visuals + 4 unused + 24n LISTofVISUALTYPE visuals + + + +VISUALTYPE + 4 VISUALID visual-id + 1 class + 0 StaticGray + 1 GrayScale + 2 StaticColor + 3 PseudoColor + 4 TrueColor + 5 DirectColor + 1 CARD8 bits-per-rgb-value + 2 CARD16 colormap-entries + 4 CARD32 red-mask + 4 CARD32 green-mask + 4 CARD32 blue-mask + 4 unused + + + + +Requests +Requestencoding + + +CreateWindow + 1 1 opcode + 1 CARD8 depth + 2 8+n request length + 4 WINDOW wid + 4 WINDOW parent + 2 INT16 x + 2 INT16 y + 2 CARD16 width + 2 CARD16 height + 2 CARD16 border-width + 2 class + 0 CopyFromParent + 1 InputOutput + 2 InputOnly + 4 VISUALID visual + 0 CopyFromParent + 4 BITMASK value-mask (has n bits set to 1) + #x00000001 background-pixmap + #x00000002 background-pixel + #x00000004 border-pixmap + #x00000008 border-pixel + #x00000010 bit-gravity + #x00000020 win-gravity + #x00000040 backing-store + #x00000080 backing-planes + #x00000100 backing-pixel + #x00000200 override-redirect + #x00000400 save-under + #x00000800 event-mask + #x00001000 do-not-propagate-mask + #x00002000 colormap + #x00004000 cursor + 4n LISTofVALUE value-list + + VALUEs + 4 PIXMAP background-pixmap + 0 None + 1 ParentRelative + 4 CARD32 background-pixel + 4 PIXMAP border-pixmap + 0 CopyFromParent + 4 CARD32 border-pixel + 1 BITGRAVITY bit-gravity + 1 WINGRAVITY win-gravity + 1 backing-store + 0 NotUseful + 1 WhenMapped + 2 Always + 4 CARD32 backing-planes + 4 CARD32 backing-pixel + 1 BOOL override-redirect + 1 BOOL save-under + 4 SETofEVENT event-mask + 4 SETofDEVICEEVENT do-not-propagate-mask + 4 COLORMAP colormap + 0 CopyFromParent + 4 CURSOR cursor + 0 None + +ChangeWindowAttributes + 1 2 opcode + 1 unused + 2 3+n request length + 4 WINDOW window + 4 BITMASK value-mask (has n bits set to 1) + encodings are the same as for CreateWindow + 4n LISTofVALUE value-list + encodings are the same as for CreateWindow + +GetWindowAttributes + 1 3 opcode + 1 unused + 2 2 request length + 4 WINDOW window + +▶ + 1 1 Reply + 1 backing-store + 0 NotUseful + 1 WhenMapped + 2 Always + 2 CARD16 sequence number + 4 3 reply length + 4 VISUALID visual + 2 class + 1 InputOutput + 2 InputOnly + 1 BITGRAVITY bit-gravity + 1 WINGRAVITY win-gravity + 4 CARD32 backing-planes + 4 CARD32 backing-pixel + 1 BOOL save-under + 1 BOOL map-is-installed + 1 map-state + 0 Unmapped + 1 Unviewable + 2 Viewable + 1 BOOL override-redirect + 4 COLORMAP colormap + 0 None + 4 SETofEVENT all-event-masks + 4 SETofEVENT your-event-mask + 2 SETofDEVICEEVENT do-not-propagate-mask + 2 unused + +DestroyWindow + 1 4 opcode + 1 unused + 2 2 request length + 4 WINDOW window + +DestroySubwindows + 1 5 opcode + 1 unused + 2 2 request length + 4 WINDOW window + +ChangeSaveSet + 1 6 opcode + 1 mode + 0 Insert + 1 Delete + 2 2 request length + 4 WINDOW window + +ReparentWindow + 1 7 opcode + 1 unused + 2 4 request length + 4 WINDOW window + 4 WINDOW parent + 2 INT16 x + 2 INT16 y + +MapWindow + 1 8 opcode + 1 unused + 2 2 request length + 4 WINDOW window + +MapSubwindows + 1 9 opcode + 1 unused + 2 2 request length + 4 WINDOW window + +UnmapWindow + 1 10 opcode + 1 unused + 2 2 request length + 4 WINDOW window + +UnmapSubwindows + 1 11 opcode + 1 unused + 2 2 request length + 4 WINDOW window + +ConfigureWindow + 1 12 opcode + 1 unused + 2 3+n request length + 4 WINDOW window + 2 BITMASK value-mask (has n bits set to 1) + #x0001 x + #x0002 y + #x0004 width + #x0008 height + #x0010 border-width + #x0020 sibling + #x0040 stack-mode + 2 unused + 4n LISTofVALUE value-list + + VALUEs + 2 INT16 x + 2 INT16 y + 2 CARD16 width + 2 CARD16 height + 2 CARD16 border-width + 4 WINDOW sibling + 1 stack-mode + 0 Above + 1 Below + 2 TopIf + 3 BottomIf + 4 Opposite + +CirculateWindow + 1 13 opcode + 1 direction + 0 RaiseLowest + 1 LowerHighest + 2 2 request length + 4 WINDOW window + +GetGeometry + 1 14 opcode + 1 unused + 2 2 request length + 4 DRAWABLE drawable + +▶ + 1 1 Reply + 1 CARD8 depth + 2 CARD16 sequence number + 4 0 reply length + 4 WINDOW root + 2 INT16 x + 2 INT16 y + 2 CARD16 width + 2 CARD16 height + 2 CARD16 border-width + 10 unused + +QueryTree + 1 15 opcode + 1 unused + 2 2 request length + 4 WINDOW window + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 n reply length + 4 WINDOW root + 4 WINDOW parent + 0 None + 2 n number of WINDOWs in children + 14 unused + 4n LISTofWINDOW children + +InternAtom + 1 16 opcode + 1 BOOL only-if-exists + 2 2+(n+p)/4 request length + 2 n length of name + 2 unused + n STRING8 name + p unused, p=pad(n) + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 4 ATOM atom + 0 None + 20 unused + +GetAtomName + 1 17 opcode + 1 unused + 2 2 request length + 4 ATOM atom + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 (n+p)/4 reply length + 2 n length of name + 22 unused + n STRING8 name + p unused, p=pad(n) + +ChangeProperty + 1 18 opcode + 1 mode + 0 Replace + 1 Prepend + 2 Append + 2 6+(n+p)/4 request length + 4 WINDOW window + 4 ATOM property + 4 ATOM type + 1 CARD8 format + 3 unused + 4 CARD32 length of data in format units + (= n for format = 8) + (= n/2 for format = 16) + (= n/4 for format = 32) + n LISTofBYTE data + (n is a multiple of 2 for format = 16) + (n is a multiple of 4 for format = 32) + p unused, p=pad(n) + + +DeleteProperty + 1 19 opcode + 1 unused + 2 3 request length + 4 WINDOW window + 4 ATOM property + +GetProperty + 1 20 opcode + 1 BOOL delete + 2 6 request length + 4 WINDOW window + 4 ATOM property + 4 ATOM type + 0 AnyPropertyType + 4 CARD32 long-offset + 4 CARD32 long-length + +▶ + 1 1 Reply + 1 CARD8 format + 2 CARD16 sequence number + 4 (n+p)/4 reply length + 4 ATOM type + 0 None + 4 CARD32 bytes-after + 4 CARD32 length of value in format units + (= 0 for format = 0) + (= n for format = 8) + (= n/2 for format = 16) + (= n/4 for format = 32) + 12 unused + n LISTofBYTE value + (n is zero for format = 0) + (n is a multiple of 2 for format = 16) + (n is a multiple of 4 for format = 32) + p unused, p=pad(n) + +ListProperties + 1 21 opcode + 1 unused + 2 2 request length + 4 WINDOW window + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 n reply length + 2 n number of ATOMs in atoms + 22 unused + 4n LISTofATOM atoms + +SetSelectionOwner + 1 22 opcode + 1 unused + 2 4 request length + 4 WINDOW owner + 0 None + 4 ATOM selection + 4 TIMESTAMP time + 0 CurrentTime + +GetSelectionOwner + 1 23 opcode + 1 unused + 2 2 request length + 4 ATOM selection + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 4 WINDOW owner + 0 None + 20 unused + +ConvertSelection + 1 24 opcode + 1 unused + 2 6 request length + 4 WINDOW requestor + 4 ATOM selection + 4 ATOM target + 4 ATOM property + 0 None + 4 TIMESTAMP time + 0 CurrentTime + +SendEvent + 1 25 opcode + 1 BOOL propagate + 2 11 requestlength + 4 WINDOW destination + 0 PointerWindow + 1 InputFocus + 4 SETofEVENT event-mask + 32 event + standard event format (see the Events section) + +GrabPointer + 1 26 opcode + 1 BOOL owner-events + 2 6 request length + 4 WINDOW grab-window + 2 SETofPOINTEREVENT event-mask + 1 pointer-mode + 0 Synchronous + 1 Asynchronous + 1 keyboard-mode + 0 Synchronous + 1 Asynchronous + 4 WINDOW confine-to + 0 None + 4 CURSOR cursor + 0 None + 4 TIMESTAMP time + 0 CurrentTime + +▶ + 1 1 Reply + 1 status + 0 Success + 1 AlreadyGrabbed + 2 InvalidTime + 3 NotViewable + 4 Frozen + 2 CARD16 sequence number + 4 0 reply length + 24 unused + +UngrabPointer + 1 27 opcode + 1 unused + 2 2 request length + 4 TIMESTAMP time + 0 CurrentTime + +GrabButton + 1 28 opcode + 1 BOOL owner-events + 2 6 request length + 4 WINDOW grab-window + 2 SETofPOINTEREVENT event-mask + 1 pointer-mode + 0 Synchronous + 1 Asynchronous + 1 keyboard-mode + 0 Synchronous + 1 Asynchronous + 4 WINDOW confine-to + 0 None + 4 CURSOR cursor + 0 None + 1 BUTTON button + 0 AnyButton + 1 unused + 2 SETofKEYMASK modifiers + #x8000 AnyModifier + +UngrabButton + 1 29 opcode + 1 BUTTON button + 0 AnyButton + 2 3 request length + 4 WINDOW grab-window + 2 SETofKEYMASK modifiers + #x8000 AnyModifier + 2 unused + +ChangeActivePointerGrab + 1 30 opcode + 1 unused + 2 4 request length + 4 CURSOR cursor + 0 None + 4 TIMESTAMP time + 0 CurrentTime + 2 SETofPOINTEREVENT event-mask + 2 unused + +GrabKeyboard + 1 31 opcode + 1 BOOL owner-events + 2 4 request length + 4 WINDOW grab-window + 4 TIMESTAMP time + 0 CurrentTime + 1 pointer-mode + 0 Synchronous + 1 Asynchronous + 1 keyboard-mode + 0 Synchronous + 1 Asynchronous + 2 unused + +▶ + 1 1 Reply + 1 status + 0 Success + 1 AlreadyGrabbed + 2 InvalidTime + 3 NotViewable + 4 Frozen + 2 CARD16 sequence number + 4 0 reply length + 24 unused + +UngrabKeyboard + 1 32 opcode + 1 unused + 2 2 request length + 4 TIMESTAMP time + 0 CurrentTime + +GrabKey + 1 33 opcode + 1 BOOL owner-events + 2 4 request length + 4 WINDOW grab-window + 2 SETofKEYMASK modifiers + #x8000 AnyModifier + 1 KEYCODE key + 0 AnyKey + 1 pointer-mode + 0 Synchronous + 1 Asynchronous + 1 keyboard-mode + 0 Synchronous + 1 Asynchronous + 3 unused + +UngrabKey + 1 34 opcode + 1 KEYCODE key + 0 AnyKey + 2 3 request length + 4 WINDOW grab-window + 2 SETofKEYMASK modifiers + #x8000 AnyModifier + 2 unused + +AllowEvents + 1 35 opcode + 1 mode + 0 AsyncPointer + 1 SyncPointer + 2 ReplayPointer + 3 AsyncKeyboard + 4 SyncKeyboard + 5 ReplayKeyboard + 6 AsyncBoth + 7 SyncBoth + 2 2 request length + 4 TIMESTAMP time + 0 CurrentTime + +GrabServer + 1 36 opcode + 1 unused + 2 1 request length + +UngrabServer + 1 37 opcode + 1 unused + 2 1 request length + +QueryPointer + 1 38 opcode + 1 unused + 2 2 request length + 4 WINDOW window + +▶ + 1 1 Reply + 1 BOOL same-screen + 2 CARD16 sequence number + 4 0 reply length + 4 WINDOW root + 4 WINDOW child + 0 None + 2 INT16 root-x + 2 INT16 root-y + 2 INT16 win-x + 2 INT16 win-y + 2 SETofKEYBUTMASK mask + 6 unused + +GetMotionEvents + 1 39 opcode + 1 unused + 2 4 request length + 4 WINDOW window + 4 TIMESTAMP start + 0 CurrentTime + 4 TIMESTAMP stop + 0 CurrentTime + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 2n reply length + 4 n number of TIMECOORDs in events + 20 unused + 8n LISTofTIMECOORD events + + TIMECOORD + 4 TIMESTAMP time + 2 INT16 x + 2 INT16 y + +TranslateCoordinates + 1 40 opcode + 1 unused + 2 4 request length + 4 WINDOW src-window + 4 WINDOW dst-window + 2 INT16 src-x + 2 INT16 src-y +▶ + 1 1 Reply + 1 BOOL same-screen + 2 CARD16 sequence number + 4 0 reply length + 4 WINDOW child + 0 None + 2 INT16 dst-x + 2 INT16 dst-y + 16 unused + +WarpPointer + 1 41 opcode + 1 unused + 2 6 request length + 4 WINDOW src-window + 0 None + 4 WINDOW dst-window + 0 None + 2 INT16 src-x + 2 INT16 src-y + 2 CARD16 src-width + 2 CARD16 src-height + 2 INT16 dst-x + 2 INT16 dst-y + +SetInputFocus + 1 42 opcode + 1 revert-to + 0 None + 1 PointerRoot + 2 Parent + 2 3 request length + 4 WINDOW focus + 0 None + 1 PointerRoot + 4 TIMESTAMP time + 0 CurrentTime + +GetInputFocus + 1 43 opcode + 1 unused + 2 1 request length + +▶ + 1 1 Reply + 1 revert-to + 0 None + 1 PointerRoot + 2 Parent + 2 CARD16 sequence number + 4 0 reply length + 4 WINDOW focus + 0 None + 1 PointerRoot + 20 unused + +QueryKeymap + 1 44 opcode + 1 unused + 2 1 request length + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 2 reply length + 32 LISTofCARD8 keys + +OpenFont + 1 45 opcode + 1 unused + 2 3+(n+p)/4 request length + 4 FONT fid + 2 n length of name + 2 unused + n STRING8 name + p unused, p=pad(n) + +CloseFont + 1 46 opcode + 1 unused + 2 2 request length + 4 FONT font + +QueryFont + 1 47 opcode + 1 unused + 2 2 request length + 4 FONTABLE font + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 7+2n+3m reply length + 12 CHARINFO min-bounds + 4 unused + 12 CHARINFO max-bounds + 4 unused + 2 CARD16 min-char-or-byte2 + 2 CARD16 max-char-or-byte2 + 2 CARD16 default-char + 2 n number of FONTPROPs in properties + 1 draw-direction + 0 LeftToRight + 1 RightToLeft + 1 CARD8 min-byte1 + 1 CARD8 max-byte1 + 1 BOOL all-chars-exist + 2 INT16 font-ascent + 2 INT16 font-descent + 4 m number of CHARINFOs in char-infos + 8n LISTofFONTPROP properties + 12m LISTofCHARINFO char-infos + + FONTPROP + 4 ATOM name + 4 <32-bits> value + + CHARINFO + 2 INT16 left-side-bearing + 2 INT16 right-side-bearing + 2 INT16 character-width + 2 INT16 ascent + 2 INT16 descent + 2 CARD16 attributes + +QueryTextExtents + 1 48 opcode + 1 BOOL odd length, True if p = 2 + 2 2+(2n+p)/4 request length + 4 FONTABLE font + 2n STRING16 string + p unused, p=pad(2n) + +▶ + 1 1 Reply + 1 draw-direction + 0 LeftToRight + 1 RightToLeft + 2 CARD16 sequence number + 4 0 reply length + 2 INT16 font-ascent + 2 INT16 font-descent + 2 INT16 overall-ascent + 2 INT16 overall-descent + 4 INT32 overall-width + 4 INT32 overall-left + 4 INT32 overall-right + 4 unused + +ListFonts + 1 49 opcode + 1 unused + 2 2+(n+p)/4 request length + 2 CARD16 max-names + 2 n length of pattern + n STRING8 pattern + p unused, p=pad(n) + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 (n+p)/4 reply length + 2 CARD16 number of STRs in names + 22 unused + n LISTofSTR names + p unused, p=pad(n) + +ListFontsWithInfo + 1 50 opcode + 1 unused + 2 2+(n+p)/4 request length + 2 CARD16 max-names + 2 n length of pattern + n STRING8 pattern + p unused, p=pad(n) + +▶ (except for last in series) + 1 1 Reply + 1 n length of name in bytes + 2 CARD16 sequence number + 4 7+2m+(n+p)/4 reply length + 12 CHARINFO min-bounds + 4 unused + 12 CHARINFO max-bounds + 4 unused + 2 CARD16 min-char-or-byte2 + 2 CARD16 max-char-or-byte2 + 2 CARD16 default-char + 2 m number of FONTPROPs in properties + 1 draw-direction + 0 LeftToRight + 1 RightToLeft + 1 CARD8 min-byte1 + 1 CARD8 max-byte1 + 1 BOOL all-chars-exist + 2 INT16 font-ascent + 2 INT16 font-descent + 4 CARD32 replies-hint + 8m LISTofFONTPROP properties + n STRING8 name + p unused, p=pad(n) + + FONTPROP + encodings are the same as for QueryFont + + CHARINFO + encodings are the same as for QueryFont + +▶ (last in series) + 1 1 Reply + 1 0 last-reply indicator + 2 CARD16 sequence number + 4 7 reply length + 52 unused + +SetFontPath + 1 51 opcode + 1 unused + 2 2+(n+p)/4 request length + 2 CARD16 number of STRs in path + 2 unused + n LISTofSTR path + p unused, p=pad(n) + +GetFontPath + 1 52 opcode + 1 unused + 2 1 request list + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 (n+p)/4 reply length + 2 CARD16 number of STRs in path + 22 unused + n LISTofSTR path + p unused, p=pad(n) + +CreatePixmap + 1 53 opcode + 1 CARD8 depth + 2 4 request length + 4 PIXMAP pid + 4 DRAWABLE drawable + 2 CARD16 width + 2 CARD16 height + +FreePixmap + 1 54 opcode + 1 unused + 2 2 request length + 4 PIXMAP pixmap + +CreateGC + 1 55 opcode + 1 unused + 2 4+n request length + 4 GCONTEXT cid + 4 DRAWABLE drawable + 4 BITMASK value-mask (has n bits set to 1) + #x00000001 function + #x00000002 plane-mask + #x00000004 foreground + #x00000008 background + #x00000010 line-width + #x00000020 line-style + #x00000040 cap-style + #x00000080 join-style + #x00000100 fill-style + #x00000200 fill-rule + #x00000400 tile + #x00000800 stipple + #x00001000 tile-stipple-x-origin + #x00002000 tile-stipple-y-origin + #x00004000 font + #x00008000 subwindow-mode + #x00010000 graphics-exposures + #x00020000 clip-x-origin + #x00040000 clip-y-origin + #x00080000 clip-mask + #x00100000 dash-offset + #x00200000 dashes + #x00400000 arc-mode + 4n LISTofVALUE value-list + + VALUEs + 1 function + 0 Clear + 1 And + 2 AndReverse + 3 Copy + 4 AndInverted + 5 NoOp + 6 Xor + 7 Or + 8 Nor + 9 Equiv + 10 Invert + 11 OrReverse + 12 CopyInverted + 13 OrInverted + 14 Nand + 15 Set + 4 CARD32 plane-mask + 4 CARD32 foreground + 4 CARD32 background + 2 CARD16 line-width + 1 line-style + 0 Solid + 1 OnOffDash + 2 DoubleDash + 1 cap-style + 0 NotLast + 1 Butt + 2 Round + 3 Projecting + 1 join-style + 0 Miter + 1 Round + 2 Bevel + 1 fill-style + 0 Solid + 1 Tiled + 2 Stippled + 3 OpaqueStippled + 1 fill-rule + 0 EvenOdd + 1 Winding + 4 PIXMAP tile + 4 PIXMAP stipple + 2 INT16 tile-stipple-x-origin + 2 INT16 tile-stipple-y-origin + 4 FONT font + 1 subwindow-mode + 0 ClipByChildren + 1 IncludeInferiors + 1 BOOL graphics-exposures + 2 INT16 clip-x-origin + 2 INT16 clip-y-origin + 4 PIXMAP clip-mask + 0 None + 2 CARD16 dash-offset + 1 CARD8 dashes + 1 arc-mode + 0 Chord + 1 PieSlice + +ChangeGC + 1 56 opcode + 1 unused + 2 3+n request length + 4 GCONTEXT gc + 4 BITMASK value-mask (has n bits set to 1) + encodings are the same as for CreateGC + 4n LISTofVALUE value-list + encodings are the same as for CreateGC + +CopyGC + 1 57 opcode + 1 unused + 2 4 request length + 4 GCONTEXT src-gc + 4 GCONTEXT dst-gc + 4 BITMASK value-mask + encodings are the same as for CreateGC + +SetDashes + 1 58 opcode + 1 unused + 2 3+(n+p)/4 request length + 4 GCONTEXT gc + 2 CARD16 dash-offset + 2 n length of dashes + n LISTofCARD8 dashes + p unused, p=pad(n) + +SetClipRectangles + 1 59 opcode + 1 ordering + 0 UnSorted + 1 YSorted + 2 YXSorted + 3 YXBanded + 2 3+2n request length + 4 GCONTEXT gc + 2 INT16 clip-x-origin + 2 INT16 clip-y-origin + 8n LISTofRECTANGLE rectangles + +FreeGC + 1 60 opcode + 1 unused + 2 2 request length + 4 GCONTEXT gc + +ClearArea + 1 61 opcode + 1 BOOL exposures + 2 4 request length + 4 WINDOW window + 2 INT16 x + 2 INT16 y + 2 CARD16 width + 2 CARD16 height + +CopyArea + 1 62 opcode + 1 unused + 2 7 request length + 4 DRAWABLE src-drawable + 4 DRAWABLE dst-drawable + 4 GCONTEXT gc + 2 INT16 src-x + 2 INT16 src-y + 2 INT16 dst-x + 2 INT16 dst-y + 2 CARD16 width + 2 CARD16 height + +CopyPlane + 1 63 opcode + 1 unused + 2 8 request length + 4 DRAWABLE src-drawable + 4 DRAWABLE dst-drawable + 4 GCONTEXT gc + 2 INT16 src-x + 2 INT16 src-y + 2 INT16 dst-x + 2 INT16 dst-y + 2 CARD16 width + 2 CARD16 height + 4 CARD32 bit-plane + +PolyPoint + 1 64 opcode + 1 coordinate-mode + 0 Origin + 1 Previous + 2 3+n request length + 4 DRAWABLE drawable + 4 GCONTEXT gc + 4n LISTofPOINT points + +PolyLine + 1 65 opcode + 1 coordinate-mode + 0 Origin + 1 Previous + 2 3+n request length + 4 DRAWABLE drawable + 4 GCONTEXT gc + 4n LISTofPOINT points + +PolySegment + 1 66 opcode + 1 unused + 2 3+2n request length + 4 DRAWABLE drawable + 4 GCONTEXT gc + 8n LISTofSEGMENT segments + + SEGMENT + 2 INT16 x1 + 2 INT16 y1 + 2 INT16 x2 + 2 INT16 y2 + +PolyRectangle + 1 67 opcode + 1 unused + 2 3+2n request length + 4 DRAWABLE drawable + 4 GCONTEXT gc + 8n LISTofRECTANGLE rectangles + +PolyArc + 1 68 opcode + 1 unused + 2 3+3n request length + 4 DRAWABLE drawable + 4 GCONTEXT gc + 12n LISTofARC arcs + +FillPoly + 1 69 opcode + 1 unused + 2 4+n request length + 4 DRAWABLE drawable + 4 GCONTEXT gc + 1 shape + 0 Complex + 1 Nonconvex + 2 Convex + 1 coordinate-mode + 0 Origin + 1 Previous + 2 unused + 4n LISTofPOINT points + +PolyFillRectangle + 1 70 opcode + 1 unused + 2 3+2n request length + 4 DRAWABLE drawable + 4 GCONTEXT gc + 8n LISTofRECTANGLE rectangles + +PolyFillArc + 1 71 opcode + 1 unused + 2 3+3n request length + 4 DRAWABLE drawable + 4 GCONTEXT gc + 12n LISTofARC arcs + +PutImage + 1 72 opcode + 1 format + 0 Bitmap + 1 XYPixmap + 2 ZPixmap + 2 6+(n+p)/4 request length + 4 DRAWABLE drawable + 4 GCONTEXT gc + 2 CARD16 width + 2 CARD16 height + 2 INT16 dst-x + 2 INT16 dst-y + 1 CARD8 left-pad + 1 CARD8 depth + 2 unused + n LISTofBYTE data + p unused, p=pad(n) + +GetImage + 1 73 opcode + 1 format + 1 XYPixmap + 2 ZPixmap + 2 5 request length + 4 DRAWABLE drawable + 2 INT16 x + 2 INT16 y + 2 CARD16 width + 2 CARD16 height + 4 CARD32 plane-mask + +▶ + 1 1 Reply + 1 CARD8 depth + 2 CARD16 sequence number + 4 (n+p)/4 reply length + 4 VISUALID visual + 0 None + 20 unused + n LISTofBYTE data + p unused, p=pad(n) + +PolyText8 + 1 74 opcode + 1 unused + 2 4+(n+p)/4 request length + 4 DRAWABLE drawable + 4 GCONTEXT gc + 2 INT16 x + 2 INT16 y + n LISTofTEXTITEM8 items + p unused, p=pad(n) (p is always 0 + or 1) + + TEXTITEM8 + 1 m length of string (cannot be 255) + 1 INT8 delta + m STRING8 string + or + 1 255 font-shift indicator + 1 font byte 3 (most-significant) + 1 font byte 2 + 1 font byte 1 + 1 font byte 0 (least-significant) + +PolyText16 + 1 75 opcode + 1 unused + 2 4+(n+p)/4 request length + 4 DRAWABLE drawable + 4 GCONTEXT gc + 2 INT16 x + 2 INT16 y + n LISTofTEXTITEM16 items + p unused, p=pad(n) (p must be 0 or + 1) + + TEXTITEM16 + 1 m number of CHAR2Bs in string + (cannot be 255) + 1 INT8 delta + 2m STRING16 string + or + 1 255 font-shift indicator + 1 font byte 3 (most-significant) + 1 font byte 2 + 1 font byte 1 + 1 font byte 0 (least-significant) + +ImageText8 + 1 76 opcode + 1 n length of string + 2 4+(n+p)/4 request length + 4 DRAWABLE drawable + 4 GCONTEXT gc + 2 INT16 x + 2 INT16 y + n STRING8 string + p unused, p=pad(n) + +ImageText16 + 1 77 opcode + 1 n number of CHAR2Bs in string + 2 4+(2n+p)/4 request length + 4 DRAWABLE drawable + 4 GCONTEXT gc + 2 INT16 x + 2 INT16 y + 2n STRING16 string + p unused, p=pad(2n) + +CreateColormap + 1 78 opcode + 1 alloc + 0 None + 1 All + 2 4 request length + 4 COLORMAP mid + 4 WINDOW window + 4 VISUALID visual + +FreeColormap + 1 79 opcode + 1 unused + 2 2 request length + 4 COLORMAP cmap + +CopyColormapAndFree + 1 80 opcode + 1 unused + 2 3 request length + 4 COLORMAP mid + 4 COLORMAP src-cmap + +InstallColormap + 1 81 opcode + 1 unused + 2 2 request length + 4 COLORMAP cmap + +UninstallColormap + 1 82 opcode + 1 unused + 2 2 request length + 4 COLORMAP cmap + +ListInstalledColormaps + 1 83 opcode + 1 unused + 2 2 request length + 4 WINDOW window + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 n reply length + 2 n number of COLORMAPs in cmaps + 22 unused + 4n LISTofCOLORMAP cmaps + +AllocColor + 1 84 opcode + 1 unused + 2 4 request length + 4 COLORMAP cmap + 2 CARD16 red + 2 CARD16 green + 2 CARD16 blue + 2 unused + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 2 CARD16 red + 2 CARD16 green + 2 CARD16 blue + 2 unused + 4 CARD32 pixel + 12 unused + +AllocNamedColor + 1 85 opcode + 1 unused + 2 3+(n+p)/4 request length + 4 COLORMAP cmap + 2 n length of name + 2 unused + n STRING8 name + p unused, p=pad(n) + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 4 CARD32 pixel + 2 CARD16 exact-red + 2 CARD16 exact-green + 2 CARD16 exact-blue + 2 CARD16 visual-red + 2 CARD16 visual-green + 2 CARD16 visual-blue + 8 unused + +AllocColorCells + 1 86 opcode + 1 BOOL contiguous + 2 3 request length + 4 COLORMAP cmap + 2 CARD16 colors + 2 CARD16 planes + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 n+m reply length + 2 n number of CARD32s in pixels + 2 m number of CARD32s in masks + 20 unused + 4n LISTofCARD32 pixels + 4m LISTofCARD32 masks + +AllocColorPlanes + 1 87 opcode + 1 BOOL contiguous + 2 4 request length + 4 COLORMAP cmap + 2 CARD16 colors + 2 CARD16 reds + 2 CARD16 greens + 2 CARD16 blues + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 n reply length + 2 n number of CARD32s in pixels + 2 unused + 4 CARD32 red-mask + 4 CARD32 green-mask + 4 CARD32 blue-mask + 8 unused + 4n LISTofCARD32 pixels + +FreeColors + 1 88 opcode + 1 unused + 2 3+n request length + 4 COLORMAP cmap + 4 CARD32 plane-mask + 4n LISTofCARD32 pixels + +StoreColors + 1 89 opcode + 1 unused + 2 2+3n request length + 4 COLORMAP cmap + 12n LISTofCOLORITEM items + + COLORITEM + 4 CARD32 pixel + 2 CARD16 red + 2 CARD16 green + 2 CARD16 blue + 1 do-red, do-green, do-blue + #x01 do-red (1 is True, 0 is False) + #x02 do-green (1 is True, 0 is False) + #x04 do-blue (1 is True, 0 is False) + #xF8 unused + 1 unused + +StoreNamedColor + 1 90 opcode + 1 do-red, do-green, do-blue + #x01 do-red (1 is True, 0 is False) + #x02 do-green (1 is True, 0 is False) + #x04 do-blue (1 is True, 0 is False) + #xF8 unused + 2 4+(n+p)/4 request length + 4 COLORMAP cmap + 4 CARD32 pixel + 2 n length of name + 2 unused + n STRING8 name + p unused, p=pad(n) + +QueryColors + 1 91 opcode + 1 unused + 2 2+n request length + 4 COLORMAP cmap + 4n LISTofCARD32 pixels + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 2n reply length + 2 n number of RGBs in colors + 22 unused + 8n LISTofRGB colors + + RGB + 2 CARD16 red + 2 CARD16 green + 2 CARD16 blue + 2 unused + +LookupColor + 1 92 opcode + 1 unused + 2 3+(n+p)/4 request length + 4 COLORMAP cmap + 2 n length of name + 2 unused + n STRING8 name + p unused, p=pad(n) + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 2 CARD16 exact-red + 2 CARD16 exact-green + 2 CARD16 exact-blue + 2 CARD16 visual-red + 2 CARD16 visual-green + 2 CARD16 visual-blue + 12 unused + +CreateCursor + 1 93 opcode + 1 unused + 2 8 request length + 4 CURSOR cid + 4 PIXMAP source + 4 PIXMAP mask + 0 None + 2 CARD16 fore-red + 2 CARD16 fore-green + 2 CARD16 fore-blue + 2 CARD16 back-red + 2 CARD16 back-green + 2 CARD16 back-blue + 2 CARD16 x + 2 CARD16 y + +CreateGlyphCursor + 1 94 opcode + 1 unused + 2 8 request length + 4 CURSOR cid + 4 FONT source-font + 4 FONT mask-font + 0 None + 2 CARD16 source-char + 2 CARD16 mask-char + 2 CARD16 fore-red + 2 CARD16 fore-green + 2 CARD16 fore-blue + 2 CARD16 back-red + 2 CARD16 back-green + 2 CARD16 back-blue + +FreeCursor + 1 95 opcode + 1 unused + 2 2 request length + 4 CURSOR cursor + +RecolorCursor + 1 96 opcode + 1 unused + 2 5 request length + 4 CURSOR cursor + 2 CARD16 fore-red + 2 CARD16 fore-green + 2 CARD16 fore-blue + 2 CARD16 back-red + 2 CARD16 back-green + 2 CARD16 back-blue + +QueryBestSize + 1 97 opcode + 1 class + 0 Cursor + 1 Tile + 2 Stipple + 2 3 request length + 4 DRAWABLE drawable + 2 CARD16 width + 2 CARD16 height + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 2 CARD16 width + 2 CARD16 height + 20 unused + +QueryExtension + 1 98 opcode + 1 unused + 2 2+(n+p)/4 request length + 2 n length of name + 2 unused + n STRING8 name + p unused, p=pad(n) + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 1 BOOL present + 1 CARD8 major-opcode + 1 CARD8 first-event + 1 CARD8 first-error + 20 unused + +ListExtensions + 1 99 opcode + 1 unused + 2 1 request length + +▶ + 1 1 Reply + 1 CARD8 number of STRs in names + 2 CARD16 sequence number + 4 (n+p)/4 reply length + 24 unused + n LISTofSTR names + p unused, p=pad(n) + +ChangeKeyboardMapping + 1 100 opcode + 1 n keycode-count + 2 2+nm request length + 1 KEYCODE first-keycode + 1 m keysyms-per-keycode + 2 unused + 4nm LISTofKEYSYM keysyms + +GetKeyboardMapping + 1 101 opcode + 1 unused + 2 2 request length + 1 KEYCODE first-keycode + 1 m count + 2 unused + +▶ + 1 1 Reply + 1 n keysyms-per-keycode + 2 CARD16 sequence number + 4 nm reply length (m = count field + from the request) + 24 unused + 4nm LISTofKEYSYM keysyms + +ChangeKeyboardControl + 1 102 opcode + 1 unused + 2 2+n request length + 4 BITMASK value-mask (has n bits set to 1) + #x0001 key-click-percent + #x0002 bell-percent + #x0004 bell-pitch + #x0008 bell-duration + #x0010 led + #x0020 led-mode + #x0040 key + #x0080 auto-repeat-mode + 4n LISTofVALUE value-list + + VALUEs + 1 INT8 key-click-percent + 1 INT8 bell-percent + 2 INT16 bell-pitch + 2 INT16 bell-duration + 1 CARD8 led + 1 led-mode + 0 Off + 1 On + 1 KEYCODE key + 1 auto-repeat-mode + 0 Off + 1 On + 2 Default + +GetKeyboardControl + 1 103 opcode + 1 unused + 2 1 request length + +▶ + 1 1 Reply + 1 global-auto-repeat + 0 Off + 1 On + 2 CARD16 sequence number + 4 5 reply length + 4 CARD32 led-mask + 1 CARD8 key-click-percent + 1 CARD8 bell-percent + 2 CARD16 bell-pitch + 2 CARD16 bell-duration + 2 unused + 32 LISTofCARD8 auto-repeats + +Bell + 1 104 opcode + 1 INT8 percent + 2 1 request length + +ChangePointerControl + 1 105 opcode + 1 unused + 2 3 request length + 2 INT16 acceleration-numerator + 2 INT16 acceleration-denominator + 2 INT16 threshold + 1 BOOL do-acceleration + 1 BOOL do-threshold + +GetPointerControl + 1 106 opcode + 1 unused + 2 1 request length + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 2 CARD16 acceleration-numerator + 2 CARD16 acceleration-denominator + 2 CARD16 threshold + 18 unused + +SetScreenSaver + 1 107 opcode + 1 unused + 2 3 request length + 2 INT16 timeout + 2 INT16 interval + 1 prefer-blanking + 0 No + 1 Yes + 2 Default + 1 allow-exposures + 0 No + 1 Yes + 2 Default + 2 unused + +GetScreenSaver + 1 108 opcode + 1 unused + 2 1 request length + +▶ + 1 1 Reply + 1 unused + 2 CARD16 sequence number + 4 0 reply length + 2 CARD16 timeout + 2 CARD16 interval + 1 prefer-blanking + 0 No + 1 Yes + 1 allow-exposures + 0 No + 1 Yes + 18 unused + +ChangeHosts + 1 109 opcode + 1 mode + 0 Insert + 1 Delete + 2 2+(n+p)/4 request length + 1 family + 0 Internet + 1 DECnet + 2 Chaos + 1 unused + 2 n length of address + n LISTofCARD8 address + p unused, p=pad(n) + +ListHosts + 1 110 opcode + 1 unused + 2 1 request length + +▶ + 1 1 Reply + 1 mode + 0 Disabled + 1 Enabled + 2 CARD16 sequence number + 4 n/4 reply length + 2 CARD16 number of HOSTs in hosts + 22 unused + n LISTofHOST hosts (n always a multiple of 4) + +SetAccessControl + 1 111 opcode + 1 mode + 0 Disable + 1 Enable + 2 1 request length + +SetCloseDownMode + 1 112 opcode + 1 mode + 0 Destroy + 1 RetainPermanent + 2 RetainTemporary + 2 1 request length + +KillClient + 1 113 opcode + 1 unused + 2 2 request length + 4 CARD32 resource + 0 AllTemporary + +RotateProperties + 1 114 opcode + 1 unused + 2 3+n request length + 4 WINDOW window + 2 n number of properties + 2 INT16 delta + 4n LISTofATOM properties + +ForceScreenSaver + 1 115 opcode + 1 mode + 0 Reset + 1 Activate + 2 1 request length + +SetPointerMapping + 1 116 opcode + 1 n length of map + 2 1+(n+p)/4 request length + n LISTofCARD8 map + p unused, p=pad(n) + +▶ + 1 1 Reply + 1 status + 0 Success + 1 Busy + 2 CARD16 sequence number + 4 0 reply length + 24 unused + +GetPointerMapping + 1 117 opcode + 1 unused + 2 1 request length + +▶ + 1 1 Reply + 1 n length of map + 2 CARD16 sequence number + 4 (n+p)/4 reply length + 24 unused + n LISTofCARD8 map + p unused, p=pad(n) + +SetModifierMapping + 1 118 opcode + 1 n keycodes-per-modifier + 2 1+2n request length + 8n LISTofKEYCODE keycodes + +▶ + 1 1 Reply + 1 status + 0 Success + 1 Busy + 2 Failed + 2 CARD16 sequence number + 4 0 reply length + 24 unused + +GetModifierMapping + 1 119 opcode + 1 unused + 2 1 request length + +▶ + 1 1 Reply + 1 n keycodes-per-modifier + 2 CARD16 sequence number + 4 2n reply length + 24 unused + 8n LISTofKEYCODE keycodes + +NoOperation + 1 127 opcode + 1 unused + 2 1+n request length + 4n unused + + + + +Events +Eventencoding + + +KeyPress + 1 2 code + 1 KEYCODE detail + 2 CARD16 sequence number + 4 TIMESTAMP time + 4 WINDOW root + 4 WINDOW event + 4 WINDOW child + 0 None + 2 INT16 root-x + 2 INT16 root-y + 2 INT16 event-x + 2 INT16 event-y + 2 SETofKEYBUTMASK state + 1 BOOL same-screen + 1 unused + +KeyRelease + 1 3 code + 1 KEYCODE detail + 2 CARD16 sequence number + 4 TIMESTAMP time + 4 WINDOW root + 4 WINDOW event + 4 WINDOW child + 0 None + 2 INT16 root-x + 2 INT16 root-y + 2 INT16 event-x + 2 INT16 event-y + 2 SETofKEYBUTMASK state + 1 BOOL same-screen + 1 unused + +ButtonPress + 1 4 code + 1 BUTTON detail + 2 CARD16 sequence number + 4 TIMESTAMP time + 4 WINDOW root + 4 WINDOW event + 4 WINDOW child + 0 None + 2 INT16 root-x + 2 INT16 root-y + 2 INT16 event-x + 2 INT16 event-y + 2 SETofKEYBUTMASK state + 1 BOOL same-screen + 1 unused + +ButtonRelease + 1 5 code + 1 BUTTON detail + 2 CARD16 sequence number + 4 TIMESTAMP time + 4 WINDOW root + 4 WINDOW event + 4 WINDOW child + 0 None + 2 INT16 root-x + 2 INT16 root-y + 2 INT16 event-x + 2 INT16 event-y + 2 SETofKEYBUTMASK state + 1 BOOL same-screen + 1 unused + +MotionNotify + 1 6 code + 1 detail + 0 Normal + 1 Hint + 2 CARD16 sequence number + 4 TIMESTAMP time + 4 WINDOW root + 4 WINDOW event + 4 WINDOW child + 0 None + 2 INT16 root-x + 2 INT16 root-y + 2 INT16 event-x + 2 INT16 event-y + 2 SETofKEYBUTMASK state + 1 BOOL same-screen + 1 unused + +EnterNotify + 1 7 code + 1 detail + 0 Ancestor + 1 Virtual + 2 Inferior + 3 Nonlinear + 4 NonlinearVirtual + 2 CARD16 sequence number + 4 TIMESTAMP time + 4 WINDOW root + 4 WINDOW event + 4 WINDOW child + 0 None + 2 INT16 root-x + 2 INT16 root-y + 2 INT16 event-x + 2 INT16 event-y + 2 SETofKEYBUTMASK state + 1 mode + 0 Normal + 1 Grab + 2 Ungrab + 1 same-screen, focus + #x01 focus (1 is True, 0 is False) + #x02 same-screen (1 is True, 0 is False) + #xFC unused + +LeaveNotify + 1 8 code + 1 detail + 0 Ancestor + 1 Virtual + 2 Inferior + 3 Nonlinear + 4 NonlinearVirtual + 2 CARD16 sequence number + 4 TIMESTAMP time + 4 WINDOW root + 4 WINDOW event + 4 WINDOW child + 0 None + 2 INT16 root-x + 2 INT16 root-y + 2 INT16 event-x + 2 INT16 event-y + 2 SETofKEYBUTMASK state + 1 mode + 0 Normal + 1 Grab + 2 Ungrab + 1 same-screen, focus + #x01 focus (1 is True, 0 is False) + #x02 same-screen (1 is True, 0 is False) + #xFC unused + +FocusIn + 1 9 code + 1 detail + 0 Ancestor + 1 Virtual + 2 Inferior + 3 Nonlinear + 4 NonlinearVirtual + 5 Pointer + 6 PointerRoot + 7 None + 2 CARD16 sequence number + 4 WINDOW event + 1 mode + 0 Normal + 1 Grab + 2 Ungrab + 3 WhileGrabbed + 23 unused + +FocusOut + 1 10 code + 1 detail + 0 Ancestor + 1 Virtual + 2 Inferior + 3 Nonlinear + 4 NonlinearVirtual + 5 Pointer + 6 PointerRoot + 7 None + 2 CARD16 sequence number + 4 WINDOW event + 1 mode + 0 Normal + 1 Grab + 2 Ungrab + 3 WhileGrabbed + 23 unused + +KeymapNotify + 1 11 code + 31 LISTofCARD8 keys (byte for keycodes 0-7 is + omitted) + +Expose + 1 12 code + 1 unused + 2 CARD16 sequence number + 4 WINDOW window + 2 CARD16 x + 2 CARD16 y + 2 CARD16 width + 2 CARD16 height + 2 CARD16 count + 14 unused + +GraphicsExposure + 1 13 code + 1 unused + 2 CARD16 sequence number + 4 DRAWABLE drawable + 2 CARD16 x + 2 CARD16 y + 2 CARD16 width + 2 CARD16 height + 2 CARD16 minor-opcode + 2 CARD16 count + 1 CARD8 major-opcode + 11 unused + +NoExposure + 1 14 code + 1 unused + 2 CARD16 sequence number + 4 DRAWABLE drawable + 2 CARD16 minor-opcode + 1 CARD8 major-opcode + 21 unused + +VisibilityNotify + 1 15 code + 1 unused + 2 CARD16 sequence number + 4 WINDOW window + 1 state + 0 Unobscured + 1 PartiallyObscured + 2 FullyObscured + 23 unused + +CreateNotify + 1 16 code + 1 unused + 2 CARD16 sequence number + 4 WINDOW parent + 4 WINDOW window + 2 INT16 x + 2 INT16 y + 2 CARD16 width + 2 CARD16 height + 2 CARD16 border-width + 1 BOOL override-redirect + 9 unused + +DestroyNotify + 1 17 code + 1 unused + 2 CARD16 sequence number + 4 WINDOW event + 4 WINDOW window + 20 unused + +UnmapNotify + 1 18 code + 1 unused + 2 CARD16 sequence number + 4 WINDOW event + 4 WINDOW window + 1 BOOL from-configure + 19 unused + +MapNotify + 1 19 code + 1 unused + 2 CARD16 sequence number + 4 WINDOW event + 4 WINDOW window + 1 BOOL override-redirect + 19 unused + +MapRequest + 1 20 code + 1 unused + 2 CARD16 sequence number + 4 WINDOW parent + 4 WINDOW window + 20 unused + +ReparentNotify + 1 21 code + 1 unused + 2 CARD16 sequence number + 4 WINDOW event + 4 WINDOW window + 4 WINDOW parent + 2 INT16 x + 2 INT16 y + 1 BOOL override-redirect + 11 unused + +ConfigureNotify + 1 22 code + 1 unused + 2 CARD16 sequence number + 4 WINDOW event + 4 WINDOW window + 4 WINDOW above-sibling + 0 None + 2 INT16 x + 2 INT16 y + 2 CARD16 width + 2 CARD16 height + 2 CARD16 border-width + 1 BOOL override-redirect + 5 unused + +ConfigureRequest + 1 23 code + 1 stack-mode + 0 Above + 1 Below + 2 TopIf + 3 BottomIf + 4 Opposite + 2 CARD16 sequence number + 4 WINDOW parent + 4 WINDOW window + 4 WINDOW sibling + 0 None + 2 INT16 x + 2 INT16 y + 2 CARD16 width + 2 CARD16 height + 2 CARD16 border-width + 2 BITMASK value-mask + #x0001 x + #x0002 y + #x0004 width + #x0008 height + #x0010 border-width + #x0020 sibling + #x0040 stack-mode + 4 unused + +GravityNotify + 1 24 code + 1 unused + 2 CARD16 sequence number + 4 WINDOW event + 4 WINDOW window + 2 INT16 x + 2 INT16 y + 16 unused + +ResizeRequest + 1 25 code + 1 unused + 2 CARD16 sequence number + 4 WINDOW window + 2 CARD16 width + 2 CARD16 height + 20 unused + +CirculateNotify + 1 26 code + 1 unused + 2 CARD16 sequence number + 4 WINDOW event + 4 WINDOW window + 4 WINDOW unused + 1 place + 0 Top + 1 Bottom + 15 unused + +CirculateRequest + 1 27 code + 1 unused + 2 CARD16 sequence number + 4 WINDOW parent + 4 WINDOW window + 4 unused + 1 place + 0 Top + 1 Bottom + 15 unused + +PropertyNotify + 1 28 code + 1 unused + 2 CARD16 sequence number + 4 WINDOW window + 4 ATOM atom + 4 TIMESTAMP time + 1 state + 0 NewValue + 1 Deleted + 15 unused + +SelectionClear + 1 29 code + 1 unused + 2 CARD16 sequence number + 4 TIMESTAMP time + 4 WINDOW owner + 4 ATOM selection + 16 unused + +SelectionRequest + 1 30 code + 1 unused + 2 CARD16 sequence number + 4 TIMESTAMP time + 0 CurrentTime + 4 WINDOW owner + 4 WINDOW requestor + 4 ATOM selection + 4 ATOM target + 4 ATOM property + 0 None + 4 unused + +SelectionNotify + 1 31 code + 1 unused + 2 CARD16 sequence number + 4 TIMESTAMP time + 0 CurrentTime + 4 WINDOW requestor + 4 ATOM selection + 4 ATOM target + 4 ATOM property + 0 None + 8 unused + +ColormapNotify + 1 32 code + 1 unused + 2 CARD16 sequence number + 4 WINDOW window + 4 COLORMAP colormap + 0 None + 1 BOOL new + 1 state + 0 Uninstalled + 1 Installed + 18 unused + +ClientMessage + 1 33 code + 1 CARD8 format + 2 CARD16 sequence number + 4 WINDOW window + 4 ATOM type + 20 data + +MappingNotify + 1 34 code + 1 unused + 2 CARD16 sequence number + 1 request + 0 Modifier + 1 Keyboard + 2 Pointer + 1 KEYCODE first-keycode + 1 CARD8 count + 25 unused + + + + diff --git a/miniconda3/share/doc/xproto/glossary.xml b/miniconda3/share/doc/xproto/glossary.xml new file mode 100644 index 0000000000000000000000000000000000000000..eefd327f79c157776d505d0b28bf3092ed8948f6 --- /dev/null +++ b/miniconda3/share/doc/xproto/glossary.xml @@ -0,0 +1,1320 @@ + +Glossary + + + + Access control list + Access control list + + +X maintains a list of hosts from which client programs can be run. +By default, +only programs on the local host and hosts specified in an initial list read +by the server can use the display. +Clients on the local host can change this access control list. +Some server implementations can also implement other authorization mechanisms +in addition to or in place of this mechanism. +The action of this mechanism can be conditional based on the authorization +protocol name and data received by the server at connection setup. + + + + + + Active grab + Active grab + + +A grab is active when the pointer or keyboard is actually owned by +the single grabbing client. + + + + + + Ancestors + Ancestors + + +If W is an inferior of A, then A is an ancestor of W. + + + + + + Atom + Atom + + +An atom is a unique ID corresponding to a string name. +Atoms are used to identify properties, types, and selections. + + + + + + Background + Background + + +An +InputOutput +window can have a background, which is defined as a pixmap. +When regions of the window have their contents lost or invalidated, +the server will automatically tile those regions with the background. + + + + + + Backing store + Backing store + + +When a server maintains the contents of a window, +the pixels saved off screen are known as a backing store. + + + + + + Bit gravity + Bitgravity + + +When a window is resized, +the contents of the window are not necessarily discarded. +It is possible to request that the server relocate the previous contents +to some region of the window (though no guarantees are made). +This attraction of window contents for some location of +a window is known as bit gravity. + + + + + + Bit plane + Bitplane + + +When a pixmap or window is thought of as a stack of bitmaps, +each bitmap is called a bit plane or plane. + + + + + + Bitmap + Bitmap + + +A bitmap is a pixmap of depth one. + + + + + + Border + Border + + +An +InputOutput +window can have a border of equal thickness on all four sides of the window. +A pixmap defines the contents of the border, +and the server automatically maintains the contents of the border. +Exposure events are never generated for border regions. + + + + + + Button grabbing + Buttongrabbing + + +Buttons on the pointer may be passively grabbed by a client. +When the button is pressed, +the pointer is then actively grabbed by the client. + + + + + + Byte order + Byte order + + +For image (pixmap/bitmap) data, +the server defines the byte order, +and clients with different native byte ordering must swap bytes as necessary. +For all other parts of the protocol, +the client defines the byte order, +and the server swaps bytes as necessary. + + + + + + Children + Children + Windowchildren + + +The children of a window are its first-level subwindows. + + + + + + Client + Client + + +An application program connects to the window system server by some +interprocess communication path, such as a TCP connection or a +shared memory buffer. +This program is referred to as a client of the window system server. +More precisely, +the client is the communication path itself; +a program with multiple paths open to the server is viewed as +multiple clients by the protocol. +Resource lifetimes are controlled by connection lifetimes, +not by program lifetimes. + + + + + + Clipping region + Clipping region + + +In a graphics context, +a bitmap or list of rectangles can be specified +to restrict output to a particular region of the window. +The image defined by the bitmap or rectangles is called a clipping region. + + + + + + Colormap + Colormap + + +A colormap consists of a set of entries defining color values. +The colormap associated with a window is used to display the contents of +the window; each pixel value indexes the colormap to produce RGB values +that drive the guns of a monitor. +Depending on hardware limitations, +one or more colormaps may be installed at one time, +so that windows associated with those maps display with correct colors. + + + + + + Connection + Connection + + +The interprocess communication path between the server and client +program is known as a connection. +A client program typically (but not necessarily) has one +connection to the server over which requests and events are sent. + + + + + + Containment + Containment + + +A window contains the pointer if the window is viewable and the +hotspot of the cursor is +within a visible region of the window or a +visible region of one of its inferiors. +The border of the window is included as part of the window for containment. +The pointer is in a window if the window contains the pointer +but no inferior contains the pointer. + + + + + + Coordinate system + Coordinate system + + +The coordinate system has the X axis horizontal and the Y axis vertical, +with the origin [0, 0] at the upper left. +Coordinates are integral, +in terms of pixels, +and coincide with pixel centers. +Each window and pixmap has its own coordinate system. +For a window, +the origin is inside the border at the inside upper left. + + + + + + Cursor + Cursor + + +A cursor is the visible shape of the pointer on a screen. +It consists of a hotspot, +a source bitmap, a shape bitmap, and a pair of colors. +The cursor defined for a window controls the visible appearance +when the pointer is in that window. + + + + + + Depth + Depth + + +The depth of a window or pixmap is the number of bits per pixel that it has. +The depth of a graphics context is the depth of the drawables it can be +used in conjunction with for graphics output. + + + + + + Device + Device + + +Keyboards, mice, tablets, track-balls, button boxes, and so on are all +collectively known as input devices. +The core protocol only deals with two devices, +the keyboard and the pointer. + + + + + + DirectColor + DirectColor + + +DirectColor +is a class of colormap in which a pixel value is decomposed into three +separate subfields for indexing. +The first subfield indexes an array to produce red intensity values. +The second subfield indexes a second array to produce blue intensity values. +The third subfield indexes a third array to produce green intensity values. +The RGB values can be changed dynamically. + + + + + + Display + Display + + +A server, together with its screens and input devices, is called a display. + + + + + + Drawable + Drawable + + +Both windows and pixmaps can be used as sources and destinations in +graphics operations. +These windows and pixmaps are collectively known as drawables. +However, an +InputOnly +window cannot be used as a source or destination in a graphics operation. + + + + + + Event + Event + + +Clients are informed of information asynchronously by means of events. +These events can be generated either asynchronously from devices +or as side effects of client requests. +Events are grouped into types. +The server never sends events to a client unless the +client has specifically asked to be informed of that type of event. +However, other clients can force events to be sent to other clients. +Events are typically reported relative to a window. + + + + + + Event mask + Eventmask + + +Events are requested relative to a window. +The set of event types that a client requests relative to a window +is described by using an event mask. + + + + + + Event synchronization + Eventsynchronization + + +There are certain race conditions possible when demultiplexing device +events to clients (in particular deciding where pointer and keyboard +events should be sent when in the middle of window management +operations). +The event synchronization mechanism allows synchronous processing +of device events. + + + + + + Event propagation + Eventpropagation + + +Device-related events propagate from the source window to ancestor +windows until some client has expressed interest in handling that type +of event or until the event is discarded explicitly. + + + + + + Event source + Eventsource + + +The window the pointer is in is the source of a device-related +event. + + + + + + Exposure event + EventExposure + + +Servers do not guarantee to preserve the contents of windows when +windows are obscured or reconfigured. +Exposure events are sent to clients to inform them when contents +of regions of windows have been lost. + + + + + + Extension + Extension + + +Named extensions to the core protocol can be defined to extend the +system. +Extension to output requests, resources, and event types are +all possible and are expected. + + + + + + Focus window + Focus window + + +The focus window is another term for the input focus. + + + + + + Font + Font + + +A font is a matrix of glyphs (typically characters). +The protocol does no translation or interpretation of character sets. +The client simply indicates values used to index the glyph array. +A font contains additional metric information to determine interglyph +and interline spacing. + + + + + + GC, GContext + GCGraphics context + GContextGraphics context + + +GC and gcontext are abbreviations for graphics context. + + + + + + Glyph + Glyph + + +A glyph is an image, typically of a character, in a font. + + + + + + Grab + GrabActive grabPassive grab + + +Keyboard keys, the keyboard, pointer buttons, the pointer, and the +server can be grabbed for exclusive use by a client. +In general, +these facilities are not intended to be used by normal applications +but are intended for various input and window managers to implement +various styles of user interfaces. + + + + + + Graphics context + Graphics context + + +Various information for graphics output is stored in a graphics context +such as foreground pixel, background pixel, line width, +clipping region, +and so on. +A graphics context can only be used with drawables that have the same root +and the same depth as the graphics context. + + + + + + Gravity + Gravity + + +See bit gravity +and window gravity. + + + + + + GrayScale + GrayScale + + +GrayScale +can be viewed as a degenerate case of +PseudoColor, +in which the red, green, and blue values in any given colormap entry are equal, +thus producing shades of gray. +The gray values can be changed dynamically. + + + + + + Hotspot + Hotspot + + +A cursor has an associated hotspot that defines the point in the +cursor corresponding to the coordinates reported for the pointer. + + + + + + Identifier + Identifier + + +An identifier is a unique value associated with a resource that clients use +to name that resource. +The identifier can be used over any connection. + + + + + + Inferiors + Inferiors + + +The inferiors of a window are all of the subwindows nested below it: +the children, the children's children, and so on. + + + + + + Input focus + Input focus + + +The input focus is normally a window defining the scope for +processing of keyboard input. +If a generated keyboard event would normally be reported to this window +or one of its inferiors, +the event is reported normally. +Otherwise, the event is reported with respect to +the focus window. +The input focus also can be set such that all +keyboard events are discarded and such that the focus +window is dynamically taken to be the root window of whatever screen +the pointer is on at each keyboard event. + + + + + + Input manager + Input manager + + +Control over keyboard input is typically provided by an input manager client. + + + + + + InputOnly window + WindowInputOnly + + +An +InputOnly +window is a window that cannot be used for graphics requests. +InputOnly +windows are invisible and can be used to control such things +as cursors, input event generation, and grabbing. +InputOnly +windows cannot have +InputOutput +windows as inferiors. + + + + + + InputOutput window + WindowInputOutput + + +An +InputOutput +window is the normal kind of opaque window, used for both input and output. +InputOutput +windows can have both +InputOutput +and +InputOnly +windows as inferiors. + + + + + + Key grabbing + Keygrabbing + + +Keys on the keyboard can be passively grabbed by a client. +When the key is pressed, +the keyboard is then actively grabbed by the client. + + + + + + Keyboard grabbing + Keyboardgrabbing + + +A client can actively grab control of the keyboard, and key events +will be sent to that client rather than the client the events would +normally have been sent to. + + + + + + Keysym + Keysym + + +An encoding of a symbol on a keycap on a keyboard. + + + + + + Mapped + Mapped window + + +A window is said to be mapped if a map call has been performed on it. +Unmapped windows and their inferiors are never viewable or visible. + + + + + + Modifier keys + Modifier keys + KeymodifierModifier keys + + +Shift, Control, Meta, Super, Hyper, Alt, Compose, Apple, CapsLock, +ShiftLock, and similar keys are called modifier keys. + + + + + + Monochrome + Monochrome + + +Monochrome is a special case of +StaticGray +in which there are only two colormap entries. + + + + + + Obscure + Obscure + + +A window is obscured if some other window obscures it. +Window A obscures window B if both are viewable +InputOutput +windows, A is higher in the global stacking order, +and the rectangle defined by the outside edges of A intersects +the rectangle defined by the outside edges of B. +Note the distinction between obscure and occludes. +Also note that window borders are included in the calculation +and that a window can be obscured and yet still have visible regions. + + + + + + Occlude + Occlude + + +A window is occluded if some other window occludes it. +Window A occludes window B if both are mapped, A is higher in the global +stacking order, and the rectangle defined by the outside edges of A +intersects the rectangle defined by the outside edges of B. +Note the distinction between occludes and obscures. +Also note that window borders are included in the calculation. + + + + + + Padding + Padding + + +Some padding bytes are inserted in the data stream to maintain +alignment of the protocol requests on natural boundaries. +This increases ease of portability to some machine architectures. + + + + + + Parent window + Windowparent + + +If C is a child of P, +then P is the parent of C. + + + + + + Passive grab + Passive grab + + +Grabbing a key or button is a passive grab. +The grab activates when the key or button is actually pressed. + + + + + + Pixel value + Pixel value + + +A pixel is an N-bit value, where N is the number of bit planes used +in a particular window or pixmap (that is, +N is the depth of the window or pixmap). +For a window, +a pixel value indexes a colormap to derive an actual color to be displayed. + + + + + + Pixmap + Pixmap + + +A pixmap is a three-dimensional array of bits. +A pixmap is normally thought of as a two-dimensional array of pixels, +where each pixel can be a value from 0 to (2^N)-1 +and where N is the depth (z axis) of the pixmap. +A pixmap can also be thought of as a stack of N bitmaps. + + + + + + Plane + Plane + + +When a pixmap or window is thought of as a stack of bitmaps, +each bitmap is called a plane or bit plane. + + + + + + Plane mask + Planemask + + +Graphics operations can be restricted to only affect a subset of bit +planes of a destination. +A plane mask is a bit mask describing which planes are to be modified. +The plane mask is stored in a graphics context. + + + + + + Pointer + Pointer + + +The pointer is the pointing device attached to the cursor +and tracked on the screens. + + + + + + Pointer grabbing + Pointergrabbing + + +A client can actively grab control of the pointer. +Then button and motion events will be sent to that client +rather than the client the events would normally have been sent to. + + + + + + Pointing device + Pointing device + + +A pointing device is typically a mouse, tablet, or some other +device with effective dimensional motion. +There is only one visible cursor defined by the core protocol, +and it tracks whatever pointing device is attached as the pointer. + + + + + + Property + Property + + +Windows may have associated properties, +which consist of a name, a type, a data format, and some data. +The protocol places no interpretation on properties. +They are intended as a general-purpose naming mechanism for clients. +For example, clients might use properties to share information such as resize +hints, program names, and icon formats with a window manager. + + + + + + Property list + Property list + + +The property list of a window is the list of properties that have +been defined for the window. + + + + + + PseudoColor + PseudoColor + + +PseudoColor +is a class of colormap in which a pixel value indexes the colormap to +produce independent red, green, and blue values; +that is, the colormap is viewed as an array of triples (RGB values). +The RGB values can be changed dynamically. + + + + + + Redirecting control + Redirecting control + + +Window managers (or client programs) may want to enforce window layout +policy in various ways. +When a client attempts to change the size or position of a window, +the operation may be redirected to a specified client +rather than the operation actually being performed. + + + + + + Reply + Reply + + +Information requested by a client program is sent back to the client +with a reply. +Both events and replies are multiplexed on the same connection. +Most requests do not generate replies, +although some requests generate multiple replies. + + + + + + Request + Request + + +A command to the server is called a request. +It is a single block of data sent over a connection. + + + + + + Resource + Resource + + +Windows, pixmaps, cursors, fonts, graphics contexts, and colormaps are +known as resources. +They all have unique identifiers associated with them for naming purposes. +The lifetime of a resource usually is bounded by the lifetime of the connection +over which the resource was created. + + + + + + RGB values + RGB values + + +Red, green, and blue (RGB) intensity values are used to define color. +These values are always represented as 16-bit unsigned numbers, +with 0 being the minimum intensity and 65535 being the maximum intensity. +The server scales the values to match the display hardware. + + + + + + Root + Root + + +The root of a pixmap, colormap, or graphics context is the same as the root of +whatever drawable was used when the pixmap, colormap, or graphics context was +created. +The root of a window is the root window under which the window was created. + + + + + + Root window + Windowroot + + +Each screen has a root window covering it. +It cannot be reconfigured or unmapped, +but it otherwise acts as a full-fledged window. +A root window has no parent. + + + + + + Save set + Save set + + +The save set of a client is a list of other clients' windows that, +if they are inferiors of one of the client's windows at connection close, +should not be destroyed and that should be remapped if currently unmapped. +Save sets are typically used by window managers to avoid +lost windows if the manager terminates abnormally. + + + + + + Scanline + Scanline + + +A scanline is a list of pixel or bit values viewed as a horizontal +row (all values having the same y coordinate) of an image, with the +values ordered by increasing x coordinate. + + + + + + Scanline order + Scanline order + + +An image represented in scanline order contains scanlines ordered by +increasing y coordinate. + + + + + + Screen + Screen + + +A server can provide several independent screens, +which typically have physically independent monitors. +This would be the expected configuration when there is only a single keyboard +and pointer shared among the screens. + + + + + + Selection + Selection + + +A selection can be thought of as an indirect property with dynamic +type; that is, rather than having the property stored in the server, +it is maintained by some client (the owner). +A selection is global in nature and is thought of as belonging to the user +(although maintained by clients), rather than as being private to a particular +window subhierarchy or a particular set of clients. +When a client asks for the contents of a selection, +it specifies a selection target type. +This target type can be used to control the transmitted representation of the +contents. +For example, +if the selection is the last thing the user clicked on +and that is currently an image, then the target type might specify +whether the contents of the image should be sent in XY format or Z format. +The target type can also be used to control the class of contents transmitted; +for example, asking for the looks (fonts, line +spacing, indentation, and so on) of a paragraph selection rather than the +text of the paragraph. +The target type can also be used for other purposes. +The protocol does not constrain the semantics. + + + + + + Server + Server + + +The server provides the basic windowing mechanism. +It handles connections from clients, +multiplexes graphics requests onto the screens, +and demultiplexes input back to the appropriate clients. + + + + + + Server grabbing + Servergrabbing + + +The server can be grabbed by a single client for exclusive use. +This prevents processing of any requests from other client connections until +the grab is completed. +This is typically only a transient state for +such things as rubber-banding, pop-up menus, or to execute requests +indivisibly. + + + + + + Sibling + Sibling + + +Children of the same parent window are known as sibling windows. + + + + + + Stacking order + Stacking order + + +Sibling windows may stack on top of each other. +Windows above other windows both obscure and occlude those lower windows. +This is similar to paper on a desk. +The relationship between sibling windows is known as the stacking order. + + + + + + StaticColor + StaticColor + + +StaticColor +can be viewed as a degenerate case of +PseudoColor +in which the RGB values are predefined and read-only. + + + + + + StaticGray + StaticGray + + +StaticGray +can be viewed as a degenerate case of +GrayScale +in which the gray values are predefined and read-only. +The values are typically linear or near-linear increasing ramps. + + + + + + Stipple + Stipple + + +A stipple pattern is a bitmap that is used to tile a region that will serve +as an additional clip mask for a fill operation with the foreground +color. + + + + + + String Equivalence + String Equivalence + + +Two ISO Latin-1 STRING8 values are considered equal if they are the same +length and if corresponding bytes are either equal or are equivalent as +follows: decimal values 65 to 90 inclusive (characters A to Z) are +pairwise equivalent to decimal values 97 to 122 inclusive +(characters a to z), decimal values 192 to 214 inclusive +(characters A grave to O diaeresis) are pairwise equivalent to decimal +values 224 to 246 inclusive (characters a grave to o diaeresis), +and decimal values 216 to 222 inclusive (characters O oblique to THORN) +are pairwise equivalent to decimal values 246 to 254 inclusive +(characters o oblique to thorn). + + + + + + Tile + Tile + + +A pixmap can be replicated in two dimensions to tile a region. +The pixmap itself is also known as a tile. + + + + + + Timestamp + Timestamp + CurrentTime + + +A timestamp is a time value, expressed in milliseconds. +It typically is the time since the last +server reset. +Timestamp values wrap around (after about 49.7 days). +The server, given its current time is represented by timestamp T, +always interprets timestamps from clients by treating half of the +timestamp space as being earlier in time than T and half of the +timestamp space as being later in time than T. +One timestamp value (named +CurrentTime) +is never generated by the server. +This value is reserved for use in requests to represent the current +server time. + + + + + + TrueColor + TrueColor + + +TrueColor +can be viewed as a degenerate case of +DirectColor +in which the subfields in the pixel value directly encode +the corresponding RGB values; that is, the colormap has predefined +read-only RGB values. +The values are typically linear or near-linear increasing ramps. + + + + + + Type + Type + + +A type is an arbitrary atom used to identify the interpretation of +property data. +Types are completely uninterpreted by the server +and are solely for the benefit of clients. + + + + + + Viewable + Viewable + + +A window is viewable if it and all of its ancestors are mapped. +This does not imply that any portion of the window is actually visible. +Graphics requests can be performed on a window when it is not viewable, +but output will not be retained unless the server is maintaining +backing store. + + + + + + Visible + Visible + + +A region of a window is visible if someone looking at the screen can +actually see it; +that is, the window is viewable and the region is not occluded by any +other window. + + + + + + Window gravity + Windowgravity + + +When windows are resized, +subwindows may be repositioned automatically relative to some position +in the window. +This attraction of a subwindow to some part of its parent is known +as window gravity. + + + + + + Window manager + Windowmanager + + +Manipulation of windows on the screen and much of the user interface +(policy) is typically provided by a window manager client. + + + + + + XYFormat + XYFormat + + +The data for a pixmap is said to be in XY format if it is organized as +a set of bitmaps representing individual bit planes, with the planes +appearing from most-significant to least-significant in bit order. + + + + + + ZFormat + ZFormat + + +The data for a pixmap is said to be in Z format if it is organized as +a set of pixel values in scanline order. + + + + + diff --git a/miniconda3/share/doc/xproto/keysyms.xml b/miniconda3/share/doc/xproto/keysyms.xml new file mode 100644 index 0000000000000000000000000000000000000000..9999f8d88583d7468bec6f7d7fc2d6b64939191c --- /dev/null +++ b/miniconda3/share/doc/xproto/keysyms.xml @@ -0,0 +1,6050 @@ + +KEYSYM Encoding +TypesKEYSYM +Keysym + + +KEYSYM values are 32-bit integers that encode the symbols on the +keycaps of a keyboard. The three most significant bits are always +zero, which leaves a 29-bit number space. For convenience, KEYSYM +values can be viewed as split into four bytes: + + + + + +Byte 1 is the most significant eight bits (three zero bits and +the most-significant five bits of the 29-bit effective value) + + + + +Byte 2 is the next most-significant eight bits + + + + +Byte 3 is the next most-significant eight bits + + + + +Byte 4 is the least-significant eight bits + + + + + +There are six categories of KEYSYM values. + + + +Special KEYSYMs + +There are two special values: +NoSymbol +and +VoidSymbol. +They are used to indicate the absence of symbols (see +Section 5, Keyboards). + + + + + + + + + + + + + + Byte 1 + Byte 2 + Byte 3 + Byte 4 + Hex. value + Name + + + + + 0 + 0 + 0 + 0 + #x00000000 + NoSymbol + + + 0 + 255 + 255 + 255 + #x00FFFFFF + VoidSymbol + + + + + + + +Latin-1 KEYSYMs + + +The Latin-1 KEYSYMs occupy the range #x0020 to #x007E and #x00A0 to +#00FF and represent the ISO 10646 / Unicode characters U+0020 to +U+007E and U+00A0 to U+00FF, respectively. + + + + +Unicode KEYSYMs +KeysymUnicode + + +These occupy the range #x01000100 to #x0110FFFF and represent the ISO +10646 / Unicode characters U+0100 to U+10FFFF, respectively. The +numeric value of a Unicode KEYSYM is the Unicode position of the +corresponding character plus #x01000000. In the interest of backwards +compatibility, clients should be able to process both the Unicode +KEYSYM and the Legacy KEYSYM for those characters where both exist. + + +Dead keys, which place an accent on the next character entered, shall +be encoded as Function KEYSYMs, and not as the Unicode KEYSYM +corresponding to an equivalent combining character. Where a keycap +indicates a specific function with a graphical symbol that is also +available in Unicode (e.g., an upwards arrow for the cursor up +function), the appropriate Function KEYSYM should be used, and not +the Unicode KEYSYM corresponding to the depicted symbol. + + + +Function KEYSYMs + + +These represent keycap symbols that do not directly represent elements +of a coded character set. Instead, they typically identify a software +function, mode, or operation (e.g., cursor up, caps lock, insert) that +can be activated using a dedicated key. Function KEYSYMs have zero +values for bytes 1 and 2. Byte 3 distinguishes between several 8-bit +sets within which byte 4 identifies the individual function key. + + + + + + + + + + Byte 3 + Byte 4 + + + + + 255 + Keyboard + + + 254 + Keyboard (XKB) Extension + + + 253 + 3270 + + + + + + +Within a national market, keyboards tend to be comparatively standard +with respect to the character keys, but they can differ significantly +on the miscellaneous function keys. Some have function keys left over +from early timesharing days, others were designed for a specific +application, such as text processing, web browsing, or accessing +audiovisual data. The symbols on the keycaps can differ significantly +between manufacturers and national markets, even where they denote the +same software function (e.g., Ctrl in the U.S. versus Strg in Germany) + + + +There are two ways of thinking about how to define KEYSYMs for such a +world: + + + + +The Engraving approach + + + + +The Common approach + + + + + +The Engraving approach is to create a KEYSYM for every unique key +engraving. This is effectively taking the union of all key engravings +on all keyboards. For example, some keyboards label function keys +across the top as F1 through Fn, and others label them as PF1 through +PFn. These would be different keys under the Engraving +approach. Likewise, Lock would differ from Shift Lock, which is +different from the up-arrow symbol that has the effect of changing +lowercase to uppercase. There are lots of other aliases such as Del, +DEL, Delete, Remove, and so forth. The Engraving approach makes it +easy to decide if a new entry should be added to the KEYSYM set: if it +does not exactly match an existing one, then a new one is created. + + + +The Common approach tries to capture all of the keys present on an +interesting number of keyboards, folding likely aliases into the same +KEYSYM. For example, Del, DEL, and Delete are all merged into a single +KEYSYM. Vendors can augment the KEYSYM set (using the vendor-specific +encoding space) to include all of their unique keys that were not +included in the standard set. Each vendor decides which of its keys +map into the standard KEYSYMs, which presumably can be overridden by a +user. It is more difficult to implement this approach, because +judgment is required about when a sufficient set of keyboards +implements an engraving to justify making it a KEYSYM in the standard +set and about which engravings should be merged into a single +KEYSYM. + + + +Although neither scheme is perfect or elegant, the Common approach has +been selected because it makes it easier to write a portable +application. Having the Delete functionality merged into a single +KEYSYM allows an application to implement a deletion function and +expect reasonable bindings on a wide set of workstations. Under the +Common approach, application writers are still free to look for and +interpret vendor-specific KEYSYMs, but because they are in the +extended set, the application developer is more conscious that they +are writing the application in a nonportable fashion. + + + +The Keyboard set is a miscellaneous collection of commonly occurring +keys on keyboards. Within this set, the numeric keypad symbols are +generally duplicates of symbols found on keys on the main part of the +keyboard, but they are distinguished here because they often have a +distinguishable semantics associated with them. + + + + + + + + + + KEYSYM value + Name + Set + + + + + #xFF08 + BACKSPACE, BACK SPACE, BACK CHAR + Keyboard + + + #xFF09 + TAB + Keyboard + + + #xFF0A + LINEFEED, LF + Keyboard + + + #xFF0B + CLEAR + Keyboard + + + #xFF0D + RETURN, ENTER + Keyboard + + + #xFF13 + PAUSE, HOLD + Keyboard + + + #xFF14 + SCROLL LOCK + Keyboard + + + #xFF15 + SYS REQ, SYSTEM REQUEST + Keyboard + + + #xFF1B + ESCAPE + Keyboard + + + #xFF20 + MULTI-KEY CHARACTER PREFACE + Keyboard + + + #xFF21 + KANJI, KANJI CONVERT + Keyboard + + + #xFF22 + MUHENKAN + Keyboard + + + #xFF23 + HENKAN MODE + Keyboard + + + #xFF24 + ROMAJI + Keyboard + + + #xFF25 + HIRAGANA + Keyboard + + + #xFF26 + KATAKANA + Keyboard + + + #xFF27 + HIRAGANA/KATAKANA TOGGLE + Keyboard + + + #xFF28 + ZENKAKU + Keyboard + + + #xFF29 + HANKAKU + Keyboard + + + #xFF2A + ZENKAKU/HANKAKU TOGGLE + Keyboard + + + #xFF2B + TOUROKU + Keyboard + + + #xFF2C + MASSYO + Keyboard + + + #xFF2D + KANA LOCK + Keyboard + + + #xFF2E + KANA SHIFT + Keyboard + + + #xFF2F + EISU SHIFT + Keyboard + + + #xFF30 + EISU TOGGLE + Keyboard + + + #xFF31 + HANGUL START/STOP (TOGGLE) + Keyboard + + + #xFF32 + HANGUL START + Keyboard + + + #xFF33 + HANGUL END, ENGLISH START + Keyboard + + + #xFF34 + START HANGUL/HANJA CONVERSION + Keyboard + + + #xFF35 + HANGUL JAMO MODE + Keyboard + + + #xFF36 + HANGUL ROMAJA MODE + Keyboard + + + #xFF37 + HANGUL CODE INPUT + Keyboard + + + #xFF38 + HANGUL JEONJA MODE + Keyboard + + + #xFF39 + HANGUL BANJA MODE + Keyboard + + + #xFF3A + HANGUL PREHANJA CONVERSION + Keyboard + + + #xFF3B + HANGUL POSTHANJA CONVERSION + Keyboard + + + #xFF3C + HANGUL SINGLE CANDIDATE + Keyboard + + + #xFF3D + HANGUL MULTIPLE CANDIDATE + Keyboard + + + #xFF3E + HANGUL PREVIOUS CANDIDATE + Keyboard + + + #xFF3F + HANGUL SPECIAL SYMBOLS + Keyboard + + + #xFF50 + HOME + Keyboard + + + #xFF51 + LEFT, MOVE LEFT, LEFT ARROW + Keyboard + + + #xFF52 + UP, MOVE UP, UP ARROW + Keyboard + + + #xFF53 + RIGHT, MOVE RIGHT, RIGHT ARROW + Keyboard + + + #xFF54 + DOWN, MOVE DOWN, DOWN ARROW + Keyboard + + + #xFF55 + PRIOR, PREVIOUS, PAGE UP + Keyboard + + + #xFF56 + NEXT, PAGE DOWN + Keyboard + + + #xFF57 + END, EOL + Keyboard + + + #xFF58 + BEGIN, BOL + Keyboard + + + #xFF60 + SELECT, MARK + Keyboard + + + #xFF61 + PRINT + Keyboard + + + #xFF62 + EXECUTE, RUN, DO + Keyboard + + + #xFF63 + INSERT, INSERT HERE + Keyboard + + + #xFF65 + UNDO, OOPS + Keyboard + + + #xFF66 + REDO, AGAIN + Keyboard + + + #xFF67 + MENU + Keyboard + + + #xFF68 + FIND, SEARCH + Keyboard + + + #xFF69 + CANCEL, STOP, ABORT, EXIT + Keyboard + + + #xFF6A + HELP + Keyboard + + + #xFF6B + BREAK + Keyboard + + + #xFF7E + MODE SWITCH, SCRIPT SWITCH, CHARACTER SET SWITCH + Keyboard + + + #xFF7F + NUM LOCK + Keyboard + + + #xFF80 + KEYPAD SPACE + Keyboard + + + #xFF89 + KEYPAD TAB + Keyboard + + + #xFF8D + KEYPAD ENTER + Keyboard + + + #xFF91 + KEYPAD F1, PF1, A + Keyboard + + + #xFF92 + KEYPAD F2, PF2, B + Keyboard + + + #xFF93 + KEYPAD F3, PF3, C + Keyboard + + + #xFF94 + KEYPAD F4, PF4, D + Keyboard + + + #xFF95 + KEYPAD HOME + Keyboard + + + #xFF96 + KEYPAD LEFT + Keyboard + + + #xFF97 + KEYPAD UP + Keyboard + + + #xFF98 + KEYPAD RIGHT + Keyboard + + + #xFF99 + KEYPAD DOWN + Keyboard + + + #xFF9A + KEYPAD PRIOR, PAGE UP + Keyboard + + + #xFF9B + KEYPAD NEXT, PAGE DOWN + Keyboard + + + #xFF9C + KEYPAD END + Keyboard + + + #xFF9D + KEYPAD BEGIN + Keyboard + + + #xFF9E + KEYPAD INSERT + Keyboard + + + #xFF9F + KEYPAD DELETE + Keyboard + + + #xFFAA + KEYPAD MULTIPLICATION SIGN, ASTERISK + Keyboard + + + #xFFAB + KEYPAD PLUS SIGN + Keyboard + + + #xFFAC + KEYPAD SEPARATOR, COMMA + Keyboard + + + #xFFAD + KEYPAD MINUS SIGN, HYPHEN + Keyboard + + + #xFFAE + KEYPAD DECIMAL POINT, FULL STOP + Keyboard + + + #xFFAF + KEYPAD DIVISION SIGN, SOLIDUS + Keyboard + + + #xFFB0 + KEYPAD DIGIT ZERO + Keyboard + + + #xFFB1 + KEYPAD DIGIT ONE + Keyboard + + + #xFFB2 + KEYPAD DIGIT TWO + Keyboard + + + #xFFB3 + KEYPAD DIGIT THREE + Keyboard + + + #xFFB4 + KEYPAD DIGIT FOUR + Keyboard + + + #xFFB5 + KEYPAD DIGIT FIVE + Keyboard + + + #xFFB6 + KEYPAD DIGIT SIX + Keyboard + + + #xFFB7 + KEYPAD DIGIT SEVEN + Keyboard + + + #xFFB8 + KEYPAD DIGIT EIGHT + Keyboard + + + #xFFB9 + KEYPAD DIGIT NINE + Keyboard + + + #xFFBD + KEYPAD EQUALS SIGN + Keyboard + + + #xFFBE + F1 + Keyboard + + + #xFFBF + F2 + Keyboard + + + #xFFC0 + F3 + Keyboard + + + #xFFC1 + F4 + Keyboard + + + #xFFC2 + F5 + Keyboard + + + #xFFC3 + F6 + Keyboard + + + #xFFC4 + F7 + Keyboard + + + #xFFC5 + F8 + Keyboard + + + #xFFC6 + F9 + Keyboard + + + #xFFC7 + F10 + Keyboard + + + #xFFC8 + F11, L1 + Keyboard + + + #xFFC9 + F12, L2 + Keyboard + + + #xFFCA + F13, L3 + Keyboard + + + #xFFCB + F14, L4 + Keyboard + + + #xFFCC + F15, L5 + Keyboard + + + #xFFCD + F16, L6 + Keyboard + + + #xFFCE + F17, L7 + Keyboard + + + #xFFCF + F18, L8 + Keyboard + + + #xFFD0 + F19, L9 + Keyboard + + + #xFFD1 + F20, L10 + Keyboard + + + #xFFD2 + F21, R1 + Keyboard + + + #xFFD3 + F22, R2 + Keyboard + + + #xFFD4 + F23, R3 + Keyboard + + + #xFFD5 + F24, R4 + Keyboard + + + #xFFD6 + F25, R5 + Keyboard + + + #xFFD7 + F26, R6 + Keyboard + + + #xFFD8 + F27, R7 + Keyboard + + + #xFFD9 + F28, R8 + Keyboard + + + #xFFDA + F29, R9 + Keyboard + + + #xFFDB + F30, R10 + Keyboard + + + #xFFDC + F31, R11 + Keyboard + + + #xFFDD + F32, R12 + Keyboard + + + #xFFDE + F33, R13 + Keyboard + + + #xFFDF + F34, R14 + Keyboard + + + #xFFE0 + F35, R15 + Keyboard + + + #xFFE1 + LEFT SHIFT + Keyboard + + + #xFFE2 + RIGHT SHIFT + Keyboard + + + #xFFE3 + LEFT CONTROL + Keyboard + + + #xFFE4 + RIGHT CONTROL + Keyboard + + + #xFFE5 + CAPS LOCK + Keyboard + + + #xFFE6 + SHIFT LOCK + Keyboard + + + #xFFE7 + LEFT META + Keyboard + + + #xFFE8 + RIGHT META + Keyboard + + + #xFFE9 + LEFT ALT + Keyboard + + + #xFFEA + RIGHT ALT + Keyboard + + + #xFFEB + LEFT SUPER + Keyboard + + + #xFFEC + RIGHT SUPER + Keyboard + + + #xFFED + LEFT HYPER + Keyboard + + + #xFFEE + RIGHT HYPER + Keyboard + + + #xFFFF + DELETE, RUBOUT + Keyboard + + + + + + +The Keyboard (XKB) Extension set, which provides among other things +a range of dead keys, is defined in "The X Keyboard Extension: +Protocol Specification", Appendix C. + + + +The 3270 set defines additional keys that are specific to IBM 3270 +terminals. + + + + + + + + + + KEYSYM value + Name + Set + + + + + #xFD01 + 3270 DUPLICATE + 3270 + + + #xFD02 + 3270 FIELDMARK + 3270 + + + #xFD03 + 3270 RIGHT2 + 3270 + + + #xFD04 + 3270 LEFT2 + 3270 + + + #xFD05 + 3270 BACKTAB + 3270 + + + #xFD06 + 3270 ERASEEOF + 3270 + + + #xFD07 + 3270 ERASEINPUT + 3270 + + + #xFD08 + 3270 RESET + 3270 + + + #xFD09 + 3270 QUIT + 3270 + + + #xFD0A + 3270 PA1 + 3270 + + + #xFD0B + 3270 PA2 + 3270 + + + #xFD0C + 3270 PA3 + 3270 + + + #xFD0D + 3270 TEST + 3270 + + + #xFD0E + 3270 ATTN + 3270 + + + #xFD0F + 3270 CURSORBLINK + 3270 + + + #xFD10 + 3270 ALTCURSOR + 3270 + + + #xFD11 + 3270 KEYCLICK + 3270 + + + #xFD12 + 3270 JUMP + 3270 + + + #xFD13 + 3270 IDENT + 3270 + + + #xFD14 + 3270 RULE + 3270 + + + #xFD15 + 3270 COPY + 3270 + + + #xFD16 + 3270 PLAY + 3270 + + + #xFD17 + 3270 SETUP + 3270 + + + #xFD18 + 3270 RECORD + 3270 + + + #xFD19 + 3270 CHANGESCREEN + 3270 + + + #xFD1A + 3270 DELETEWORD + 3270 + + + #xFD1B + 3270 EXSELECT + 3270 + + + #xFD1C + 3270 CURSORSELECT + 3270 + + + #xFD1D + 3270 PRINTSCREEN + 3270 + + + #xFD1E + 3270 ENTER + 3270 + + + + + + + + +Vendor KEYSYMs + + +The KEYSYM number range #x10000000 to #x1FFFFFFF is available for +vendor-specific extensions. Among these, the range #x11000000 to +#x1100FFFF is designated for keypad KEYSYMs. + + + + +Legacy KEYSYMs + + +These date from the time before ISO 10646 / Unicode was +available. They represent characters from a number of different older +8-bit coded character sets and have zero values for bytes 1 and +2. Byte 3 indicates a coded character set and byte 4 is the 8-bit +value of the particular character within that set. + + + + + + + + + + + Byte 3 + Byte 4 + Byte 3 + Byte 4 + + + + + 1 + Latin-2 + 11 + APL + + + 2 + Latin-3 + 12 + Hebrew + + + 3 + Latin-4 + 13 + Thai + + + 4 + Kana + 14 + Korean + + + 5 + Arabic + 15 + Latin-5 + + + 6 + Cyrillic + 16 + Latin-6 + + + 7 + Greek + 17 + Latin-7 + + + 8 + Technical + 18 + Latin-8 + + + 9 + Special + 19 + Latin-9 + + + 10 + Publishing + 32 + Currency + + + + + + +Each character set contains gaps where codes have been removed that +were duplicates with codes in previous character sets (that is, +character sets with lesser byte 3 value). + + + +The Latin, Arabic, Cyrillic, Greek, Hebrew, and Thai sets were taken +from the early drafts of the relevant ISO 8859 parts available at the +time. However, in the case of the Cyrillic and Greek sets, these +turned out differently in the final versions of the ISO standard. The +Technical, Special, and Publishing sets are based on Digital Equipment +Corporation standards, as no equivalent international standards were +available at the time. + + + +The table below lists all standardized Legacy KEYSYMs, along with the +name used in the source document. Where there exists an unambiguous +equivalent in Unicode, as it is the case with all ISO 8859 characters, +it is given in the second column as a cross reference. Where there is +no Unicode number provided, the exact semantics of the KEYSYM may have +been lost and a Unicode KEYSYM should be used instead, if available. + + + +As support of Unicode KEYSYMs increases, some or all of the Legacy +KEYSYMs may be phased out and withdrawn in future versions of this +standard. Most KEYSYMs in the sets Technical, Special, Publishing, APL +and Currency (with the exception of #x20AC) were probably never used +in practice, and were not supported by pre-Unicode fonts. In +particular, the Currency set, which was copied from Unicode, has +already been deprecated by the introduction of the Unicode KEYSYMs. + + + + + + + + + + + KEYSYM value + Unicode value + Name + Set + + + + + #x01A1 + U+0104 + LATIN CAPITAL LETTER A WITH OGONEK + Latin-2 + + + #x01A2 + U+02D8 + BREVE + Latin-2 + + + #x01A3 + U+0141 + LATIN CAPITAL LETTER L WITH STROKE + Latin-2 + + + #x01A5 + U+013D + LATIN CAPITAL LETTER L WITH CARON + Latin-2 + + + #x01A6 + U+015A + LATIN CAPITAL LETTER S WITH ACUTE + Latin-2 + + + #x01A9 + U+0160 + LATIN CAPITAL LETTER S WITH CARON + Latin-2 + + + #x01AA + U+015E + LATIN CAPITAL LETTER S WITH CEDILLA + Latin-2 + + + #x01AB + U+0164 + LATIN CAPITAL LETTER T WITH CARON + Latin-2 + + + #x01AC + U+0179 + LATIN CAPITAL LETTER Z WITH ACUTE + Latin-2 + + + #x01AE + U+017D + LATIN CAPITAL LETTER Z WITH CARON + Latin-2 + + + #x01AF + U+017B + LATIN CAPITAL LETTER Z WITH DOT ABOVE + Latin-2 + + + #x01B1 + U+0105 + LATIN SMALL LETTER A WITH OGONEK + Latin-2 + + + #x01B2 + U+02DB + OGONEK + Latin-2 + + + #x01B3 + U+0142 + LATIN SMALL LETTER L WITH STROKE + Latin-2 + + + #x01B5 + U+013E + LATIN SMALL LETTER L WITH CARON + Latin-2 + + + #x01B6 + U+015B + LATIN SMALL LETTER S WITH ACUTE + Latin-2 + + + #x01B7 + U+02C7 + CARON + Latin-2 + + + #x01B9 + U+0161 + LATIN SMALL LETTER S WITH CARON + Latin-2 + + + #x01BA + U+015F + LATIN SMALL LETTER S WITH CEDILLA + Latin-2 + + + #x01BB + U+0165 + LATIN SMALL LETTER T WITH CARON + Latin-2 + + + #x01BC + U+017A + LATIN SMALL LETTER Z WITH ACUTE + Latin-2 + + + #x01BD + U+02DD + DOUBLE ACUTE ACCENT + Latin-2 + + + #x01BE + U+017E + LATIN SMALL LETTER Z WITH CARON + Latin-2 + + + #x01BF + U+017C + LATIN SMALL LETTER Z WITH DOT ABOVE + Latin-2 + + + #x01C0 + U+0154 + LATIN CAPITAL LETTER R WITH ACUTE + Latin-2 + + + #x01C3 + U+0102 + LATIN CAPITAL LETTER A WITH BREVE + Latin-2 + + + #x01C5 + U+0139 + LATIN CAPITAL LETTER L WITH ACUTE + Latin-2 + + + #x01C6 + U+0106 + LATIN CAPITAL LETTER C WITH ACUTE + Latin-2 + + + #x01C8 + U+010C + LATIN CAPITAL LETTER C WITH CARON + Latin-2 + + + #x01CA + U+0118 + LATIN CAPITAL LETTER E WITH OGONEK + Latin-2 + + + #x01CC + U+011A + LATIN CAPITAL LETTER E WITH CARON + Latin-2 + + + #x01CF + U+010E + LATIN CAPITAL LETTER D WITH CARON + Latin-2 + + + #x01D0 + U+0110 + LATIN CAPITAL LETTER D WITH STROKE + Latin-2 + + + #x01D1 + U+0143 + LATIN CAPITAL LETTER N WITH ACUTE + Latin-2 + + + #x01D2 + U+0147 + LATIN CAPITAL LETTER N WITH CARON + Latin-2 + + + #x01D5 + U+0150 + LATIN CAPITAL LETTER O WITH DOUBLE ACUTE + Latin-2 + + + #x01D8 + U+0158 + LATIN CAPITAL LETTER R WITH CARON + Latin-2 + + + #x01D9 + U+016E + LATIN CAPITAL LETTER U WITH RING ABOVE + Latin-2 + + + #x01DB + U+0170 + LATIN CAPITAL LETTER U WITH DOUBLE ACUTE + Latin-2 + + + #x01DE + U+0162 + LATIN CAPITAL LETTER T WITH CEDILLA + Latin-2 + + + #x01E0 + U+0155 + LATIN SMALL LETTER R WITH ACUTE + Latin-2 + + + #x01E3 + U+0103 + LATIN SMALL LETTER A WITH BREVE + Latin-2 + + + #x01E5 + U+013A + LATIN SMALL LETTER L WITH ACUTE + Latin-2 + + + #x01E6 + U+0107 + LATIN SMALL LETTER C WITH ACUTE + Latin-2 + + + #x01E8 + U+010D + LATIN SMALL LETTER C WITH CARON + Latin-2 + + + #x01EA + U+0119 + LATIN SMALL LETTER E WITH OGONEK + Latin-2 + + + #x01EC + U+011B + LATIN SMALL LETTER E WITH CARON + Latin-2 + + + #x01EF + U+010F + LATIN SMALL LETTER D WITH CARON + Latin-2 + + + #x01F0 + U+0111 + LATIN SMALL LETTER D WITH STROKE + Latin-2 + + + #x01F1 + U+0144 + LATIN SMALL LETTER N WITH ACUTE + Latin-2 + + + #x01F2 + U+0148 + LATIN SMALL LETTER N WITH CARON + Latin-2 + + + #x01F5 + U+0151 + LATIN SMALL LETTER O WITH DOUBLE ACUTE + Latin-2 + + + #x01F8 + U+0159 + LATIN SMALL LETTER R WITH CARON + Latin-2 + + + #x01F9 + U+016F + LATIN SMALL LETTER U WITH RING ABOVE + Latin-2 + + + #x01FB + U+0171 + LATIN SMALL LETTER U WITH DOUBLE ACUTE + Latin-2 + + + #x01FE + U+0163 + LATIN SMALL LETTER T WITH CEDILLA + Latin-2 + + + #x01FF + U+02D9 + DOT ABOVE + Latin-2 + + + #x02A1 + U+0126 + LATIN CAPITAL LETTER H WITH STROKE + Latin-3 + + + #x02A6 + U+0124 + LATIN CAPITAL LETTER H WITH CIRCUMFLEX + Latin-3 + + + #x02A9 + U+0130 + LATIN CAPITAL LETTER I WITH DOT ABOVE + Latin-3 + + + #x02AB + U+011E + LATIN CAPITAL LETTER G WITH BREVE + Latin-3 + + + #x02AC + U+0134 + LATIN CAPITAL LETTER J WITH CIRCUMFLEX + Latin-3 + + + #x02B1 + U+0127 + LATIN SMALL LETTER H WITH STROKE + Latin-3 + + + #x02B6 + U+0125 + LATIN SMALL LETTER H WITH CIRCUMFLEX + Latin-3 + + + #x02B9 + U+0131 + LATIN SMALL LETTER DOTLESS I + Latin-3 + + + #x02BB + U+011F + LATIN SMALL LETTER G WITH BREVE + Latin-3 + + + #x02BC + U+0135 + LATIN SMALL LETTER J WITH CIRCUMFLEX + Latin-3 + + + #x02C5 + U+010A + LATIN CAPITAL LETTER C WITH DOT ABOVE + Latin-3 + + + #x02C6 + U+0108 + LATIN CAPITAL LETTER C WITH CIRCUMFLEX + Latin-3 + + + #x02D5 + U+0120 + LATIN CAPITAL LETTER G WITH DOT ABOVE + Latin-3 + + + #x02D8 + U+011C + LATIN CAPITAL LETTER G WITH CIRCUMFLEX + Latin-3 + + + #x02DD + U+016C + LATIN CAPITAL LETTER U WITH BREVE + Latin-3 + + + #x02DE + U+015C + LATIN CAPITAL LETTER S WITH CIRCUMFLEX + Latin-3 + + + #x02E5 + U+010B + LATIN SMALL LETTER C WITH DOT ABOVE + Latin-3 + + + #x02E6 + U+0109 + LATIN SMALL LETTER C WITH CIRCUMFLEX + Latin-3 + + + #x02F5 + U+0121 + LATIN SMALL LETTER G WITH DOT ABOVE + Latin-3 + + + #x02F8 + U+011D + LATIN SMALL LETTER G WITH CIRCUMFLEX + Latin-3 + + + #x02FD + U+016D + LATIN SMALL LETTER U WITH BREVE + Latin-3 + + + #x02FE + U+015D + LATIN SMALL LETTER S WITH CIRCUMFLEX + Latin-3 + + + #x03A2 + U+0138 + LATIN SMALL LETTER KRA + Latin-4 + + + #x03A3 + U+0156 + LATIN CAPITAL LETTER R WITH CEDILLA + Latin-4 + + + #x03A5 + U+0128 + LATIN CAPITAL LETTER I WITH TILDE + Latin-4 + + + #x03A6 + U+013B + LATIN CAPITAL LETTER L WITH CEDILLA + Latin-4 + + + #x03AA + U+0112 + LATIN CAPITAL LETTER E WITH MACRON + Latin-4 + + + #x03AB + U+0122 + LATIN CAPITAL LETTER G WITH CEDILLA + Latin-4 + + + #x03AC + U+0166 + LATIN CAPITAL LETTER T WITH STROKE + Latin-4 + + + #x03B3 + U+0157 + LATIN SMALL LETTER R WITH CEDILLA + Latin-4 + + + #x03B5 + U+0129 + LATIN SMALL LETTER I WITH TILDE + Latin-4 + + + #x03B6 + U+013C + LATIN SMALL LETTER L WITH CEDILLA + Latin-4 + + + #x03BA + U+0113 + LATIN SMALL LETTER E WITH MACRON + Latin-4 + + + #x03BB + U+0123 + LATIN SMALL LETTER G WITH CEDILLA + Latin-4 + + + #x03BC + U+0167 + LATIN SMALL LETTER T WITH STROKE + Latin-4 + + + #x03BD + U+014A + LATIN CAPITAL LETTER ENG + Latin-4 + + + #x03BF + U+014B + LATIN SMALL LETTER ENG + Latin-4 + + + #x03C0 + U+0100 + LATIN CAPITAL LETTER A WITH MACRON + Latin-4 + + + #x03C7 + U+012E + LATIN CAPITAL LETTER I WITH OGONEK + Latin-4 + + + #x03CC + U+0116 + LATIN CAPITAL LETTER E WITH DOT ABOVE + Latin-4 + + + #x03CF + U+012A + LATIN CAPITAL LETTER I WITH MACRON + Latin-4 + + + #x03D1 + U+0145 + LATIN CAPITAL LETTER N WITH CEDILLA + Latin-4 + + + #x03D2 + U+014C + LATIN CAPITAL LETTER O WITH MACRON + Latin-4 + + + #x03D3 + U+0136 + LATIN CAPITAL LETTER K WITH CEDILLA + Latin-4 + + + #x03D9 + U+0172 + LATIN CAPITAL LETTER U WITH OGONEK + Latin-4 + + + #x03DD + U+0168 + LATIN CAPITAL LETTER U WITH TILDE + Latin-4 + + + #x03DE + U+016A + LATIN CAPITAL LETTER U WITH MACRON + Latin-4 + + + #x03E0 + U+0101 + LATIN SMALL LETTER A WITH MACRON + Latin-4 + + + #x03E7 + U+012F + LATIN SMALL LETTER I WITH OGONEK + Latin-4 + + + #x03EC + U+0117 + LATIN SMALL LETTER E WITH DOT ABOVE + Latin-4 + + + #x03EF + U+012B + LATIN SMALL LETTER I WITH MACRON + Latin-4 + + + #x03F1 + U+0146 + LATIN SMALL LETTER N WITH CEDILLA + Latin-4 + + + #x03F2 + U+014D + LATIN SMALL LETTER O WITH MACRON + Latin-4 + + + #x03F3 + U+0137 + LATIN SMALL LETTER K WITH CEDILLA + Latin-4 + + + #x03F9 + U+0173 + LATIN SMALL LETTER U WITH OGONEK + Latin-4 + + + #x03FD + U+0169 + LATIN SMALL LETTER U WITH TILDE + Latin-4 + + + #x03FE + U+016B + LATIN SMALL LETTER U WITH MACRON + Latin-4 + + + #x047E + U+203E + OVERLINE + Kana + + + #x04A1 + U+3002 + KANA FULL STOP + Kana + + + #x04A2 + U+300C + KANA OPENING BRACKET + Kana + + + #x04A3 + U+300D + KANA CLOSING BRACKET + Kana + + + #x04A4 + U+3001 + KANA COMMA + Kana + + + #x04A5 + U+30FB + KANA CONJUNCTIVE + Kana + + + #x04A6 + U+30F2 + KANA LETTER WO + Kana + + + #x04A7 + U+30A1 + KANA LETTER SMALL A + Kana + + + #x04A8 + U+30A3 + KANA LETTER SMALL I + Kana + + + #x04A9 + U+30A5 + KANA LETTER SMALL U + Kana + + + #x04AA + U+30A7 + KANA LETTER SMALL E + Kana + + + #x04AB + U+30A9 + KANA LETTER SMALL O + Kana + + + #x04AC + U+30E3 + KANA LETTER SMALL YA + Kana + + + #x04AD + U+30E5 + KANA LETTER SMALL YU + Kana + + + #x04AE + U+30E7 + KANA LETTER SMALL YO + Kana + + + #x04AF + U+30C3 + KANA LETTER SMALL TSU + Kana + + + #x04B0 + U+30FC + PROLONGED SOUND SYMBOL + Kana + + + #x04B1 + U+30A2 + KANA LETTER A + Kana + + + #x04B2 + U+30A4 + KANA LETTER I + Kana + + + #x04B3 + U+30A6 + KANA LETTER U + Kana + + + #x04B4 + U+30A8 + KANA LETTER E + Kana + + + #x04B5 + U+30AA + KANA LETTER O + Kana + + + #x04B6 + U+30AB + KANA LETTER KA + Kana + + + #x04B7 + U+30AD + KANA LETTER KI + Kana + + + #x04B8 + U+30AF + KANA LETTER KU + Kana + + + #x04B9 + U+30B1 + KANA LETTER KE + Kana + + + #x04BA + U+30B3 + KANA LETTER KO + Kana + + + #x04BB + U+30B5 + KANA LETTER SA + Kana + + + #x04BC + U+30B7 + KANA LETTER SHI + Kana + + + #x04BD + U+30B9 + KANA LETTER SU + Kana + + + #x04BE + U+30BB + KANA LETTER SE + Kana + + + #x04BF + U+30BD + KANA LETTER SO + Kana + + + #x04C0 + U+30BF + KANA LETTER TA + Kana + + + #x04C1 + U+30C1 + KANA LETTER CHI + Kana + + + #x04C2 + U+30C4 + KANA LETTER TSU + Kana + + + #x04C3 + U+30C6 + KANA LETTER TE + Kana + + + #x04C4 + U+30C8 + KANA LETTER TO + Kana + + + #x04C5 + U+30CA + KANA LETTER NA + Kana + + + #x04C6 + U+30CB + KANA LETTER NI + Kana + + + #x04C7 + U+30CC + KANA LETTER NU + Kana + + + #x04C8 + U+30CD + KANA LETTER NE + Kana + + + #x04C9 + U+30CE + KANA LETTER NO + Kana + + + #x04CA + U+30CF + KANA LETTER HA + Kana + + + #x04CB + U+30D2 + KANA LETTER HI + Kana + + + #x04CC + U+30D5 + KANA LETTER FU + Kana + + + #x04CD + U+30D8 + KANA LETTER HE + Kana + + + #x04CE + U+30DB + KANA LETTER HO + Kana + + + #x04CF + U+30DE + KANA LETTER MA + Kana + + + #x04D0 + U+30DF + KANA LETTER MI + Kana + + + #x04D1 + U+30E0 + KANA LETTER MU + Kana + + + #x04D2 + U+30E1 + KANA LETTER ME + Kana + + + #x04D3 + U+30E2 + KANA LETTER MO + Kana + + + #x04D4 + U+30E4 + KANA LETTER YA + Kana + + + #x04D5 + U+30E6 + KANA LETTER YU + Kana + + + #x04D6 + U+30E8 + KANA LETTER YO + Kana + + + #x04D7 + U+30E9 + KANA LETTER RA + Kana + + + #x04D8 + U+30EA + KANA LETTER RI + Kana + + + #x04D9 + U+30EB + KANA LETTER RU + Kana + + + #x04DA + U+30EC + KANA LETTER RE + Kana + + + #x04DB + U+30ED + KANA LETTER RO + Kana + + + #x04DC + U+30EF + KANA LETTER WA + Kana + + + #x04DD + U+30F3 + KANA LETTER N + Kana + + + #x04DE + U+309B + VOICED SOUND SYMBOL + Kana + + + #x04DF + U+309C + SEMIVOICED SOUND SYMBOL + Kana + + + #x05AC + U+060C + ARABIC COMMA + Arabic + + + #x05BB + U+061B + ARABIC SEMICOLON + Arabic + + + #x05BF + U+061F + ARABIC QUESTION MARK + Arabic + + + #x05C1 + U+0621 + ARABIC LETTER HAMZA + Arabic + + + #x05C2 + U+0622 + ARABIC LETTER ALEF WITH MADDA ABOVE + Arabic + + + #x05C3 + U+0623 + ARABIC LETTER ALEF WITH HAMZA ABOVE + Arabic + + + #x05C4 + U+0624 + ARABIC LETTER WAW WITH HAMZA ABOVE + Arabic + + + #x05C5 + U+0625 + ARABIC LETTER ALEF WITH HAMZA BELOW + Arabic + + + #x05C6 + U+0626 + ARABIC LETTER YEH WITH HAMZA ABOVE + Arabic + + + #x05C7 + U+0627 + ARABIC LETTER ALEF + Arabic + + + #x05C8 + U+0628 + ARABIC LETTER BEH + Arabic + + + #x05C9 + U+0629 + ARABIC LETTER TEH MARBUTA + Arabic + + + #x05CA + U+062A + ARABIC LETTER TEH + Arabic + + + #x05CB + U+062B + ARABIC LETTER THEH + Arabic + + + #x05CC + U+062C + ARABIC LETTER JEEM + Arabic + + + #x05CD + U+062D + ARABIC LETTER HAH + Arabic + + + #x05CE + U+062E + ARABIC LETTER KHAH + Arabic + + + #x05CF + U+062F + ARABIC LETTER DAL + Arabic + + + #x05D0 + U+0630 + ARABIC LETTER THAL + Arabic + + + #x05D1 + U+0631 + ARABIC LETTER REH + Arabic + + + #x05D2 + U+0632 + ARABIC LETTER ZAIN + Arabic + + + #x05D3 + U+0633 + ARABIC LETTER SEEN + Arabic + + + #x05D4 + U+0634 + ARABIC LETTER SHEEN + Arabic + + + #x05D5 + U+0635 + ARABIC LETTER SAD + Arabic + + + #x05D6 + U+0636 + ARABIC LETTER DAD + Arabic + + + #x05D7 + U+0637 + ARABIC LETTER TAH + Arabic + + + #x05D8 + U+0638 + ARABIC LETTER ZAH + Arabic + + + #x05D9 + U+0639 + ARABIC LETTER AIN + Arabic + + + #x05DA + U+063A + ARABIC LETTER GHAIN + Arabic + + + #x05E0 + U+0640 + ARABIC TATWEEL + Arabic + + + #x05E1 + U+0641 + ARABIC LETTER FEH + Arabic + + + #x05E2 + U+0642 + ARABIC LETTER QAF + Arabic + + + #x05E3 + U+0643 + ARABIC LETTER KAF + Arabic + + + #x05E4 + U+0644 + ARABIC LETTER LAM + Arabic + + + #x05E5 + U+0645 + ARABIC LETTER MEEM + Arabic + + + #x05E6 + U+0646 + ARABIC LETTER NOON + Arabic + + + #x05E7 + U+0647 + ARABIC LETTER HEH + Arabic + + + #x05E8 + U+0648 + ARABIC LETTER WAW + Arabic + + + #x05E9 + U+0649 + ARABIC LETTER ALEF MAKSURA + Arabic + + + #x05EA + U+064A + ARABIC LETTER YEH + Arabic + + + #x05EB + U+064B + ARABIC FATHATAN + Arabic + + + #x05EC + U+064C + ARABIC DAMMATAN + Arabic + + + #x05ED + U+064D + ARABIC KASRATAN + Arabic + + + #x05EE + U+064E + ARABIC FATHA + Arabic + + + #x05EF + U+064F + ARABIC DAMMA + Arabic + + + #x05F0 + U+0650 + ARABIC KASRA + Arabic + + + #x05F1 + U+0651 + ARABIC SHADDA + Arabic + + + #x05F2 + U+0652 + ARABIC SUKUN + Arabic + + + #x06A1 + U+0452 + CYRILLIC SMALL LETTER DJE + Cyrillic + + + #x06A2 + U+0453 + CYRILLIC SMALL LETTER GJE + Cyrillic + + + #x06A3 + U+0451 + CYRILLIC SMALL LETTER IO + Cyrillic + + + #x06A4 + U+0454 + CYRILLIC SMALL LETTER UKRAINIAN IE + Cyrillic + + + #x06A5 + U+0455 + CYRILLIC SMALL LETTER DZE + Cyrillic + + + #x06A6 + U+0456 + CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I + Cyrillic + + + #x06A7 + U+0457 + CYRILLIC SMALL LETTER YI + Cyrillic + + + #x06A8 + U+0458 + CYRILLIC SMALL LETTER JE + Cyrillic + + + #x06A9 + U+0459 + CYRILLIC SMALL LETTER LJE + Cyrillic + + + #x06AA + U+045A + CYRILLIC SMALL LETTER NJE + Cyrillic + + + #x06AB + U+045B + CYRILLIC SMALL LETTER TSHE + Cyrillic + + + #x06AC + U+045C + CYRILLIC SMALL LETTER KJE + Cyrillic + + + #x06AD + U+0491 + CYRILLIC SMALL LETTER GHE WITH UPTURN + Cyrillic + + + #x06AE + U+045E + CYRILLIC SMALL LETTER SHORT U + Cyrillic + + + #x06AF + U+045F + CYRILLIC SMALL LETTER DZHE + Cyrillic + + + #x06B0 + U+2116 + NUMERO SIGN + Cyrillic + + + #x06B1 + U+0402 + CYRILLIC CAPITAL LETTER DJE + Cyrillic + + + #x06B2 + U+0403 + CYRILLIC CAPITAL LETTER GJE + Cyrillic + + + #x06B3 + U+0401 + CYRILLIC CAPITAL LETTER IO + Cyrillic + + + #x06B4 + U+0404 + CYRILLIC CAPITAL LETTER UKRAINIAN IE + Cyrillic + + + #x06B5 + U+0405 + CYRILLIC CAPITAL LETTER DZE + Cyrillic + + + #x06B6 + U+0406 + CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I + Cyrillic + + + #x06B7 + U+0407 + CYRILLIC CAPITAL LETTER YI + Cyrillic + + + #x06B8 + U+0408 + CYRILLIC CAPITAL LETTER JE + Cyrillic + + + #x06B9 + U+0409 + CYRILLIC CAPITAL LETTER LJE + Cyrillic + + + #x06BA + U+040A + CYRILLIC CAPITAL LETTER NJE + Cyrillic + + + #x06BB + U+040B + CYRILLIC CAPITAL LETTER TSHE + Cyrillic + + + #x06BC + U+040C + CYRILLIC CAPITAL LETTER KJE + Cyrillic + + + #x06BD + U+0490 + CYRILLIC CAPITAL LETTER GHE WITH UPTURN + Cyrillic + + + #x06BE + U+040E + CYRILLIC CAPITAL LETTER SHORT U + Cyrillic + + + #x06BF + U+040F + CYRILLIC CAPITAL LETTER DZHE + Cyrillic + + + #x06C0 + U+044E + CYRILLIC SMALL LETTER YU + Cyrillic + + + #x06C1 + U+0430 + CYRILLIC SMALL LETTER A + Cyrillic + + + #x06C2 + U+0431 + CYRILLIC SMALL LETTER BE + Cyrillic + + + #x06C3 + U+0446 + CYRILLIC SMALL LETTER TSE + Cyrillic + + + #x06C4 + U+0434 + CYRILLIC SMALL LETTER DE + Cyrillic + + + #x06C5 + U+0435 + CYRILLIC SMALL LETTER IE + Cyrillic + + + #x06C6 + U+0444 + CYRILLIC SMALL LETTER EF + Cyrillic + + + #x06C7 + U+0433 + CYRILLIC SMALL LETTER GHE + Cyrillic + + + #x06C8 + U+0445 + CYRILLIC SMALL LETTER HA + Cyrillic + + + #x06C9 + U+0438 + CYRILLIC SMALL LETTER I + Cyrillic + + + #x06CA + U+0439 + CYRILLIC SMALL LETTER SHORT I + Cyrillic + + + #x06CB + U+043A + CYRILLIC SMALL LETTER KA + Cyrillic + + + #x06CC + U+043B + CYRILLIC SMALL LETTER EL + Cyrillic + + + #x06CD + U+043C + CYRILLIC SMALL LETTER EM + Cyrillic + + + #x06CE + U+043D + CYRILLIC SMALL LETTER EN + Cyrillic + + + #x06CF + U+043E + CYRILLIC SMALL LETTER O + Cyrillic + + + #x06D0 + U+043F + CYRILLIC SMALL LETTER PE + Cyrillic + + + #x06D1 + U+044F + CYRILLIC SMALL LETTER YA + Cyrillic + + + #x06D2 + U+0440 + CYRILLIC SMALL LETTER ER + Cyrillic + + + #x06D3 + U+0441 + CYRILLIC SMALL LETTER ES + Cyrillic + + + #x06D4 + U+0442 + CYRILLIC SMALL LETTER TE + Cyrillic + + + #x06D5 + U+0443 + CYRILLIC SMALL LETTER U + Cyrillic + + + #x06D6 + U+0436 + CYRILLIC SMALL LETTER ZHE + Cyrillic + + + #x06D7 + U+0432 + CYRILLIC SMALL LETTER VE + Cyrillic + + + #x06D8 + U+044C + CYRILLIC SMALL LETTER SOFT SIGN + Cyrillic + + + #x06D9 + U+044B + CYRILLIC SMALL LETTER YERU + Cyrillic + + + #x06DA + U+0437 + CYRILLIC SMALL LETTER ZE + Cyrillic + + + #x06DB + U+0448 + CYRILLIC SMALL LETTER SHA + Cyrillic + + + #x06DC + U+044D + CYRILLIC SMALL LETTER E + Cyrillic + + + #x06DD + U+0449 + CYRILLIC SMALL LETTER SHCHA + Cyrillic + + + #x06DE + U+0447 + CYRILLIC SMALL LETTER CHE + Cyrillic + + + #x06DF + U+044A + CYRILLIC SMALL LETTER HARD SIGN + Cyrillic + + + #x06E0 + U+042E + CYRILLIC CAPITAL LETTER YU + Cyrillic + + + #x06E1 + U+0410 + CYRILLIC CAPITAL LETTER A + Cyrillic + + + #x06E2 + U+0411 + CYRILLIC CAPITAL LETTER BE + Cyrillic + + + #x06E3 + U+0426 + CYRILLIC CAPITAL LETTER TSE + Cyrillic + + + #x06E4 + U+0414 + CYRILLIC CAPITAL LETTER DE + Cyrillic + + + #x06E5 + U+0415 + CYRILLIC CAPITAL LETTER IE + Cyrillic + + + #x06E6 + U+0424 + CYRILLIC CAPITAL LETTER EF + Cyrillic + + + #x06E7 + U+0413 + CYRILLIC CAPITAL LETTER GHE + Cyrillic + + + #x06E8 + U+0425 + CYRILLIC CAPITAL LETTER HA + Cyrillic + + + #x06E9 + U+0418 + CYRILLIC CAPITAL LETTER I + Cyrillic + + + #x06EA + U+0419 + CYRILLIC CAPITAL LETTER SHORT I + Cyrillic + + + #x06EB + U+041A + CYRILLIC CAPITAL LETTER KA + Cyrillic + + + #x06EC + U+041B + CYRILLIC CAPITAL LETTER EL + Cyrillic + + + #x06ED + U+041C + CYRILLIC CAPITAL LETTER EM + Cyrillic + + + #x06EE + U+041D + CYRILLIC CAPITAL LETTER EN + Cyrillic + + + #x06EF + U+041E + CYRILLIC CAPITAL LETTER O + Cyrillic + + + #x06F0 + U+041F + CYRILLIC CAPITAL LETTER PE + Cyrillic + + + #x06F1 + U+042F + CYRILLIC CAPITAL LETTER YA + Cyrillic + + + #x06F2 + U+0420 + CYRILLIC CAPITAL LETTER ER + Cyrillic + + + #x06F3 + U+0421 + CYRILLIC CAPITAL LETTER ES + Cyrillic + + + #x06F4 + U+0422 + CYRILLIC CAPITAL LETTER TE + Cyrillic + + + #x06F5 + U+0423 + CYRILLIC CAPITAL LETTER U + Cyrillic + + + #x06F6 + U+0416 + CYRILLIC CAPITAL LETTER ZHE + Cyrillic + + + #x06F7 + U+0412 + CYRILLIC CAPITAL LETTER VE + Cyrillic + + + #x06F8 + U+042C + CYRILLIC CAPITAL LETTER SOFT SIGN + Cyrillic + + + #x06F9 + U+042B + CYRILLIC CAPITAL LETTER YERU + Cyrillic + + + #x06FA + U+0417 + CYRILLIC CAPITAL LETTER ZE + Cyrillic + + + #x06FB + U+0428 + CYRILLIC CAPITAL LETTER SHA + Cyrillic + + + #x06FC + U+042D + CYRILLIC CAPITAL LETTER E + Cyrillic + + + #x06FD + U+0429 + CYRILLIC CAPITAL LETTER SHCHA + Cyrillic + + + #x06FE + U+0427 + CYRILLIC CAPITAL LETTER CHE + Cyrillic + + + #x06FF + U+042A + CYRILLIC CAPITAL LETTER HARD SIGN + Cyrillic + + + #x07A1 + U+0386 + GREEK CAPITAL LETTER ALPHA WITH TONOS + Greek + + + #x07A2 + U+0388 + GREEK CAPITAL LETTER EPSILON WITH TONOS + Greek + + + #x07A3 + U+0389 + GREEK CAPITAL LETTER ETA WITH TONOS + Greek + + + #x07A4 + U+038A + GREEK CAPITAL LETTER IOTA WITH TONOS + Greek + + + #x07A5 + U+03AA + GREEK CAPITAL LETTER IOTA WITH DIALYTIKA + Greek + + + #x07A7 + U+038C + GREEK CAPITAL LETTER OMICRON WITH TONOS + Greek + + + #x07A8 + U+038E + GREEK CAPITAL LETTER UPSILON WITH TONOS + Greek + + + #x07A9 + U+03AB + GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA + Greek + + + #x07AB + U+038F + GREEK CAPITAL LETTER OMEGA WITH TONOS + Greek + + + #x07AE + U+0385 + GREEK DIALYTIKA TONOS + Greek + + + #x07AF + U+2015 + HORIZONTAL BAR + Greek + + + #x07B1 + U+03AC + GREEK SMALL LETTER ALPHA WITH TONOS + Greek + + + #x07B2 + U+03AD + GREEK SMALL LETTER EPSILON WITH TONOS + Greek + + + #x07B3 + U+03AE + GREEK SMALL LETTER ETA WITH TONOS + Greek + + + #x07B4 + U+03AF + GREEK SMALL LETTER IOTA WITH TONOS + Greek + + + #x07B5 + U+03CA + GREEK SMALL LETTER IOTA WITH DIALYTIKA + Greek + + + #x07B6 + U+0390 + GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS + Greek + + + #x07B7 + U+03CC + GREEK SMALL LETTER OMICRON WITH TONOS + Greek + + + #x07B8 + U+03CD + GREEK SMALL LETTER UPSILON WITH TONOS + Greek + + + #x07B9 + U+03CB + GREEK SMALL LETTER UPSILON WITH DIALYTIKA + Greek + + + #x07BA + U+03B0 + GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS + Greek + + + #x07BB + U+03CE + GREEK SMALL LETTER OMEGA WITH TONOS + Greek + + + #x07C1 + U+0391 + GREEK CAPITAL LETTER ALPHA + Greek + + + #x07C2 + U+0392 + GREEK CAPITAL LETTER BETA + Greek + + + #x07C3 + U+0393 + GREEK CAPITAL LETTER GAMMA + Greek + + + #x07C4 + U+0394 + GREEK CAPITAL LETTER DELTA + Greek + + + #x07C5 + U+0395 + GREEK CAPITAL LETTER EPSILON + Greek + + + #x07C6 + U+0396 + GREEK CAPITAL LETTER ZETA + Greek + + + #x07C7 + U+0397 + GREEK CAPITAL LETTER ETA + Greek + + + #x07C8 + U+0398 + GREEK CAPITAL LETTER THETA + Greek + + + #x07C9 + U+0399 + GREEK CAPITAL LETTER IOTA + Greek + + + #x07CA + U+039A + GREEK CAPITAL LETTER KAPPA + Greek + + + #x07CB + U+039B + GREEK CAPITAL LETTER LAMDA + Greek + + + #x07CC + U+039C + GREEK CAPITAL LETTER MU + Greek + + + #x07CD + U+039D + GREEK CAPITAL LETTER NU + Greek + + + #x07CE + U+039E + GREEK CAPITAL LETTER XI + Greek + + + #x07CF + U+039F + GREEK CAPITAL LETTER OMICRON + Greek + + + #x07D0 + U+03A0 + GREEK CAPITAL LETTER PI + Greek + + + #x07D1 + U+03A1 + GREEK CAPITAL LETTER RHO + Greek + + + #x07D2 + U+03A3 + GREEK CAPITAL LETTER SIGMA + Greek + + + #x07D4 + U+03A4 + GREEK CAPITAL LETTER TAU + Greek + + + #x07D5 + U+03A5 + GREEK CAPITAL LETTER UPSILON + Greek + + + #x07D6 + U+03A6 + GREEK CAPITAL LETTER PHI + Greek + + + #x07D7 + U+03A7 + GREEK CAPITAL LETTER CHI + Greek + + + #x07D8 + U+03A8 + GREEK CAPITAL LETTER PSI + Greek + + + #x07D9 + U+03A9 + GREEK CAPITAL LETTER OMEGA + Greek + + + #x07E1 + U+03B1 + GREEK SMALL LETTER ALPHA + Greek + + + #x07E2 + U+03B2 + GREEK SMALL LETTER BETA + Greek + + + #x07E3 + U+03B3 + GREEK SMALL LETTER GAMMA + Greek + + + #x07E4 + U+03B4 + GREEK SMALL LETTER DELTA + Greek + + + #x07E5 + U+03B5 + GREEK SMALL LETTER EPSILON + Greek + + + #x07E6 + U+03B6 + GREEK SMALL LETTER ZETA + Greek + + + #x07E7 + U+03B7 + GREEK SMALL LETTER ETA + Greek + + + #x07E8 + U+03B8 + GREEK SMALL LETTER THETA + Greek + + + #x07E9 + U+03B9 + GREEK SMALL LETTER IOTA + Greek + + + #x07EA + U+03BA + GREEK SMALL LETTER KAPPA + Greek + + + #x07EB + U+03BB + GREEK SMALL LETTER LAMDA + Greek + + + #x07EC + U+03BC + GREEK SMALL LETTER MU + Greek + + + #x07ED + U+03BD + GREEK SMALL LETTER NU + Greek + + + #x07EE + U+03BE + GREEK SMALL LETTER XI + Greek + + + #x07EF + U+03BF + GREEK SMALL LETTER OMICRON + Greek + + + #x07F0 + U+03C0 + GREEK SMALL LETTER PI + Greek + + + #x07F1 + U+03C1 + GREEK SMALL LETTER RHO + Greek + + + #x07F2 + U+03C3 + GREEK SMALL LETTER SIGMA + Greek + + + #x07F3 + U+03C2 + GREEK SMALL LETTER FINAL SIGMA + Greek + + + #x07F4 + U+03C4 + GREEK SMALL LETTER TAU + Greek + + + #x07F5 + U+03C5 + GREEK SMALL LETTER UPSILON + Greek + + + #x07F6 + U+03C6 + GREEK SMALL LETTER PHI + Greek + + + #x07F7 + U+03C7 + GREEK SMALL LETTER CHI + Greek + + + #x07F8 + U+03C8 + GREEK SMALL LETTER PSI + Greek + + + #x07F9 + U+03C9 + GREEK SMALL LETTER OMEGA + Greek + + + #x08A1 + U+23B7 + LEFT RADICAL + Technical + + + #x08A2 + - + TOP LEFT RADICAL + Technical + + + #x08A3 + - + HORIZONTAL CONNECTOR + Technical + + + #x08A4 + U+2320 + TOP INTEGRAL + Technical + + + #x08A5 + U+2321 + BOTTOM INTEGRAL + Technical + + + #x08A6 + - + VERTICAL CONNECTOR + Technical + + + #x08A7 + U+23A1 + TOP LEFT SQUARE BRACKET + Technical + + + #x08A8 + U+23A3 + BOTTOM LEFT SQUARE BRACKET + Technical + + + #x08A9 + U+23A4 + TOP RIGHT SQUARE BRACKET + Technical + + + #x08AA + U+23A6 + BOTTOM RIGHT SQUARE BRACKET + Technical + + + #x08AB + U+239B + TOP LEFT PARENTHESIS + Technical + + + #x08AC + U+239D + BOTTOM LEFT PARENTHESIS + Technical + + + #x08AD + U+239E + TOP RIGHT PARENTHESIS + Technical + + + #x08AE + U+23A0 + BOTTOM RIGHT PARENTHESIS + Technical + + + #x08AF + U+23A8 + LEFT MIDDLE CURLY BRACE + Technical + + + #x08B0 + U+23AC + RIGHT MIDDLE CURLY BRACE + Technical + + + #x08B1 + - + TOP LEFT SUMMATION + Technical + + + #x08B2 + - + BOTTOM LEFT SUMMATION + Technical + + + #x08B3 + - + TOP VERTICAL SUMMATION CONNECTOR + Technical + + + #x08B4 + - + BOTTOM VERTICAL SUMMATION CONNECTOR + Technical + + + #x08B5 + - + TOP RIGHT SUMMATION + Technical + + + #x08B6 + - + BOTTOM RIGHT SUMMATION + Technical + + + #x08B7 + - + RIGHT MIDDLE SUMMATION + Technical + + + #x08BC + U+2264 + LESS THAN OR EQUAL SIGN + Technical + + + #x08BD + U+2260 + NOT EQUAL SIGN + Technical + + + #x08BE + U+2265 + GREATER THAN OR EQUAL SIGN + Technical + + + #x08BF + U+222B + INTEGRAL + Technical + + + #x08C0 + U+2234 + THEREFORE + Technical + + + #x08C1 + U+221D + VARIATION, PROPORTIONAL TO + Technical + + + #x08C2 + U+221E + INFINITY + Technical + + + #x08C5 + U+2207 + NABLA, DEL + Technical + + + #x08C8 + U+223C + IS APPROXIMATE TO + Technical + + + #x08C9 + U+2243 + SIMILAR OR EQUAL TO + Technical + + + #x08CD + U+21D4 + IF AND ONLY IF + Technical + + + #x08CE + U+21D2 + IMPLIES + Technical + + + #x08CF + U+2261 + IDENTICAL TO + Technical + + + #x08D6 + U+221A + RADICAL + Technical + + + #x08DA + U+2282 + IS INCLUDED IN + Technical + + + #x08DB + U+2283 + INCLUDES + Technical + + + #x08DC + U+2229 + INTERSECTION + Technical + + + #x08DD + U+222A + UNION + Technical + + + #x08DE + U+2227 + LOGICAL AND + Technical + + + #x08DF + U+2228 + LOGICAL OR + Technical + + + #x08EF + U+2202 + PARTIAL DERIVATIVE + Technical + + + #x08F6 + U+0192 + FUNCTION + Technical + + + #x08FB + U+2190 + LEFT ARROW + Technical + + + #x08FC + U+2191 + UPWARD ARROW + Technical + + + #x08FD + U+2192 + RIGHT ARROW + Technical + + + #x08FE + U+2193 + DOWNWARD ARROW + Technical + + + #x09DF + - + BLANK + Special + + + #x09E0 + U+25C6 + SOLID DIAMOND + Special + + + #x09E1 + U+2592 + CHECKERBOARD + Special + + + #x09E2 + U+2409 + "HT" + Special + + + #x09E3 + U+240C + "FF" + Special + + + #x09E4 + U+240D + "CR" + Special + + + #x09E5 + U+240A + "LF" + Special + + + #x09E8 + U+2424 + "NL" + Special + + + #x09E9 + U+240B + "VT" + Special + + + #x09EA + U+2518 + LOWER-RIGHT CORNER + Special + + + #x09EB + U+2510 + UPPER-RIGHT CORNER + Special + + + #x09EC + U+250C + UPPER-LEFT CORNER + Special + + + #x09ED + U+2514 + LOWER-LEFT CORNER + Special + + + #x09EE + U+253C + CROSSING-LINES + Special + + + #x09EF + U+23BA + HORIZONTAL LINE, SCAN 1 + Special + + + #x09F0 + U+23BB + HORIZONTAL LINE, SCAN 3 + Special + + + #x09F1 + U+2500 + HORIZONTAL LINE, SCAN 5 + Special + + + #x09F2 + U+23BC + HORIZONTAL LINE, SCAN 7 + Special + + + #x09F3 + U+23BD + HORIZONTAL LINE, SCAN 9 + Special + + + #x09F4 + U+251C + LEFT "T" + Special + + + #x09F5 + U+2524 + RIGHT "T" + Special + + + #x09F6 + U+2534 + BOTTOM "T" + Special + + + #x09F7 + U+252C + TOP "T" + Special + + + #x09F8 + U+2502 + VERTICAL BAR + Special + + + #x0AA1 + U+2003 + EM SPACE + Publish + + + #x0AA2 + U+2002 + EN SPACE + Publish + + + #x0AA3 + U+2004 + 3/EM SPACE + Publish + + + #x0AA4 + U+2005 + 4/EM SPACE + Publish + + + #x0AA5 + U+2007 + DIGIT SPACE + Publish + + + #x0AA6 + U+2008 + PUNCTUATION SPACE + Publish + + + #x0AA7 + U+2009 + THIN SPACE + Publish + + + #x0AA8 + U+200A + HAIR SPACE + Publish + + + #x0AA9 + U+2014 + EM DASH + Publish + + + #x0AAA + U+2013 + EN DASH + Publish + + + #x0AAC + - + SIGNIFICANT BLANK SYMBOL + Publish + + + #x0AAE + U+2026 + ELLIPSIS + Publish + + + #x0AAF + U+2025 + DOUBLE BASELINE DOT + Publish + + + #x0AB0 + U+2153 + VULGAR FRACTION ONE THIRD + Publish + + + #x0AB1 + U+2154 + VULGAR FRACTION TWO THIRDS + Publish + + + #x0AB2 + U+2155 + VULGAR FRACTION ONE FIFTH + Publish + + + #x0AB3 + U+2156 + VULGAR FRACTION TWO FIFTHS + Publish + + + #x0AB4 + U+2157 + VULGAR FRACTION THREE FIFTHS + Publish + + + #x0AB5 + U+2158 + VULGAR FRACTION FOUR FIFTHS + Publish + + + #x0AB6 + U+2159 + VULGAR FRACTION ONE SIXTH + Publish + + + #x0AB7 + U+215A + VULGAR FRACTION FIVE SIXTHS + Publish + + + #x0AB8 + U+2105 + CARE OF + Publish + + + #x0ABB + U+2012 + FIGURE DASH + Publish + + + #x0ABC + - + LEFT ANGLE BRACKET + Publish + + + #x0ABD + - + DECIMAL POINT + Publish + + + #x0ABE + - + RIGHT ANGLE BRACKET + Publish + + + #x0ABF + - + MARKER + Publish + + + #x0AC3 + U+215B + VULGAR FRACTION ONE EIGHTH + Publish + + + #x0AC4 + U+215C + VULGAR FRACTION THREE EIGHTHS + Publish + + + #x0AC5 + U+215D + VULGAR FRACTION FIVE EIGHTHS + Publish + + + #x0AC6 + U+215E + VULGAR FRACTION SEVEN EIGHTHS + Publish + + + #x0AC9 + U+2122 + TRADEMARK SIGN + Publish + + + #x0ACA + - + SIGNATURE MARK + Publish + + + #x0ACB + - + TRADEMARK SIGN IN CIRCLE + Publish + + + #x0ACC + - + LEFT OPEN TRIANGLE + Publish + + + #x0ACD + - + RIGHT OPEN TRIANGLE + Publish + + + #x0ACE + - + EM OPEN CIRCLE + Publish + + + #x0ACF + - + EM OPEN RECTANGLE + Publish + + + #x0AD0 + U+2018 + LEFT SINGLE QUOTATION MARK + Publish + + + #x0AD1 + U+2019 + RIGHT SINGLE QUOTATION MARK + Publish + + + #x0AD2 + U+201C + LEFT DOUBLE QUOTATION MARK + Publish + + + #x0AD3 + U+201D + RIGHT DOUBLE QUOTATION MARK + Publish + + + #x0AD4 + U+211E + PRESCRIPTION, TAKE, RECIPE + Publish + + + #x0AD5 + U+2030 + PER MILLE SIGN + Publish + + + #x0AD6 + U+2032 + MINUTES + Publish + + + #x0AD7 + U+2033 + SECONDS + Publish + + + #x0AD9 + U+271D + LATIN CROSS + Publish + + + #x0ADA + - + HEXAGRAM + Publish + + + #x0ADB + - + FILLED RECTANGLE BULLET + Publish + + + #x0ADC + - + FILLED LEFT TRIANGLE BULLET + Publish + + + #x0ADD + - + FILLED RIGHT TRIANGLE BULLET + Publish + + + #x0ADE + - + EM FILLED CIRCLE + Publish + + + #x0ADF + - + EM FILLED RECTANGLE + Publish + + + #x0AE0 + - + EN OPEN CIRCLE BULLET + Publish + + + #x0AE1 + - + EN OPEN SQUARE BULLET + Publish + + + #x0AE2 + - + OPEN RECTANGULAR BULLET + Publish + + + #x0AE3 + - + OPEN TRIANGULAR BULLET UP + Publish + + + #x0AE4 + - + OPEN TRIANGULAR BULLET DOWN + Publish + + + #x0AE5 + - + OPEN STAR + Publish + + + #x0AE6 + - + EN FILLED CIRCLE BULLET + Publish + + + #x0AE7 + - + EN FILLED SQUARE BULLET + Publish + + + #x0AE8 + - + FILLED TRIANGULAR BULLET UP + Publish + + + #x0AE9 + - + FILLED TRIANGULAR BULLET DOWN + Publish + + + #x0AEA + - + LEFT POINTER + Publish + + + #x0AEB + - + RIGHT POINTER + Publish + + + #x0AEC + U+2663 + CLUB + Publish + + + #x0AED + U+2666 + DIAMOND + Publish + + + #x0AEE + U+2665 + HEART + Publish + + + #x0AF0 + U+2720 + MALTESE CROSS + Publish + + + #x0AF1 + U+2020 + DAGGER + Publish + + + #x0AF2 + U+2021 + DOUBLE DAGGER + Publish + + + #x0AF3 + U+2713 + CHECK MARK, TICK + Publish + + + #x0AF4 + U+2717 + BALLOT CROSS + Publish + + + #x0AF5 + U+266F + MUSICAL SHARP + Publish + + + #x0AF6 + U+266D + MUSICAL FLAT + Publish + + + #x0AF7 + U+2642 + MALE SYMBOL + Publish + + + #x0AF8 + U+2640 + FEMALE SYMBOL + Publish + + + #x0AF9 + U+260E + TELEPHONE SYMBOL + Publish + + + #x0AFA + U+2315 + TELEPHONE RECORDER SYMBOL + Publish + + + #x0AFB + U+2117 + PHONOGRAPH COPYRIGHT SIGN + Publish + + + #x0AFC + U+2038 + CARET + Publish + + + #x0AFD + U+201A + SINGLE LOW QUOTATION MARK + Publish + + + #x0AFE + U+201E + DOUBLE LOW QUOTATION MARK + Publish + + + #x0AFF + - + CURSOR + Publish + + + #x0BA3 + - + LEFT CARET + APL + + + #x0BA6 + - + RIGHT CARET + APL + + + #x0BA8 + - + DOWN CARET + APL + + + #x0BA9 + - + UP CARET + APL + + + #x0BC0 + - + OVERBAR + APL + + + #x0BC2 + U+22A5 + DOWN TACK + APL + + + #x0BC3 + - + UP SHOE (CAP) + APL + + + #x0BC4 + U+230A + DOWN STILE + APL + + + #x0BC6 + - + UNDERBAR + APL + + + #x0BCA + U+2218 + JOT + APL + + + #x0BCC + U+2395 + QUAD + APL + + + #x0BCE + U+22A4 + UP TACK + APL + + + #x0BCF + U+25CB + CIRCLE + APL + + + #x0BD3 + U+2308 + UP STILE + APL + + + #x0BD6 + - + DOWN SHOE (CUP) + APL + + + #x0BD8 + - + RIGHT SHOE + APL + + + #x0BDA + - + LEFT SHOE + APL + + + #x0BDC + U+22A2 + LEFT TACK + APL + + + #x0BFC + U+22A3 + RIGHT TACK + APL + + + #x0CDF + U+2017 + DOUBLE LOW LINE + Hebrew + + + #x0CE0 + U+05D0 + HEBREW LETTER ALEF + Hebrew + + + #x0CE1 + U+05D1 + HEBREW LETTER BET + Hebrew + + + #x0CE2 + U+05D2 + HEBREW LETTER GIMEL + Hebrew + + + #x0CE3 + U+05D3 + HEBREW LETTER DALET + Hebrew + + + #x0CE4 + U+05D4 + HEBREW LETTER HE + Hebrew + + + #x0CE5 + U+05D5 + HEBREW LETTER VAV + Hebrew + + + #x0CE6 + U+05D6 + HEBREW LETTER ZAYIN + Hebrew + + + #x0CE7 + U+05D7 + HEBREW LETTER HET + Hebrew + + + #x0CE8 + U+05D8 + HEBREW LETTER TET + Hebrew + + + #x0CE9 + U+05D9 + HEBREW LETTER YOD + Hebrew + + + #x0CEA + U+05DA + HEBREW LETTER FINAL KAF + Hebrew + + + #x0CEB + U+05DB + HEBREW LETTER KAF + Hebrew + + + #x0CEC + U+05DC + HEBREW LETTER LAMED + Hebrew + + + #x0CED + U+05DD + HEBREW LETTER FINAL MEM + Hebrew + + + #x0CEE + U+05DE + HEBREW LETTER MEM + Hebrew + + + #x0CEF + U+05DF + HEBREW LETTER FINAL NUN + Hebrew + + + #x0CF0 + U+05E0 + HEBREW LETTER NUN + Hebrew + + + #x0CF1 + U+05E1 + HEBREW LETTER SAMEKH + Hebrew + + + #x0CF2 + U+05E2 + HEBREW LETTER AYIN + Hebrew + + + #x0CF3 + U+05E3 + HEBREW LETTER FINAL PE + Hebrew + + + #x0CF4 + U+05E4 + HEBREW LETTER PE + Hebrew + + + #x0CF5 + U+05E5 + HEBREW LETTER FINAL TSADI + Hebrew + + + #x0CF6 + U+05E6 + HEBREW LETTER TSADI + Hebrew + + + #x0CF7 + U+05E7 + HEBREW LETTER QOF + Hebrew + + + #x0CF8 + U+05E8 + HEBREW LETTER RESH + Hebrew + + + #x0CF9 + U+05E9 + HEBREW LETTER SHIN + Hebrew + + + #x0CFA + U+05EA + HEBREW LETTER TAV + Hebrew + + + #x0DA1 + U+0E01 + THAI CHARACTER KO KAI + Thai + + + #x0DA2 + U+0E02 + THAI CHARACTER KHO KHAI + Thai + + + #x0DA3 + U+0E03 + THAI CHARACTER KHO KHUAT + Thai + + + #x0DA4 + U+0E04 + THAI CHARACTER KHO KHWAI + Thai + + + #x0DA5 + U+0E05 + THAI CHARACTER KHO KHON + Thai + + + #x0DA6 + U+0E06 + THAI CHARACTER KHO RAKHANG + Thai + + + #x0DA7 + U+0E07 + THAI CHARACTER NGO NGU + Thai + + + #x0DA8 + U+0E08 + THAI CHARACTER CHO CHAN + Thai + + + #x0DA9 + U+0E09 + THAI CHARACTER CHO CHING + Thai + + + #x0DAA + U+0E0A + THAI CHARACTER CHO CHANG + Thai + + + #x0DAB + U+0E0B + THAI CHARACTER SO SO + Thai + + + #x0DAC + U+0E0C + THAI CHARACTER CHO CHOE + Thai + + + #x0DAD + U+0E0D + THAI CHARACTER YO YING + Thai + + + #x0DAE + U+0E0E + THAI CHARACTER DO CHADA + Thai + + + #x0DAF + U+0E0F + THAI CHARACTER TO PATAK + Thai + + + #x0DB0 + U+0E10 + THAI CHARACTER THO THAN + Thai + + + #x0DB1 + U+0E11 + THAI CHARACTER THO NANGMONTHO + Thai + + + #x0DB2 + U+0E12 + THAI CHARACTER THO PHUTHAO + Thai + + + #x0DB3 + U+0E13 + THAI CHARACTER NO NEN + Thai + + + #x0DB4 + U+0E14 + THAI CHARACTER DO DEK + Thai + + + #x0DB5 + U+0E15 + THAI CHARACTER TO TAO + Thai + + + #x0DB6 + U+0E16 + THAI CHARACTER THO THUNG + Thai + + + #x0DB7 + U+0E17 + THAI CHARACTER THO THAHAN + Thai + + + #x0DB8 + U+0E18 + THAI CHARACTER THO THONG + Thai + + + #x0DB9 + U+0E19 + THAI CHARACTER NO NU + Thai + + + #x0DBA + U+0E1A + THAI CHARACTER BO BAIMAI + Thai + + + #x0DBB + U+0E1B + THAI CHARACTER PO PLA + Thai + + + #x0DBC + U+0E1C + THAI CHARACTER PHO PHUNG + Thai + + + #x0DBD + U+0E1D + THAI CHARACTER FO FA + Thai + + + #x0DBE + U+0E1E + THAI CHARACTER PHO PHAN + Thai + + + #x0DBF + U+0E1F + THAI CHARACTER FO FAN + Thai + + + #x0DC0 + U+0E20 + THAI CHARACTER PHO SAMPHAO + Thai + + + #x0DC1 + U+0E21 + THAI CHARACTER MO MA + Thai + + + #x0DC2 + U+0E22 + THAI CHARACTER YO YAK + Thai + + + #x0DC3 + U+0E23 + THAI CHARACTER RO RUA + Thai + + + #x0DC4 + U+0E24 + THAI CHARACTER RU + Thai + + + #x0DC5 + U+0E25 + THAI CHARACTER LO LING + Thai + + + #x0DC6 + U+0E26 + THAI CHARACTER LU + Thai + + + #x0DC7 + U+0E27 + THAI CHARACTER WO WAEN + Thai + + + #x0DC8 + U+0E28 + THAI CHARACTER SO SALA + Thai + + + #x0DC9 + U+0E29 + THAI CHARACTER SO RUSI + Thai + + + #x0DCA + U+0E2A + THAI CHARACTER SO SUA + Thai + + + #x0DCB + U+0E2B + THAI CHARACTER HO HIP + Thai + + + #x0DCC + U+0E2C + THAI CHARACTER LO CHULA + Thai + + + #x0DCD + U+0E2D + THAI CHARACTER O ANG + Thai + + + #x0DCE + U+0E2E + THAI CHARACTER HO NOKHUK + Thai + + + #x0DCF + U+0E2F + THAI CHARACTER PAIYANNOI + Thai + + + #x0DD0 + U+0E30 + THAI CHARACTER SARA A + Thai + + + #x0DD1 + U+0E31 + THAI CHARACTER MAI HAN-AKAT + Thai + + + #x0DD2 + U+0E32 + THAI CHARACTER SARA AA + Thai + + + #x0DD3 + U+0E33 + THAI CHARACTER SARA AM + Thai + + + #x0DD4 + U+0E34 + THAI CHARACTER SARA I + Thai + + + #x0DD5 + U+0E35 + THAI CHARACTER SARA II + Thai + + + #x0DD6 + U+0E36 + THAI CHARACTER SARA UE + Thai + + + #x0DD7 + U+0E37 + THAI CHARACTER SARA UEE + Thai + + + #x0DD8 + U+0E38 + THAI CHARACTER SARA U + Thai + + + #x0DD9 + U+0E39 + THAI CHARACTER SARA UU + Thai + + + #x0DDA + U+0E3A + THAI CHARACTER PHINTHU + Thai + + + #x0DDF + U+0E3F + THAI CURRENCY SYMBOL BAHT + Thai + + + #x0DE0 + U+0E40 + THAI CHARACTER SARA E + Thai + + + #x0DE1 + U+0E41 + THAI CHARACTER SARA AE + Thai + + + #x0DE2 + U+0E42 + THAI CHARACTER SARA O + Thai + + + #x0DE3 + U+0E43 + THAI CHARACTER SARA AI MAIMUAN + Thai + + + #x0DE4 + U+0E44 + THAI CHARACTER SARA AI MAIMALAI + Thai + + + #x0DE5 + U+0E45 + THAI CHARACTER LAKKHANGYAO + Thai + + + #x0DE6 + U+0E46 + THAI CHARACTER MAIYAMOK + Thai + + + #x0DE7 + U+0E47 + THAI CHARACTER MAITAIKHU + Thai + + + #x0DE8 + U+0E48 + THAI CHARACTER MAI EK + Thai + + + #x0DE9 + U+0E49 + THAI CHARACTER MAI THO + Thai + + + #x0DEA + U+0E4A + THAI CHARACTER MAI TRI + Thai + + + #x0DEB + U+0E4B + THAI CHARACTER MAI CHATTAWA + Thai + + + #x0DEC + U+0E4C + THAI CHARACTER THANTHAKHAT + Thai + + + #x0DED + U+0E4D + THAI CHARACTER NIKHAHIT + Thai + + + #x0DF0 + U+0E50 + THAI DIGIT ZERO + Thai + + + #x0DF1 + U+0E51 + THAI DIGIT ONE + Thai + + + #x0DF2 + U+0E52 + THAI DIGIT TWO + Thai + + + #x0DF3 + U+0E53 + THAI DIGIT THREE + Thai + + + #x0DF4 + U+0E54 + THAI DIGIT FOUR + Thai + + + #x0DF5 + U+0E55 + THAI DIGIT FIVE + Thai + + + #x0DF6 + U+0E56 + THAI DIGIT SIX + Thai + + + #x0DF7 + U+0E57 + THAI DIGIT SEVEN + Thai + + + #x0DF8 + U+0E58 + THAI DIGIT EIGHT + Thai + + + #x0DF9 + U+0E59 + THAI DIGIT NINE + Thai + + + #x0EA1 + - + HANGUL KIYEOG + Korean + + + #x0EA2 + - + HANGUL SSANG KIYEOG + Korean + + + #x0EA3 + - + HANGUL KIYEOG SIOS + Korean + + + #x0EA4 + - + HANGUL NIEUN + Korean + + + #x0EA5 + - + HANGUL NIEUN JIEUJ + Korean + + + #x0EA6 + - + HANGUL NIEUN HIEUH + Korean + + + #x0EA7 + - + HANGUL DIKEUD + Korean + + + #x0EA8 + - + HANGUL SSANG DIKEUD + Korean + + + #x0EA9 + - + HANGUL RIEUL + Korean + + + #x0EAA + - + HANGUL RIEUL KIYEOG + Korean + + + #x0EAB + - + HANGUL RIEUL MIEUM + Korean + + + #x0EAC + - + HANGUL RIEUL PIEUB + Korean + + + #x0EAD + - + HANGUL RIEUL SIOS + Korean + + + #x0EAE + - + HANGUL RIEUL TIEUT + Korean + + + #x0EAF + - + HANGUL RIEUL PHIEUF + Korean + + + #x0EB0 + - + HANGUL RIEUL HIEUH + Korean + + + #x0EB1 + - + HANGUL MIEUM + Korean + + + #x0EB2 + - + HANGUL PIEUB + Korean + + + #x0EB3 + - + HANGUL SSANG PIEUB + Korean + + + #x0EB4 + - + HANGUL PIEUB SIOS + Korean + + + #x0EB5 + - + HANGUL SIOS + Korean + + + #x0EB6 + - + HANGUL SSANG SIOS + Korean + + + #x0EB7 + - + HANGUL IEUNG + Korean + + + #x0EB8 + - + HANGUL JIEUJ + Korean + + + #x0EB9 + - + HANGUL SSANG JIEUJ + Korean + + + #x0EBA + - + HANGUL CIEUC + Korean + + + #x0EBB + - + HANGUL KHIEUQ + Korean + + + #x0EBC + - + HANGUL TIEUT + Korean + + + #x0EBD + - + HANGUL PHIEUF + Korean + + + #x0EBE + - + HANGUL HIEUH + Korean + + + #x0EBF + - + HANGUL A + Korean + + + #x0EC0 + - + HANGUL AE + Korean + + + #x0EC1 + - + HANGUL YA + Korean + + + #x0EC2 + - + HANGUL YAE + Korean + + + #x0EC3 + - + HANGUL EO + Korean + + + #x0EC4 + - + HANGUL E + Korean + + + #x0EC5 + - + HANGUL YEO + Korean + + + #x0EC6 + - + HANGUL YE + Korean + + + #x0EC7 + - + HANGUL O + Korean + + + #x0EC8 + - + HANGUL WA + Korean + + + #x0EC9 + - + HANGUL WAE + Korean + + + #x0ECA + - + HANGUL OE + Korean + + + #x0ECB + - + HANGUL YO + Korean + + + #x0ECC + - + HANGUL U + Korean + + + #x0ECD + - + HANGUL WEO + Korean + + + #x0ECE + - + HANGUL WE + Korean + + + #x0ECF + - + HANGUL WI + Korean + + + #x0ED0 + - + HANGUL YU + Korean + + + #x0ED1 + - + HANGUL EU + Korean + + + #x0ED2 + - + HANGUL YI + Korean + + + #x0ED3 + - + HANGUL I + Korean + + + #x0ED4 + - + HANGUL JONG SEONG KIYEOG + Korean + + + #x0ED5 + - + HANGUL JONG SEONG SSANG KIYEOG + Korean + + + #x0ED6 + - + HANGUL JONG SEONG KIYEOG SIOS + Korean + + + #x0ED7 + - + HANGUL JONG SEONG NIEUN + Korean + + + #x0ED8 + - + HANGUL JONG SEONG NIEUN JIEUJ + Korean + + + #x0ED9 + - + HANGUL JONG SEONG NIEUN HIEUH + Korean + + + #x0EDA + - + HANGUL JONG SEONG DIKEUD + Korean + + + #x0EDB + - + HANGUL JONG SEONG RIEUL + Korean + + + #x0EDC + - + HANGUL JONG SEONG RIEUL KIYEOG + Korean + + + #x0EDD + - + HANGUL JONG SEONG RIEUL MIEUM + Korean + + + #x0EDE + - + HANGUL JONG SEONG RIEUL PIEUB + Korean + + + #x0EDF + - + HANGUL JONG SEONG RIEUL SIOS + Korean + + + #x0EE0 + - + HANGUL JONG SEONG RIEUL TIEUT + Korean + + + #x0EE1 + - + HANGUL JONG SEONG RIEUL PHIEUF + Korean + + + #x0EE2 + - + HANGUL JONG SEONG RIEUL HIEUH + Korean + + + #x0EE3 + - + HANGUL JONG SEONG MIEUM + Korean + + + #x0EE4 + - + HANGUL JONG SEONG PIEUB + Korean + + + #x0EE5 + - + HANGUL JONG SEONG PIEUB SIOS + Korean + + + #x0EE6 + - + HANGUL JONG SEONG SIOS + Korean + + + #x0EE7 + - + HANGUL JONG SEONG SSANG SIOS + Korean + + + #x0EE8 + - + HANGUL JONG SEONG IEUNG + Korean + + + #x0EE9 + - + HANGUL JONG SEONG JIEUJ + Korean + + + #x0EEA + - + HANGUL JONG SEONG CIEUC + Korean + + + #x0EEB + - + HANGUL JONG SEONG KHIEUQ + Korean + + + #x0EEC + - + HANGUL JONG SEONG TIEUT + Korean + + + #x0EED + - + HANGUL JONG SEONG PHIEUF + Korean + + + #x0EEE + - + HANGUL JONG SEONG HIEUH + Korean + + + #x0EEF + - + HANGUL RIEUL YEORIN HIEUH + Korean + + + #x0EF0 + - + HANGUL SUNKYEONGEUM MIEUM + Korean + + + #x0EF1 + - + HANGUL SUNKYEONGEUM PIEUB + Korean + + + #x0EF2 + - + HANGUL PAN SIOS + Korean + + + #x0EF3 + - + HANGUL KKOGJI DALRIN IEUNG + Korean + + + #x0EF4 + - + HANGUL SUNKYEONGEUM PHIEUF + Korean + + + #x0EF5 + - + HANGUL YEORIN HIEUH + Korean + + + #x0EF6 + - + HANGUL ARAE A + Korean + + + #x0EF7 + - + HANGUL ARAE AE + Korean + + + #x0EF8 + - + HANGUL JONG SEONG PAN SIOS + Korean + + + #x0EF9 + - + HANGUL JONG SEONG KKOGJI DALRIN IEUNG + Korean + + + #x0EFA + - + HANGUL JONG SEONG YEORIN HIEUH + Korean + + + #x0EFF + - + KOREAN WON + Korean + + + #x13BC + U+0152 + LATIN CAPITAL LIGATURE OE + Latin-9 + + + #x13BD + U+0153 + LATIN SMALL LIGATURE OE + Latin-9 + + + #x13BE + U+0178 + LATIN CAPITAL LETTER Y WITH DIAERESIS + Latin-9 + + + #x20A0 + - + CURRENCY ECU SIGN + Currency + + + #x20A1 + - + CURRENCY COLON SIGN + Currency + + + #x20A2 + - + CURRENCY CRUZEIRO SIGN + Currency + + + #x20A3 + - + CURRENCY FRENCH FRANC SIGN + Currency + + + #x20A4 + - + CURRENCY LIRA SIGN + Currency + + + #x20A5 + - + CURRENCY MILL SIGN + Currency + + + #x20A6 + - + CURRENCY NAIRA SIGN + Currency + + + #x20A7 + - + CURRENCY PESETA SIGN + Currency + + + #x20A8 + - + CURRENCY RUPEE SIGN + Currency + + + #x20A9 + - + CURRENCY WON SIGN + Currency + + + #x20AA + - + CURRENCY NEW SHEQEL SIGN + Currency + + + #x20AB + - + CURRENCY DONG SIGN + Currency + + + #x20AC + U+20AC + CURRENCY EURO SIGN + Currency + + + + + + + diff --git a/miniconda3/share/doc/xproto/sect1-9.xml b/miniconda3/share/doc/xproto/sect1-9.xml new file mode 100644 index 0000000000000000000000000000000000000000..c59def1f85fad481b20735efa71699ac93587bf4 --- /dev/null +++ b/miniconda3/share/doc/xproto/sect1-9.xml @@ -0,0 +1,15309 @@ + + +Acknowledgements + +The primary contributors to the X11 protocol are: + + + +Dave Carver (Digital HPW) +Branko Gerovac (Digital HPW) +Jim Gettys (MIT/Project Athena, Digital) +Phil Karlton (Digital WSL) +Scott McGregor (Digital SSG) +Ram Rao (Digital UEG) +David Rosenthal (Sun) +Dave Winchell (Digital UEG) + + + +The implementors of initial server who provided useful +input are: + + + +Susan Angebranndt (Digital) +Raymond Drewry (Digital) +Todd Newman (Digital) + + + +The invited reviewers who provided useful input are: + + + +Andrew Cherenson (Berkeley) +Burns Fisher (Digital) +Dan Garfinkel (HP) +Leo Hourvitz (Next) +Brock Krizan (HP) +David Laidlaw (Stellar) +Dave Mellinger (Interleaf) +Ron Newman (MIT) +John Ousterhout (Berkeley) +Andrew Palay (ITC CMU) +Ralph Swick (MIT) +Craig Taylor (Sun) +Jeffery Vroom (Stellar) + + + +Thanks go to Al Mento of Digital's UEG Documentation Group for +formatting this document. + + + +This document does not attempt to provide the rationale or pragmatics required +to fully understand the protocol or to place it in perspective within a +complete system. + + + +The protocol contains many management mechanisms that are not intended for +normal applications. +Not all mechanisms are needed to build a particular user interface. +It is important to keep in mind that the protocol is intended to +provide mechanism, not policy. + + + +Robert W. Scheifler + + +X Consortium, Inc. + + + + + Protocol Formats + +
+ Request Format + Requestformat + +Every request contains an 8-bit major opcode +Opcodemajor +and a 16-bit length field +Requestlength +expressed in units of four bytes. +Every request consists of four bytes of a header +(containing the major opcode, the length field, and a data byte) +followed by zero or more additional bytes of data. +The length field defines the total length of the request, including the header. +The length field in a request must equal the minimum length required to contain +the request. +If the specified length is smaller or larger than the required length, +an error is generated. +Unused bytes in a request are not required to be zero. +Major opcodes 128 through 255 are reserved for +extensions. +Extension +Extensions are intended to contain multiple requests, +so extension requests typically have an additional +minor opcode encoded +in the second data byte in the request header. +Opcodeminor +However, the placement and interpretation of this minor opcode and of all +other fields in extension requests are not defined by the core protocol. +Every request on a given connection is implicitly assigned a +sequence number, +Sequence number +starting with one, that is used in replies, errors, and events. + +
+ +
+ Reply Format + Replyformat + +Every reply contains a 32-bit length field +expressed in units of four bytes. +Every reply consists of 32 bytes followed by zero or more additional bytes of +data, as specified in the length field. +Unused bytes within a reply are not guaranteed to be zero. +Every reply also contains the least significant 16 bits of the sequence number +of the corresponding request. + +
+ +
+ Error Format + Error reportformat + +Error reports are 32 bytes long. +Every error includes an 8-bit error code. + +Error codes 128 through 255 are reserved for extensions. + +Error Codesextensions +Extensionerror codes +Every error also includes the major and minor opcodes of the failed request +and the least significant 16 bits of the sequence number of the request. +For the following errors (see section 4), +the failing resource ID is also returned: +Colormap, +Cursor, +Drawable, +Font, +GContext, +IDChoice, +Pixmap +and +Window. +For +Atom +errors, the failing atom is returned. +For +Value +errors, the failing value is returned. +Other core errors return no additional data. +Unused bytes within an error are not guaranteed to be zero. + +
+ +
+ Event Format + Eventformat + +Events are 32 bytes long. +Unused bytes within an event are not guaranteed to be zero. +Every event contains an 8-bit type code. +The most significant bit in this code is set if the event was generated from a +SendEvent +request. + +Event codes 64 through 127 are reserved for extensions, although the core +protocol does not define a mechanism for selecting interest in such events. + +Eventextension +Extensionevent +Every core event (with the exception of +KeymapNotify) +also contains the least significant 16 bits of the sequence number of the last +request issued by the client that was (or is currently being) processed by +the server. + +
+
+ + +Syntactic Conventions + + + + + +The rest of this document uses the following syntactic conventions. + + + + +The syntax {...} encloses a set of alternatives. + + + + +The syntax [...] encloses a set of structure components. + + + + +In general, TYPEs are in uppercase and +AlternativeValues +are capitalized. + + + + +Requests in section 9 are described +in the following format: + +RequestName + arg1: type1 + ... + argN: typeN + ▶ + result1: type1 + ... + resultM: typeM + + Errors: kind1, ..., kindK + + Description. + + + +If no ▶ is present in the description, +then the request has no reply (it is asynchronous), +although errors may still be reported. +If ▶+ is used, +then one or more replies can be generated for a single request. + + + + +Events in section 11 are described +in the following format: + +EventName + value1: type1 + ... + valueN: typeN + + Description. + + + + + + + +Common Types + + + + + + + + + + Name + Value + + + + + LISTofFOOTypesLISTofFOO + + +A type name of the form LISTofFOO means a counted list of elements of type +FOO. +The size of the length field may vary (it is not necessarily the same +size as a FOO), and in some cases, it may be implicit. +It is fully specified in Appendix B. +Except where explicitly noted, +zero-length lists are legal. + + + + BITMASKTypesBITMASKLISTofVALUETypesLISTofVALUE + + +The types BITMASK and LISTofVALUE are somewhat special. +Various requests contain arguments of the form: + + +value-mask: BITMASK + + +value-list: LISTofVALUE + + +These are used to allow the client to specify a subset of a heterogeneous +collection of optional arguments. +The value-mask specifies which arguments are to be provided; +each such argument is assigned a unique bit position. +The representation of the BITMASK will typically contain more bits than +there are defined arguments. +The unused bits in the value-mask must be zero (or the server generates a +Value +error). +The value-list contains one value for each bit set to 1 in the mask, +from least significant to most significant bit in the mask. +Each value is represented with four bytes, +but the actual value occupies only the least significant bytes as required. +The values of the unused bytes do not matter. + + + + + ORTypesOR + +A type of the form "T1 or ... or Tn" means the union of the indicated types. +A single-element type is given as the element without enclosing braces. + + + + WINDOWTypesWINDOW + 32-bit value (top three bits guaranteed to be zero) + + + PIXMAPTypesPIXMAP + 32-bit value (top three bits guaranteed to be zero) + + + CURSORTypesCURSOR + 32-bit value (top three bits guaranteed to be zero) + + + FONTTypesFONT + 32-bit value (top three bits guaranteed to be zero) + + + GCONTEXTTypesGCONTEXT + 32-bit value (top three bits guaranteed to be zero) + + + COLORMAPTypesCOLORMAP + 32-bit value (top three bits guaranteed to be zero) + + + DRAWABLETypesDRAWABLE + WINDOW or PIXMAP + + + FONTABLETypesFONTABLE + FONT or GCONTEXT + + + ATOMTypesATOM + 32-bit value (top three bits guaranteed to be zero) + + + VISUALIDTypesVISUALID + 32-bit value (top three bits guaranteed to be zero) + + + VALUETypesVALUE + 32-bit quantity (used only in LISTofVALUE) + + + BYTETypesBYTE + 8-bit value + + + INT8TypesINT8 + 8-bit signed integer + + + INT16TypesINT16 + 16-bit signed integer + + + INT32TypesINT32 + 32-bit signed integer + + + CARD8TypesCARD8 + 8-bit unsigned integer + + + CARD16TypesCARD16 + 16-bit unsigned integer + + + CARD32TypesCARD32 + 32-bit unsigned integer + + + TIMESTAMPTypesTIMESTAMP + CARD32 + + + BITGRAVITYTypesBITGRAVITY + +{ Forget, +Static, +NorthWest, +North, +NorthEast, +West, +Center, +East, +SouthWest, +South, +SouthEast } + + + + WINGRAVITYTypesWINGRAVITY + +{ Unmap, +Static, +NorthWest, +North, +NorthEast, +West, +Center, +East, +SouthWest, +South, +SouthEast } + + + + BOOLTypesBOOL + +{ True, +False } + + + + EVENTTypesEVENT + +{ KeyPress, +KeyRelease, +OwnerGrabButton, +ButtonPress, +ButtonRelease, +EnterWindow, +LeaveWindow, +PointerMotion, +PointerMotionHint, +Button1Motion, +Button2Motion, +Button3Motion, +Button4Motion, +Button5Motion, +ButtonMotion, +Exposure, +VisibilityChange, +StructureNotify, +ResizeRedirect, +SubstructureNotify, +SubstructureRedirect, +FocusChange, +PropertyChange, +ColormapChange, +KeymapState } + + + + POINTEREVENTTypesPOINTEREVENT + +{ ButtonPress, +ButtonRelease, +EnterWindow, +LeaveWindow, +PointerMotion, +PointerMotionHint, +Button1Motion, +Button2Motion, +Button3Motion, +Button4Motion, +Button5Motion, +ButtonMotion, +KeymapState } + + + + DEVICEEVENTTypesDEVICEEVENT + +{ KeyPress, +KeyRelease, +ButtonPress, +ButtonRelease, +PointerMotion, +Button1Motion, +Button2Motion, +Button3Motion, +Button4Motion, +Button5Motion, +ButtonMotion } + + + + KEYSYMTypesKEYSYM + 32-bit value (top three bits guaranteed to be zero) + + + KEYCODETypesKEYCODE + CARD8 + + + BUTTONTypesBUTTON + CARD8 + + + KEYMASKTypesKEYMASK + +{ Shift, +Lock, +Control, +Mod1, +Mod2, +Mod3, +Mod4, +Mod5 } + + + + BUTMASKTypesBUTMASK + +{ Button1, +Button2, +Button3, +Button4, +Button5 } + + + + KEYBUTMASKTypesKEYBUTMASK + KEYMASK or BUTMASK + + + STRING8TypesSTRING8 + LISTofCARD8 + + + STRING16TypesSTRING16 + LISTofCHAR2B + + + CHAR2BTypesCHAR2B + [byte1, byte2: CARD8] + + + POINTTypesPOINT + [x, y: INT16] + + + RECTANGLETypesRECTANGLE + +[x, y: INT16, +width, height: CARD16] + + + + ARCTypesARC + +[x, y: INT16, +width, height: CARD16, +angle1, angle2: INT16] + + + + HOSTTypesHOST + + +[family: +{ Internet, +InternetV6, +ServerInterpreted, +DECnet, +Chaos } + +address: LISTofBYTE] + + + + + + + +The [x,y] coordinates of a RECTANGLE specify the upper-left corner. + + + +The primary interpretation of large characters in a STRING16 is that they +are composed of two bytes used to index a two-dimensional matrix, +hence, the use of CHAR2B rather than CARD16. +This corresponds to the JIS/ISO method of indexing 2-byte characters. +It is expected that most large fonts will be defined with 2-byte +matrix indexing. +For large fonts constructed with linear indexing, +a CHAR2B can be interpreted as a 16-bit number by treating byte1 as +the most significant byte. +This means that clients should always transmit such +16-bit character values most significant byte first, as the server will never +byte-swap CHAR2B quantities. + + + +The length, format, and interpretation of a HOST address are specific to the +family (see +ChangeHosts +request). + + + + +Errors + + + + + +In general, when a request terminates with an error, +the request has no side effects (that is, there is no partial execution). +The only requests for which this is not true are +ChangeWindowAttributes, +ChangeGC, +PolyText8, +PolyText16, +FreeColors, +StoreColors +and +ChangeKeyboardControl. + + + +The following error codes result from various requests as follows: + + + + + + + + + Error + Description + + + + + AccessError CodesAccess + +An attempt is made to grab a key/button combination already grabbed by another +client. +An attempt is made to free a colormap entry not allocated by the client +or to free an entry in a colormap that was created with all entries writable. +An attempt is made to store into a read-only or an unallocated colormap entry. +An attempt is made to modify the access control list from other than the local +host (or otherwise authorized client). +An attempt is made to select an event type that only one client can +select at a time when another client has already selected it. + + + + AllocError CodesAlloc + +The server failed to allocate the requested resource. +Note that the explicit listing of +Alloc +errors in request only covers allocation errors at a very coarse level +and is not intended to cover all cases +of a server running out of allocation space in the middle of service. +The semantics when a server runs out of allocation space are left unspecified, +but a server may generate an +Alloc +error on any request for this reason, +and clients should be prepared to receive such errors and handle +or discard them. + + + + AtomError CodesAtom + +A value for an ATOM argument does not name a defined ATOM. + + + + ColormapError CodesColormap + +A value for a COLORMAP argument does not name a defined COLORMAP. + + + + CursorError CodesCursor + +A value for a CURSOR argument does not name a defined CURSOR. + + + + DrawableError CodesDrawable + +A value for a DRAWABLE argument does not name a defined WINDOW +or PIXMAP. + + + + FontError CodesFont + +A value for a FONT argument does not name a defined FONT. +A value for a FONTABLE argument does not name a defined FONT or a +defined GCONTEXT. + + + + GContextError CodesGContext + +A value for a GCONTEXT argument does not name a defined GCONTEXT. + + + + IDChoiceError CodesIDChoice + +The value chosen for a resource identifier either is not included +in the range assigned to the client or is already in use. + + + + ImplementationError CodesImplementation + +The server does not implement some aspect of the request. +A server that generates this error for a core request is deficient. +As such, this error is not listed for any of the requests, +but clients should be prepared to receive such errors +and handle or discard them. + + + + LengthError CodesLength + +The length of a request is shorter or longer than that required +to minimally contain the arguments. +The length of a request exceeds the maximum length accepted by the +server. + + + + MatchError CodesMatch + +An +InputOnly +window is used as a DRAWABLE. +In a graphics request, the GCONTEXT argument does not have the same +root and depth as the destination DRAWABLE argument. +Some argument (or pair of arguments) has the correct type and range, +but it fails to match in some other way required by the request. + + + + NameError CodesName + +A font or color of the specified name does not exist. + + + + PixmapError CodesPixmap + +A value for a PIXMAP argument does not name a defined PIXMAP. + + + + RequestError CodesRequest + +The major or minor opcode does not specify a valid request. + + + + ValueError CodesValue + +Some numeric value falls outside the range of values accepted by the request. +Unless a specific range is specified for an argument, +the full range defined by the argument's type is accepted. +Any argument defined as a set of alternatives typically can generate +this error (due to the encoding). + + + + WindowError CodesWindow + +A value for a WINDOW argument does not name a defined WINDOW. + + + + + + + +The +Atom, +Colormap, +Cursor, +Drawable, +Font, +GContext, +Pixmap +and +Window +errors are also used when the argument type is extended by union with a +set of fixed alternatives, for example, <WINDOW or +PointerRoot +or +None>. + + + + +Keyboards +Keyboard + + + + +A KEYCODE represents a physical (or logical) key. +TypesKEYCODE +Keycode +Keycodes lie in the inclusive range [8,255]. +A keycode value carries no intrinsic information, +although server implementors may attempt to encode geometry information +(for example, matrix) to be interpreted in a server-dependent fashion. +The mapping between keys and keycodes cannot be changed using the +protocol. + + +A KEYSYM is an encoding of a symbol on the cap of a key. +TypesKEYSYM +Keysym +The set of defined KEYSYMs include the character sets Latin-1, Latin-2, +Latin-3, Latin-4, Kana, Arabic, Cyrillic, Greek, Tech, Special, Publish, APL, +Hebrew, Thai, and Korean as well as a set of symbols common on keyboards +(Return, Help, Tab, +and so on). +KEYSYMs with the most significant bit (of the 29 bits) set are reserved +as vendor-specific. + + +A list of KEYSYMs is associated with each KEYCODE. +The list is intended to convey the set of symbols on the corresponding key. +If the list (ignoring trailing +NoSymbol +entries) is a single KEYSYM "K", +then the list is treated as if it were +the list "K NoSymbol +K NoSymbol". +If the list (ignoring trailing NoSymbol entries) +is a pair of KEYSYMs +"K1 K2", then the list is treated as +if it were the list +"K1 K2 K1 K2". +If the list (ignoring trailing +NoSymbol +entries) is +a triple of KEYSYMs "K1 K2 K3", +then the list is treated as if it were the list " +K1 K2 K3 NoSymbol". +When an explicit "void" element is desired in the list, +the value +VoidSymbol +can be used. + + + +The first four elements of the list are split into two groups of KEYSYMs. +Group 1 contains the first and second KEYSYMs, Group 2 contains the third and +fourth KEYSYMs. +Within each group, +if the second element of the group is +NoSymbol, +then the group should be treated as if the second element were the +same as the first element, except when the first element is an alphabetic +KEYSYM "K" for which both lowercase +and uppercase forms are defined. +In that case, the group should be treated as if the first element were the +lowercase form of "K" and the second +element were the uppercase form +of "K". + + + +The standard rules for obtaining a KEYSYM from a +KeyPress +KeyPress +event make use of only the Group 1 and Group 2 KEYSYMs; no interpretation of +other KEYSYMs in the list is defined. The modifier state determines which +group to use. Switching between groups is controlled by the KEYSYM named +MODE SWITCH, by attaching that KEYSYM to some KEYCODE and attaching that +KEYCODE to any one of the modifiers +Mod1 +through +Mod5. +This modifier is +modifiergroup +called the "group modifier". For any KEYCODE, Group 1 is used when the +group modifier is off, and Group 2 is used when the group modifier is on. + + + +The +Lock +modifierLock +modifier is interpreted as CapsLock when the KEYSYM named CAPS +LOCK is attached to some KEYCODE and that KEYCODE is attached to the +Lock +modifier. The +Lock +modifier is interpreted as ShiftLock when the KEYSYM +named SHIFT LOCK is attached to some KEYCODE and that KEYCODE is attached +to the +Lock +modifier. If the +Lock +modifier could be interpreted as both +CapsLock and ShiftLock, the CapsLock interpretation is used. + + + + +The operation of "keypad" keys is controlled by the KEYSYM named NUM LOCK, +by attaching that KEYSYM to some KEYCODE and attaching that KEYCODE to any +one of the modifiers +Mod1 +through +Mod5. +This modifier is called the +modifierNumLock +"numlock modifier". The standard KEYSYMs with the prefix KEYPAD in their +name are called "keypad" KEYSYMs; these are KEYSYMS with numeric value in +the hexadecimal range #xFF80 to #xFFBD inclusive. In addition, +vendor-specific KEYSYMS in the hexadecimal range #x11000000 to #x1100FFFF +are also keypad KEYSYMs. + + + +Within a group, the choice of KEYSYM is determined by applying the first +rule that is satisfied from the following list: + + + + + +The numlock modifier is on and the second KEYSYM is a keypad KEYSYM. In +this case, if the +Shift +modifier is on, or if the +Lock +modifier is on and +is interpreted as ShiftLock, then the first KEYSYM is used; otherwise, the +second KEYSYM is used. + + + + +The +Shift +and +Lock +modifiers are both off. In this case, the first +KEYSYM is used. + + + + +The +Shift +modifier is off, and the +Lock +modifier is on and is +interpreted as CapsLock. In this case, the first KEYSYM is used, but if +that KEYSYM is lowercase alphabetic, then the corresponding uppercase +KEYSYM is used instead. + + + + +The +Shift +modifier is on, and the +Lock +modifier is on and is interpreted +as CapsLock. In this case, the second KEYSYM is used, but if that KEYSYM +is lowercase alphabetic, then the corresponding uppercase KEYSYM is used +instead. + + + + +The +Shift +modifier is on, or the +Lock +modifier is on and is interpreted +as ShiftLock, or both. In this case, the second KEYSYM is used. + + + + + + +The mapping between KEYCODEs and KEYSYMs is not used directly by the server; +it is merely stored for reading and writing by clients. + + + + +Pointers + + + + +Buttons are always numbered starting with one. +Buttonnumber + + + + +Predefined Atoms + + + + + +Atompredefined +Predefined atoms are not strictly necessary and may not be useful in all +environments, but they will eliminate many +InternAtom +requests in most applications. +Note that they are predefined only in the sense of having numeric values, +not in the sense of having required semantics. +The core protocol imposes no semantics on these names, +but semantics are specified in other X Window System standards, +such as the +Inter-Client Communication Conventions Manual +and the X Logical Font Description Conventions. + + + +The following names have predefined atom values. +Note that uppercase and lowercase matter. + + + + ARC + ATOM + BITMAP + CAP_HEIGHT + CARDINAL + COLORMAP + COPYRIGHT + CURSOR + CUT_BUFFER0 + CUT_BUFFER1 + CUT_BUFFER2 + CUT_BUFFER3 + CUT_BUFFER4 + CUT_BUFFER5 + CUT_BUFFER6 + CUT_BUFFER7 + DRAWABLE + END_SPACE + FAMILY_NAME + FONT + FONT_NAME + FULL_NAME + INTEGER + ITALIC_ANGLE + MAX_SPACE + MIN_SPACE + NORM_SPACE + NOTICE + PIXMAP + POINT + POINT_SIZE + PRIMARY + QUAD_WIDTH + RECTANGLE + RESOLUTION + RESOURCE_MANAGER + RGB_BEST_MAP + RGB_BLUE_MAP + RGB_COLOR_MAP + RGB_DEFAULT_MAP + RGB_GRAY_MAP + RGB_GREEN_MAP + RGB_RED_MAP + SECONDARY + STRIKEOUT_ASCENT + STRIKEOUT_DESCENT + STRING + SUBSCRIPT_X + SUBSCRIPT_Y + SUPERSCRIPT_X + SUPERSCRIPT_Y + UNDERLINE_POSITION + UNDERLINE_THICKNESS + VISUALID + WEIGHT + WINDOW + WM_CLASS + WM_CLIENT_MACHINE + WM_COMMAND + WM_HINTS + WM_ICON_NAME + WM_ICON_SIZE + WM_NAME + WM_NORMAL_HINTS + WM_SIZE_HINTS + WM_TRANSIENT_FOR + WM_ZOOM_HINTS + X_HEIGHT + + + + +To avoid conflicts with possible future names for which semantics might be +imposed (either at the protocol level or in terms of higher level user +interface models), +names beginning with an underscore should be used for atoms +that are private to a particular vendor or organization. +To guarantee no conflicts between vendors and organizations, +additional prefixes need to be used. +However, the protocol does not define the mechanism for choosing such prefixes. +For names private to a single application or end user but stored in globally +accessible locations, +it is suggested that two leading underscores be used to avoid conflicts with +other names. + + + + + Connection Setup + Connection + + +For remote clients, +the X protocol can be built on top of any reliable byte stream. + + +
+ Connection Initiation + Connectionopening + + +The client must send an initial byte of data to identify the byte order to be +employed. +Byte order +The value of the byte must be octal 102 or 154. +The value 102 (ASCII uppercase B) means values are transmitted most significant +byte first, and value 154 (ASCII lowercase l) means values are transmitted +least significant byte first. +Except where explicitly noted in the protocol, +all 16-bit and 32-bit quantities sent by the client must be transmitted with +this byte order, +and all 16-bit and 32-bit quantities returned by the server will be transmitted +with this byte order. + + +Following the byte-order byte, +the client sends the following information at connection setup: + +
+ +protocol-major-version: CARD16 + + +protocol-minor-version: CARD16 + + +authorization-protocol-name: STRING8 + + +authorization-protocol-data: STRING8 + +
+ +The version numbers indicate what version of the protocol the client +expects the server to implement. + + +The authorization name indicates what authorization (and authentication) +protocol the client +expects the server to use, and the data is specific to that protocol. +Authorization +Specification of valid authorization mechanisms is not part of the core +X protocol. +A server that does not implement the protocol the client expects +or that only implements the host-based mechanism may simply ignore this +information. +If both name and data strings are empty, +this is to be interpreted as "no explicit authorization." + +
+ +
+ Server Response + + +The client receives the following information at connection setup: + + + + + +success: +{ Failed, +Success, +Authenticate} + + + + + +The client receives the following additional data if the returned success +value is +Failed, +and the connection is not successfully established: + + +
+ +protocol-major-version: CARD16 + + +protocol-minor-version: CARD16 + + +reason: STRING8 + +
+ + +The client receives the following additional data if the returned success +value is +Authenticate, +and further authentication negotiation is required: + + +
+ +reason: STRING8 + +
+ + +The contents of the reason string are specific to the authorization +protocol in use. The semantics of this authentication negotiation are +not constrained, except that the negotiation must eventually terminate +with a reply from the server containing a success value of +Failed +or +Success. + + + +The client receives the following additional data if the returned success +value is +Success, +and the connection is successfully established: + + +
+ +protocol-major-version: CARD16 + + + +protocol-minor-version: CARD16 + + + +vendor: STRING8 + + + +release-number: CARD32 + + + +resource-id-base, resource-id-mask: CARD32 + + + +image-byte-order: +{ LSBFirst, +MSBFirst } + + + +bitmap-scanline-unit: {8, 16, 32} + + + +bitmap-scanline-pad: {8, 16, 32} + + + +bitmap-bit-order: +{ LeastSignificant, +MostSignificant } + + + +pixmap-formats: LISTofFORMAT + + + +roots: LISTofSCREEN + + + +motion-buffer-size: CARD32 + + + +maximum-request-length: CARD16 + + + +min-keycode, max-keycode: KEYCODE + + +where: + +
+ + + + + + + FORMAT: + [depth: CARD8, + + + + +bits-per-pixel: {1, 4, 8, 16, 24, 32} + + + + + +scanline-pad: {8, 16, 32}] + + + + SCREEN: + [root: WINDOW + + + + width-in-pixels, height-in-pixels: CARD16 + + + + width-in-millimeters, height-in-millimeters: CARD16 + + + + allowed-depths: LISTofDEPTH + + + + root-depth: CARD8 + + + + root-visual: VISUALID + + + + default-colormap: COLORMAP + + + + white-pixel, black-pixel: CARD32 + + + + min-installed-maps, max-installed-maps: CARD16 + + + + backing-stores: {Never, WhenMapped, Always} + + + + save-unders: BOOL + + + + current-input-masks: SETofEVENT] + + + DEPTH: + [depth: CARD8 + + + + visuals: LISTofVISUALTYPE] + + + VISUALTYPE: + [visual-id: VISUALID + + + + +class: {StaticGray, StaticColor, TrueColor, GrayScale, +PseudoColor, DirectColor} + + + + + red-mask, green-mask, blue-mask: CARD32 + + + + bits-per-rgb-value: CARD8 + + + + colormap-entries: CARD16] + + + + +
+
+
+ +
+ Server Information + + +The information that is global to the server is: + + + +The protocol version numbers are an escape hatch in case future revisions of +the protocol are necessary. +In general, +the major version would increment for incompatible changes, +and the minor version would increment for small upward compatible changes. +Barring changes, +the major version will be 11, and the minor version will be 0. +The protocol version numbers returned indicate the protocol the server +actually supports. +This might not equal the version sent by the client. +The server can (but need not) refuse connections from clients that offer a +different version than the server supports. +A server can (but need not) support more than one version simultaneously. + + +The vendor string gives some identification of the owner of the server +implementation. +The vendor controls the semantics of the release number. + + +The resource-id-mask contains a single contiguous set of bits (at least 18). +The client allocates resource IDs for types WINDOW, PIXMAP, +CURSOR, FONT, GCONTEXT, and COLORMAP by choosing a value with only +some subset of these bits set and ORing it with resource-id-base. +ResourceID +Only values constructed in this way can be used to name newly created +resources over this connection. +Resource IDs never have the top three bits set. +The client is not restricted to linear or contiguous allocation +of resource IDs. +Once an ID has been freed, +it can be reused. +An ID must be unique with respect to the IDs of all other resources, +not just other resources of the same type. +However, note that the value spaces of resource identifiers, +atoms, visualids, and keysyms are distinguished by context, and +as such, are not required to be disjoint; for example, a given numeric value +might be both a valid window ID, a valid atom, and a valid keysym. + + +Although the server is in general responsible for byte-swapping data to +match the client, +images are always transmitted and received in formats (including byte order) +specified by the server. +The byte order for images is given by image-byte-order and applies to each +scanline unit in XY format (bitmap format) and to each pixel value in Z format. + + +A bitmap is represented in scanline order. +Bitmapformat +Each scanline +is padded to a multiple of bits as given by bitmap-scanline-pad. +The pad bits are of arbitrary value. +The scanline is quantized in multiples of bits as given by bitmap-scanline-unit. +The bitmap-scanline-unit is always less than or equal to the +bitmap-scanline-pad. +Within each unit, +the leftmost bit in the bitmap is either the least significant +or most significant bit in the unit, as given by bitmap-bit-order. +XYFormat +If a pixmap is represented in XY format, +each plane is represented as a bitmap, and the planes appear from +most significant to least significant in bit order with no padding +between planes. + + +Pixmap-formats contains one entry for each +depth value. +Pixmapformat +ZFormat +The entry describes the Z format +used to represent images of that depth. +An entry for a depth is included if any screen supports that depth, +and all screens supporting that depth must support only that Z format for that +depth. +In Z format, +the pixels are in scanline order, left to right within a scanline. +The number of bits used to hold each pixel is given by bits-per-pixel. +Bits-per-pixel may be larger than strictly required by the depth, +in which case the least significant bits are used to hold +the pixmap data, and the values of the unused high-order bits are +undefined. +When the bits-per-pixel is 4, +the order of nibbles in the byte is the same as the image byte-order. +When the bits-per-pixel is 1, +the format is identical for bitmap format. +Each scanline is padded to a multiple of bits as given by scanline-pad. +When bits-per-pixel is 1, +this will be identical to bitmap-scanline-pad. + + +How a pointing device roams the screens is up to the server +implementation and is transparent to the protocol. +No geometry is defined among screens. + + +The server may retain the recent history of pointer motion and do so to a +finer granularity than is reported by +MotionNotify +events. +The +GetMotionEvents +request makes such history available. +The motion-buffer-size gives the approximate maximum number +of elements in the history buffer. + + +Maximum-request-length specifies the maximum length of a request +accepted by the server, in 4-byte units. +Requestlength +That is, length is the maximum value that can appear in the length field of a +request. +Requests larger than this maximum generate a +Length +error, +and the server will read and simply discard the entire request. +Maximum-request-length will always be at least 4096 +(that is, requests of length up to and including 16384 bytes +will be accepted by all servers). + + +TypesKEYCODE +Keycode +Min-keycode and max-keycode specify the smallest and largest keycode +values transmitted by the server. +Min-keycode is never less than 8, +and max-keycode is never greater than 255. +Not all keycodes in this range are required to have corresponding keys. + +
+ +
+ Screen Information + Screen + + +The information that applies per screen is: + + + +The allowed-depths specifies what pixmap and window depths are supported. +Pixmaps are supported for each depth listed, +and windows of that depth are supported if at least one visual type is listed +for the depth. +A pixmap depth of one is always supported and listed, +but windows of depth one might not be supported. +A depth of zero is never listed, +but zero-depth +InputOnly +windows are always supported. + + +Root-depth and root-visual specify the depth and visual type of the +root window. +Width-in-pixels and height-in-pixels specify the size of +the root window (which cannot be changed). +The class of the root window is always +InputOutput. +Width-in-millimeters and height-in-millimeters can be used to determine the +physical size and the aspect ratio. + + +The default-colormap is the one initially associated with the root window. +Clients with minimal color requirements creating windows of +the same depth as the root may want to allocate from this map by +default. + + +Black-pixel and white-pixel can be used in implementing a monochrome +application. +These pixel values are for permanently allocated entries in the +default-colormap. +The actual RGB values may be settable on some screens +and, in any case, may not actually be black and white. +The names are intended to convey the expected relative intensity of the colors. + + +The border of the root window is initially a pixmap filled with the black-pixel. +The initial background of the root window is a pixmap filled with some +unspecified two-color pattern using black-pixel and white-pixel. + + +Min-installed-maps specifies the number of maps that can be guaranteed +to be installed simultaneously (with +InstallColormap), +regardless of the number of entries allocated in each map. +Max-installed-maps specifies the maximum number of maps that might possibly be +installed simultaneously, depending on their allocations. +Multiple static-visual colormaps with identical contents but differing in +resource ID should be considered as a single map for the purposes of this +number. +For the typical case of a single hardware colormap, both values will be 1. + + +Backing store +Backing-stores indicates when the server supports backing stores for +this screen, although it may be storage limited in the number of +windows it can support at once. +If save-unders is +True, +the server can support the save-under mode in +CreateWindow +and +ChangeWindowAttributes, +although again it may be storage limited. + + +The current-input-events is what +GetWindowAttributes +would return for the all-event-masks for the root window. + +
+ +
+ Visual Information + Visualinformation + + +The information that applies per visual-type is: + + + +A given visual type might be listed for more than one depth or for +more than one screen. + + + +Colormaptypes +Pixel value +For +PseudoColor, +a pixel value indexes a colormap to produce independent RGB values; +the RGB values can be changed dynamically. +GrayScale +is treated in the same way as +PseudoColor +except which primary drives the screen is undefined; +thus, the client should always store the +same value for red, green, and blue in colormaps. +For +DirectColor, +a pixel value is decomposed into separate RGB subfields, +and each subfield separately indexes the colormap for the corresponding value. +The RGB values can be changed dynamically. +TrueColor +is treated in the same way as +DirectColor +except the colormap has predefined read-only RGB values. +These values are server-dependent but provide linear or near-linear +increasing ramps in each primary. +StaticColor +is treated in the same way as +PseudoColor +except the colormap has predefined read-only RGB values, +which are server-dependent. +StaticGray +is treated in the same way as +StaticColor +except the red, green, and blue values are equal for any +single pixel value, resulting in shades of gray. +StaticGray +with a two-entry colormap can be thought of as monochrome. + + + +The red-mask, green-mask, and blue-mask are only defined for +DirectColor +and +TrueColor. +Each has one contiguous set of bits set to 1 with no intersections. +Usually each mask has the same number of bits set to 1. + + + +The bits-per-rgb-value specifies the log base 2 of the number of +distinct color intensity values (individually) of red, green, and blue. +This number need not bear any relation to the number of colormap entries. +Actual RGB values are always passed in the protocol within a +16-bit spectrum, with 0 being minimum intensity and 65535 being the +maximum intensity. +On hardware that provides a linear zero-based intensity ramp, +the following relationship exists: + + + + + hw-intensity = protocol-intensity / (65536 / total-hw-intensities) + + + + +Colormap entries are indexed from 0. +The colormap-entries defines the number of available colormap entries in a +newly created colormap. +For +DirectColor +and +TrueColor, +this will usually be 2 to the power of the maximum number of bits set to 1 in +red-mask, green-mask, and blue-mask. + +
+
+ + + Requests +
+ CreateWindow + CreateWindow + + + + + + + + +wid, parent: WINDOW + + + + +class: +{ InputOutput, +InputOnly, +CopyFromParent} + + + + +depth: CARD8 + + + + +visual: VISUALID or +CopyFromParent + + + + +x, y: INT16 + + + + +width, height, border-width: CARD16 + + + + +value-mask: BITMASK + + + + +value-list: LISTofVALUE + + + + + + +Errors: +Alloc, +Colormap, +Cursor, +IDChoice, +Match, +Pixmap, +Value, +Window + + + + + + + + + +This request creates an unmapped window and assigns the identifier wid to it. + + +A class of +CopyFromParent +means the class is taken from the parent. +A depth of zero for class +InputOutput +or +CopyFromParent +means the depth is taken from the parent. +A visual of +CopyFromParent +means the visual type is taken from the parent. +For class +InputOutput, +the visual type and depth must be a combination supported for the screen +(or a +Match +error results). +The depth need not be the same as the parent, +but the parent must not be of class +InputOnly +(or a +Match +error results). +For class +InputOnly, +the depth must be zero (or a +Match +error results), and the visual must be one supported for the screen (or a +Match +error results). +However, the parent can have any depth and class. + + +The server essentially acts as if +InputOnly +windows do not exist for the purposes of graphics requests, +exposure processing, and +VisibilityNotify +events. +An +InputOnly +window cannot be used as a drawable (as a source or destination for graphics +requests). +InputOnly +and +InputOutput +windows act identically in other respects-properties, +grabs, input control, and so on. + + +The coordinate system has the X axis horizontal and the Y axis vertical +with the origin [0, 0] at the upper-left corner. +Coordinates are integral, +in terms of pixels, +and coincide with pixel centers. +Each window and pixmap has its own coordinate system. +For a window, +the origin is inside the border at the inside, upper-left corner. + + +The x and y coordinates +for the window are relative to the parent's origin +and specify the position of the upper-left outer corner of the window +(not the origin). +The width and height specify the inside size (not including the border) +and must be nonzero (or a +Value +error results). +The border-width for an +InputOnly +window must be zero (or a +Match +error results). + + +The window is placed on top in the stacking order with respect to siblings. + + +The value-mask and value-list specify attributes of the window that are +to be explicitly initialized. +The possible values are: + + + + + + + + Attribute + Type + + + + + background-pixmap + +PIXMAP or +None +or +ParentRelative + + + + background-pixel + CARD32 + + + border-pixmap + +PIXMAP or +CopyFromParent + + + + border-pixel + CARD32 + + + bit-gravity + BITGRAVITY + + + win-gravity + WINGRAVITY + + + backing-store + +{ NotUseful, +WhenMapped, +Always } + + + + backing-planes + CARD32 + + + backing-pixel + CARD32 + + + save-under + BOOL + + + event-mask + SETofEVENT + + + do-not-propagate-mask + SETofDEVICEEVENT + + + override-redirect + BOOL + + + colormap + +COLORMAP or +CopyFromParent + + + + cursor + +CURSOR or +None + + + + + + + +The default values when attributes are not explicitly initialized +are: + + + + + + + + + Attribute + Default + + + + + background-pixmap + +None + + + + border-pixmap + +CopyFromParent + + + + bit-gravity + +Forget + + + + win-gravity + +NorthWest + + + + backing-store + +NotUseful + + + + backing-planes + all ones + + + backing-pixel + zero + + + save-under + +False + + + + event-mask + {} (empty set) + + + do-not-propagate-mask + {} (empty set) + + + override-redirect + +False + + + + colormap + +CopyFromParent + + + + cursor + +None + + + + + + + +Only the following attributes are defined for +InputOnly +windows: + + + + + +win-gravity + + + + +event-mask + + + + +do-not-propagate-mask + + + + +override-redirect + + + + +cursor + + + + + +It is a +Match +error to specify any other attributes for +InputOnly +windows. + + +Background +If background-pixmap is given, +it overrides the default background-pixmap. +The background pixmap and the window must have the +same root and the same depth (or a +Match +error results). +Any size pixmap can be used, although some sizes may be faster than others. +If background +None +is specified, the window has no defined background. +If background +ParentRelative +is specified, the parent's background is used, +but the window must have the same depth as the parent (or a +Match +error results). +If the parent has background +None, +then the window will also have background +None. +A copy of the parent's background is not made. +The parent's background is reexamined each time the window background is +required. +If background-pixel is given, it overrides the default +background-pixmap and any background-pixmap given explicitly, +and a pixmap of undefined size filled with background-pixel is used for the +background. +Range checking is not performed on the background-pixel value; +it is simply truncated to the appropriate number of bits. +For a +ParentRelative +background, +the background tile origin always aligns with the parent's background tile +origin. +Otherwise, the background tile origin is always the window origin. + + +When no valid contents are available for regions of a window +and the regions are either visible or the server is maintaining backing store, +the server automatically tiles the regions with the window's background +unless the window has a background of +None. +If the background is +None, +the previous screen contents from other windows of the same depth as the window +are simply left in place if the contents come from the parent of the window +or an inferior of the parent; +otherwise, the initial contents of the exposed regions are undefined. +Exposure events are then generated for the regions, even if the background is +None. + + +The border tile origin is always the same as the background tile origin. +If border-pixmap is given, +it overrides the default border-pixmap. +The border pixmap and the window must have the same root +and the same depth (or a +Match +error results). +Any size pixmap can be used, +although some sizes may be faster than others. +If +CopyFromParent +is given, the parent's border pixmap is copied (subsequent changes to +the parent's border attribute do not affect the child), +but the window must have the same depth as the parent (or a +Match +error results). +The pixmap might be copied by sharing the same pixmap object between the +child and parent or by making a complete copy of the pixmap contents. +If border-pixel is given, +it overrides the default border-pixmap and any border-pixmap given explicitly, +and a pixmap of undefined size filled with border-pixel is used for the border. +Range checking is not performed on the border-pixel value; +it is simply truncated to the appropriate number of bits. + + +Output to a window is always clipped to the inside of the window, +so that the border is never affected. + + +The bit-gravity defines which region of the window should be retained +if the window is resized, and win-gravity defines how the window should +be repositioned if the parent is resized (see +ConfigureWindow +request). + + +A backing-store of +WhenMapped +advises the server that maintaining contents of obscured regions +when the window is mapped would be beneficial. +A backing-store of +Always +advises the server that maintaining contents even when the window is +unmapped would be beneficial. +In this case, +the server may generate an exposure event when the window is created. +A value of +NotUseful +advises the server that maintaining contents is unnecessary, +although a server may still choose to maintain contents while the window +is mapped. +Note that if the server maintains contents, +then the server should maintain complete contents +not just the region within the parent boundaries, +even if the window is larger than its parent. +While the server maintains contents, +exposure events will not normally be generated, +but the server may stop maintaining contents at any time. + + +If save-under is +True, +the server is advised that when this window is +mapped, saving the contents of windows it obscures would be beneficial. + + +When the contents of obscured regions of a window are being maintained, +regions obscured by noninferior windows are included in the +destination (and source, when the window is the source) of graphics +requests, but regions obscured by inferior windows are not included. + + +The backing-planes indicates (with bits set to 1) which bit planes +of the window hold dynamic data that must be preserved in backing-stores +and during save-unders. +The backing-pixel specifies what value to use in planes not +covered by backing-planes. +The server is free to save only the specified bit planes in the backing-store +or save-under and regenerate the remaining planes with the specified pixel +value. +Any bits beyond the specified depth of the window in these +values are simply ignored. + + +Eventmask +Eventpropagation +The event-mask defines which events the client is interested in for +this window (or for some event types, inferiors of the window). +The do-not-propagate-mask defines which events should not be propagated to +ancestor windows when no client has the event type selected in this +window. + + +The override-redirect specifies whether map and configure requests on this +window should override a +SubstructureRedirect +on the parent, typically to inform a window manager not to tamper with +the window. + + +The colormap specifies the colormap that best reflects the true +colors of the window. +Servers capable of supporting multiple hardware colormaps may use this +information, and window managers may use it for +InstallColormap +requests. +The colormap must have the same visual type and root as the window (or a +Match +error results). +If +CopyFromParent +is specified, +the parent's colormap is copied (subsequent changes to the parent's +colormap attribute do not affect the child). +However, the window must have the same visual type as the parent (or a +Match +error results), and the parent must not have a colormap of +None +(or a +Match +error results). +For an explanation of +None, +see FreeColormap +request. +The colormap is copied by sharing the colormap object between the child +and the parent, +not by making a complete copy of the colormap contents. + + +If a cursor is specified, +it will be used whenever the pointer is in the window. +If +None +is specified, +the parent's cursor will be used when the pointer is in the window, +and any change in the parent's cursor will cause an immediate change +in the displayed cursor. + + +This request generates a +CreateNotify +event. + + +The background and border pixmaps and the cursor may be freed +immediately if no further explicit references to them are to be made. + + +Subsequent drawing into the background or border pixmap has an +undefined effect on the window state. +The server might or might not make a copy of the pixmap. + + +
+
+ ChangeWindowAttributes + ChangeWindowAttributes + + + + + + + + +window: WINDOW + + + + +value-mask: BITMASK + + + + +value-list: LISTofVALUE + + + + + + +Errors: +Access, +Colormap, +Cursor, +Match, +Pixmap, +Value, +Window + + + + + + + + + +The value-mask and value-list specify which attributes are to be changed. +The values and restrictions are the same as for +CreateWindow. + + +Setting a new background, whether by background-pixmap or +background-pixel, overrides any previous background. +Setting a new border, whether by border-pixel or border-pixmap, +overrides any previous border. + + +Changing the background does not cause the window contents to be changed. +Setting the border or changing the background such that the +border tile origin changes causes the border to be repainted. +Changing the background of a root window to +None +or +ParentRelative +restores the default background pixmap. +Changing the border of a root window to +CopyFromParent +restores the default border pixmap. + + +Changing the win-gravity does not affect the current position of the +window. + + +Changing the backing-store of an obscured window to +WhenMapped +or +Always +or changing the backing-planes, backing-pixel, or save-under of +a mapped window may have no immediate effect. + + +Multiple clients can select input on the same window; +their event-masks are disjoint. +When an event is generated, +it will be reported to all interested clients. +However, only one client at a time can select for +SubstructureRedirect, +only one client at a time can select for +ResizeRedirect, +and only one client at a time can select for +ButtonPress. +An attempt to violate these restrictions results in an +Access +error. + + +There is only one do-not-propagate-mask for a window, not one per +client. + + +Changing the colormap of a window (by defining a new map, not by +changing the contents of the existing map) generates a +ColormapNotify +event. +Changing the colormap of a visible window might have no immediate effect +on the screen (see +InstallColormap +request). + + +Changing the cursor of a root window to +None +restores the default cursor. + + +The order in which attributes are verified and altered is server-dependent. +If an error is generated, +a subset of the attributes may have been altered. + + +
+
+ GetWindowAttributes + GetWindowAttributes + + + + + + + + +window: WINDOW + + + + + + ▶ + + + + + +visual: VISUALID + + + + +class: +{ InputOutput, +InputOnly} + + + + +bit-gravity: BITGRAVITY + + + + +win-gravity: WINGRAVITY + + + + +backing-store: +{ NotUseful, +WhenMapped, +Always} + + + + +backing-planes: CARD32 + + + + +backing-pixel: CARD32 + + + + +save-under: BOOL + + + + +colormap: COLORMAP or +None + + + + +map-is-installed: BOOL + + + + +map-state: +{ Unmapped, +Unviewable, +Viewable} + + + + +all-event-masks, your-event-mask: SETofEVENT + + + + +do-not-propagate-mask: SETofDEVICEEVENT + + + + +override-redirect: BOOL + + + + + + +Errors: +Window + + + + + + + + + +This request returns the current attributes of the window. +A window is +Unviewable +if it is mapped but some ancestor is unmapped. +All-event-masks is the inclusive-OR of all event masks selected on the window +by clients. +Your-event-mask is the event mask selected by the querying client. + + +
+
+ DestroyWindow + DestroyWindow + + + + + + + + +window: WINDOW + + + + + + +Errors: +Window + + + + + + + + + +If the argument window is mapped, +an +UnmapWindow +request is performed automatically. +The window and all inferiors are then destroyed, and a +DestroyNotify +event is generated for each window. +The ordering of the +DestroyNotify +events is such that for any given window, +DestroyNotify +is generated on all inferiors of the window before being generated on +the window itself. +The ordering among siblings and across subhierarchies is not otherwise +constrained. + + +Normal exposure processing on formerly obscured windows is performed. + + +If the window is a root window, +this request has no effect. + + +
+
+ DestroySubwindows + DestroySubwindows + + + + + + + + +window: WINDOW + + + + + + +Errors: +Window + + + + + + + + + +This request performs a +DestroyWindow +request on all children of the window, in bottom-to-top stacking order. + + +
+
+ ChangeSaveSet + ChangeSaveSet + + + + + + + + +window: WINDOW + + + + +mode: +{ Insert, +Delete} + + + + + +Errors: + +Match, +Value, +Window + + + + + + + + + +This request adds or removes the specified window from the client's +save-set. +The window must have been created by some other client (or a +Match +error results). +For further information about the use of the save-set, +see section 10. + + +When windows are destroyed, +the server automatically removes them from the save-set. + + +
+
+ ReparentWindow + ReparentWindow + + + + + + + + +window, parent: WINDOW + + + + +x, y: INT16 + + + + + + +Errors: +Match, +Window + + + + + + + + + +If the window is mapped, +an +UnmapWindow +request is performed automatically first. +The window is then removed from its current position in the hierarchy +and is inserted as a child of the specified parent. +The x and y coordinates are relative to the parent's origin +and specify the new position of the upper-left outer corner of the +window. +The window is placed on top in the stacking order with respect +to siblings. +A +ReparentNotify +event is then generated. +The override-redirect attribute of the window is passed on in this event; +a value of +True +indicates that a window manager should not tamper with this window. +Finally, if the window was originally mapped, a +MapWindow +request is performed automatically. + + +Normal exposure processing on formerly obscured windows is performed. +The server might not generate exposure events for regions from the +initial unmap that are immediately obscured by the final map. + + +A +Match +error is generated if: + +The new parent is not on the same screen as the old parent. + +The new parent is the window itself or an inferior of the window. + +The new parent is +InputOnly, +and the window is not. + +The window has a +ParentRelative +background, and the new parent is not the same depth as the window. + + +
+
+ MapWindow + MapWindow + Mapped window + + + + + + + + +window: WINDOW + + + + + + +Errors: +Window + + + + + + + + + +If the window is already mapped, this request has no effect. + + +If the override-redirect attribute of the window is +False +and some other client has selected +SubstructureRedirect +on the parent, then a +MapRequest +event is generated, but the window remains unmapped. +Otherwise, the window is mapped, +and a +MapNotify +event is generated. + + +If the window is now viewable and its contents have been discarded, +the window is tiled with its background (if no background is defined, +the existing screen contents are not altered), and zero or more exposure +events are generated. +If a backing-store has been maintained while the window was unmapped, +no exposure events are generated. +If a backing-store will now be maintained, +a full-window exposure is always generated. +Otherwise, only visible regions may be reported. +Similar tiling and exposure take place for any newly viewable inferiors. + + +
+
+ MapSubwindows + MapSubwindows + + + + + + + + +window: WINDOW + + + + + + +Errors: +Window + + + + + + + + + +This request performs a +MapWindow +request on all unmapped children of the window, +in top-to-bottom stacking order. + + +
+
+ UnmapWindow + UnmapWindow + + + + + + + + +window: WINDOW + + + + + + +Errors: +Window + + + + + + + + + +If the window is already unmapped, this request has no effect. +Otherwise, the window is unmapped, and an +UnmapNotify +event is generated. +Normal exposure processing on formerly obscured windows is performed. + + +
+
+ UnmapSubwindows + UnmapSubwindows + + + + + + + + +window: WINDOW + + + + + + +Errors: +Window + + + + + + + + + +This request performs an +UnmapWindow +request on all mapped children of the window, +in bottom-to-top stacking order. + + +
+
+ ConfigureWindow + ConfigureWindow + + + + + + + + +window: WINDOW + + + + +value-mask: BITMASK + + + + +value-list: LISTofVALUE + + + + + + +Errors: +Match, +Value, +Window + + + + + + + + + +This request changes the configuration of the window. +The value-mask and value-list specify which values are to be given. +The possible values are: + + + + + + + + + + Attribute + Type + + + + + x + INT16 + + + y + INT16 + + + width + CARD16 + + + height + CARD16 + + + border-width + CARD16 + + + sibling + WINDOW + + + stack-mode + +{ Above, +Below, +TopIf, +BottomIf, +Opposite } + + + + + + + +The x and y coordinates are relative to the parent's origin +and specify the position of the upper-left outer corner of the window. +The width and height specify the inside size, not including the border, and +must be nonzero (or a +Value +error results). +Those values not specified are taken from the existing geometry of the window. +Note that changing just the border-width leaves the outer-left corner +of the window in a fixed position but moves the absolute position of the +window's origin. +It is a +Match +error to attempt to make the border-width of an +InputOnly +window nonzero. + + +If the override-redirect attribute of the window is +False +and some other client has selected +SubstructureRedirect +on the parent, a +ConfigureRequest +event is generated, and no further processing is performed. +Otherwise, the following is performed: + + +If some other client has selected +ResizeRedirect +on the window and the inside width or height of the window is being changed, +a +ResizeRequest +event is generated, +and the current inside width and height are used instead. +Note that the override-redirect attribute of the window has no effect on +ResizeRedirect +and that +SubstructureRedirect +on the parent has precedence over +ResizeRedirect +on the window. + + +Gravity +Bitgravity +Windowgravity +The geometry of the window is changed as specified, +the window is restacked among siblings, and a +ConfigureNotify +event is generated if the state of the window actually changes. +If the inside width or height of the window has actually changed, +then children of the window are affected, +according to their win-gravity. +Exposure processing is performed on formerly obscured windows +(including the window itself and its inferiors if regions of them were +obscured but now are not). +Exposure processing is also performed on any new regions of the window +(as a result of increasing the width or height) +and on any regions where window contents are lost. + + +If the inside width or height of a window is not changed +but the window is moved or its border is changed, +then the contents of the window are not lost but move with the window. +Changing the inside width or height of the window causes its contents to be +moved or lost, depending on the bit-gravity of the window. +It also causes children to be reconfigured, depending on their win-gravity. +For a change of width and height of W and H, +we define the [x, y] pairs as: + + + + + + + + + + Direction + Deltas + + + + + +NorthWest + + [0, 0] + + + +North + + [W/2, 0] + + + +NorthEast + + [W, 0] + + + +West + + [0, H/2] + + + +Center + + [W/2, H/2] + + + +East + + [W, H/2] + + + +SouthWest + + [0, H] + + + +South + + [W/2, H] + + + +SouthEast + + [W, H] + + + + + + +When a window with one of these bit-gravities is resized, +the corresponding pair defines the change in position of each pixel in the +window. +When a window with one of these win-gravities has its parent window resized, +the corresponding pair defines the change in position +of the window within the parent. +This repositioning generates a +GravityNotify +event. +GravityNotify +events are generated after the +ConfigureNotify +event is generated. + + +A gravity of +Static +indicates that the contents or origin should not move relative to the origin +of the root window. +If the change in size of the window is coupled with a change +in position of [X, Y], +then for bit-gravity the change in position of each pixel is [-X, -Y] and for +win-gravity the change in position of a child when its parent is so +resized is [-X, -Y]. +Note that +Static +gravity still only takes effect when the width or height of the +window is changed, not when the window is simply moved. + + +A bit-gravity of +Forget +indicates that the window contents are always discarded after a size change, +even if backing-store or save-under has been requested. +The window is tiled with its background (except, if no background is defined, +the existing screen contents are not altered) +and zero or more exposure events are generated. + + +The contents and borders of inferiors are not affected by their parent's +bit-gravity. +A server is permitted to ignore the specified bit-gravity and use +Forget +instead. + + +A win-gravity of +Unmap +is like +NorthWest, +but the child is also unmapped when the parent is resized, +and an +UnmapNotify +event is generated. +UnmapNotify +events are generated after the +ConfigureNotify +event is generated. + + +If a sibling and a stack-mode are specified, +the window is restacked as follows: + + + + + + + + + + +Above + + +The window is placed just above the sibling. + + + + +Below + + +The window is placed just below the sibling. + + + + +TopIf + + +If the sibling occludes the window, +then the window is placed at the top of the stack. + + + + +BottomIf + + +If the window occludes the sibling, +then the window is placed at the bottom of the stack. + + + + +Opposite + + +If the sibling occludes the window, +then the window is placed at the top of the stack. +Otherwise, if the window occludes the sibling, +then the window is placed at the bottom of the stack. + + + + + + + +If a stack-mode is specified but no sibling is specified, +the window is restacked as follows: + + + + + + + + + + +Above + + +The window is placed at the top of the stack. + + + + +Below + + +The window is placed at the bottom of the stack. + + + + +TopIf + + +If any sibling occludes the window, +then the window is placed at the top of the stack. + + + + +BottomIf + + +If the window occludes any sibling, +then the window is placed at the bottom of the stack. + + + + +Opposite + + +If any sibling occludes the window, +then the window is placed at the top of the stack. +Otherwise, if the window occludes any sibling, +then the window is placed at the bottom of the stack. + + + + + + + +It is a +Match +error if a sibling is specified without a stack-mode +or if the window is not actually a sibling. + + +Note that the computations for +BottomIf, +TopIf, +and +Opposite +are performed with respect to the window's final geometry (as controlled by +the other arguments to the request), not to its initial geometry. + + +Attempts to configure a root window have no effect. + + +
+
+ CirculateWindow + CirculateWindow + + + + + + + + +window: WINDOW + + + + +direction: +{ RaiseLowest, +LowerHighest} + + + + + + +Errors: +Value, +Window + + + + + + + + + +If some other client has selected +SubstructureRedirect +on the window, then a +CirculateRequest +event is generated, and no further processing is performed. +Otherwise, the following is performed, and then a +CirculateNotify +event is generated if the window is actually restacked. + + +For +RaiseLowest, +CirculateWindow +raises the lowest mapped child (if any) that is +occluded by another child to the top of the stack. +For +LowerHighest, +CirculateWindow +lowers the highest mapped child (if any) that occludes another child to +the bottom of the stack. +Exposure processing is performed on formerly obscured windows. + + +
+
+ GetGeometry + GetGeometry + + + + + + + + +drawable: DRAWABLE + + + + + + ▶ + + + + + +root: WINDOW + + + + +depth: CARD8 + + + + +x, y: INT16 + + + + +width, height, border-width: CARD16 + + + + + + +Errors: +Drawable + + + + + + + + + +This request returns the root and current geometry of the drawable. +The depth is the number of bits per pixel for the object. +The x, y, and border-width will always be zero for pixmaps. +For a window, +the x and y coordinates specify the upper-left outer corner of the window +relative to its parent's origin, +and the width and height specify the inside size, not including the border. + + +It is legal to pass an +InputOnly +window as a drawable to this request. + + +
+
+ QueryTree + QueryTree + Children + + + + + + + + +window: WINDOW + + + + + + ▶ + + + + + +root: WINDOW + + + + +parent: WINDOW or +None + + + + +children: LISTofWINDOW + + + + + + +Errors: +Window + + + + + + + + + +This request returns the root, the parent, and the children of the window. +The children are listed in bottom-to-top stacking order. + + +
+
+ InternAtom + InternAtom + Atom + + + + + + + + +name: STRING8 + + + + +only-if-exists: BOOL + + + + + + ▶ + + + + + +atom: ATOM or +None + + + + + + +Errors: +Alloc, +Value + + + + + + + + + +This request returns the atom for the given name. +If only-if-exists is +False, +then the atom is created if it does not exist. +The string should use the ISO Latin-1 encoding. +Uppercase and lowercase matter. + + +The lifetime of an atom is not tied to the interning client. +Atoms remain defined until server reset (see section 10). + + +
+
+ GetAtomName + GetAtomName + + + + + + + + +atom: ATOM + + + + + + ▶ + + + + + +name: STRING8 + + + + + + +Errors: +Atom + + + + + + + + + +This request returns the name for the given atom. + + +
+
+ ChangeProperty + ChangeProperty + Property + + + + + + + + +window: WINDOW + + + + +property, type: ATOM + + + + +format: {8, 16, 32} + + + + +mode: +{ Replace, +Prepend, +Append} + + + + +data: LISTofINT8 or LISTofINT16 or LISTofINT32 + + + + + + +Errors: +Alloc, +Atom, +Match, +Value, +Window + + + + + + + + + +This request alters the property for the specified window. +The type is uninterpreted by the server. +The format specifies whether the data should be viewed as a list of 8-bit, +16-bit, or 32-bit quantities so that the server can correctly byte-swap +as necessary. + + +If the mode is +Replace, +the previous property value is discarded. +If the mode is +Prepend +or +Append, +then the type and format must match the existing property value (or a +Match +error results). +If the property is undefined, +it is treated as defined with the correct type +and format with zero-length data. +For +Prepend, +the data is tacked on to the beginning of the existing data, and for +Append, +it is tacked on to the end of the existing data. + + +This request generates a +PropertyNotify +event on the window. + + +The lifetime of a property is not tied to the storing client. +Properties remain until explicitly deleted, until the window is destroyed, +or until server reset (see section 10). + + +The maximum size of a property is server-dependent and may vary dynamically. + + +
+
+ DeleteProperty + DeleteProperty + + + + + + + + +window: WINDOW + + + + +property: ATOM + + + + + + +Errors: +Atom, +Window + + + + + + + + + +This request deletes the property from the specified window +if the property exists and generates a +PropertyNotify +event on the window unless the property does not exist. + + +
+
+ GetProperty + GetProperty + + + + + + + + +window: WINDOW + + + + +property: ATOM + + + + +type: ATOM or +AnyPropertyType + + + + +long-offset, long-length: CARD32 + + + + +delete: BOOL + + + + + + ▶ + + + + + +type: ATOM or +None + + + + +format: {0, 8, 16, 32} + + + + +bytes-after: CARD32 + + + + +value: LISTofINT8 or LISTofINT16 or LISTofINT32 + + + + + + +Errors: +Atom, +Value, +Window + + + + + + + + + +If the specified property does not exist for the specified window, +then the return type is +None, +the format and bytes-after are zero, +and the value is empty. +The delete argument is ignored in this case. +If the specified property exists but its type does not match the specified type, +then the return type is the actual type of the property, +the format is the actual format of the property (never zero), +the bytes-after is the length of the property in bytes +(even if the format is 16 or 32), +and the value is empty. +The delete argument is ignored in this case. +If the specified property exists and either +AnyPropertyType +is specified or the specified type matches the actual type of the property, +then the return type is the actual type of the property, +the format is the actual format of the property (never zero), +and the bytes-after and value are as follows, given: + + N = actual length of the stored property in bytes + (even if the format is 16 or 32) + I = 4 * long-offset + T = N - I + L = MINIMUM(T, 4 * long-length) + A = N - (I + L) + + + +The returned value starts at byte index I in the property (indexing from 0), +and its length in bytes is L. +However, it is a +Value +error if long-offset is given such that L is negative. +The value of bytes-after is A, +giving the number of trailing unread bytes in the stored +property. +If delete is +True +and the bytes-after is zero, +the property is also deleted from the window, +and a +PropertyNotify +event is generated on the window. + + +
+
+ RotateProperties + RotateProperties + + + + + + + + +window: WINDOW + + + + +delta: INT16 + + + + +properties: LISTofATOM + + + + + + +Errors: +Atom, +Match, +Window + + + + + + + + + +If the property names in the list are viewed as being numbered starting +from zero, and there are N property names in the list, +then the value associated with property name I becomes the value +associated with property name (I + delta) mod N, for all I from zero to N - 1. +The effect is to rotate the states by delta places around the virtual ring +of property names (right for positive delta, left for negative delta). + + +If delta mod N is nonzero, +a +PropertyNotify +event is generated for each property in the order listed. + + +If an atom occurs more than once in the list or no property with that +name is defined for the window, +a +Match +error is generated. +If an +Atom +or +Match +error is generated, no properties are changed. + + +
+
+ ListProperties + ListProperties + + + + + + + + +window: WINDOW + + + + + + ▶ + + + + + +atoms: LISTofATOM + + + + + + +Errors: +Window + + + + + + + + + +This request returns the atoms of properties currently defined on the window. + + +
+
+ SetSelectionOwner + SetSelectionOwner + Selection + + + + + + + + +selection: ATOM + + + + +owner: WINDOW or +None + + + + +time: TIMESTAMP or +CurrentTime + + + + + + +Errors: +Atom, +Window + + + + + + + + + +This request changes the owner, owner window, +and last-change time of the specified selection. +This request has no effect if the specified time is earlier +than the current last-change time of the specified selection or is +later than the current server time. +Otherwise, the last-change time is set to the specified time +with +CurrentTime +replaced by the current server time. +If the owner window is specified as +None, +then the owner of the selection becomes +None +(that is, no owner). +Otherwise, the owner of the selection becomes the client executing the request. +If the new owner (whether a client or +None) +is not the same as the current owner +and the current owner is not +None, +then the current owner is sent a +SelectionClear +event. + + +If the client that is the owner of a selection is later terminated +(that is, its connection is closed) or if the owner window it has +specified in the request is later destroyed, +then the owner of the selection automatically reverts to +None, +but the last-change time is not affected. + + +The selection atom is uninterpreted by the server. +The owner window is returned by the +GetSelectionOwner +request and is reported in +SelectionRequest +and +SelectionClear +events. + + +Selections are global to the server. + + +
+
+ GetSelectionOwner + GetSelectionOwner + + + + + + + + +selection: ATOM + + + + + + ▶ + + + + + +owner: WINDOW or +None + + + + + + +Errors: +Atom + + + + + + + + + +This request returns the current owner window of the specified selection, +if any. +If +None +is returned, then there is no owner for the selection. + + +
+
+ ConvertSelection + ConvertSelection + + + + + + + + +selection, target: ATOM + + + + +property: ATOM or +None + + + + +requestor: WINDOW + + + + +time: TIMESTAMP or +CurrentTime + + + + + + +Errors: +Atom, +Window + + + + + + + + + +If the specified selection has an owner, +the server sends a +SelectionRequest +event to that owner. +If no owner for the specified selection exists, +the server generates a +SelectionNotify +event to the requestor with property +None. +The arguments are passed on unchanged in either of the events. + + +
+
+ SendEvent + SendEvent + Eventsending + + + + + + + + +destination: WINDOW or +PointerWindow +or +InputFocus + + + + +propagate: BOOL + + + + +event-mask: SETofEVENT + + + + +event: <normal-event-format> + + + + + + +Errors: +Value, +Window + + + + + + + + + +If +PointerWindow +is specified, +destination is replaced with the window that the pointer is in. +If +InputFocus +is specified and the focus window contains the pointer, +destination is replaced with the window that the pointer is in. +Otherwise, destination is replaced with the focus window. + + +If the event-mask is the empty set, +then the event is sent to the client that created the destination window. +If that client no longer exists, no event is sent. + + +If propagate is +False, +then the event is sent to every client selecting +on destination any of the event types in event-mask. + + +If propagate is +True +and no clients have selected on destination any +of the event types in event-mask, +then destination is replaced with the +closest ancestor of destination for which some client has selected a +type in event-mask and no intervening window has that type in its +do-not-propagate-mask. +If no such window exists or if the window is an ancestor of the focus window +and +InputFocus +was originally specified as the destination, +then the event is not sent to any clients. +Otherwise, the event is reported to every client selecting on the final +destination any of the types specified in event-mask. + + +The event code must be one of the core events or one of the events +defined by an extension (or a +Value +error results) so that the server can correctly byte-swap the +contents as necessary. +The contents of the event are otherwise unaltered and unchecked +by the server except to force on the most significant bit of the event code +and to set the sequence number in the event correctly. + + +Active grabs are ignored for this request. + + +
+
+ GrabPointer + GrabPointer + Active grabpointer + Pointergrabbing + + + + + + + + +grab-window: WINDOW + + + + +owner-events: BOOL + + + + +event-mask: SETofPOINTEREVENT + + + + +pointer-mode, keyboard-mode: +{ Synchronous, +Asynchronous} + + + + +confine-to: WINDOW or +None + + + + +cursor: CURSOR or +None + + + + +time: TIMESTAMP or +CurrentTime + + + + + + ▶ + + + + + +status: +{ Success, +AlreadyGrabbed, +Frozen, +InvalidTime, +NotViewable} + + + + + + +Errors: +Cursor, +Value, +Window + + + + + + + + + +This request actively grabs control of the pointer. +Further pointer events are only reported to the grabbing client. +The request overrides any active pointer grab by this client. + + +If owner-events is +False, +all generated pointer events are reported with respect to grab-window +and are only reported if selected by event-mask. +If owner-events is +True +and a generated pointer event would normally be reported to this client, +it is reported normally. +Otherwise, the event is reported with respect to the grab-window and is +only reported if selected by event-mask. +For either value of owner-events, +unreported events are simply discarded. + + +If pointer-mode is +Asynchronous, +pointer event processing continues normally. +If the pointer is currently frozen by this client, +then processing of pointer events is resumed. +If pointer-mode is +Synchronous, +the state of the pointer (as seen by means of the protocol) appears to freeze, +and no further pointer events are generated by the server until the +grabbing client issues a releasing +AllowEvents +request or until the pointer grab is released. +Actual pointer changes are not lost while the pointer is frozen. +They are simply queued for later processing. + + +If keyboard-mode is +Asynchronous, +keyboard event processing is unaffected by activation of the grab. +If keyboard-mode is +Synchronous, +the state of the keyboard (as seen by means of the protocol) appears to freeze, +and no further keyboard events are generated by the server until the grabbing +client issues a releasing +AllowEvents +request or until the pointer grab is released. +Actual keyboard changes are not lost while the keyboard is frozen. +They are simply queued for later processing. + + +If a cursor is specified, +then it is displayed regardless of what window the pointer is in. +If no cursor is specified, +then when the pointer is in grab-window or one of its subwindows, +the normal cursor for that window is displayed. +Otherwise, the cursor for grab-window is displayed. + + +If a confine-to window is specified, +then the pointer will be restricted to stay contained in that window. +The confine-to window need have no relationship to the grab-window. +If the pointer is not initially in the confine-to window, +then it is warped automatically to the closest edge +(and enter/leave events are generated normally) just before the grab activates. +If the confine-to window is subsequently reconfigured, +the pointer will be warped automatically as necessary to +keep it contained in the window. + + +This request generates +EnterNotify +and +LeaveNotify +events. + + +The request fails with status +AlreadyGrabbed +if the pointer is actively grabbed by some other client. +The request fails with status +Frozen +if the pointer is frozen by an active grab of another client. +The request fails with status +NotViewable +if grab-window or confine-to window is not viewable +or if the confine-to window lies completely outside the boundaries +of the root window. +The request fails with status +InvalidTime +if the specified time is earlier than the last-pointer-grab time or later than +the current server time. +Otherwise, the last-pointer-grab time is set to the specified time, with +CurrentTime +replaced by the current server time. + + +
+
+ UngrabPointer + UngrabPointer + + + + + + + + +time: TIMESTAMP or +CurrentTime + + + + + + + + + +This request releases the pointer if this client has it actively grabbed (from +either +GrabPointer +or +GrabButton +or from a normal button press) and releases any queued events. +The request has no effect if the specified time is earlier than +the last-pointer-grab time or is later than the current server time. + + +This request generates +EnterNotify +and +LeaveNotify +events. + + +An +UngrabPointer +request is performed automatically if the event window or +confine-to window for an active pointer grab becomes not viewable +or if window reconfiguration causes the confine-to window to lie +completely outside the boundaries of the root window. + + +
+
+ GrabButton + GrabButton + Buttongrabbing + + + + + + + + +modifiers: SETofKEYMASK or +AnyModifier + + + + +button: BUTTON or +AnyButton + + + + +grab-window: WINDOW + + + + +owner-events: BOOL + + + + +event-mask: SETofPOINTEREVENT + + + + +pointer-mode, keyboard-mode: +{ Synchronous, +Asynchronous} + + + + +confine-to: WINDOW or +None + + + + +cursor: CURSOR or +None + + + + + + +Errors: +Access, +Cursor, +Value, +Window + + + + + + + + + +This request establishes a passive grab. +Passive grabpointer +In the future, +the pointer is actively grabbed as described in +GrabPointer, +the last-pointer-grab time is set to the time at which the button was +pressed (as transmitted in the +ButtonPress +event), and the +ButtonPress +event is reported if all of the following conditions are true: + +The pointer is not grabbed and the specified button is logically pressed +when the specified modifier keys are logically down, +and no other buttons or modifier keys are logically down. + +The grab-window contains the pointer. + +The confine-to window (if any) is viewable. + +A passive grab on the same button/key combination does not exist +on any ancestor of grab-window. + + +The interpretation of the remaining arguments is the same as for +GrabPointer. +The active grab is terminated automatically when +the logical state of the pointer has all buttons released, +independent of the logical state of modifier keys. +Note that the logical state of a device (as seen by means of the protocol) +may lag the physical state if device event processing is frozen. + + +This request overrides all previous passive grabs by the same client on +the same button/key combinations on the same window. +A modifier of +AnyModifier +is equivalent to issuing the request for all possible modifier combinations +(including the combination of no modifiers). +It is not required that all specified modifiers have currently assigned +keycodes. +A button of +AnyButton +is equivalent to issuing the request for all possible buttons. +Otherwise, it is not required that the button specified currently be assigned +to a physical button. + + +An +Access +error is generated if some other client has already issued a +GrabButton +request with the same button/key combination on the same window. +When using +AnyModifier +or +AnyButton, +the request fails completely (no grabs are established), and an +Access +error is generated if there is a conflicting grab for any combination. +The request has no effect on an active grab. + + +
+
+ UngrabButton + UngrabButton + + + + + + + + +modifiers: SETofKEYMASK or +AnyModifier + + + + +button: BUTTON or +AnyButton + + + + +grab-window: WINDOW + + + + + + +Errors: +Value, +Window + + + + + + + + + +This request releases the passive button/key combination +on the specified window if it was grabbed by this client. +A modifiers argument of +AnyModifier +is equivalent to issuing the request for all possible modifier +combinations (including the combination of no modifiers). +A button of +AnyButton +is equivalent to issuing the request for all possible buttons. +The request has no effect on an active grab. + + +
+
+ ChangeActivePointerGrab + ChangeActivePointerGrab + Active grabpointer + + + + + + + + +event-mask: SETofPOINTEREVENT + + + + +cursor: CURSOR or +None + + + + +time: TIMESTAMP or +CurrentTime + + + + + + +Errors: +Cursor, +Value + + + + + + + + + +This request changes the specified dynamic parameters if the pointer is +actively grabbed by the client and the specified time is no earlier than the +last-pointer-grab time and no later than the current server time. +The interpretation of event-mask and cursor are the same as in +GrabPointer. +This request has no effect on the parameters of any passive grabs established +with +GrabButton. + + +
+
+ GrabKeyboard + GrabKeyboard + Active grabkeyboard + Keyboardgrabbing + + + + + + + + +grab-window: WINDOW + + + + +owner-events: BOOL + + + + +pointer-mode, keyboard-mode: +{ Synchronous, +Asynchronous} + + + + +time: TIMESTAMP or +CurrentTime + + + + + + ▶ + + + + + +status: +{ Success, +AlreadyGrabbed, +Frozen, +InvalidTime, +NotViewable} + + + + + + +Errors: +Value, +Window + + + + + + + + + +This request actively grabs control of the keyboard. +Further key events are reported only to the grabbing client. +This request overrides any active keyboard grab by this client. + + +If owner-events is +False, +all generated key events are reported with respect to grab-window. +If owner-events is +True +and if a generated key event would normally be reported to this client, +it is reported normally. +Otherwise, the event is reported with respect to the grab-window. +Both +KeyPress +and +KeyRelease +events are always reported, +independent of any event selection made by the client. + + +If keyboard-mode is +Asynchronous, +keyboard event processing continues normally. +If the keyboard is currently frozen by this client, +then processing of keyboard events is resumed. +If keyboard-mode is +Synchronous, +the state of the keyboard (as seen by means of the protocol) appears to freeze. +No further keyboard events are generated by the server until the +grabbing client issues a releasing +AllowEvents +request or until the keyboard grab is released. +Actual keyboard changes are not lost while the keyboard is frozen. +They are simply queued for later processing. + + +If pointer-mode is +Asynchronous, +pointer event processing is unaffected by activation of the grab. +If pointer-mode is +Synchronous, +the state of the pointer (as seen by means of the protocol) appears to freeze. +No further pointer events are generated by the server +until the grabbing client issues a releasing +AllowEvents +request or until the keyboard grab is released. +Actual pointer changes are not lost while the pointer is frozen. +They are simply queued for later processing. + + +This request generates +FocusIn +and +FocusOut +events. + + +The request fails with status +AlreadyGrabbed +if the keyboard is actively grabbed by some other client. +The request fails with status +Frozen +if the keyboard is frozen by an active grab of another client. +The request fails with status +NotViewable +if grab-window is not viewable. +The request fails with status +InvalidTime +if the specified time is earlier than the last-keyboard-grab time +or later than the current server time. +Otherwise, the last-keyboard-grab time is set to the specified time with +CurrentTime +replaced by the current server time. + + +
+
+ UngrabKeyboard + UngrabKeyboard + + + + + + + + +time: TIMESTAMP or +CurrentTime + + + + + + + + + +This request releases the keyboard if this client has it actively grabbed +(as a result of either +GrabKeyboard +or +GrabKey) +and releases any queued events. +The request has no effect if the specified time is earlier than the +last-keyboard-grab time or is later than the current server time. + + +This request generates +FocusIn +and +FocusOut +events. + + +An +UngrabKeyboard +is performed automatically if the event window for an active keyboard grab +becomes not viewable. + + +
+
+ GrabKey + GrabKey + Keygrabbing + + + + + + + + +key: KEYCODE or +AnyKey + + + + +modifiers: SETofKEYMASK or +AnyModifier + + + + +grab-window: WINDOW + + + + +owner-events: BOOL + + + + +pointer-mode, keyboard-mode: +{ Synchronous, +Asynchronous} + + + + + + +Errors: +Access, +Value, +Window + + + + + + + + + +This request establishes a passive grab on the keyboard. +Passive grabkeyboard +In the future, +the keyboard is actively grabbed as described in +GrabKeyboard, +the last-keyboard-grab time is set to the time at which the key was pressed +(as transmitted in the +KeyPress +event), and the +KeyPress +event is reported if all of the following conditions are true: + +The keyboard is not grabbed and the specified key +(which can itself be a modifier key) is logically pressed +when the specified modifier keys are logically down, +and no other modifier keys are logically down. + +Either the grab-window is an ancestor of (or is) the focus window, +or the grab-window is a descendent of the focus window and contains the pointer. + +A passive grab on the same key combination does not exist +on any ancestor of grab-window. + + +The interpretation of the remaining arguments is the same as for +GrabKeyboard. +The active grab is terminated automatically when the logical state +of the keyboard has the specified key released, +independent of the logical state of modifier keys. +Note that the logical state of a device (as seen by means of the protocol) +may lag the physical state if device event processing is frozen. + + +This request overrides all previous passive grabs by the same client +on the same key combinations on the same window. +A modifier of +AnyModifier +is equivalent to issuing the request for all possible modifier combinations +(including the combination of no modifiers). +It is not required that all modifiers specified have +currently assigned keycodes. +A key of +AnyKey +is equivalent to issuing the request for all possible keycodes. +Otherwise, the key must be in the range specified by min-keycode +and max-keycode in the connection setup (or a +Value +error results). + + +An +Access +error is generated if some other client has issued a +GrabKey +with the same key combination on the same window. +When using +AnyModifier +or +AnyKey, +the request fails completely (no grabs are established), +and an +Access +error is generated if there is a conflicting grab for any combination. + + +
+
+ UngrabKey + UngrabKey + + + + + + + + +key: KEYCODE or +AnyKey + + + + +modifiers: SETofKEYMASK or +AnyModifier + + + + +grab-window: WINDOW + + + + + + +Errors: +Value, +Window + + + + + + + + + +This request releases the key combination on the specified window +if it was grabbed by this client. +A modifiers argument of +AnyModifier +is equivalent to issuing the request for all possible modifier combinations +(including the combination of no modifiers). +A key of +AnyKey +is equivalent to issuing the request for all possible keycodes. +This request has no effect on an active grab. + + +
+
+ AllowEvents + AllowEvents + + + + + + + + +mode: +{ AsyncPointer, +SyncPointer, +ReplayPointer, +AsyncKeyboard, + + + + +SyncKeyboard, +ReplayKeyboard, +AsyncBoth, +SyncBoth} + + + + +time: TIMESTAMP or +CurrentTime + + + + + + +Errors: +Value + + + + + + + + + +This request releases some queued events if the client has caused a device to +freeze. +The request has no effect if the specified time is earlier +than the last-grab time of the most recent active grab for the client +or if the specified time is later than the current server time. + + +For +AsyncPointer, +if the pointer is frozen by the client, +pointer event processing continues normally. +If the pointer is frozen twice by the client on behalf of two separate grabs, +AsyncPointer +thaws for both. +AsyncPointer +has no effect if the pointer is not frozen by the client, +but the pointer need not be grabbed by the client. + + +For +SyncPointer, +if the pointer is frozen and actively grabbed by the client, +pointer event processing continues normally until the next +ButtonPress +or +ButtonRelease +event is reported to the client, +at which time the pointer again appears to freeze. +However, if the reported event causes the pointer grab to be released, +then the pointer does not freeze. +SyncPointer +has no effect if the pointer is not frozen by the +client or if the pointer is not grabbed by the client. + + +For +ReplayPointer, +if the pointer is actively grabbed by the client and +is frozen as the result of an event having been sent to the client +(either from the activation of a +GrabButton +or from a previous +AllowEvents +with mode +SyncPointer +but not from a +GrabPointer), +then the pointer grab is released and that event is completely reprocessed, +this time ignoring any passive grabs at or above (towards the root) +the grab-window of the grab just released. +The request has no effect if the pointer is not grabbed by the client +or if the pointer is not frozen as the result of an event. + + +For +AsyncKeyboard, +if the keyboard is frozen by the client, +keyboard event processing continues normally. +If the keyboard is frozen twice by the client on behalf of two separate grabs, +AsyncKeyboard +thaws for both. +AsyncKeyboard +has no effect if the keyboard is not frozen by the client, +but the keyboard need not be grabbed by the client. + + +For +SyncKeyboard, +if the keyboard is frozen and actively grabbed by the client, +keyboard event processing continues normally until the next +KeyPress +or +KeyRelease +event is reported to the client, +at which time the keyboard again appears to freeze. +However, if the reported event causes the keyboard grab to be released, +then the keyboard does not freeze. +SyncKeyboard +has no effect if the keyboard is not frozen by the client or +if the keyboard is not grabbed by the client. + + +For +ReplayKeyboard, +if the keyboard is actively grabbed by the client +and is frozen as the result of an event having been sent to the client +(either from the activation of a +GrabKey +or from a previous +AllowEvents +with mode +SyncKeyboard +but not from a +GrabKeyboard), +then the keyboard grab is released and that event is completely reprocessed, +this time ignoring any passive grabs at or above (towards the root) +the grab-window of the grab just released. +The request has no effect if the keyboard is not grabbed by the client +or if the keyboard is not frozen as the result of an event. + + +For +SyncBoth, +if both pointer and keyboard are frozen by the client, +event processing (for both devices) continues normally until the next +ButtonPress, +ButtonRelease, +KeyPress, +or +KeyRelease +event is reported to the client for a grabbed device +(button event for the pointer, key event for the keyboard), +at which time the devices again appear to freeze. +However, if the reported event causes the grab to be released, +then the devices do not freeze (but if the other device is still +grabbed, then a subsequent event for it will still cause both devices +to freeze). +SyncBoth +has no effect unless both pointer and keyboard are frozen by the client. +If the pointer or keyboard is frozen twice by the client on behalf +of two separate grabs, +SyncBoth +thaws for both (but a subsequent freeze for +SyncBoth +will only freeze each device once). + + +For +AsyncBoth, +if the pointer and the keyboard are frozen by the client, +event processing for both devices continues normally. +If a device is frozen twice by the client on behalf of two separate grabs, +AsyncBoth +thaws for both. +AsyncBoth +has no effect unless both pointer and keyboard are frozen by the client. + + +AsyncPointer, +SyncPointer, +and +ReplayPointer +have no effect on processing of keyboard events. +AsyncKeyboard, +SyncKeyboard, +and +ReplayKeyboard +have no effect on processing of pointer events. + + +It is possible for both a pointer grab and a keyboard grab to be active +simultaneously (by the same or different clients). +When a device is frozen on behalf of either grab, +no event processing is performed for the device. +It is possible for a single device to be frozen because of both grabs. +In this case, the freeze must be released on behalf of both grabs +before events can again be processed. +If a device is frozen twice by a single client, then a single +AllowEvents +releases both. + + +
+
+ GrabServer + GrabServer + Servergrabbing + +This request disables processing of requests and close-downs on all +connections other than the one this request arrived on. + + +
+
+ UngrabServer + UngrabServer + +This request restarts processing of requests and close-downs +on other connections. + + +
+
+ QueryPointer + QueryPointer + + + + + + + + +window: WINDOW + + + + + + ▶ + + + + + +root: WINDOW + + + + +child: WINDOW or +None + + + + +same-screen: BOOL + + + + +root-x, root-y, win-x, win-y: INT16 + + + + +mask: SETofKEYBUTMASK + + + + + + +Errors: +Window + + + + + + + + + +The root window the pointer is logically on and the pointer coordinates +relative to the root's origin are returned. +If same-screen is +False, +then the pointer is not on the same screen as the argument window, +child is +None, +and win-x and win-y are zero. +If same-screen is +True, +then win-x and win-y are the pointer coordinates relative to the +argument window's origin, and child is the child containing the +pointer, if any. +The current logical state of the modifier keys and the buttons +are also returned. +Note that the logical state of a device (as seen by means of the protocol) +may lag the physical state if device event processing is frozen. + + +
+
+ GetMotionEvents + GetMotionEvents + + + + + + + + +start, +stop: TIMESTAMP or +CurrentTime + + + + +window: WINDOW + + + + + + ▶ + + + + + +events: LISTofTIMECOORD + + + + + +where: + + + + +TIMECOORD: [x, y: INT16 + + + + + time: TIMESTAMP] + + + + + + + +Errors: +Window + + + + + + + + + +This request returns all events in the motion history buffer that fall +between the specified start and stop times (inclusive) +and that have coordinates that lie within (including borders) +the specified window at its present placement. +The x and y coordinates are reported relative to the origin of the window. + + +If the start time is later than the stop time or if the start time is +in the future, no events are returned. +If the stop time is in the future, it is equivalent to specifying +CurrentTime. + + +
+
+ TranslateCoordinates + TranslateCoordinates + Coordinate systemtranslating + + + + + + + + +src-window, dst-window: WINDOW + + + + +src-x, src-y: INT16 + + + + + + ▶ + + + + + +same-screen: BOOL + + + + +child: WINDOW or +None + + + + +dst-x, dst-y: INT16 + + + + + + +Errors: +Window + + + + + + + + + +The src-x and src-y coordinates are taken relative to src-window's +origin and are returned as dst-x and dst-y coordinates relative to +dst-window's origin. +If same-screen is +False, +then src-window and dst-window are on different screens, +and dst-x and dst-y are zero. +If the coordinates are contained in a mapped child of dst-window, +then that child is returned. + + +
+
+ WarpPointer + WarpPointer + + + + + + + + +src-window: WINDOW or +None + + + + +dst-window: WINDOW or +None + + + + +src-x, src-y: INT16 + + + + +src-width, src-height: CARD16 + + + + +dst-x, dst-y: INT16 + + + + + + +Errors: +Window + + + + + + + + + +If dst-window is +None, +this request moves the pointer by offsets [dst-x, dst-y] +relative to the current position of the pointer. +If dst-window is a window, +this request moves the pointer to [dst-x, dst-y] relative to dst-window's +origin. +However, if src-window is not +None, +the move only takes place if src-window contains the pointer +and the pointer is contained in the specified rectangle of src-window. + + +The src-x and src-y coordinates are relative to src-window's origin. +If src-height is zero, +it is replaced with the current height of src-window minus src-y. +If src-width is zero, +it is replaced with the current width of src-window minus src-x. + + +This request cannot be used to move the pointer outside the confine-to +window of an active pointer grab. +An attempt will only move the pointer as far as the closest edge +of the confine-to window. + + +This request will generate events just as if the user had instantaneously +moved the pointer. + + +
+
+ SetInputFocus + SetInputFocus + Input focus + + + + + + + + +focus: WINDOW or +PointerRoot +or +None + + + + +revert-to: +{ Parent, +PointerRoot, +None} + + + + +time: TIMESTAMP or +CurrentTime + + + + + + +Errors: +Match, +Value, +Window + + + + + + + + + +This request changes the input focus and the last-focus-change time. +The request has no effect if the specified time is earlier than the current +last-focus-change time or is later than the current server time. +Otherwise, the last-focus-change time is set to the specified time +with +CurrentTime +replaced by the current server time. + + +If +None +is specified as the focus, +all keyboard events are discarded until a new focus window is set. +In this case, the revert-to argument is ignored. + + +If a window is specified as the focus, +it becomes the keyboard's focus window. +If a generated keyboard event would normally be reported to +this window or one of its inferiors, the event is reported normally. +Otherwise, the event is reported with respect to the focus window. + + +If +PointerRoot +is specified as the focus, +the focus window is dynamically taken to be the root window of whatever screen +the pointer is on at each keyboard event. +In this case, +the revert-to argument is ignored. + + +This request generates +FocusIn +and +FocusOut +events. + + +The specified focus window must be viewable at the time of the request (or a +Match +error results). +If the focus window later becomes not viewable, +the new focus window depends on the revert-to argument. +If revert-to is +Parent, +the focus reverts to the parent (or the closest viewable ancestor) +and the new revert-to value is taken to be +None. +If revert-to is +PointerRoot +or +None, +the focus reverts to that value. +When the focus reverts, +FocusIn +and +FocusOut +events are generated, +but the last-focus-change time is not affected. + + +
+
+ GetInputFocus + GetInputFocus + + + + + + + + ▶ + + + + + +focus: WINDOW or +PointerRoot +or +None + + + + +revert-to: +{ Parent, +PointerRoot, +None} + + + + + + + + + +This request returns the current focus state. + + +
+
+ QueryKeymap + QueryKeymap + + + + + + + + ▶ + + + + + +keys: LISTofCARD8 + + + + + + + + + +This request returns a bit vector for the logical state of the keyboard. +Each bit set to 1 indicates that the corresponding key is currently pressed. +The vector is represented as 32 bytes. +Byte N (from 0) contains the bits for keys 8N to 8N + 7 +with the least significant bit in the byte representing key 8N. +Note that the logical state of a device (as seen by means of the protocol) +may lag the physical state if device event processing is frozen. + + +
+
+ OpenFont + OpenFont + Font + + + + + + + + +fid: FONT + + + + +name: STRING8 + + + + + + +Errors: +Alloc, +IDChoice, +Name + + + + + + + + + +This request loads the specified font, if necessary, +and associates identifier fid with it. +The font name should use the ISO Latin-1 encoding, +and uppercase and lowercase do not matter. +When the characters ? and * are used in a font name, a +pattern match is performed and any matching font is used. +In the pattern, +the ? character (octal value 77) will match any single character, +and the * character (octal value 52) will match any number +of characters. +A structured format for font names is specified in the +X.Org standard X Logical Font Description Conventions. + + +Fonts are not associated with a particular screen +and can be stored as a component of any graphics context. + + +
+
+ CloseFont + CloseFont + + + + + + + + +font: FONT + + + + + + +Errors: +Font + + + + + + + + + +This request deletes the association between the resource ID and the font. +The font itself will be freed when no other resource references it. + + +
+
+ QueryFont + QueryFont + + + + + + + + + + + +font: FONTABLE + + + + + + ▶ + + + + + +font-info: FONTINFO + + + + +char-infos: LISTofCHARINFO + + + + + + +where: + + + + +FONTINFO: + + +[draw-direction: +{ LeftToRight, +RightToLeft } + + + + +min-char-or-byte2, max-char-or-byte2: CARD16 + + + + +min-byte1, max-byte1: CARD8 + + + + +all-chars-exist: BOOL + + + + +default-char: CARD16 + + + + +min-bounds: CHARINFO + + + + +max-bounds: CHARINFO + + + + +font-ascent: INT16 + + + + +font-descent: INT16 + + + + +properties: LISTofFONTPROP] + + + + +FONTPROP: + + +[name: ATOM + + + + +value: <32-bit-value>] + + + + +CHARINFO: + + +[left-side-bearing: INT16 + + + + +right-side-bearing: INT16 + + + + +character-width: INT16 + + + + +ascent: INT16 + + + + +descent: INT16 + + + + +attributes: CARD16] + + + + + +Errors: +Font + + + + + + + + + +This request returns logical information about a font. +If a gcontext is given for font, +the currently contained font is used. + + +The draw-direction is just a hint +and indicates whether most char-infos have a positive, +LeftToRight, +or a negative, +RightToLeft, +character-width metric. +The core protocol defines no support for vertical text. + + +If min-byte1 and max-byte1 are both zero, +then min-char-or-byte2 specifies the linear character index corresponding +to the first element of char-infos, +and max-char-or-byte2 specifies the linear character index of the last element. +If either min-byte1 or max-byte1 are nonzero, +then both min-char-or-byte2 and max-char-or-byte2 will be less than 256, +and the 2-byte character index values corresponding to char-infos element N +(counting from 0) are: + + byte1 = N/D + min-byte1 + byte2 = N\\D + min-char-or-byte2 + + + +where: + + D = max-char-or-byte2 - min-char-or-byte2 + 1 + / = integer division + \\ = integer modulus + + + +If char-infos has length zero, +then min-bounds and max-bounds will be identical, +and the effective char-infos is one filled with this char-info, of length: + + L = D * (max-byte1 - min-byte1 + 1) + + + +That is, +all glyphs in the specified linear or matrix range have the same information, +as given by min-bounds (and max-bounds). +If all-chars-exist is +True, +then all characters in char-infos have nonzero bounding boxes. + + +The default-char specifies the character that will be used when an +undefined or nonexistent character is used. +Note that default-char is a CARD16, not CHAR2B. +For a font using 2-byte matrix format, +the default-char has byte1 in the most significant byte +and byte2 in the least significant byte. +If the default-char itself specifies an undefined or nonexistent character, +then no printing is performed for an undefined or nonexistent character. + + +The min-bounds and max-bounds contain the minimum and maximum values of +each individual CHARINFO component over all char-infos (ignoring +nonexistent characters). +The bounding box of the font (that is, the +smallest rectangle enclosing the shape obtained by superimposing all +characters at the same origin [x,y]) has its upper-left coordinate at: + + [x + min-bounds.left-side-bearing, y - max-bounds.ascent] + +with a width of: + + max-bounds.right-side-bearing - min-bounds.left-side-bearing + + + +and a height of: + + max-bounds.ascent + max-bounds.descent + + + +The font-ascent is the logical extent of the font above the baseline +and is used for determining line spacing. +Specific characters may extend beyond this. +The font-descent is the logical extent of the font at or below the baseline +and is used for determining line spacing. +Specific characters may extend beyond this. +If the baseline is at Y-coordinate y, +then the logical extent of the font is inclusive +between the Y-coordinate values (y - font-ascent) and (y + font-descent - 1). + + +A font is not guaranteed to have any properties. +The interpretation of the property value (for example, INT32, CARD32) +must be derived from a priori knowledge of the property. +A basic set of font properties is specified in the X.Org +standard X Logical Font Description Conventions. + + +For a character origin at [x,y], +the bounding box of a character (that is, +the smallest rectangle enclosing the character's shape), described in +terms of CHARINFO components, is a rectangle with its upper-left corner at: + + [x + left-side-bearing, y - ascent] + + + +with a width of: + + right-side-bearing - left-side-bearing + + + +and a height of: + + ascent + descent + + + +and the origin for the next character is defined to be: + + [x + character-width, y] + + + +Note that the baseline is logically viewed as being just below +nondescending characters (when descent is zero, only pixels with +Y-coordinates less than y are drawn) and that the origin is logically +viewed as being coincident with the left edge of a nonkerned character +(when left-side-bearing is zero, no pixels with X-coordinate less than +x are drawn). + + +Note that CHARINFO metric values can be negative. + + +A nonexistent character is represented with all CHARINFO components +zero. + + +The interpretation of the per-character attributes field is +server-dependent. + + +
+
+ QueryTextExtents + QueryTextExtents + + + + + + + + +font: FONTABLE + + + + +string: STRING16 + + + + + + ▶ + + + + + +draw-direction: +{ LeftToRight, +RightToLeft} + + + + +font-ascent: INT16 + + + + +font-descent: INT16 + + + + +overall-ascent: INT16 + + + + +overall-descent: INT16 + + + + +overall-width: INT32 + + + + +overall-left: INT32 + + + + +overall-right: INT32 + + + + + + +Errors: +Font + + + + + + + + + +This request returns the logical extents of the specified string of characters +in the specified font. +If a gcontext is given for font, +the currently contained font is used. +The draw-direction, font-ascent, and font-descent are the same as +described in +QueryFont. +The overall-ascent is the maximum of the ascent metrics of all characters +in the string, and the overall-descent is the maximum of the descent metrics. +The overall-width is the sum of the character-width metrics of all characters +in the string. +For each character in the string, +let W be the sum of the character-width metrics of all characters preceding it +in the string, +let L be the left-side-bearing metric of the character plus W, +and let R be the right-side-bearing metric of the character plus W. +The overall-left is the minimum L of all characters in the string, +and the overall-right is the maximum R. + + +For fonts defined with linear indexing rather than 2-byte matrix indexing, +the server will interpret each CHAR2B as a 16-bit number that +has been transmitted most significant byte first (that is, byte1 of the +CHAR2B is taken as the most significant byte). + + +Characters with all zero metrics are ignored. +If the font has no defined default-char, +then undefined characters in the string are also ignored. + + +
+
+ ListFonts + ListFonts + + + + + + + + +pattern: STRING8 + + + + +max-names: CARD16 + + + + + + ▶ + + + + + +names: LISTofSTRING8 + + + + + + + + + +This request returns a list +of available font names (as controlled by the font search path; see +SetFontPath +request) +that match the pattern. +At most, max-names names will be returned. +The pattern should use the ISO Latin-1 encoding, +and uppercase and lowercase do not matter. +In the pattern, +the ? character (octal value 77) will match any single character, +and the * character (octal value 52) will match any number +of characters. +The returned names are in lowercase. + + +
+
+ ListFontsWithInfo + ListFontsWithInfo + + + + + + + + +pattern: STRING8 + + + + +max-names: CARD16 + + + + + + ▶ + + + + + +name: STRING8 + + + + +info FONTINFO + + + + +replies-hint: CARD32 + + + + + + +where: + + + + + + +FONTINFO: <same type definition as in +QueryFont> + + + + + + + + +This request is similar to +ListFonts, +but it also returns information about each font. +The information returned for each font is identical to what +QueryFont +would return except that the per-character metrics are not returned. +Note that this request can generate multiple replies. +With each reply, +replies-hint may provide an indication of how many more fonts will be returned. +This number is a hint only and may be larger or smaller than +the number of fonts actually returned. +A zero value does not guarantee that no more fonts will be returned. +After the font replies, +a reply with a zero-length name is sent to indicate the end of the reply +sequence. + + +
+
+ SetFontPath + SetFontPath + + + + + + + + +path: LISTofSTRING8 + + + + + + +Errors: +Value + + + + + + + + + +This request defines the search path for font lookup. +There is only one search path per server, not one per client. +The interpretation of the strings is operating-system-dependent, +but the strings are intended to specify directories to be searched in the +order listed. + + +Setting the path to the empty list restores the default path defined +for the server. + + +As a side effect of executing this request, +the server is guaranteed to flush all cached information about fonts +for which there currently are no explicit resource IDs allocated. + + +The meaning of an error from this request is system specific. + + +
+
+ GetFontPath + GetFontPath + + + + + + + + ▶ + + + + + +path: LISTofSTRING8 + + + + + + + + + +This request returns the current search path for fonts. + + +
+
+ CreatePixmap + CreatePixmap + + + + + + + + +pid: PIXMAP + + + + +drawable: DRAWABLE + + + + +depth: CARD8 + + + + +width, height: CARD16 + + + + + + +Errors: +Alloc, +Drawable, +IDChoice, +Value + + + + + + + + + +This request creates a pixmap and assigns the identifier pid to it. +The width and height must be nonzero (or a +Value +error results). +The depth must be one of the depths supported by the root of the specified +drawable (or a +Value +error results). +The initial contents of the pixmap are undefined. + + +It is legal to pass an +InputOnly +window as a drawable to this request. + + +
+
+ FreePixmap + FreePixmap + + + + + + + + +pixmap: PIXMAP + + + + + + +Errors: +Pixmap + + + + + + + + + +This request deletes the association between the resource ID and the pixmap. +The pixmap storage will be freed when no other resource references it. + + +
+
+ CreateGC + CreateGC + Graphics context + + + + + + + + +cid: GCONTEXT + + + + +drawable: DRAWABLE + + + + +value-mask: BITMASK + + + + +value-list: LISTofVALUE + + + + + + +Errors: +Alloc, +Drawable, +Font, +IDChoice, +Match, +Pixmap, +Value + + + + + + + + + +This request creates a graphics context +and assigns the identifier cid to it. +The gcontext can be used with any destination drawable having the same root +and depth as the specified drawable; +use with other drawables results in a +Match +error. + + +The value-mask and value-list specify which components are to be +explicitly initialized. +The context components are: + + + + + + + + + + Component + Type + + + + + function + +{ Clear, +And, +AndReverse, +Copy, +AndInverted, +NoOp, +Xor, +Or, +Nor, +Equiv, +Invert, +OrReverse, +CopyInverted, +OrInverted, +Nand, +Set } + + + + plane-mask + CARD32 + + + foreground + CARD32 + + + background + CARD32 + + + line-width + CARD16 + + + line-style + +{ Solid, +OnOffDash, +DoubleDash } + + + + cap-style + +{ NotLast, +Butt, +Round, +Projecting } + + + + join-style + +{ Miter, +Round, +Bevel } + + + + fill-style + +{ Solid, +Tiled, +OpaqueStippled, +Stippled } + + + + fill-rule + +{ EvenOdd, +Winding } + + + + arc-mode + +{ Chord, +PieSlice } + + + + tile + PIXMAP + + + stipple + PIXMAP + + + tile-stipple-x-origin + INT16 + + + tile-stipple-y-origin + INT16 + + + font + FONT + + + subwindow-mode + +{ ClipByChildren, +IncludeInferiors } + + + + graphics-exposures + BOOL + + + clip-x-origin + INT16 + + + clip-y-origin + INT16 + + + clip-mask + +PIXMAP or +None + + + + dash-offset + CARD16 + + + dashes + CARD8 + + + + + + +Planemask +In graphics operations, +given a source and destination pixel, +the result is computed bitwise on corresponding bits of the pixels; +that is, a Boolean operation is performed in each bit plane. +The plane-mask restricts the operation to a subset of planes, +so the result is: + + + + ((src FUNC dst) AND plane-mask) OR (dst AND (NOT plane-mask)) + + + +Range checking is not performed on the values for foreground, background, +or plane-mask. +They are simply truncated to the appropriate number of bits. + + + +The meanings of the functions are: + + + + + + + + + + Function + Operation + + + + + +Clear + + 0 + + + +And + + src AND dst + + + +AndReverse + + src AND (NOT dst) + + + +Copy + + src + + + +AndInverted + + (NOT src) AND dst + + + +NoOp + + dst + + + +Xor + + src XOR dst + + + +Or + + src OR dst + + + +Nor + + (NOT src) AND (NOT dst) + + + +Equiv + + (NOT src) XOR dst + + + +Invert + + NOT dst + + + +OrReverse + + src OR (NOT dst) + + + +CopyInverted + + NOT src + + + +OrInverted + + (NOT src) OR dst + + + +Nand + + (NOT src) OR (NOT dst) + + + +Set + + 1 + + + + + + +Linedrawing +The line-width is measured in pixels and can be greater than or equal to +one, a wide line, or the special value zero, a thin line. + + + +Wide lines are drawn centered on the path described by the graphics request. +Unless otherwise specified by the join or cap style, +the bounding box of a wide line with endpoints [x1, y1], [x2, y2] and +width w is a rectangle with vertices at the following real coordinates: + + + + [x1-(w*sn/2), y1+(w*cs/2)], [x1+(w*sn/2), y1-(w*cs/2)], + [x2-(w*sn/2), y2+(w*cs/2)], [x2+(w*sn/2), y2-(w*cs/2)] + + + +The sn is the sine of the angle of the line and cs is the cosine of +the angle of the line. +A pixel is part of the line (and hence drawn) if the center of the pixel +is fully inside the bounding box, which is viewed as having infinitely thin +edges. +If the center of the pixel is exactly on the bounding box, +it is part of the line if and only if the interior is immediately to its right +(x increasing direction). +Pixels with centers on a horizontal edge are a special case and are part of +the line if and only if the interior or the boundary is immediately below +(y increasing direction) and if the interior or the boundary is immediately +to the right (x increasing direction). +Note that this description is a mathematical model describing the pixels +that are drawn for a wide line and does not imply that trigonometry is required +to implement such a model. +Real or fixed point arithmetic is recommended for computing the corners of the +line endpoints for lines greater than one pixel in width. + + +Thin lines (zero line-width) are nominally one pixel wide lines drawn using an +unspecified, device-dependent algorithm. +There are only two constraints on this algorithm. +First, if a line is drawn unclipped from [x1,y1] to [x2,y2] +and another line is drawn unclipped from [x1+dx,y1+dy] to [x2+dx,y2+dy], +then a point [x,y] is touched by drawing the first line if +and only if the point [x+dx,y+dy] is touched by drawing the second line. +Second, the effective set of points comprising a line cannot be affected +by clipping. +Thus, a point is touched in a clipped line if and only if the point lies +inside the clipping region and the point would be touched by the line +when drawn unclipped. + + +Note that a wide line drawn from [x1,y1] to [x2,y2] always draws the +same pixels as a wide line drawn from [x2,y2] to [x1,y1], not counting +cap-style and join-style. +Implementors are encouraged to make this property true for thin lines, +but it is not required. +A line-width of zero may differ from a line-width of one in which pixels +are drawn. +In general, +drawing a thin line will be faster than drawing a wide line of width one, +but thin lines may not mix well aesthetically with wide lines +because of the different drawing algorithms. +If it is desirable to obtain precise and uniform results across all displays, +a client should always use a line-width of one, rather than a line-width of +zero. + + +The line-style defines which sections of a line are drawn: + + + + + + + + + + +Solid + + +The full path of the line is drawn. + + + + +DoubleDash + + +The full path of the line is drawn, +but the even dashes are filled differently than the odd dashes +(see fill-style), with +Butt +cap-style used where even and odd dashes meet. + + + + +OnOffDash + + +Only the even dashes are drawn, +and cap-style applies to all internal ends of the individual dashes +(except +NotLast +is treated as +Butt). + + + + + + + +The cap-style defines how the endpoints of a path are drawn: + + + + + + + + + + +NotLast + + +The result is equivalent to +Butt, +except that for a line-width of zero the final endpoint is not drawn. + + + + +Butt + + +The result is square at the endpoint (perpendicular to the slope of the +line) with no projection beyond. + + + + +Round + + +The result is a circular arc with its diameter equal to the line-width, +centered on the endpoint; it is equivalent to +Butt +for line-width zero. + + + + +Projecting + + +The result is square at the end, but the path continues beyond the +endpoint for a distance equal to half the line-width; +it is equivalent to +Butt +for line-width zero. + + + + + + + + + +The join-style defines how corners are drawn for wide lines: + + + + + + + + + + +Miter + + +The outer edges of the two lines extend to meet at an angle. +However, if the angle is less than 11 degrees, a +Bevel +join-style is used instead. + + + + +Round + + +The result is a circular arc with a diameter equal to the line-width, +centered on the joinpoint. + + + + +Bevel + + +The result is +Butt +endpoint styles, and then the triangular notch is filled. + + + + + + + + +For a line with coincident endpoints (x1=x2, y1=y2), when the cap-style +is applied to both endpoints, the semantics depends on the line-width +and the cap-style: + + + + + + + + + + + +NotLast + + thin + +This is device-dependent, but the desired effect is that nothing is drawn. + + + + +Butt + + thin + +This is device-dependent, but the desired effect is that +a single pixel is drawn. + + + + +Round + + thin + +This is the same as +Butt/thin. + + + + +Projecting + + thin + +This is the same as +Butt/thin. + + + + +Butt + + wide + +Nothing is drawn. + + + + +Round + + wide + +The closed path is a circle, centered at the endpoint and +with a diameter equal to the line-width. + + + + +Projecting + + wide + +The closed path is a square, aligned with the coordinate axes, +centered at the endpoint and with sides equal to the line-width. + + + + + + + +For a line with coincident endpoints (x1=x2, y1=y2), +when the join-style is applied at one or both endpoints, +the effect is as if the line was removed from the overall path. +However, if the total path consists of (or is reduced to) a single point +joined with itself, +the effect is the same as when the cap-style is applied at both endpoints. + + +The tile/stipple represents an infinite two-dimensional plane +with the tile/stipple +replicated in all dimensions. When that plane is superimposed on +the drawable for use in a graphics operation, the upper-left corner +of some instance of the tile/stipple is at the coordinates within +the drawable specified by the tile/stipple origin. +The tile/stipple and clip origins are interpreted relative to the +origin of whatever destination drawable is specified in a graphics +request. + + +The tile pixmap must have the same root and depth as the gcontext (or a +Match +error results). +The stipple pixmap must have depth one and must have the same root +as the gcontext (or a +Match +error results). +For fill-style +Stippled +(but not fill-style +OpaqueStippled), +the stipple pattern is tiled in a single plane +and acts as an additional clip mask to be ANDed with the clip-mask. +Any size pixmap can be used for tiling or stippling, +although some sizes may be faster to use than others. + + +The fill-style defines the contents of the source for line, text, and +fill requests. +For all text and fill requests (for example, +PolyText8, +PolyText16, +PolyFillRectangle, +FillPoly, +and +PolyFillArc) +as well as for line requests with line-style +Solid, +(for example, +PolyLine, +PolySegment, +PolyRectangle, +PolyArc ) +and for the even dashes for line requests with line-style +OnOffDash +or +DoubleDash: + + + + + + + + + + +Solid + + Foreground + + + +Tiled + + Tile + + + +OpaqueStippled + + +A tile with the same width and height as stipple +but with background everywhere stipple has a zero +and with foreground everywhere stipple has a one + + + + +Stippled + + +Foreground masked by stipple + + + + + + + +For the odd dashes for line requests with line-style +DoubleDash: + + + + + + + + + + +Solid + + Background + + + +Tiled + + Same as for even dashes + + + +OpaqueStippled + + Same as for even dashes + + + +Stippled + + Background masked by stipple + + + + + + + +The dashes value allowed here is actually a simplified form of the more +general patterns that can be set with +SetDashes. +Specifying a value of N here is equivalent to specifying +the two element list [N, N] in +SetDashes. +The value must be nonzero (or a +Value +error results). +The meaning of dash-offset and dashes are explained in the +SetDashes +request. + + +Clipping region +The clip-mask restricts writes to the destination drawable. +Only pixels where the clip-mask has bits set to 1 are drawn. +Pixels are not drawn outside the area covered by the clip-mask +or where the clip-mask has bits set to 0. +The clip-mask affects all graphics requests, +but it does not clip sources. +The clip-mask origin is interpreted relative to the origin of whatever +destination drawable is specified in a graphics request. +If a pixmap is specified as the clip-mask, +it must have depth 1 and have the same root as the gcontext (or a +Match +error results). +If clip-mask is +None, +then pixels are always drawn, regardless of the clip origin. +The clip-mask can also be set with the +SetClipRectangles +request. + + +For +ClipByChildren, +both source and destination windows are additionally clipped by all viewable +InputOutput +children. +For +IncludeInferiors, +neither source nor destination window is clipped by inferiors. +This will result in including subwindow contents in the +source and drawing through subwindow boundaries of the destination. +The use of +IncludeInferiors +with a source or destination window of one depth with mapped inferiors +of differing depth is not illegal, +but the semantics is undefined by the core protocol. + + +Winding rule +Fill rule +The fill-rule defines what pixels are inside (that is, are drawn) for +paths given in +FillPoly +requests. +EvenOdd +means a point is inside if an infinite ray with the point as origin crosses +the path an odd number of times. +For +Winding, +a point is inside if an infinite ray with the point as origin crosses an +unequal number of clockwise and counterclockwise directed path segments. +A clockwise directed path segment is one that crosses the ray from left +to right as observed from the point. +A counter-clockwise segment is one that crosses the ray from right to left +as observed from the point. +The case where a directed line segment is coincident with the ray is +uninteresting because one can simply choose a different ray that is not +coincident with a segment. + + +For both fill rules, +a point is infinitely small and the path is an infinitely thin line. +A pixel is inside if the center point of the pixel is inside +and the center point is not on the boundary. +If the center point is on the boundary, +the pixel is inside if and only if the polygon interior is immediately +to its right (x increasing direction). +Pixels with centers along a horizontal edge are a special case +and are inside if and only if the polygon interior is immediately below +(y increasing direction). + + +The arc-mode controls filling in the +PolyFillArc +request. + + +The graphics-exposures flag controls +GraphicsExposure +event generation for +CopyArea +and +CopyPlane +requests (and any similar requests defined by extensions). + + +The default component values are: + + + + + + + + + + Component + Default + + + + + function + +Copy + + + + plane-mask + all ones + + + foreground + 0 + + + background + 1 + + + line-width + 0 + + + line-style + Solid + + + cap-style + Butt + + + join-style + Miter + + + fill-style + Solid + + + fill-rule + EvenOdd + + + arc-mode + PieSlice + + + tile + + +Pixmap of unspecified size filled with foreground pixel + + +(that is, client specified pixel if any, else 0) + + +(subsequent changes to foreground do not affect this pixmap) + + + + + stipple + +Pixmap of unspecified size filled with ones + + + + tile-stipple-x-origin + 0 + + + tile-stipple-y-origin + 0 + + + font + <server-dependent-font> + + + subwindow-mode + +ClipByChildren + + + + graphics-exposures + +True + + + + clip-x-origin + 0 + + + clip-y-origin + 0 + + + clip-mask + +None + + + + dash-offset + 0 + + + dashes + 4 (that is, the list [4, 4]) + + + + + + +Storing a pixmap in a gcontext might or might not result in a copy +being made. +If the pixmap is later used as the destination for a graphics request, +the change might or might not be reflected in the gcontext. +If the pixmap is used simultaneously in a graphics request +as both a destination and as a tile or stipple, +the results are not defined. + + +It is quite likely that some amount of gcontext information will be +cached in display hardware and that such hardware can only cache a +small number of gcontexts. +Given the number and complexity of components, +clients should view switching between gcontexts with nearly +identical state as significantly more expensive than making minor +changes to a single gcontext. + + +
+
+ ChangeGC + ChangeGC + + + + + + + + +gc: GCONTEXT + + + + +value-mask: BITMASK + + + + +value-list: LISTofVALUE + + + + + + +Errors: +Alloc, +Font, +GContext, +Match, +Pixmap, +Value + + + + + + + + + +This request changes components in gc. +The value-mask and value-list specify which components are to be changed. +The values and restrictions are the same +as for +CreateGC. + + +Changing the clip-mask also overrides any previous +SetClipRectangles +request on the context. +Changing dash-offset or dashes overrides any previous +SetDashes +request on the context. + + +The order in which components are verified and altered is server-dependent. +If an error is generated, +a subset of the components may have been altered. + + +
+
+ CopyGC + CopyGC + + + + + + + + +src-gc, dst-gc: GCONTEXT + + + + +value-mask: BITMASK + + + + + + +Errors: +Alloc, +GContext, +Match, +Value + + + + + + + + + +This request copies components from src-gc to dst-gc. +The value-mask specifies which components to copy, as for +CreateGC. +The two gcontexts must have the same root and the same depth (or a +Match +error results). + + +
+
+ SetDashes + SetDashes + + + + + + + + +gc: GCONTEXT + + + + +dash-offset: CARD16 + + + + +dashes: LISTofCARD8 + + + + + + +Errors: +Alloc, +GContext, +Value + + + + + + + + + +This request sets dash-offset and dashes in gc for dashed line styles. +Dashes cannot be empty (or a +Value +error results). +Specifying an odd-length list is equivalent to specifying the same list +concatenated with itself to produce an even-length list. +The initial and alternating elements of dashes are the even dashes; +the others are the odd dashes. +Each element specifies a dash length in pixels. +All of the elements must be nonzero (or a +Value +error results). +The dash-offset defines the phase of the pattern, +specifying how many pixels into dashes the pattern should actually begin in +any single graphics request. +Dashing is continuous through path elements combined with a join-style +but is reset to the dash-offset between each sequence of joined lines. + + +The unit of measure for dashes is the same as in the ordinary +coordinate system. +Ideally, a dash length is measured along the slope of the line, +but implementations are only required to match this ideal +for horizontal and vertical lines. +Failing the ideal semantics, +it is suggested that the length be measured along the major axis of the line. +The major axis is defined as the x axis for lines drawn at an angle of +between -45 and +45 degrees or between 135 and 225 degrees from the x axis. +For all other lines, the major axis is the y axis. + + +For any graphics primitive, the computation of the endpoint of an individual +dash only depends on the geometry of the primitive, the start position +of the dash, the direction of the dash, and the dash length. + + +For any graphics primitive, the total set of pixels used to render the +primitive (both even and odd numbered dash elements) with +DoubleDash +line-style is the same as the set of pixels used to render the +primitive with +Solid +line-style. + + +For any graphics primitive, if the primitive is drawn with +OnOffDash +or +DoubleDash +line-style unclipped at position [x,y] and again at position +[x+dx,y+dy], then a point [x1,y1] is included in a dash in the first +instance if and only if the point [x1+dx,y1+dy] is included in the dash in +the second instance. In addition, the effective set of points comprising a +dash cannot be affected by clipping. A point is included in a clipped dash +if and only if the point lies inside the clipping region and the point +would be included in the dash when drawn unclipped. + + +
+
+ SetClipRectangles + SetClipRectangles + + + + + + + + +gc: GCONTEXT + + + + +clip-x-origin, clip-y-origin: INT16 + + + + +rectangles: LISTofRECTANGLE + + + + +ordering: +{ UnSorted, +YSorted, +YXSorted, +YXBanded} + + + + + + +Errors: +Alloc, +GContext, +Match, +Value + + + + + + + + + +This request changes clip-mask in gc to the specified list of rectangles +and sets the clip origin. +Output will be clipped to remain contained within the rectangles. +The clip origin is interpreted relative to the origin of +whatever destination drawable is specified in a graphics request. +The rectangle coordinates are interpreted relative to the clip origin. +The rectangles should be nonintersecting, or graphics results will be +undefined. +Note that the list of rectangles can be empty, +which effectively disables output. +This is the opposite of passing +None +as the clip-mask in +CreateGC +and +ChangeGC. + + +If known by the client, +ordering relations on the rectangles can be specified with the ordering +argument. +This may provide faster operation by the server. +If an incorrect ordering is specified, +the server may generate a +Match +error, but it is not required to do so. +If no error is generated, +the graphics results are undefined. +UnSorted +means that the rectangles are in arbitrary order. +YSorted +means that the rectangles are nondecreasing in their Y origin. +YXSorted +additionally constrains +YSorted +order in that all rectangles with an equal Y origin are +nondecreasing in their X origin. +YXBanded +additionally constrains +YXSorted +by requiring that, for every possible Y scanline, +all rectangles that include that scanline have identical Y origins and Y +extents. + + +
+
+ FreeGC + FreeGC + + + + + + + + +gc: GCONTEXT + + + + + + +Errors: +GContext + + + + + + + + + +This request deletes the association between the resource ID and the gcontext +and destroys the gcontext. + + +
+
+ ClearArea + ClearArea + Background + + + + + + + +window: WINDOW + + + + +x, y: INT16 + + + + +width, height: CARD16 + + + + +exposures: BOOL + + + + + + +Errors: +Match, +Value, +Window + + + + + + + + + +The x and y coordinates are relative to the window's origin +and specify the upper-left corner of the rectangle. +If width is zero, +it is replaced with the current width of the window minus x. +If height is zero, +it is replaced with the current height of the window minus y. +If the window has a defined background tile, +the rectangle is tiled with a plane-mask of all ones and function of +Copy +and a subwindow-mode of +ClipByChildren. +If the window has background +None, +the contents of the window are not changed. +In either case, +if exposures is +True, +then one or more exposure events are generated for regions of the rectangle +that are either visible or are being retained in a backing store. + + +It is a +Match +error to use an +InputOnly +window in this request. + + +
+
+ CopyArea + CopyArea + + + + + + + + +src-drawable, dst-drawable: DRAWABLE + + + + +gc: GCONTEXT + + + + +src-x, src-y: INT16 + + + + +width, height: CARD16 + + + + +dst-x, dst-y: INT16 + + + + + + +Errors: +Drawable, +GContext, +Match + + + + + + + + + +This request combines the specified rectangle of src-drawable with the +specified rectangle of dst-drawable. +The src-x and src-y coordinates are relative to src-drawable's origin. +The dst-x and dst-y are relative to dst-drawable's origin, +each pair specifying the upper-left corner of the rectangle. +The src-drawable must have the same root and the same depth +as dst-drawable (or a +Match +error results). + + +If regions of the source rectangle are obscured and have not been retained +in backing store +or if regions outside the boundaries of the source drawable are specified, +then those regions are not copied, +but the following occurs on all corresponding destination regions that are +either visible or are retained in backing-store. +If the dst-drawable is a window with a background other than +None, +these corresponding destination regions are tiled +(with plane-mask of all ones and function +Copy) +with that background. +Regardless of tiling and whether the destination is a window or a pixmap, +if graphics-exposures in gc is +True, +then +GraphicsExposure +events for all corresponding destination regions are generated. + + +If graphics-exposures is +True +but no +GraphicsExposure +events are generated, +then a +NoExposure +event is generated. + + +GC components: function, plane-mask, subwindow-mode, +graphics-exposures, clip-x-origin, clip-y-origin, clip-mask + + +
+
+ CopyPlane + CopyPlane + + + + + + + + +src-drawable, dst-drawable: DRAWABLE + + + + +gc: GCONTEXT + + + + +src-x, src-y: INT16 + + + + +width, height: CARD16 + + + + +dst-x, dst-y: INT16 + + + + +bit-plane: CARD32 + + + + + + +Errors: +Drawable, +GContext, +Match, +Value + + + + + + + + + +The src-drawable must have the same root as dst-drawable (or a +Match +error results), but it need not have the same depth. +The bit-plane must have exactly one bit set to 1 and the value of bit-plane +must be less than %2 sup n% where n is the depth of src-drawable (or a +Value +error results). +Effectively, a pixmap of the same depth as dst-drawable and with size specified +by the source region is formed using the foreground/background pixels in gc +(foreground everywhere the bit-plane in src-drawable contains a bit set to 1, +background everywhere the bit-plane contains a bit set to 0), +and the equivalent of a +CopyArea +is performed, with all the same exposure semantics. +This can also be thought of as using the specified region of the source +bit-plane as a stipple with a fill-style of +OpaqueStippled +for filling a rectangular area of the destination. + + +GC components: function, plane-mask, foreground, background, +subwindow-mode, graphics-exposures, clip-x-origin, clip-y-origin, +clip-mask + + +
+
+ PolyPoint + PolyPoint + + + + + + + + +drawable: DRAWABLE + + + + +gc: GCONTEXT + + + + +coordinate-mode: +{ Origin, +Previous} + + + + +points: LISTofPOINT + + + + + + +Errors: +Drawable, +GContext, +Match, +Value + + + + + + + + + +This request combines the foreground pixel in gc with the pixel +at each point in the drawable. +The points are drawn in the order listed. + + +The first point is always relative to the drawable's origin. +The rest are relative either to that origin or the previous point, +depending on the coordinate-mode. + + +GC components: function, plane-mask, foreground, subwindow-mode, +clip-x-origin, clip-y-origin, clip-mask + + +
+
+ PolyLine + PolyLine + Linedrawing + + + + + + + + +drawable: DRAWABLE + + + + +gc: GCONTEXT + + + + +coordinate-mode: +{ Origin, +Previous} + + + + +points: LISTofPOINT + + + + + + +Errors: +Drawable, +GContext, +Match, +Value + + + + + + + + + +This request draws lines between each pair of points (point[i], point[i+1]). +The lines are drawn in the order listed. +The lines join correctly at all intermediate points, +and if the first and last points coincide, +the first and last lines also join correctly. + + +For any given line, +no pixel is drawn more than once. +If thin (zero line-width) lines intersect, +the intersecting pixels are drawn multiple times. +If wide lines intersect, +the intersecting pixels are drawn only once, as though the entire +PolyLine +were a single filled shape. + + +The first point is always relative to the drawable's origin. +The rest are relative either to that origin or the previous point, +depending on the coordinate-mode. + + +When either of the two lines involved in a +Bevel +join is neither vertical +nor horizontal, then the slope and position of the line segment defining +the bevel join edge is implementation dependent. However, the computation +of the slope and distance (relative to the join point) only depends on +the line width and the slopes of the two lines. + + +GC components: function, plane-mask, line-width, line-style, +cap-style, join-style, fill-style, subwindow-mode, clip-x-origin, +clip-y-origin, clip-mask + + +GC mode-dependent components: foreground, background, tile, stipple, +tile-stipple-x-origin, tile-stipple-y-origin, dash-offset, dashes + + +
+
+ PolySegment + PolySegment + + + + + + + + +drawable: DRAWABLE + + + + +gc: GCONTEXT + + + + +segments: LISTofSEGMENT + + + + + + +where: + + + + + + +SEGMENT: [x1, y1, x2, y2: INT16] + + + + + + +Errors: +Drawable, +GContext, +Match + + + + + + + + + +For each segment, +this request draws a line between [x1, y1] and [x2, y2]. +The lines are drawn in the order listed. +No joining is performed at coincident endpoints. +For any given line, +no pixel is drawn more than once. +If lines intersect, +the intersecting pixels are drawn multiple times. + + +GC components: function, plane-mask, line-width, line-style, +cap-style, fill-style, subwindow-mode, clip-x-origin, clip-y-origin, +clip-mask + + +GC mode-dependent components: foreground, background, tile, stipple, +tile-stipple-x-origin, tile-stipple-y-origin, dash-offset, dashes + + +
+
+ PolyRectangle + PolyRectangle + + + + + + + + +drawable: DRAWABLE + + + + +gc: GCONTEXT + + + + +rectangles: LISTofRECTANGLE + + + + + + +Errors: +Drawable, +GContext, +Match + + + + + + + + + +This request draws the outlines of the specified rectangles, as if a five-point +PolyLine +were specified for each rectangle: + + + + [x,y] [x+width,y] [x+width,y+height] [x,y+height] [x,y] + + + +The x and y coordinates of each rectangle are relative to the drawable's origin +and define the upper-left corner of the rectangle. + + +The rectangles are drawn in the order listed. +For any given rectangle, +no pixel is drawn more than once. +If rectangles intersect, +the intersecting pixels are drawn multiple times. + + +GC components: function, plane-mask, line-width, line-style, +cap-style, join-style, fill-style, subwindow-mode, clip-x-origin, +clip-y-origin, clip-mask + + +GC mode-dependent components: foreground, background, tile, stipple, +tile-stipple-x-origin, tile-stipple-y-origin, dash-offset, dashes + + +
+
+ PolyArc + PolyArc + + + + + + + + +drawable: DRAWABLE + + + + +gc: GCONTEXT + + + + +arcs: LISTofARC + + + + + + +Errors: +Drawable, +GContext, +Match + + + + + + + + + +This request draws circular or elliptical arcs. +Each arc is specified by a rectangle and two angles. +The angles are signed integers in degrees scaled by 64, +with positive indicating counterclockwise motion and +negative indicating clockwise motion. +The start of the arc is specified by angle1 relative to the three-o'clock +position from the center of the rectangle, +and the path and extent of the arc is specified by angle2 relative to the +start of the arc. +If the magnitude of angle2 is greater than 360 degrees, +it is truncated to 360 degrees. +The x and y coordinates of the rectangle are relative to the origin of +the drawable. +For an arc specified as [x,y,w,h,a1,a2], +the origin of the major and minor axes is at [x+(w/2),y+(h/2)], +and the infinitely thin path describing the entire circle/ellipse intersects +the horizontal axis at [x,y+(h/2)] and [x+w,y+(h/2)] and intersects the +vertical axis at [x+(w/2),y] and [x+(w/2),y+h]. +These coordinates are not necessarily integral; that is, +they are not truncated to discrete coordinates. + + +For a wide line with line-width lw, the ideal bounding outlines for filling +are given by the two infinitely thin paths consisting of all points whose +perpendicular distance from a tangent to the path of the circle/ellipse is +equal to lw/2 (which may be a fractional value). When the width and height +of the arc are not equal and both are nonzero, then the actual bounding +outlines are implementation dependent. However, the computation of the +shape and position of the bounding outlines (relative to the center of the +arc) only depends on the width and height of the arc and the +line-width. + + +The cap-style is applied the same as for a line corresponding to the +tangent of the circle/ellipse at the endpoint. When the angle of an arc +face is not an integral multiple of 90 degrees, and the width and height of +the arc are both are nonzero, then the shape and position of the cap at +that face is implementation dependent. However, for a +Butt +cap, the face +is defined by a straight line, and the computation of the position +(relative to the center of the arc) and the slope of the line only +depends on the width and height of the arc and the angle of the arc face. +For other cap styles, the computation of the position (relative to the +center of the arc) and the shape of the cap only depends on the width +and height of the arc, the line-width, the angle of the arc face, and the +direction (clockwise or counter clockwise) of the arc from the endpoint. + + +The join-style is applied the same as for two lines corresponding to the +tangents of the circles/ellipses at the join point. When the width and +height of both arcs are nonzero, and the angle of either arc face is not an +integral multiple of 90 degrees, then the shape of the join is +implementation dependent. However, the computation of the shape only +depends on the width and height of each arc, the line-width, the angles of +the two arc faces, the direction (clockwise or counter clockwise) of the +arcs from the join point, and the relative orientation of the two arc +center points. + + +For an arc specified as [x,y,w,h,a1,a2], +the angles must be specified in the effectively skewed coordinate system of +the ellipse (for a circle, the angles and coordinate systems are identical). +The relationship between these angles and angles expressed in the normal +coordinate system of the screen (as measured with a protractor) is as +follows: + + skewed-angle = atan(tan(normal-angle) * w/h) + adjust + + + +The skewed-angle and normal-angle are expressed in radians (rather +than in degrees scaled by 64) in the range [0,2*PI). +The atan returns a value in the range [-PI/2,PI/2]. +The adjust is: + + + + + + + + 0 + for normal-angle in the range [0,PI/2) + + + PI + for normal-angle in the range [PI/2,(3*PI)/2) + + + 2*PI + for normal-angle in the range [(3*PI)/2,2*PI) + + + + + + +The arcs are drawn in the order listed. +If the last point in one arc coincides with the first point in the following +arc, +the two arcs will join correctly. +If the first point in the first arc coincides with the last point +in the last arc, +the two arcs will join correctly. +For any given arc, +no pixel is drawn more than once. +If two arcs join correctly and the line-width is greater than zero +and the arcs intersect, +no pixel is drawn more than once. +Otherwise, the intersecting pixels of intersecting arcs are drawn multiple +times. +Specifying an arc with one endpoint and a clockwise extent draws the +same pixels as specifying the other endpoint and an equivalent +counterclockwise extent, except as it affects joins. + + +By specifying one axis to be zero, +a horizontal or vertical line can be drawn. + + +Angles are computed based solely on the coordinate system, +ignoring the aspect ratio. + + +GC components: function, plane-mask, line-width, line-style, +cap-style, join-style, fill-style, subwindow-mode, clip-x-origin, +clip-y-origin, clip-mask + + +GC mode-dependent components: foreground, background, tile, stipple, +tile-stipple-x-origin, tile-stipple-y-origin, dash-offset, dashes + + +
+
+ FillPoly + FillPoly + + + + + + + + +drawable: DRAWABLE + + + + +gc: GCONTEXT + + + + +shape: +{ Complex, +Nonconvex, +Convex} + + + + +coordinate-mode: +{ Origin, +Previous} + + + + +points: LISTofPOINT + + + + + + +Errors: +Drawable, +GContext, +Match, +Value + + + + + + + + + +This request fills the region closed by the specified path. +The path is closed automatically if the last point in the list does not +coincide with the first point. +No pixel of the region is drawn more than once. + + +The first point is always relative to the drawable's origin. +The rest are relative either to that origin or the previous point, +depending on the coordinate-mode. + + +The shape parameter may be used by the server to improve performance. +Complex +means the path may self-intersect. +Contiguous coincident points in the path are not treated +as self-intersection. + + +Nonconvex +means the path does not self-intersect, +but the shape is not wholly convex. +If known by the client, +specifying +Nonconvex +over +Complex +may improve performance. +If +Nonconvex +is specified for a self-intersecting path, +the graphics results are undefined. + + +Convex +means that for every pair of points inside the polygon, +the line segment connecting them does not intersect the path. +If known by the client, +specifying +Convex +can improve performance. +If +Convex +is specified for a path that is not convex, +the graphics results are undefined. + + +GC components: function, plane-mask, fill-style, fill-rule, +subwindow-mode, clip-x-origin, clip-y-origin, clip-mask + + +GC mode-dependent components: foreground, background, tile, stipple, +tile-stipple-x-origin, tile-stipple-y-origin + + +
+
+ PolyFillRectangle + PolyFillRectangle + + + + + + + + +drawable: DRAWABLE + + + + +gc: GCONTEXT + + + + +rectangles: LISTofRECTANGLE + + + + + + +Errors: +Drawable, +GContext, +Match + + + + + + + + + +This request fills the specified rectangles, as if a four-point +FillPoly +were specified for each rectangle: + + [x,y] [x+width,y] [x+width,y+height] [x,y+height] + + + +The x and y coordinates of each rectangle are relative to the drawable's origin +and define the upper-left corner of the rectangle. + + +The rectangles are drawn in the order listed. +For any given rectangle, +no pixel is drawn more than once. +If rectangles intersect, +the intersecting pixels are drawn multiple times. + + +GC components: function, plane-mask, fill-style, subwindow-mode, +clip-x-origin, clip-y-origin, clip-mask + + +GC mode-dependent components: foreground, background, tile, stipple, +tile-stipple-x-origin, tile-stipple-y-origin + + +
+
+ PolyFillArc + PolyFillArc + + + + + + + + +drawable: DRAWABLE + + + + +gc: GCONTEXT + + + + +arcs: LISTofARC + + + + + + +Errors: +Drawable, +GContext, +Match + + + + + + + + + +For each arc, +this request fills the region closed by the infinitely thin path +described by the specified arc and one or two line segments, +depending on the arc-mode. +For +Chord, +the single line segment joining the endpoints of the arc is used. +For +PieSlice, +the two line segments joining the endpoints of the arc with the center point +are used. + + +For an arc specified as [x,y,w,h,a1,a2], the origin of the major and minor +axes is at [x+(w/2),y+(h/2)], and the infinitely thin path describing the +entire circle/ellipse intersects the horizontal axis at [x,y+(h/2)] and +[x+w,y+(h/2)] and intersects the vertical axis at [x+(w/2),y] and +[x+(w/2),y+h]. These coordinates are not necessarily integral; that is, +they are not truncated to discrete coordinates. + + +The arc angles are interpreted as specified in the +PolyArc +request. When +the angle of an arc face is not an integral multiple of 90 degrees, then +the precise endpoint on the arc is implementation dependent. However, for +Chord +arc-mode, the computation of the pair of endpoints (relative to the +center of the arc) only depends on the width and height of the arc and +the angles of the two arc faces. For +PieSlice +arc-mode, the computation of +an endpoint only depends on the angle of the arc face for that +endpoint and the ratio of the arc width to arc height. + + +The arcs are filled in the order listed. +For any given arc, +no pixel is drawn more than once. +If regions intersect, +the intersecting pixels are drawn multiple times. + + +GC components: function, plane-mask, fill-style, arc-mode, +subwindow-mode, clip-x-origin, clip-y-origin, clip-mask + + +GC mode-dependent components: foreground, background, tile, stipple, +tile-stipple-x-origin, tile-stipple-y-origin + + +
+
+ PutImage + PutImage + + + + + + + + +drawable: DRAWABLE + + + + +gc: GCONTEXT + + + + +depth: CARD8 + + + + +width, height: CARD16 + + + + +dst-x, dst-y: INT16 + + + + +left-pad: CARD8 + + + + +format: +{ Bitmap, +XYPixmap, +ZPixmap} + + + + +data: LISTofBYTE + + + + + + +Errors: +Drawable, +GContext, +Match, +Value + + + + + + + + + +This request combines an image with a rectangle of the drawable. +The dst-x and dst-y coordinates are relative to the drawable's origin. + + +If +Bitmap +format is used, +then depth must be one (or a +Match +error results), and the image must be in XY format. +The foreground pixel in gc defines the source for bits set to 1 in the image, +and the background pixel defines the source for the bits set to 0. + + +For +XYPixmap +and +ZPixmap, +the depth must match the depth of the drawable (or a +Match +error results). +For +XYPixmap, +the image must be sent in XY format. +For +ZPixmap, +the image must be sent in the Z format defined for the given depth. + + +The left-pad must be zero for +ZPixmap +format (or a +Match +error results). +For +Bitmap +and +XYPixmap +format, +left-pad must be less than bitmap-scanline-pad as given in the server +connection setup information (or a +Match +error results). +The first left-pad bits in every scanline are to be ignored by the server. +The actual image begins that many bits into the data. +The width argument defines the width of the actual image +and does not include left-pad. + + +GC components: function, plane-mask, subwindow-mode, clip-x-origin, +clip-y-origin, clip-mask + + +GC mode-dependent components: foreground, background + + +
+
+ GetImage + GetImage + + + + + + + + +drawable: DRAWABLE + + + + +x, y: INT16 + + + + +width, height: CARD16 + + + + +plane-mask: CARD32 + + + + +format: +{ XYPixmap, +ZPixmap} + + + + + + ▶ + + + + + +depth: CARD8 + + + + +visual: VISUALID or +None + + + + +data: LISTofBYTE + + + + + + +Errors: +Drawable, +Match, +Value + + + + + + + + + +This request returns the contents of the given rectangle of the drawable in the +given format. +The x and y coordinates are relative to the drawable's origin +and define the upper-left corner of the rectangle. +If +XYPixmap +is specified, +only the bit planes specified in plane-mask are transmitted, +with the planes appearing from most significant to least significant +in bit order. +If +ZPixmap +is specified, then bits in all planes not specified in plane-mask are +transmitted as zero. +Range checking is not performed on plane-mask; +extraneous bits are simply ignored. +The returned depth is as specified when the drawable was created +and is the same as a depth component in a FORMAT structure (in the connection +setup), not a bits-per-pixel component. +If the drawable is a window, +its visual type is returned. +If the drawable is a pixmap, +the visual is +None. + + +If the drawable is a pixmap, +then the given rectangle must be wholly contained within the pixmap (or a +Match +error results). +If the drawable is a window, +the window must be viewable, +and it must be the case that, +if there were no inferiors or overlapping windows, +the specified rectangle of the window would be fully visible on the screen +and wholly contained within the outside edges of the window (or a +Match +error results). +Note that the borders of the window can be included and read with this request. +If the window has a backing store, +then the backing-store contents are returned for regions of the window +that are obscured by noninferior windows; +otherwise, the returned contents of such obscured regions are undefined. +Also undefined are the returned contents of visible +regions of inferiors of different depth than the specified window. +The pointer cursor image is not included in the contents returned. + + +This request is not general-purpose in the same sense as other +graphics-related requests. +It is intended specifically for rudimentary hardcopy support. + + +
+
+ PolyText8 + PolyText8 + + + + + + + + + + + +drawable: DRAWABLE + + + + +gc: GCONTEXT + + + + +x, y: INT16 + + + + +items: LISTofTEXTITEM8 + + + + + + +where: + + + + +TEXTITEM8: + + +TEXTELT8 or FONT + + + + +TEXTELT8: + + +[delta: INT8 + + + + +string: STRING8] + + + + + + +Errors: +Drawable, +Font, +GContext, +Match + + + + + + + + + +The x and y coordinates are relative to the drawable's origin +and specify the baseline starting position (the initial character origin). +Each text item is processed in turn. +A font item causes the font to be stored in gc +and to be used for subsequent text. +Switching among fonts does not affect the next character origin. +A text element delta specifies an additional change in the position +along the x axis before the string is drawn; +the delta is always added to the character origin. +Each character image, as defined by the font in gc, +is treated as an additional mask for a fill operation on the drawable. + + +All contained FONTs are always transmitted most significant byte first. + + +If a +Font +error is generated for an item, +the previous items may have been drawn. + + +For fonts defined with 2-byte matrix indexing, +each STRING8 byte is interpreted as a byte2 value of a CHAR2B with a byte1 +value of zero. + + +GC components: function, plane-mask, fill-style, font, +subwindow-mode, clip-x-origin, clip-y-origin, clip-mask + + +GC mode-dependent components: foreground, background, tile, stipple, +tile-stipple-x-origin, tile-stipple-y-origin + + +
+
+ PolyText16 + PolyText16 + + + + + + + + + + + +drawable: DRAWABLE + + + + +gc: GCONTEXT + + + + +x, y: INT16 + + + + +items: LISTofTEXTITEM16 + + + + + + +where: + + + + +TEXTITEM16: + + +TEXTELT16 or FONT + + + + +TEXTELT16: + + +[delta: INT8 + + + + +string: STRING16] + + + + + + +Errors: +Drawable, +Font, +GContext, +Match + + + + + + + + + +This request is similar to +PolyText8, +except 2-byte (or 16-bit) characters are used. +For fonts defined with linear indexing rather than 2-byte matrix indexing, +the server will interpret each CHAR2B as a 16-bit number that +has been transmitted most significant byte first (that is, byte1 of the +CHAR2B is taken as the most significant byte). + + +
+
+ ImageText8 + ImageText8 + + + + + + + + +drawable: DRAWABLE + + + + +gc: GCONTEXT + + + + +x, y: INT16 + + + + +string: STRING8 + + + + + + +Errors: +Drawable, +GContext, +Match + + + + + + + + + +The x and y coordinates are relative to the drawable's origin +and specify the baseline starting position (the initial character origin). +The effect is first to fill a destination rectangle with the background +pixel defined in gc and then to paint the text with the foreground pixel. +The upper-left corner of the filled rectangle is at: + + [x, y - font-ascent] + + + +the width is: + + overall-width + + + +and the height is: + + font-ascent + font-descent + + + +The overall-width, font-ascent, and font-descent are as +they would be returned by a +QueryTextExtents +call using gc and string. + + +The function and fill-style defined in gc are ignored for this request. +The effective function is +Copy, +and the effective fill-style +Solid. + + +For fonts defined with 2-byte matrix indexing, +each STRING8 byte is interpreted as a byte2 value of a CHAR2B with a byte1 +value of zero. + + +GC components: plane-mask, foreground, background, font, +subwindow-mode, clip-x-origin, clip-y-origin, clip-mask + + +
+
+ ImageText16 + ImageText16 + + + + + + + + +drawable: DRAWABLE + + + + +gc: GCONTEXT + + + + +x, y: INT16 + + + + +string: STRING16 + + + + + + +Errors: +Drawable, +GContext, +Match + + + + + + + + + +This request is similar to +ImageText8, +except 2-byte (or 16-bit) characters are used. +For fonts defined with linear indexing rather than 2-byte matrix indexing, +the server will interpret each CHAR2B as a 16-bit number that +has been transmitted most significant byte first (that is, byte1 of the +CHAR2B is taken as the most significant byte). + + +
+
+ CreateColormap + CreateColormap + Colormap + + + + + + + + +mid: COLORMAP + + + + +visual: VISUALID + + + + +window: WINDOW + + + + +alloc: +{ None, +All} + + + + + + +Errors: +Alloc, +IDChoice, +Match, +Value, +Window + + + + + + + + + +This request creates a colormap of the specified visual type for the screen +on which the window resides and associates the identifier mid with it. +The visual type must be one supported by the screen (or a +Match +error results). +The initial values of the colormap entries are undefined for classes +GrayScale, +PseudoColor, +and +DirectColor. +For +StaticGray, +StaticColor, +and +TrueColor, +the entries will have defined values, +but those values are specific to the visual and are not defined +by the core protocol. +For +StaticGray, +StaticColor, +and +TrueColor, +alloc must be specified as +None +(or a +Match +error results). +For the other classes, if alloc is +None, +the colormap initially has no allocated entries, +and clients can allocate entries. + + +If alloc is +All, +then the entire colormap is allocated writable. +The initial values of all allocated entries are undefined. +For +GrayScale +and +PseudoColor, +the effect is as if an +AllocColorCells +request returned all pixel values from zero to N - 1, +where N is the colormap-entries value in the specified visual. +For +DirectColor, +the effect is as if an +AllocColorPlanes +request returned a pixel value of zero and red-mask, +green-mask, and blue-mask values containing the same bits as the +corresponding masks in the specified visual. +However, +in all cases, none of these entries can be freed with +FreeColors. + + +
+
+ FreeColormap + FreeColormap + + + + + + + + +cmap: COLORMAP + + + + + + +Errors: +Colormap + + + + + + + + + +This request deletes the association between the resource ID and the colormap +and frees the colormap storage. +If the colormap is an installed map for a screen, +it is uninstalled (see +UninstallColormap +request). +If the colormap is defined as the colormap for a window (by means of +CreateWindow +or +ChangeWindowAttributes), +the colormap for the window is changed to +None, +and a +ColormapNotify +event is generated. +The protocol does not define the colors displayed for a window with a colormap of +None. + + +This request has no effect on a default colormap for a screen. + + +
+
+ CopyColormapAndFree + CopyColormapAndFree + + + + + + + + +mid, src-cmap: COLORMAP + + + + + + +Errors: +Alloc, +Colormap, +IDChoice + + + + + + + + + +This request creates a colormap of the same visual type +and for the same screen as src-cmap, +and it associates identifier mid with it. +It also moves all of the client's existing allocations from src-cmap +to the new colormap with their color values intact +and their read-only or writable characteristics intact, +and it frees those entries in src-cmap. +Color values in other entries in the new colormap are undefined. +If src-cmap was created by the client with alloc +All +(see +CreateColormap +request), +then the new colormap is also created with alloc +All, +all color values for all entries are copied from src-cmap, +and then all entries in src-cmap are freed. +If src-cmap was not created by the client with alloc +All, +then the allocations to be moved are all those pixels and planes that have +been allocated by the client using either +AllocColor, +AllocNamedColor, +AllocColorCells, +or +AllocColorPlanes +and that have not been freed since they were allocated. + + +
+
+ InstallColormap + InstallColormap + + + + + + + + +cmap: COLORMAP + + + + + + +Errors: +Colormap + + + + + + + + + +This request makes this colormap an installed map for its screen. +All windows associated with this colormap immediately display with true colors. +As a side effect, +additional colormaps might be implicitly installed +or uninstalled by the server. +Which other colormaps get installed or uninstalled is server-dependent +except that the required list must remain installed. + + +If cmap is not already an installed map, a +ColormapNotify +event is generated on every window having cmap as an attribute. +In addition, +for every other colormap that is installed or uninstalled as a result +of the request, a +ColormapNotify +event is generated on every window having that colormap as an attribute. + + +At any time, there is a subset of the installed maps that are viewed as an +ordered list and are called the required list. +The length of the required list is at most M, +where M is the min-installed-maps specified for the screen in the +connection setup. +The required list is maintained as follows. +When a colormap is an explicit argument to +InstallColormap, +it is added to the head of the list; the list is truncated at the +tail, if necessary, to keep the length of the list to at most M. +When a colormap is an explicit argument to +UninstallColormap +and it is in the required list, it is removed from the list. +A colormap is not added to the required list when it is installed implicitly +by the server, and the server cannot implicitly uninstall a colormap that is +in the required list. + + +Initially the default colormap for a screen is installed (but is not in +the required list). + + +
+
+ UninstallColormap + UninstallColormap + + + + + + + + +cmap: COLORMAP + + + + + + +Errors: +Colormap + + + + + + + + + +If cmap is on the required list for its screen (see +InstallColormap +request), +it is removed from the list. +As a side effect, +cmap might be uninstalled, +and additional colormaps might be implicitly installed or uninstalled. +Which colormaps get installed or uninstalled is server-dependent +except that the required list must remain installed. + + +If cmap becomes uninstalled, a +ColormapNotify +event is generated on every window having cmap as an attribute. +In addition, +for every other colormap that is installed or uninstalled as a result of +the request, a +ColormapNotify +event is generated on every window having that colormap as an attribute. + + +
+
+ ListInstalledColormaps + ListInstalledColormaps + + + + + + + + +window: WINDOW + + + + + + ▶ + + + + + +cmaps: LISTofCOLORMAP + + + + + + +Errors: +Window + + + + + + + + + +This request returns a list of the currently installed colormaps for the +screen of the specified window. +The order of colormaps is not significant, +and there is no explicit indication of the required list (see +InstallColormap +request). + + +
+
+ AllocColor + AllocColor + + + + + + + + +cmap: COLORMAP + + + + +red, green, blue: CARD16 + + + + + + ▶ + + + + + +pixel: CARD32 + + + + +red, green, blue: CARD16 + + + + + + +Errors: +Alloc, +Colormap + + + + + + + + + +This request allocates a read-only colormap entry corresponding to the closest +RGB values provided by the hardware. +It also returns the pixel and the RGB values actually used. +Multiple clients requesting the same effective RGB values can be assigned +the same read-only entry, allowing entries to be shared. + + +
+
+ AllocNamedColor + AllocNamedColor + + + + + + + + +cmap: COLORMAP + + + + +name: STRING8 + + + + + + ▶ + + + + + +pixel: CARD32 + + + + +exact-red, exact-green, exact-blue: CARD16 + + + + +visual-red, visual-green, visual-blue: CARD16 + + + + + + +Errors: +Alloc, +Colormap, +Name + + + + + + + + + +This request looks up the named color with respect to the screen associated +with the colormap. +Then, it does an +AllocColor +on cmap. +The name should use the ISO Latin-1 encoding, +and uppercase and lowercase do not matter. +The exact RGB values specify the true values for the color, +and the visual values specify the values actually used in the colormap. + + +
+
+ AllocColorCells + AllocColorCells + + + + + + + + +cmap: COLORMAP + + + + +colors, planes: CARD16 + + + + +contiguous: BOOL + + + + + + ▶ + + + + + +pixels, masks: LISTofCARD32 + + + + + + +Errors: +Alloc, +Colormap, +Value + + + + + + + + + +The number of colors must be positive, +and the number of planes must be nonnegative (or a +Value +error results). +If C colors and P planes are requested, +then C pixels and P masks are returned. +No mask will have any bits in common with any other mask +or with any of the pixels. +By ORing together masks and pixels, +C*%2 sup P% distinct pixels can be produced; +all of these are allocated writable by the request. +For +GrayScale +or +PseudoColor, +each mask will have exactly one bit set to 1; for +DirectColor, +each will have exactly three bits set to 1. +If contiguous is +True +and if all masks are ORed together, +a single contiguous set of bits will be formed for +GrayScale +or +PseudoColor, +and three contiguous sets of bits (one within each pixel subfield) for +DirectColor. +The RGB values of the allocated entries are undefined. + + +
+
+ AllocColorPlanes + AllocColorPlanes + + + + + + + + +cmap: COLORMAP + + + + +colors, reds, greens, blues: CARD16 + + + + +contiguous: BOOL + + + + + + ▶ + + + + + +pixels: LISTofCARD32 + + + + +red-mask, green-mask, blue-mask: CARD32 + + + + + + +Errors: +Alloc, +Colormap, +Value + + + + + + + + + +The number of colors must be positive, +and the reds, greens, and blues must be nonnegative (or a +Value +error results). +If C colors, R reds, G greens, and B blues are requested, +then C pixels are returned, and the masks have R, G, and B bits set, +respectively. +If contiguous is +True, +then each mask will have a contiguous set of bits. +No mask will have any bits in common with any other mask +or with any of the pixels. +For +DirectColor, +each mask will lie within the corresponding pixel subfield. +By ORing together subsets of masks with pixels, +C*%2 sup R+G+B% distinct pixels can be produced; +all of these are allocated writable by the request. +The initial RGB values of the allocated entries are undefined. +In the colormap, +there are only C*%2 sup R% independent red entries, +C*%2 sup G% independent green entries, +and C*%2 sup B% independent blue entries. +This is true even for +PseudoColor. +When the colormap entry for a pixel value is changed using +StoreColors +or +StoreNamedColor, +the pixel is decomposed according to the masks and the +corresponding independent entries are updated. + + +
+
+ FreeColors + FreeColors + + + + + + + + +cmap: COLORMAP + + + + +pixels: LISTofCARD32 + + + + +plane-mask: CARD32 + + + + + + +Errors: +Access, +Colormap, +Value + + + + + + + + + +The plane-mask should not have any bits in common with any of the +pixels. +The set of all pixels is produced by ORing together subsets of +plane-mask with the pixels. +The request frees all of these pixels that +were allocated by the client (using +AllocColor, +AllocNamedColor, +AllocColorCells, +and +AllocColorPlanes). +Note that freeing an +individual pixel obtained from +AllocColorPlanes +may not actually allow it to be reused until all of its related pixels +are also freed. +Similarly, a read-only entry is not actually freed until it has been +freed by all clients, and if a client allocates the same read-only entry +multiple times, it must free the entry that many times before the +entry is actually freed. + + +All specified pixels that are allocated by the client in cmap are freed, +even if one or more pixels produce an error. +A +Value +error is generated if a specified pixel is not a valid index into cmap. +An +Access +error is generated if a specified pixel is not allocated by the +client (that is, is unallocated or is only allocated by another client) +or if the colormap was created with all entries writable (using an alloc +value of +All +in +CreateColormap). +If more than one pixel is in error, +it is arbitrary as to which pixel is reported. + + +
+
+ StoreColors + StoreColors + + + + + + + + +cmap: COLORMAP + + + + +items: LISTofCOLORITEM + + + + +where: + + + + + + + + + + + + + COLORITEM: + [pixel: CARD32 + + + + +do-red, do-green, do-blue: BOOL + + + + + +red, green, blue: CARD16] + + + + + + + + + + +Errors: +Access, +Colormap, +Value + + + + + + + +This request changes the colormap entries of the specified pixels. +The do-red, do-green, and do-blue fields indicate which components +should actually be changed. +If the colormap is an installed map for its screen, +the changes are visible immediately. + + +All specified pixels that are allocated writable in cmap (by any client) +are changed, even if one or more pixels produce an error. +A +Value +error is generated if a specified pixel is not a valid index into cmap, and an +Access +error is generated if a specified pixel is unallocated or is allocated +read-only. +If more than one pixel is in error, +it is arbitrary as to which pixel is reported. + + +
+
+ StoreNamedColor + StoreNamedColor + + + + + + + + +cmap: COLORMAP + + + + +pixel: CARD32 + + + + +name: STRING8 + + + + +do-red, do-green, do-blue: BOOL + + + + + + +Errors: +Access, +Colormap, +Name, +Value + + + + + + + + + +This request looks up the named color with respect to the screen associated +with cmap and then does a +StoreColors +in cmap. +The name should use the ISO Latin-1 encoding, +and uppercase and lowercase do not matter. +The +Access +and +Value +errors are the same as in +StoreColors. + + +
+
+ QueryColors + QueryColors + + + + + + + + +cmap: COLORMAP + + + + +pixels: LISTofCARD32 + + + + + + ▶ + + + + + +colors: LISTofRGB + + + + + + +where: + + + + + + +RGB: [red, green, blue: CARD16] + + + + + + +Errors: +Colormap, +Value + + + + + + + + + +This request returns the hardware-specific color values stored in cmap for +the specified pixels. +The values returned for an unallocated entry are undefined. +A +Value +error is generated if a pixel is not a valid index into cmap. +If more than one pixel is in error, +it is arbitrary as to which pixel is reported. + + +
+
+ LookupColor + LookupColor + + + + + + + + +cmap: COLORMAP + + + + +name: STRING8 + + + + + + ▶ + + + + + +exact-red, exact-green, exact-blue: CARD16 + + + + +visual-red, visual-green, visual-blue: CARD16 + + + + + + +Errors: +Colormap, +Name + + + + + + + + + +This request looks up the string name of a color with respect to the screen +associated with cmap and returns both the exact color values and +the closest values provided by the hardware with respect to the visual +type of cmap. +The name should use the ISO Latin-1 encoding, +and uppercase and lowercase do not matter. + + +
+
+ CreateCursor + CreateCursor + Cursor + + + + + + + + +cid: CURSOR + + + + +source: PIXMAP + + + + +mask: PIXMAP or +None + + + + +fore-red, fore-green, fore-blue: CARD16 + + + + +back-red, back-green, back-blue: CARD16 + + + + +x, y: CARD16 + + + + + + +Errors: +Alloc, +IDChoice, +Match, +Pixmap + + + + + + + + + +This request creates a cursor and associates identifier cid with it. +The foreground and background RGB values must be specified, +even if the server only has a +StaticGray +or +GrayScale +screen. +The foreground is used for the bits set to 1 in the source, +and the background is used for the bits set to 0. +Both source and mask (if specified) must have depth one (or a +Match +error results), but they can have any root. +The mask pixmap defines the shape of the cursor. +That is, +the bits set to 1 in the mask define which source pixels will be displayed, +and where the mask has bits set to 0, +the corresponding bits of the source pixmap are ignored. +If no mask is given, +all pixels of the source are displayed. +The mask, if present, must be the same size as the source (or a +Match +error results). +The x and y coordinates define the hotspot relative to the source's origin +and must be a point within the source (or a +Match +error results). + + +The components of the cursor may be transformed arbitrarily to meet +display limitations. + + +The pixmaps can be freed immediately if no further explicit references +to them are to be made. + + +Subsequent drawing in the source or mask pixmap has an undefined effect +on the cursor. +The server might or might not make a copy of the pixmap. + + +
+
+ CreateGlyphCursor + CreateGlyphCursor + + + + + + + + +cid: CURSOR + + + + +source-font: FONT + + + + +mask-font: FONT or +None + + + + +source-char, mask-char: CARD16 + + + + +fore-red, fore-green, fore-blue: CARD16 + + + + +back-red, back-green, back-blue: CARD16 + + + + + + +Errors: +Alloc, +Font, +IDChoice, +Value + + + + + + + + + +This request is similar to +CreateCursor, +except the source and mask bitmaps are obtained from the specified font glyphs. +The source-char must be a defined glyph in source-font, +and if mask-font is given, mask-char must be a defined glyph in mask-font +(or a +Value +error results). +The mask font and character are optional. +The origins of the source and mask (if it is defined) glyphs +are positioned coincidently and define the hotspot. +The source and mask need not have the same bounding box metrics, +and there is no restriction on the placement of the hotspot relative +to the bounding boxes. +If no mask is given, +all pixels of the source are displayed. +Note that source-char and mask-char are CARD16, not CHAR2B. +For 2-byte matrix fonts, +the 16-bit value should be formed with byte1 in the most significant byte +and byte2 in the least significant byte. + + +The components of the cursor may be transformed arbitrarily to meet +display limitations. + + +The fonts can be freed immediately if no further explicit references to +them are to be made. + + +
+
+ FreeCursor + FreeCursor + + + + + + + + +cursor: CURSOR + + + + + + +Errors: +Cursor + + + + + + + + + +This request deletes the association between the resource ID and the cursor. +The cursor storage will be freed when no other resource references it. + + +
+
+ RecolorCursor + RecolorCursor + + + + + + + + +cursor: CURSOR + + + + +fore-red, fore-green, fore-blue: CARD16 + + + + +back-red, back-green, back-blue: CARD16 + + + + + + +Errors: +Cursor + + + + + + + + + +This request changes the color of a cursor. +If the cursor is being displayed on a screen, +the change is visible immediately. + + +
+
+ QueryBestSize + QueryBestSize + + + + + + + + +class: +{ Cursor, +Tile, +Stipple} + + + + +drawable: DRAWABLE + + + + +width, height: CARD16 + + + + + + ▶ + + + + + +width, height: CARD16 + + + + + + +Errors: +Drawable, +Match, +Value + + + + + + + + + +This request returns the best size that is closest to the argument size. +For +Cursor, +this is the largest size that can be fully displayed. +For +Tile, +this is the size that can be tiled fastest. +For +Stipple, +this is the size that can be stippled fastest. + + +For +Cursor, +the drawable indicates the desired screen. +For +Tile +and +Stipple, +the drawable indicates the screen and also possibly the window class and depth. +An +InputOnly +window cannot be used as the drawable for +Tile +or +Stipple +(or a +Match +error results). + + +
+
+ QueryExtension + QueryExtension + Extensionquerying + + + + + + + + +name: STRING8 + + + + + + ▶ + + + + + +present: BOOL + + + + +major-opcode: CARD8 + + + + +first-event: CARD8 + + + + +first-error: CARD8 + + + + + + + + + +This request determines if the named extension is present. +If so, +the major opcode for the extension is returned, if it has one. +Otherwise, zero is returned. +Any minor opcode and the request formats are specific to the extension. +If the extension involves additional event types, +the base event type code is returned. +Otherwise, zero is returned. +The format of the events is specific to the extension. +If the extension involves additional error codes, +the base error code is returned. +Otherwise, zero is returned. +The format of additional data in the errors is specific to the extension. + + +The extension name should use the ISO Latin-1 encoding, +and uppercase and lowercase matter. + + +
+
+ ListExtensions + ListExtensions + Extensionlisting + + + + + + + + ▶ + + + + + +names: LISTofSTRING8 + + + + + + + + + +This request returns a list of all extensions supported by the server. + +
+
+ SetModifierMapping + SetModifierMapping + Modifier keys + + + + + + + + +keycodes-per-modifier: CARD8 + + + + +keycodes: LISTofKEYCODE + + + + + + ▶ + + + + + +status: +{ Success, +Busy, +Failed} + + + + + + +Errors: +Alloc, +Value + + + + + + + + + +This request specifies the keycodes (if any) of the keys to be used as +modifiers. +The number of keycodes in the list must be 8*keycodes-per-modifier (or a +Length +error results). +The keycodes are divided into eight sets, +with each set containing keycodes-per-modifier elements. +The sets are assigned to the modifiers +Shift, +Lock, +Control, +Mod1, +Mod2, +Mod3, +Mod4, +and +Mod5, +in order. +Only nonzero keycode values are used within each set; +zero values are ignored. +All of the nonzero keycodes must be in the range specified by min-keycode +and max-keycode in the connection setup (or a +Value +error results). +The order of keycodes within a set does not matter. +If no nonzero values are specified in a set, +the use of the corresponding modifier is disabled, +and the modifier bit will always be zero. +Otherwise, the modifier bit will be one whenever +at least one of the keys in the corresponding set is in the down +position. + + +A server can impose restrictions on how modifiers can be changed (for example, +if certain keys do not generate up transitions in hardware, +if auto-repeat cannot be disabled on certain keys, +or if multiple keys per modifier are not supported). +The status reply is +Failed +if some such restriction is violated, +and none of the modifiers is changed. + + +If the new nonzero keycodes specified for a modifier differ from those +currently defined and any (current or new) keys for that modifier are +logically in the down state, then the status reply is +Busy, +and none of the modifiers is changed. + + +This request generates a +MappingNotify +event on a +Success +status. + + +
+
+ GetModifierMapping + GetModifierMapping + Modifier keys + + + + + + + + ▶ + + + + + +keycodes-per-modifier: CARD8 + + + + +keycodes: LISTofKEYCODE + + + + + + + + + +This request returns the keycodes of the keys being used as modifiers. +The number of keycodes in the list is 8*keycodes-per-modifier. +The keycodes are divided into eight sets, +with each set containing keycodes-per-modifier elements. +The sets are assigned to the modifiers +Shift, +Lock, +Control, +Mod1, +Mod2, +Mod3, +Mod4, +and +Mod5, +in order. +The keycodes-per-modifier value is chosen arbitrarily by the server; +zeroes are used to fill in unused elements within each set. +If only zero values are given in a set, +the use of the corresponding modifier has been disabled. +The order of keycodes within each set is chosen arbitrarily by the server. + + +
+
+ ChangeKeyboardMapping + ChangeKeyboardMapping + Keysym + + + + + + + + +first-keycode: KEYCODE + + + + +keysyms-per-keycode: CARD8 + + + + +keysyms: LISTofKEYSYM + + + + + + +Errors: +Alloc, +Value + + + + + + + + + +This request defines the symbols for the specified number of keycodes, +starting with the specified keycode. +The symbols for keycodes outside this range remained unchanged. +The number of elements in the keysyms list must be a multiple of +keysyms-per-keycode (or a +Length +error results). +The first-keycode must be greater than or equal to min-keycode as returned +in the connection setup (or a +Value +error results) and: + + first-keycode + (keysyms-length / keysyms-per-keycode) - 1 + + + +must be less than or equal to max-keycode as returned in the connection +setup (or a +Value +error results). +KEYSYM number N (counting from zero) for keycode K has an index +(counting from zero) of: + + (K - first-keycode) * keysyms-per-keycode + N + + + +in keysyms. +The keysyms-per-keycode can be chosen arbitrarily by the client +to be large enough to hold all desired symbols. +A special KEYSYM value of +NoSymbol +should be used to fill in unused elements for individual keycodes. +It is legal for +NoSymbol +to appear in nontrailing positions of the effective list for a keycode. + + +This request generates a +MappingNotify +event. + + +There is no requirement that the server interpret this mapping; +it is merely stored for reading and writing by clients +(see section 5). + + +
+
+ GetKeyboardMapping + GetKeyboardMapping + Keysym + + + + + + + + +first-keycode: KEYCODE + + + + +count: CARD8 + + + + + + ▶ + + + + + +keysyms-per-keycode: CARD8 + + + + +keysyms: LISTofKEYSYM + + + + + + +Errors: +Value + + + + + + + + + +This request returns the symbols for the specified number of keycodes, +starting with the specified keycode. +The first-keycode must be greater than or equal to +min-keycode as returned in the connection setup (or a +Value +error results), and: + + first-keycode + count - 1 + + + +must be less than or equal to max-keycode as returned in the connection setup +(or a +Value +error results). +The number of elements in the keysyms list is: + + count * keysyms-per-keycode + + + +and KEYSYM number N (counting from zero) for keycode K has an index +(counting from zero) of: + + (K - first-keycode) * keysyms-per-keycode + N + + + +in keysyms. +The keysyms-per-keycode value is chosen arbitrarily by the server +to be large enough to report all requested symbols. +A special KEYSYM value of +NoSymbol +is used to fill in unused elements for individual keycodes. + + +
+
+ ChangeKeyboardControl + ChangeKeyboardControl + + + + + + + + +value-mask: BITMASK + + + + +value-list: LISTofVALUE + + + + + +Errors: +Match, +Value + + + + + + + +This request controls various aspects of the keyboard. +The value-mask and value-list specify which controls are to be changed. +The possible values are: + + + + + + + + + + Control + Type + + + + + key-click-percent + INT8 + + + bell-percent + INT8 + + + bell-pitch + INT16 + + + bell-duration + INT16 + + + led + CARD8 + + + led-mode + +{ On, +Off } + + + + key + KEYCODE + + + auto-repeat-mode + +{ On, +Off, +Default } + + + + + + + +The key-click-percent sets the volume for key clicks between 0 (off) and +100 (loud) inclusive, if possible. +Setting to -1 restores the default. +Other negative values generate a +Value +error. + + +The bell-percent sets the base volume for the bell between 0 (off) and 100 +(loud) inclusive, if possible. +Setting to -1 restores the default. +Other negative values generate a +Value +error. + + +The bell-pitch sets the pitch (specified in Hz) of the bell, if possible. +Setting to -1 restores the default. +Other negative values generate a +Value +error. + + +The bell-duration sets the duration of the bell (specified in milliseconds), +if possible. +Setting to -1 restores the default. +Other negative values generate a +Value +error. + + +If both led-mode and led are specified, +then the state of that LED is changed, if possible. +If only led-mode is specified, +then the state of all LEDs are changed, if possible. +At most 32 LEDs, numbered from one, are supported. +No standard interpretation of LEDs is defined. +It is a +Match +error if an led is specified without an led-mode. + + +If both auto-repeat-mode and key are specified, +then the auto-repeat mode of that key is changed, if possible. +If only auto-repeat-mode is specified, +then the global auto-repeat mode for the entire keyboard is changed, +if possible, without affecting the per-key settings. +It is a +Match +error if a key is specified without an auto-repeat-mode. +Each key has an individual mode of whether or not it should auto-repeat +and a default setting for that mode. +In addition, there is a global mode of whether auto-repeat should be +enabled or not and a default setting for that mode. +When the global mode is +On, +keys should obey their individual auto-repeat modes. +When the global mode is +Off, +no keys should auto-repeat. +An auto-repeating key generates alternating +KeyPress +and +KeyRelease +events. +When a key is used as a modifier, +it is desirable for the key not to auto-repeat, +regardless of the auto-repeat setting for that key. + + +A bell generator connected with the console but not directly on the +keyboard is treated as if it were part of the keyboard. + + +The order in which controls are verified and altered is server-dependent. +If an error is generated, +a subset of the controls may have been altered. + + +
+
+ GetKeyboardControl + GetKeyboardControl + + + + + + + + ▶ + + + + + +key-click-percent: CARD8 + + + + +bell-percent: CARD8 + + + + +bell-pitch: CARD16 + + + + +bell-duration: CARD16 + + + + +led-mask: CARD32 + + + + +global-auto-repeat: +{ On, +Off} + + + + +auto-repeats: LISTofCARD8 + + + + + + + + + +This request returns the current control values for the keyboard. +For the LEDs, +the least significant bit of led-mask corresponds to LED one, +and each one bit in led-mask indicates an LED that is lit. +The auto-repeats is a bit vector; +each one bit indicates that auto-repeat is enabled for the corresponding key. +The vector is represented as 32 bytes. +Byte N (from 0) contains the bits for keys 8N to 8N + 7, +with the least significant bit in the byte representing key 8N. + + +
+
+ Bell + Bell + + + + + + + + +percent: INT8 + + + + + + +Errors: +Value + + + + + + + + + +This request rings the bell on the keyboard at a volume relative to the +base volume for the keyboard, if possible. +Percent can range from -100 to 100 inclusive (or a +Value +error results). +The volume at which the bell is rung when percent is nonnegative is: + + base - [(base * percent) / 100] + percent + + + +When percent is negative, it is: + + base + [(base * percent) / 100] + + + +
+
+ SetPointerMapping + SetPointerMapping + + + + + + + + +map: LISTofCARD8 + + + + + + ▶ + + + + + +status: +{ Success, +Busy} + + + + + + +Errors: +Value + + + + + + + + + +This request sets the mapping of the pointer. +Elements of the list are indexed starting from one. +The length of the list must be the same as +GetPointerMapping +would return (or a +Value +error results). +The index is a core button number, +and the element of the list defines the effective number. + + +A zero element disables a button. +Elements are not restricted in value by the number of physical buttons, +but no two elements can have the same nonzero value (or a +Value +error results). + + +If any of the buttons to be altered are logically in the down state, +the status reply is +Busy, +and the mapping is not changed. + + +This request generates a +MappingNotify +event on a +Success +status. + + +
+
+ GetPointerMapping + GetPointerMapping + + + + + + + + ▶ + + + + + +map: LISTofCARD8 + + + + + + + + + +This request returns the current mapping of the pointer. +Elements of the list are indexed starting from one. +The length of the list indicates the number of physical buttons. + + +The nominal mapping for a pointer is the identity mapping: map[i]=i. + + +
+
+ ChangePointerControl + ChangePointerControl + + + + + + + + +do-acceleration, do-threshold: BOOL + + + + +acceleration-numerator, acceleration-denominator: INT16 + + + + +threshold: INT16 + + + + + + +Errors: +Value + + + + + + + + + +This request defines how the pointer moves. +The acceleration is a multiplier for movement expressed as a fraction. +For example, +specifying 3/1 means the pointer moves three times as fast as normal. +The fraction can be rounded arbitrarily by the server. +Acceleration only takes effect if the pointer moves more than threshold +number of pixels at once and only applies to the amount beyond the threshold. +Setting a value to -1 restores the default. +Other negative values generate a +Value +error, as does a zero value for acceleration-denominator. + + +
+
+ GetPointerControl + GetPointerControl + + + + + + + + ▶ + + + + + +acceleration-numerator, acceleration-denominator: CARD16 + + + + +threshold: CARD16 + + + + + + + + + +This request returns the current acceleration and threshold for the pointer. + + +
+
+ SetScreenSaver + SetScreenSaver + + + + + + + + +timeout, interval: INT16 + + + + +prefer-blanking: +{ Yes, +No, +Default} + + + + +allow-exposures: +{ Yes, +No, +Default} + + + + + + +Errors: +Value + + + + + + + + + +The timeout and interval are specified in seconds; +setting a value to -1 restores the default. +Other negative values generate a +Value +error. +If the timeout value is zero, +screen-saver is disabled (but an activated screen-saver is not deactivated). +If the timeout value is nonzero, +screen-saver is enabled. +Once screen-saver is enabled, +if no input from the keyboard or pointer is generated for timeout seconds, +screen-saver is activated. +For each screen, +if blanking is preferred and the hardware supports video blanking, +the screen will simply go blank. +Otherwise, +if either exposures are allowed or the screen can be regenerated without +sending exposure events to clients, +the screen is changed in a server-dependent fashion to avoid phosphor burn. +Otherwise, +the state of the screens does not change, and screen-saver is not activated. +At the next keyboard or pointer input or at the next +ForceScreenSaver +with mode +Reset, +screen-saver is deactivated, and all screen states are restored. + + +If the server-dependent screen-saver method is amenable to periodic change, +interval serves as a hint about how long the change period should be, +with zero hinting that no periodic change should be made. +Examples of ways to change the screen include scrambling the color map +periodically, moving an icon image about the screen periodically, or +tiling the screen with the root window background tile, +randomly reorigined periodically. + + +
+
+ GetScreenSaver + GetScreenSaver + + + + + + + + ▶ + + + + + +timeout, interval: CARD16 + + + + +prefer-blanking: +{ Yes, +No} + + + + +allow-exposures: +{ Yes, +No} + + + + + + + + + +This request returns the current screen-saver control values. + + +
+
+ ForceScreenSaver + ForceScreenSaver + + + + + + + + +mode: +{ Activate, +Reset} + + + + + + +Errors: +Value + + + + + + + + + +If the mode is +Activate +and screen-saver is currently deactivated, +then screen-saver is activated (even if screen-saver has been disabled with +a timeout value of zero). +If the mode is +Reset +and screen-saver is currently enabled, +then screen-saver is deactivated (if it was activated), +and the activation timer is reset to its initial state +as if device input had just been received. + + +
+
+ ChangeHosts + ChangeHosts + + + + + + + + +mode: +{ Insert, +Delete} + + + + +host: HOST + + + + + + +Errors: +Access, +Value + + + + + + + + + +This request adds or removes the specified host from the access control list. +Access control list +When the access control mechanism is enabled and a client attempts to +establish a connection to the server, +the host on which the client resides must be in the access control list, +or the client must have been granted permission by a server-dependent +method, or the server will refuse the connection. + + +The client must reside on the same host as the server and/or have been granted +permission by a server-dependent method to execute this request (or an +Access +error results). + + +An initial access control list can usually be specified, +typically by naming a file that the server reads at startup and reset. + + +The following address families are defined. +TypesHOST +A server is not required to support these families +and may support families not listed here. +Use of an unsupported family, an improper address format, +or an improper address length within a supported family results in a +Value +error. + + +For the Internet family, +the address must be four bytes long. +The address bytes are in standard IP order; +the server performs no automatic swapping on the address bytes. +The Internet family supports IP version 4 addresses only. + + +For the InternetV6 family, the address must be sixteen bytes +long. The address bytes are in standard IP order; the +server performs no automatic swapping on the address bytes. +The InternetV6 family supports IP version 6 addresses only. + + +For the DECnet family, +the server performs no automatic swapping on the address bytes. +A Phase IV address is two bytes long: +the first byte contains the least significant eight bits of the node number, +and the second byte contains the most significant two bits of the node number in +the least significant two bits of the byte and the area in the most +significant six bits of the byte. + + +For the Chaos family, +the address must be two bytes long. +The host number is always the first byte in the address, +and the subnet number is always the second byte. +The server performs no automatic swapping on the address bytes. + + +For the ServerInterpreted family, the address may be of any +length up to 65535 bytes. The address consists of two strings +of ASCII characters, separated by a byte with a value of 0. +The first string represents the type of address, and the second +string contains the address value. Address types and the syntax +for their associated values will be registered via the X.Org Registry. +Implementors who wish to add implementation specific types may register +a unique prefix with the X.Org registry to prevent namespace +collisions. + + +Use of a host address in the ChangeHosts request is deprecated. It is +only useful when a host has a unique, constant address, a requirement +that is increasingly unmet as sites adopt dynamically assigned +addresses, network address translation gateways, IPv6 link local +addresses, and various other technologies. It also assumes all users of +a host share equivalent access rights, and as such has never been +suitable for many multi-user machine environments. Instead, more +secure forms of authentication, such as those based on shared secrets +or public key encryption, are recommended. + + +
+
+ ListHosts + ListHosts + + + + + + + + ▶ + + + + + +mode: +{ Enabled, +Disabled} + + + + +hosts: LISTofHOST + + + + + + + + + +This request returns the hosts on the access control list +and whether use of the list at connection setup is currently +enabled or disabled. + + +Each HOST is padded to a multiple of four bytes. + + +
+
+ SetAccessControl + SetAccessControl + + + + + + + + +mode: +{ Enable, +Disable} + + + + + + +Errors: +Access, +Value + + + + + + + + + +This request enables or disables the use of the access control list +at connection setups. + + +The client must reside on the same host as the server +and/or have been granted permission by a server-dependent method +to execute this request (or an +Access +error results). + + +
+
+ SetCloseDownMode + SetCloseDownMode + + + + + + + + +mode: +{ Destroy, +RetainPermanent, +RetainTemporary} + + + + + + +Errors: +Value + + + + + + + + + +This request defines what will happen to the client's resources +at connection close. +A connection starts in +Destroy +mode. +The meaning of the close-down mode is described +in section 10. + + +
+
+ KillClient + KillClient + + + + + + + + +resource: CARD32 or +AllTemporary + + + + + + +Errors: +Value + + + + + + + + + +If a valid resource is specified, +KillClient +forces a close-down of the client that created the resource. +If the client has already terminated in either +RetainPermanent +or +RetainTemporary +mode, all of the client's resources are destroyed +(see section 10). +If +AllTemporary +is specified, +then the resources of all clients that have terminated in +RetainTemporary +are destroyed. + + +
+
+ NoOperation + NoOperation + +This request has no arguments and no results, +but the request length field +allows the request to be any multiple of four bytes in length. +The bytes contained in the request are uninterpreted by the server. + + +This request can be used in its minimum four byte form as padding where +necessary by client libraries that find it convenient to force requests +to begin on 64-bit boundaries. + +
+
+ + +Connection Close + Connectionclosing + + + + +At connection close, +all event selections made by the client are discarded. +If the client has the pointer actively grabbed, an +UngrabPointer +is performed. +If the client has the keyboard actively grabbed, an +UngrabKeyboard +is performed. +All passive grabs by the client are released. +If the client has the server grabbed, an +UngrabServer +is performed. +All selections (see +SetSelectionOwner +request) +owned by the client are disowned. +If close-down mode (see +SetCloseDownMode +request) is +RetainPermanent +or +RetainTemporary, +then all resources (including colormap entries) +allocated by the client are marked as permanent or temporary, +respectively (but this does not prevent other clients from explicitly +destroying them). +If the mode is +Destroy, +all of the client's resources are destroyed. + + +When a client's resources are destroyed, +for each window in the client's save-set, +if the window is an inferior of a window created by the client, +the save-set window is reparented to the closest ancestor such that +the save-set window is not an inferior of a window created by the client. +If the save-set window is unmapped, a +MapWindow +request is performed on it (even if it was not an inferior +of a window created by the client). +The reparenting leaves unchanged the absolute coordinates +(with respect to the root window) of the upper-left outer corner of the +save-set window. +After save-set processing, +all windows created by the client are destroyed. +For each nonwindow resource created by the client, +the appropriate +Free +request is performed. +All colors and colormap entries allocated by the client are freed. + + +A server goes through a cycle of having no connections and having some +connections. +At every transition to the state of having no connections +as a result of a connection closing with a +Destroy +close-down mode, +the server resets its state as if it had just been started. +This starts by destroying all lingering resources from clients +that have terminated in +RetainPermanent +or +RetainTemporary +mode. +It additionally includes deleting all but the predefined atom identifiers, +deleting all properties on all root windows, resetting all device maps and +attributes (key click, bell volume, acceleration), resetting the access +control list, restoring the standard root tiles and cursors, restoring +the default font path, and restoring the input focus to state +PointerRoot. + + +Note that closing a connection with a close-down mode of +RetainPermanent +or +RetainTemporary +will not cause the server to reset. + + + + +Events + + + + +Event +When a button press is processed with the pointer in some window W +and no active pointer grab is in progress, +the ancestors of W are searched from the root down, +looking for a passive grab to activate. +If no matching passive grab on the button exists, +then an active grab is started automatically for the client receiving the event, +and the last-pointer-grab time is set to the current server time. +The effect is essentially equivalent to a +GrabButton +with arguments: + + + + + + + + + + Argument + Value + + + + + event-window + Event window + + + event-mask + +Client's selected pointer events on the event window + + + + pointer-mode and keyboard-mode + +Asynchronous + + + + owner-events + +True +if the client has +OwnerGrabButton +selected on the event window, otherwise +False + + + + confine-to + +None + + + + cursor + +None + + + + + + + + + +The grab is terminated automatically when the logical state of the pointer +has all buttons released. +UngrabPointer +and +ChangeActivePointerGrab +can both be used to modify the active grab. + + + +
+ Input Device events + Input deviceevents + + + + + + + + +KeyPress +KeyPress + + + + +KeyRelease +KeyRelease + + + + +ButtonPress +ButtonPress + + + + +ButtonRelease +ButtonRelease + + + + +MotionNotify +MotionNotify + + + + + +root, event: WINDOW + + + + +child: WINDOW or +None + + + + +same-screen: BOOL + + + + +root-x, root-y, event-x, event-y: INT16 + + + + +detail: <see below> + + + + +state: SETofKEYBUTMASK + + + + +time: TIMESTAMP + + + + + + + + + +These events are generated either when a key or button logically changes state +or when the pointer logically moves. +The generation of these logical changes may lag the physical changes +if device event processing is frozen. +Note that +KeyPress +and +KeyRelease +are generated for all keys, even those mapped to modifier bits. + +The source of the event is the window the pointer is in. + +Eventsource +The window the event is reported with respect to is called the event window. +The event window is found by starting with the source window and +looking up the hierarchy for the first window on which any client has selected +interest in the event (provided no intervening window prohibits event +generation by including the event type in its do-not-propagate-mask). +The actual window used for reporting can be modified by active grabs and, +in the case of keyboard events, can be modified by the focus window. + + +The root is the root window of the source window, +and root-x and root-y are the pointer coordinates relative to root's origin +at the time of the event. +Event is the event window. +If the event window is on the same screen as root, +then event-x and event-y are the pointer coordinates relative to the +event window's origin. +Otherwise, event-x and event-y are zero. +If the source window is an inferior of the event window, +then child is set to the child of the event window that is an +ancestor of (or is) the source window. +Otherwise, it is set to +None. +The state component gives the logical state of the buttons and modifier keys +just before the event. +The detail component type varies with the event type: + + + + + + + + + + Event + Component + + + + + +KeyPress, +KeyRelease + + KEYCODE + + + +ButtonPress, +ButtonRelease + + BUTTON + + + +MotionNotify + + +{ Normal +Hint } + + + + + + + +MotionNotify +events are only generated when the motion begins and ends in the window. +The granularity of motion events is not guaranteed, +but a client selecting for motion events is guaranteed to get at least one +event when the pointer moves and comes to rest. +Selecting +PointerMotion +receives events independent of the state of the pointer buttons. +By selecting some subset of +Button[1-5]Motion +instead, +MotionNotify +events will only be received when one or more of the +specified buttons are pressed. +By selecting +ButtonMotion, +MotionNotify +events will be received only when at least one button is pressed. +The events are always of type +MotionNotify, +independent of the selection. +If +PointerMotionHint +is selected, +the server is free to send only one +MotionNotify +event (with detail +Hint) +to the client for the event window until +either the key or button state changes, +the pointer leaves the event window, +or the client issues a +QueryPointer +or +GetMotionEvents +request. + + +
+
+ Pointer Window events + + + + + + + +EnterNotify +EnterNotify + + + + +LeaveNotify +LeaveNotify + + + + + +root, event: WINDOW + + + + +child: WINDOW or +None + + + + +same-screen: BOOL + + + + +root-x, root-y, event-x, event-y: INT16 + + + + +mode: +{ Normal, +Grab, +Ungrab} + + + + +detail: +{ Ancestor, +Virtual, +Inferior, +Nonlinear, +NonlinearVirtual} + + + + +focus: BOOL + + + + +state: SETofKEYBUTMASK + + + + +time: TIMESTAMP + + + + + + + + + +If pointer motion or window hierarchy change causes the pointer to be +in a different window than before, +EnterNotify +and +LeaveNotify +events are generated instead of a +MotionNotify +event. +Only clients selecting +EnterWindow +on a window receive +EnterNotify +events, and only clients selecting +LeaveWindow +receive +LeaveNotify +events. +The pointer position reported in the event is always the final position, +not the initial position of the pointer. +The root is the root window for this position, +and root-x and root-y are the pointer coordinates relative to root's +origin at the time of the event. +Event is the event window. +If the event window is on the same screen as root, +then event-x and event-y are the pointer coordinates relative +to the event window's origin. +Otherwise, event-x and event-y are zero. +In a +LeaveNotify +event, if a child of the event window contains the initial position of the +pointer, then the child component is set to that child. +Otherwise, it is +None. +For an +EnterNotify +event, if a child of the event window contains the final pointer position, +then the child component is set to that child. +Otherwise, it is +None. +If the event window is the focus window or an inferior of the focus window, +then focus is +True. +Otherwise, focus is +False. + + +Normal pointer motion events have mode +Normal. +Pseudo-motion events when a grab activates have mode +Grab, +and pseudo-motion events when a grab deactivates have mode +Ungrab. + + +All +EnterNotify +and +LeaveNotify +events caused by a hierarchy change are generated after any hierarchy event +caused by that change (that is, +UnmapNotify, +MapNotify, +ConfigureNotify, +GravityNotify, +CirculateNotify), +but the ordering of +EnterNotify +and +LeaveNotify +events with respect to +FocusOut, +VisibilityNotify, +and +Expose +events is not constrained. + + +Normal events are generated as follows: + + + +When the pointer moves from window A to window B and A is an inferior +of B: + + + + + +LeaveNotify +with detail +Ancestor +is generated on A. + + + + +LeaveNotify +with detail +Virtual +is generated on each window between A and B exclusive (in that order). + + + + +EnterNotify +with detail +Inferior +is generated on B. + + + + + +When the pointer moves from window A to window B and B is an inferior +of A: + + + + + + +LeaveNotify +with detail +Inferior +is generated on A. + + + + +EnterNotify +with detail +Virtual +is generated on each window between A and B exclusive (in that order). + + + + +EnterNotify +with detail +Ancestor +is generated on B. + + + + + +When the pointer moves from window A to window B and window C is +their least common ancestor: + + + + + +LeaveNotify +with detail +Nonlinear +is generated on A. + + + + +LeaveNotify +with detail +NonlinearVirtual +is generated on each window between A and C exclusive (in that order). + + + + +EnterNotify +with detail +NonlinearVirtual +is generated on each window between C and B exclusive (in that order). + + + + +EnterNotify +with detail +Nonlinear +is generated on B. + + + + + +When the pointer moves from window A to window B on different screens: + + + + + +LeaveNotify +with detail +Nonlinear +is generated on A. + + + + +If A is not a root window, +LeaveNotify +with detail +NonlinearVirtual +is generated on each window above A up to and including its root (in order). + + + + +If B is not a root window, +EnterNotify +with detail +NonlinearVirtual +is generated on each window from B's root down to but not including B +(in order). + + + + +EnterNotify +with detail +Nonlinear +is generated on B. + + + + + +When a pointer grab activates (but after any initial warp into a confine-to +window and before generating any actual +ButtonPress +event that activates the grab), +G is the grab-window for the grab, and P is the window the pointer is in: + + + + + +EnterNotify +and +LeaveNotify +events with mode +Grab +are generated (as for +Normal +above) as if the pointer were to suddenly warp from its current +position in P to some position in G. +However, the pointer does not warp, +and the pointer position is used as both the initial +and final positions for the events. + + + + + +When a pointer grab deactivates (but after generating any actual +ButtonRelease +event that deactivates the grab), G is the grab-window for +the grab, and P is the window the pointer is in: + + + + + +EnterNotify +and +LeaveNotify +events with mode +Ungrab +are generated (as for +Normal +above) as if the pointer were to suddenly warp from +some position in G to its current position in P. +However, the pointer does not warp, +and the current pointer position is used as both the initial +and final positions for the events. + + + + +
+
+ Input Focus events + Input focusevents + + + + + + + + +FocusIn +FocusIn + + + + +FocusOut +FocusOut + + + + + +event: WINDOW + + + + +mode: +{ Normal, +WhileGrabbed, +Grab, +Ungrab} + + + + +detail: +{ Ancestor, +Virtual, +Inferior, +Nonlinear, +NonlinearVirtual, +Pointer, + + + + +PointerRoot, +None } + + + + + + + + + +These events are generated when the input focus changes +and are reported to clients selecting +FocusChange +on the window. +Events generated by +SetInputFocus +when the keyboard is not grabbed have mode +Normal. +Events generated by +SetInputFocus +when the keyboard is grabbed have mode +WhileGrabbed. +Events generated when a keyboard grab activates have mode +Grab, +and events generated when a keyboard grab deactivates have mode +Ungrab. + + +All +FocusOut +events caused by a window unmap are generated after any +UnmapNotify +event, but the ordering of +FocusOut +with respect to generated +EnterNotify, +LeaveNotify, +VisibilityNotify, +and +Expose +events is not constrained. + + +Normal +and +WhileGrabbed +events are generated as follows: + + +When the focus moves from window A to window B, A is an inferior of B, +and the pointer is in window P: + + + + + +FocusOut +with detail +Ancestor +is generated on A. + + + + +FocusOut +with detail +Virtual +is generated on each window between A and B exclusive (in order). + + + + +FocusIn +with detail +Inferior +is generated on B. + + + + +If P is an inferior of B +but P is not A or an inferior of A or an ancestor of A, +FocusIn +with detail +Pointer +is generated on each window below B down to and including P (in order). + + + + + + +When the focus moves from window A to window B, B is an inferior of A, +and the pointer is in window P: + + + + + +If P is an inferior of A +but P is not an inferior of B or an ancestor of B, +FocusOut +with detail +Pointer +is generated on each window from P up to but not including A (in order). + + + + +FocusOut +with detail +Inferior +is generated on A. + + + + +FocusIn +with detail +Virtual +is generated on each window between A and B exclusive (in order). + + + + +FocusIn +with detail +Ancestor +is generated on B. + + + + + +When the focus moves from window A to window B, window C is their +least common ancestor, and the pointer is in window P: + + + + + +If P is an inferior of A, +FocusOut +with detail +Pointer +is generated on each window from P up to but not including A (in order). + + + + +FocusOut +with detail +Nonlinear +is generated on A. + + + + +FocusOut +with detail +NonlinearVirtual +is generated on each window between A and C exclusive (in order). + + + + +FocusIn +with detail +NonlinearVirtual +is generated on each window between C and B exclusive (in order). + + + + +FocusIn +with detail +Nonlinear +is generated on B. + + + + +If P is an inferior of B, +FocusIn +with detail +Pointer +is generated on each window below B down to and including P (in order). + + + + + +When the focus moves from window A to window B on different screens +and the pointer is in window P: + + + + + + +If P is an inferior of A, +FocusOut +with detail +Pointer +is generated on each window from P up to but not including A (in order). + + + + +FocusOut +with detail +Nonlinear +is generated on A. + + + + +If A is not a root window, +FocusOut +with detail +NonlinearVirtual +is generated on each window above A up to and including its root (in order). + + + + +If B is not a root window, +FocusIn +with detail +NonlinearVirtual +is generated on each window from B's root down to but not including B +(in order). + + + + +FocusIn +with detail +Nonlinear +is generated on B. + + + + +If P is an inferior of B, +FocusIn +with detail +Pointer +is generated on each window below B down to and including P (in order). + + + + + +When the focus moves from window A to +PointerRoot +(or +None) +and the pointer is in window P: + + + + + + +If P is an inferior of A, +FocusOut +with detail +Pointer +is generated on each window from P up to but not including A (in order). + + + + +FocusOut +with detail +Nonlinear +is generated on A. + + + + +If A is not a root window, +FocusOut +with detail +NonlinearVirtual +is generated on each window above A up to and including its root (in order). + + + + +FocusIn +with detail +PointerRoot +(or +None) +is generated on all root windows. + + + + +If the new focus is +PointerRoot, +FocusIn +with detail +Pointer +is generated on each window from P's root down to and including P (in order). + + + + + +When the focus moves from +PointerRoot +(or +None) +to window A and the pointer is in window P: + + + + + + +If the old focus is +PointerRoot, +FocusOut +with detail +Pointer +is generated on each window from P up to and including P's root (in order). + + + + +FocusOut +with detail +PointerRoot +(or +None) +is generated on all root windows. + + + + +If A is not a root window, +FocusIn +with detail +NonlinearVirtual +is generated on each window from A's root down to but not including A +(in order). + + + + +FocusIn +with detail +Nonlinear +is generated on A. + + + + +If P is an inferior of A, +FocusIn +with detail +Pointer +is generated on each window below A down to and including P (in order). + + + + + +When the focus moves from +PointerRoot +to +None +(or vice versa) and the pointer is in window P: + + + + + +If the old focus is +PointerRoot, +FocusOut +with detail +Pointer +is generated on each window from P up to and including P's root (in order). + + + + +FocusOut +with detail +PointerRoot +(or +None) +is generated on all root windows. + + + + +FocusIn +with detail +None +(or +PointerRoot) +is generated on all root windows. + + + + +If the new focus is +PointerRoot, +FocusIn +with detail +Pointer +is generated on each window from P's root down to and including P (in order). + + + + + + +When a keyboard grab activates (but before generating any actual +KeyPress +event that activates the grab), G is the grab-window for the grab, +and F is the current focus: + + + + + +FocusIn +and +FocusOut +events with mode +Grab +are generated (as for +Normal +above) as if the focus were to change from F to G. + + + + + +When a keyboard grab deactivates (but after generating any actual +KeyRelease +event that deactivates the grab), G is the grab-window for the grab, +and F is the current focus: + + + + + +FocusIn +and +FocusOut +events with mode +Ungrab +are generated (as for +Normal +above) as if the focus were to change from G to F. + + + + +
+
+ KeymapNotify + KeymapNotify + + + + + + + + + KeymapNotify + + + + +keys: LISTofCARD8 + + + + + + + +The value is a bit vector as described in +QueryKeymap. +This event is reported to clients selecting +KeymapState +on a window and is generated immediately after every +EnterNotify +and +FocusIn. + + +
+
+ Expose + Expose + EventExposure + + + + + + + + Expose + + + + + +window: WINDOW + + + + +x, +y, +width, +height: CARD16 + + + + +count: CARD16 + + + + + + + + +This event is reported to clients selecting +Exposure +on the window. +It is generated when no valid contents are available for regions of a window, +and either the regions are visible, the regions are viewable +and the server is (perhaps newly) maintaining backing store on the window, +or the window is not viewable but the server is (perhaps newly) honoring +window's backing-store attribute of +Always +or +WhenMapped. +The regions are decomposed into an arbitrary set of rectangles, +and an +Expose +event is generated for each rectangle. + + +For a given action causing exposure events, +the set of events for a given window are guaranteed to be reported contiguously. +If count is zero, +then no more +Expose +events for this window follow. +If count is nonzero, +then at least that many more +Expose +events for this window follow (and possibly more). + + +The x and y coordinates are relative to window's origin +and specify the upper-left corner of a rectangle. +The width and height specify the extent of the rectangle. + + +Expose +events are never generated on +InputOnly +windows. + + +All +Expose +events caused by a hierarchy change are generated after any +hierarchy event caused by that change (for example, +UnmapNotify, +MapNotify, +ConfigureNotify, +GravityNotify, +CirculateNotify). +All +Expose +events on a given window are generated after any +VisibilityNotify +event on that window, +but it is not required that all +Expose +events on all windows be generated after all +Visibilitity +events on all windows. +The ordering of +Expose +events with respect to +FocusOut, +EnterNotify, +and +LeaveNotify +events is not constrained. + + +
+
+ GraphicsExposure + GraphicsExposure + + + + + + + + GraphicsExposure + + + + + +drawable: DRAWABLE + + + + +x, y, width, height: CARD16 + + + + +count: CARD16 + + + + +major-opcode: CARD8 + + + + +minor-opcode: CARD16 + + + + + + + + + +This event is reported to a client using a graphics context +with graphics-exposures selected +and is generated when a destination region could not be computed due +to an obscured or out-of-bounds source region. +All of the regions exposed by a given graphics request +are guaranteed to be reported contiguously. +If count is zero then no more +GraphicsExposure +events for this window follow. +If count is nonzero, +then at least that many more +GraphicsExposure +events for this window follow (and possibly more). + + +The x and y coordinates are relative to drawable's origin +and specify the upper-left corner of a rectangle. +The width and height specify the extent of the rectangle. + + +The major and minor opcodes identify the graphics request used. +For the core protocol, +major-opcode is always +CopyArea +or +CopyPlane, +and minor-opcode is always zero. + + +
+
+ NoExposure + NoExposure + + + + + + + + NoExposure + + + + + +drawable: DRAWABLE + + + + +major-opcode: CARD8 + + + + +minor-opcode: CARD16 + + + + + + + + + +This event is reported to a client using a graphics context +with graphics-exposures selected +and is generated when a graphics request +that might produce +GraphicsExposure +events does not produce any. +The drawable specifies the destination used for the graphics request. + + +The major and minor opcodes identify the graphics request used. +For the core protocol, +major-opcode is always +CopyArea +or +CopyPlane, +and the minor-opcode is always zero. + + +
+
+ VisibilityNotify + VisibilityNotify + + + + + + + + VisibilityNotify + + + + + +window: WINDOW + + + + +state: +{ Unobscured, +PartiallyObscured, +FullyObscured} + + + + + + + + + +This event is reported to clients selecting +VisibilityChange +on the window. +In the following, +the state of the window is calculated ignoring all of the window's subwindows. +When a window changes state from partially or fully obscured or +not viewable to viewable and completely unobscured, +an event with +Unobscured +is generated. +When a window changes state from viewable and completely unobscured, +from viewable and completely obscured, +or from not viewable, to viewable and partially obscured, +an event with +PartiallyObscured +is generated. +When a window changes state from viewable and completely unobscured, +from viewable and partially obscured, +or from not viewable to viewable and fully obscured, +an event with +FullyObscured +is generated. + + +VisibilityNotify +events are never generated on +InputOnly +windows. + + +All +VisibilityNotify +events caused by a hierarchy change are generated after any hierarchy event +caused by that change (for example, +UnmapNotify, +MapNotify, +ConfigureNotify, +GravityNotify, +CirculateNotify). +Any +VisibilityNotify +event on a given window is generated before any +Expose +events on that window, +but it is not required that all +VisibilityNotify +events on all windows be generated before all +Expose +events on all windows. +The ordering of +VisibilityNotify +events with respect to +FocusOut, +EnterNotify, +and +LeaveNotify +events is not constrained. + + +
+
+ CreateNotify + CreateNotify + + + + + + + + CreateNotify + + + + + +parent, window: WINDOW + + + + +x, y: INT16 + + + + +width, height, border-width: CARD16 + + + + +override-redirect: BOOL + + + + + + + + + +This event is reported to clients selecting +SubstructureNotify +on the parent +and is generated when the window is created. +The arguments are as in the +CreateWindow +request. + + +
+
+ DestroyNotify + DestroyNotify + + + + + + + + DestroyNotify + + + + + +event, window: WINDOW + + + + + + + + + +This event is reported to clients selecting +StructureNotify +on the window and to clients selecting +SubstructureNotify +on the parent. +It is generated when the window is destroyed. +The event is the window on which the event was generated, +and the window is the window that is destroyed. + + +The ordering of the +DestroyNotify +events is such that for any given window, +DestroyNotify +is generated on all inferiors of the window +before being generated on the window itself. +The ordering among siblings and across subhierarchies is not +otherwise constrained. + + +
+
+ UnmapNotify + UnmapNotify + + + + + + + + UnmapNotify + + + + + +event, window: WINDOW + + + + +from-configure: BOOL + + + + + + + + + +This event is reported to clients selecting +StructureNotify +on the window and to clients selecting +SubstructureNotify +on the parent. +It is generated when the window changes state from mapped to unmapped. +The event is the window on which the event was generated, +and the window is the window that is unmapped. +The from-configure flag is +True +if the event was generated as a result of the window's parent being resized +when the window itself had a win-gravity of +Unmap. + + +
+
+ MapNotify + MapNotify + Mapped window + + + + + + + + MapNotify + + + + + +event, window: WINDOW + + + + +override-redirect: BOOL + + + + + + + + + +This event is reported to clients selecting +StructureNotify +on the window and to clients selecting +SubstructureNotify +on the parent. +It is generated when the window changes state from unmapped to mapped. +The event is the window on which the event was generated, +and the window is the window that is mapped. +The override-redirect flag is from the window's attribute. + + +
+
+ MapRequest + MapRequest + + + + + + + + MapRequest + + + + + +parent, window: WINDOW + + + + + + + + + +This event is reported to the client selecting +SubstructureRedirect +on the parent and is generated when a +MapWindow +request is issued on an unmapped window with an override-redirect attribute of +False. + + +
+
+ ReparentNotify + ReparentNotify + + + + + + + + ReparentNotify + + + + + +event, window, parent: WINDOW + + + + +x, y: INT16 + + + + +override-redirect: BOOL + + + + + + + + + +This event is reported to clients selecting +SubstructureNotify +on either the old or the new parent and to clients selecting +StructureNotify +on the window. +It is generated when the window is reparented. +The event is the window on which the event was generated. +The window is the window that has been rerooted. +The parent specifies the new parent. +The x and y coordinates are relative to the new parent's origin +and specify the position of the upper-left outer corner of the window. +The override-redirect flag is from the window's attribute. + + +
+
+ ConfigureNotify + ConfigureNotify + + + + + + + + ConfigureNotify + + + + + +event, window: WINDOW + + + + +x, y: INT16 + + + + +width, height, border-width: CARD16 + + + + +above-sibling: WINDOW or +None + + + + +override-redirect: BOOL + + + + + + + + + +This event is reported to clients selecting +StructureNotify +on the window and to clients selecting +SubstructureNotify +on the parent. +It is generated when a +ConfigureWindow +request actually changes the state of the window. +The event is the window on which the event was generated, +and the window is the window that is changed. +The x and y coordinates are relative to the new parent's origin +and specify the position of the upper-left outer corner of the window. +The width and height specify the inside size, not including the border. +If above-sibling is +None, +then the window is on the bottom of the stack with respect to siblings. +Otherwise, the window is immediately on top of the specified sibling. +The override-redirect flag is from the window's attribute. + + +
+
+ GravityNotify + GravityNotify + + + + + + + + GravityNotify + + + + + +event, window: WINDOW + + + + +x, y: INT16 + + + + + + + + + +This event is reported to clients selecting +SubstructureNotify +on the parent and to clients selecting +StructureNotify +on the window. +It is generated when a window is moved because of a change in size +of the parent. +The event is the window on which the event was generated, +and the window is the window that is moved. +The x and y coordinates are relative to the new parent's origin +and specify the position of the upper-left outer corner of the window. + + +
+
+ ResizeRequest + ResizeRequest + + + + + + + + ResizeRequest + + + + + +window: WINDOW + + + + +width, height: CARD16 + + + + + + + + + +This event is reported to the client selecting +ResizeRedirect +on the window and is generated when a +ConfigureWindow +request by some other client on the window attempts to change the size +of the window. +The width and height are the requested inside size, not including the border. + + +
+
+ ConfigureRequest + ConfigureRequest + + + + + + + + ConfigureRequest + + + + + +parent, window: WINDOW + + + + +x, y: INT16 + + + + +width, height, border-width: CARD16 + + + + +sibling: WINDOW or +None + + + + +stack-mode: +{ Above, +Below, +TopIf, +BottomIf, +Opposite} + + + + +value-mask: BITMASK + + + + + + + + + +This event is reported to the client selecting +SubstructureRedirect +on the parent and is generated when a +ConfigureWindow +request is issued on the window by some other client. +The value-mask indicates which components were specified in the request. +The value-mask and the corresponding values are reported as given +in the request. +The remaining values are filled in from the current geometry of the window, +except in the case of sibling and stack-mode, +which are reported as +None +and +Above +(respectively) if not given in the request. + + +
+
+ CirculateNotify + CirculateNotify + + + + + + + + CirculateNotify + + + + + +event, window: WINDOW + + + + +place: +{ Top, +Bottom} + + + + + + + + + +This event is reported to clients selecting +StructureNotify +on the window and to clients selecting +SubstructureNotify +on the parent. +It is generated when the window is actually restacked from a +CirculateWindow +request. +The event is the window on which the event was generated, +and the window is the window that is restacked. +If place is +Top, +the window is now on top of all siblings. +Otherwise, it is below all siblings. + + +
+
+ CirculateRequest + CirculateRequest + + + + + + + + CirculateRequest + + + + + +parent, window: WINDOW + + + + +place: +{ Top, +Bottom} + + + + + + + + + +This event is reported to the client selecting +SubstructureRedirect +on the parent and is generated when a +CirculateWindow +request is issued on the parent and a window actually needs to be restacked. +The window specifies the window to be restacked, +and the place specifies what the new position in the stacking order should be. + + +
+
+ PropertyNotify + PropertyNotify + + + + + + + + PropertyNotify + + + + + +window: WINDOW + + + + +atom: ATOM + + + + +state: +{ NewValue, +Deleted} + + + + +time: TIMESTAMP + + + + + + + + + +This event is reported to clients selecting +PropertyChange +on the window and is generated with state +NewValue +when a property of the window is changed using +ChangeProperty +or +RotateProperties, +even when adding zero-length data using +ChangeProperty +and when replacing all or part of a property with identical data using +ChangeProperty +or +RotateProperties. +It is generated with state +Deleted +when a property of the +window is deleted using request +DeleteProperty +or +GetProperty. +The timestamp indicates the server time when the property was changed. + + +
+
+ SelectionClear + SelectionClear + + + + + + + + SelectionClear + + + + + +owner: WINDOW + + + + +selection: ATOM + + + + +time: TIMESTAMP + + + + + + + + + +This event is reported to the current owner of a selection +and is generated when a new owner is being defined by means of +SetSelectionOwner. +The timestamp is the last-change time recorded for the selection. +The owner argument is the window that was specified by the current owner in its +SetSelectionOwner +request. + + +
+
+ SelectionRequest + SelectionRequest + + + + + + + + SelectionRequest + + + + + +owner: WINDOW + + + + +selection: ATOM + + + + +target: ATOM + + + + +property: ATOM or +None + + + + +requestor: WINDOW + + + + +time: TIMESTAMP or +CurrentTime + + + + + + + + + +This event is reported to the owner of a selection +and is generated when a client issues a +ConvertSelection +request. +The owner argument is the window that was specified in the +SetSelectionOwner +request. +The remaining arguments are as in the +ConvertSelection +request. + + +The owner should convert the selection based on the specified target type +and send a +SelectionNotify +back to the requestor. +A complete specification for using selections is given in the X.Org +standard Inter-Client Communication Conventions Manual. + + +
+
+ SelectionNotify + SelectionNotify + + + + + + + + SelectionNotify + + + + + +requestor: WINDOW + + + + +selection, target: ATOM + + + + +property: ATOM or +None + + + + +time: TIMESTAMP or +CurrentTime + + + + + + + + + +This event is generated by the server in response to a +ConvertSelection +request when there is no owner for the selection. +When there is an owner, +it should be generated by the owner using +SendEvent. +The owner of a selection should send this event to a requestor either +when a selection has been converted and stored as a property +or when a selection conversion could not be performed (indicated with property +None). + + +
+
+ ColormapNotify + ColormapNotify + + + + + + + + ColormapNotify + + + + + +window: WINDOW + + + + +colormap: COLORMAP or +None + + + + +new: BOOL + + + + +state: +{ Installed, +Uninstalled} + + + + + + + + + +This event is reported to clients selecting +ColormapChange +on the window. +It is generated with value +True +for new when the colormap attribute of the window is changed +and is generated with value +False +for new when the colormap of a window is installed or uninstalled. +In either case, +the state indicates whether the colormap is currently installed. + + +
+
+ MappingNotify + MappingNotify + + + + + + + + MappingNotify + + + + + +request: +{ Modifier, +Keyboard, +Pointer} + + + + +first-keycode, count: CARD8 + + + + + + + + + +This event is sent to all clients. +There is no mechanism to express disinterest in this event. +The detail indicates the kind of change that occurred: +Modifiers +for a successful +SetModifierMapping, +Keyboard +for a successful +ChangeKeyboardMapping, +and +Pointer +for a successful +SetPointerMapping. +If the detail is +Keyboard, +then first-keycode and count indicate the range of altered keycodes. + + +
+
+ ClientMessage + ClientMessage + + + + + + + + ClientMessage + + + + + +window: WINDOW + + + + +type: ATOM + + + + +format: {8, 16, 32} + + + + +data: LISTofINT8 or LISTofINT16 or LISTofINT32 + + + + + + + + + +This event is only generated by clients using +SendEvent. +The type specifies how the data is to be interpreted by the receiving client; +the server places no interpretation on the type or the data. +The format specifies whether the data should be viewed as a list of 8-bit, +16-bit, or 32-bit quantities, so that the server can correctly +byte-swap, as necessary. +The data always consists of either 20 8-bit values or 10 16-bit values +or 5 32-bit values, although particular message types might not make use +of all of these values. + +
+
+ +Flow Control and Concurrency + + + + +Whenever the server is writing to a given connection, +it is permissible for the server to stop reading from that connection +(but if the writing would block, it must continue to service other connections). +The server is not required to buffer more than a single request per connection +at one time. +For a given connection to the server, +a client can block while reading from the connection +but should undertake to read (events and errors) when writing would block. +Failure on the part of a client to obey this rule could result +in a deadlocked connection, +although deadlock is probably unlikely unless either +the transport layer has very little buffering or the client attempts to +send large numbers of requests without ever reading replies or checking for +errors and events. + + +Whether or not a server is implemented with internal concurrency, +the overall effect must be as if individual requests are executed to completion +in some serial order, +and requests from a given connection must be executed in delivery order +(that is, the total execution order is a shuffle of the individual streams). +The execution of a request includes validating all arguments, +collecting all data for any reply, +and generating and queueing all required events. +However, +it does not include the actual transmission of the reply and the events. +In addition, the effect of any other cause that can generate multiple events +(for example, activation of a grab or pointer motion) must effectively generate +and queue all required events indivisibly with respect to all other causes +and requests. +For a request from a given client, +any events destined for that client that are caused by executing the request +must be sent to the client before any reply or error is sent. + + +
diff --git a/miniconda3/share/doc/xproto/x11protocol.xml b/miniconda3/share/doc/xproto/x11protocol.xml new file mode 100644 index 0000000000000000000000000000000000000000..87ac55545cc889ccf89cd9e0da0ab99746e74202 --- /dev/null +++ b/miniconda3/share/doc/xproto/x11protocol.xml @@ -0,0 +1,64 @@ + + %defs; +]> + + + + + + X Window System Protocol + X Consortium Standard + + Robert + W. + Scheifler + X Consortium, Inc. + + X Version 11, Release &fullrelvers; + Version 1.0 + 19861987198819942004 + The Open Group + + + + + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +Except as contained in this notice, the name of the Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from the Open Group. + +X Window System is a trademark of The Open Group. + + + + + + + + + + diff --git a/miniconda3/share/doc/xz/AUTHORS b/miniconda3/share/doc/xz/AUTHORS new file mode 100644 index 0000000000000000000000000000000000000000..f805a204ecb75ca7245e3488101740ec013870c1 --- /dev/null +++ b/miniconda3/share/doc/xz/AUTHORS @@ -0,0 +1,58 @@ + +Authors of XZ Utils +=================== + + XZ Utils is developed and maintained by + Lasse Collin . + + Major parts of liblzma are based on code written by Igor Pavlov, + specifically the LZMA SDK . Without + this code, XZ Utils wouldn't exist. + + The SHA-256 implementation in liblzma is based on code written by + Wei Dai in Crypto++ Library . + + A few scripts have been adapted from GNU gzip. The original + versions were written by Jean-loup Gailly, Charles Levert, and + Paul Eggert. Andrew Dudman helped adapting the scripts and their + man pages for XZ Utils. + + The initial version of the threaded .xz decompressor was written + by Sebastian Andrzej Siewior. + + The initial version of the .lz (lzip) decoder was written + by Michał Górny. + + Architecture-specific CRC optimizations were contributed by + Ilya Kurdyukov, Chenxi Mao, and Xi Ruoyao. + + Other authors: + - Jonathan Nieder + - Joachim Henke + + Special author: Jia Tan was a co-maintainer in 2022-2024. He and + the team behind him inserted a backdoor (CVE-2024-3094) into + XZ Utils 5.6.0 and 5.6.1 releases. He suddenly disappeared when + this was discovered. + + Many people have contributed improvements or reported bugs. + Most of these people are mentioned in the file THANKS. + + The translations of the command line tools and man pages have been + contributed by many people via the Translation Project: + + - https://translationproject.org/domain/xz.html + - https://translationproject.org/domain/xz-man.html + + The authors of the translated man pages are in the header comments + of the man page files. In the source package, the authors of the + translations are in po/*.po and po4a/*.po files. + + Third-party code whose authors aren't listed here: + + - GNU getopt_long() in the 'lib' directory is included for + platforms that don't have a usable getopt_long(). + + - The build system files from GNU Autoconf, GNU Automake, + GNU Libtool, GNU Gettext, Autoconf Archive, and related files. + diff --git a/miniconda3/share/doc/xz/COPYING b/miniconda3/share/doc/xz/COPYING new file mode 100644 index 0000000000000000000000000000000000000000..ef3371389d7d45db6593a146fd9e027347f3122c --- /dev/null +++ b/miniconda3/share/doc/xz/COPYING @@ -0,0 +1,70 @@ + +XZ Utils Licensing +================== + + Different licenses apply to different files in this package. Here + is a summary of which licenses apply to which parts of this package: + + - liblzma is under the BSD Zero Clause License (0BSD). + + - The command line tools xz, xzdec, lzmadec, and lzmainfo are + under 0BSD except that, on systems that don't have a usable + getopt_long, GNU getopt_long is compiled and linked in from the + 'lib' directory. The getopt_long code is under GNU LGPLv2.1+. + + - The scripts to grep, diff, and view compressed files have been + adapted from GNU gzip. These scripts (xzgrep, xzdiff, xzless, + and xzmore) are under GNU GPLv2+. The man pages of the scripts + are under 0BSD; they aren't based on the man pages of GNU gzip. + + - Most of the XZ Utils specific documentation that is in + plain text files (like README, INSTALL, PACKAGERS, NEWS, + and ChangeLog) are under 0BSD unless stated otherwise in + the file itself. The files xz-file-format.txt and + lzma-file-format.xt are in the public domain but may + be distributed under the terms of 0BSD too. + + - Translated messages and man pages are under 0BSD except that + some old translations are in the public domain. + + - Test files and test code in the 'tests' directory, and + debugging utilities in the 'debug' directory are under + the BSD Zero Clause License (0BSD). + + - The GNU Autotools based build system contains files that are + under GNU GPLv2+, GNU GPLv3+, and a few permissive licenses. + These files don't affect the licensing of the binaries being + built. + + - The 'extra' directory contains files that are under various + free software licenses. These aren't built or installed as + part of XZ Utils. + + The following command may be helpful in finding per-file license + information. It works on xz.git and on a clean file tree extracted + from a release tarball. + + sh build-aux/license-check.sh -v + + For the files under the BSD Zero Clause License (0BSD), if + a copyright notice is needed, the following is sufficient: + + Copyright (C) The XZ Utils authors and contributors + + If you copy significant amounts of 0BSD-licensed code from XZ Utils + into your project, acknowledging this somewhere in your software is + polite (especially if it is proprietary, non-free software), but + it is not legally required by the license terms. Here is an example + of a good notice to put into "about box" or into documentation: + + This software includes code from XZ Utils . + + The following license texts are included in the following files: + - COPYING.0BSD: BSD Zero Clause License + - COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1 + - COPYING.GPLv2: GNU General Public License version 2 + - COPYING.GPLv3: GNU General Public License version 3 + + If you have questions, don't hesitate to ask for more information. + The contact information is in the README file. + diff --git a/miniconda3/share/doc/xz/COPYING.0BSD b/miniconda3/share/doc/xz/COPYING.0BSD new file mode 100644 index 0000000000000000000000000000000000000000..4322122aecf1aecff317bd50334ba206dcb9ac41 --- /dev/null +++ b/miniconda3/share/doc/xz/COPYING.0BSD @@ -0,0 +1,11 @@ +Permission to use, copy, modify, and/or distribute this +software for any purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL +THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, +NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/miniconda3/share/doc/xz/COPYING.GPLv2 b/miniconda3/share/doc/xz/COPYING.GPLv2 new file mode 100644 index 0000000000000000000000000000000000000000..9efa6fbc962836e243e20f7f23db062e2c077d28 --- /dev/null +++ b/miniconda3/share/doc/xz/COPYING.GPLv2 @@ -0,0 +1,338 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, see . + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Moe Ghoul, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/miniconda3/share/doc/xz/NEWS b/miniconda3/share/doc/xz/NEWS new file mode 100644 index 0000000000000000000000000000000000000000..73ff8558da08fca0bee21fb60922891f7de0e828 --- /dev/null +++ b/miniconda3/share/doc/xz/NEWS @@ -0,0 +1,2992 @@ + +XZ Utils Release Notes +====================== + +5.8.2 (2025-12-17) + + * liblzma: + + - Fix the build on ARM64 on glibc versions older than + 2.24 (2016). They don't have HWCAP_CRC32 in . + + - Disable CLMUL CRC code when building for 32-bit x86 with + old MSVC versions. This avoids a compiler bug. The exact + compiler version in which the issue was fixed is unknown, + but VS 2022 17.13 (MSVC 19.43.34808) is known to work, so + CLMUL CRC on 32-bit x86 is disabled with MSVC versions + older than that. + + * xz: + + - Add a workaround for Red Hat Enterprise Linux 9 kernel bug + which made xz fail with "xz: Failed to enable the sandbox". + It only occurs with xz 5.8.0 and 5.8.1 binaries built for + other distros. For example, running Debian 13 in a container + on RHEL/CentOS 9 would trigger the issue. + + The bug was introduced in RHEL 9 kernel 5.14.0-603.el9 + (2025-07-30) and fixed in 5.14.0-648.el9 (2025-12-05). + However, as of writing, the fixed kernel isn't available + to RHEL 9 users yet, so including the workaround in this + xz release seems reasonable. The workaround will be removed + when it's no longer needed. + + xzdec was also affected by this issue. + + - On AIX, don't use fsync() on directories because it fails. + + - Fix the build on Emscripten. + + - Fix the build on clang-cl on Windows. + + - Take resource limits (RLIMIT_DATA, RLIMIT_AS, and RLIMIT_VMEM) + into account when determining the default memory usage limit + for multithreaded mode. This should prevent xz from failing + when a resource limit has been set to a value that is less + than 1/4 of total RAM. Other memory limits can still trigger + the same issue, for example, Linux cgroup v2 memory.max. + + * Build systems: + + - When symbol versioning is enabled, pass --undefined-version + to the linker if the option is supported. This fixes the + build when using LLVM's lld and some liblzma features have + been disabled at build time. + + - ARM64: Fix autodetection of fast unaligned memory access when + using GCC and -mstrict-align is in effect. Previously the + build systems would incorrectly guess that unaligned access + is fast, which would result in much slower binaries than + needed. The fix is a workaround for GCC bug 111555; + autodetection already worked with Clang. + + - LoongArch: Autodetect if fast unaligned memory access is + supported. This can improve compression speed by 15 % (but + not decompression speed). + + * Translations: + + - Update the Spanish translation. + + - Add Swedish man page translations. + + - Update Italian, Korean, Romanian, Serbian, and Ukrainian + man page translations. + + +5.8.1 (2025-04-03) + + IMPORTANT: This includes a security fix for CVE-2025-31115 which + affects XZ Utils from 5.3.3alpha to 5.8.0. No new 5.4.x or 5.6.x + releases will be made, but the fix is in the v5.4 and v5.6 branches + in the xz Git repository. A standalone patch for all affected + versions is available as well. + + * Multithreaded .xz decoder (lzma_stream_decoder_mt()): + + - Fix a bug that could at least result in a crash with + invalid input. (CVE-2025-31115) + + - Fix a performance bug: Only one thread was used if the whole + input file was provided at once to lzma_code(), the output + buffer was big enough, timeout was disabled, and LZMA_FINISH + was used. There are no bug reports about this, thus it's + possible that no real-world application was affected. + + * Avoid even with C11/C17 compilers. This fixes the + build with Oracle Developer Studio 12.6 on Solaris 10 when the + compiler is in C11 mode (the header doesn't exist). + + * Autotools: Restore compatibility with GNU make versions older + than 4.0 by creating the package using GNU gettext 0.23.1 + infrastructure instead of 0.24. + + * Update Croatian translation. + + +5.8.0 (2025-03-25) + + This bumps the minor version of liblzma because new features were + added. The API and ABI are still backward compatible with liblzma + 5.6.x, 5.4.x, 5.2.x, and 5.0.x. + + * liblzma on 32/64-bit x86: When possible, use SSE2 intrinsics + instead of memcpy() in the LZMA/LZMA2 decoder. In typical cases, + this may reduce decompression time by 0-5 %. However, when built + against musl libc, over 15 % time reduction was observed with + highly compressed files. + + * CMake: Make the feature test macros match the Autotools-based + build on NetBSD, Darwin, and mingw-w64. + + * Update the Croatian, Italian, Portuguese, and Romanian + translations. + + * Update the German, Italian, Korean, Romanian, Serbian, and + Ukrainian man page translations. + + Summary of changes in the 5.7.x development releases: + + * Mark the following LZMA Utils script aliases as deprecated: + lzcmp, lzdiff, lzless, lzmore, lzgrep, lzegrep, and lzfgrep. + + * liblzma: + + - Improve LZMA/LZMA2 encoder speed on 64-bit PowerPC (both + endiannesses) and those 64-bit RISC-V processors that + support fast unaligned access. + + - Add low-level APIs for RISC-V, ARM64, and x86 BCJ filters + to lzma/bcj.h. These are primarily for erofs-utils. + + - x86/x86-64/E2K CLMUL CRC code was rewritten. + + - Use the CRC32 instructions on LoongArch. + + * xz: + + - Synchronize the output file and its directory using fsync() + before deleting the input file. No syncing is done when xz + isn't going to delete the input file. + + - Add --no-sync to disable the sync-before-delete behavior. + + - Make --single-stream imply --keep. + + * xz, xzdec, lzmainfo: When printing messages, replace + non-printable characters with question marks. + + * xz and xzdec on Linux: Support Landlock ABI versions 5 and 6. + + * CMake: Revise the configuration variables and some of their + options, and document them in the file INSTALL. CMake support + is no longer experimental. (It was already not experimental + when building for native Windows.) + + * Add build-aux/license-check.sh. + + +5.7.2beta (2025-03-08) + + * On the man pages, mark the following LZMA Utils script aliases as + deprecated: lzcmp, lzdiff, lzless, lzmore, lzgrep, lzegrep, and + lzfgrep. The commands that start with xz* instead of lz* have + identical behavior. + + The LZMA Utils aliases lzma, unlzma, and lzcat aren't deprecated + because some of these aliases are still in common use. lzmadec + and lzmainfo aren't deprecated either. + + * xz: In the ENVIRONMENT section of the man page, warn about + problems that some uses of XZ_DEFAULTS and XZ_OPT may create. + + * Windows (native builds, not Cygwin): In xz, xzdec, and lzmadec, + avoid an error message on broken pipe. + + * Autotools: Fix out-of-tree builds when using the bundled + getopt_long. + + * Translations: + + - Updated: Chinese (traditional), Croatian, Finnish, Georgian, + German, Korean, Polish, Romanian, Serbian, Spanish, Swedish, + Turkish, and Ukrainian + + - Added: Dutch + + * Man page translations: + + - Updated: German, Korean, Romanian, and Ukrainian + + - Added: Italian and Serbian + + +5.7.1alpha (2025-01-23) + + * All fixes from 5.6.4. + + * liblzma: + + - Improve LZMA/LZMA2 encoder speed on 64-bit PowerPC (both + endiannesses) and those 64-bit RISC-V processors that + support fast unaligned access. + + - x86/x86-64/E2K CLMUL CRC code was rewritten. It's faster and + doesn't cause false positives from sanitizers. Attributes + like __attribute__((__no_sanitize_address__)) are no longer + present. + + - On 32-bit x86, CLMUL CRC and the old (but still good) + assembly versions now co-exist with runtime detection. + Both Autotools and CMake build systems handle this + automatically now. + + - Use the CRC32 instructions on LoongArch to make CRC32 + calculation faster. + + - Add low-level APIs for RISC-V, ARM64, and x86 BCJ filters + to lzma/bcj.h. These are primarily for erofs-utils. + + - Minor tweaks to ARM64 CRC32 code and BCJ filters were made. + + * xz: + + - Synchronize the output file and its directory before deleting + the input file using fsync(). This reduces the probability of + data loss after a system crash. However, it can be a major + performance hit if processing many small files. + + NOTE: No syncing is done when xz isn't going to delete + the input file. + + - Add a new option --no-sync to disable the sync-before-delete + behavior. It's useful when compressing many small files and + one doesn't worry about data loss in case of a system crash. + + - Make --single-stream imply --keep. + + - Use automatic word wrapping for the text in --help and + similar situations to hopefully make the strings easier for + majority of translators (no need to count spaces anymore). + + * xz, xzdec, lzmainfo: When printing messages, replace + non-printable characters with question marks. This way + malicious filenames cannot be used to send escape sequences + to a terminal. This change is also applied to filenames shown + in "xz --robot --list". + + * xz and xzdec on Linux: Add support for Landlock ABI versions 5 + and 6. + + * CMake updates: + + - Increase the minimum required CMake version to 3.20. + + - Revise the configuration variables and some of their options. + Document them in the file INSTALL. + + - Attempt to produce liblzma.pc so that the paths are based on + ${prefix}, which makes it simpler to override the paths + if the liblzma files have been moved. + + - To enable translations, gettext-tools is now required. The + CMake build no longer supports installing pre-compiled + message catalog binary files (po/*.gmo). + + - Apple: Use Mach-O shared library versioning that is + compatible with GNU Libtool. This should make it easier to + switch between the build systems on Apple OSes that enforce + the correct compatibility_version (macOS >= 12 doesn't?). + This change is backward compatible: binaries linked against + old CMake-built liblzma will run with liblzma that uses + Libtool style versioning. + + - Windows (not Cygwin): Document CMAKE_DLL_NAME_WITH_SOVERSION + (CMake >= 3.27) in the file INSTALL. This option should + usually be left to its default value (OFF). It can be set + to ON if the liblzma DLL filename must be compatible with + the versioned filename produced by GNU Libtool. For example, + binaries distributed in MSYS2 use a versioned DLL filename. + + - CMake support is no longer experimental. (It was already + not experimental when building for native Windows.) + + * Windows: Building liblzma with Visual Studio 2013 is no longer + supported. Visual Studio 2015 or later (with CMake) can be used + to build liblzma and the command line tools. + + * Add preliminary Georgian translation. This already contains + translations of most of the strings that are now automatically + word wrapped. + + * Add build-aux/license-check.sh. Without arguments, it checks that + no license information has been forgotten. With the -v argument, + it shows the license info (or the lack of it) for each file. + + If the .git directory is available, only the files in the + repository are checked. Without the .git directory, a clean tree + from an extracted release tarball is expected. + + +5.6.4 (2025-01-23) + + * liblzma: Fix LZMA/LZMA2 encoder on big endian ARM64. + + * xz: + + - Fix --filters= and --filters1= ... --filters9= options + parsing. They require an argument, thus "xz --filters lzma2" + should work in addition to "xz --filters=lzma2". + + - On the man page, note in the --compress and --decompress + options that the default behavior is to delete the input + file unless writing to standard output. It was already + documented in the DESCRIPTION section but new users in + a hurry might miss it. + + * Windows (native builds, not Cygwin): Fix regressions introduced + in XZ Utils 5.6.3 which caused non-ASCII characters to display + incorrectly. Only builds with translation support were affected + (--enable-nls or ENABLE_NLS=ON). The following changes affect + builds that have translations enabled: + + - Require UCRT because MSVCRT doesn't support UTF-8 + locales and thus translations won't be readable on + Windows 10 version 1903 and later. (MSVCRT builds + are still possible with --disable-nls or ENABLE_NLS=OFF.) + + - Require gettext-runtime >= 0.23.1 because older versions + don't autodetect the use of the UTF-8 code page. This + resulted in garbled non-ASCII characters even with UCRT. + + - Partially fix alignment issues in xz --verbose --list + with translated messages. Chinese (simplified), + Chinese (traditional), and Korean column headings + are misaligned still because Windows and MinGW-w64 + don't provide wcwidth() and XZ Utils doesn't include + a replacement function either. + + * CMake: Explicitly disable unity builds. This prevents build + failures when another project uses XZ Utils via CMake's + FetchContent module, and that project enables unity builds. + + * Update Chinese (traditional) and Serbian translations. + + +5.6.3 (2024-10-01) + + IMPORTANT: This includes a Windows-specific security fix to + the command line tools (CVE-2024-47611). liblzma isn't affected + by this issue. + + * liblzma: + + - Fix x86-64 inline assembly compatibility with GNU Binutils + older than 2.27. + + - Fix the build with GCC 4.2 on OpenBSD/sparc64. + + * xzdec: Display an error instead of failing silently if the + unsupported option -M is specified. + + * lzmainfo: Fix integer overflows when rounding the dictionary and + uncompressed sizes to the nearest mebibyte. + + * Windows (except Cygwin and MSYS2): Add an application manifest to + xz, xzdec, lzmadec, and lzmainfo executables: + + - Declare them compatible with Vista/7/8/8.1/10/11. This way + the programs won't needlessly use Operating System Context + of Vista when running on later Windows versions. This setting + doesn't mean that the executables cannot run on even older + versions if otherwise built that way. + + - Declare them as UAC-compliant. MSVC added this by default + already but it wasn't done with MinGW-w64, at least not + with all toolchain variants. + + - Declare them long path aware. This makes long path names + work on Windows 10 and 11 if the feature has been enabled + in the Windows registry. + + - Use the UTF-8 code page on Windows 10 version 1903 and later. + + * Now command line tools can access files whose names + contain characters that don't exist in the current + legacy code page. + + * The options --files and --files0 now expect file lists + to be in UTF-8 instead of the legacy code page. + + * This fixes a security issue: If a command line contains + Unicode characters (for example, filenames) that don't + exist in the current legacy code page, the characters are + converted to similar-looking characters with best-fit + mapping. Some best-fit mappings result in ASCII + characters that change the meaning of the command line, + which can be exploited with malicious filenames to do + argument injection or directory traversal attacks. + UTF-8 avoids best-fit mappings and thus fixes the issue. + (CVE-2024-47611) + + Forcing the process code page to UTF-8 is possible only + on Windows 10 version 1903 and later. The command line + tools remain vulnerable if used on an old older + version of Windows. + + This issue was discovered by Orange Tsai and splitline + from DEVCORE Research Team. + + A related smaller issue remains: Windows filenames may + contain unpaired surrogates (invalid UTF-16). These are + converted to the replacement character U+FFFD in the + UTF-8 code page. Thus, filenames with different unpaired + surrogates appear identical and aren't distinguishable + from filenames that contain the actual replacement + character U+FFFD. + + * When building with MinGW-w64, it is recommended to use + UCRT version instead of the old MSVCRT. For example, + non-ASCII characters from filenames won't print + correctly in messages to console with MSVCRT with + the UTF-8 code page (a cosmetic issue). liblzma-only + builds are still fine with MSVCRT. + + - Cygwin and MSYS2 process command line options differently and + the above issues don't exist. There is no need to replace the + default application manifest on Cygwin and MSYS2. + + * Autotools-based build: + + - Fix feature checks with link-time optimization (-flto). + + - Solaris: Fix a compatibility issue in version.sh. It matters + if one wants to regenerate configure by running autoconf. + + * CMake: + + - Use paths relative to ${prefix} in liblzma.pc when possible. + This is done only with CMake >= 3.20. + + - MSVC: Install liblzma.pc as it can be useful with MSVC too. + + - Windows: Fix liblzma filename prefix, for example: + + * Cygwin: The DLL was incorrectly named liblzma-5.dll. + Now it is cyglzma-5.dll. + + * MSVC: Rename import library from liblzma.lib to lzma.lib + while keeping liblzma.dll name as is. This helps with + "pkgconf --msvc-syntax --libs liblzma" because it mungles + "-llzma" in liblzma.pc to "lzma.lib". + + * MinGW-w64: No changes. + + - Windows: Use the correct resource file for lzmadec.exe. + Previously the resource file for xzdec.exe was used for both. + Autotools-based build isn't affected. + + - Prefer a C11 compiler over a C99 compiler but accept both. + + - Link Threads::Threads against liblzma using PRIVATE so that + -pthread and such flags won't unnecessarily get included in + the usage requirements of shared liblzma. That is, + target_link_libraries(foo PRIVATE liblzma::liblzma) no + longer adds -pthread if using POSIX threads and linking + against shared liblzma. The threading flags are still added + if linking against static liblzma. + + * Updated translations: Catalan, Chinese (simplified), and + Brazilian Portuguese. + + +5.6.2 (2024-05-29) + + * Remove the backdoor (CVE-2024-3094). + + * Not changed: Memory sanitizer (MSAN) has a false positive + in the CRC CLMUL code which also makes OSS Fuzz unhappy. + Valgrind is smarter and doesn't complain. + + A revision to the CLMUL code is coming anyway and this issue + will be cleaned up as part of it. It won't be backported to + 5.6.x or 5.4.x because the old code isn't wrong. There is + no reason to risk introducing regressions in old branches + just to silence a false positive. + + * liblzma: + + - lzma_index_decoder() and lzma_index_buffer_decode(): Fix + a missing output pointer initialization (*i = NULL) if the + functions are called with invalid arguments. The API docs + say that such an initialization is always done. In practice + this matters very little because the problem can only occur + if the calling application has a bug and these functions + return LZMA_PROG_ERROR. + + - lzma_str_to_filters(): Fix a missing output pointer + initialization (*error_pos = 0). This is very similar + to the fix above. + + - Fix C standard conformance with function pointer types. + + - Remove GNU indirect function (IFUNC) support. This is *NOT* + done for security reasons even though the backdoor relied on + this code. The performance benefits of IFUNC are too tiny in + this project to make the extra complexity worth it. + + - FreeBSD on ARM64: Add error checking to CRC32 instruction + support detection. + + - Fix building with NVIDIA HPC SDK. + + * xz: + + - Fix a C standard conformance issue in --block-list parsing + (arithmetic on a null pointer). + + - Fix a warning from GNU groff when processing the man page: + "warning: cannot select font 'CW'" + + * xzdec: Add support for Linux Landlock ABI version 4. xz already + had the v3-to-v4 change but it had been forgotten from xzdec. + + * Autotools-based build system (configure): + + - Symbol versioning variant can now be overridden with + --enable-symbol-versions. Documentation in INSTALL was + updated to match. + + - Add new configure option --enable-doxygen to enable + generation and installation of the liblzma API documentation + using Doxygen. Documentation in INSTALL and PACKAGERS was + updated to match. + + CMake: + + - Fix detection of Linux Landlock support. The detection code + in CMakeLists.txt had been sabotaged. + + - Disable symbol versioning on non-glibc Linux to match what + the Autotools build does. For example, symbol versioning + isn't enabled with musl. + + - Symbol versioning variant can now be overridden by setting + SYMBOL_VERSIONING to "OFF", "generic", or "linux". + + - Add support for all tests in typical build configurations. + Now the only difference to the tests coverage to Autotools + is that CMake-based build will skip more tests if features + are disabled. Such builds are only for special cases like + embedded systems. + + - Separate the CMake code for the tests into tests/tests.cmake. + It is used conditionally, thus it is possible to + + rm -rf tests + + and the CMake-based build will still work normally except + that no tests are then available. + + - Add a option ENABLE_DOXYGEN to enable generation and + installation of the liblzma API documentation using Doxygen. + + * Documentation: + + - Omit the Doxygen-generated liblzma API documentation from the + package. Instead, the generation and installation of the API + docs can be enabled with a configure or CMake option if + Doxygen is available. + + - Remove the XZ logo which was used in the API documentation. + The logo has been retired and isn't used by the project + anymore. However, it's OK to use it in contexts that refer + to the backdoor incident. + + - Remove the PDF versions of the man pages from the source + package. These existed primarily for users of operating + systems which don't come with tools to render man page + source files. The plain text versions are still included + in doc/man/txt. PDF files can still be generated to doc/man, + if the required tools are available, using "make pdf" after + running "configure". + + - Update home page URLs back to their old locations on + tukaani.org. + + - Update maintainer info. + + * Tests: + + - In tests/files/README, explain how to recreate the ARM64 + test files. + + - Remove two tests that used tiny x86 and SPARC object files + as the input files. The matching .c file was included but + the object files aren't easy to reproduce. The test cases + weren't great anyway; they were from the early days (2009) + of the project when the test suite had very few tests. + + - Improve a few tests. + + +5.6.1 (2024-03-09) + + IMPORTANT: This fixed bugs in the backdoor (CVE-2024-3094) (someone + had forgot to run Valgrind). + + * liblzma: Fixed two bugs relating to GNU indirect function (IFUNC) + with GCC. The more serious bug caused a program linked with + liblzma to crash on start up if the flag -fprofile-generate was + used to build liblzma. The second bug caused liblzma to falsely + report an invalid write to Valgrind when loading liblzma. + + * xz: Changed the messages for thread reduction due to memory + constraints to only appear under the highest verbosity level. + + * Build: + + - Fixed a build issue when the header file + was present on the system but the Landlock system calls were + not defined in . + + - The CMake build now warns and disables NLS if both gettext + tools and pre-created .gmo files are missing. Previously, + this caused the CMake build to fail. + + * Minor improvements to man pages. + + * Minor improvements to tests. + + +5.6.0 (2024-02-24) + + IMPORTANT: This added a backdoor (CVE-2024-3094). It's enabled only + in the release tarballs. + + This bumps the minor version of liblzma because new features were + added. The API and ABI are still backward compatible with liblzma + 5.4.x and 5.2.x and 5.0.x. + + NOTE: As described in the NEWS for 5.5.2beta, the core components + are now under the BSD Zero Clause License (0BSD). + + Since 5.5.2beta: + + * liblzma: + + - Disabled the branchless C variant in the LZMA decoder based + on the benchmark results from the community. + + - Disabled x86-64 inline assembly on x32 to fix the build. + + * Sandboxing support in xz: + + - Landlock is now used even when xz needs to create files. + In this case the sandbox has to be more permissive than + when no files need to be created. A similar thing was + already in use with pledge(2) since 5.3.4alpha. + + - Landlock and pledge(2) are now stricter when reading from + more than one input file and only writing to standard output. + + - Added support for Landlock ABI version 4. + + * CMake: + + - Default to -O2 instead of -O3 with CMAKE_BUILD_TYPE=Release. + -O3 is not useful for speed and makes the code larger. + + - Now builds lzmainfo and lzmadec. + + - xzdiff, xzgrep, xzless, xzmore, and their symlinks are now + installed. The scripts are also tested during "make test". + + - Added translation support for xz, lzmainfo, and the + man pages. + + - Applied the symbol versioning workaround for MicroBlaze that + is used in the Autotools build. + + - The general XZ Utils and liblzma API documentation is now + installed. + + - The CMake component names were changed a little and several + were added. liblzma_Runtime and liblzma_Development are + unchanged. + + - Minimum required CMake version is now 3.14. However, + translation support is disabled with CMake versions + older than 3.20. + + - The CMake-based build is now close to feature parity with the + Autotools-based build. Most importantly a few tests aren't + run yet. Testing the CMake-based build on different operating + systems would be welcome now. See the comment at the top of + CMakeLists.txt. + + * Fixed a bug in the Autotools feature test for ARM64 CRC32 + instruction support for old versions of Clang. This did not + affect the CMake build. + + * Windows: + + - The build instructions in INSTALL and windows/INSTALL*.txt + were revised completely. + + - windows/build-with-cmake.bat along with the instructions + in windows/INSTALL-MinGW-w64_with_CMake.txt should make + it very easy to build liblzma.dll and xz.exe on Windows + using CMake and MinGW-w64 with either GCC or Clang/LLVM. + + - windows/build.bash was updated. It now works on MSYS2 and + on GNU/Linux (cross-compiling) to create a .zip and .7z + package for 32-bit and 64-bit x86 using GCC + MinGW-w64. + + * The TODO file is no longer installed as part of the + documentation. The file is out of date and does not reflect + the actual tasks that will be completed in the future. + + * Translations: + + - Translated lzmainfo man pages are now installed. These + had been forgotten in earlier versions. + + - Updated Croatian, Esperanto, German, Hungarian, Korean, + Polish, Romanian, Spanish, Swedish, Vietnamese, and Ukrainian + translations. + + - Updated German, Korean, Romanian, and Ukrainian man page + translations. + + * Added a few tests. + + Summary of new features added in the 5.5.x development releases: + + * liblzma: + + - LZMA decoder: Speed optimizations to the C code and + added GCC & Clang compatible inline assembly for x86-64. + + - Added lzma_mt_block_size() to recommend a Block size for + multithreaded encoding. + + - Added CLMUL-based CRC32 on x86-64 and E2K with runtime + processor detection. Similar to CRC64, on 32-bit x86 it + isn't available unless --disable-assembler is used. + + - Optimized the CRC32 calculation on ARM64 platforms using the + CRC32 instructions. Runtime detection for the instruction is + used on GNU/Linux, FreeBSD, Windows, and macOS. If the + compiler flags indicate unconditional CRC32 instruction + support (+crc) then the generic version is not built. + + - Added definitions of mask values like + LZMA_INDEX_CHECK_MASK_CRC32 to . + + * xz: + + - Multithreaded mode is now the default. This improves + compression speed and creates .xz files that can be + decompressed in multithreaded mode. The downsides are + increased memory usage and slightly worse compression ratio. + + - Added a new command line option --filters to set the filter + chain using the liblzma filter string syntax. + + - Added new command line options --filters1 ... --filters9 to + set additional filter chains using the liblzma filter string + syntax. The --block-list option now allows specifying filter + chains that were set using these new options. + + - Ported the command line tools to Windows MSVC. + Visual Studio 2015 or later is required. + + * Added lz4 support to xzdiff/xzcmp and xzgrep. + + +5.5.2beta (2024-02-14) + + * Licensing change: The core components are now under the + BSD Zero Clause License (0BSD). In XZ Utils 5.4.6 and older + and 5.5.1alpha these components are in the public domain and + obviously remain so; the change affects the new releases only. + + 0BSD is an extremely permissive license which doesn't require + retaining or reproducing copyright or license notices when + distributing the code, thus in practice there is extremely + little difference to public domain. + + * liblzma + + - Significant speed optimizations to the LZMA decoder were + made. There are now three variants that can be chosen at + build time: + + * Basic C version: This is a few percent faster than + 5.4.x due to some new optimizations. + + * Branchless C: This is currently the default on platforms + for which there is no assembly code. This should be a few + percent faster than the basic C version. + + * x86-64 inline assembly. This works with GCC and Clang. + + The default choice can currently be overridden by setting + LZMA_RANGE_DECODER_CONFIG in CPPFLAGS: 0 means the basic + version and 3 means that branchless C version. + + - Optimized the CRC32 calculation on ARM64 platforms using the + CRC32 instructions. The instructions are optional in ARMv8.0 + and are required in ARMv8.1 and later. Runtime detection for + the instruction is used on GNU/Linux, FreeBSD, Windows, and + macOS. If the compiler flags indicate unconditional CRC32 + instruction support (+crc) then the generic version is not + built. + + * Added lz4 support to xzdiff/xzcmp and xzgrep. + + * Man pages of xzdiff/xzcmp, xzgrep, and xzmore were rewritten + to simplify licensing of the man page translations. + + * Translations: + + - Updated Chinese (simplified), German, Korean, Polish, + Romanian, Spanish, Swedish, and Ukrainian translations. + + - Updated German, Korean, Romanian, and Ukrainian man page + translations. + + * Small improvements to the tests. + + * Added doc/examples/11_file_info.c. It was added to the Git + repository in 2017 but forgotten to be added into distribution + tarballs. + + * Removed doc/examples_old. These were from 2012. + + * Removed the macos/build.sh script. It had not been updated + since 2013. + + +5.5.1alpha (2024-01-26) + + * Added a new filter for RISC-V binaries. The filter can be used + for 32-bit and 64-bit binaries with either little or big + endianness. In liblzma, the Filter ID is LZMA_FILTER_RISCV (0x0B) + and the xz option is --riscv. liblzma filter string syntax + recognizes this filter as "riscv". + + * liblzma: + + - Added lzma_mt_block_size() to recommend a Block size for + multithreaded encoding + + - Added CLMUL-based CRC32 on x86-64 and E2K with runtime + processor detection. Similar to CRC64, on 32-bit x86 it + isn't available unless --disable-assembler is used. + + - Implemented GNU indirect function (IFUNC) as a runtime + function dispatching method for CRC32 and CRC64 fast + implementations on x86. Only GNU/Linux (glibc) and FreeBSD + builds will use IFUNC, unless --enable-ifunc is specified to + configure. + + - Added definitions of mask values like + LZMA_INDEX_CHECK_MASK_CRC32 to . + + - The XZ logo is now included in the Doxygen generated + documentation. It is licensed under Creative Commons + Attribution-ShareAlike 4.0. + + * xz: + + - Multithreaded mode is now the default. This improves + compression speed and creates .xz files that can be + decompressed multithreaded at the cost of increased memory + usage and slightly worse compression ratio. + + - Added new command line option --filters to set the filter + chain using liblzma filter string syntax. + + - Added new command line options --filters1 ... --filters9 to + set additional filter chains using liblzma filter string + syntax. The --block-list option now allows specifying filter + chains that were set using these new options. + + - Added support for Linux Landlock as a sandboxing method. + + - xzdec now supports pledge(2), Capsicum, and Linux Landlock as + sandboxing methods. + + - Progress indicator time stats remain accurate after pausing + xz with SIGTSTP. + + - Ported xz and xzdec to Windows MSVC. Visual Studio 2015 or + later is required. + + * CMake Build: + + - Supports pledge(2), Capsicum, and Linux Landlock sandboxing + methods. + + - Replacement functions for getopt_long() are used on platforms + that do not have it. + + * Enabled unaligned access by default on PowerPC64LE and on RISC-V + targets that define __riscv_misaligned_fast. + + * Tests: + + - Added two new fuzz targets to OSS-Fuzz. + + - Implemented Continuous Integration (CI) testing using + GitHub Actions. + + * Changed quoting style from `...' to '...' in all messages, + scripts, and documentation. + + * Added basic Codespell support to help catch typo errors. + + +5.4.7 (2024-05-29) + + * Not changed: Memory sanitizer (MSAN) has a false positive + in the CRC CLMUL code which also makes OSS Fuzz unhappy. + Valgrind is smarter and doesn't complain. + + A revision to the CLMUL code is coming anyway and this issue + will be cleaned up as part of it. It won't be backported to + 5.6.x or 5.4.x because the old code isn't wrong. There is + no reason to risk introducing regressions in old branches + just to silence a false positive. + + * liblzma: + + - lzma_index_decoder() and lzma_index_buffer_decode(): Fix + a missing output pointer initialization (*i = NULL) if the + functions are called with invalid arguments. The API docs + say that such an initialization is always done. In practice + this matters very little because the problem can only occur + if the calling application has a bug and these functions + return LZMA_PROG_ERROR. + + - lzma_str_to_filters(): Fix a missing output pointer + initialization (*error_pos = 0). This is very similar + to the fix above. + + - Fix C standard conformance with function pointer types. + This newly showed up with Clang 17 with -fsanitize=undefined. + There are no bug reports about this. + + - Fix building with NVIDIA HPC SDK. + + * xz: + + - Fix a C standard conformance issue in --block-list parsing + (arithmetic on a null pointer). + + - Fix a warning from GNU groff when processing the man page: + "warning: cannot select font 'CW'" + + - Fix outdated threading related information on the man page. + + * xzless: + + - With "less" version 451 and later, use "||-" instead of "|-" + in the environment variable LESSOPEN. This way compressed + files that contain no uncompressed data are shown correctly + as empty. + + - With "less" version 632 and later, use --show-preproc-errors + to make "less" show a warning on decompression errors. + + * Autotools-based build system (configure): + + - Symbol versioning variant can now be overridden with + --enable-symbol-versions. Documentation in INSTALL was + updated to match. + + CMake: + + - Linux on MicroBlaze is handled specially now. This matches + the changes made to the Autotools-based build in XZ Utils + 5.4.2 and 5.2.11. + + - Disable symbol versioning on non-glibc Linux to match what + the Autotools build does. For example, symbol versioning + isn't enabled with musl. + + - Symbol versioning variant can now be overridden by setting + SYMBOL_VERSIONING to "OFF", "generic", or "linux". + + * Documentation: + + - Clarify the description of --disable-assembler in INSTALL. + The option only affects 32-bit x86 assembly usage. + + - Add doc/examples/11_file_info.c. It was added to the + Git repository in 2017 but forgotten to be added into + distribution tarballs. + + - Don't install the TODO file as part of the documentation. + The file is out of date. + + - Update home page URLs back to their old locations on + tukaani.org. + + - Update maintainer info. + + +5.4.6 (2024-01-26) + + * Fixed a bug involving internal function pointers in liblzma not + being initialized to NULL. The bug can only be triggered if + lzma_filters_update() is called on a LZMA1 encoder, so it does + not affect xz or any application known to us that uses liblzma. + + * xz: + + - Fixed a regression introduced in 5.4.2 that caused encoding + in the raw format to unnecessarily fail if --suffix was not + used. For instance, the following command no longer reports + that --suffix must be used: + + echo foo | xz --format=raw --lzma2 | wc -c + + - Fixed an issue on MinGW-w64 builds that prevented reading + from or writing to non-terminal character devices like NUL. + + * Added a new test. + + +5.4.5 (2023-11-01) + + * liblzma: + + - Use __attribute__((__no_sanitize_address__)) to avoid address + sanitization with CRC64 CLMUL. It uses 16-byte-aligned reads + which can extend past the bounds of the input buffer and + inherently trigger address sanitization errors. This isn't + a bug. + + - Fixed an assertion failure that could be triggered by a large + unpadded_size argument. It was verified that there was no + other bug than the assertion failure. + + - Fixed a bug that prevented building with Windows Vista + threading when __attribute__((__constructor__)) is not + supported. + + * xz now properly handles special files such as "con" or "nul" on + Windows. Before this fix, the following wrote "foo" to the + console and deleted the input file "con_xz": + + echo foo | xz > con_xz + xz --suffix=_xz --decompress con_xz + + * Build systems: + + - Allow builds with Windows win95 threading and small mode when + __attribute__((__constructor__)) is supported. + + - Added a new line to liblzma.pc for MSYS2 (Windows): + + Cflags.private: -DLZMA_API_STATIC + + When compiling code that will link against static liblzma, + the LZMA_API_STATIC macro needs to be defined on Windows. + + - CMake specific changes: + + * Fixed a bug that allowed CLOCK_MONOTONIC to be used even + if the check for it failed. + + * Fixed a bug where configuring CMake multiple times + resulted in HAVE_CLOCK_GETTIME and HAVE_CLOCK_MONOTONIC + not being set. + + * Fixed the build with MinGW-w64-based Clang/LLVM 17. + llvm-windres now has more accurate GNU windres emulation + so the GNU windres workaround from 5.4.1 is needed with + llvm-windres version 17 too. + + * The import library on Windows is now properly named + "liblzma.dll.a" instead of "libliblzma.dll.a" + + * Fixed a bug causing the Ninja Generator to fail on + UNIX-like systems. This bug was introduced in 5.4.0. + + * Added a new option to disable CLMUL CRC64. + + * A module-definition (.def) file is now created when + building liblzma.dll with MinGW-w64. + + * The pkg-config liblzma.pc file is now installed on all + builds except when using MSVC on Windows. + + * Added large file support by default for platforms that + need it to handle files larger than 2 GiB. This includes + MinGW-w64, even 64-bit builds. + + * Small fixes and improvements to the tests. + + * Updated translations: Chinese (simplified) and Esperanto. + + +5.4.4 (2023-08-02) + + * liblzma and xzdec can now build against WASI SDK when threading + support is disabled. xz and tests don't build yet. + + * CMake: + + - Fixed a bug preventing other projects from including liblzma + multiple times using find_package(). + + - Don't create broken symlinks in Cygwin and MSYS2 unless + supported by the environment. This prevented building for the + default MSYS2 environment. The problem was introduced in + xz 5.4.0. + + * Documentation: + + - Small improvements to man pages. + + - Small improvements and typo fixes for liblzma API + documentation. + + * Tests: + + - Added a new section to INSTALL to describe basic test usage + and address recent questions about building the tests when + cross compiling. + + - Small fixes and improvements to the tests. + + * Translations: + + - Fixed a mistake that caused one of the error messages to not + be translated. This only affected versions 5.4.2 and 5.4.3. + + - Updated the Chinese (simplified), Croatian, Esperanto, German, + Korean, Polish, Romanian, Spanish, Swedish, Ukrainian, and + Vietnamese translations. + + - Updated the German, Korean, Romanian, and Ukrainian man page + translations. + + +5.4.3 (2023-05-04) + + * All fixes from 5.2.12 + + * Features in the CMake build can now be disabled as CMake cache + variables, similar to the Autotools build. + + * Minor update to the Croatian translation. + + +5.4.2 (2023-03-18) + + * All fixes from 5.2.11 that were not included in 5.4.1. + + * If xz is built with support for the Capsicum sandbox but running + in an environment that doesn't support Capsicum, xz now runs + normally without sandboxing instead of exiting with an error. + + * liblzma: + + - Documentation was updated to improve the style, consistency, + and completeness of the liblzma API headers. + + - The Doxygen-generated HTML documentation for the liblzma API + header files is now included in the source release and is + installed as part of "make install". All JavaScript is + removed to simplify license compliance and to reduce the + install size. + + - Fixed a minor bug in lzma_str_from_filters() that produced + too many filters in the output string instead of reporting + an error if the input array had more than four filters. This + bug did not affect xz. + + * Build systems: + + - autogen.sh now invokes the doxygen tool via the new wrapper + script doxygen/update-doxygen, unless the command line option + --no-doxygen is used. + + - Added microlzma_encoder.c and microlzma_decoder.c to the + VS project files for Windows and to the CMake build. These + should have been included in 5.3.2alpha. + + * Tests: + + - Added a test to the CMake build that was forgotten in the + previous release. + + - Added and refactored a few tests. + + * Translations: + + - Updated the Brazilian Portuguese translation. + + - Added Brazilian Portuguese man page translation. + + +5.4.1 (2023-01-11) + + * liblzma: + + - Fixed the return value of lzma_microlzma_encoder() if the + LZMA options lc/lp/pb are invalid. Invalid lc/lp/pb options + made the function return LZMA_STREAM_END without encoding + anything instead of returning LZMA_OPTIONS_ERROR. + + - Windows / Visual Studio: Workaround a possible compiler bug + when targeting 32-bit x86 and compiling the CLMUL version of + the CRC64 code. The CLMUL code isn't enabled by the Windows + project files but it is in the CMake-based builds. + + * Build systems: + + - Windows-specific CMake changes: + + * Don't try to enable CLMUL CRC64 code if _mm_set_epi64x() + isn't available. This fixes CMake-based build with Visual + Studio 2013. + + * Created a workaround for a build failure with windres + from GNU binutils. It is used only when the C compiler + is GCC (not Clang). The workaround is incompatible + with llvm-windres, resulting in "XZx20Utils" instead + of "XZ Utils" in the resource file, but without the + workaround llvm-windres works correctly. See the + comment in CMakeLists.txt for details. + + * Included the resource files in the xz and xzdec build + rules. Building the command line tools is still + experimental but possible with MinGW-w64. + + - Visual Studio: Added stream_decoder_mt.c to the project + files. Now the threaded decompressor lzma_stream_decoder_mt() + gets built. CMake-based build wasn't affected. + + - Updated windows/INSTALL-MSVC.txt to mention that CMake-based + build is now the preferred method with Visual Studio. The + project files will probably be removed after 5.4.x releases. + + - Changes to #defines in config.h: + + * HAVE_DECL_CLOCK_MONOTONIC was replaced by + HAVE_CLOCK_MONOTONIC. The old macro was always defined + in configure-generated config.h to either 0 or 1. The + new macro is defined (to 1) only if the declaration of + CLOCK_MONOTONIC is available. This matches the way most + other config.h macros work and makes things simpler with + other build systems. + + * HAVE_DECL_PROGRAM_INVOCATION_NAME was replaced by + HAVE_PROGRAM_INVOCATION_NAME for the same reason. + + * Tests: + + - Fixed test script compatibility with ancient /bin/sh + versions. Now the five test_compress_* tests should + no longer fail on Solaris 10. + + - Added and refactored a few tests. + + * Translations: + + - Updated the Catalan and Esperanto translations. + + - Added Korean and Ukrainian man page translations. + + +5.4.0 (2022-12-13) + + This bumps the minor version of liblzma because new features were + added. The API and ABI are still backward compatible with liblzma + 5.2.x and 5.0.x. + + Since 5.3.5beta: + + * All fixes from 5.2.10. + + * The ARM64 filter is now stable. The xz option is now --arm64. + Decompression requires XZ Utils 5.4.0. In the future the ARM64 + filter will be supported by XZ for Java, XZ Embedded (including + the version in Linux), LZMA SDK, and 7-Zip. + + * Translations: + + - Updated Catalan, Croatian, German, Romanian, and Turkish + translations. + + - Updated German man page translations. + + - Added Romanian man page translations. + + Summary of new features added in the 5.3.x development releases: + + * liblzma: + + - Added threaded .xz decompressor lzma_stream_decoder_mt(). + It can use multiple threads with .xz files that have multiple + Blocks with size information in Block Headers. The threaded + encoder in xz has always created such files. + + Single-threaded encoder cannot store the size information in + Block Headers even if one used LZMA_FULL_FLUSH to create + multiple Blocks, so this threaded decoder cannot use multiple + threads with such files. + + If there are multiple Streams (concatenated .xz files), one + Stream will be decompressed completely before starting the + next Stream. + + - A new decoder flag LZMA_FAIL_FAST was added. It makes the + threaded decompressor report errors soon instead of first + flushing all pending data before the error location. + + - New Filter IDs: + * LZMA_FILTER_ARM64 is for ARM64 binaries. + * LZMA_FILTER_LZMA1EXT is for raw LZMA1 streams that don't + necessarily use the end marker. + + - Added lzma_str_to_filters(), lzma_str_from_filters(), and + lzma_str_list_filters() to convert a preset or a filter chain + string to a lzma_filter[] and vice versa. These should make + it easier to write applications that allow users to specify + custom compression options. + + - Added lzma_filters_free() which can be convenient for freeing + the filter options in a filter chain (an array of lzma_filter + structures). + + - lzma_file_info_decoder() to makes it a little easier to get + the Index field from .xz files. This helps in getting the + uncompressed file size but an easy-to-use random access + API is still missing which has existed in XZ for Java for + a long time. + + - Added lzma_microlzma_encoder() and lzma_microlzma_decoder(). + It is used by erofs-utils and may be used by others too. + + The MicroLZMA format is a raw LZMA stream (without end marker) + whose first byte (always 0x00) has been replaced with + bitwise-negation of the LZMA properties (lc/lp/pb). It was + created for use in EROFS but may be used in other contexts + as well where it is important to avoid wasting bytes for + stream headers or footers. The format is also supported by + XZ Embedded (the XZ Embedded version in Linux got MicroLZMA + support in Linux 5.16). + + The MicroLZMA encoder API in liblzma can compress into a + fixed-sized output buffer so that as much data is compressed + as can be fit into the buffer while still creating a valid + MicroLZMA stream. This is needed for EROFS. + + - Added lzma_lzip_decoder() to decompress the .lz (lzip) file + format version 0 and the original unextended version 1 files. + Also lzma_auto_decoder() supports .lz files. + + - lzma_filters_update() can now be used with the multi-threaded + encoder (lzma_stream_encoder_mt()) to change the filter chain + after LZMA_FULL_BARRIER or LZMA_FULL_FLUSH. + + - In lzma_options_lzma, allow nice_len = 2 and 3 with the match + finders that require at least 3 or 4. Now it is internally + rounded up if needed. + + - CLMUL-based CRC64 on x86-64 and E2K with runtime processor + detection. On 32-bit x86 it currently isn't available unless + --disable-assembler is used which can make the non-CLMUL + CRC64 slower; this might be fixed in the future. + + - Building with --disable-threads --enable-small + is now thread-safe if the compiler supports + __attribute__((__constructor__)). + + * xz: + + - Using -T0 (--threads=0) will now use multi-threaded encoder + even on a single-core system. This is to ensure that output + from the same xz binary is identical on both single-core and + multi-core systems. + + - --threads=+1 or -T+1 is now a way to put xz into + multi-threaded mode while using only one worker thread. + The + is ignored if the number is not 1. + + - A default soft memory usage limit is now used for compression + when -T0 is used and no explicit limit has been specified. + This soft limit is used to restrict the number of threads + but if the limit is exceeded with even one thread then xz + will continue with one thread using the multi-threaded + encoder and this limit is ignored. If the number of threads + is specified manually then no default limit will be used; + this affects only -T0. + + This change helps on systems that have very many cores and + using all of them for xz makes no sense. Previously xz -T0 + could run out of memory on such systems because it attempted + to reserve memory for too many threads. + + This also helps with 32-bit builds which don't have a large + amount of address space that would be required for many + threads. The default soft limit for -T0 is at most 1400 MiB + on all 32-bit platforms. + + - Previously a low value in --memlimit-compress wouldn't cause + xz to switch from multi-threaded mode to single-threaded mode + if the limit cannot otherwise be met; xz failed instead. Now + xz can switch to single-threaded mode and then, if needed, + scale down the LZMA2 dictionary size too just like it already + did when it was started in single-threaded mode. + + - The option --no-adjust no longer prevents xz from scaling down + the number of threads as that doesn't affect the compressed + output (only performance). Now --no-adjust only prevents + adjustments that affect compressed output, that is, with + --no-adjust xz won't switch from multi-threaded mode to + single-threaded mode and won't scale down the LZMA2 + dictionary size. + + - Added a new option --memlimit-mt-decompress=LIMIT. This is + used to limit the number of decompressor threads (possibly + falling back to single-threaded mode) but it will never make + xz refuse to decompress a file. This has a system-specific + default value because without any limit xz could end up + allocating memory for the whole compressed input file, the + whole uncompressed output file, multiple thread-specific + decompressor instances and so on. Basically xz could + attempt to use an insane amount of memory even with fairly + common files. The system-specific default value is currently + the same as the one used for compression with -T0. + + The new option works together with the existing option + --memlimit-decompress=LIMIT. The old option sets a hard limit + that must not be exceeded (xz will refuse to decompress) + while the new option only restricts the number of threads. + If the limit set with --memlimit-mt-decompress is greater + than the limit set with --memlimit-compress, then the latter + value is used also for --memlimit-mt-decompress. + + - Added new information to the output of xz --info-memory and + new fields to the output of xz --robot --info-memory. + + - In --lzma2=nice=NUMBER allow 2 and 3 with all match finders + now that liblzma handles it. + + - Don't mention endianness for ARM and ARM-Thumb filters in + --long-help. The filters only work for little endian + instruction encoding but modern ARM processors using + big endian data access still use little endian + instruction encoding. So the help text was misleading. + In contrast, the PowerPC filter is only for big endian + 32/64-bit PowerPC code. Little endian PowerPC would need + a separate filter. + + - Added decompression support for the .lz (lzip) file format + version 0 and the original unextended version 1. It is + autodetected by default. See also the option --format on + the xz man page. + + - Sandboxing enabled by default: + * Capsicum (FreeBSD) + * pledge(2) (OpenBSD) + + * Scripts now support the .lz format using xz. + + * A few new tests were added. + + * The liblzma-specific tests are now supported in CMake-based + builds too ("make test"). + + +5.3.5beta (2022-12-01) + + * All fixes from 5.2.9. + + * liblzma: + + - Added new LZMA_FILTER_LZMA1EXT for raw encoder and decoder to + handle raw LZMA1 streams that don't have end of payload marker + (EOPM) alias end of stream (EOS) marker. It can be used in + filter chains, for example, with the x86 BCJ filter. + + - Added lzma_str_to_filters(), lzma_str_from_filters(), and + lzma_str_list_filters() to make it easier for applications + to get custom compression options from a user and convert + it to an array of lzma_filter structures. + + - Added lzma_filters_free(). + + - lzma_filters_update() can now be used with the multi-threaded + encoder (lzma_stream_encoder_mt()) to change the filter chain + after LZMA_FULL_BARRIER or LZMA_FULL_FLUSH. + + - In lzma_options_lzma, allow nice_len = 2 and 3 with the match + finders that require at least 3 or 4. Now it is internally + rounded up if needed. + + - ARM64 filter was modified. It is still experimental. + + - Fixed LTO build with Clang if -fgnuc-version=10 or similar + was used to make Clang look like GCC >= 10. Now it uses + __has_attribute(__symver__) which should be reliable. + + * xz: + + - --threads=+1 or -T+1 is now a way to put xz into multi-threaded + mode while using only one worker thread. + + - In --lzma2=nice=NUMBER allow 2 and 3 with all match finders + now that liblzma handles it. + + * Updated translations: Chinese (simplified), Korean, and Turkish. + + +5.3.4alpha (2022-11-15) + + * All fixes from 5.2.7 and 5.2.8. + + * liblzma: + + - Minor improvements to the threaded decoder. + + - Added CRC64 implementation that uses SSSE3, SSE4.1, and CLMUL + instructions on 32/64-bit x86 and E2K. On 32-bit x86 it's + not enabled unless --disable-assembler is used but then + the non-CLMUL code might be slower. Processor support is + detected at runtime so this is built by default on x86-64 + and E2K. On these platforms, if compiler flags indicate + unconditional CLMUL support (-msse4.1 -mpclmul) then the + generic version is not built, making liblzma 8-9 KiB smaller + compared to having both versions included. + + With extremely compressible files this can make decompression + up to twice as fast but with typical files 5 % improvement + is a more realistic expectation. + + The CLMUL version is slower than the generic version with + tiny inputs (especially at 1-8 bytes per call, but up to + 16 bytes). In normal use in xz this doesn't matter at all. + + - Added an experimental ARM64 filter. This is *not* the final + version! Files created with this experimental version won't + be supported in the future versions! The filter design is + a compromise where improving one use case makes some other + cases worse. + + - Added decompression support for the .lz (lzip) file format + version 0 and the original unextended version 1. See the + API docs of lzma_lzip_decoder() for details. Also + lzma_auto_decoder() supports .lz files. + + - Building with --disable-threads --enable-small + is now thread-safe if the compiler supports + __attribute__((__constructor__)) + + * xz: + + - Added support for OpenBSD's pledge(2) as a sandboxing method. + + - Don't mention endianness for ARM and ARM-Thumb filters in + --long-help. The filters only work for little endian + instruction encoding but modern ARM processors using + big endian data access still use little endian + instruction encoding. So the help text was misleading. + In contrast, the PowerPC filter is only for big endian + 32/64-bit PowerPC code. Little endian PowerPC would need + a separate filter. + + - Added --experimental-arm64. This will be renamed once the + filter is finished. Files created with this experimental + filter will not be supported in the future! + + - Added new fields to the output of xz --robot --info-memory. + + - Added decompression support for the .lz (lzip) file format + version 0 and the original unextended version 1. It is + autodetected by default. See also the option --format on + the xz man page. + + * Scripts now support the .lz format using xz. + + * Build systems: + + - New #defines in config.h: HAVE_ENCODER_ARM64, + HAVE_DECODER_ARM64, HAVE_LZIP_DECODER, HAVE_CPUID_H, + HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR, HAVE_USABLE_CLMUL + + - New configure options: --disable-clmul-crc, + --disable-microlzma, --disable-lzip-decoder, and + 'pledge' is now an option in --enable-sandbox (but + it's autodetected by default anyway). + + - INSTALL was updated to document the new configure options. + + - PACKAGERS now lists also --disable-microlzma and + --disable-lzip-decoder as configure options that must + not be used in builds for non-embedded use. + + * Tests: + + - Fix some of the tests so that they skip instead of fail if + certain features have been disabled with configure options. + It's still not perfect. + + - Other improvements to tests. + + * Updated translations: Croatian, Finnish, Hungarian, Polish, + Romanian, Spanish, Swedish, and Ukrainian. + + +5.3.3alpha (2022-08-22) + + * All fixes from 5.2.6. + + * liblzma: + + - Fixed 32-bit build. + + - Added threaded .xz decompressor lzma_stream_decoder_mt(). + It can use multiple threads with .xz files that have multiple + Blocks with size information in Block Headers. The threaded + encoder in xz has always created such files. + + Single-threaded encoder cannot store the size information in + Block Headers even if one used LZMA_FULL_FLUSH to create + multiple Blocks, so this threaded decoder cannot use multiple + threads with such files. + + If there are multiple Streams (concatenated .xz files), one + Stream will be decompressed completely before starting the + next Stream. + + - A new decoder flag LZMA_FAIL_FAST was added. It makes the + threaded decompressor report errors soon instead of first + flushing all pending data before the error location. + + * xz: + + - Using -T0 (--threads=0) will now use multi-threaded encoder + even on a single-core system. This is to ensure that output + from the same xz binary is identical on both single-core and + multi-core systems. + + - A default soft memory usage limit is now used for compression + when -T0 is used and no explicit limit has been specified. + This soft limit is used to restrict the number of threads + but if the limit is exceeded with even one thread then xz + will continue with one thread using the multi-threaded + encoder and this limit is ignored. If the number of threads + is specified manually then no default limit will be used; + this affects only -T0. + + This change helps on systems that have very many cores and + using all of them for xz makes no sense. Previously xz -T0 + could run out of memory on such systems because it attempted + to reserve memory for too many threads. + + This also helps with 32-bit builds which don't have a large + amount of address space that would be required for many + threads. The default limit is 1400 MiB on all 32-bit + platforms with -T0. + + Now xz -T0 should just work. It might use too few threads + in some cases but at least it shouldn't easily run out of + memory. It's possible that this will be tweaked before 5.4.0. + + - Changes to --memlimit-compress and --no-adjust: + + In single-threaded mode, --memlimit-compress can make xz + scale down the LZMA2 dictionary size to meet the memory usage + limit. This obviously affects the compressed output. However, + if xz was in threaded mode, --memlimit-compress could make xz + reduce the number of threads but it wouldn't make xz switch + from multi-threaded mode to single-threaded mode or scale + down the LZMA2 dictionary size. This seemed illogical. + + Now --memlimit-compress can make xz switch to single-threaded + mode if one thread in multi-threaded mode uses too much + memory. If memory usage is still too high, then the LZMA2 + dictionary size can be scaled down too. + + The option --no-adjust was also changed so that it no longer + prevents xz from scaling down the number of threads as that + doesn't affect compressed output (only performance). After + this commit --no-adjust only prevents adjustments that affect + compressed output, that is, with --no-adjust xz won't switch + from multithreaded mode to single-threaded mode and won't + scale down the LZMA2 dictionary size. + + - Added a new option --memlimit-mt-decompress=LIMIT. This is + used to limit the number of decompressor threads (possibly + falling back to single-threaded mode) but it will never make + xz refuse to decompress a file. This has a system-specific + default value because without any limit xz could end up + allocating memory for the whole compressed input file, the + whole uncompressed output file, multiple thread-specific + decompressor instances and so on. Basically xz could + attempt to use an insane amount of memory even with fairly + common files. + + The new option works together with the existing option + --memlimit-decompress=LIMIT. The old option sets a hard limit + that must not be exceeded (xz will refuse to decompress) + while the new option only restricts the number of threads. + If the limit set with --memlimit-mt-decompress is greater + than the limit set with --memlimit-compress, then the latter + value is used also for --memlimit-mt-decompress. + + * Tests: + + - Added a few more tests. + + - Added tests/code_coverage.sh to create a code coverage report + of the tests. + + * Build systems: + + - Automake's parallel test harness is now used to make tests + finish faster. + + - Added the CMake files to the distribution tarball. These were + supposed to be in 5.2.5 already. + + - Added liblzma tests to the CMake build. + + - Windows: Fix building of liblzma.dll with the included + Visual Studio project files. + + +5.3.2alpha (2021-10-28) + + This release was made on short notice so that recent erofs-utils can + be built with LZMA support without needing a snapshot from xz.git. + Thus many pending things were not included, not even updated + translations (which would need to be updated for the new --list + strings anyway). + + * All fixes from 5.2.5. + + * xz: + + - When copying metadata from the source file to the destination + file, don't try to set the group (GID) if it is already set + correctly. This avoids a failure on OpenBSD (and possibly on + a few other OSes) where files may get created so that their + group doesn't belong to the user, and fchown(2) can fail even + if it needs to do nothing. + + - The --keep option now accepts symlinks, hardlinks, and + setuid, setgid, and sticky files. Previously this required + using --force. + + - Split the long strings used in --list and --info-memory modes + to make them much easier for translators. + + - If built with sandbox support and enabling the sandbox fails, + xz will now immediately exit with exit status of 1. Previously + it would only display a warning if -vv was used. + + - Cap --memlimit-compress to 2000 MiB on MIPS32 because on + MIPS32 userspace processes are limited to 2 GiB of address + space. + + * liblzma: + + - Added lzma_microlzma_encoder() and lzma_microlzma_decoder(). + The API is in lzma/container.h. + + The MicroLZMA format is a raw LZMA stream (without end marker) + whose first byte (always 0x00) has been replaced with + bitwise-negation of the LZMA properties (lc/lp/pb). It was + created for use in EROFS but may be used in other contexts + as well where it is important to avoid wasting bytes for + stream headers or footers. The format is also supported by + XZ Embedded. + + The MicroLZMA encoder API in liblzma can compress into a + fixed-sized output buffer so that as much data is compressed + as can be fit into the buffer while still creating a valid + MicroLZMA stream. This is needed for EROFS. + + - Added fuzzing support. + + - Support Intel Control-flow Enforcement Technology (CET) in + 32-bit x86 assembly files. + + - Visual Studio: Use non-standard _MSVC_LANG to detect C++ + standard version in the lzma.h API header. It's used to + detect when "noexcept" can be used. + + * Scripts: + + - Fix exit status of xzdiff/xzcmp. Exit status could be 2 when + the correct value is 1. + + - Fix exit status of xzgrep. + + - Detect corrupt .bz2 files in xzgrep. + + - Add zstd support to xzgrep and xzdiff/xzcmp. + + - Fix less(1) version detection in xzless. It failed if the + version number from "less -V" contained a dot. + + * Fix typos and technical issues in man pages. + + * Build systems: + + - Windows: Fix building of resource files when config.h isn't + used. CMake + Visual Studio can now build liblzma.dll. + + - Various fixes to the CMake support. It might still need a few + more fixes even for liblzma-only builds. + + +5.3.1alpha (2018-04-29) + + * All fixes from 5.2.4. + + * Add lzma_file_info_decoder() into liblzma and use it in xz to + implement the --list feature. + + * Capsicum sandbox support is enabled by default where available + (FreeBSD >= 10). + + +5.2.13 (2024-05-29) + + * liblzma: + + - lzma_index_append(): Fix an assertion failure that could be + triggered by a large unpadded_size argument. It was verified + that there was no other bug than the assertion failure. + + - lzma_index_decoder() and lzma_index_buffer_decode(): Fix + a missing output pointer initialization (*i = NULL) if the + functions are called with invalid arguments. The API docs + say that such an initialization is always done. In practice + this matters very little because the problem can only occur + if the calling application has a bug and these functions + return LZMA_PROG_ERROR. + + - Fix C standard conformance with function pointer types. + This newly showed up with Clang 17 with -fsanitize=undefined. + There are no bug reports about this. + + - Fix building with NVIDIA HPC SDK. + + - Fix building with Windows Vista threads and --enable-small. + (CMake build doesn't support ENABLE_SMALL in XZ Utils 5.2.x.) + + * xz: + + - Fix a C standard conformance issue in --block-list parsing + (arithmetic on a null pointer). + + - Fix a warning from GNU groff when processing the man page: + "warning: cannot select font 'CW'" + + - Windows: Handle special files such as "con" or "nul". Earlier + the following wrote "foo" to the console and deleted the input + file "con_xz": + + echo foo | xz > con_xz + xz --suffix=_xz --decompress con_xz + + - Windows: Fix an issue that prevented reading from or writing + to non-terminal character devices like NUL. + + * xzless: + + - With "less" version 451 and later, use "||-" instead of "|-" + in the environment variable LESSOPEN. This way compressed + files that contain no uncompressed data are shown correctly + as empty. + + - With "less" version 632 and later, use --show-preproc-errors + to make "less" show a warning on decompression errors. + + * Build systems: + + - Add a new line to liblzma.pc for MSYS2 (Windows): + + Cflags.private: -DLZMA_API_STATIC + + When compiling code that will link against static liblzma, + the LZMA_API_STATIC macro needs to be defined on Windows. + + - Autotools (configure): + + * Symbol versioning variant can now be overridden with + --enable-symbol-versions. Documentation in INSTALL was + updated to match. + + - CMake: + + * Fix a bug that prevented other projects from including + liblzma multiple times using find_package(). + + * Fix a bug where configuring CMake multiple times resulted + in HAVE_CLOCK_GETTIME and HAVE_CLOCK_MONOTONIC not being + defined. + + * Fix the build with MinGW-w64-based Clang/LLVM 17. + llvm-windres now has more accurate GNU windres emulation + so the GNU windres workaround from 5.4.1 is needed with + llvm-windres version 17 too. + + * The import library on Windows is now properly named + "liblzma.dll.a" instead of "libliblzma.dll.a" + + * Add large file support by default for platforms that + need it to handle files larger than 2 GiB. This includes + MinGW-w64, even 64-bit builds. + + * Linux on MicroBlaze is handled specially now. This + matches the changes made to the Autotools-based build + in XZ Utils 5.4.2 and 5.2.11. + + * Disable symbol versioning on non-glibc Linux to match + what the Autotools build does. For example, symbol + versioning isn't enabled with musl. + + * Symbol versioning variant can now be overridden by + setting SYMBOL_VERSIONING to "OFF", "generic", or + "linux". + + * Documentation: + + - Clarify the description of --disable-assembler in INSTALL. + The option only affects 32-bit x86 assembly usage. + + - Don't install the TODO file as part of the documentation. + The file is out of date. + + - Update home page URLs back to their old locations on + tukaani.org. + + - Update maintainer info. + + +5.2.12 (2023-05-04) + + * Fixed a build system bug that prevented building liblzma as a + shared library when configured with --disable-threads. This bug + affected releases 5.2.6 to 5.2.11 and 5.4.0 to 5.4.2. + + * Include for Windows intrinsic functions where they are + needed. This fixed a bug that prevented building liblzma using + clang-cl on Windows. + + * Minor update to the Croatian translation. The small change + applies to a string in both 5.2 and 5.4 branches. + + +5.2.11 (2023-03-18) + + * Removed all possible cases of null pointer + 0. It is undefined + behavior in C99 and C17. This was detected by a sanitizer and had + not caused any known issues. + + * Build systems: + + - Added a workaround for building with GCC on MicroBlaze Linux. + GCC 12 on MicroBlaze doesn't support the __symver__ attribute + even though __has_attribute(__symver__) returns true. The + build is now done without the extra RHEL/CentOS 7 symbols + that were added in XZ Utils 5.2.7. The workaround only + applies to the Autotools build (not CMake). + + - CMake: Ensure that the C compiler language is set to C99 or + a newer standard. + + - CMake changes from XZ Utils 5.4.1: + + * Added a workaround for a build failure with + windres from GNU binutils. + + * Included the Windows resource files in the xz + and xzdec build rules. + + +5.2.10 (2022-12-13) + + * xz: Don't modify argv[] when parsing the --memlimit* and + --block-list command line options. This fixes confusing + arguments in process listing (like "ps auxf"). + + * GNU/Linux only: Use __has_attribute(__symver__) to detect if + that attribute is supported. This fixes build on Mandriva where + Clang is patched to define __GNUC__ to 11 by default (instead + of 4 as used by Clang upstream). + + +5.2.9 (2022-11-30) + + * liblzma: + + - Fixed an infinite loop in LZMA encoder initialization + if dict_size >= 2 GiB. (The encoder only supports up + to 1536 MiB.) + + - Fixed two cases of invalid free() that can happen if + a tiny allocation fails in encoder re-initialization + or in lzma_filters_update(). These bugs had some + similarities with the bug fixed in 5.2.7. + + - Fixed lzma_block_encoder() not allowing the use of + LZMA_SYNC_FLUSH with lzma_code() even though it was + documented to be supported. The sync-flush code in + the Block encoder was already used internally via + lzma_stream_encoder(), so this was just a missing flag + in the lzma_block_encoder() API function. + + - GNU/Linux only: Don't put symbol versions into static + liblzma as it breaks things in some cases (and even if + it didn't break anything, symbol versions in static + libraries are useless anyway). The downside of the fix + is that if the configure options --with-pic or --without-pic + are used then it's not possible to build both shared and + static liblzma at the same time on GNU/Linux anymore; + with those options --disable-static or --disable-shared + must be used too. + + * New email address for bug reports is which + forwards messages to Lasse Collin and Jia Tan. + + +5.2.8 (2022-11-13) + + * xz: + + - If xz cannot remove an input file when it should, this + is now treated as a warning (exit status 2) instead of + an error (exit status 1). This matches GNU gzip and it + is more logical as at that point the output file has + already been successfully closed. + + - Fix handling of .xz files with an unsupported check type. + Previously such printed a warning message but then xz + behaved as if an error had occurred (didn't decompress, + exit status 1). Now a warning is printed, decompression + is done anyway, and exit status is 2. This used to work + slightly before 5.0.0. In practice this bug matters only + if xz has been built with some check types disabled. As + instructed in PACKAGERS, such builds should be done in + special situations only. + + - Fix "xz -dc --single-stream tests/files/good-0-empty.xz" + which failed with "Internal error (bug)". That is, + --single-stream was broken if the first .xz stream in + the input file didn't contain any uncompressed data. + + - Fix displaying file sizes in the progress indicator when + working in passthru mode and there are multiple input files. + Just like "gzip -cdf", "xz -cdf" works like "cat" when the + input file isn't a supported compressed file format. In + this case the file size counters weren't reset between + files so with multiple input files the progress indicator + displayed an incorrect (too large) value. + + * liblzma: + + - API docs in lzma/container.h: + * Update the list of decoder flags in the decoder + function docs. + * Explain LZMA_CONCATENATED behavior with .lzma files + in lzma_auto_decoder() docs. + + - OpenBSD: Use HW_NCPUONLINE to detect the number of + available hardware threads in lzma_physmem(). + + - Fix use of wrong macro to detect x86 SSE2 support. + __SSE2_MATH__ was used with GCC/Clang but the correct + one is __SSE2__. The first one means that SSE2 is used + for floating point math which is irrelevant here. + The affected SSE2 code isn't used on x86-64 so this affects + only 32-bit x86 builds that use -msse2 without -mfpmath=sse + (there is no runtime detection for SSE2). It improves LZMA + compression speed (not decompression). + + - Fix the build with Intel C compiler 2021 (ICC, not ICX) + on Linux. It defines __GNUC__ to 10 but doesn't support + the __symver__ attribute introduced in GCC 10. + + * Scripts: Ignore warnings from xz by using --quiet --no-warn. + This is needed if the input .xz files use an unsupported + check type. + + * Translations: + + - Updated Croatian and Turkish translations. + + - One new translations wasn't included because it needed + technical fixes. It will be in upcoming 5.4.0. No new + translations will be added to the 5.2.x branch anymore. + + - Renamed the French man page translation file from + fr_FR.po to fr.po and thus also its install directory + (like /usr/share/man/fr_FR -> .../fr). + + - Man page translations for upcoming 5.4.0 are now handled + in the Translation Project. + + * Update doc/faq.txt a little so it's less out-of-date. + + +5.2.7 (2022-09-30) + + * liblzma: + + - Made lzma_filters_copy() to never modify the destination + array if an error occurs. lzma_stream_encoder() and + lzma_stream_encoder_mt() already assumed this. Before this + change, if a tiny memory allocation in lzma_filters_copy() + failed it would lead to a crash (invalid free() or invalid + memory reads) in the cleanup paths of these two encoder + initialization functions. + + - Added missing integer overflow check to lzma_index_append(). + This affects xz --list and other applications that decode + the Index field from .xz files using lzma_index_decoder(). + Normal decompression of .xz files doesn't call this code + and thus most applications using liblzma aren't affected + by this bug. + + - Single-threaded .xz decoder (lzma_stream_decoder()): If + lzma_code() returns LZMA_MEMLIMIT_ERROR it is now possible + to use lzma_memlimit_set() to increase the limit and continue + decoding. This was supposed to work from the beginning + but there was a bug. With other decoders (.lzma or + threaded .xz decoder) this already worked correctly. + + - Fixed accumulation of integrity check type statistics in + lzma_index_cat(). This bug made lzma_index_checks() return + only the type of the integrity check of the last Stream + when multiple lzma_indexes were concatenated. Most + applications don't use these APIs but in xz it made + xz --list not list all check types from concatenated .xz + files. In xz --list --verbose only the per-file "Check:" + lines were affected and in xz --robot --list only the "file" + line was affected. + + - Added ABI compatibility with executables that were linked + against liblzma in RHEL/CentOS 7 or other liblzma builds + that had copied the problematic patch from RHEL/CentOS 7 + (xz-5.2.2-compat-libs.patch). For the details, see the + comment at the top of src/liblzma/validate_map.sh. + + WARNING: This uses __symver__ attribute with GCC >= 10. + In other cases the traditional __asm__(".symver ...") + is used. Using link-time optimization (LTO, -flto) with + GCC versions older than 10 can silently result in + broken liblzma.so.5 (incorrect symbol versions)! If you + want to use -flto with GCC, you must use GCC >= 10. + LTO with Clang seems to work even with the traditional + __asm__(".symver ...") method. + + * xzgrep: Fixed compatibility with old shells that break if + comments inside command substitutions have apostrophes ('). + This problem was introduced in 5.2.6. + + * Build systems: + + - New #define in config.h: HAVE_SYMBOL_VERSIONS_LINUX + + - Windows: Fixed liblzma.dll build with Visual Studio project + files. It broke in 5.2.6 due to a change that was made to + improve CMake support. + + - Windows: Building liblzma with UNICODE defined should now + work. + + - CMake files are now actually included in the release tarball. + They should have been in 5.2.5 already. + + - Minor CMake fixes and improvements. + + * Added a new translation: Turkish + + +5.2.6 (2022-08-12) + + * xz: + + - The --keep option now accepts symlinks, hardlinks, and + setuid, setgid, and sticky files. Previously this required + using --force. + + - When copying metadata from the source file to the destination + file, don't try to set the group (GID) if it is already set + correctly. This avoids a failure on OpenBSD (and possibly on + a few other OSes) where files may get created so that their + group doesn't belong to the user, and fchown(2) can fail even + if it needs to do nothing. + + - Cap --memlimit-compress to 2000 MiB instead of 4020 MiB on + MIPS32 because on MIPS32 userspace processes are limited + to 2 GiB of address space. + + * liblzma: + + - Fixed a missing error-check in the threaded encoder. If a + small memory allocation fails, a .xz file with an invalid + Index field would be created. Decompressing such a file would + produce the correct output but result in an error at the end. + Thus this is a "mild" data corruption bug. Note that while + a failed memory allocation can trigger the bug, it cannot + cause invalid memory access. + + - The decoder for .lzma files now supports files that have + uncompressed size stored in the header and still use the + end of payload marker (end of stream marker) at the end + of the LZMA stream. Such files are rare but, according to + the documentation in LZMA SDK, they are valid. + doc/lzma-file-format.txt was updated too. + + - Improved 32-bit x86 assembly files: + * Support Intel Control-flow Enforcement Technology (CET) + * Use non-executable stack on FreeBSD. + + - Visual Studio: Use non-standard _MSVC_LANG to detect C++ + standard version in the lzma.h API header. It's used to + detect when "noexcept" can be used. + + * xzgrep: + + - Fixed arbitrary command injection via a malicious filename + (CVE-2022-1271, ZDI-CAN-16587). A standalone patch for + this was released to the public on 2022-04-07. A slight + robustness improvement has been made since then and, if + using GNU or *BSD grep, a new faster method is now used + that doesn't use the old sed-based construct at all. This + also fixes bad output with GNU grep >= 3.5 (2020-09-27) + when xzgrepping binary files. + + This vulnerability was discovered by: + cleemy desu wayo working with Trend Micro Zero Day Initiative + + - Fixed detection of corrupt .bz2 files. + + - Improved error handling to fix exit status in some situations + and to fix handling of signals: in some situations a signal + didn't make xzgrep exit when it clearly should have. It's + possible that the signal handling still isn't quite perfect + but hopefully it's good enough. + + - Documented exit statuses on the man page. + + - xzegrep and xzfgrep now use "grep -E" and "grep -F" instead + of the deprecated egrep and fgrep commands. + + - Fixed parsing of the options -E, -F, -G, -P, and -X. The + problem occurred when multiple options were specified in + a single argument, for example, + + echo foo | xzgrep -Fe foo + + treated foo as a filename because -Fe wasn't correctly + split into -F -e. + + - Added zstd support. + + * xzdiff/xzcmp: + + - Fixed wrong exit status. Exit status could be 2 when the + correct value is 1. + + - Documented on the man page that exit status of 2 is used + for decompression errors. + + - Added zstd support. + + * xzless: + + - Fix less(1) version detection. It failed if the version number + from "less -V" contained a dot. + + * Translations: + + - Added new translations: Catalan, Croatian, Esperanto, + Korean, Portuguese, Romanian, Serbian, Spanish, Swedish, + and Ukrainian + + - Updated the Brazilian Portuguese translation. + + - Added French man page translation. This and the existing + German translation aren't complete anymore because the + English man pages got a few updates and the translators + weren't reached so that they could update their work. + + * Build systems: + + - Windows: Fix building of resource files when config.h isn't + used. CMake + Visual Studio can now build liblzma.dll. + + - Various fixes to the CMake support. Building static or shared + liblzma should work fine in most cases. In contrast, building + the command line tools with CMake is still clearly incomplete + and experimental and should be used for testing only. + + +5.2.5 (2020-03-17) + + * liblzma: + + - Fixed several C99/C11 conformance bugs. Now the code is clean + under gcc/clang -fsanitize=undefined. Some of these changes + might have a negative effect on performance with old GCC + versions or compilers other than GCC and Clang. The configure + option --enable-unsafe-type-punning can be used to (mostly) + restore the old behavior but it shouldn't normally be used. + + - Improved API documentation of lzma_properties_decode(). + + - Added a very minor encoder speed optimization. + + * xz: + + - Fixed a crash in "xz -dcfv not_an_xz_file". All four options + were required to trigger it. The crash occurred in the + progress indicator code when xz was in passthru mode where + xz works like "cat". + + - Fixed an integer overflow with 32-bit off_t. It could happen + when decompressing a file that has a long run of zero bytes + which xz would try to write as a sparse file. Since the build + system enables large file support by default, off_t is + normally 64-bit even on 32-bit systems. + + - Fixes for --flush-timeout: + * Fix semi-busy-waiting. + * Avoid unneeded flushes when no new input has arrived + since the previous flush was completed. + + - Added a special case for 32-bit xz: If --memlimit-compress is + used to specify a limit that exceeds 4020 MiB, the limit will + be set to 4020 MiB. The values "0" and "max" aren't affected + by this and neither is decompression. This hack can be + helpful when a 32-bit xz has access to 4 GiB address space + but the specified memlimit exceeds 4 GiB. This can happen + e.g. with some scripts. + + - Capsicum sandbox is now enabled by default where available + (FreeBSD >= 10). The sandbox debug messages (xz -vv) were + removed since they seemed to be more annoying than useful. + + - DOS build now requires DJGPP 2.05 instead of 2.04beta. + A workaround for a locale problem with DJGPP 2.05 was added. + + * xzgrep and other scripts: + + - Added a configure option --enable-path-for-scripts=PREFIX. + It is disabled by default except on Solaris where the default + is /usr/xpg4/bin. See INSTALL for details. + + - Added a workaround for a POSIX shell detection problem on + Solaris. + + * Build systems: + + - Added preliminary build instructions for z/OS. See INSTALL + section 1.2.9. + + - Experimental CMake support was added. It should work to build + static liblzma on a few operating systems. It may or may not + work to build shared liblzma. On some platforms it can build + xz and xzdec too but those are only for testing. See the + comment in the beginning of CMakeLists.txt for details. + + - Visual Studio project files were updated. + WindowsTargetPlatformVersion was removed from VS2017 files + and set to "10.0" in the added VS2019 files. In the future + the VS project files will be removed when CMake support is + good enough. + + - New #defines in config.h: HAVE___BUILTIN_ASSUME_ALIGNED, + HAVE___BUILTIN_BSWAPXX, and TUKLIB_USE_UNSAFE_TYPE_PUNNING. + + - autogen.sh has a new optional dependency on po4a and a new + option --no-po4a to skip that step. This matters only if one + wants to remake the build files. po4a is used to update the + translated man pages but as long as the man pages haven't + been modified, there's nothing to update and one can use + --no-po4a to avoid the dependency on po4a. + + * Translations: + + - XZ Utils translations are now handled by the Translation + Project: https://translationproject.org/domain/xz.html + + - All man pages are now included in German too. + + - New xz translations: Brazilian Portuguese, Finnish, + Hungarian, Chinese (simplified), Chinese (traditional), + and Danish (partial translation) + + - Updated xz translations: French, German, Italian, and Polish + + - Unfortunately a few new xz translations weren't included due + to technical problems like too long lines in --help output or + misaligned column headings in tables. In the future, many of + these strings will be split and e.g. the table column + alignment will be handled in software. This should make the + strings easier to translate. + + +5.2.4 (2018-04-29) + + * liblzma: + + - Allow 0 as memory usage limit instead of returning + LZMA_PROG_ERROR. Now 0 is treated as if 1 byte was specified, + which effectively is the same as 0. + + - Use "noexcept" keyword instead of "throw()" in the public + headers when a C++11 (or newer standard) compiler is used. + + - Added a portability fix for recent Intel C Compilers. + + - Microsoft Visual Studio build files have been moved under + windows/vs2013 and windows/vs2017. + + * xz: + + - Fix "xz --list --robot missing_or_bad_file.xz" which would + try to print an uninitialized string and thus produce garbage + output. Since the exit status is non-zero, most uses of such + a command won't try to interpret the garbage output. + + - "xz --list foo.xz" could print "Internal error (bug)" in a + corner case where a specific memory usage limit had been set. + + +5.2.3 (2016-12-30) + + * xz: + + - Always close a file before trying to delete it to avoid + problems on some operating system and file system combinations. + + - Fixed copying of file timestamps on Windows. + + - Added experimental (disabled by default) sandbox support using + Capsicum (FreeBSD >= 10). See --enable-sandbox in INSTALL. + + * C99/C11 conformance fixes to liblzma. The issues affected at least + some builds using link-time optimizations. + + * Fixed bugs in the rarely-used function lzma_index_dup(). + + * Use of external SHA-256 code is now disabled by default. + It can still be enabled by passing --enable-external-sha256 + to configure. The reasons to disable it by default (see INSTALL + for more details): + + - Some OS-specific SHA-256 implementations conflict with + OpenSSL and cause problems in programs that link against both + liblzma and libcrypto. At least FreeBSD 10 and MINIX 3.3.0 + are affected. + + - The internal SHA-256 is faster than the SHA-256 code in + some operating systems. + + * Changed CPU core count detection to use sched_getaffinity() on + GNU/Linux and GNU/kFreeBSD. + + * Fixes to the build-system and xz to make xz buildable even when + encoders, decoders, or threading have been disabled from libilzma + using configure options. These fixes added two new #defines to + config.h: HAVE_ENCODERS and HAVE_DECODERS. + + +5.2.2 (2015-09-29) + + * Fixed bugs in QNX-specific code. + + * Omitted the use of pipe2() even if it is available to avoid + portability issues with some old Linux and glibc combinations. + + * Updated German translation. + + * Added project files to build static and shared liblzma (not the + whole XZ Utils) with Visual Studio 2013 update 2 or later. + + * Documented that threaded decompression hasn't been implemented + yet. A 5.2.0 NEWS entry describing multi-threading support had + incorrectly said "decompression" when it should have said + "compression". + + +5.2.1 (2015-02-26) + + * Fixed a compression-ratio regression in fast mode of LZMA1 and + LZMA2. The bug is present in 5.1.4beta and 5.2.0 releases. + + * Fixed a portability problem in xz that affected at least OpenBSD. + + * Fixed xzdiff to be compatible with FreeBSD's mktemp which differs + from most other mktemp implementations. + + * Changed CPU core count detection to use cpuset_getaffinity() on + FreeBSD. + + +5.2.0 (2014-12-21) + + Since 5.1.4beta: + + * All fixes from 5.0.8 + + * liblzma: Fixed lzma_stream_encoder_mt_memusage() when a preset + was used. + + * xzdiff: If mktemp isn't installed, mkdir will be used as + a fallback to create a temporary directory. Installing mktemp + is still recommended. + + * Updated French, German, Italian, Polish, and Vietnamese + translations. + + Summary of fixes and new features added in the 5.1.x development + releases: + + * liblzma: + + - Added support for multi-threaded compression. See the + lzma_mt structure, lzma_stream_encoder_mt(), and + lzma_stream_encoder_mt_memusage() in , + lzma_get_progress() in , and lzma_cputhreads() + in for details. + + - Made the uses of lzma_allocator const correct. + + - Added lzma_block_uncomp_encode() to create uncompressed + .xz Blocks using LZMA2 uncompressed chunks. + + - Added support for LZMA_IGNORE_CHECK. + + - A few speed optimizations were made. + + - Added support for symbol versioning. It is enabled by default + on GNU/Linux, other GNU-based systems, and FreeBSD. + + - liblzma (not the whole XZ Utils) should now be buildable + with MSVC 2013 update 2 or later using windows/config.h. + + * xz: + + - Fixed a race condition in the signal handling. It was + possible that e.g. the first SIGINT didn't make xz exit + if reading or writing blocked and one had bad luck. The fix + is non-trivial, so as of writing it is unknown if it will be + backported to the v5.0 branch. + + - Multi-threaded compression can be enabled with the + --threads (-T) option. + [Fixed: This originally said "decompression".] + + - New command line options in xz: --single-stream, + --block-size=SIZE, --block-list=SIZES, + --flush-timeout=TIMEOUT, and --ignore-check. + + - xz -lvv now shows the minimum xz version that is required to + decompress the file. Currently it is 5.0.0 for all supported + .xz files except files with empty LZMA2 streams require 5.0.2. + + * xzdiff and xzgrep now support .lzo files if lzop is installed. + The .tzo suffix is also recognized as a shorthand for .tar.lzo. + + +5.1.4beta (2014-09-14) + + * All fixes from 5.0.6 + + * liblzma: Fixed the use of presets in threaded encoder + initialization. + + * xz --block-list and --block-size can now be used together + in single-threaded mode. Previously the combination only + worked in multi-threaded mode. + + * Added support for LZMA_IGNORE_CHECK to liblzma and made it + available in xz as --ignore-check. + + * liblzma speed optimizations: + + - Initialization of a new LZMA1 or LZMA2 encoder has been + optimized. (The speed of reinitializing an already-allocated + encoder isn't affected.) This helps when compressing many + small buffers with lzma_stream_buffer_encode() and other + similar situations where an already-allocated encoder state + isn't reused. This speed-up is visible in xz too if one + compresses many small files one at a time instead running xz + once and giving all files as command-line arguments. + + - Buffer comparisons are now much faster when unaligned access + is allowed (configured with --enable-unaligned-access). This + speeds up encoding significantly. There is arch-specific code + for 32-bit and 64-bit x86 (32-bit needs SSE2 for the best + results and there's no run-time CPU detection for now). + For other archs there is only generic code which probably + isn't as optimal as arch-specific solutions could be. + + - A few speed optimizations were made to the SHA-256 code. + (Note that the builtin SHA-256 code isn't used on all + operating systems.) + + * liblzma can now be built with MSVC 2013 update 2 or later + using windows/config.h. + + * Vietnamese translation was added. + + +5.1.3alpha (2013-10-26) + + * All fixes from 5.0.5 + + * liblzma: + + - Fixed a deadlock in the threaded encoder. + + - Made the uses of lzma_allocator const correct. + + - Added lzma_block_uncomp_encode() to create uncompressed + .xz Blocks using LZMA2 uncompressed chunks. + + - Added support for native threads on Windows and the ability + to detect the number of CPU cores. + + * xz: + + - Fixed a race condition in the signal handling. It was + possible that e.g. the first SIGINT didn't make xz exit + if reading or writing blocked and one had bad luck. The fix + is non-trivial, so as of writing it is unknown if it will be + backported to the v5.0 branch. + + - Made the progress indicator work correctly in threaded mode. + + - Threaded encoder now works together with --block-list=SIZES. + + - Added preliminary support for --flush-timeout=TIMEOUT. + It can be useful for (somewhat) real-time streaming. For + now the decompression side has to be done with something + else than the xz tool due to how xz does buffering, but this + should be fixed. + + +5.1.2alpha (2012-07-04) + + * All fixes from 5.0.3 and 5.0.4 + + * liblzma: + + - Fixed a deadlock and an invalid free() in the threaded encoder. + + - Added support for symbol versioning. It is enabled by default + on GNU/Linux, other GNU-based systems, and FreeBSD. + + - Use SHA-256 implementation from the operating system if one is + available in libc, libmd, or libutil. liblzma won't use e.g. + OpenSSL or libgcrypt to avoid introducing new dependencies. + + - Fixed liblzma.pc for static linking. + + - Fixed a few portability bugs. + + * xz --decompress --single-stream now fixes the input position after + successful decompression. Now the following works: + + echo foo | xz > foo.xz + echo bar | xz >> foo.xz + ( xz -dc --single-stream ; xz -dc --single-stream ) < foo.xz + + Note that it doesn't work if the input is not seekable + or if there is Stream Padding between the concatenated + .xz Streams. + + * xz -lvv now shows the minimum xz version that is required to + decompress the file. Currently it is 5.0.0 for all supported .xz + files except files with empty LZMA2 streams require 5.0.2. + + * Added an *incomplete* implementation of --block-list=SIZES to xz. + It only works correctly in single-threaded mode and when + --block-size isn't used at the same time. --block-list allows + specifying the sizes of Blocks which can be useful e.g. when + creating files for random-access reading. + + +5.1.1alpha (2011-04-12) + + * All fixes from 5.0.2 + + * liblzma fixes that will also be included in 5.0.3: + + - A memory leak was fixed. + + - lzma_stream_buffer_encode() no longer creates an empty .xz + Block if encoding an empty buffer. Such an empty Block with + LZMA2 data would trigger a bug in 5.0.1 and older (see the + first bullet point in 5.0.2 notes). When releasing 5.0.2, + I thought that no encoder creates this kind of files but + I was wrong. + + - Validate function arguments better in a few functions. Most + importantly, specifying an unsupported integrity check to + lzma_stream_buffer_encode() no longer creates a corrupt .xz + file. Probably no application tries to do that, so this + shouldn't be a big problem in practice. + + - Document that lzma_block_buffer_encode(), + lzma_easy_buffer_encode(), lzma_stream_encoder(), and + lzma_stream_buffer_encode() may return LZMA_UNSUPPORTED_CHECK. + + - The return values of the _memusage() functions are now + documented better. + + * Support for multithreaded compression was added using the simplest + method, which splits the input data into blocks and compresses + them independently. Other methods will be added in the future. + The current method has room for improvement, e.g. it is possible + to reduce the memory usage. + + * Added the options --single-stream and --block-size=SIZE to xz. + + * xzdiff and xzgrep now support .lzo files if lzop is installed. + The .tzo suffix is also recognized as a shorthand for .tar.lzo. + + * Support for short 8.3 filenames under DOS was added to xz. It is + experimental and may change before it gets into a stable release. + + +5.0.8 (2014-12-21) + + * Fixed an old bug in xzgrep that affected OpenBSD and probably + a few other operating systems too. + + * Updated French and German translations. + + * Added support for detecting the amount of RAM on AmigaOS/AROS. + + * Minor build system updates. + + +5.0.7 (2014-09-20) + + * Fix regressions introduced in 5.0.6: + + - Fix building with non-GNU make. + + - Fix invalid Libs.private value in liblzma.pc which broke + static linking against liblzma if the linker flags were + taken from pkg-config. + + +5.0.6 (2014-09-14) + + * xzgrep now exits with status 0 if at least one file matched. + + * A few minor portability and build system fixes + + +5.0.5 (2013-06-30) + + * lzmadec and liblzma's lzma_alone_decoder(): Support decompressing + .lzma files that have less common settings in the headers + (dictionary size other than 2^n or 2^n + 2^(n-1), or uncompressed + size greater than 256 GiB). The limitations existed to avoid false + positives when detecting .lzma files. The lc + lp <= 4 limitation + still remains since liblzma's LZMA decoder has that limitation. + + NOTE: xz's .lzma support or liblzma's lzma_auto_decoder() are NOT + affected by this change. They still consider uncommon .lzma headers + as not being in the .lzma format. Changing this would give way too + many false positives. + + * xz: + + - Interaction of preset and custom filter chain options was + made less illogical. This affects only certain less typical + uses cases so few people are expected to notice this change. + + Now when a custom filter chain option (e.g. --lzma2) is + specified, all preset options (-0 ... -9, -e) earlier are on + the command line are completely forgotten. Similarly, when + a preset option is specified, all custom filter chain options + earlier on the command line are completely forgotten. + + Example 1: "xz -9 --lzma2=preset=5 -e" is equivalent to "xz -e" + which is equivalent to "xz -6e". Earlier -e didn't put xz back + into preset mode and thus the example command was equivalent + to "xz --lzma2=preset=5". + + Example 2: "xz -9e --lzma2=preset=5 -7" is equivalent to + "xz -7". Earlier a custom filter chain option didn't make + xz forget the -e option so the example was equivalent to + "xz -7e". + + - Fixes and improvements to error handling. + + - Various fixes to the man page. + + * xzless: Fixed to work with "less" versions 448 and later. + + * xzgrep: Made -h an alias for --no-filename. + + * Include the previously missing debug/translation.bash which can + be useful for translators. + + * Include a build script for Mac OS X. This has been in the Git + repository since 2010 but due to a mistake in Makefile.am the + script hasn't been included in a release tarball before. + + +5.0.4 (2012-06-22) + + * liblzma: + + - Fix lzma_index_init(). It could crash if memory allocation + failed. + + - Fix the possibility of an incorrect LZMA_BUF_ERROR when a BCJ + filter is used and the application only provides exactly as + much output space as is the uncompressed size of the file. + + - Fix a bug in doc/examples_old/xz_pipe_decompress.c. It didn't + check if the last call to lzma_code() really returned + LZMA_STREAM_END, which made the program think that truncated + files are valid. + + - New example programs in doc/examples (old programs are now in + doc/examples_old). These have more comments and more detailed + error handling. + + * Fix "xz -lvv foo.xz". It could crash on some corrupted files. + + * Fix output of "xz --robot -lv" and "xz --robot -lvv" which + incorrectly printed the filename also in the "foo (x/x)" format. + + * Fix exit status of "xzdiff foo.xz bar.xz". + + * Fix exit status of "xzgrep foo binary_file". + + * Fix portability to EBCDIC systems. + + * Fix a configure issue on AIX with the XL C compiler. See INSTALL + for details. + + * Update French, German, Italian, and Polish translations. + + +5.0.3 (2011-05-21) + + * liblzma fixes: + + - A memory leak was fixed. + + - lzma_stream_buffer_encode() no longer creates an empty .xz + Block if encoding an empty buffer. Such an empty Block with + LZMA2 data would trigger a bug in 5.0.1 and older (see the + first bullet point in 5.0.2 notes). When releasing 5.0.2, + I thought that no encoder creates this kind of files but + I was wrong. + + - Validate function arguments better in a few functions. Most + importantly, specifying an unsupported integrity check to + lzma_stream_buffer_encode() no longer creates a corrupt .xz + file. Probably no application tries to do that, so this + shouldn't be a big problem in practice. + + - Document that lzma_block_buffer_encode(), + lzma_easy_buffer_encode(), lzma_stream_encoder(), and + lzma_stream_buffer_encode() may return LZMA_UNSUPPORTED_CHECK. + + - The return values of the _memusage() functions are now + documented better. + + * Fix command name detection in xzgrep. xzegrep and xzfgrep now + correctly use egrep and fgrep instead of grep. + + * French translation was added. + + +5.0.2 (2011-04-01) + + * LZMA2 decompressor now correctly accepts LZMA2 streams with no + uncompressed data. Previously it considered them corrupt. The + bug can affect applications that use raw LZMA2 streams. It is + very unlikely to affect .xz files because no compressor creates + .xz files with empty LZMA2 streams. (Empty .xz files are a + different thing than empty LZMA2 streams.) + + * "xz --suffix=.foo filename.foo" now refuses to compress the + file due to it already having the suffix .foo. It was already + documented on the man page, but the code lacked the test. + + * "xzgrep -l foo bar.xz" works now. + + * Polish translation was added. + + +5.0.1 (2011-01-29) + + * xz --force now (de)compresses files that have setuid, setgid, + or sticky bit set and files that have multiple hard links. + The man page had it documented this way already, but the code + had a bug. + + * gzip and bzip2 support in xzdiff was fixed. + + * Portability fixes + + * Minor fix to Czech translation + + +5.0.0 (2010-10-23) + + Only the most important changes compared to 4.999.9beta are listed + here. One change is especially important: + + * The memory usage limit is now disabled by default. Some scripts + written before this change may have used --memory=max on xz command + line or in XZ_OPT. THESE USES OF --memory=max SHOULD BE REMOVED + NOW, because they interfere with user's ability to set the memory + usage limit himself. If user-specified limit causes problems to + your script, blame the user. + + Other significant changes: + + * Added support for XZ_DEFAULTS environment variable. This variable + allows users to set default options for xz, e.g. default memory + usage limit or default compression level. Scripts that use xz + must never set or unset XZ_DEFAULTS. Scripts should use XZ_OPT + instead if they need a way to pass options to xz via an + environment variable. + + * The compression settings associated with the preset levels + -0 ... -9 have been changed. --extreme was changed a little too. + It is now less likely to make compression worse, but with some + files the new --extreme may compress slightly worse than the old + --extreme. + + * If a preset level (-0 ... -9) is specified after a custom filter + chain options have been used (e.g. --lzma2), the custom filter + chain will be forgotten. Earlier the preset options were + completely ignored after custom filter chain options had been + seen. + + * xz will create sparse files when decompressing if the uncompressed + data contains long sequences of binary zeros. This is done even + when writing to standard output that is connected to a regular + file and certain additional conditions are met to make it safe. + + * Support for "xz --list" was added. Combine with --verbose or + --verbose --verbose (-vv) for detailed output. + + * I had hoped that liblzma API would have been stable after + 4.999.9beta, but there have been a couple of changes in the + advanced features, which don't affect most applications: + + - Index handling code was revised. If you were using the old + API, you will get a compiler error (so it's easy to notice). + + - A subtle but important change was made to the Block handling + API. lzma_block.version has to be initialized even for + lzma_block_header_decode(). Code that doesn't do it will work + for now, but might break in the future, which makes this API + change easy to miss. + + * The major soname has been bumped to 5.0.0. liblzma API and ABI + are now stable, so the need to recompile programs linking against + liblzma shouldn't arise soon. + diff --git a/miniconda3/share/doc/xz/README b/miniconda3/share/doc/xz/README new file mode 100644 index 0000000000000000000000000000000000000000..41671676a516e32c56c75c38c487f262dde4fa59 --- /dev/null +++ b/miniconda3/share/doc/xz/README @@ -0,0 +1,281 @@ + +XZ Utils +======== + + 0. Overview + 1. Documentation + 1.1. Overall documentation + 1.2. Documentation for command-line tools + 1.3. Documentation for liblzma + 2. Version numbering + 3. Reporting bugs + 4. Translations + 4.1. Testing translations + 5. Other implementations of the .xz format + 6. Contact information + + +0. Overview +----------- + + XZ Utils provide a general-purpose data-compression library plus + command-line tools. The native file format is the .xz format, but + also the legacy .lzma format is supported. The .xz format supports + multiple compression algorithms, which are called "filters" in the + context of XZ Utils. The primary filter is currently LZMA2. With + typical files, XZ Utils create about 30 % smaller files than gzip. + + To ease adapting support for the .xz format into existing applications + and scripts, the API of liblzma is somewhat similar to the API of the + popular zlib library. For the same reason, the command-line tool xz + has a command-line syntax similar to that of gzip. + + When aiming for the highest compression ratio, the LZMA2 encoder uses + a lot of CPU time and may use, depending on the settings, even + hundreds of megabytes of RAM. However, in fast modes, the LZMA2 encoder + competes with bzip2 in compression speed, RAM usage, and compression + ratio. + + LZMA2 is reasonably fast to decompress. It is a little slower than + gzip, but a lot faster than bzip2. Being fast to decompress means + that the .xz format is especially nice when the same file will be + decompressed very many times (usually on different computers), which + is the case e.g. when distributing software packages. In such + situations, it's not too bad if the compression takes some time, + since that needs to be done only once to benefit many people. + + With some file types, combining (or "chaining") LZMA2 with an + additional filter can improve the compression ratio. A filter chain may + contain up to four filters, although usually only one or two are used. + For example, putting a BCJ (Branch/Call/Jump) filter before LZMA2 + in the filter chain can improve compression ratio of executable files. + + Since the .xz format allows adding new filter IDs, it is possible that + some day there will be a filter that is, for example, much faster to + compress than LZMA2 (but probably with worse compression ratio). + Similarly, it is possible that some day there is a filter that will + compress better than LZMA2. + + XZ Utils supports multithreaded compression. XZ Utils doesn't support + multithreaded decompression yet. It has been planned though and taken + into account when designing the .xz file format. In the future, files + that were created in threaded mode can be decompressed in threaded + mode too. + + +1. Documentation +---------------- + +1.1. Overall documentation + + README This file + + INSTALL.generic Generic install instructions for those not + familiar with packages using GNU Autotools + INSTALL Installation instructions specific to XZ Utils + PACKAGERS Information to packagers of XZ Utils + + COPYING XZ Utils copyright and license information + COPYING.0BSD BSD Zero Clause License + COPYING.GPLv2 GNU General Public License version 2 + COPYING.GPLv3 GNU General Public License version 3 + COPYING.LGPLv2.1 GNU Lesser General Public License version 2.1 + + AUTHORS The main authors of XZ Utils + THANKS Incomplete list of people who have helped making + this software + NEWS User-visible changes between XZ Utils releases + ChangeLog Detailed list of changes (commit log) + TODO Known bugs and some sort of to-do list + + Note that only some of the above files are included in binary + packages. + + +1.2. Documentation for command-line tools + + The command-line tools are documented as man pages. In source code + releases (and possibly also in some binary packages), the man pages + are also provided in plain text (ASCII only) format in the directory + "doc/man" to make the man pages more accessible to those whose + operating system doesn't provide an easy way to view man pages. + + +1.3. Documentation for liblzma + + The liblzma API headers include short docs about each function + and data type as Doxygen tags. These docs should be quite OK as + a quick reference. + + There are a few example/tutorial programs that should help in + getting started with liblzma. In the source package the examples + are in "doc/examples" and in binary packages they may be under + "examples" in the same directory as this README. + + Since the liblzma API has similarities to the zlib API, some people + may find it useful to read the zlib docs and tutorial too: + + https://zlib.net/manual.html + https://zlib.net/zlib_how.html + + +2. Version numbering +-------------------- + + The version number format of XZ Utils is X.Y.ZS: + + - X is the major version. When this is incremented, the library + API and ABI break. + + - Y is the minor version. It is incremented when new features + are added without breaking the existing API or ABI. An even Y + indicates a stable release and an odd Y indicates unstable + (alpha or beta version). + + - Z is the revision. This has a different meaning for stable and + unstable releases: + + * Stable: Z is incremented when bugs get fixed without adding + any new features. This is intended to be convenient for + downstream distributors that want bug fixes but don't want + any new features to minimize the risk of introducing new bugs. + + * Unstable: Z is just a counter. API or ABI of features added + in earlier unstable releases having the same X.Y may break. + + - S indicates stability of the release. It is missing from the + stable releases, where Y is an even number. When Y is odd, S + is either "alpha" or "beta" to make it very clear that such + versions are not stable releases. The same X.Y.Z combination is + not used for more than one stability level, i.e. after X.Y.Zalpha, + the next version can be X.Y.(Z+1)beta but not X.Y.Zbeta. + + +3. Reporting bugs +----------------- + + Naturally it is easiest for me if you already know what causes the + unexpected behavior. Even better if you have a patch to propose. + However, quite often the reason for unexpected behavior is unknown, + so here are a few things to do before sending a bug report: + + 1. Try to create a small example how to reproduce the issue. + + 2. Compile XZ Utils with debugging code using configure switches + --enable-debug and, if possible, --disable-shared. If you are + using GCC, use CFLAGS='-O0 -ggdb3'. Don't strip the resulting + binaries. + + 3. Turn on core dumps. The exact command depends on your shell; + for example in GNU bash it is done with "ulimit -c unlimited", + and in tcsh with "limit coredumpsize unlimited". + + 4. Try to reproduce the suspected bug. If you get "assertion failed" + message, be sure to include the complete message in your bug + report. If the application leaves a coredump, get a backtrace + using gdb: + $ gdb /path/to/app-binary # Load the app to the debugger. + (gdb) core core # Open the coredump. + (gdb) bt # Print the backtrace. Copy & paste to bug report. + (gdb) quit # Quit gdb. + + Report your bug via email or IRC (see Contact information below). + Don't send core dump files or any executables. If you have a small + example file(s) (total size less than 256 KiB), please include + it/them as an attachment. If you have bigger test files, put them + online somewhere and include a URL to the file(s) in the bug report. + + Always include the exact version number of XZ Utils in the bug report. + If you are using a snapshot from the git repository, use "git describe" + to get the exact snapshot version. If you are using XZ Utils shipped + in an operating system distribution, mention the distribution name, + distribution version, and exact xz package version; if you cannot + repeat the bug with the code compiled from unpatched source code, + you probably need to report a bug to your distribution's bug tracking + system. + + +4. Translations +--------------- + + The xz command line tool and all man pages can be translated. + The translations are handled via the Translation Project. If you + wish to help translating xz, please join the Translation Project: + + https://translationproject.org/html/translators.html + + Updates to translations won't be accepted by methods that bypass + the Translation Project because there is a risk of duplicate work: + translation updates made in the xz repository aren't seen by the + translators in the Translation Project. If you have found bugs in + a translation, please report them to the Language-Team address + which can be found near the beginning of the PO file. + + If you find language problems in the original English strings, + feel free to suggest improvements. Ask if something is unclear. + + +4.1. Testing translations + + Testing can be done by installing xz into a temporary directory. + + If building from Git repository (not tarball), generate the + Autotools files: + + ./autogen.sh + + Create a subdirectory for the build files. The tmp-build directory + can be deleted after testing. + + mkdir tmp-build + cd tmp-build + ../configure --disable-shared --enable-debug --prefix=$PWD/inst + + Edit the .po file in the po directory. Then build and install to + the "tmp-build/inst" directory, and use translations.bash to see + how some of the messages look. Repeat these steps if needed: + + make -C po update-po + make -j"$(nproc)" install + bash ../debug/translation.bash | less + bash ../debug/translation.bash | less -S # For --list outputs + + To test other languages, set the LANGUAGE environment variable + before running translations.bash. The value should match the PO file + name without the .po suffix. Example: + + export LANGUAGE=fi + + +5. Other implementations of the .xz format +------------------------------------------ + + 7-Zip and the p7zip port of 7-Zip support the .xz format starting + from the version 9.00alpha. + + https://7-zip.org/ + https://p7zip.sourceforge.net/ + + XZ Embedded is a limited implementation written for use in the Linux + kernel, but it is also suitable for other embedded use. + + https://tukaani.org/xz/embedded.html + + XZ for Java is a complete implementation written in pure Java. + + https://tukaani.org/xz/java.html + + +6. Contact information +---------------------- + + XZ Utils in general: + - Home page: https://tukaani.org/xz/ + - Email to maintainer(s): xz@tukaani.org + - IRC: #tukaani on Libera Chat + - GitHub: https://github.com/tukaani-project/xz + + Lead maintainer: + - Email: Lasse Collin + - IRC: Larhzu on Libera Chat + diff --git a/miniconda3/share/doc/xz/THANKS b/miniconda3/share/doc/xz/THANKS new file mode 100644 index 0000000000000000000000000000000000000000..e1c21ebfe5d22a6683f30bef678c3414012de49f --- /dev/null +++ b/miniconda3/share/doc/xz/THANKS @@ -0,0 +1,257 @@ + +Thanks +====== + +Some people have helped more, some less, but nevertheless everyone's help +has been important. :-) + - Adam Borowski + - Adam Walling + - Adrien Nader + - Agostino Sarubbo + - Alexander Bluhm + - Alexander M. Greenham + - Alexander Neumann + - Alexandre Sauvé + - Alexey Tourbin + - Anders F. Björklund + - Andraž 'ruskie' Levstik + - Andre Noll + - Andreas K. Hüttel + - Andreas Müller + - Andreas Schwab + - Andreas Zieringer + - Andrej Skenderija + - Andres Freund + - Andrew Dudman + - Andrew Murray + - Antoine Cœur + - Anton Kochkov + - Antonio Diaz Diaz + - Arkadiusz Miskiewicz + - Asgeir Storesund Nilsen + - Aziz Chaudhry + - Bela Lubkin + - Ben Boeckel + - Benjamin Buch + - Benno Schulenberg + - Bernhard Reutner-Fischer + - Bert Wesarg + - Bhargava Shastry + - Bill Glessner + - Bjarni Ingi Gislason + - Boud Roukema + - Brad Smith + - Bruce Stark + - Cary Lewis + - Charles Wilson + - Chenxi Mao + - Chien Wong + - Chris Donawa + - Chris McCrohan + - Christian Hesse + - Christian Kujau + - Christian von Roques + - Christian Weisgerber + - Christoph Junghans + - Collin Funk + - Conley Moorhous + - Cristian Rodríguez + - Cristiano Ceglia + - Dan Shechter + - Dan Stromberg + - Dan Weiss + - Daniel Leonard + - Daniel Mealha Cabrita + - Daniel Packard + - Daniel Richard G. + - David Burklund + - Denis Excoffier + - Derwin McGeary + - Dexter Castor Döpping + - Diederik de Haas + - Diego Elio Pettenò + - Dimitri Papadopoulos Orfanos + - Dirk Müller + - Douglas Thor + - Ed Maste + - Elbert Pol + - Eli Schwartz + - Elijah Almeida Coimbra + - Émilie Labbé + - Emmanuel Blot + - Eric Lindblad + - Eric S. Raymond + - Étienne Mollier + - Evan Nemerson + - Fangrui Song + - Felix Collin + - Filip Palian + - Firas Khalil Khana + - François Etcheverry + - Frank Busse + - Frank Prochnow + - Fredrik Wikstrom + - Gabi Davar + - Gabriela Gutierrez + - Gilles Espinasse + - Gregory Margo + - Guillaume Outters + - Guiorgy Potskhishvili + - H. Peter Anvin + - Hajin Jang + - Hans Jansen + - Harri K. Koskinen + - Hin-Tak Leung + - H.J. Lu + - Hongbo Ni + - Igor Pavlov + - İhsan Doğan + - Ilya Kurdyukov + - Iouri Kharon + - İsmail Dönmez + - Ivan A. Melnikov + - Jakub Bogusz + - James Buren + - James M Leddy + - Jan Kratochvil + - Jan Terje Hansen + - Jason Gorski + - Jeff Bastian + - Jeffrey Walton + - Jeroen Roovers + - Jim Meyering + - Jim Wilcoxson + - Joachim Henke + - John Paul Adrian Glaubitz + - Jonathan Nieder + - Jonathan Stott + - Joona Kannisto + - Jouk Jansen + - Juan Manuel Guerrero + - Jukka Salmi + - Julien Marrec + - Jun I Jin + - Kai Pastor + - Karl Beldan + - Karl Berry + - Keith Patton + - Kelvin Lee + - Kevin R. Bulgrien + - Kian-Meng Ang + - Kim Jinyeong + - Kirill A. Korinsky + - Kiyoshi Kanazawa + - Lars Wirzenius + - Li Chenggang + - Lizandro Heredia + - Loganaden Velvindron + - Lorenzo De Liso + - Lukas Braune + - Maarten Bosmans + - Maksym Vatsyk + - Marcin Kowalczyk + - Marcus Comstedt + - Marcus Tillmanns + - Marek Černocký + - Mark Adler + - Mark Wielaard + - Markus Duft + - Markus Rickert + - Martin Blumenstingl + - Martin Matuška + - Martin Storsjö + - Martin Väth + - Mathieu Vachon + - Matthew Good + - Matthieu Rakotojaona + - Melanie Blower + - Michael Felt + - Michael Fox + - Michał Górny + - Mike Frysinger + - Mikko Pouru + - Milo Casagrande + - Mohammed Adnène Trojette + - Nathan Moinvaziri + - Nelson H. F. Beebe + - Nicholas Jackson + - Ole André Vadla Ravnås + - Orange Tsai + - Orgad Shaneh + - Patrick J. Volkerding + - Paul Eggert + - Paul Townsend + - Pavel Raiskup + - Per Øyvind Karlsen + - Peter Ivanov + - Peter Lawler + - Peter O'Gorman + - Peter Pallinger + - Peter Seiderer + - Pierre-Yves Martin + - Pilorz Wojciech + - Pippijn van Steenhoven + - Rafał Mużyło + - Rainer Müller + - Ralf Wildenhues + - Rich Prohaska + - Richard Koch + - Richard W.M. Jones + - Robert Elz + - Robert Readman + - Roel Bouckaert + - Ron Desmond + - Ruarí Ødegaard + - Rui Paulo + - Ryan Colyer + - Ryan Young + - Sam James + - Scott McAllister + - Sean Fenian + - Sebastian Andrzej Siewior + - Sergey Kosukhin + - Simon Josefsson + - Siteshwar Vashisht + - Steffen Nurpmeso + - Stephan Kulow + - Stephen Sachs + - Stuart Shelton + - Taiki Tsunekawa + - Thomas Klausner + - Tobias Lahrmann Hansen + - Tobias Stoeckmann + - Tomasz Gajc + - Tomer Chachamu + - Torsten Rupp + - Trần Ngọc Quân + - Trent W. Buck + - Victoria Alexia + - Vijay Sarvepalli + - Ville Koskinen + - Ville Skyttä + - Vincent Cruz + - Vincent Fazio + - Vincent Lefevre + - Vincent Torri + - Vincent Wixsom + - Vincenzo Innocente + - Vitaly Chikunov + - Wim Lewis + - Xi Ruoyao + - Xin Li + - Yifeng Li + - 榆柳松 (ZhengSen Wang) + +Companies: + - Google + - Sandfly Security + +Other credits: + - cleemy desu wayo working with Trend Micro Zero Day Initiative + - Orange Tsai and splitline from DEVCORE Research Team + +Also thanks to all the people who have participated in the Tukaani project. + +I have probably forgot to add some names to the above list. Sorry about +that and thanks for your help. + diff --git a/miniconda3/share/doc/xz/examples/00_README.txt b/miniconda3/share/doc/xz/examples/00_README.txt new file mode 100644 index 0000000000000000000000000000000000000000..120e1eb7e7c507a8293a060767d60fcfac3babde --- /dev/null +++ b/miniconda3/share/doc/xz/examples/00_README.txt @@ -0,0 +1,31 @@ + +liblzma example programs +======================== + +Introduction + + The examples are written so that the same comments aren't + repeated (much) in later files. + + On POSIX systems, the examples should build by just typing "make". + + The examples that use stdin or stdout don't set stdin and stdout + to binary mode. On systems where it matters (e.g. Windows) it is + possible that the examples won't work without modification. + + +List of examples + + 01_compress_easy.c Multi-call compression using + a compression preset + + 02_decompress.c Multi-call decompression + + 03_compress_custom.c Like 01_compress_easy.c but using + a custom filter chain + (x86 BCJ + LZMA2) + + 04_compress_easy_mt.c Multi-threaded multi-call + compression using a compression + preset + diff --git a/miniconda3/share/doc/xz/examples/01_compress_easy.c b/miniconda3/share/doc/xz/examples/01_compress_easy.c new file mode 100644 index 0000000000000000000000000000000000000000..31bcf928508afd0e63699114cf1fb2e944e7e1d8 --- /dev/null +++ b/miniconda3/share/doc/xz/examples/01_compress_easy.c @@ -0,0 +1,296 @@ +// SPDX-License-Identifier: 0BSD + +/////////////////////////////////////////////////////////////////////////////// +// +/// \file 01_compress_easy.c +/// \brief Compress from stdin to stdout in multi-call mode +/// +/// Usage: ./01_compress_easy PRESET < INFILE > OUTFILE +/// +/// Example: ./01_compress_easy 6 < foo > foo.xz +// +// Author: Lasse Collin +// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include + + +static void +show_usage_and_exit(const char *argv0) +{ + fprintf(stderr, "Usage: %s PRESET < INFILE > OUTFILE\n" + "PRESET is a number 0-9 and can optionally be " + "followed by 'e' to indicate extreme preset\n", + argv0); + exit(EXIT_FAILURE); +} + + +static uint32_t +get_preset(int argc, char **argv) +{ + // One argument whose first char must be 0-9. + if (argc != 2 || argv[1][0] < '0' || argv[1][0] > '9') + show_usage_and_exit(argv[0]); + + // Calculate the preste level 0-9. + uint32_t preset = argv[1][0] - '0'; + + // If there is a second char, it must be 'e'. It will set + // the LZMA_PRESET_EXTREME flag. + if (argv[1][1] != '\0') { + if (argv[1][1] != 'e' || argv[1][2] != '\0') + show_usage_and_exit(argv[0]); + + preset |= LZMA_PRESET_EXTREME; + } + + return preset; +} + + +static bool +init_encoder(lzma_stream *strm, uint32_t preset) +{ + // Initialize the encoder using a preset. Set the integrity to check + // to CRC64, which is the default in the xz command line tool. If + // the .xz file needs to be decompressed with XZ Embedded, use + // LZMA_CHECK_CRC32 instead. + lzma_ret ret = lzma_easy_encoder(strm, preset, LZMA_CHECK_CRC64); + + // Return successfully if the initialization went fine. + if (ret == LZMA_OK) + return true; + + // Something went wrong. The possible errors are documented in + // lzma/container.h (src/liblzma/api/lzma/container.h in the source + // package or e.g. /usr/include/lzma/container.h depending on the + // install prefix). + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_OPTIONS_ERROR: + msg = "Specified preset is not supported"; + break; + + case LZMA_UNSUPPORTED_CHECK: + msg = "Specified integrity check is not supported"; + break; + + default: + // This is most likely LZMA_PROG_ERROR indicating a bug in + // this program or in liblzma. It is inconvenient to have a + // separate error message for errors that should be impossible + // to occur, but knowing the error code is important for + // debugging. That's why it is good to print the error code + // at least when there is no good error message to show. + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Error initializing the encoder: %s (error code %u)\n", + msg, ret); + return false; +} + + +static bool +compress(lzma_stream *strm, FILE *infile, FILE *outfile) +{ + // This will be LZMA_RUN until the end of the input file is reached. + // This tells lzma_code() when there will be no more input. + lzma_action action = LZMA_RUN; + + // Buffers to temporarily hold uncompressed input + // and compressed output. + uint8_t inbuf[BUFSIZ]; + uint8_t outbuf[BUFSIZ]; + + // Initialize the input and output pointers. Initializing next_in + // and avail_in isn't really necessary when we are going to encode + // just one file since LZMA_STREAM_INIT takes care of initializing + // those already. But it doesn't hurt much and it will be needed + // if encoding more than one file like we will in 02_decompress.c. + // + // While we don't care about strm->total_in or strm->total_out in this + // example, it is worth noting that initializing the encoder will + // always reset total_in and total_out to zero. But the encoder + // initialization doesn't touch next_in, avail_in, next_out, or + // avail_out. + strm->next_in = NULL; + strm->avail_in = 0; + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + + // Loop until the file has been successfully compressed or until + // an error occurs. + while (true) { + // Fill the input buffer if it is empty. + if (strm->avail_in == 0 && !feof(infile)) { + strm->next_in = inbuf; + strm->avail_in = fread(inbuf, 1, sizeof(inbuf), + infile); + + if (ferror(infile)) { + fprintf(stderr, "Read error: %s\n", + strerror(errno)); + return false; + } + + // Once the end of the input file has been reached, + // we need to tell lzma_code() that no more input + // will be coming and that it should finish the + // encoding. + if (feof(infile)) + action = LZMA_FINISH; + } + + // Tell liblzma do the actual encoding. + // + // This reads up to strm->avail_in bytes of input starting + // from strm->next_in. avail_in will be decremented and + // next_in incremented by an equal amount to match the + // number of input bytes consumed. + // + // Up to strm->avail_out bytes of compressed output will be + // written starting from strm->next_out. avail_out and next_out + // will be incremented by an equal amount to match the number + // of output bytes written. + // + // The encoder has to do internal buffering, which means that + // it may take quite a bit of input before the same data is + // available in compressed form in the output buffer. + lzma_ret ret = lzma_code(strm, action); + + // If the output buffer is full or if the compression finished + // successfully, write the data from the output buffer to + // the output file. + if (strm->avail_out == 0 || ret == LZMA_STREAM_END) { + // When lzma_code() has returned LZMA_STREAM_END, + // the output buffer is likely to be only partially + // full. Calculate how much new data there is to + // be written to the output file. + size_t write_size = sizeof(outbuf) - strm->avail_out; + + if (fwrite(outbuf, 1, write_size, outfile) + != write_size) { + fprintf(stderr, "Write error: %s\n", + strerror(errno)); + return false; + } + + // Reset next_out and avail_out. + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + } + + // Normally the return value of lzma_code() will be LZMA_OK + // until everything has been encoded. + if (ret != LZMA_OK) { + // Once everything has been encoded successfully, the + // return value of lzma_code() will be LZMA_STREAM_END. + // + // It is important to check for LZMA_STREAM_END. Do not + // assume that getting ret != LZMA_OK would mean that + // everything has gone well. + if (ret == LZMA_STREAM_END) + return true; + + // It's not LZMA_OK nor LZMA_STREAM_END, + // so it must be an error code. See lzma/base.h + // (src/liblzma/api/lzma/base.h in the source package + // or e.g. /usr/include/lzma/base.h depending on the + // install prefix) for the list and documentation of + // possible values. Most values listen in lzma_ret + // enumeration aren't possible in this example. + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_DATA_ERROR: + // This error is returned if the compressed + // or uncompressed size get near 8 EiB + // (2^63 bytes) because that's where the .xz + // file format size limits currently are. + // That is, the possibility of this error + // is mostly theoretical unless you are doing + // something very unusual. + // + // Note that strm->total_in and strm->total_out + // have nothing to do with this error. Changing + // those variables won't increase or decrease + // the chance of getting this error. + msg = "File size limits exceeded"; + break; + + default: + // This is most likely LZMA_PROG_ERROR, but + // if this program is buggy (or liblzma has + // a bug), it may be e.g. LZMA_BUF_ERROR or + // LZMA_OPTIONS_ERROR too. + // + // It is inconvenient to have a separate + // error message for errors that should be + // impossible to occur, but knowing the error + // code is important for debugging. That's why + // it is good to print the error code at least + // when there is no good error message to show. + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Encoder error: %s (error code %u)\n", + msg, ret); + return false; + } + } +} + + +extern int +main(int argc, char **argv) +{ + // Get the preset number from the command line. + uint32_t preset = get_preset(argc, argv); + + // Initialize a lzma_stream structure. When it is allocated on stack, + // it is simplest to use LZMA_STREAM_INIT macro like below. When it + // is allocated on heap, using memset(strmptr, 0, sizeof(*strmptr)) + // works (as long as NULL pointers are represented with zero bits + // as they are on practically all computers today). + lzma_stream strm = LZMA_STREAM_INIT; + + // Initialize the encoder. If it succeeds, compress from + // stdin to stdout. + bool success = init_encoder(&strm, preset); + if (success) + success = compress(&strm, stdin, stdout); + + // Free the memory allocated for the encoder. If we were encoding + // multiple files, this would only need to be done after the last + // file. See 02_decompress.c for handling of multiple files. + // + // It is OK to call lzma_end() multiple times or when it hasn't been + // actually used except initialized with LZMA_STREAM_INIT. + lzma_end(&strm); + + // Close stdout to catch possible write errors that can occur + // when pending data is flushed from the stdio buffers. + if (fclose(stdout)) { + fprintf(stderr, "Write error: %s\n", strerror(errno)); + success = false; + } + + return success ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/miniconda3/share/doc/xz/examples/02_decompress.c b/miniconda3/share/doc/xz/examples/02_decompress.c new file mode 100644 index 0000000000000000000000000000000000000000..a87a5d3ece2ed6edbc6e01e77b6e48a112867e47 --- /dev/null +++ b/miniconda3/share/doc/xz/examples/02_decompress.c @@ -0,0 +1,286 @@ +// SPDX-License-Identifier: 0BSD + +/////////////////////////////////////////////////////////////////////////////// +// +/// \file 02_decompress.c +/// \brief Decompress .xz files to stdout +/// +/// Usage: ./02_decompress INPUT_FILES... > OUTFILE +/// +/// Example: ./02_decompress foo.xz bar.xz > foobar +// +// Author: Lasse Collin +// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include + + +static bool +init_decoder(lzma_stream *strm) +{ + // Initialize a .xz decoder. The decoder supports a memory usage limit + // and a set of flags. + // + // The memory usage of the decompressor depends on the settings used + // to compress a .xz file. It can vary from less than a megabyte to + // a few gigabytes, but in practice (at least for now) it rarely + // exceeds 65 MiB because that's how much memory is required to + // decompress files created with "xz -9". Settings requiring more + // memory take extra effort to use and don't (at least for now) + // provide significantly better compression in most cases. + // + // Memory usage limit is useful if it is important that the + // decompressor won't consume gigabytes of memory. The need + // for limiting depends on the application. In this example, + // no memory usage limiting is used. This is done by setting + // the limit to UINT64_MAX. + // + // The .xz format allows concatenating compressed files as is: + // + // echo foo | xz > foobar.xz + // echo bar | xz >> foobar.xz + // + // When decompressing normal standalone .xz files, LZMA_CONCATENATED + // should always be used to support decompression of concatenated + // .xz files. If LZMA_CONCATENATED isn't used, the decoder will stop + // after the first .xz stream. This can be useful when .xz data has + // been embedded inside another file format. + // + // Flags other than LZMA_CONCATENATED are supported too, and can + // be combined with bitwise-or. See lzma/container.h + // (src/liblzma/api/lzma/container.h in the source package or e.g. + // /usr/include/lzma/container.h depending on the install prefix) + // for details. + lzma_ret ret = lzma_stream_decoder( + strm, UINT64_MAX, LZMA_CONCATENATED); + + // Return successfully if the initialization went fine. + if (ret == LZMA_OK) + return true; + + // Something went wrong. The possible errors are documented in + // lzma/container.h (src/liblzma/api/lzma/container.h in the source + // package or e.g. /usr/include/lzma/container.h depending on the + // install prefix). + // + // Note that LZMA_MEMLIMIT_ERROR is never possible here. If you + // specify a very tiny limit, the error will be delayed until + // the first headers have been parsed by a call to lzma_code(). + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_OPTIONS_ERROR: + msg = "Unsupported decompressor flags"; + break; + + default: + // This is most likely LZMA_PROG_ERROR indicating a bug in + // this program or in liblzma. It is inconvenient to have a + // separate error message for errors that should be impossible + // to occur, but knowing the error code is important for + // debugging. That's why it is good to print the error code + // at least when there is no good error message to show. + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Error initializing the decoder: %s (error code %u)\n", + msg, ret); + return false; +} + + +static bool +decompress(lzma_stream *strm, const char *inname, FILE *infile, FILE *outfile) +{ + // When LZMA_CONCATENATED flag was used when initializing the decoder, + // we need to tell lzma_code() when there will be no more input. + // This is done by setting action to LZMA_FINISH instead of LZMA_RUN + // in the same way as it is done when encoding. + // + // When LZMA_CONCATENATED isn't used, there is no need to use + // LZMA_FINISH to tell when all the input has been read, but it + // is still OK to use it if you want. When LZMA_CONCATENATED isn't + // used, the decoder will stop after the first .xz stream. In that + // case some unused data may be left in strm->next_in. + lzma_action action = LZMA_RUN; + + uint8_t inbuf[BUFSIZ]; + uint8_t outbuf[BUFSIZ]; + + strm->next_in = NULL; + strm->avail_in = 0; + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + + while (true) { + if (strm->avail_in == 0 && !feof(infile)) { + strm->next_in = inbuf; + strm->avail_in = fread(inbuf, 1, sizeof(inbuf), + infile); + + if (ferror(infile)) { + fprintf(stderr, "%s: Read error: %s\n", + inname, strerror(errno)); + return false; + } + + // Once the end of the input file has been reached, + // we need to tell lzma_code() that no more input + // will be coming. As said before, this isn't required + // if the LZMA_CONCATENATED flag isn't used when + // initializing the decoder. + if (feof(infile)) + action = LZMA_FINISH; + } + + lzma_ret ret = lzma_code(strm, action); + + if (strm->avail_out == 0 || ret == LZMA_STREAM_END) { + size_t write_size = sizeof(outbuf) - strm->avail_out; + + if (fwrite(outbuf, 1, write_size, outfile) + != write_size) { + fprintf(stderr, "Write error: %s\n", + strerror(errno)); + return false; + } + + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + } + + if (ret != LZMA_OK) { + // Once everything has been decoded successfully, the + // return value of lzma_code() will be LZMA_STREAM_END. + // + // It is important to check for LZMA_STREAM_END. Do not + // assume that getting ret != LZMA_OK would mean that + // everything has gone well or that when you aren't + // getting more output it must have successfully + // decoded everything. + if (ret == LZMA_STREAM_END) + return true; + + // It's not LZMA_OK nor LZMA_STREAM_END, + // so it must be an error code. See lzma/base.h + // (src/liblzma/api/lzma/base.h in the source package + // or e.g. /usr/include/lzma/base.h depending on the + // install prefix) for the list and documentation of + // possible values. Many values listen in lzma_ret + // enumeration aren't possible in this example, but + // can be made possible by enabling memory usage limit + // or adding flags to the decoder initialization. + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_FORMAT_ERROR: + // .xz magic bytes weren't found. + msg = "The input is not in the .xz format"; + break; + + case LZMA_OPTIONS_ERROR: + // For example, the headers specify a filter + // that isn't supported by this liblzma + // version (or it hasn't been enabled when + // building liblzma, but no-one sane does + // that unless building liblzma for an + // embedded system). Upgrading to a newer + // liblzma might help. + // + // Note that it is unlikely that the file has + // accidentally became corrupt if you get this + // error. The integrity of the .xz headers is + // always verified with a CRC32, so + // unintentionally corrupt files can be + // distinguished from unsupported files. + msg = "Unsupported compression options"; + break; + + case LZMA_DATA_ERROR: + msg = "Compressed file is corrupt"; + break; + + case LZMA_BUF_ERROR: + // Typically this error means that a valid + // file has got truncated, but it might also + // be a damaged part in the file that makes + // the decoder think the file is truncated. + // If you prefer, you can use the same error + // message for this as for LZMA_DATA_ERROR. + msg = "Compressed file is truncated or " + "otherwise corrupt"; + break; + + default: + // This is most likely LZMA_PROG_ERROR. + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "%s: Decoder error: " + "%s (error code %u)\n", + inname, msg, ret); + return false; + } + } +} + + +extern int +main(int argc, char **argv) +{ + if (argc <= 1) { + fprintf(stderr, "Usage: %s FILES...\n", argv[0]); + return EXIT_FAILURE; + } + + lzma_stream strm = LZMA_STREAM_INIT; + + bool success = true; + + // Try to decompress all files. + for (int i = 1; i < argc; ++i) { + if (!init_decoder(&strm)) { + // Decoder initialization failed. There's no point + // to retry it so we need to exit. + success = false; + break; + } + + FILE *infile = fopen(argv[i], "rb"); + + if (infile == NULL) { + fprintf(stderr, "%s: Error opening the " + "input file: %s\n", + argv[i], strerror(errno)); + success = false; + } else { + success &= decompress(&strm, argv[i], infile, stdout); + fclose(infile); + } + } + + // Free the memory allocated for the decoder. This only needs to be + // done after the last file. + lzma_end(&strm); + + if (fclose(stdout)) { + fprintf(stderr, "Write error: %s\n", strerror(errno)); + success = false; + } + + return success ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/miniconda3/share/doc/xz/examples/03_compress_custom.c b/miniconda3/share/doc/xz/examples/03_compress_custom.c new file mode 100644 index 0000000000000000000000000000000000000000..80ad189a5e3eab826eb17b4e97ba11b1035bbb53 --- /dev/null +++ b/miniconda3/share/doc/xz/examples/03_compress_custom.c @@ -0,0 +1,192 @@ +// SPDX-License-Identifier: 0BSD + +/////////////////////////////////////////////////////////////////////////////// +// +/// \file 03_compress_custom.c +/// \brief Compress in multi-call mode using x86 BCJ and LZMA2 +/// +/// Usage: ./03_compress_custom < INFILE > OUTFILE +/// +/// Example: ./03_compress_custom < foo > foo.xz +// +// Author: Lasse Collin +// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include + + +static bool +init_encoder(lzma_stream *strm) +{ + // Use the default preset (6) for LZMA2. + // + // The lzma_options_lzma structure and the lzma_lzma_preset() function + // are declared in lzma/lzma12.h (src/liblzma/api/lzma/lzma12.h in the + // source package or e.g. /usr/include/lzma/lzma12.h depending on + // the install prefix). + lzma_options_lzma opt_lzma2; + if (lzma_lzma_preset(&opt_lzma2, LZMA_PRESET_DEFAULT)) { + // It should never fail because the default preset + // (and presets 0-9 optionally with LZMA_PRESET_EXTREME) + // are supported by all stable liblzma versions. + // + // (The encoder initialization later in this function may + // still fail due to unsupported preset *if* the features + // required by the preset have been disabled at build time, + // but no-one does such things except on embedded systems.) + fprintf(stderr, "Unsupported preset, possibly a bug\n"); + return false; + } + + // Now we could customize the LZMA2 options if we wanted. For example, + // we could set the dictionary size (opt_lzma2.dict_size) to + // something else than the default (8 MiB) of the default preset. + // See lzma/lzma12.h for details of all LZMA2 options. + // + // The x86 BCJ filter will try to modify the x86 instruction stream so + // that LZMA2 can compress it better. The x86 BCJ filter doesn't need + // any options so it will be set to NULL below. + // + // Construct the filter chain. The uncompressed data goes first to + // the first filter in the array, in this case the x86 BCJ filter. + // The array is always terminated by setting .id = LZMA_VLI_UNKNOWN. + // + // See lzma/filter.h for more information about the lzma_filter + // structure. + lzma_filter filters[] = { + { .id = LZMA_FILTER_X86, .options = NULL }, + { .id = LZMA_FILTER_LZMA2, .options = &opt_lzma2 }, + { .id = LZMA_VLI_UNKNOWN, .options = NULL }, + }; + + // Initialize the encoder using the custom filter chain. + lzma_ret ret = lzma_stream_encoder(strm, filters, LZMA_CHECK_CRC64); + + if (ret == LZMA_OK) + return true; + + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_OPTIONS_ERROR: + // We are no longer using a plain preset so this error + // message has been edited accordingly compared to + // 01_compress_easy.c. + msg = "Specified filter chain is not supported"; + break; + + case LZMA_UNSUPPORTED_CHECK: + msg = "Specified integrity check is not supported"; + break; + + default: + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Error initializing the encoder: %s (error code %u)\n", + msg, ret); + return false; +} + + +// This function is identical to the one in 01_compress_easy.c. +static bool +compress(lzma_stream *strm, FILE *infile, FILE *outfile) +{ + lzma_action action = LZMA_RUN; + + uint8_t inbuf[BUFSIZ]; + uint8_t outbuf[BUFSIZ]; + + strm->next_in = NULL; + strm->avail_in = 0; + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + + while (true) { + if (strm->avail_in == 0 && !feof(infile)) { + strm->next_in = inbuf; + strm->avail_in = fread(inbuf, 1, sizeof(inbuf), + infile); + + if (ferror(infile)) { + fprintf(stderr, "Read error: %s\n", + strerror(errno)); + return false; + } + + if (feof(infile)) + action = LZMA_FINISH; + } + + lzma_ret ret = lzma_code(strm, action); + + if (strm->avail_out == 0 || ret == LZMA_STREAM_END) { + size_t write_size = sizeof(outbuf) - strm->avail_out; + + if (fwrite(outbuf, 1, write_size, outfile) + != write_size) { + fprintf(stderr, "Write error: %s\n", + strerror(errno)); + return false; + } + + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + } + + if (ret != LZMA_OK) { + if (ret == LZMA_STREAM_END) + return true; + + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_DATA_ERROR: + msg = "File size limits exceeded"; + break; + + default: + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Encoder error: %s (error code %u)\n", + msg, ret); + return false; + } + } +} + + +extern int +main(void) +{ + lzma_stream strm = LZMA_STREAM_INIT; + + bool success = init_encoder(&strm); + if (success) + success = compress(&strm, stdin, stdout); + + lzma_end(&strm); + + if (fclose(stdout)) { + fprintf(stderr, "Write error: %s\n", strerror(errno)); + success = false; + } + + return success ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/miniconda3/share/doc/xz/examples/04_compress_easy_mt.c b/miniconda3/share/doc/xz/examples/04_compress_easy_mt.c new file mode 100644 index 0000000000000000000000000000000000000000..c721a6618ae0f13cf63541d59b0a31824fb9e55d --- /dev/null +++ b/miniconda3/share/doc/xz/examples/04_compress_easy_mt.c @@ -0,0 +1,205 @@ +// SPDX-License-Identifier: 0BSD + +/////////////////////////////////////////////////////////////////////////////// +// +/// \file 04_compress_easy_mt.c +/// \brief Compress in multi-call mode using LZMA2 in multi-threaded mode +/// +/// Usage: ./04_compress_easy_mt < INFILE > OUTFILE +/// +/// Example: ./04_compress_easy_mt < foo > foo.xz +// +// Author: Lasse Collin +// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include + + +static bool +init_encoder(lzma_stream *strm) +{ + // The threaded encoder takes the options as pointer to + // a lzma_mt structure. + lzma_mt mt = { + // No flags are needed. + .flags = 0, + + // Let liblzma determine a sane block size. + .block_size = 0, + + // Use no timeout for lzma_code() calls by setting timeout + // to zero. That is, sometimes lzma_code() might block for + // a long time (from several seconds to even minutes). + // If this is not OK, for example due to progress indicator + // needing updates, specify a timeout in milliseconds here. + // See the documentation of lzma_mt in lzma/container.h for + // information how to choose a reasonable timeout. + .timeout = 0, + + // Use the default preset (6) for LZMA2. + // To use a preset, filters must be set to NULL. + .preset = LZMA_PRESET_DEFAULT, + .filters = NULL, + + // Use CRC64 for integrity checking. See also + // 01_compress_easy.c about choosing the integrity check. + .check = LZMA_CHECK_CRC64, + }; + + // Detect how many threads the CPU supports. + mt.threads = lzma_cputhreads(); + + // If the number of CPU cores/threads cannot be detected, + // use one thread. Note that this isn't the same as the normal + // single-threaded mode as this will still split the data into + // blocks and use more RAM than the normal single-threaded mode. + // You may want to consider using lzma_easy_encoder() or + // lzma_stream_encoder() instead of lzma_stream_encoder_mt() if + // lzma_cputhreads() returns 0 or 1. + if (mt.threads == 0) + mt.threads = 1; + + // If the number of CPU cores/threads exceeds threads_max, + // limit the number of threads to keep memory usage lower. + // The number 8 is arbitrarily chosen and may be too low or + // high depending on the compression preset and the computer + // being used. + // + // FIXME: A better way could be to check the amount of RAM + // (or available RAM) and use lzma_stream_encoder_mt_memusage() + // to determine if the number of threads should be reduced. + const uint32_t threads_max = 8; + if (mt.threads > threads_max) + mt.threads = threads_max; + + // Initialize the threaded encoder. + lzma_ret ret = lzma_stream_encoder_mt(strm, &mt); + + if (ret == LZMA_OK) + return true; + + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_OPTIONS_ERROR: + // We are no longer using a plain preset so this error + // message has been edited accordingly compared to + // 01_compress_easy.c. + msg = "Specified filter chain is not supported"; + break; + + case LZMA_UNSUPPORTED_CHECK: + msg = "Specified integrity check is not supported"; + break; + + default: + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Error initializing the encoder: %s (error code %u)\n", + msg, ret); + return false; +} + + +// This function is identical to the one in 01_compress_easy.c. +static bool +compress(lzma_stream *strm, FILE *infile, FILE *outfile) +{ + lzma_action action = LZMA_RUN; + + uint8_t inbuf[BUFSIZ]; + uint8_t outbuf[BUFSIZ]; + + strm->next_in = NULL; + strm->avail_in = 0; + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + + while (true) { + if (strm->avail_in == 0 && !feof(infile)) { + strm->next_in = inbuf; + strm->avail_in = fread(inbuf, 1, sizeof(inbuf), + infile); + + if (ferror(infile)) { + fprintf(stderr, "Read error: %s\n", + strerror(errno)); + return false; + } + + if (feof(infile)) + action = LZMA_FINISH; + } + + lzma_ret ret = lzma_code(strm, action); + + if (strm->avail_out == 0 || ret == LZMA_STREAM_END) { + size_t write_size = sizeof(outbuf) - strm->avail_out; + + if (fwrite(outbuf, 1, write_size, outfile) + != write_size) { + fprintf(stderr, "Write error: %s\n", + strerror(errno)); + return false; + } + + strm->next_out = outbuf; + strm->avail_out = sizeof(outbuf); + } + + if (ret != LZMA_OK) { + if (ret == LZMA_STREAM_END) + return true; + + const char *msg; + switch (ret) { + case LZMA_MEM_ERROR: + msg = "Memory allocation failed"; + break; + + case LZMA_DATA_ERROR: + msg = "File size limits exceeded"; + break; + + default: + msg = "Unknown error, possibly a bug"; + break; + } + + fprintf(stderr, "Encoder error: %s (error code %u)\n", + msg, ret); + return false; + } + } +} + + +extern int +main(void) +{ + lzma_stream strm = LZMA_STREAM_INIT; + + bool success = init_encoder(&strm); + if (success) + success = compress(&strm, stdin, stdout); + + lzma_end(&strm); + + if (fclose(stdout)) { + fprintf(stderr, "Write error: %s\n", strerror(errno)); + success = false; + } + + return success ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/miniconda3/share/doc/xz/examples/11_file_info.c b/miniconda3/share/doc/xz/examples/11_file_info.c new file mode 100644 index 0000000000000000000000000000000000000000..caadd98072fbf0ced7e27869a6f32dd90b45d71f --- /dev/null +++ b/miniconda3/share/doc/xz/examples/11_file_info.c @@ -0,0 +1,205 @@ +// SPDX-License-Identifier: 0BSD + +/////////////////////////////////////////////////////////////////////////////// +// +/// \file 11_file_info.c +/// \brief Get uncompressed size of .xz file(s) +/// +/// Usage: ./11_file_info INFILE1.xz [INFILEn.xz]... +/// +/// Example: ./11_file_info foo.xz +// +// Author: Lasse Collin +// +/////////////////////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include +#include + + +static bool +print_file_size(lzma_stream *strm, FILE *infile, const char *filename) +{ + // Get the file size. In standard C it can be done by seeking to + // the end of the file and then getting the file position. + // In POSIX one can use fstat() and then st_size from struct stat. + // Also note that fseek() and ftell() use long and thus don't support + // large files on 32-bit systems (POSIX versions fseeko() and + // ftello() can support large files). + if (fseek(infile, 0, SEEK_END)) { + fprintf(stderr, "Error seeking the file '%s': %s\n", + filename, strerror(errno)); + return false; + } + + const long file_size = ftell(infile); + + // The decoder wants to start from the beginning of the .xz file. + rewind(infile); + + // Initialize the decoder. + lzma_index *i; + lzma_ret ret = lzma_file_info_decoder(strm, &i, UINT64_MAX, + (uint64_t)file_size); + switch (ret) { + case LZMA_OK: + // Initialization succeeded. + break; + + case LZMA_MEM_ERROR: + fprintf(stderr, "Out of memory when initializing " + "the .xz file info decoder\n"); + return false; + + case LZMA_PROG_ERROR: + default: + fprintf(stderr, "Unknown error, possibly a bug\n"); + return false; + } + + // This example program reuses the same lzma_stream structure + // for multiple files, so we need to reset this when starting + // a new file. + strm->avail_in = 0; + + // Buffer for input data. + uint8_t inbuf[BUFSIZ]; + + // Pass data to the decoder and seek when needed. + while (true) { + if (strm->avail_in == 0) { + strm->next_in = inbuf; + strm->avail_in = fread(inbuf, 1, sizeof(inbuf), + infile); + + if (ferror(infile)) { + fprintf(stderr, + "Error reading from '%s': %s\n", + filename, strerror(errno)); + return false; + } + + // We don't need to care about hitting the end of + // the file so no need to check for feof(). + } + + ret = lzma_code(strm, LZMA_RUN); + + switch (ret) { + case LZMA_OK: + break; + + case LZMA_SEEK_NEEDED: + // The cast is safe because liblzma won't ask us to + // seek past the known size of the input file which + // did fit into a long. + // + // NOTE: Remember to change these to off_t if you + // switch fseeko() or lseek(). + if (fseek(infile, (long)(strm->seek_pos), SEEK_SET)) { + fprintf(stderr, "Error seeking the " + "file '%s': %s\n", + filename, strerror(errno)); + return false; + } + + // The old data in the inbuf is useless now. Set + // avail_in to zero so that we will read new input + // from the new file position on the next iteration + // of this loop. + strm->avail_in = 0; + break; + + case LZMA_STREAM_END: + // File information was successfully decoded. + // See for functions that can be + // used on it. In this example we just print + // the uncompressed size (in bytes) of + // the .xz file followed by its file name. + printf("%10" PRIu64 " %s\n", + lzma_index_uncompressed_size(i), + filename); + + // Free the memory of the lzma_index structure. + lzma_index_end(i, NULL); + + return true; + + case LZMA_FORMAT_ERROR: + // .xz magic bytes weren't found. + fprintf(stderr, "The file '%s' is not " + "in the .xz format\n", filename); + return false; + + case LZMA_OPTIONS_ERROR: + fprintf(stderr, "The file '%s' has .xz headers that " + "are not supported by this liblzma " + "version\n", filename); + return false; + + case LZMA_DATA_ERROR: + fprintf(stderr, "The file '%s' is corrupt\n", + filename); + return false; + + case LZMA_MEM_ERROR: + fprintf(stderr, "Memory allocation failed when " + "decoding the file '%s'\n", filename); + return false; + + // LZMA_MEMLIMIT_ERROR shouldn't happen because we used + // UINT64_MAX as the limit. + // + // LZMA_BUF_ERROR shouldn't happen because we always provide + // new input when the input buffer is empty. The decoder + // knows the input file size and thus won't try to read past + // the end of the file. + case LZMA_MEMLIMIT_ERROR: + case LZMA_BUF_ERROR: + case LZMA_PROG_ERROR: + default: + fprintf(stderr, "Unknown error, possibly a bug\n"); + return false; + } + } + + // This line is never reached. +} + + +extern int +main(int argc, char **argv) +{ + bool success = true; + lzma_stream strm = LZMA_STREAM_INIT; + + for (int i = 1; i < argc; ++i) { + FILE *infile = fopen(argv[i], "rb"); + + if (infile == NULL) { + fprintf(stderr, "Cannot open the file '%s': %s\n", + argv[i], strerror(errno)); + success = false; + } + + success &= print_file_size(&strm, infile, argv[i]); + + (void)fclose(infile); + } + + lzma_end(&strm); + + // Close stdout to catch possible write errors that can occur + // when pending data is flushed from the stdio buffers. + if (fclose(stdout)) { + fprintf(stderr, "Write error: %s\n", strerror(errno)); + success = false; + } + + return success ? EXIT_SUCCESS : EXIT_FAILURE; +} diff --git a/miniconda3/share/doc/xz/examples/Makefile b/miniconda3/share/doc/xz/examples/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..f5b98788ece821f1727ec3644c30f7115bd9148f --- /dev/null +++ b/miniconda3/share/doc/xz/examples/Makefile @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: 0BSD +# Author: Lasse Collin + +CC = c99 +CFLAGS = -g +LDFLAGS = -llzma + +PROGS = \ + 01_compress_easy \ + 02_decompress \ + 03_compress_custom \ + 04_compress_easy_mt \ + 11_file_info + +all: $(PROGS) + +.c: + $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) + +clean: + -rm -f $(PROGS) diff --git a/miniconda3/share/doc/xz/faq.txt b/miniconda3/share/doc/xz/faq.txt new file mode 100644 index 0000000000000000000000000000000000000000..3f9068b4b278040489220702772738604209df03 --- /dev/null +++ b/miniconda3/share/doc/xz/faq.txt @@ -0,0 +1,244 @@ + +XZ Utils FAQ +============ + +Q: What do the letters XZ mean? + +A: Nothing. They are just two letters, which come from the file format + suffix .xz. The .xz suffix was selected, because it seemed to be + pretty much unused. It has no deeper meaning. + + +Q: What are LZMA and LZMA2? + +A: LZMA stands for Lempel-Ziv-Markov chain-Algorithm. It is the name + of the compression algorithm designed by Igor Pavlov for 7-Zip. + LZMA is based on LZ77 and range encoding. + + LZMA2 is an updated version of the original LZMA to fix a couple of + practical issues. In context of XZ Utils, LZMA is called LZMA1 to + emphasize that LZMA is not the same thing as LZMA2. LZMA2 is the + primary compression algorithm in the .xz file format. + + +Q: There are many LZMA related projects. How does XZ Utils relate to them? + +A: 7-Zip and LZMA SDK are the original projects. LZMA SDK is roughly + a subset of the 7-Zip source tree. + + p7zip is 7-Zip's command-line tools ported to POSIX-like systems. + + LZMA Utils provide a gzip-like lzma tool for POSIX-like systems. + LZMA Utils are based on LZMA SDK. XZ Utils are the successor to + LZMA Utils. + + There are several other projects using LZMA. Most are more or less + based on LZMA SDK. See . + + +Q: Why is liblzma named liblzma if its primary file format is .xz? + Shouldn't it be e.g. libxz? + +A: When the designing of the .xz format began, the idea was to replace + the .lzma format and use the same .lzma suffix. It would have been + quite OK to reuse the suffix when there were very few .lzma files + around. However, the old .lzma format became popular before the + new format was finished. The new format was renamed to .xz but the + name of liblzma wasn't changed. + + +Q: Do XZ Utils support the .7z format? + +A: No. Use 7-Zip (Windows) or p7zip (POSIX-like systems) to handle .7z + files. + + +Q: I have many .tar.7z files. Can I convert them to .tar.xz without + spending hours recompressing the data? + +A: In the "extra" directory, there is a script named 7z2lzma.bash which + is able to convert some .7z files to the .lzma format (not .xz). It + needs the 7za (or 7z) command from p7zip. The script may silently + produce corrupt output if certain assumptions are not met, so + decompress the resulting .lzma file and compare it against the + original before deleting the original file! + + +Q: I have many .lzma files. Can I quickly convert them to the .xz format? + +A: For now, no. Since XZ Utils supports the .lzma format, it's usually + not too bad to keep the old files in the old format. If you want to + do the conversion anyway, you need to decompress the .lzma files and + then recompress to the .xz format. + + Technically, there is a way to make the conversion relatively fast + (roughly twice the time that normal decompression takes). Writing + such a tool would take quite a bit of time though, and would probably + be useful to only a few people. If you really want such a conversion + tool, contact Lasse Collin and offer some money. + + +Q: I have installed xz, but my tar doesn't recognize .tar.xz files. + How can I extract .tar.xz files? + +A: xz -dc foo.tar.xz | tar xf - + + +Q: Can I recover parts of a broken .xz file (e.g. a corrupted CD-R)? + +A: It may be possible if the file consists of multiple blocks, which + typically is not the case if the file was created in single-threaded + mode. There is no recovery program yet. + + +Q: Is (some part of) XZ Utils patented? + +A: Lasse Collin is not aware of any patents that could affect XZ Utils. + However, due to the nature of software patents, it's not possible to + guarantee that XZ Utils isn't affected by any third party patent(s). + + +Q: Where can I find documentation about the file format and algorithms? + +A: The .xz format is documented in xz-file-format.txt. It is a container + format only, and doesn't include descriptions of any non-trivial + filters. + + Documenting LZMA and LZMA2 is planned, but for now, there is no other + documentation than the source code. Before you begin, you should know + the basics of LZ77 and range-coding algorithms. LZMA is based on LZ77, + but LZMA is a lot more complex. Range coding is used to compress + the final bitstream like Huffman coding is used in Deflate. + + +Q: I cannot find BCJ and BCJ2 filters. Don't they exist in liblzma? + +A: BCJ filter is called "x86" in liblzma. BCJ2 is not included, + because it requires using more than one encoded output stream. + + +Q: I need to use a script that runs "xz -9". On a system with 256 MiB + of RAM, xz says that it cannot allocate memory. Can I make the + script work without modifying it? + +A: Set a default memory usage limit for compression. You can do it e.g. + in a shell initialization script such as ~/.bashrc or /etc/profile: + + XZ_DEFAULTS=--memlimit-compress=150MiB + export XZ_DEFAULTS + + xz will then scale the compression settings down so that the given + memory usage limit is not reached. This way xz shouldn't run out + of memory. + + Check also that memory-related resource limits are high enough. + On most systems, "ulimit -a" will show the current resource limits. + + +Q: How do I create files that can be decompressed with XZ Embedded? + +A: See the documentation in XZ Embedded. In short, something like + this is a good start: + + xz --check=crc32 --lzma2=preset=6e,dict=64KiB + + Or if a BCJ filter is needed too, e.g. if compressing + a kernel image for PowerPC: + + xz --check=crc32 --powerpc --lzma2=preset=6e,dict=64KiB + + Adjust the dictionary size to get a good compromise between + compression ratio and decompressor memory usage. Note that + in single-call decompression mode of XZ Embedded, a big + dictionary doesn't increase memory usage. + + +Q: How is multi-threaded compression implemented in XZ Utils? + +A: The simplest method is splitting the uncompressed data into blocks + and compressing them in parallel independent from each other. + This is currently the only threading method supported in XZ Utils. + Since the blocks are compressed independently, they can also be + decompressed independently. Together with the index feature in .xz, + this allows using threads to create .xz files for random-access + reading. This also makes threaded decompression possible. + + The independent blocks method has a couple of disadvantages too. It + will compress worse than a single-block method. Often the difference + is not too big (maybe 1-2 %) but sometimes it can be too big. Also, + the memory usage of the compressor increases linearly when adding + threads. + + At least two other threading methods are possible but these haven't + been implemented in XZ Utils: + + Match finder parallelization has been in 7-Zip for ages. It doesn't + affect compression ratio or memory usage significantly. Among the + three threading methods, only this is useful when compressing small + files (files that are not significantly bigger than the dictionary). + Unfortunately this method scales only to about two CPU cores. + + The third method is pigz-style threading (I use that name, because + pigz uses that method). It doesn't + affect compression ratio significantly and scales to many cores. + The memory usage scales linearly when threads are added. This isn't + significant with pigz, because Deflate uses only a 32 KiB dictionary, + but with LZMA2 the memory usage will increase dramatically just like + with the independent-blocks method. There is also a constant + computational overhead, which may make pigz-method a bit dull on + dual-core compared to the parallel match finder method, but with more + cores the overhead is not a big deal anymore. + + Combining the threading methods will be possible and also useful. + For example, combining match finder parallelization with pigz-style + threading or independent-blocks-threading can cut the memory usage + by 50 %. + + +Q: I told xz to use many threads but it is using only one or two + processor cores. What is wrong? + +A: Since multi-threaded compression is done by splitting the data into + blocks that are compressed individually, if the input file is too + small for the block size, then many threads cannot be used. The + default block size increases when the compression level is + increased. For example, xz -6 uses 8 MiB LZMA2 dictionary and + 24 MiB blocks, and xz -9 uses 64 MiB LZMA dictionary and 192 MiB + blocks. If the input file is 100 MiB, xz -6 can use five threads + of which one will finish quickly as it has only 4 MiB to compress. + However, for the same file, xz -9 can only use one thread. + + One can adjust block size with --block-size=SIZE but making the + block size smaller than LZMA2 dictionary is waste of RAM: using + xz -9 with 6 MiB blocks isn't any better than using xz -6 with + 6 MiB blocks. The default settings use a block size bigger than + the LZMA2 dictionary size because this was seen as a reasonable + compromise between RAM usage and compression ratio. + + When decompressing, the ability to use threads depends on how the + file was created. If it was created in multi-threaded mode then + it can be decompressed in multi-threaded mode too if there are + multiple blocks in the file. + + +Q: How do I build a program that needs liblzmadec (lzmadec.h)? + +A: liblzmadec is part of LZMA Utils. XZ Utils has liblzma, but no + liblzmadec. The code using liblzmadec should be ported to use + liblzma instead. If you cannot or don't want to do that, download + LZMA Utils from . + + +Q: The default build of liblzma is too big. How can I make it smaller? + +A: Give --enable-small to the configure script. Use also appropriate + --enable or --disable options to include only those filter encoders + and decoders and integrity checks that you actually need. Use + CFLAGS=-Os (with GCC) or equivalent to tell your compiler to optimize + for size. See INSTALL for information about configure options. + + If the result is still too big, take a look at XZ Embedded. It is + a separate project, which provides a limited but significantly + smaller XZ decoder implementation than XZ Utils. You can find it + at . + diff --git a/miniconda3/share/doc/xz/history.txt b/miniconda3/share/doc/xz/history.txt new file mode 100644 index 0000000000000000000000000000000000000000..8545e232254ed5d64bab1aa9f713cc3a24cf3abe --- /dev/null +++ b/miniconda3/share/doc/xz/history.txt @@ -0,0 +1,150 @@ + +History of LZMA Utils and XZ Utils +================================== + +Tukaani distribution + + In 2005, there was a small group working on the Tukaani distribution, + which was a Slackware fork. One of the project's goals was to fit the + distro on a single 700 MiB ISO-9660 image. Using LZMA instead of gzip + helped a lot. Roughly speaking, one could fit data that took 1000 MiB + in gzipped form into 700 MiB with LZMA. Naturally, the compression + ratio varied across packages, but this was what we got on average. + + Slackware packages have traditionally had .tgz as the filename suffix, + which is an abbreviation of .tar.gz. A logical naming for LZMA + compressed packages was .tlz, being an abbreviation of .tar.lzma. + + At the end of the year 2007, there was no distribution under the + Tukaani project anymore, but development of LZMA Utils was kept going. + Still, there were .tlz packages around, because at least Vector Linux + (a Slackware based distribution) used LZMA for its packages. + + First versions of the modified pkgtools used the LZMA_Alone tool from + Igor Pavlov's LZMA SDK as is. It was fine, because users wouldn't need + to interact with LZMA_Alone directly. But people soon wanted to use + LZMA for other files too, and the interface of LZMA_Alone wasn't + comfortable for those used to gzip and bzip2. + + +First steps of LZMA Utils + + The first version of LZMA Utils (4.22.0) included a shell script called + lzmash. It was a wrapper that had a gzip-like command-line interface. It + used the LZMA_Alone tool from LZMA SDK to do all the real work. zgrep, + zdiff, and related scripts from gzip were adapted to work with LZMA and + were part of the first LZMA Utils release too. + + LZMA Utils 4.22.0 included also lzmadec, which was a small (less than + 10 KiB) decoder-only command-line tool. It was written on top of the + decoder-only C code found from the LZMA SDK. lzmadec was convenient in + situations where LZMA_Alone (a few hundred KiB) would be too big. + + lzmash and lzmadec were written by Lasse Collin. + + +Second generation + + The lzmash script was an ugly and not very secure hack. The last + version of LZMA Utils to use lzmash was 4.27.1. + + LZMA Utils 4.32.0beta1 introduced a new lzma command-line tool written + by Ville Koskinen. It was written in C++, and used the encoder and + decoder from C++ LZMA SDK with some little modifications. This tool + replaced both the lzmash script and the LZMA_Alone command-line tool + in LZMA Utils. + + Introducing this new tool caused some temporary incompatibilities, + because the LZMA_Alone executable was simply named lzma like the new + command-line tool, but they had a completely different command-line + interface. The file format was still the same. + + Lasse wrote liblzmadec, which was a small decoder-only library based + on the C code found from LZMA SDK. liblzmadec had an API similar to + zlib, although there were some significant differences, which made it + non-trivial to use it in some applications designed for zlib and + libbzip2. + + The lzmadec command-line tool was converted to use liblzmadec. + + Alexandre Sauvé helped converting the build system to use GNU + Autotools. This made it easier to test for certain less portable + features needed by the new command-line tool. + + Since the new command-line tool never got completely finished (for + example, it didn't support the LZMA_OPT environment variable), the + intent was to not call 4.32.x stable. Similarly, liblzmadec wasn't + polished, but appeared to work well enough, so some people started + using it too. + + Because the development of the third generation of LZMA Utils was + delayed considerably (3-4 years), the 4.32.x branch had to be kept + maintained. It got some bug fixes now and then, and finally it was + decided to call it stable, although most of the missing features were + never added. + + +File format problems + + The file format used by LZMA_Alone was primitive. It was designed with + embedded systems in mind, and thus provided only a minimal set of + features. The two biggest problems for non-embedded use were the lack + of magic bytes and an integrity check. + + Igor and Lasse started developing a new file format with some help + from Ville Koskinen. Also Mark Adler, Mikko Pouru, H. Peter Anvin, + and Lars Wirzenius helped with some minor things at some point of the + development. Designing the new format took quite a long time (actually, + too long a time would be a more appropriate expression). It was mostly + because Lasse was quite slow at getting things done due to personal + reasons. + + Originally the new format was supposed to use the same .lzma suffix + that was already used by the old file format. Switching to the new + format wouldn't have caused much trouble when the old format wasn't + used by many people. But since the development of the new format took + such a long time, the old format got quite popular, and it was decided + that the new file format must use a different suffix. + + It was decided to use .xz as the suffix of the new file format. The + first stable .xz file format specification was finally released in + December 2008. In addition to fixing the most obvious problems of + the old .lzma format, the .xz format added some new features like + support for multiple filters (compression algorithms), filter chaining + (like piping on the command line), and limited random-access reading. + + Currently the primary compression algorithm used in .xz is LZMA2. + It is an extension on top of the original LZMA to fix some practical + problems: LZMA2 adds support for flushing the encoder, uncompressed + chunks, eases stateful decoder implementations, and improves support + for multithreading. Since LZMA2 is better than the original LZMA, the + original LZMA is not supported in .xz. + + +Transition to XZ Utils + + The early versions of XZ Utils were called LZMA Utils. The first + releases were 4.42.0alphas. They dropped the rest of the C++ LZMA SDK. + The code was still directly based on LZMA SDK but ported to C and + converted from a callback API to a stateful API. Later, Igor Pavlov + made a C version of the LZMA encoder too; these ports from C++ to C + were independent in LZMA SDK and LZMA Utils. + + The core of the new LZMA Utils was liblzma, a compression library with + a zlib-like API. liblzma supported both the old and new file format. + The gzip-like lzma command-line tool was rewritten to use liblzma. + + The new LZMA Utils code base was renamed to XZ Utils when the name + of the new file format had been decided. The liblzma compression + library retained its name though, because changing it would have + caused unnecessary breakage in applications already using the early + liblzma snapshots. + + The xz command-line tool can emulate the gzip-like lzma tool by + creating appropriate symlinks (e.g. lzma -> xz). Thus, practically + all scripts using the lzma tool from LZMA Utils will work as is with + XZ Utils (and will keep using the old .lzma format). Still, the .lzma + format is more or less deprecated. XZ Utils will keep supporting it, + but new applications should use the .xz format, and migrating old + applications to .xz is often a good idea too. + diff --git a/miniconda3/share/doc/xz/lzma-file-format.txt b/miniconda3/share/doc/xz/lzma-file-format.txt new file mode 100644 index 0000000000000000000000000000000000000000..8cce5dcce749121b0855010e6e5576d545ba6a68 --- /dev/null +++ b/miniconda3/share/doc/xz/lzma-file-format.txt @@ -0,0 +1,173 @@ + +The .lzma File Format +===================== + + 0. Preface + 0.1. Notices and Acknowledgements + 0.2. Changes + 1. File Format + 1.1. Header + 1.1.1. Properties + 1.1.2. Dictionary Size + 1.1.3. Uncompressed Size + 1.2. LZMA Compressed Data + 2. References + + +0. Preface + + This document describes the .lzma file format, which is + sometimes also called LZMA_Alone format. It is a legacy file + format, which is being or has been replaced by the .xz format. + The MIME type of the .lzma format is `application/x-lzma'. + + The most commonly used software to handle .lzma files are + LZMA SDK, LZMA Utils, 7-Zip, and XZ Utils. This document + describes some of the differences between these implementations + and gives hints what subset of the .lzma format is the most + portable. + + +0.1. Notices and Acknowledgements + + This file format was designed by Igor Pavlov for use in + LZMA SDK. This document was written by Lasse Collin + using the documentation found + from the LZMA SDK. + + This document has been put into the public domain. + + +0.2. Changes + + Last modified: 2024-04-08 17:35+0300 + + From version 2011-04-12 11:55+0300 to 2022-07-13 21:00+0300: + The section 1.1.3 was modified to allow End of Payload Marker + with a known Uncompressed Size. + + +1. File Format + + +-+-+-+-+-+-+-+-+-+-+-+-+-+==========================+ + | Header | LZMA Compressed Data | + +-+-+-+-+-+-+-+-+-+-+-+-+-+==========================+ + + The .lzma format file consist of 13-byte Header followed by + the LZMA Compressed Data. + + Unlike the .gz, .bz2, and .xz formats, it is not possible to + concatenate multiple .lzma files as is and expect the + decompression tool to decode the resulting file as if it were + a single .lzma file. + + For example, the command line tools from LZMA Utils and + LZMA SDK silently ignore all the data after the first .lzma + stream. In contrast, the command line tool from XZ Utils + considers the .lzma file to be corrupt if there is data after + the first .lzma stream. + + +1.1. Header + + +------------+----+----+----+----+--+--+--+--+--+--+--+--+ + | Properties | Dictionary Size | Uncompressed Size | + +------------+----+----+----+----+--+--+--+--+--+--+--+--+ + + +1.1.1. Properties + + The Properties field contains three properties. An abbreviation + is given in parentheses, followed by the value range of the + property. The field consists of + + 1) the number of literal context bits (lc, [0, 8]); + 2) the number of literal position bits (lp, [0, 4]); and + 3) the number of position bits (pb, [0, 4]). + + The properties are encoded using the following formula: + + Properties = (pb * 5 + lp) * 9 + lc + + The following C code illustrates a straightforward way to + decode the Properties field: + + uint8_t lc, lp, pb; + uint8_t prop = get_lzma_properties(); + if (prop > (4 * 5 + 4) * 9 + 8) + return LZMA_PROPERTIES_ERROR; + + pb = prop / (9 * 5); + prop -= pb * 9 * 5; + lp = prop / 9; + lc = prop - lp * 9; + + XZ Utils has an additional requirement: lc + lp <= 4. Files + which don't follow this requirement cannot be decompressed + with XZ Utils. Usually this isn't a problem since the most + common lc/lp/pb values are 3/0/2. It is the only lc/lp/pb + combination that the files created by LZMA Utils can have, + but LZMA Utils can decompress files with any lc/lp/pb. + + +1.1.2. Dictionary Size + + Dictionary Size is stored as an unsigned 32-bit little endian + integer. Any 32-bit value is possible, but for maximum + portability, only sizes of 2^n and 2^n + 2^(n-1) should be + used. + + LZMA Utils creates only files with dictionary size 2^n, + 16 <= n <= 25. LZMA Utils can decompress files with any + dictionary size. + + XZ Utils creates and decompresses .lzma files only with + dictionary sizes 2^n and 2^n + 2^(n-1). If some other + dictionary size is specified when compressing, the value + stored in the Dictionary Size field is a rounded up, but the + specified value is still used in the actual compression code. + + +1.1.3. Uncompressed Size + + Uncompressed Size is stored as unsigned 64-bit little endian + integer. A special value of 0xFFFF_FFFF_FFFF_FFFF indicates + that Uncompressed Size is unknown. End of Payload Marker (*) + is used if Uncompressed Size is unknown. End of Payload Marker + is allowed but rarely used if Uncompressed Size is known. + XZ Utils 5.2.5 and older don't support .lzma files that have + End of Payload Marker together with a known Uncompressed Size. + + XZ Utils rejects files whose Uncompressed Size field specifies + a known size that is 256 GiB or more. This is to reject false + positives when trying to guess if the input file is in the + .lzma format. When Uncompressed Size is unknown, there is no + limit for the uncompressed size of the file. + + (*) Some tools use the term End of Stream (EOS) marker + instead of End of Payload Marker. + + +1.2. LZMA Compressed Data + + Detailed description of the format of this field is out of + scope of this document. + + +2. References + + LZMA SDK - The original LZMA implementation + https://7-zip.org/sdk.html + + 7-Zip + https://7-zip.org/ + + LZMA Utils - LZMA adapted to POSIX-like systems + https://tukaani.org/lzma/ + + XZ Utils - The next generation of LZMA Utils + https://tukaani.org/xz/ + + The .xz file format - The successor of the .lzma format + https://tukaani.org/xz/xz-file-format.txt + diff --git a/miniconda3/share/doc/xz/xz-file-format.txt b/miniconda3/share/doc/xz/xz-file-format.txt new file mode 100644 index 0000000000000000000000000000000000000000..12d2530cda4831e133ffaebad7d0f3f22ae302f2 --- /dev/null +++ b/miniconda3/share/doc/xz/xz-file-format.txt @@ -0,0 +1,1174 @@ + +The .xz File Format +=================== + +Version 1.2.1 (2024-04-08) + + + 0. Preface + 0.1. Notices and Acknowledgements + 0.2. Getting the Latest Version + 0.3. Version History + 1. Conventions + 1.1. Byte and Its Representation + 1.2. Multibyte Integers + 2. Overall Structure of .xz File + 2.1. Stream + 2.1.1. Stream Header + 2.1.1.1. Header Magic Bytes + 2.1.1.2. Stream Flags + 2.1.1.3. CRC32 + 2.1.2. Stream Footer + 2.1.2.1. CRC32 + 2.1.2.2. Backward Size + 2.1.2.3. Stream Flags + 2.1.2.4. Footer Magic Bytes + 2.2. Stream Padding + 3. Block + 3.1. Block Header + 3.1.1. Block Header Size + 3.1.2. Block Flags + 3.1.3. Compressed Size + 3.1.4. Uncompressed Size + 3.1.5. List of Filter Flags + 3.1.6. Header Padding + 3.1.7. CRC32 + 3.2. Compressed Data + 3.3. Block Padding + 3.4. Check + 4. Index + 4.1. Index Indicator + 4.2. Number of Records + 4.3. List of Records + 4.3.1. Unpadded Size + 4.3.2. Uncompressed Size + 4.4. Index Padding + 4.5. CRC32 + 5. Filter Chains + 5.1. Alignment + 5.2. Security + 5.3. Filters + 5.3.1. LZMA2 + 5.3.2. Branch/Call/Jump Filters for Executables + 5.3.3. Delta + 5.3.3.1. Format of the Encoded Output + 5.4. Custom Filter IDs + 5.4.1. Reserved Custom Filter ID Ranges + 6. Cyclic Redundancy Checks + 7. References + + +0. Preface + + This document describes the .xz file format (filename suffix + ".xz", MIME type "application/x-xz"). It is intended that this + this format replace the old .lzma format used by LZMA SDK and + LZMA Utils. + + +0.1. Notices and Acknowledgements + + This file format was designed by Lasse Collin + and Igor Pavlov. + + Special thanks for helping with this document goes to + Ville Koskinen. Thanks for helping with this document goes to + Mark Adler, H. Peter Anvin, Mikko Pouru, and Lars Wirzenius. + + This document has been put into the public domain. + + +0.2. Getting the Latest Version + + The latest official version of this document can be downloaded + from . + + Specific versions of this document have a filename + xz-file-format-X.Y.Z.txt where X.Y.Z is the version number. + For example, the version 1.0.0 of this document is available + at . + + +0.3. Version History + + Version Date Description + + 1.2.1 2024-04-08 The URLs of this specification and + XZ Utils were changed back to the + original ones in Sections 0.2 and 7. + + 1.2.0 2024-01-19 Added RISC-V filter and updated URLs in + Sections 0.2 and 7. The URL of this + specification was changed. + + 1.1.0 2022-12-11 Added ARM64 filter and clarified 32-bit + ARM endianness in Section 5.3.2, + language improvements in Section 5.4 + + 1.0.4 2009-08-27 Language improvements in Sections 1.2, + 2.1.1.2, 3.1.1, 3.1.2, and 5.3.1 + + 1.0.3 2009-06-05 Spelling fixes in Sections 5.1 and 5.4 + + 1.0.2 2009-06-04 Typo fixes in Sections 4 and 5.3.1 + + 1.0.1 2009-06-01 Typo fix in Section 0.3 and minor + clarifications to Sections 2, 2.2, + 3.3, 4.4, and 5.3.2 + + 1.0.0 2009-01-14 The first official version + + +1. Conventions + + The key words "MUST", "MUST NOT", "REQUIRED", "SHOULD", + "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this + document are to be interpreted as described in [RFC-2119]. + + Indicating a warning means displaying a message, returning + appropriate exit status, or doing something else to let the + user know that something worth warning occurred. The operation + SHOULD still finish if a warning is indicated. + + Indicating an error means displaying a message, returning + appropriate exit status, or doing something else to let the + user know that something prevented successfully finishing the + operation. The operation MUST be aborted once an error has + been indicated. + + +1.1. Byte and Its Representation + + In this document, byte is always 8 bits. + + A "null byte" has all bits unset. That is, the value of a null + byte is 0x00. + + To represent byte blocks, this document uses notation that + is similar to the notation used in [RFC-1952]: + + +-------+ + | Foo | One byte. + +-------+ + + +---+---+ + | Foo | Two bytes; that is, some of the vertical bars + +---+---+ can be missing. + + +=======+ + | Foo | Zero or more bytes. + +=======+ + + In this document, a boxed byte or a byte sequence declared + using this notation is called "a field". The example field + above would be called "the Foo field" or plain "Foo". + + If there are many fields, they may be split to multiple lines. + This is indicated with an arrow ("--->"): + + +=====+ + | Foo | + +=====+ + + +=====+ + ---> | Bar | + +=====+ + + The above is equivalent to this: + + +=====+=====+ + | Foo | Bar | + +=====+=====+ + + +1.2. Multibyte Integers + + Multibyte integers of static length, such as CRC values, + are stored in little endian byte order (least significant + byte first). + + When smaller values are more likely than bigger values (for + example file sizes), multibyte integers are encoded in a + variable-length representation: + - Numbers in the range [0, 127] are copied as is, and take + one byte of space. + - Bigger numbers will occupy two or more bytes. All but the + last byte of the multibyte representation have the highest + (eighth) bit set. + + For now, the value of the variable-length integers is limited + to 63 bits, which limits the encoded size of the integer to + nine bytes. These limits may be increased in the future if + needed. + + The following C code illustrates encoding and decoding of + variable-length integers. The functions return the number of + bytes occupied by the integer (1-9), or zero on error. + + #include + #include + + size_t + encode(uint8_t buf[static 9], uint64_t num) + { + if (num > UINT64_MAX / 2) + return 0; + + size_t i = 0; + + while (num >= 0x80) { + buf[i++] = (uint8_t)(num) | 0x80; + num >>= 7; + } + + buf[i++] = (uint8_t)(num); + + return i; + } + + size_t + decode(const uint8_t buf[], size_t size_max, uint64_t *num) + { + if (size_max == 0) + return 0; + + if (size_max > 9) + size_max = 9; + + *num = buf[0] & 0x7F; + size_t i = 0; + + while (buf[i++] & 0x80) { + if (i >= size_max || buf[i] == 0x00) + return 0; + + *num |= (uint64_t)(buf[i] & 0x7F) << (i * 7); + } + + return i; + } + + +2. Overall Structure of .xz File + + A standalone .xz files consist of one or more Streams which may + have Stream Padding between or after them: + + +========+================+========+================+ + | Stream | Stream Padding | Stream | Stream Padding | ... + +========+================+========+================+ + + The sizes of Stream and Stream Padding are always multiples + of four bytes, thus the size of every valid .xz file MUST be + a multiple of four bytes. + + While a typical file contains only one Stream and no Stream + Padding, a decoder handling standalone .xz files SHOULD support + files that have more than one Stream or Stream Padding. + + In contrast to standalone .xz files, when the .xz file format + is used as an internal part of some other file format or + communication protocol, it usually is expected that the decoder + stops after the first Stream, and doesn't look for Stream + Padding or possibly other Streams. + + +2.1. Stream + + +-+-+-+-+-+-+-+-+-+-+-+-+=======+=======+ +=======+ + | Stream Header | Block | Block | ... | Block | + +-+-+-+-+-+-+-+-+-+-+-+-+=======+=======+ +=======+ + + +=======+-+-+-+-+-+-+-+-+-+-+-+-+ + ---> | Index | Stream Footer | + +=======+-+-+-+-+-+-+-+-+-+-+-+-+ + + All the above fields have a size that is a multiple of four. If + Stream is used as an internal part of another file format, it + is RECOMMENDED to make the Stream start at an offset that is + a multiple of four bytes. + + Stream Header, Index, and Stream Footer are always present in + a Stream. The maximum size of the Index field is 16 GiB (2^34). + + There are zero or more Blocks. The maximum number of Blocks is + limited only by the maximum size of the Index field. + + Total size of a Stream MUST be less than 8 EiB (2^63 bytes). + The same limit applies to the total amount of uncompressed + data stored in a Stream. + + If an implementation supports handling .xz files with multiple + concatenated Streams, it MAY apply the above limits to the file + as a whole instead of limiting per Stream basis. + + +2.1.1. Stream Header + + +---+---+---+---+---+---+-------+------+--+--+--+--+ + | Header Magic Bytes | Stream Flags | CRC32 | + +---+---+---+---+---+---+-------+------+--+--+--+--+ + + +2.1.1.1. Header Magic Bytes + + The first six (6) bytes of the Stream are so called Header + Magic Bytes. They can be used to identify the file type. + + Using a C array and ASCII: + const uint8_t HEADER_MAGIC[6] + = { 0xFD, '7', 'z', 'X', 'Z', 0x00 }; + + In plain hexadecimal: + FD 37 7A 58 5A 00 + + Notes: + - The first byte (0xFD) was chosen so that the files cannot + be erroneously detected as being in .lzma format, in which + the first byte is in the range [0x00, 0xE0]. + - The sixth byte (0x00) was chosen to prevent applications + from misdetecting the file as a text file. + + If the Header Magic Bytes don't match, the decoder MUST + indicate an error. + + +2.1.1.2. Stream Flags + + The first byte of Stream Flags is always a null byte. In the + future, this byte may be used to indicate a new Stream version + or other Stream properties. + + The second byte of Stream Flags is a bit field: + + Bit(s) Mask Description + 0-3 0x0F Type of Check (see Section 3.4): + ID Size Check name + 0x00 0 bytes None + 0x01 4 bytes CRC32 + 0x02 4 bytes (Reserved) + 0x03 4 bytes (Reserved) + 0x04 8 bytes CRC64 + 0x05 8 bytes (Reserved) + 0x06 8 bytes (Reserved) + 0x07 16 bytes (Reserved) + 0x08 16 bytes (Reserved) + 0x09 16 bytes (Reserved) + 0x0A 32 bytes SHA-256 + 0x0B 32 bytes (Reserved) + 0x0C 32 bytes (Reserved) + 0x0D 64 bytes (Reserved) + 0x0E 64 bytes (Reserved) + 0x0F 64 bytes (Reserved) + 4-7 0xF0 Reserved for future use; MUST be zero for now. + + Implementations SHOULD support at least the Check IDs 0x00 + (None) and 0x01 (CRC32). Supporting other Check IDs is + OPTIONAL. If an unsupported Check is used, the decoder SHOULD + indicate a warning or error. + + If any reserved bit is set, the decoder MUST indicate an error. + It is possible that there is a new field present which the + decoder is not aware of, and can thus parse the Stream Header + incorrectly. + + +2.1.1.3. CRC32 + + The CRC32 is calculated from the Stream Flags field. It is + stored as an unsigned 32-bit little endian integer. If the + calculated value does not match the stored one, the decoder + MUST indicate an error. + + The idea is that Stream Flags would always be two bytes, even + if new features are needed. This way old decoders will be able + to verify the CRC32 calculated from Stream Flags, and thus + distinguish between corrupt files (CRC32 doesn't match) and + files that the decoder doesn't support (CRC32 matches but + Stream Flags has reserved bits set). + + +2.1.2. Stream Footer + + +-+-+-+-+---+---+---+---+-------+------+----------+---------+ + | CRC32 | Backward Size | Stream Flags | Footer Magic Bytes | + +-+-+-+-+---+---+---+---+-------+------+----------+---------+ + + +2.1.2.1. CRC32 + + The CRC32 is calculated from the Backward Size and Stream Flags + fields. It is stored as an unsigned 32-bit little endian + integer. If the calculated value does not match the stored one, + the decoder MUST indicate an error. + + The reason to have the CRC32 field before the Backward Size and + Stream Flags fields is to keep the four-byte fields aligned to + a multiple of four bytes. + + +2.1.2.2. Backward Size + + Backward Size is stored as a 32-bit little endian integer, + which indicates the size of the Index field as multiple of + four bytes, minimum value being four bytes: + + real_backward_size = (stored_backward_size + 1) * 4; + + If the stored value does not match the real size of the Index + field, the decoder MUST indicate an error. + + Using a fixed-size integer to store Backward Size makes + it slightly simpler to parse the Stream Footer when the + application needs to parse the Stream backwards. + + +2.1.2.3. Stream Flags + + This is a copy of the Stream Flags field from the Stream + Header. The information stored to Stream Flags is needed + when parsing the Stream backwards. The decoder MUST compare + the Stream Flags fields in both Stream Header and Stream + Footer, and indicate an error if they are not identical. + + +2.1.2.4. Footer Magic Bytes + + As the last step of the decoding process, the decoder MUST + verify the existence of Footer Magic Bytes. If they don't + match, an error MUST be indicated. + + Using a C array and ASCII: + const uint8_t FOOTER_MAGIC[2] = { 'Y', 'Z' }; + + In hexadecimal: + 59 5A + + The primary reason to have Footer Magic Bytes is to make + it easier to detect incomplete files quickly, without + uncompressing. If the file does not end with Footer Magic Bytes + (excluding Stream Padding described in Section 2.2), it cannot + be undamaged, unless someone has intentionally appended garbage + after the end of the Stream. + + +2.2. Stream Padding + + Only the decoders that support decoding of concatenated Streams + MUST support Stream Padding. + + Stream Padding MUST contain only null bytes. To preserve the + four-byte alignment of consecutive Streams, the size of Stream + Padding MUST be a multiple of four bytes. Empty Stream Padding + is allowed. If these requirements are not met, the decoder MUST + indicate an error. + + Note that non-empty Stream Padding is allowed at the end of the + file; there doesn't need to be a new Stream after non-empty + Stream Padding. This can be convenient in certain situations + [GNU-tar]. + + The possibility of Stream Padding MUST be taken into account + when designing an application that parses Streams backwards, + and the application supports concatenated Streams. + + +3. Block + + +==============+=================+===============+=======+ + | Block Header | Compressed Data | Block Padding | Check | + +==============+=================+===============+=======+ + + +3.1. Block Header + + +-------------------+-------------+=================+ + | Block Header Size | Block Flags | Compressed Size | + +-------------------+-------------+=================+ + + +===================+======================+ + ---> | Uncompressed Size | List of Filter Flags | + +===================+======================+ + + +================+--+--+--+--+ + ---> | Header Padding | CRC32 | + +================+--+--+--+--+ + + +3.1.1. Block Header Size + + This field overlaps with the Index Indicator field (see + Section 4.1). + + This field contains the size of the Block Header field, + including the Block Header Size field itself. Valid values are + in the range [0x01, 0xFF], which indicate the size of the Block + Header as multiples of four bytes, minimum size being eight + bytes: + + real_header_size = (encoded_header_size + 1) * 4; + + If a Block Header bigger than 1024 bytes is needed in the + future, a new field can be added between the Block Header and + Compressed Data fields. The presence of this new field would + be indicated in the Block Header field. + + +3.1.2. Block Flags + + The Block Flags field is a bit field: + + Bit(s) Mask Description + 0-1 0x03 Number of filters (1-4) + 2-5 0x3C Reserved for future use; MUST be zero for now. + 6 0x40 The Compressed Size field is present. + 7 0x80 The Uncompressed Size field is present. + + If any reserved bit is set, the decoder MUST indicate an error. + It is possible that there is a new field present which the + decoder is not aware of, and can thus parse the Block Header + incorrectly. + + +3.1.3. Compressed Size + + This field is present only if the appropriate bit is set in + the Block Flags field (see Section 3.1.2). + + The Compressed Size field contains the size of the Compressed + Data field, which MUST be non-zero. Compressed Size is stored + using the encoding described in Section 1.2. If the Compressed + Size doesn't match the size of the Compressed Data field, the + decoder MUST indicate an error. + + +3.1.4. Uncompressed Size + + This field is present only if the appropriate bit is set in + the Block Flags field (see Section 3.1.2). + + The Uncompressed Size field contains the size of the Block + after uncompressing. Uncompressed Size is stored using the + encoding described in Section 1.2. If the Uncompressed Size + does not match the real uncompressed size, the decoder MUST + indicate an error. + + Storing the Compressed Size and Uncompressed Size fields serves + several purposes: + - The decoder knows how much memory it needs to allocate + for a temporary buffer in multithreaded mode. + - Simple error detection: wrong size indicates a broken file. + - Seeking forwards to a specific location in streamed mode. + + It should be noted that the only reliable way to determine + the real uncompressed size is to uncompress the Block, + because the Block Header and Index fields may contain + (intentionally or unintentionally) invalid information. + + +3.1.5. List of Filter Flags + + +================+================+ +================+ + | Filter 0 Flags | Filter 1 Flags | ... | Filter n Flags | + +================+================+ +================+ + + The number of Filter Flags fields is stored in the Block Flags + field (see Section 3.1.2). + + The format of each Filter Flags field is as follows: + + +===========+====================+===================+ + | Filter ID | Size of Properties | Filter Properties | + +===========+====================+===================+ + + Both Filter ID and Size of Properties are stored using the + encoding described in Section 1.2. Size of Properties indicates + the size of the Filter Properties field as bytes. The list of + officially defined Filter IDs and the formats of their Filter + Properties are described in Section 5.3. + + Filter IDs greater than or equal to 0x4000_0000_0000_0000 + (2^62) are reserved for implementation-specific internal use. + These Filter IDs MUST never be used in List of Filter Flags. + + +3.1.6. Header Padding + + This field contains as many null byte as it is needed to make + the Block Header have the size specified in Block Header Size. + If any of the bytes are not null bytes, the decoder MUST + indicate an error. It is possible that there is a new field + present which the decoder is not aware of, and can thus parse + the Block Header incorrectly. + + +3.1.7. CRC32 + + The CRC32 is calculated over everything in the Block Header + field except the CRC32 field itself. It is stored as an + unsigned 32-bit little endian integer. If the calculated + value does not match the stored one, the decoder MUST indicate + an error. + + By verifying the CRC32 of the Block Header before parsing the + actual contents allows the decoder to distinguish between + corrupt and unsupported files. + + +3.2. Compressed Data + + The format of Compressed Data depends on Block Flags and List + of Filter Flags. Excluding the descriptions of the simplest + filters in Section 5.3, the format of the filter-specific + encoded data is out of scope of this document. + + +3.3. Block Padding + + Block Padding MUST contain 0-3 null bytes to make the size of + the Block a multiple of four bytes. This can be needed when + the size of Compressed Data is not a multiple of four. If any + of the bytes in Block Padding are not null bytes, the decoder + MUST indicate an error. + + +3.4. Check + + The type and size of the Check field depends on which bits + are set in the Stream Flags field (see Section 2.1.1.2). + + The Check, when used, is calculated from the original + uncompressed data. If the calculated Check does not match the + stored one, the decoder MUST indicate an error. If the selected + type of Check is not supported by the decoder, it SHOULD + indicate a warning or error. + + +4. Index + + +-----------------+===================+ + | Index Indicator | Number of Records | + +-----------------+===================+ + + +=================+===============+-+-+-+-+ + ---> | List of Records | Index Padding | CRC32 | + +=================+===============+-+-+-+-+ + + Index serves several purposes. Using it, one can + - verify that all Blocks in a Stream have been processed; + - find out the uncompressed size of a Stream; and + - quickly access the beginning of any Block (random access). + + +4.1. Index Indicator + + This field overlaps with the Block Header Size field (see + Section 3.1.1). The value of Index Indicator is always 0x00. + + +4.2. Number of Records + + This field indicates how many Records there are in the List + of Records field, and thus how many Blocks there are in the + Stream. The value is stored using the encoding described in + Section 1.2. If the decoder has decoded all the Blocks of the + Stream, and then notices that the Number of Records doesn't + match the real number of Blocks, the decoder MUST indicate an + error. + + +4.3. List of Records + + List of Records consists of as many Records as indicated by the + Number of Records field: + + +========+========+ + | Record | Record | ... + +========+========+ + + Each Record contains information about one Block: + + +===============+===================+ + | Unpadded Size | Uncompressed Size | + +===============+===================+ + + If the decoder has decoded all the Blocks of the Stream, it + MUST verify that the contents of the Records match the real + Unpadded Size and Uncompressed Size of the respective Blocks. + + Implementation hint: It is possible to verify the Index with + constant memory usage by calculating for example SHA-256 of + both the real size values and the List of Records, then + comparing the hash values. Implementing this using + non-cryptographic hash like CRC32 SHOULD be avoided unless + small code size is important. + + If the decoder supports random-access reading, it MUST verify + that Unpadded Size and Uncompressed Size of every completely + decoded Block match the sizes stored in the Index. If only + partial Block is decoded, the decoder MUST verify that the + processed sizes don't exceed the sizes stored in the Index. + + +4.3.1. Unpadded Size + + This field indicates the size of the Block excluding the Block + Padding field. That is, Unpadded Size is the size of the Block + Header, Compressed Data, and Check fields. Unpadded Size is + stored using the encoding described in Section 1.2. The value + MUST never be zero; with the current structure of Blocks, the + actual minimum value for Unpadded Size is five. + + Implementation note: Because the size of the Block Padding + field is not included in Unpadded Size, calculating the total + size of a Stream or doing random-access reading requires + calculating the actual size of the Blocks by rounding Unpadded + Sizes up to the next multiple of four. + + The reason to exclude Block Padding from Unpadded Size is to + ease making a raw copy of Compressed Data without Block + Padding. This can be useful, for example, if someone wants + to convert Streams to some other file format quickly. + + +4.3.2. Uncompressed Size + + This field indicates the Uncompressed Size of the respective + Block as bytes. The value is stored using the encoding + described in Section 1.2. + + +4.4. Index Padding + + This field MUST contain 0-3 null bytes to pad the Index to + a multiple of four bytes. If any of the bytes are not null + bytes, the decoder MUST indicate an error. + + +4.5. CRC32 + + The CRC32 is calculated over everything in the Index field + except the CRC32 field itself. The CRC32 is stored as an + unsigned 32-bit little endian integer. If the calculated + value does not match the stored one, the decoder MUST indicate + an error. + + +5. Filter Chains + + The Block Flags field defines how many filters are used. When + more than one filter is used, the filters are chained; that is, + the output of one filter is the input of another filter. The + following figure illustrates the direction of data flow. + + v Uncompressed Data ^ + | Filter 0 | + Encoder | Filter 1 | Decoder + | Filter n | + v Compressed Data ^ + + +5.1. Alignment + + Alignment of uncompressed input data is usually the job of + the application producing the data. For example, to get the + best results, an archiver tool should make sure that all + PowerPC executable files in the archive stream start at + offsets that are multiples of four bytes. + + Some filters, for example LZMA2, can be configured to take + advantage of specified alignment of input data. Note that + taking advantage of aligned input can be beneficial also when + a filter is not the first filter in the chain. For example, + if you compress PowerPC executables, you may want to use the + PowerPC filter and chain that with the LZMA2 filter. Because + not only the input but also the output alignment of the PowerPC + filter is four bytes, it is now beneficial to set LZMA2 + settings so that the LZMA2 encoder can take advantage of its + four-byte-aligned input data. + + The output of the last filter in the chain is stored to the + Compressed Data field, which is is guaranteed to be aligned + to a multiple of four bytes relative to the beginning of the + Stream. This can increase + - speed, if the filtered data is handled multiple bytes at + a time by the filter-specific encoder and decoder, + because accessing aligned data in computer memory is + usually faster; and + - compression ratio, if the output data is later compressed + with an external compression tool. + + +5.2. Security + + If filters would be allowed to be chained freely, it would be + possible to create malicious files, that would be very slow to + decode. Such files could be used to create denial of service + attacks. + + Slow files could occur when multiple filters are chained: + + v Compressed input data + | Filter 1 decoder (last filter) + | Filter 0 decoder (non-last filter) + v Uncompressed output data + + The decoder of the last filter in the chain produces a lot of + output from little input. Another filter in the chain takes the + output of the last filter, and produces very little output + while consuming a lot of input. As a result, a lot of data is + moved inside the filter chain, but the filter chain as a whole + gets very little work done. + + To prevent this kind of slow files, there are restrictions on + how the filters can be chained. These restrictions MUST be + taken into account when designing new filters. + + The maximum number of filters in the chain has been limited to + four, thus there can be at maximum of three non-last filters. + Of these three non-last filters, only two are allowed to change + the size of the data. + + The non-last filters, that change the size of the data, MUST + have a limit how much the decoder can compress the data: the + decoder SHOULD produce at least n bytes of output when the + filter is given 2n bytes of input. This limit is not + absolute, but significant deviations MUST be avoided. + + The above limitations guarantee that if the last filter in the + chain produces 4n bytes of output, the chain as a whole will + produce at least n bytes of output. + + +5.3. Filters + +5.3.1. LZMA2 + + LZMA (Lempel-Ziv-Markov chain-Algorithm) is a general-purpose + compression algorithm with high compression ratio and fast + decompression. LZMA is based on LZ77 and range coding + algorithms. + + LZMA2 is an extension on top of the original LZMA. LZMA2 uses + LZMA internally, but adds support for flushing the encoder, + uncompressed chunks, eases stateful decoder implementations, + and improves support for multithreading. Thus, the plain LZMA + will not be supported in this file format. + + Filter ID: 0x21 + Size of Filter Properties: 1 byte + Changes size of data: Yes + Allow as a non-last filter: No + Allow as the last filter: Yes + + Preferred alignment: + Input data: Adjustable to 1/2/4/8/16 byte(s) + Output data: 1 byte + + The format of the one-byte Filter Properties field is as + follows: + + Bits Mask Description + 0-5 0x3F Dictionary Size + 6-7 0xC0 Reserved for future use; MUST be zero for now. + + Dictionary Size is encoded with one-bit mantissa and five-bit + exponent. The smallest dictionary size is 4 KiB and the biggest + is 4 GiB. + + Raw value Mantissa Exponent Dictionary size + 0 2 11 4 KiB + 1 3 11 6 KiB + 2 2 12 8 KiB + 3 3 12 12 KiB + 4 2 13 16 KiB + 5 3 13 24 KiB + 6 2 14 32 KiB + ... ... ... ... + 35 3 27 768 MiB + 36 2 28 1024 MiB + 37 3 29 1536 MiB + 38 2 30 2048 MiB + 39 3 30 3072 MiB + 40 2 31 4096 MiB - 1 B + + Instead of having a table in the decoder, the dictionary size + can be decoded using the following C code: + + const uint8_t bits = get_dictionary_flags() & 0x3F; + if (bits > 40) + return DICTIONARY_TOO_BIG; // Bigger than 4 GiB + + uint32_t dictionary_size; + if (bits == 40) { + dictionary_size = UINT32_MAX; + } else { + dictionary_size = 2 | (bits & 1); + dictionary_size <<= bits / 2 + 11; + } + + +5.3.2. Branch/Call/Jump Filters for Executables + + These filters convert relative branch, call, and jump + instructions to their absolute counterparts in executable + files. This conversion increases redundancy and thus + compression ratio. + + Size of Filter Properties: 0 or 4 bytes + Changes size of data: No + Allow as a non-last filter: Yes + Allow as the last filter: No + + Below is the list of filters in this category. The alignment + is the same for both input and output data. + + Filter ID Alignment Description + 0x04 1 byte x86 filter (BCJ) + 0x05 4 bytes PowerPC (big endian) filter + 0x06 16 bytes IA64 filter + 0x07 4 bytes ARM filter [1] + 0x08 2 bytes ARM Thumb filter [1] + 0x09 4 bytes SPARC filter + 0x0A 4 bytes ARM64 filter [2] + 0x0B 2 bytes RISC-V filter + + [1] These are for little endian instruction encoding. + This must not be confused with data endianness. + A processor configured for big endian data access + may still use little endian instruction encoding. + The filters don't care about the data endianness. + + [2] 4096-byte alignment gives the best results + because the address in the ADRP instruction + is a multiple of 4096 bytes. + + If the size of Filter Properties is four bytes, the Filter + Properties field contains the start offset used for address + conversions. It is stored as an unsigned 32-bit little endian + integer. The start offset MUST be a multiple of the alignment + of the filter as listed in the table above; if it isn't, the + decoder MUST indicate an error. If the size of Filter + Properties is zero, the start offset is zero. + + Setting the start offset may be useful if an executable has + multiple sections, and there are many cross-section calls. + Taking advantage of this feature usually requires usage of + the Subblock filter, whose design is not complete yet. + + +5.3.3. Delta + + The Delta filter may increase compression ratio when the value + of the next byte correlates with the value of an earlier byte + at specified distance. + + Filter ID: 0x03 + Size of Filter Properties: 1 byte + Changes size of data: No + Allow as a non-last filter: Yes + Allow as the last filter: No + + Preferred alignment: + Input data: 1 byte + Output data: Same as the original input data + + The Properties byte indicates the delta distance, which can be + 1-256 bytes backwards from the current byte: 0x00 indicates + distance of 1 byte and 0xFF distance of 256 bytes. + + +5.3.3.1. Format of the Encoded Output + + The code below illustrates both encoding and decoding with + the Delta filter. + + // Distance is in the range [1, 256]. + const unsigned int distance = get_properties_byte() + 1; + uint8_t pos = 0; + uint8_t delta[256]; + + memset(delta, 0, sizeof(delta)); + + while (1) { + const int byte = read_byte(); + if (byte == EOF) + break; + + uint8_t tmp = delta[(uint8_t)(distance + pos)]; + if (is_encoder) { + tmp = (uint8_t)(byte) - tmp; + delta[pos] = (uint8_t)(byte); + } else { + tmp = (uint8_t)(byte) + tmp; + delta[pos] = tmp; + } + + write_byte(tmp); + --pos; + } + + +5.4. Custom Filter IDs + + If a developer wants to use custom Filter IDs, there are two + choices. The first choice is to contact Lasse Collin and ask + him to allocate a range of IDs for the developer. + + The second choice is to generate a 40-bit random integer + which the developer can use as a personal Developer ID. + To minimize the risk of collisions, Developer ID has to be + a randomly generated integer, not manually selected "hex word". + The following command, which works on many free operating + systems, can be used to generate Developer ID: + + dd if=/dev/urandom bs=5 count=1 | hexdump + + The developer can then use the Developer ID to create unique + (well, hopefully unique) Filter IDs. + + Bits Mask Description + 0-15 0x0000_0000_0000_FFFF Filter ID + 16-55 0x00FF_FFFF_FFFF_0000 Developer ID + 56-62 0x3F00_0000_0000_0000 Static prefix: 0x3F + + The resulting 63-bit integer will use 9 bytes of space when + stored using the encoding described in Section 1.2. To get + a shorter ID, see the beginning of this Section how to + request a custom ID range. + + +5.4.1. Reserved Custom Filter ID Ranges + + Range Description + 0x0000_0300 - 0x0000_04FF Reserved to ease .7z compatibility + 0x0002_0000 - 0x0007_FFFF Reserved to ease .7z compatibility + 0x0200_0000 - 0x07FF_FFFF Reserved to ease .7z compatibility + + +6. Cyclic Redundancy Checks + + There are several incompatible variations to calculate CRC32 + and CRC64. For simplicity and clarity, complete examples are + provided to calculate the checks as they are used in this file + format. Implementations MAY use different code as long as it + gives identical results. + + The program below reads data from standard input, calculates + the CRC32 and CRC64 values, and prints the calculated values + as big endian hexadecimal strings to standard output. + + #include + #include + #include + + uint32_t crc32_table[256]; + uint64_t crc64_table[256]; + + void + init(void) + { + static const uint32_t poly32 = UINT32_C(0xEDB88320); + static const uint64_t poly64 + = UINT64_C(0xC96C5795D7870F42); + + for (size_t i = 0; i < 256; ++i) { + uint32_t crc32 = i; + uint64_t crc64 = i; + + for (size_t j = 0; j < 8; ++j) { + if (crc32 & 1) + crc32 = (crc32 >> 1) ^ poly32; + else + crc32 >>= 1; + + if (crc64 & 1) + crc64 = (crc64 >> 1) ^ poly64; + else + crc64 >>= 1; + } + + crc32_table[i] = crc32; + crc64_table[i] = crc64; + } + } + + uint32_t + crc32(const uint8_t *buf, size_t size, uint32_t crc) + { + crc = ~crc; + for (size_t i = 0; i < size; ++i) + crc = crc32_table[buf[i] ^ (crc & 0xFF)] + ^ (crc >> 8); + return ~crc; + } + + uint64_t + crc64(const uint8_t *buf, size_t size, uint64_t crc) + { + crc = ~crc; + for (size_t i = 0; i < size; ++i) + crc = crc64_table[buf[i] ^ (crc & 0xFF)] + ^ (crc >> 8); + return ~crc; + } + + int + main() + { + init(); + + uint32_t value32 = 0; + uint64_t value64 = 0; + uint64_t total_size = 0; + uint8_t buf[8192]; + + while (1) { + const size_t buf_size + = fread(buf, 1, sizeof(buf), stdin); + if (buf_size == 0) + break; + + total_size += buf_size; + value32 = crc32(buf, buf_size, value32); + value64 = crc64(buf, buf_size, value64); + } + + printf("Bytes: %" PRIu64 "\n", total_size); + printf("CRC-32: 0x%08" PRIX32 "\n", value32); + printf("CRC-64: 0x%016" PRIX64 "\n", value64); + + return 0; + } + + +7. References + + LZMA SDK - The original LZMA implementation + https://7-zip.org/sdk.html + + LZMA Utils - LZMA adapted to POSIX-like systems + https://tukaani.org/lzma/ + + XZ Utils - The next generation of LZMA Utils + https://tukaani.org/xz/ + + [RFC-1952] + GZIP file format specification version 4.3 + https://www.ietf.org/rfc/rfc1952.txt + - Notation of byte boxes in section "2.1. Overall conventions" + + [RFC-2119] + Key words for use in RFCs to Indicate Requirement Levels + https://www.ietf.org/rfc/rfc2119.txt + + [GNU-tar] + GNU tar 1.35 manual + https://www.gnu.org/software/tar/manual/html_node/Blocking-Factor.html + - Node 9.4.2 "Blocking Factor", paragraph that begins + "gzip will complain about trailing garbage" + - Note that this URL points to the latest version of the + manual, and may some day not contain the note which is in + 1.35. For the exact version of the manual, download GNU + tar 1.35: ftp://ftp.gnu.org/pub/gnu/tar/tar-1.35.tar.gz + diff --git a/miniconda3/share/gettext-0.25.1/its/docbook.loc b/miniconda3/share/gettext-0.25.1/its/docbook.loc new file mode 100644 index 0000000000000000000000000000000000000000..9baf810610c877b8417426ad5399392241629f37 --- /dev/null +++ b/miniconda3/share/gettext-0.25.1/its/docbook.loc @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + diff --git a/miniconda3/share/gettext-0.25.1/its/docbook4.its b/miniconda3/share/gettext-0.25.1/its/docbook4.its new file mode 100644 index 0000000000000000000000000000000000000000..1c39ce21e7a18fa4951b11078845eabb88225f0c --- /dev/null +++ b/miniconda3/share/gettext-0.25.1/its/docbook4.its @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/miniconda3/share/gettext-0.25.1/its/docbook5.its b/miniconda3/share/gettext-0.25.1/its/docbook5.its new file mode 100644 index 0000000000000000000000000000000000000000..2d448928c3b5d5914bf767d15767f35c538cd242 --- /dev/null +++ b/miniconda3/share/gettext-0.25.1/its/docbook5.its @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/miniconda3/share/gettext-0.25.1/its/glade.loc b/miniconda3/share/gettext-0.25.1/its/glade.loc new file mode 100644 index 0000000000000000000000000000000000000000..eb9b1bc82987f7101c1baa18b2b59f2b4b7753d7 --- /dev/null +++ b/miniconda3/share/gettext-0.25.1/its/glade.loc @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + diff --git a/miniconda3/share/gettext-0.25.1/its/glade1.its b/miniconda3/share/gettext-0.25.1/its/glade1.its new file mode 100644 index 0000000000000000000000000000000000000000..42f73b78031d0d0ac6aa48998587a3959aa88173 --- /dev/null +++ b/miniconda3/share/gettext-0.25.1/its/glade1.its @@ -0,0 +1,37 @@ + + + + + + + + + + + diff --git a/miniconda3/share/gettext-0.25.1/its/glade2.its b/miniconda3/share/gettext-0.25.1/its/glade2.its new file mode 100644 index 0000000000000000000000000000000000000000..8b38db7509476355b8482948981b7e874a83bfe9 --- /dev/null +++ b/miniconda3/share/gettext-0.25.1/its/glade2.its @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + diff --git a/miniconda3/share/gettext-0.25.1/its/gsettings.its b/miniconda3/share/gettext-0.25.1/its/gsettings.its new file mode 100644 index 0000000000000000000000000000000000000000..fe963846b50ed3183ac0ff16dcfd2e982026a1db --- /dev/null +++ b/miniconda3/share/gettext-0.25.1/its/gsettings.its @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + diff --git a/miniconda3/share/gettext-0.25.1/its/gsettings.loc b/miniconda3/share/gettext-0.25.1/its/gsettings.loc new file mode 100644 index 0000000000000000000000000000000000000000..308e4517c3f3854b5ac7c027af476a33b26cad25 --- /dev/null +++ b/miniconda3/share/gettext-0.25.1/its/gsettings.loc @@ -0,0 +1,23 @@ + + + + + + + diff --git a/miniconda3/share/gettext-0.25.1/its/gtkbuilder.its b/miniconda3/share/gettext-0.25.1/its/gtkbuilder.its new file mode 100644 index 0000000000000000000000000000000000000000..9d28531a78e578f896eba324e576f15306f11ccd --- /dev/null +++ b/miniconda3/share/gettext-0.25.1/its/gtkbuilder.its @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + diff --git a/miniconda3/share/gettext-0.25.1/its/metainfo.its b/miniconda3/share/gettext-0.25.1/its/metainfo.its new file mode 100644 index 0000000000000000000000000000000000000000..3923614c52a62c04e0bc704d11f64ddbd7f1900d --- /dev/null +++ b/miniconda3/share/gettext-0.25.1/its/metainfo.its @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + diff --git a/miniconda3/share/gettext-0.25.1/its/metainfo.loc b/miniconda3/share/gettext-0.25.1/its/metainfo.loc new file mode 100644 index 0000000000000000000000000000000000000000..64fff224df0e84e06a150ff7d1a682f1a5877857 --- /dev/null +++ b/miniconda3/share/gettext-0.25.1/its/metainfo.loc @@ -0,0 +1,26 @@ + + + + + + + + + + diff --git a/miniconda3/share/gettext/ABOUT-NLS b/miniconda3/share/gettext/ABOUT-NLS new file mode 100644 index 0000000000000000000000000000000000000000..0a9d56d9e79bf5cd209a6fc6a7c8cddade70b16d --- /dev/null +++ b/miniconda3/share/gettext/ABOUT-NLS @@ -0,0 +1 @@ + diff --git a/miniconda3/share/gettext/config.rpath b/miniconda3/share/gettext/config.rpath new file mode 100644 index 0000000000000000000000000000000000000000..43dc3042de2a4bf288baa42f6f3b736e0f7c25f8 --- /dev/null +++ b/miniconda3/share/gettext/config.rpath @@ -0,0 +1,751 @@ +#! /bin/sh +# Output a system dependent set of variables, describing how to set the +# run time search path of shared libraries in a binary (executable or +# shared library). +# +# Copyright 1996-2025 Free Software Foundation, Inc. +# Taken from GNU libtool, 2001 +# Originally by Gordon Matzigkeit , 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# Known limitations: +# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer +# than 256 bytes, otherwise the compiler driver will dump core. The only +# known workaround is to choose shorter directory names for the build +# directory and/or the installation directory. + +# func_usage +# outputs to stdout the --help usage message. +func_usage () +{ + echo "\ +Usage: config.rpath [OPTION] HOST + +Prints shell variable assignments that describe how to hardcode a directory +for the lookup of shared libraries into a binary (executable or shared library). + +The first argument passed to this file is the canonical host specification, + CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +or + CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM + +The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld +should be set by the caller. + +The set of defined variables is at the end of this script. + +Options: + --help print this help and exit + --version print version information and exit + +Send patches and bug reports to ." +} + +# func_version +# outputs to stdout the --version message. +func_version () +{ + echo "config.rpath (GNU gnulib, module havelib)" + echo "Copyright (C) 2025 Free Software Foundation, Inc. +License: All-Permissive. +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law." + echo + printf 'Written by %s.\n' "Bruno Haible" +} + +# func_fatal_error message +# outputs to stderr a fatal error message, and terminates the program. +func_fatal_error () +{ + echo "config.rpath: *** $1" 1>&2 + echo "config.rpath: *** Stop." 1>&2 + exit 1 +} + +# Command-line option processing. +while test $# -gt 0; do + case "$1" in + --help | --hel | --he | --h ) + func_usage + exit 0 ;; + --version | --versio | --versi | --vers | --ver | --ve | --v ) + func_version + exit 0 ;; + -- ) # Stop option processing + shift; break ;; + -* ) + func_fatal_error "unrecognized option: $1" + ;; + * ) + break ;; + esac +done + +if test $# -gt 1; then + func_fatal_error "too many arguments" +fi +if test $# -lt 1; then + func_fatal_error "too few arguments" +fi + +# All known linkers require a '.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +shrext=.so + +host="$1" +host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# Code taken from libtool.m4's _LT_CC_BASENAME. + +for cc_temp in $CC""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` + +# Code taken from libtool.m4's _LT_COMPILER_PIC. + +wl= +if test "$GCC" = yes; then + wl='-Wl,' +else + case "$host_os" in + aix*) + wl='-Wl,' + ;; + mingw* | cygwin* | pw32* | os2* | cegcc*) + ;; + hpux9* | hpux10* | hpux11*) + wl='-Wl,' + ;; + irix5* | irix6* | nonstopux*) + wl='-Wl,' + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + ecc*) + wl='-Wl,' + ;; + icc* | ifort*) + wl='-Wl,' + ;; + lf95*) + wl='-Wl,' + ;; + nagfor*) + wl='-Wl,-Wl,,' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + wl='-Wl,' + ;; + ccc*) + wl='-Wl,' + ;; + xl* | bgxl* | bgf* | mpixl*) + wl='-Wl,' + ;; + como) + wl='-lopt=' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + wl= + ;; + *Sun\ C*) + wl='-Wl,' + ;; + esac + ;; + esac + ;; + newsos6) + ;; + *nto* | *qnx*) + ;; + osf3* | osf4* | osf5*) + wl='-Wl,' + ;; + rdos*) + ;; + solaris*) + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + wl='-Qoption ld ' + ;; + *) + wl='-Wl,' + ;; + esac + ;; + sunos4*) + wl='-Qoption ld ' + ;; + sysv4 | sysv4.2uw2* | sysv4.3*) + wl='-Wl,' + ;; + sysv4*MP*) + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + wl='-Wl,' + ;; + unicos*) + wl='-Wl,' + ;; + uts4*) + ;; + esac +fi + +# Code taken from libtool.m4's _LT_LINKER_SHLIBS. + +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no + +case "$host_os" in + cygwin* | mingw* | pw32* | cegcc*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + # Unlike libtool, we use -rpath here, not --rpath, since the documented + # option of GNU ld is called -rpath, not --rpath. + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + case "$host_os" in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + fi + ;; + amigaos*) + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + cygwin* | mingw* | pw32* | cegcc*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + haiku*) + ;; + interix[3-9]*) + hardcode_direct=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + netbsd*) + ;; + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + else + ld_shlibs=no + fi + ;; + esac + ;; + sunos4*) + hardcode_direct=yes + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + : + else + ld_shlibs=no + fi + ;; + esac + if test "$ld_shlibs" = no; then + hardcode_libdir_flag_spec= + fi +else + case "$host_os" in + aix3*) + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + aix[4-9]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + else + aix_use_runtimelinking=no + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + fi + hardcode_direct=yes + hardcode_libdir_separator=':' + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + fi + # Begin _LT_AC_SYS_LIBPATH_AIX. + echo 'int main () { return 0; }' > conftest.c + ${CC} ${LDFLAGS} conftest.c -o conftest + aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` + fi + if test -z "$aix_libpath"; then + aix_libpath="/usr/lib:/lib" + fi + rm -f conftest.c conftest + # End _LT_AC_SYS_LIBPATH_AIX. + if test "$aix_use_runtimelinking" = yes; then + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + else + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + fi + fi + ;; + amigaos*) + case "$host_cpu" in + powerpc) + ;; + m68k) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + bsdi[45]*) + ;; + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + libext=lib + ;; + darwin* | rhapsody*) + hardcode_direct=no + if { case $cc_basename in ifort*) true;; *) test "$GCC" = yes;; esac; }; then + : + else + ld_shlibs=no + fi + ;; + dgux*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + freebsd2.[01]*) + hardcode_direct=yes + hardcode_minus_L=yes + ;; + freebsd* | dragonfly* | midnightbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + hpux9*) + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + hpux10*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; + hpux11*) + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + ;; + *) + hardcode_direct=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + irix5* | irix6* | nonstopux*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + netbsd*) + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + ;; + newsos6) + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + *nto* | *qnx*) + ;; + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + else + case "$host_os" in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + osf3*) + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + osf4* | osf5*) + if test "$GCC" = yes; then + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + # Both cc and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; + solaris*) + hardcode_libdir_flag_spec='-R$libdir' + ;; + sunos4*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + ;; + sysv4) + case $host_vendor in + sni) + hardcode_direct=yes # is this really true??? + ;; + siemens) + hardcode_direct=no + ;; + motorola) + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + esac + ;; + sysv4.3*) + ;; + sysv4*MP*) + if test -d /usr/nec; then + ld_shlibs=yes + fi + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + ;; + sysv5* | sco3.2v5* | sco5v6*) + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + ;; + uts4*) + hardcode_libdir_flag_spec='-L$libdir' + ;; + *) + ld_shlibs=no + ;; + esac +fi + +# Check dynamic linker characteristics +# Code taken from libtool.m4's _LT_SYS_DYNAMIC_LINKER. +# Unlike libtool.m4, here we don't care about _all_ names of the library, but +# only about the one the linker finds when passed -lNAME. This is the last +# element of library_names_spec in libtool.m4, or possibly two of them if the +# linker has special search rules. +library_names_spec= # the last element of library_names_spec in libtool.m4 +libname_spec='lib$name' +case "$host_os" in + aix3*) + library_names_spec='$libname.a' + ;; + aix[4-9]*) + library_names_spec='$libname$shrext' + ;; + amigaos*) + case "$host_cpu" in + powerpc*) + library_names_spec='$libname$shrext' ;; + m68k) + library_names_spec='$libname.a' ;; + esac + ;; + beos*) + library_names_spec='$libname$shrext' + ;; + bsdi[45]*) + library_names_spec='$libname$shrext' + ;; + cygwin* | mingw* | pw32* | cegcc*) + shrext=.dll + library_names_spec='$libname.dll.a $libname.lib' + ;; + darwin* | rhapsody*) + shrext=.dylib + library_names_spec='$libname$shrext' + ;; + dgux*) + library_names_spec='$libname$shrext' + ;; + freebsd[23].*) + library_names_spec='$libname$shrext$versuffix' + ;; + freebsd* | dragonfly* | midnightbsd*) + library_names_spec='$libname$shrext' + ;; + gnu*) + library_names_spec='$libname$shrext' + ;; + haiku*) + library_names_spec='$libname$shrext' + ;; + hpux9* | hpux10* | hpux11*) + case $host_cpu in + ia64*) + shrext=.so + ;; + hppa*64*) + shrext=.sl + ;; + *) + shrext=.sl + ;; + esac + library_names_spec='$libname$shrext' + ;; + interix[3-9]*) + library_names_spec='$libname$shrext' + ;; + irix5* | irix6* | nonstopux*) + library_names_spec='$libname$shrext' + case "$host_os" in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; + *) libsuff= shlibsuff= ;; + esac + ;; + esac + ;; + linux*oldld* | linux*aout* | linux*coff*) + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + library_names_spec='$libname$shrext' + ;; + knetbsd*-gnu) + library_names_spec='$libname$shrext' + ;; + netbsd*) + library_names_spec='$libname$shrext' + ;; + newsos6) + library_names_spec='$libname$shrext' + ;; + *nto* | *qnx*) + library_names_spec='$libname$shrext' + ;; + openbsd*) + library_names_spec='$libname$shrext$versuffix' + ;; + os2*) + libname_spec='$name' + shrext=.dll + library_names_spec='$libname.a' + ;; + osf3* | osf4* | osf5*) + library_names_spec='$libname$shrext' + ;; + rdos*) + ;; + solaris*) + library_names_spec='$libname$shrext' + ;; + sunos4*) + library_names_spec='$libname$shrext$versuffix' + ;; + sysv4 | sysv4.3*) + library_names_spec='$libname$shrext' + ;; + sysv4*MP*) + library_names_spec='$libname$shrext' + ;; + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + library_names_spec='$libname$shrext' + ;; + tpf*) + library_names_spec='$libname$shrext' + ;; + uts4*) + library_names_spec='$libname$shrext' + ;; +esac + +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' +escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` +shlibext=`echo "$shrext" | sed -e 's,^\.,,'` +escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` +escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` + +LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' < or fax it to us at +1-617-542-2652. +You can also send it to us via the postal mail if you prefer: + +Attn: Copyright Administrator +Free Software Foundation +31 Milk Street, # 960789 +Boston, MA 02196 +USA + + +Please print your email and snail addresses on the printed disclaimer. +*Don't forget to include the date.* + +In the unlikely event that you are employed on a continuing basis to do +translation, we may need a disclaimer from your employer as well, to assure +your employer does not claim to own this work. Please contact the FSF to +ask for advice if you think this may apply to you. + +Note: if you want the wording modified to cover only a specific category +of programs, or a specific program, we can easily do that. + + + + DISCLAIMER OF COPYRIGHT IN TRANSLATIONS OF PARTS OF PROGRAMS + +I, _____________________________________, a citizen of _____________ +(country), do hereby acknowledge to the Free Software Foundation, a +not-for-profit corporation of Massachusetts, USA, that I disclaim all +copyright interest in my works, which consist of translation of +portions of free software programs from one human language to another +human language, that I have provided to the Foundation or that I will +provide in the future. The programs to which this applies include all +programs for which the Foundation is the copyright holder, and all +other freely redistributable software programs. + +The translations covered by this disclaimer include, without +limitation, translations of textual messages, glossaries, command or +option names, help files, user interface text, and the like, contained +within or made for use via these programs. + + Given as a sealed instrument this ___ day of ______ (month), ______ +(year), at _____________________ (city and country). + + + signed: ___________________________ + + email address: ___________________________ + + postal address: ___________________________ + + ___________________________ + + ___________________________ + + + +I currently expect to translate into the following language (though +this disclaimer applies to all such translations that I may +subsequently provide to the FSF, whatever the language): + + __________________________________________________ + + __________________________________________________ + diff --git a/miniconda3/share/gettext/gettext.h b/miniconda3/share/gettext/gettext.h new file mode 100644 index 0000000000000000000000000000000000000000..e07880bb3d5e8a658b66acf511899bab970aa073 --- /dev/null +++ b/miniconda3/share/gettext/gettext.h @@ -0,0 +1,310 @@ +/* Convenience header for conditional use of GNU . + Copyright (C) 1995-2024 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . */ + +#ifndef _LIBGETTEXT_H +#define _LIBGETTEXT_H 1 + + +/* NLS can be disabled through the configure --disable-nls option + or through "#define ENABLE NLS 0" before including this file. */ +#if defined ENABLE_NLS && ENABLE_NLS + +/* Get declarations of GNU message catalog functions. */ +# include + +/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by + the gettext() and ngettext() macros. This is an alternative to calling + textdomain(), and is useful for libraries. */ +# ifdef DEFAULT_TEXT_DOMAIN +# undef gettext +# define gettext(Msgid) \ + dgettext (DEFAULT_TEXT_DOMAIN, Msgid) +# undef ngettext +# define ngettext(Msgid1, Msgid2, N) \ + dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) +# endif + +#else + +/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which + chokes if dcgettext is defined as a macro. So include it now, to make + later inclusions of a NOP. We don't include + as well because people using "gettext.h" will not include , + and also including would fail on SunOS 4, whereas + is OK. */ +# if defined(__sun) +# include +# endif + +/* Many header files from the libstdc++ coming with g++ 3.3 or newer include + , which chokes if dcgettext is defined as a macro. So include + it now, to make later inclusions of a NOP. */ +# if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) +# include +# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || _GLIBCXX_HAVE_LIBINTL_H +# include +# endif +# endif + +/* Disabled NLS. + The casts to 'const char *' serve the purpose of producing warnings + for invalid uses of the value returned from these functions. + On pre-ANSI systems without 'const', the config.h file is supposed to + contain "#define const". */ +# undef gettext +# define gettext(Msgid) ((const char *) (Msgid)) +# undef dgettext +# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid)) +# undef dcgettext +# define dcgettext(Domainname, Msgid, Category) \ + ((void) (Category), dgettext (Domainname, Msgid)) +# undef ngettext +# define ngettext(Msgid1, Msgid2, N) \ + ((N) == 1 \ + ? ((void) (Msgid2), (const char *) (Msgid1)) \ + : ((void) (Msgid1), (const char *) (Msgid2))) +# undef dngettext +# define dngettext(Domainname, Msgid1, Msgid2, N) \ + ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) +# undef dcngettext +# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ + ((void) (Category), dngettext (Domainname, Msgid1, Msgid2, N)) +# undef textdomain +# define textdomain(Domainname) ((const char *) (Domainname)) +# undef bindtextdomain +# define bindtextdomain(Domainname, Dirname) \ + ((void) (Domainname), (const char *) (Dirname)) +# undef bind_textdomain_codeset +# define bind_textdomain_codeset(Domainname, Codeset) \ + ((void) (Domainname), (const char *) (Codeset)) + +#endif + + +/* Prefer gnulib's setlocale override over libintl's setlocale override. */ +#ifdef GNULIB_defined_setlocale +# undef setlocale +# define setlocale rpl_setlocale +#endif + + +/* A pseudo function call that serves as a marker for the automated + extraction of messages, but does not call gettext(). The run-time + translation is done at a different place in the code. + The argument, String, should be a literal string. Concatenated strings + and other string expressions won't work. + The macro's expansion is not parenthesized, so that it is suitable as + initializer for static 'char[]' or 'const char[]' variables. */ +#define gettext_noop(String) String + + +/* The separator between msgctxt and msgid in a .mo file. */ +#define GETTEXT_CONTEXT_GLUE "\004" + +/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a + MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be + short and rarely need to change. + The letter 'p' stands for 'particular' or 'special'. */ + +#include /* for LC_MESSAGES */ + +#ifdef DEFAULT_TEXT_DOMAIN +# define pgettext(Msgctxt, Msgid) \ + pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#else +# define pgettext(Msgctxt, Msgid) \ + pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#endif +#define dpgettext(Domainname, Msgctxt, Msgid) \ + pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) +#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ + pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) +#ifdef DEFAULT_TEXT_DOMAIN +# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#else +# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#endif +#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ + npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) +#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ + npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category) + +#if defined __GNUC__ || defined __clang__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +pgettext_aux (const char *domain, + const char *msg_ctxt_id, const char *msgid, + int category) +{ + const char *translation = dcgettext (domain, msg_ctxt_id, category); + if (translation == msg_ctxt_id) + return msgid; + else + return translation; +} + +#if defined __GNUC__ || defined __clang__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +npgettext_aux (const char *domain, + const char *msg_ctxt_id, const char *msgid, + const char *msgid_plural, unsigned long int n, + int category) +{ + const char *translation = + dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); + if (translation == msg_ctxt_id || translation == msgid_plural) + return (n == 1 ? msgid : msgid_plural); + else + return translation; +} + + +/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID + can be arbitrary expressions. But for string literals these macros are + less efficient than those above. */ + +#include /* for memcpy */ + +/* GNULIB_NO_VLA can be defined to disable use of VLAs even if supported. + This relates to the -Wvla and -Wvla-larger-than warnings, enabled in + the default GCC many warnings set. This allows programs to disable use + of VLAs, which may be unintended, or may be awkward to support portably, + or may have security implications due to non-deterministic stack usage. */ + +#if (!defined GNULIB_NO_VLA \ + && (((__GNUC__ >= 3 || defined __clang__) \ + && !defined __STRICT_ANSI__ && !defined __cplusplus) \ + /* || (__STDC_VERSION__ == 199901L && !defined __HP_cc) + || (__STDC_VERSION__ >= 201112L && !defined __STDC_NO_VLA__) */ )) +# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1 +#else +# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0 +#endif + +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS +# include /* for malloc, free */ +#endif + +#define pgettext_expr(Msgctxt, Msgid) \ + dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES) +#define dpgettext_expr(Domainname, Msgctxt, Msgid) \ + dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES) + +#if defined __GNUC__ || defined __clang__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +dcpgettext_expr (const char *domain, + const char *msgctxt, const char *msgid, + int category) +{ + size_t msgctxt_len = strlen (msgctxt) + 1; + size_t msgid_len = strlen (msgid) + 1; + const char *translation; +#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + char msg_ctxt_id[msgctxt_len + msgid_len]; +#else + char buf[1024]; + char *msg_ctxt_id = + (msgctxt_len + msgid_len <= sizeof (buf) + ? buf + : (char *) malloc (msgctxt_len + msgid_len)); + if (msg_ctxt_id != NULL) +#endif + { + int found_translation; + memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); + msg_ctxt_id[msgctxt_len - 1] = '\004'; + memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); + translation = dcgettext (domain, msg_ctxt_id, category); + found_translation = (translation != msg_ctxt_id); +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + if (msg_ctxt_id != buf) + free (msg_ctxt_id); +#endif + if (found_translation) + return translation; + } + return msgid; +} + +#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ + dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) +#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ + dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) + +#if defined __GNUC__ || defined __clang__ +__inline +#else +#ifdef __cplusplus +inline +#endif +#endif +static const char * +dcnpgettext_expr (const char *domain, + const char *msgctxt, const char *msgid, + const char *msgid_plural, unsigned long int n, + int category) +{ + size_t msgctxt_len = strlen (msgctxt) + 1; + size_t msgid_len = strlen (msgid) + 1; + const char *translation; +#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + char msg_ctxt_id[msgctxt_len + msgid_len]; +#else + char buf[1024]; + char *msg_ctxt_id = + (msgctxt_len + msgid_len <= sizeof (buf) + ? buf + : (char *) malloc (msgctxt_len + msgid_len)); + if (msg_ctxt_id != NULL) +#endif + { + int found_translation; + memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); + msg_ctxt_id[msgctxt_len - 1] = '\004'; + memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); + translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); + found_translation = !(translation == msg_ctxt_id || translation == msgid_plural); +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS + if (msg_ctxt_id != buf) + free (msg_ctxt_id); +#endif + if (found_translation) + return translation; + } + return (n == 1 ? msgid : msgid_plural); +} + + +#endif /* _LIBGETTEXT_H */ diff --git a/miniconda3/share/gettext/javaversion.class b/miniconda3/share/gettext/javaversion.class new file mode 100644 index 0000000000000000000000000000000000000000..d62585b0ecd259dc3d661247c323788c927ff140 Binary files /dev/null and b/miniconda3/share/gettext/javaversion.class differ diff --git a/miniconda3/share/gettext/m4/build-to-host.m4 b/miniconda3/share/gettext/m4/build-to-host.m4 new file mode 100644 index 0000000000000000000000000000000000000000..01bff8f34f24649e479f1081ccb58f2c87d3491e --- /dev/null +++ b/miniconda3/share/gettext/m4/build-to-host.m4 @@ -0,0 +1,274 @@ +# build-to-host.m4 +# serial 5 +dnl Copyright (C) 2023-2025 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl This file is offered as-is, without any warranty. + +dnl Written by Bruno Haible. + +dnl When the build environment ($build_os) is different from the target runtime +dnl environment ($host_os), file names may need to be converted from the build +dnl environment syntax to the target runtime environment syntax. This is +dnl because the Makefiles are executed (mostly) by build environment tools and +dnl therefore expect file names in build environment syntax, whereas the runtime +dnl expects file names in target runtime environment syntax. +dnl +dnl For example, if $build_os = cygwin and $host_os = mingw32, filenames need +dnl be converted from Cygwin syntax to native Windows syntax: +dnl /cygdrive/c/foo/bar -> C:\foo\bar +dnl /usr/local/share -> C:\cygwin64\usr\local\share +dnl +dnl gl_BUILD_TO_HOST([somedir]) +dnl This macro takes as input an AC_SUBSTed variable 'somedir', which must +dnl already have its final value assigned, and produces two additional +dnl AC_SUBSTed variables 'somedir_c' and 'somedir_c_make', that designate the +dnl same file name value, just in different syntax: +dnl - somedir_c is the file name in target runtime environment syntax, +dnl as a C string (starting and ending with a double-quote, +dnl and with escaped backslashes and double-quotes in +dnl between). +dnl - somedir_c_make is the same thing, escaped for use in a Makefile. + +AC_DEFUN([gl_BUILD_TO_HOST], +[ + AC_REQUIRE([AC_CANONICAL_BUILD]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_BUILD_TO_HOST_INIT]) + + dnl Define somedir_c. + gl_final_[$1]="$[$1]" + dnl Translate it from build syntax to host syntax. + case "$build_os" in + cygwin*) + case "$host_os" in + mingw* | windows*) + gl_final_[$1]=`cygpath -w "$gl_final_[$1]"` ;; + esac + ;; + esac + dnl Convert it to C string syntax. + [$1]_c=`printf '%s\n' "$gl_final_[$1]" | sed -e "$gl_sed_double_backslashes" -e "$gl_sed_escape_doublequotes" | tr -d "$gl_tr_cr"` + [$1]_c='"'"$[$1]_c"'"' + AC_SUBST([$1_c]) + + dnl Define somedir_c_make. + [$1]_c_make=`printf '%s\n' "$[$1]_c" | sed -e "$gl_sed_escape_for_make_1" -e "$gl_sed_escape_for_make_2" | tr -d "$gl_tr_cr"` + dnl Use the substituted somedir variable, when possible, so that the user + dnl may adjust somedir a posteriori when there are no special characters. + if test "$[$1]_c_make" = '\"'"${gl_final_[$1]}"'\"'; then + [$1]_c_make='\"$([$1])\"' + fi + AC_SUBST([$1_c_make]) +]) + +dnl Some initializations for gl_BUILD_TO_HOST. +AC_DEFUN([gl_BUILD_TO_HOST_INIT], +[ + gl_sed_double_backslashes='s/\\/\\\\/g' + gl_sed_escape_doublequotes='s/"/\\"/g' +changequote(,)dnl + gl_sed_escape_for_make_1="s,\\([ \"&'();<>\\\\\`|]\\),\\\\\\1,g" +changequote([,])dnl + gl_sed_escape_for_make_2='s,\$,\\$$,g' + dnl Find out how to remove carriage returns from output. Solaris /usr/ucb/tr + dnl does not understand '\r'. + case `echo r | tr -d '\r'` in + '') gl_tr_cr='\015' ;; + *) gl_tr_cr='\r' ;; + esac +]) + + +dnl The following macros are convenience invocations of gl_BUILD_TO_HOST +dnl for some of the variables that are defined by Autoconf. +dnl To do so for _all_ the possible variables, use the module 'configmake'. + +dnl Defines bindir_c and bindir_c_make. +AC_DEFUN_ONCE([gl_BUILD_TO_HOST_BINDIR], +[ + dnl Find the final value of bindir. + gl_saved_prefix="${prefix}" + gl_saved_exec_prefix="${exec_prefix}" + gl_saved_bindir="${bindir}" + dnl Unfortunately, prefix and exec_prefix get only finally determined + dnl at the end of configure. + if test "X$prefix" = "XNONE"; then + prefix="$ac_default_prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + exec_prefix='${prefix}' + fi + eval exec_prefix="$exec_prefix" + eval bindir="$bindir" + gl_BUILD_TO_HOST([bindir]) + bindir="${gl_saved_bindir}" + exec_prefix="${gl_saved_exec_prefix}" + prefix="${gl_saved_prefix}" +]) + +dnl Defines datadir_c and datadir_c_make, +dnl where datadir = $(datarootdir) +AC_DEFUN_ONCE([gl_BUILD_TO_HOST_DATADIR], +[ + dnl Find the final value of datadir. + gl_saved_prefix="${prefix}" + gl_saved_datarootdir="${datarootdir}" + gl_saved_datadir="${datadir}" + dnl Unfortunately, prefix gets only finally determined at the end of + dnl configure. + if test "X$prefix" = "XNONE"; then + prefix="$ac_default_prefix" + fi + eval datarootdir="$datarootdir" + eval datadir="$datadir" + gl_BUILD_TO_HOST([datadir]) + datadir="${gl_saved_datadir}" + datarootdir="${gl_saved_datarootdir}" + prefix="${gl_saved_prefix}" +]) + +dnl Defines libdir_c and libdir_c_make. +AC_DEFUN_ONCE([gl_BUILD_TO_HOST_LIBDIR], +[ + dnl Find the final value of libdir. + gl_saved_prefix="${prefix}" + gl_saved_exec_prefix="${exec_prefix}" + gl_saved_libdir="${libdir}" + dnl Unfortunately, prefix and exec_prefix get only finally determined + dnl at the end of configure. + if test "X$prefix" = "XNONE"; then + prefix="$ac_default_prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + exec_prefix='${prefix}' + fi + eval exec_prefix="$exec_prefix" + eval libdir="$libdir" + gl_BUILD_TO_HOST([libdir]) + libdir="${gl_saved_libdir}" + exec_prefix="${gl_saved_exec_prefix}" + prefix="${gl_saved_prefix}" +]) + +dnl Defines libexecdir_c and libexecdir_c_make. +AC_DEFUN_ONCE([gl_BUILD_TO_HOST_LIBEXECDIR], +[ + dnl Find the final value of libexecdir. + gl_saved_prefix="${prefix}" + gl_saved_exec_prefix="${exec_prefix}" + gl_saved_libexecdir="${libexecdir}" + dnl Unfortunately, prefix and exec_prefix get only finally determined + dnl at the end of configure. + if test "X$prefix" = "XNONE"; then + prefix="$ac_default_prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + exec_prefix='${prefix}' + fi + eval exec_prefix="$exec_prefix" + eval libexecdir="$libexecdir" + gl_BUILD_TO_HOST([libexecdir]) + libexecdir="${gl_saved_libexecdir}" + exec_prefix="${gl_saved_exec_prefix}" + prefix="${gl_saved_prefix}" +]) + +dnl Defines localedir_c and localedir_c_make. +AC_DEFUN_ONCE([gl_BUILD_TO_HOST_LOCALEDIR], +[ + dnl Find the final value of localedir. + gl_saved_prefix="${prefix}" + gl_saved_datarootdir="${datarootdir}" + gl_saved_localedir="${localedir}" + dnl Unfortunately, prefix gets only finally determined at the end of + dnl configure. + if test "X$prefix" = "XNONE"; then + prefix="$ac_default_prefix" + fi + eval datarootdir="$datarootdir" + eval localedir="$localedir" + gl_BUILD_TO_HOST([localedir]) + localedir="${gl_saved_localedir}" + datarootdir="${gl_saved_datarootdir}" + prefix="${gl_saved_prefix}" +]) + +dnl Defines pkgdatadir_c and pkgdatadir_c_make, +dnl where pkgdatadir = $(datadir)/$(PACKAGE) +AC_DEFUN_ONCE([gl_BUILD_TO_HOST_PKGDATADIR], +[ + dnl Find the final value of pkgdatadir. + gl_saved_prefix="${prefix}" + gl_saved_datarootdir="${datarootdir}" + gl_saved_datadir="${datadir}" + gl_saved_pkgdatadir="${pkgdatadir}" + dnl Unfortunately, prefix gets only finally determined at the end of + dnl configure. + if test "X$prefix" = "XNONE"; then + prefix="$ac_default_prefix" + fi + eval datarootdir="$datarootdir" + eval datadir="$datadir" + eval pkgdatadir="$pkgdatadir" + gl_BUILD_TO_HOST([pkgdatadir]) + pkgdatadir="${gl_saved_pkgdatadir}" + datadir="${gl_saved_datadir}" + datarootdir="${gl_saved_datarootdir}" + prefix="${gl_saved_prefix}" +]) + +dnl Defines pkglibdir_c and pkglibdir_c_make, +dnl where pkglibdir = $(libdir)/$(PACKAGE) +AC_DEFUN_ONCE([gl_BUILD_TO_HOST_PKGLIBDIR], +[ + dnl Find the final value of pkglibdir. + gl_saved_prefix="${prefix}" + gl_saved_exec_prefix="${exec_prefix}" + gl_saved_libdir="${libdir}" + gl_saved_pkglibdir="${pkglibdir}" + dnl Unfortunately, prefix and exec_prefix get only finally determined + dnl at the end of configure. + if test "X$prefix" = "XNONE"; then + prefix="$ac_default_prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + exec_prefix='${prefix}' + fi + eval exec_prefix="$exec_prefix" + eval libdir="$libdir" + eval pkglibdir="$pkglibdir" + gl_BUILD_TO_HOST([pkglibdir]) + pkglibdir="${gl_saved_pkglibdir}" + libdir="${gl_saved_libdir}" + exec_prefix="${gl_saved_exec_prefix}" + prefix="${gl_saved_prefix}" +]) + +dnl Defines pkglibexecdir_c and pkglibexecdir_c_make, +dnl where pkglibexecdir = $(libexecdir)/$(PACKAGE) +AC_DEFUN_ONCE([gl_BUILD_TO_HOST_PKGLIBEXECDIR], +[ + dnl Find the final value of pkglibexecdir. + gl_saved_prefix="${prefix}" + gl_saved_exec_prefix="${exec_prefix}" + gl_saved_libexecdir="${libexecdir}" + gl_saved_pkglibexecdir="${pkglibexecdir}" + dnl Unfortunately, prefix and exec_prefix get only finally determined + dnl at the end of configure. + if test "X$prefix" = "XNONE"; then + prefix="$ac_default_prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + exec_prefix='${prefix}' + fi + eval exec_prefix="$exec_prefix" + eval libexecdir="$libexecdir" + eval pkglibexecdir="$pkglibexecdir" + gl_BUILD_TO_HOST([pkglibexecdir]) + pkglibexecdir="${gl_saved_pkglibexecdir}" + libexecdir="${gl_saved_libexecdir}" + exec_prefix="${gl_saved_exec_prefix}" + prefix="${gl_saved_prefix}" +]) diff --git a/miniconda3/share/gettext/m4/gettext.m4 b/miniconda3/share/gettext/m4/gettext.m4 new file mode 100644 index 0000000000000000000000000000000000000000..7de17f99c02c28a2950cc3dd1e565822f3b637a1 --- /dev/null +++ b/miniconda3/share/gettext/m4/gettext.m4 @@ -0,0 +1,393 @@ +# gettext.m4 +# serial 81 (gettext-0.24) +dnl Copyright (C) 1995-2025 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl This file is offered as-is, without any warranty. +dnl +dnl This file can be used in projects which are not available under +dnl the GNU General Public License or the GNU Lesser General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Lesser General Public License, and the rest of the GNU +dnl gettext package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995-2000. +dnl Bruno Haible , 2000-2024. + +dnl Macro to add for using GNU gettext. + +dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). +dnl INTLSYMBOL must be one of 'external', 'use-libtool', 'here'. +dnl INTLSYMBOL should be 'external' for packages other than GNU gettext. +dnl It should be 'use-libtool' for the packages 'gettext-runtime' and +dnl 'gettext-tools'. +dnl It should be 'here' for the package 'gettext-runtime/intl'. +dnl If INTLSYMBOL is 'here', then a libtool library +dnl $(top_builddir)/libintl.la will be created (shared and/or static, +dnl depending on --{enable,disable}-{shared,static} and on the presence of +dnl AM-DISABLE-SHARED). +dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext +dnl implementations (in libc or libintl) without the ngettext() function +dnl will be ignored. If NEEDSYMBOL is specified and is +dnl 'need-formatstring-macros', then GNU gettext implementations that don't +dnl support the ISO C 99 formatstring macros will be ignored. +dnl INTLDIR is used to find the intl libraries. If empty, +dnl the value '$(top_builddir)/intl/' is used. +dnl +dnl The result of the configuration is one of three cases: +dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled +dnl and used. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 2) GNU gettext has been found in the system's C library. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 3) No internationalization, always use English msgid. +dnl Catalog format: none +dnl Catalog extension: none +dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. +dnl The use of .gmo is historical (it was needed to avoid overwriting the +dnl GNU format catalogs when building on a platform with an X/Open gettext), +dnl but we keep it in order not to force irrelevant filename changes on the +dnl maintainers. +dnl +AC_DEFUN([AM_GNU_GETTEXT], +[ + dnl Argument checking. + m4_if([$1], [], , [m4_if([$1], [external], , [m4_if([$1], [use-libtool], , [m4_if([$1], [here], , + [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT +])])])])]) + m4_if(m4_if([$1], [], [old])[]m4_if([$1], [no-libtool], [old]), [old], + [errprint([ERROR: Use of AM_GNU_GETTEXT without [external] argument is no longer supported. +])]) + m4_if([$2], [], , [m4_if([$2], [need-ngettext], , [m4_if([$2], [need-formatstring-macros], , + [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT +])])])]) + define([gt_building_libintl_in_same_build_tree], + m4_if([$1], [use-libtool], [yes], [m4_if([$1], [here], [yes], [no])])) + gt_NEEDS_INIT + AM_GNU_GETTEXT_NEED([$2]) + + AC_REQUIRE([AM_PO_SUBDIRS])dnl + + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Sometimes libintl requires libiconv, so first search for libiconv. + dnl Ideally we would do this search only after the + dnl if test "$USE_NLS" = "yes"; then + dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + dnl tests. But if configure.ac invokes AM_ICONV after AM_GNU_GETTEXT + dnl the configure script would need to contain the same shell code + dnl again, outside any 'if'. There are two solutions: + dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. + dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. + dnl Since AC_PROVIDE_IFELSE is not documented, we avoid it. + m4_if(gt_building_libintl_in_same_build_tree, yes, , [ + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + ]) + + dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation. + gt_INTL_MACOSX + + dnl Set USE_NLS. + AC_REQUIRE([AM_NLS]) + + m4_if(gt_building_libintl_in_same_build_tree, yes, [ + USE_INCLUDED_LIBINTL=no + ]) + LIBINTL= + LTLIBINTL= + POSUB= + + dnl Add a version number to the cache macros. + case " $gt_needs " in + *" need-formatstring-macros "*) gt_api_version=3 ;; + *" need-ngettext "*) gt_api_version=2 ;; + *) gt_api_version=1 ;; + esac + gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" + gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" + + dnl If we use NLS figure out what method + if test "$USE_NLS" = "yes"; then + gt_use_preinstalled_gnugettext=no + m4_if(gt_building_libintl_in_same_build_tree, yes, [ + AC_MSG_CHECKING([whether included gettext is requested]) + AC_ARG_WITH([included-gettext], + [ --with-included-gettext use the GNU gettext library included here], + nls_cv_force_use_gnu_gettext=$withval, + nls_cv_force_use_gnu_gettext=no) + AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext]) + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + ]) + dnl User does not insist on using GNU NLS library. Figure out what + dnl to use. If GNU gettext is available we use this. Else we have + dnl to fall back to GNU NLS library. + + if test $gt_api_version -ge 3; then + gt_revision_test_code=' +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) +#endif +changequote(,)dnl +typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; +changequote([,])dnl +' + else + gt_revision_test_code= + fi + if test $gt_api_version -ge 2; then + gt_expression_test_code=' + * ngettext ("", "", 0)' + else + gt_expression_test_code= + fi + + AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], + [AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +extern int _nl_msg_cat_cntr; +extern int *_nl_domain_bindings; +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_domain_bindings) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION + ]])], + [eval "$gt_func_gnugettext_libc=yes"], + [eval "$gt_func_gnugettext_libc=no"])]) + + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then + dnl Sometimes libintl requires libiconv, so first search for libiconv. + m4_if(gt_building_libintl_in_same_build_tree, yes, , [ + AM_ICONV_LINK + ]) + dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL + dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) + dnl because that would add "-liconv" to LIBINTL and LTLIBINTL + dnl even if libiconv doesn't exist. + AC_LIB_LINKFLAGS_BODY([intl]) + AC_CACHE_CHECK([for GNU gettext in libintl], + [$gt_func_gnugettext_libintl], + [gt_saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $INCINTL" + gt_saved_LIBS="$LIBS" + LIBS="$LIBS $LIBINTL" + dnl Now see whether libintl exists and does not depend on libiconv. + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION + ]])], + [eval "$gt_func_gnugettext_libintl=yes"], + [eval "$gt_func_gnugettext_libintl=no"]) + dnl Now see whether libintl exists and depends on libiconv or other + dnl OS dependent libraries, specifically on macOS and AIX. + gt_LIBINTL_EXTRA="$INTL_MACOSX_LIBS" + AC_REQUIRE([AC_CANONICAL_HOST]) + case "$host_os" in + aix*) gt_LIBINTL_EXTRA="-lpthread" ;; + esac + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } \ + && { test -n "$LIBICONV" || test -n "$gt_LIBINTL_EXTRA"; }; then + LIBS="$LIBS $LIBICONV $gt_LIBINTL_EXTRA" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION +extern int _nl_msg_cat_cntr; +extern +#ifdef __cplusplus +"C" +#endif +const char *_nl_expand_alias (const char *); +#define __GNU_GETTEXT_SYMBOL_EXPRESSION (_nl_msg_cat_cntr + *_nl_expand_alias ("")) +#else +#define __GNU_GETTEXT_SYMBOL_EXPRESSION 0 +#endif +$gt_revision_test_code + ]], + [[ +bindtextdomain ("", ""); +return * gettext ("")$gt_expression_test_code + __GNU_GETTEXT_SYMBOL_EXPRESSION + ]])], + [LIBINTL="$LIBINTL $LIBICONV $gt_LIBINTL_EXTRA" + LTLIBINTL="$LTLIBINTL $LTLIBICONV $gt_LIBINTL_EXTRA" + eval "$gt_func_gnugettext_libintl=yes" + ]) + fi + CPPFLAGS="$gt_saved_CPPFLAGS" + LIBS="$gt_saved_LIBS"]) + fi + + dnl If an already present or preinstalled GNU gettext() is found, + dnl use it. But if this macro is used in GNU gettext, and GNU + dnl gettext is already preinstalled in libintl, we update this + dnl libintl. (Cf. the install rule in intl/Makefile.in.) + if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ + || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ + && test "$PACKAGE" != gettext-runtime \ + && test "$PACKAGE" != gettext-tools \ + && test "$PACKAGE" != libintl; }; then + gt_use_preinstalled_gnugettext=yes + else + dnl Reset the values set by searching for libintl. + LIBINTL= + LTLIBINTL= + INCINTL= + fi + + m4_if(gt_building_libintl_in_same_build_tree, yes, [ + if test "$gt_use_preinstalled_gnugettext" != "yes"; then + dnl GNU gettext is not found in the C library. + dnl Fall back on included GNU gettext library. + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions used to generate GNU NLS library. + USE_INCLUDED_LIBINTL=yes + LIBINTL="m4_if([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LIBICONV $LIBTHREAD" + LTLIBINTL="m4_if([$3],[],\${top_builddir}/intl,[$3])/libintl.la $LTLIBICONV $LTLIBTHREAD" + LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` + fi + + CATOBJEXT= + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions to use GNU gettext tools. + CATOBJEXT=.gmo + fi + ]) + + if test -n "$INTL_MACOSX_LIBS"; then + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Some extra flags are needed during linking. + LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" + LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" + fi + fi + + if test "$gt_use_preinstalled_gnugettext" = "yes" \ + || test "$nls_cv_use_gnu_gettext" = "yes"; then + AC_DEFINE([ENABLE_NLS], [1], + [Define to 1 if translation of program messages to the user's native language + is requested.]) + else + USE_NLS=no + fi + fi + + AC_MSG_CHECKING([whether to use NLS]) + AC_MSG_RESULT([$USE_NLS]) + if test "$USE_NLS" = "yes"; then + AC_MSG_CHECKING([where the gettext function comes from]) + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + gt_source="external libintl" + else + gt_source="libc" + fi + else + gt_source="included intl directory" + fi + AC_MSG_RESULT([$gt_source]) + fi + + if test "$USE_NLS" = "yes"; then + + if test "$gt_use_preinstalled_gnugettext" = "yes"; then + if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then + AC_MSG_CHECKING([how to link with libintl]) + AC_MSG_RESULT([$LIBINTL]) + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) + fi + + dnl For backward compatibility. Some packages may be using this. + AC_DEFINE([HAVE_GETTEXT], [1], + [Define if the GNU gettext() function is already present or preinstalled.]) + AC_DEFINE([HAVE_DCGETTEXT], [1], + [Define if the GNU dcgettext() function is already present or preinstalled.]) + fi + + dnl We need to process the po/ directory. + POSUB=po + fi + + m4_if(gt_building_libintl_in_same_build_tree, yes, [ + dnl Make all variables we use known to autoconf. + AC_SUBST([USE_INCLUDED_LIBINTL]) + AC_SUBST([CATOBJEXT]) + ]) + + m4_if(gt_building_libintl_in_same_build_tree, yes, [], [ + dnl For backward compatibility. Some Makefiles may be using this. + INTLLIBS="$LIBINTL" + AC_SUBST([INTLLIBS]) + ]) + + dnl Make all documented variables known to autoconf. + AC_SUBST([LIBINTL]) + AC_SUBST([LTLIBINTL]) + AC_SUBST([POSUB]) + + dnl Define localedir_c and localedir_c_make. + gl_BUILD_TO_HOST_LOCALEDIR +]) + + +dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. +m4_define([gt_NEEDS_INIT], +[ + m4_divert_text([DEFAULTS], [gt_needs=]) + m4_define([gt_NEEDS_INIT], []) +]) + + +dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) +AC_DEFUN([AM_GNU_GETTEXT_NEED], +[ + m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) +]) + + +dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) +AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) + + +dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version]) +AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], []) diff --git a/miniconda3/share/gettext/m4/host-cpu-c-abi.m4 b/miniconda3/share/gettext/m4/host-cpu-c-abi.m4 new file mode 100644 index 0000000000000000000000000000000000000000..6ca7721a326a7335a9fdc59e8677fe62f49c120a --- /dev/null +++ b/miniconda3/share/gettext/m4/host-cpu-c-abi.m4 @@ -0,0 +1,532 @@ +# host-cpu-c-abi.m4 +# serial 20 +dnl Copyright (C) 2002-2025 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl This file is offered as-is, without any warranty. + +dnl From Bruno Haible and Sam Steingold. + +dnl Sets the HOST_CPU variable to the canonical name of the CPU. +dnl Sets the HOST_CPU_C_ABI variable to the canonical name of the CPU with its +dnl C language ABI (application binary interface). +dnl Also defines __${HOST_CPU}__ and __${HOST_CPU_C_ABI}__ as C macros in +dnl config.h. +dnl +dnl This canonical name can be used to select a particular assembly language +dnl source file that will interoperate with C code on the given host. +dnl +dnl For example: +dnl * 'i386' and 'sparc' are different canonical names, because code for i386 +dnl will not run on SPARC CPUs and vice versa. They have different +dnl instruction sets. +dnl * 'sparc' and 'sparc64' are different canonical names, because code for +dnl 'sparc' and code for 'sparc64' cannot be linked together: 'sparc' code +dnl contains 32-bit instructions, whereas 'sparc64' code contains 64-bit +dnl instructions. A process on a SPARC CPU can be in 32-bit mode or in 64-bit +dnl mode, but not both. +dnl * 'mips' and 'mipsn32' are different canonical names, because they use +dnl different argument passing and return conventions for C functions, and +dnl although the instruction set of 'mips' is a large subset of the +dnl instruction set of 'mipsn32'. +dnl * 'mipsn32' and 'mips64' are different canonical names, because they use +dnl different sizes for the C types like 'int' and 'void *', and although +dnl the instruction sets of 'mipsn32' and 'mips64' are the same. +dnl * The same canonical name is used for different endiannesses. You can +dnl determine the endianness through preprocessor symbols: +dnl - 'arm': test __ARMEL__. +dnl - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL. +dnl - 'powerpc64': test __BIG_ENDIAN__ vs. __LITTLE_ENDIAN__. +dnl * The same name 'i386' is used for CPUs of type i386, i486, i586 +dnl (Pentium), AMD K7, Pentium II, Pentium IV, etc., because +dnl - Instructions that do not exist on all of these CPUs (cmpxchg, +dnl MMX, SSE, SSE2, 3DNow! etc.) are not frequently used. If your +dnl assembly language source files use such instructions, you will +dnl need to make the distinction. +dnl - Speed of execution of the common instruction set is reasonable across +dnl the entire family of CPUs. If you have assembly language source files +dnl that are optimized for particular CPU types (like GNU gmp has), you +dnl will need to make the distinction. +dnl See . +AC_DEFUN([gl_HOST_CPU_C_ABI], +[ + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_C_ASM]) + AC_CACHE_CHECK([host CPU and C ABI], [gl_cv_host_cpu_c_abi], + [case "$host_cpu" in + +changequote(,)dnl + i[34567]86 ) +changequote([,])dnl + gl_cv_host_cpu_c_abi=i386 + ;; + + x86_64 ) + # On x86_64 systems, the C compiler may be generating code in one of + # these ABIs: + # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64. + # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64 + # with native Windows (mingw, MSVC). + # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32. + # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if (defined __x86_64__ || defined __amd64__ \ + || defined _M_X64 || defined _M_AMD64) + int ok; + #else + error fail + #endif + ]])], + [AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __ILP32__ || defined _ILP32 + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=x86_64-x32], + [gl_cv_host_cpu_c_abi=x86_64])], + [gl_cv_host_cpu_c_abi=i386]) + ;; + +changequote(,)dnl + alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] ) +changequote([,])dnl + gl_cv_host_cpu_c_abi=alpha + ;; + + arm* | aarch64 ) + # Assume arm with EABI. + # On arm64 systems, the C compiler may be generating code in one of + # these ABIs: + # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64. + # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32. + # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#ifdef __aarch64__ + int ok; + #else + error fail + #endif + ]])], + [AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __ILP32__ || defined _ILP32 + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=arm64-ilp32], + [gl_cv_host_cpu_c_abi=arm64])], + [# Don't distinguish little-endian and big-endian arm, since they + # don't require different machine code for simple operations and + # since the user can distinguish them through the preprocessor + # defines __ARMEL__ vs. __ARMEB__. + # But distinguish arm which passes floating-point arguments and + # return values in integer registers (r0, r1, ...) - this is + # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which + # passes them in float registers (s0, s1, ...) and double registers + # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer + # sets the preprocessor defines __ARM_PCS (for the first case) and + # __ARM_PCS_VFP (for the second case), but older GCC does not. + echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c + # Look for a reference to the register d0 in the .s file. + AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1 + if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then + gl_cv_host_cpu_c_abi=armhf + else + gl_cv_host_cpu_c_abi=arm + fi + rm -fr conftest* + ]) + ;; + + hppa1.0 | hppa1.1 | hppa2.0* | hppa64 ) + # On hppa, the C compiler may be generating 32-bit code or 64-bit + # code. In the latter case, it defines _LP64 and __LP64__. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#ifdef __LP64__ + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=hppa64], + [gl_cv_host_cpu_c_abi=hppa]) + ;; + + ia64* ) + # On ia64 on HP-UX, the C compiler may be generating 64-bit code or + # 32-bit code. In the latter case, it defines _ILP32. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#ifdef _ILP32 + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=ia64-ilp32], + [gl_cv_host_cpu_c_abi=ia64]) + ;; + + mips* ) + # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this + # at 32. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64) + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=mips64], + [# In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but + # may later get defined by ), and _MIPS_SIM == _ABIN32. + # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but + # may later get defined by ), and _MIPS_SIM == _ABIO32. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if (_MIPS_SIM == _ABIN32) + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=mipsn32], + [gl_cv_host_cpu_c_abi=mips])]) + ;; + + powerpc* ) + # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD. + # No need to distinguish them here; the caller may distinguish + # them based on the OS. + # On powerpc64 systems, the C compiler may still be generating + # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may + # be generating 64-bit code. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __powerpc64__ || defined __LP64__ + int ok; + #else + error fail + #endif + ]])], + [# On powerpc64, there are two ABIs on Linux: The AIX compatible + # one and the ELFv2 one. The latter defines _CALL_ELF=2. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined _CALL_ELF && _CALL_ELF == 2 + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=powerpc64-elfv2], + [gl_cv_host_cpu_c_abi=powerpc64]) + ], + [gl_cv_host_cpu_c_abi=powerpc]) + ;; + + rs6000 ) + gl_cv_host_cpu_c_abi=powerpc + ;; + + riscv32 | riscv64 ) + # There are 2 architectures (with variants): rv32* and rv64*. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if __riscv_xlen == 64 + int ok; + #else + error fail + #endif + ]])], + [cpu=riscv64], + [cpu=riscv32]) + # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d. + # Size of 'long' and 'void *': + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __LP64__ + int ok; + #else + error fail + #endif + ]])], + [main_abi=lp64], + [main_abi=ilp32]) + # Float ABIs: + # __riscv_float_abi_double: + # 'float' and 'double' are passed in floating-point registers. + # __riscv_float_abi_single: + # 'float' are passed in floating-point registers. + # __riscv_float_abi_soft: + # No values are passed in floating-point registers. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __riscv_float_abi_double + int ok; + #else + error fail + #endif + ]])], + [float_abi=d], + [AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __riscv_float_abi_single + int ok; + #else + error fail + #endif + ]])], + [float_abi=f], + [float_abi='']) + ]) + gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}" + ;; + + s390* ) + # On s390x, the C compiler may be generating 64-bit (= s390x) code + # or 31-bit (= s390) code. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __LP64__ || defined __s390x__ + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=s390x], + [gl_cv_host_cpu_c_abi=s390]) + ;; + + sparc | sparc64 ) + # UltraSPARCs running Linux have `uname -m` = "sparc64", but the + # C compiler still generates 32-bit code. + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE( + [[#if defined __sparcv9 || defined __arch64__ + int ok; + #else + error fail + #endif + ]])], + [gl_cv_host_cpu_c_abi=sparc64], + [gl_cv_host_cpu_c_abi=sparc]) + ;; + + *) + gl_cv_host_cpu_c_abi="$host_cpu" + ;; + esac + ]) + + dnl In most cases, $HOST_CPU and $HOST_CPU_C_ABI are the same. + HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'` + HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi" + AC_SUBST([HOST_CPU]) + AC_SUBST([HOST_CPU_C_ABI]) + + # This was + # AC_DEFINE_UNQUOTED([__${HOST_CPU}__]) + # AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__]) + # earlier, but KAI C++ 3.2d doesn't like this. + sed -e 's/-/_/g' >> confdefs.h <. +dnl Don't make changes that are incompatible with that documentation! + +AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], +[ + dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + AC_REQUIRE([AC_LIB_RPATH]) + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_LIB_LINKFLAGS_BODY([iconv]) +]) + +AC_DEFUN([AM_ICONV_LINK], +[ + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and + dnl those with the standalone portable GNU libiconv installed). + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + + dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV + dnl accordingly. + AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) + + dnl Add $INCICONV to CPPFLAGS before performing the following checks, + dnl because if the user has installed libiconv and not disabled its use + dnl via --without-libiconv-prefix, he wants to use it. The first + dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed. + gl_saved_CPPFLAGS="$CPPFLAGS" + AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) + + AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [ + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + ]], + [[iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);]])], + [am_cv_func_iconv=yes]) + if test "$am_cv_func_iconv" != yes; then + gl_saved_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + ]], + [[iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);]])], + [am_cv_lib_iconv=yes] + [am_cv_func_iconv=yes]) + LIBS="$gl_saved_LIBS" + fi + ]) + if test "$am_cv_func_iconv" = yes; then + AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [ + dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11, + dnl Solaris 10, macOS 14.4. + gl_saved_LIBS="$LIBS" + if test $am_cv_lib_iconv = yes; then + LIBS="$LIBS $LIBICONV" + fi + am_cv_func_iconv_works=no + for ac_iconv_const in '' 'const'; do + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include + +#ifndef ICONV_CONST +# define ICONV_CONST $ac_iconv_const +#endif + ]], + [[int result = 0; + /* Test against AIX 5.1...7.2 bug: Failures are not distinguishable from + successful returns. This is even documented in + */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */ + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 1; + iconv_close (cd_utf8_to_88591); + } + } + /* Test against macOS 14.4 bug: Failures are not distinguishable from + successful returns. + POSIX:2018 says: "The iconv() function shall ... return the number of + non-identical conversions performed." + But here, the conversion always does transliteration (the suffixes + "//TRANSLIT" and "//IGNORE" have no effect, nor does iconvctl()) and + does not report when it does a non-identical conversion. */ + { + iconv_t cd_utf8_to_88591 = iconv_open ("ISO-8859-1", "UTF-8"); + if (cd_utf8_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\305\202"; /* LATIN SMALL LETTER L WITH STROKE */ + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_utf8_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + /* Here: + With glibc, GNU libiconv (including macOS up to 13): res == (size_t)-1, errno == EILSEQ. + With musl libc, NetBSD 10, Solaris 11: res == 1. + With macOS 14.4: res == 0, output is "l". */ + if (res == 0) + result |= 2; + iconv_close (cd_utf8_to_88591); + } + } + /* Test against Solaris 10 bug: Failures are not distinguishable from + successful returns. */ + { + iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646"); + if (cd_ascii_to_88591 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\263"; + char buf[10]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_ascii_to_88591, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res == 0) + result |= 4; + iconv_close (cd_ascii_to_88591); + } + } + /* Test against AIX 6.1..7.1 bug: Buffer overrun. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304"; + static char buf[2] = { (char)0xDE, (char)0xAD }; + ICONV_CONST char *inptr = input; + size_t inbytesleft = 1; + char *outptr = buf; + size_t outbytesleft = 1; + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD) + result |= 8; + iconv_close (cd_88591_to_utf8); + } + } +#if 0 /* This bug could be worked around by the caller. */ + /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ + { + iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); + if (cd_88591_to_utf8 != (iconv_t)(-1)) + { + static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; + char buf[50]; + ICONV_CONST char *inptr = input; + size_t inbytesleft = strlen (input); + char *outptr = buf; + size_t outbytesleft = sizeof (buf); + size_t res = iconv (cd_88591_to_utf8, + &inptr, &inbytesleft, + &outptr, &outbytesleft); + if ((int)res > 0) + result |= 16; + iconv_close (cd_88591_to_utf8); + } + } +#endif + /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is + provided. */ + { + /* Try standardized names. */ + iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP"); + /* Try IRIX, OSF/1 names. */ + iconv_t cd2 = iconv_open ("UTF-8", "eucJP"); + /* Try AIX names. */ + iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP"); + /* Try HP-UX names. */ + iconv_t cd4 = iconv_open ("utf8", "eucJP"); + if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1) + && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1)) + result |= 32; + if (cd1 != (iconv_t)(-1)) + iconv_close (cd1); + if (cd2 != (iconv_t)(-1)) + iconv_close (cd2); + if (cd3 != (iconv_t)(-1)) + iconv_close (cd3); + if (cd4 != (iconv_t)(-1)) + iconv_close (cd4); + } + return result; +]])], + [am_cv_func_iconv_works=yes], , + [case "$host_os" in + aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; + *) am_cv_func_iconv_works="guessing yes" ;; + esac]) + test "$am_cv_func_iconv_works" = no || break + done + LIBS="$gl_saved_LIBS" + ]) + case "$am_cv_func_iconv_works" in + *no) am_func_iconv=no am_cv_lib_iconv=no ;; + *) am_func_iconv=yes ;; + esac + else + am_func_iconv=no am_cv_lib_iconv=no + fi + if test "$am_func_iconv" = yes; then + AC_DEFINE([HAVE_ICONV], [1], + [Define if you have the iconv() function and it works.]) + fi + if test "$am_cv_lib_iconv" = yes; then + AC_MSG_CHECKING([how to link with libiconv]) + AC_MSG_RESULT([$LIBICONV]) + else + dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV + dnl either. + CPPFLAGS="$gl_saved_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + AC_SUBST([LIBICONV]) + AC_SUBST([LTLIBICONV]) +]) + +dnl Define AM_ICONV using AC_DEFUN_ONCE, in order to avoid warnings like +dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required". +AC_DEFUN_ONCE([AM_ICONV], +[ + AM_ICONV_LINK + if test "$am_cv_func_iconv" = yes; then + AC_CACHE_CHECK([whether iconv is compatible with its POSIX signature], + [gl_cv_iconv_nonconst], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[ +#include +#include +extern +#ifdef __cplusplus +"C" +#endif +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); + ]], + [[]])], + [gl_cv_iconv_nonconst=yes], + [gl_cv_iconv_nonconst=no]) + ]) + else + dnl When compiling GNU libiconv on a system that does not have iconv yet, + dnl pick the POSIX compliant declaration without 'const'. + gl_cv_iconv_nonconst=yes + fi + if test $gl_cv_iconv_nonconst = yes; then + iconv_arg1="" + else + iconv_arg1="const" + fi + AC_DEFINE_UNQUOTED([ICONV_CONST], [$iconv_arg1], + [Define as const if the declaration of iconv() needs const.]) + dnl Also substitute ICONV_CONST in the gnulib generated . + m4_ifdef([gl_ICONV_H_DEFAULTS], + [AC_REQUIRE([gl_ICONV_H_DEFAULTS]) + if test $gl_cv_iconv_nonconst != yes; then + ICONV_CONST="const" + fi + ]) + + dnl A summary result, for those packages which want to print a summary at the + dnl end of the configuration. + if test "$am_func_iconv" = yes; then + if test -n "$LIBICONV"; then + am_cv_func_iconv_summary='yes, in libiconv' + else + am_cv_func_iconv_summary='yes, in libc' + fi + else + if test "$am_cv_func_iconv" = yes; then + am_cv_func_iconv_summary='not working, consider installing GNU libiconv' + else + am_cv_func_iconv_summary='no, consider installing GNU libiconv' + fi + fi +]) diff --git a/miniconda3/share/gettext/m4/intlmacosx.m4 b/miniconda3/share/gettext/m4/intlmacosx.m4 new file mode 100644 index 0000000000000000000000000000000000000000..f0920d0ffc536ba550e3575560ed2c478ab69734 --- /dev/null +++ b/miniconda3/share/gettext/m4/intlmacosx.m4 @@ -0,0 +1,71 @@ +# intlmacosx.m4 +# serial 10 (gettext-0.23) +dnl Copyright (C) 2004-2014, 2016, 2019-2025 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl This file is offered as-is, without any warranty. +dnl +dnl This file can be used in projects which are not available under +dnl the GNU General Public License or the GNU Lesser General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Lesser General Public License, and the rest of the GNU +dnl gettext package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Checks for special options needed on Mac OS X. +dnl Defines INTL_MACOSX_LIBS. +AC_DEFUN([gt_INTL_MACOSX], +[ + dnl Check for API introduced in Mac OS X 10.4. + AC_CACHE_CHECK([for CFPreferencesCopyAppValue], + [gt_cv_func_CFPreferencesCopyAppValue], + [gt_saved_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[CFPreferencesCopyAppValue(NULL, NULL)]])], + [gt_cv_func_CFPreferencesCopyAppValue=yes], + [gt_cv_func_CFPreferencesCopyAppValue=no]) + LIBS="$gt_saved_LIBS"]) + if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then + AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], + [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) + fi + dnl Don't check for the API introduced in Mac OS X 10.5, CFLocaleCopyCurrent, + dnl because in macOS 10.13.4 it has the following behaviour: + dnl When two or more languages are specified in the + dnl "System Preferences > Language & Region > Preferred Languages" panel, + dnl it returns en_CC where CC is the territory (even when English is not among + dnl the preferred languages!). What we want instead is what + dnl CFLocaleCopyCurrent returned in earlier macOS releases and what + dnl CFPreferencesCopyAppValue still returns, namely ll_CC where ll is the + dnl first among the preferred languages and CC is the territory. + AC_CACHE_CHECK([for CFLocaleCopyPreferredLanguages], [gt_cv_func_CFLocaleCopyPreferredLanguages], + [gt_saved_LIBS="$LIBS" + LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[CFLocaleCopyPreferredLanguages();]])], + [gt_cv_func_CFLocaleCopyPreferredLanguages=yes], + [gt_cv_func_CFLocaleCopyPreferredLanguages=no]) + LIBS="$gt_saved_LIBS"]) + if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then + AC_DEFINE([HAVE_CFLOCALECOPYPREFERREDLANGUAGES], [1], + [Define to 1 if you have the Mac OS X function CFLocaleCopyPreferredLanguages in the CoreFoundation framework.]) + fi + INTL_MACOSX_LIBS= + if test $gt_cv_func_CFPreferencesCopyAppValue = yes \ + || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then + dnl Starting with macOS version 14, CoreFoundation relies on CoreServices, + dnl and we have to link it in explicitly, otherwise an exception + dnl NSInvalidArgumentException "unrecognized selector sent to instance" + dnl occurs. + INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation -Wl,-framework -Wl,CoreServices" + fi + AC_SUBST([INTL_MACOSX_LIBS]) +]) diff --git a/miniconda3/share/gettext/m4/lib-ld.m4 b/miniconda3/share/gettext/m4/lib-ld.m4 new file mode 100644 index 0000000000000000000000000000000000000000..3714b9ce741d9062e23597461d8ea4806f19bc25 --- /dev/null +++ b/miniconda3/share/gettext/m4/lib-ld.m4 @@ -0,0 +1,170 @@ +# lib-ld.m4 +# serial 13 +dnl Copyright (C) 1996-2003, 2009-2025 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl This file is offered as-is, without any warranty. + +dnl Subroutines of libtool.m4, +dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid +dnl collision with libtool.m4. + +dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. +AC_DEFUN([AC_LIB_PROG_LD_GNU], +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], +[# I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 /dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +if test -n "$LD"; then + AC_MSG_CHECKING([for ld]) +elif test "$GCC" = yes; then + AC_MSG_CHECKING([for ld used by $CC]) +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +if test -n "$LD"; then + # Let the user override the test with a path. + : +else + AC_CACHE_VAL([acl_cv_path_LD], + [ + acl_cv_path_LD= # Final result of this test + ac_prog=ld # Program to search in $PATH + if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + case $host in + *-*-mingw* | windows*) + # gcc leaves a trailing carriage return which upsets mingw + acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + acl_output=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $acl_output in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` + while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do + acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` + done + # Got the pathname. No search in PATH is needed. + acl_cv_path_LD="$acl_output" + ac_prog= + ;; + "") + # If it fails, then pretend we aren't using GCC. + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac + fi + if test -n "$ac_prog"; then + # Search for $ac_prog in $PATH. + acl_saved_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$acl_saved_IFS" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 conftest.sh + . ./conftest.sh + rm -f ./conftest.sh + acl_cv_rpath=done + ]) + wl="$acl_cv_wl" + acl_libext="$acl_cv_libext" + acl_shlibext="$acl_cv_shlibext" + acl_libname_spec="$acl_cv_libname_spec" + acl_library_names_spec="$acl_cv_library_names_spec" + acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" + acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" + acl_hardcode_direct="$acl_cv_hardcode_direct" + acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" + dnl Determine whether the user wants rpath handling at all. + AC_ARG_ENABLE([rpath], + [ --disable-rpath do not hardcode runtime library paths], + :, enable_rpath=yes) +]) + +dnl AC_LIB_FROMPACKAGE(name, package) +dnl declares that libname comes from the given package. The configure file +dnl will then not have a --with-libname-prefix option but a +dnl --with-package-prefix option. Several libraries can come from the same +dnl package. This declaration must occur before an AC_LIB_LINKFLAGS or similar +dnl macro call that searches for libname. +AC_DEFUN([AC_LIB_FROMPACKAGE], +[ + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + define([acl_frompackage_]NAME, [$2]) + popdef([NAME]) + pushdef([PACK],[$2]) + pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + define([acl_libsinpackage_]PACKUP, + m4_ifdef([acl_libsinpackage_]PACKUP, [m4_defn([acl_libsinpackage_]PACKUP)[[, ]]],)[lib$1]) + popdef([PACKUP]) + popdef([PACK]) +]) + +dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and +dnl the libraries corresponding to explicit and implicit dependencies. +dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. +dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found +dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. +AC_DEFUN([AC_LIB_LINKFLAGS_BODY], +[ + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + pushdef([NAME],[m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + pushdef([PACK],[m4_ifdef([acl_frompackage_]NAME, [acl_frompackage_]NAME, lib[$1])]) + pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-], + [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])]) + pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" + eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" + ]) + AC_ARG_WITH(PACK[-prefix], +[[ --with-]]PACK[[-prefix[=DIR] search for ]]PACKLIBS[[ in DIR/include and DIR/lib + --without-]]PACK[[-prefix don't search for ]]PACKLIBS[[ in includedir and libdir]], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" + eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + additional_libdir2="$withval/$acl_libdirstem2" + additional_libdir3="$withval/$acl_libdirstem3" + fi + fi +]) + if test "X$additional_libdir2" = "X$additional_libdir"; then + additional_libdir2= + fi + if test "X$additional_libdir3" = "X$additional_libdir"; then + additional_libdir3= + fi + dnl Search the library and its dependencies in $additional_libdir and + dnl $LDFLAGS. Use breadth-first search. + LIB[]NAME= + LTLIB[]NAME= + INC[]NAME= + LIB[]NAME[]_PREFIX= + dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been + dnl computed. So it has to be reset here. + HAVE_LIB[]NAME= + rpathdirs= + ltrpathdirs= + names_already_handled= + names_next_round='$1 $2' + while test -n "$names_next_round"; do + names_this_round="$names_next_round" + names_next_round= + for name in $names_this_round; do + already_handled= + for n in $names_already_handled; do + if test "$n" = "$name"; then + already_handled=yes + break + fi + done + if test -z "$already_handled"; then + names_already_handled="$names_already_handled $name" + dnl See if it was already located by an earlier AC_LIB_LINKFLAGS + dnl or AC_LIB_HAVE_LINKFLAGS call. + uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'` + eval value=\"\$HAVE_LIB$uppername\" + if test -n "$value"; then + if test "$value" = yes; then + eval value=\"\$LIB$uppername\" + test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" + eval value=\"\$LTLIB$uppername\" + test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" + else + dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined + dnl that this library doesn't exist. So just drop it. + : + fi + else + dnl Search the library lib$name in $additional_libdir and $LDFLAGS + dnl and the already constructed $LIBNAME/$LTLIBNAME. + found_dir= + found_la= + found_so= + found_a= + eval libname=\"$acl_libname_spec\" # typically: libname=lib$name + if test -n "$acl_shlibext"; then + shrext=".$acl_shlibext" # typically: shrext=.so + else + shrext= + fi + if test $use_additional = yes; then + for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do + if test "X$found_dir" = "X"; then + eval dir=\$$additional_libdir_variable + if test -n "$dir"; then + dnl The same code as in the loop below: + dnl First look for a shared library. + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + dnl Then look for a static library. + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + fi + fi + done + fi + if test "X$found_dir" = "X"; then + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + case "$x" in + -L*) + dir=`echo "X$x" | sed -e 's/^X-L//'` + dnl First look for a shared library. + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi + fi + dnl Then look for a static library. + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then + found_dir="$dir" + found_a="$dir/$libname.$acl_libext" + fi + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi + ;; + esac + if test "X$found_dir" != "X"; then + break + fi + done + fi + if test "X$found_dir" != "X"; then + dnl Found the library. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" + if test "X$found_so" != "X"; then + dnl Linking with a shared library. We attempt to hardcode its + dnl directory into the executable's runpath, unless it's the + dnl standard /usr/lib. + if test "$enable_rpath" = no \ + || test "X$found_dir" = "X/usr/$acl_libdirstem" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem2" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then + dnl No hardcoding is needed. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $found_dir" + fi + dnl The hardcoding into $LIBNAME is system dependent. + if test "$acl_hardcode_direct" = yes; then + dnl Using DIR/libNAME.so during linking hardcodes DIR into the + dnl resulting binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode DIR into the resulting + dnl binary. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $found_dir" + fi + else + dnl Rely on "-L$found_dir". + dnl But don't add it if it's already contained in the LDFLAGS + dnl or the already constructed $LIBNAME + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$found_dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" + fi + if test "$acl_hardcode_minus_L" != no; then + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" + else + dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH + dnl here, because this doesn't fit in flags passed to the + dnl compiler. So give up. No hardcoding. This affects only + dnl very old systems. + dnl FIXME: Not sure whether we should use + dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" + dnl here. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + fi + fi + fi + fi + else + if test "X$found_a" != "X"; then + dnl Linking with a static library. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" + else + dnl We shouldn't come here, but anyway it's good to have a + dnl fallback. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" + fi + fi + dnl Assume the include files are nearby. + additional_includedir= + case "$found_dir" in + */$acl_libdirstem | */$acl_libdirstem/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` + if test "$name" = '$1'; then + LIB[]NAME[]_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem2 | */$acl_libdirstem2/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'` + if test "$name" = '$1'; then + LIB[]NAME[]_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + */$acl_libdirstem3 | */$acl_libdirstem3/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'` + if test "$name" = '$1'; then + LIB[]NAME[]_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; + esac + if test "X$additional_includedir" != "X"; then + dnl Potentially add $additional_includedir to $INCNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's /usr/local/include and we are using GCC on Linux, + dnl 3. if it's already present in $CPPFLAGS or the already + dnl constructed $INCNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + for x in $CPPFLAGS $INC[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $INCNAME. + INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" + fi + fi + fi + fi + fi + dnl Look for dependencies. + if test -n "$found_la"; then + dnl Read the .la file. It defines the variables + dnl dlname, library_names, old_library, dependency_libs, current, + dnl age, revision, installed, dlopen, dlpreopen, libdir. + saved_libdir="$libdir" + case "$found_la" in + */* | *\\*) . "$found_la" ;; + *) . "./$found_la" ;; + esac + libdir="$saved_libdir" + dnl We use only dependency_libs. + for dep in $dependency_libs; do + case "$dep" in + -L*) + dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + dnl Potentially add $dependency_libdir to $LIBNAME and $LTLIBNAME. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's /usr/local/lib and we are using GCC on Linux, + dnl 3. if it's already present in $LDFLAGS or the already + dnl constructed $LIBNAME, + dnl 4. if it doesn't exist as a directory. + if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \ + && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then + haveit= + if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \ + || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + haveit= + for x in $LDFLAGS $LIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$dependency_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$dependency_libdir"; then + dnl Really add $dependency_libdir to $LIBNAME. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$dependency_libdir" + fi + fi + haveit= + for x in $LDFLAGS $LTLIB[]NAME; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$dependency_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test -d "$dependency_libdir"; then + dnl Really add $dependency_libdir to $LTLIBNAME. + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$dependency_libdir" + fi + fi + fi + fi + ;; + -R*) + dir=`echo "X$dep" | sed -e 's/^X-R//'` + if test "$enable_rpath" != no; then + dnl Potentially add DIR to rpathdirs. + dnl The rpathdirs will be appended to $LIBNAME at the end. + haveit= + for x in $rpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + rpathdirs="$rpathdirs $dir" + fi + dnl Potentially add DIR to ltrpathdirs. + dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. + haveit= + for x in $ltrpathdirs; do + if test "X$x" = "X$dir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + ltrpathdirs="$ltrpathdirs $dir" + fi + fi + ;; + -l*) + dnl Handle this in the next round. + dnl But on GNU systems, ignore -lc options, because + dnl - linking with libc is the default anyway, + dnl - linking with libc.a may produce an error + dnl "/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie" + dnl or may produce an executable that always crashes, see + dnl . + dep=`echo "X$dep" | sed -e 's/^X-l//'` + if test "X$dep" != Xc \ + || case $host_os in + linux* | gnu* | k*bsd*-gnu) false ;; + *) true ;; + esac; then + names_next_round="$names_next_round $dep" + fi + ;; + *.la) + dnl Handle this in the next round. Throw away the .la's + dnl directory; it is already contained in a preceding -L + dnl option. + names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` + ;; + *) + dnl Most likely an immediate library name. + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" + ;; + esac + done + fi + else + dnl Didn't find the library; assume it is in the system directories + dnl known to the linker and runtime loader. (All the system + dnl directories known to the linker should also be known to the + dnl runtime loader, otherwise the system is severely misconfigured.) + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" + fi + fi + fi + done + done + if test "X$rpathdirs" != "X"; then + if test -n "$acl_hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user must + dnl pass all path elements in one option. We can arrange that for a + dnl single library, but not when more than one $LIBNAMEs are used. + alldirs= + for found_dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" + done + dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. + acl_saved_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_saved_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + else + dnl The -rpath options are cumulative. + for found_dir in $rpathdirs; do + acl_saved_libdir="$libdir" + libdir="$found_dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_saved_libdir" + LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" + done + fi + fi + if test "X$ltrpathdirs" != "X"; then + dnl When using libtool, the option that works for both libraries and + dnl executables is -R. The -R options are cumulative. + for found_dir in $ltrpathdirs; do + LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" + done + fi + popdef([PACKLIBS]) + popdef([PACKUP]) + popdef([PACK]) + popdef([NAME]) +]) + +dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, +dnl unless already present in VAR. +dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes +dnl contains two or three consecutive elements that belong together. +AC_DEFUN([AC_LIB_APPENDTOVAR], +[ + for element in [$2]; do + haveit= + for x in $[$1]; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + [$1]="${[$1]}${[$1]:+ }$element" + fi + done +]) + +dnl For those cases where a variable contains several -L and -l options +dnl referring to unknown libraries and directories, this macro determines the +dnl necessary additional linker options for the runtime path. +dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) +dnl sets LDADDVAR to linker options needed together with LIBSVALUE. +dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, +dnl otherwise linking without libtool is assumed. +AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], +[ + AC_REQUIRE([AC_LIB_RPATH]) + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + $1= + if test "$enable_rpath" != no; then + if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then + dnl Use an explicit option to hardcode directories into the resulting + dnl binary. + rpathdirs= + next= + for opt in $2; do + if test -n "$next"; then + dir="$next" + dnl No need to hardcode the standard /usr/lib. + if test "X$dir" != "X/usr/$acl_libdirstem" \ + && test "X$dir" != "X/usr/$acl_libdirstem2" \ + && test "X$dir" != "X/usr/$acl_libdirstem3"; then + rpathdirs="$rpathdirs $dir" + fi + next= + else + case $opt in + -L) next=yes ;; + -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` + dnl No need to hardcode the standard /usr/lib. + if test "X$dir" != "X/usr/$acl_libdirstem" \ + && test "X$dir" != "X/usr/$acl_libdirstem2" \ + && test "X$dir" != "X/usr/$acl_libdirstem3"; then + rpathdirs="$rpathdirs $dir" + fi + next= ;; + *) next= ;; + esac + fi + done + if test "X$rpathdirs" != "X"; then + if test -n ""$3""; then + dnl libtool is used for linking. Use -R options. + for dir in $rpathdirs; do + $1="${$1}${$1:+ }-R$dir" + done + else + dnl The linker is used for linking directly. + if test -n "$acl_hardcode_libdir_separator"; then + dnl Weird platform: only the last -rpath option counts, the user + dnl must pass all path elements in one option. + alldirs= + for dir in $rpathdirs; do + alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" + done + acl_saved_libdir="$libdir" + libdir="$alldirs" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_saved_libdir" + $1="$flag" + else + dnl The -rpath options are cumulative. + for dir in $rpathdirs; do + acl_saved_libdir="$libdir" + libdir="$dir" + eval flag=\"$acl_hardcode_libdir_flag_spec\" + libdir="$acl_saved_libdir" + $1="${$1}${$1:+ }$flag" + done + fi + fi + fi + fi + fi + AC_SUBST([$1]) +]) diff --git a/miniconda3/share/gettext/m4/lib-prefix.m4 b/miniconda3/share/gettext/m4/lib-prefix.m4 new file mode 100644 index 0000000000000000000000000000000000000000..29283534f3fc0e062f872d9f7a6e935223e98903 --- /dev/null +++ b/miniconda3/share/gettext/m4/lib-prefix.m4 @@ -0,0 +1,334 @@ +# lib-prefix.m4 +# serial 23 +dnl Copyright (C) 2001-2005, 2008-2025 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl This file is offered as-is, without any warranty. + +dnl From Bruno Haible. + +dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed +dnl to access previously installed libraries. The basic assumption is that +dnl a user will want packages to use other packages he previously installed +dnl with the same --prefix option. +dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate +dnl libraries, but is otherwise very convenient. +AC_DEFUN([AC_LIB_PREFIX], +[ + AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) + AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) + dnl By default, look in $includedir and $libdir. + use_additional=yes + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + AC_ARG_WITH([lib-prefix], +[[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib + --without-lib-prefix don't search for libraries in includedir and libdir]], +[ + if test "X$withval" = "Xno"; then + use_additional=no + else + if test "X$withval" = "X"; then + AC_LIB_WITH_FINAL_PREFIX([ + eval additional_includedir=\"$includedir\" + eval additional_libdir=\"$libdir\" + ]) + else + additional_includedir="$withval/include" + additional_libdir="$withval/$acl_libdirstem" + fi + fi +]) + if test $use_additional = yes; then + dnl Potentially add $additional_includedir to $CPPFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/include, + dnl 2. if it's already present in $CPPFLAGS, + dnl 3. if it's /usr/local/include and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_includedir" != "X/usr/include"; then + haveit= + for x in $CPPFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-I$additional_includedir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_includedir" = "X/usr/local/include"; then + if test -n "$GCC"; then + case $host_os in + linux* | gnu* | k*bsd*-gnu) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_includedir"; then + dnl Really add $additional_includedir to $CPPFLAGS. + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" + fi + fi + fi + fi + dnl Potentially add $additional_libdir to $LDFLAGS. + dnl But don't add it + dnl 1. if it's the standard /usr/lib, + dnl 2. if it's already present in $LDFLAGS, + dnl 3. if it's /usr/local/lib and we are using GCC on Linux, + dnl 4. if it doesn't exist as a directory. + if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then + haveit= + for x in $LDFLAGS; do + AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) + if test "X$x" = "X-L$additional_libdir"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then + if test -n "$GCC"; then + case $host_os in + linux*) haveit=yes;; + esac + fi + fi + if test -z "$haveit"; then + if test -d "$additional_libdir"; then + dnl Really add $additional_libdir to $LDFLAGS. + LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" + fi + fi + fi + fi + fi +]) + +dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, +dnl acl_final_exec_prefix, containing the values to which $prefix and +dnl $exec_prefix will expand at the end of the configure script. +AC_DEFUN([AC_LIB_PREPARE_PREFIX], +[ + dnl Unfortunately, prefix and exec_prefix get only finally determined + dnl at the end of configure. + if test "X$prefix" = "XNONE"; then + acl_final_prefix="$ac_default_prefix" + else + acl_final_prefix="$prefix" + fi + if test "X$exec_prefix" = "XNONE"; then + acl_final_exec_prefix='${prefix}' + else + acl_final_exec_prefix="$exec_prefix" + fi + acl_saved_prefix="$prefix" + prefix="$acl_final_prefix" + eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" + prefix="$acl_saved_prefix" +]) + +dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the +dnl variables prefix and exec_prefix bound to the values they will have +dnl at the end of the configure script. +AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], +[ + acl_saved_prefix="$prefix" + prefix="$acl_final_prefix" + acl_saved_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + $1 + exec_prefix="$acl_saved_exec_prefix" + prefix="$acl_saved_prefix" +]) + +dnl AC_LIB_PREPARE_MULTILIB creates +dnl - a function acl_is_expected_elfclass, that tests whether standard input +dn; has a 32-bit or 64-bit ELF header, depending on the host CPU ABI, +dnl - 3 variables acl_libdirstem, acl_libdirstem2, acl_libdirstem3, containing +dnl the basename of the libdir to try in turn, either "lib" or "lib64" or +dnl "lib/64" or "lib32" or "lib/sparcv9" or "lib/amd64" or similar. +AC_DEFUN([AC_LIB_PREPARE_MULTILIB], +[ + dnl There is no formal standard regarding lib, lib32, and lib64. + dnl On most glibc systems, the current practice is that on a system supporting + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under + dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. However, on + dnl Arch Linux based distributions, it's the opposite: 32-bit libraries go + dnl under $prefix/lib32 and 64-bit libraries go under $prefix/lib. + dnl We determine the compiler's default mode by looking at the compiler's + dnl library search path. If at least one of its elements ends in /lib64 or + dnl points to a directory whose absolute pathname ends in /lib64, we use that + dnl for 64-bit ABIs. Similarly for 32-bit ABIs. Otherwise we use the default, + dnl namely "lib". + dnl On Solaris systems, the current practice is that on a system supporting + dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under + dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or + dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib. + AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT]) + + AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf], + [AC_EGREP_CPP([Extensible Linking Format], + [#if defined __ELF__ || (defined __linux__ && (defined __EDG__ || defined __SUNPRO_C)) + Extensible Linking Format + #endif + ], + [gl_cv_elf=yes], + [gl_cv_elf=no]) + ]) + if test $gl_cv_elf = yes; then + # Extract the ELF class of a file (5th byte) in decimal. + # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header + if od -A x < /dev/null >/dev/null 2>/dev/null; then + # Use POSIX od. + func_elfclass () + { + od -A n -t d1 -j 4 -N 1 + } + else + # Use BSD hexdump. + func_elfclass () + { + dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "' + echo + } + fi + # Use 'expr', not 'test', to compare the values of func_elfclass, because on + # Solaris 11 OpenIndiana and Solaris 11 OmniOS, the result is 001 or 002, + # not 1 or 2. +changequote(,)dnl + case $HOST_CPU_C_ABI_32BIT in + yes) + # 32-bit ABI. + acl_is_expected_elfclass () + { + expr "`func_elfclass | sed -e 's/[ ]//g'`" = 1 > /dev/null + } + ;; + no) + # 64-bit ABI. + acl_is_expected_elfclass () + { + expr "`func_elfclass | sed -e 's/[ ]//g'`" = 2 > /dev/null + } + ;; + *) + # Unknown. + acl_is_expected_elfclass () + { + : + } + ;; + esac +changequote([,])dnl + else + acl_is_expected_elfclass () + { + : + } + fi + + dnl Allow the user to override the result by setting acl_cv_libdirstems. + AC_CACHE_CHECK([for the common suffixes of directories in the library search path], + [acl_cv_libdirstems], + [dnl Try 'lib' first, because that's the default for libdir in GNU, see + dnl . + acl_libdirstem=lib + acl_libdirstem2= + acl_libdirstem3= + case "$host_os" in + solaris*) + dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment + dnl . + dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link." + dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the + dnl symlink is missing, so we set acl_libdirstem2 too. + if test $HOST_CPU_C_ABI_32BIT = no; then + acl_libdirstem2=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem3=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem3=lib/amd64 ;; + esac + fi + ;; + netbsd*) + dnl On NetBSD/sparc64, there is a 'sparc' subdirectory that contains + dnl 32-bit libraries. + if test $HOST_CPU_C_ABI_32BIT != no; then + case "$host_cpu" in + sparc*) acl_libdirstem2=lib/sparc ;; + esac + fi + ;; + *) + dnl If $CC generates code for a 32-bit ABI, the libraries are + dnl surely under $prefix/lib or $prefix/lib32, not $prefix/lib64. + dnl Similarly, if $CC generates code for a 64-bit ABI, the libraries + dnl are surely under $prefix/lib or $prefix/lib64, not $prefix/lib32. + dnl Find the compiler's search path. However, non-system compilers + dnl sometimes have odd library search paths. But we can't simply invoke + dnl '/usr/bin/gcc -print-search-dirs' because that would not take into + dnl account the -m32/-m31 or -m64 options from the $CC or $CFLAGS. + searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \ + | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test $HOST_CPU_C_ABI_32BIT != no; then + # 32-bit or unknown ABI. + if test -d /usr/lib32; then + acl_libdirstem2=lib32 + fi + fi + if test $HOST_CPU_C_ABI_32BIT != yes; then + # 64-bit or unknown ABI. + if test -d /usr/lib64; then + acl_libdirstem3=lib64 + fi + fi + if test -n "$searchpath"; then + acl_saved_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;; + */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib32 ) acl_libdirstem2=lib32 ;; + */lib64 ) acl_libdirstem3=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_saved_IFS" + if test $HOST_CPU_C_ABI_32BIT = yes; then + # 32-bit ABI. + acl_libdirstem3= + fi + if test $HOST_CPU_C_ABI_32BIT = no; then + # 64-bit ABI. + acl_libdirstem2= + fi + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem" + acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3" + ]) + dnl Decompose acl_cv_libdirstems into acl_libdirstem, acl_libdirstem2, and + dnl acl_libdirstem3. +changequote(,)dnl + acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` + acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'` + acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'` +changequote([,])dnl +]) diff --git a/miniconda3/share/gettext/m4/nls.m4 b/miniconda3/share/gettext/m4/nls.m4 new file mode 100644 index 0000000000000000000000000000000000000000..c4601415bb5589537a6e2e8816e5383536ca6e4c --- /dev/null +++ b/miniconda3/share/gettext/m4/nls.m4 @@ -0,0 +1,33 @@ +# nls.m4 +# serial 6 (gettext-0.24) +dnl Copyright (C) 1995-2025 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl This file is offered as-is, without any warranty. +dnl +dnl This file can be used in projects which are not available under +dnl the GNU General Public License or the GNU Lesser General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Lesser General Public License, and the rest of the GNU +dnl gettext package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995-2000. +dnl Bruno Haible , 2000-2003. + +AC_PREREQ([2.50]) + +AC_DEFUN([AM_NLS], +[ + AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE([nls], + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT([$USE_NLS]) + AC_SUBST([USE_NLS]) +]) diff --git a/miniconda3/share/gettext/m4/po.m4 b/miniconda3/share/gettext/m4/po.m4 new file mode 100644 index 0000000000000000000000000000000000000000..73e0436bd72f3110892b9a30cf6bdbd7862cf891 --- /dev/null +++ b/miniconda3/share/gettext/m4/po.m4 @@ -0,0 +1,157 @@ +# po.m4 +# serial 34 (gettext-0.24) +dnl Copyright (C) 1995-2024 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl This file is offered as-is, without any warranty. +dnl +dnl This file can be used in projects which are not available under +dnl the GNU General Public License or the GNU Lesser General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Lesser General Public License, and the rest of the GNU +dnl gettext package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1995-2000. +dnl Bruno Haible , 2000-2024. + +AC_PREREQ([2.60]) + +dnl Checks for all prerequisites of the po subdirectory. +AC_DEFUN([AM_PO_SUBDIRS], +[ + AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_INSTALL])dnl + AC_REQUIRE([AC_PROG_MKDIR_P])dnl + AC_REQUIRE([AC_PROG_SED])dnl + AC_REQUIRE([AM_NLS])dnl + + dnl Release version of the gettext macros. This is used to ensure that + dnl the gettext macros and po/Makefile.in.in are in sync. + AC_SUBST([GETTEXT_MACRO_VERSION], [0.24]) + + dnl Perform the following tests also if --disable-nls has been given, + dnl because they are needed for "make dist" to work. + + dnl Search for GNU msgfmt in the PATH. + dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions. + dnl The second test excludes FreeBSD msgfmt. + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && + (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT]) + + dnl Test whether it is GNU msgfmt >= 0.15. +changequote(,)dnl + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; + *) GMSGFMT_015=$GMSGFMT ;; + esac +changequote([,])dnl + AC_SUBST([GMSGFMT_015]) + + dnl Search for GNU xgettext 0.12 or newer in the PATH. + dnl The first test excludes Solaris xgettext and early GNU xgettext versions. + dnl The second test excludes FreeBSD xgettext. + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 && + (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)], + :) + dnl Remove leftover from FreeBSD xgettext call. + rm -f messages.po + + dnl Test whether it is GNU xgettext >= 0.15. +changequote(,)dnl + case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;; + *) XGETTEXT_015=$XGETTEXT ;; + esac +changequote([,])dnl + AC_SUBST([XGETTEXT_015]) + + dnl Search for GNU msgmerge 0.11 or newer in the PATH. + AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge, + [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :) + + dnl Test whether it is GNU msgmerge >= 0.20. + if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then + MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt' + else + dnl Test whether it is GNU msgmerge >= 0.12. + if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then + MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet' + else + dnl With these old versions, $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) is + dnl slow. But this is not a big problem, as such old gettext versions are + dnl hardly in use any more. + MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet' + fi + fi + AC_SUBST([MSGMERGE_FOR_MSGFMT_OPTION]) + + dnl Support for AM_XGETTEXT_OPTION. + test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= + AC_SUBST([XGETTEXT_EXTRA_OPTIONS]) + + if test -n "$ALL_LINGUAS"; then + test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" + fi + + dnl Capture the value of LINGUAS because we need it to compute CATALOGS. + dnl In the Makefile, call it DESIRED_LINGUAS (because there, LINGUAS denotes + dnl the set of available translations, given by the developer). + DESIRED_LINGUAS="${LINGUAS-\$(ALL_LINGUAS)}" + AC_SUBST([DESIRED_LINGUAS]) + + AC_CONFIG_COMMANDS([po-directories], [[ + for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'` + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + # Treat a directory as a PO directory if and only if it has a + # POTFILES.in file. This allows packages to have multiple PO + # directories under different names or in different locations. + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + cat "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + fi + ;; + esac + done]], + []) +]) + +dnl Postprocesses a Makefile in a directory containing PO files. +AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE], +[ + sed -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp" + mv "$ac_file.tmp" "$ac_file" +]) + +dnl Initializes the accumulator used by AM_XGETTEXT_OPTION. +AC_DEFUN([AM_XGETTEXT_OPTION_INIT], +[ + XGETTEXT_EXTRA_OPTIONS= +]) + +dnl Registers an option to be passed to xgettext in the po subdirectory. +AC_DEFUN([AM_XGETTEXT_OPTION], +[ + AC_REQUIRE([AM_XGETTEXT_OPTION_INIT]) + XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1" +]) diff --git a/miniconda3/share/gettext/m4/progtest.m4 b/miniconda3/share/gettext/m4/progtest.m4 new file mode 100644 index 0000000000000000000000000000000000000000..2671eb856edf706e3bb861607a07da24cf91be2b --- /dev/null +++ b/miniconda3/share/gettext/m4/progtest.m4 @@ -0,0 +1,93 @@ +# progtest.m4 +# serial 10 (gettext-0.24) +dnl Copyright (C) 1996-2025 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. +dnl This file is offered as-is, without any warranty. +dnl +dnl This file can be used in projects which are not available under +dnl the GNU General Public License or the GNU Lesser General Public +dnl License but which still want to provide support for the GNU gettext +dnl functionality. +dnl Please note that the actual code of the GNU gettext library is covered +dnl by the GNU Lesser General Public License, and the rest of the GNU +dnl gettext package is covered by the GNU General Public License. +dnl They are *not* in the public domain. + +dnl Authors: +dnl Ulrich Drepper , 1996. + +AC_PREREQ([2.53]) + +# Search path for a program which passes the given test. + +dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN([AM_PATH_PROG_WITH_TEST], +[ +# Prepare PATH_SEPARATOR. +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which + # contains only /bin. Note that ksh looks also at the FPATH variable, + # so we have to set that as well for the test. + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \ + || PATH_SEPARATOR=';' + } +fi + +# Find out how to test for executable files. Don't use a zero-byte file, +# as systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + ac_executable_p="test -x" +else + ac_executable_p="test -f" +fi +rm -f conf$$.file + +# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL([ac_cv_path_$1], +[case "[$]$1" in + [[\\/]]* | ?:[[\\/]]*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + gt_saved_IFS="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in m4_if([$5], , $PATH, [$5]); do + IFS="$gt_saved_IFS" + test -z "$ac_dir" && ac_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then + echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext" + break 2 + fi + fi + done + done + IFS="$gt_saved_IFS" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +m4_if([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test m4_if([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then + AC_MSG_RESULT([$][$1]) +else + AC_MSG_RESULT([no]) +fi +AC_SUBST([$1])dnl +]) diff --git a/miniconda3/share/gettext/msgunfmt.tcl b/miniconda3/share/gettext/msgunfmt.tcl new file mode 100644 index 0000000000000000000000000000000000000000..ef32112478d07bc08a785f74c4eac715eeb36c22 --- /dev/null +++ b/miniconda3/share/gettext/msgunfmt.tcl @@ -0,0 +1,82 @@ +# Reading tcl/msgcat .msg files. +# Copyright (C) 2002-2024 Free Software Foundation, Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +namespace eval msgcat { + namespace export mcset mcdump + variable header "" +} + +proc msgcat::puts_po_string {str} { + # Replace " with \" + regsub -all "\"" $str "\\\"" str + # Replace \ with \\ + regsub -all "\\\\" $str "\\\\\\" str + # Replace newline with \n + regsub -all [subst "\n"] $str "\\n" str + regsub -all [subst "\a"] $str "\\a" str + regsub -all [subst "\b"] $str "\\b" str + regsub -all [subst "\f"] $str "\\f" str + regsub -all [subst "\r"] $str "\\r" str + regsub -all [subst "\t"] $str "\\t" str + regsub -all [subst "\v"] $str "\\v" str + # Output it. + puts -nonewline "\"$str\"" +} + +proc msgcat::write_po_message {msgid msgstr} { + puts -nonewline "msgid " + puts_po_string $msgid + puts "" + puts -nonewline "msgstr " + puts_po_string $msgstr + puts "" + puts "" +} + +# This gets called once for each message in the .msg catalog. +proc msgcat::mcset {locale src {dest ""}} { + msgcat::write_po_message $src $dest +} + +# Main function. +proc msgcat::mcdump {langfile} { + if {[file exists $langfile]} { + # msgunfmt expects the output in UTF-8 encoding. + fconfigure stdout -encoding utf-8 + + set ::msgcat::header "" + + set fd [open $langfile r] + # In newer tcl versions, the .msg files are in UTF-8 encoding. + fconfigure $fd -encoding utf-8 + eval [read $fd] + close $fd + + if {$::msgcat::header == ""} { + # Provide a minimal header. + set ::msgcat::header [subst "MIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n"] + } + msgcat::write_po_message "" $::msgcat::header + } else { + # Tell msgunfmt to emit an internationalized error message. + exit 2 + } +} + +# Main code: call the main function on the first and only argument. +msgcat::mcdump [lindex $argv 0] + +exit 0 diff --git a/miniconda3/share/gettext/po/Makefile.in.in b/miniconda3/share/gettext/po/Makefile.in.in new file mode 100644 index 0000000000000000000000000000000000000000..4651c6a9ce092189cd14269badc8215a5454c877 --- /dev/null +++ b/miniconda3/share/gettext/po/Makefile.in.in @@ -0,0 +1,580 @@ +# Makefile for PO directory in any package using GNU gettext. +# Copyright (C) 1995-2000 Ulrich Drepper +# Copyright (C) 2000-2025 Free Software Foundation, Inc. +# +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without any warranty. +# +# Origin: gettext-0.25 +GETTEXT_MACRO_VERSION = 0.24 + +# This Makefile makes use of the variable assignment operator != standardized +# by POSIX:2024 +# . +# It thus requires a 'make' implementation that supports this operator !=. +# As of 2024, these are: GNU make >= 4.0, FreeBSD make, NetBSD make, +# OpenBSD make. This means that building on specific platforms requires +# use of GNU make: +# - On macOS, use /opt/homebrew/bin/gmake. +# - On Solaris 11 OpenIndiana, use /usr/bin/gmake = /usr/gnu/bin/make. +# - On Solaris 11.4, install GNU make yourself. +# - On AIX, use /opt/freeware/bin/make. + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ + +SED = @SED@ +SHELL = /bin/sh +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datarootdir = @datarootdir@ +datadir = @datadir@ +localedir = @localedir@ +gettextsrcdir = $(datadir)/gettext/po + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ + +# We use $(mkdir_p). +# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as +# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, +# @install_sh@ does not start with $(SHELL), so we add it. +# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined +# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake +# versions, $(mkinstalldirs) and $(install_sh) are unused. +mkinstalldirs = $(SHELL) @install_sh@ -d +install_sh = $(SHELL) @install_sh@ +MKDIR_P = @MKDIR_P@ +mkdir_p = @mkdir_p@ + +# When building gettext-tools, we prefer to use the built programs +# rather than installed programs. However, we can't do that when we +# are cross compiling. +CROSS_COMPILING = @CROSS_COMPILING@ + +GMSGFMT_ = @GMSGFMT@ +GMSGFMT_no = @GMSGFMT@ +GMSGFMT_yes = @GMSGFMT_015@ +GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) +XGETTEXT_ = @XGETTEXT@ +XGETTEXT_no = @XGETTEXT@ +XGETTEXT_yes = @XGETTEXT_015@ +XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) +MSGMERGE = @MSGMERGE@ +MSGMERGE_UPDATE = @MSGMERGE@ --update +MSGMERGE_FOR_MSGFMT_OPTION = @MSGMERGE_FOR_MSGFMT_OPTION@ +MSGINIT = msginit +MSGCONV = msgconv +MSGFILTER = msgfilter + +# The list of files which contain translatable strings. +POTFILES != sed -e '/^\#/d' < $(srcdir)/POTFILES.in +# This is computed as $(foreach file, $(POTFILES), $(top_srcdir)/$(file)) +POTFILES_DEPS != for file in $(POTFILES); do echo $(top_srcdir)/$$file; done + +# The set of available translations. +ALL_LINGUAS != if test -f $(srcdir)/LINGUAS; then \ + sed -e '/^\#/d' < $(srcdir)/LINGUAS; \ + else \ + echo $(LINGUAS); \ + fi +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) +POFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.po; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo) +GMOFILES != for lang in $(ALL_LINGUAS); do echo $(srcdir)/$$lang.gmo; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).po-update) +UPDATEPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.po-update; done +# This is computed as $(foreach lang, $(ALL_LINGUAS), $(lang).nop) +DUMMYPOFILES != for lang in $(ALL_LINGUAS); do echo $$lang.nop; done + +DISTFILES.common = \ + Makefile.in.in remove-potcdate.sed \ + $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) \ + $(DISTFILES.common.extra3) $(DISTFILES.common.extra4) \ + $(DISTFILES.common.extra5) $(DISTFILES.common.extra6) +DISTFILES = \ + $(DISTFILES.common) \ + Makevars POTFILES.in \ + $(POFILES) $(GMOFILES) \ + $(DISTFILES.extra1) $(DISTFILES.extra2) \ + $(DISTFILES.extra3) $(DISTFILES.extra4) \ + $(DISTFILES.extra5) $(DISTFILES.extra6) + +# The set of desired translations, as specified by the installer or distributor. +DESIRED_LINGUAS = @DESIRED_LINGUAS@ +# The set of translations to install. This is computed based on $(ALL_LINGUAS) +# and $(DESIRED_LINGUAS). It is a subset of $(ALL_LINGUAS). +# We use the presentlang catalog if desiredlang is +# a. equal to presentlang, or +# b. a variant of presentlang (because in this case, presentlang can be used +# as a fallback for messages which are not translated in the desiredlang +# catalog). +INST_LINGUAS != for presentlang in $(ALL_LINGUAS); do \ + useit=false; \ + for desiredlang in $(DESIRED_LINGUAS); do \ + case "$$desiredlang" in \ + "$$presentlang" | "$$presentlang"_* | "$$presentlang".* | "$$presentlang"@*) \ + useit=true ;; \ + esac; \ + done; \ + if $$useit; then echo $$presentlang; fi; \ + done +# This is computed as $(foreach lang, $(INST_LINGUAS), $(lang).gmo) +CATALOGS != for lang in $(INST_LINGUAS); do echo $$lang.gmo; done + +POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot +POFILESDEPS_yes = $(POFILESDEPS_) +POFILESDEPS_no = +POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT)) + +DISTFILESDEPS_ = update-po +DISTFILESDEPS_yes = $(DISTFILESDEPS_) +DISTFILESDEPS_no = +DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO)) + +# Include the customization of this po/ directory. +include $(srcdir)/Makevars + +all: all-@USE_NLS@ + + +.SUFFIXES: +.SUFFIXES: .po .gmo .nop .po-create .po-update + +# The .pot file, stamp-po, .po files, and .gmo files appear in release tarballs. +# The GNU Coding Standards say in +# : +# "GNU distributions usually contain some files which are not source files +# ... . Since these files normally appear in the source directory, they +# should always appear in the source directory, not in the build directory. +# So Makefile rules to update them should put the updated files in the +# source directory." +# Therefore we put these files in the source directory, not the build directory. + +# During .po -> .gmo conversion, take into account the most recent changes to +# the .pot file. This eliminates the need to update the .po files when the +# .pot file has changed, which would be troublesome if the .po files are put +# under version control. +$(GMOFILES): $(srcdir)/$(DOMAIN).pot +.po.gmo: + @lang=`echo $* | sed -e 's,.*/,,'`; \ + if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; fi; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}rm -f $${lang}.gmo && $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.1po && rm -f $${lang}.1po"; \ + cd $(srcdir) && \ + rm -f $${lang}.gmo && \ + $(MSGMERGE) $(MSGMERGE_FOR_MSGFMT_OPTION) -o $${lang}.1po $${lang}.po $(DOMAIN).pot && \ + $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.1po && \ + mv t-$${lang}.gmo $${lang}.gmo && \ + rm -f $${lang}.1po + + +all-yes: $(srcdir)/stamp-po +all-no: + +# Ensure that the gettext macros and this Makefile.in.in are in sync. +CHECK_MACRO_VERSION = \ + test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ + || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ + exit 1; \ + } + +# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no +# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because +# we don't want to bother translators with empty POT files). We assume that +# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. +# In this case, $(srcdir)/stamp-po is a nop (i.e. a phony target). + +# $(srcdir)/stamp-po is a timestamp denoting the last time at which the CATALOGS +# have been loosely updated. Its purpose is that when a developer or translator +# checks out the package from a version control system, and the $(DOMAIN).pot +# file is not under version control, "make" will update the $(DOMAIN).pot and +# the $(CATALOGS), but subsequent invocations of "make" will do nothing. This +# timestamp would not be necessary if updating the $(CATALOGS) would always +# touch them; however, the rule for $(POFILES) has been designed to not touch +# files that don't need to be changed. +$(srcdir)/stamp-po: $(srcdir)/$(DOMAIN).pot + @$(CHECK_MACRO_VERSION) + test ! -f $(srcdir)/$(DOMAIN).pot || \ + test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) + @test ! -f $(srcdir)/$(DOMAIN).pot || { \ + echo "touch $(srcdir)/stamp-po" && \ + echo timestamp > $(srcdir)/stamp-poT && \ + mv $(srcdir)/stamp-poT $(srcdir)/stamp-po; \ + } + +# This target rebuilds $(DOMAIN).pot; it is an expensive operation. +# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. +# The determination of whether the package xyz is a GNU one is based on the +# heuristic whether some file in the top level directory mentions "GNU xyz". +# If GNU 'find' is available, we avoid grepping through monster files. +$(DOMAIN).pot-update: $(POTFILES_DEPS) $(srcdir)/POTFILES.in + package_gnu="$(PACKAGE_GNU)"; \ + test -n "$$package_gnu" || { \ + if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ + LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f -size -10000000c -exec grep -i 'GNU @PACKAGE@' /dev/null '{}' ';' 2>/dev/null; \ + else \ + LC_ALL=C grep -i 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ + fi; \ + } | grep -v 'libtool:' >/dev/null; then \ + package_gnu=yes; \ + else \ + package_gnu=no; \ + fi; \ + }; \ + if test "$$package_gnu" = "yes"; then \ + package_prefix='GNU '; \ + else \ + package_prefix=''; \ + fi; \ + if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ + msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ + else \ + msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ + fi; \ + case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + ;; \ + *) \ + $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ + --add-comments=TRANSLATORS: \ + --files-from=$(srcdir)/POTFILES.in \ + --copyright-holder='$(COPYRIGHT_HOLDER)' \ + --package-name="$${package_prefix}@PACKAGE@" \ + --package-version='@VERSION@' \ + --msgid-bugs-address="$$msgid_bugs_address" \ + $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ + ;; \ + esac + test ! -f $(DOMAIN).po || { \ + if test -f $(srcdir)/$(DOMAIN).pot-header; then \ + sed -e '1,/^#$$/d' < $(DOMAIN).po > $(DOMAIN).1po && \ + cat $(srcdir)/$(DOMAIN).pot-header $(DOMAIN).1po > $(DOMAIN).po && \ + rm -f $(DOMAIN).1po \ + || exit 1; \ + fi; \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + sed -f $(srcdir)/remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ + sed -f $(srcdir)/remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ + if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ + else \ + rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + else \ + mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ + fi; \ + } + +# This rule has no dependencies: we don't need to update $(DOMAIN).pot at +# every "make" invocation, only create it when it is missing. +# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. +$(srcdir)/$(DOMAIN).pot: + $(MAKE) $(DOMAIN).pot-update + +# This target rebuilds a PO file if $(DOMAIN).pot has changed. +# Note that a PO file is not touched if it doesn't need to be changed. +$(POFILES): $(POFILESDEPS) + @test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot + @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ + if test -f "$(srcdir)/$${lang}.po"; then \ + if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; fi; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot"; \ + cd $(srcdir) \ + && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.10 | 0.10.*) \ + $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ + 0.1[1-5] | 0.1[1-5].*) \ + $(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ + 0.1[6-7] | 0.1[6-7].*) \ + $(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) --previous $${lang}.po $(DOMAIN).pot;; \ + *) \ + $(MSGMERGE_UPDATE) --quiet $(MSGMERGE_OPTIONS) --lang=$${lang} --previous $${lang}.po $(DOMAIN).pot;; \ + esac; \ + }; \ + else \ + $(MAKE) $${lang}.po-create; \ + fi + + +install: install-exec install-data +install-exec: +install-data: install-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ + for file in $(DISTFILES.common) Makevars.template; do \ + $(INSTALL_DATA) $(srcdir)/$$file \ + $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + for file in Makevars; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi +install-data-no: all +install-data-yes: all + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkdir_p) $(DESTDIR)$$dir; \ + if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ + $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ + echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ + cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ + fi; \ + done; \ + done + +install-strip: install + +installdirs: installdirs-exec installdirs-data +installdirs-exec: +installdirs-data: installdirs-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ + else \ + : ; \ + fi +installdirs-data-no: +installdirs-data-yes: + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + dir=$(localedir)/$$lang/LC_MESSAGES; \ + $(mkdir_p) $(DESTDIR)$$dir; \ + for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ + if test -n "$$lc"; then \ + if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ + link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ + mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ + for file in *; do \ + if test -f $$file; then \ + ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ + fi; \ + done); \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ + else \ + if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ + :; \ + else \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ + mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ + fi; \ + fi; \ + fi; \ + done; \ + done + +# Define this as empty until I found a useful application. +installcheck: + +uninstall: uninstall-exec uninstall-data +uninstall-exec: +uninstall-data: uninstall-data-@USE_NLS@ + if test "$(PACKAGE)" = "gettext-tools"; then \ + for file in $(DISTFILES.common) Makevars.template; do \ + rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ + done; \ + else \ + : ; \ + fi +uninstall-data-no: +uninstall-data-yes: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ + for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ + rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ + done; \ + done + +check: all + +info dvi ps pdf html tags TAGS ctags CTAGS ID: + +install-dvi install-ps install-pdf install-html: + +mostlyclean: + rm -f $(srcdir)/stamp-poT + rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po + rm -fr *.o + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f $(srcdir)/$(DOMAIN).pot $(srcdir)/stamp-po $(GMOFILES) + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: + test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS) + @$(MAKE) dist2 +# This is a separate target because 'update-po' must be executed before. +dist2: $(srcdir)/stamp-po $(DISTFILES) + @dists="$(DISTFILES)"; \ + if test "$(PACKAGE)" = "gettext-tools"; then \ + dists="$$dists Makevars.template"; \ + fi; \ + if test -f $(srcdir)/$(DOMAIN).pot; then \ + dists="$$dists $(DOMAIN).pot stamp-po"; \ + else \ + case $(XGETTEXT) in \ + :) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because a suitable 'xgettext' program was not found in PATH." 1>&2;; \ + *) echo "Warning: Creating a tarball without '$(DOMAIN).pot', because 'xgettext' found no strings to extract. Check the contents of the POTFILES.in file and the XGETTEXT_OPTIONS in the Makevars file." 1>&2;; \ + esac; \ + fi; \ + if test -f $(srcdir)/ChangeLog; then \ + dists="$$dists ChangeLog"; \ + fi; \ + for i in 0 1 2 3 4 5 6 7 8 9; do \ + if test -f $(srcdir)/ChangeLog.$$i; then \ + dists="$$dists ChangeLog.$$i"; \ + fi; \ + done; \ + if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ + for file in $$dists; do \ + if test -f $$file; then \ + cp -p $$file $(distdir) || exit 1; \ + else \ + cp -p $(srcdir)/$$file $(distdir) || exit 1; \ + fi; \ + done + +update-po: Makefile + $(MAKE) $(DOMAIN).pot-update + test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) + $(MAKE) update-gmo + +# General rule for creating PO files. + +.nop.po-create: + @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ + echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ + exit 1 + +# General rule for updating PO files. + +.nop.po-update: + @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ + if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; fi; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ + echo "$${cdcmd}$(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) --lang=$$lang --previous $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ + cd $(srcdir); \ + if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.10 | 0.10.*) \ + $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + 0.1[1-5] | 0.1[1-5].*) \ + $(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + 0.1[6-7] | 0.1[6-7].*) \ + $(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + *) \ + $(MSGMERGE) --quiet $(MSGMERGE_OPTIONS) --lang=$$lang --previous -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ + esac; \ + }; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "msgmerge for $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +$(DUMMYPOFILES): + +update-gmo: Makefile $(GMOFILES) + @: + +# Include all the Rules-* extensions. Documented in +# +RULES_FILES != cd $(srcdir) \ + && for file in Rules-*; do \ + if test -f "$$file"; then \ + case "$$file" in \ + *.orig | *.bak | *~) ;; \ + *) echo $(srcdir)/"$$file" ;; \ + esac; \ + fi; \ + done +include $(RULES_FILES) + +# Recreate Makefile by invoking config.status. Explicitly invoke the shell, +# because execution permission bits may not work on the current file system. +# Use @SHELL@, which is the shell determined by autoconf for the use by its +# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. +Makefile: Makefile.in.in Makevars $(top_builddir)/config.status + cd $(top_builddir) \ + && @SHELL@ ./config.status $(subdir)/$@.in po-directories + +force: + +# Tell versions [3.59,3.63) of GNU make not to export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: + +# This Makefile contains rules which don't work with parallel make, +# namely dist2. +# See . +# So, turn off parallel execution in this Makefile. +.NOTPARALLEL: diff --git a/miniconda3/share/gettext/po/Makevars.template b/miniconda3/share/gettext/po/Makevars.template new file mode 100644 index 0000000000000000000000000000000000000000..d1532a95c9f28a3187c1a33b375100d80d96b1c5 --- /dev/null +++ b/miniconda3/share/gettext/po/Makevars.template @@ -0,0 +1,82 @@ +# Makefile variables for PO directory in any package using GNU gettext. +# +# Copyright (C) 2003-2025 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation gives +# unlimited permission to use, copy, distribute, and modify it. + +# Usually the message domain is the same as the package name. +DOMAIN = $(PACKAGE) + +# These two variables depend on the location of this directory. +subdir = po +top_builddir = .. + +# These options get passed to xgettext. +XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ + +# This is the copyright holder that gets inserted into the header of the +# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding +# package. (Note that the msgid strings, extracted from the package's +# sources, belong to the copyright holder of the package.) Translators are +# expected to transfer the copyright for their translations to this person +# or entity, or to disclaim their copyright. The empty string stands for +# the public domain; in this case the translators are expected to disclaim +# their copyright. +COPYRIGHT_HOLDER = Free Software Foundation, Inc. + +# This tells whether or not to prepend "GNU " prefix to the package +# name that gets inserted into the header of the $(DOMAIN).pot file. +# Possible values are "yes", "no", or empty. If it is empty, try to +# detect it automatically by scanning the files in $(top_srcdir) for +# "GNU packagename" string. +PACKAGE_GNU = + +# This is the email address or URL to which the translators shall report +# bugs in the untranslated strings: +# - Strings which are not entire sentences, see the maintainer guidelines +# in the GNU gettext documentation, section 'Preparing Strings'. +# - Strings which use unclear terms or require additional context to be +# understood. +# - Strings which make invalid assumptions about notation of date, time or +# money. +# - Pluralisation problems. +# - Incorrect English spelling. +# - Incorrect formatting. +# It can be your email address, or a mailing list address where translators +# can write to without being subscribed, or the URL of a web page through +# which the translators can contact you. +MSGID_BUGS_ADDRESS = + +# This is the list of locale categories, beyond LC_MESSAGES, for which the +# message catalogs shall be used. It is usually empty. +EXTRA_LOCALE_CATEGORIES = + +# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' +# context. Possible values are "yes" and "no". Set this to yes if the +# package uses functions taking also a message context, like pgettext(), or +# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. +USE_MSGCTXT = no + +# These options get passed to msgmerge. +# Useful options are in particular: +# --previous to keep previous msgids of translated messages, +# --quiet to reduce the verbosity. +MSGMERGE_OPTIONS = + +# These options get passed to msginit. +# If you want to disable line wrapping when writing PO files, add +# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and +# MSGINIT_OPTIONS. +MSGINIT_OPTIONS = + +# This tells whether or not to regenerate a PO file when $(DOMAIN).pot +# has changed. Possible values are "yes" and "no". Set this to no if +# the POT file is checked in the repository and the version control +# program ignores timestamps. +PO_DEPENDS_ON_POT = yes + +# This tells whether or not to forcibly update $(DOMAIN).pot and +# regenerate PO files on "make dist". Possible values are "yes" and +# "no". Set this to no if the POT file and PO files are maintained +# externally. +DIST_DEPENDS_ON_UPDATE_PO = yes diff --git a/miniconda3/share/gettext/po/Rules-quot b/miniconda3/share/gettext/po/Rules-quot new file mode 100644 index 0000000000000000000000000000000000000000..9e1305407934796f5a0df7bcf6ec1100631d8254 --- /dev/null +++ b/miniconda3/share/gettext/po/Rules-quot @@ -0,0 +1,66 @@ +# Special Makefile rules for English message catalogs with quotation marks. +# +# Copyright (C) 2001-2024 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# This file is offered as-is, without any warranty. +# +# Written by Bruno Haible , 2001. + +DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sed Rules-quot + +.SUFFIXES: .insert-header .po-update-en + +en@quot.po-create: + $(MAKE) en@quot.po-update +en@boldquot.po-create: + $(MAKE) en@boldquot.po-update + +en@quot.po-update: en@quot.po-update-en +en@boldquot.po-update: en@boldquot.po-update-en + +.insert-header.po-update-en: + @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ + if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ + tmpdir=`pwd`; \ + echo "$$lang:"; \ + ll=`echo $$lang | sed -e 's/@.*//'`; \ + LC_ALL=C; export LC_ALL; \ + cd $(srcdir); \ + if $(MSGINIT) $(MSGINIT_OPTIONS) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \ + | $(SED) -f $$tmpdir/$$lang.insert-header | $(SED) -e '/^%%/d' \ + | $(MSGCONV) -t UTF-8 | \ + { case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ + '' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \ + $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \ + ;; \ + *) \ + $(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \ + ;; \ + esac } 2>/dev/null > $$tmpdir/$$lang.new.po \ + ; then \ + if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ + rm -f $$tmpdir/$$lang.new.po; \ + else \ + if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ + :; \ + else \ + echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ + exit 1; \ + fi; \ + fi; \ + else \ + echo "creation of $$lang.po failed!" 1>&2; \ + rm -f $$tmpdir/$$lang.new.po; \ + fi + +en@quot.insert-header: insert-header.sed + sed -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sed > en@quot.insert-header + +en@boldquot.insert-header: insert-header.sed + sed -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sed > en@boldquot.insert-header + +mostlyclean: mostlyclean-quot +mostlyclean-quot: + rm -f *.insert-header diff --git a/miniconda3/share/gettext/po/boldquot.sed b/miniconda3/share/gettext/po/boldquot.sed new file mode 100644 index 0000000000000000000000000000000000000000..3c1de54e66e4500a95c29f78c9db06fbaa59aeb5 --- /dev/null +++ b/miniconda3/share/gettext/po/boldquot.sed @@ -0,0 +1,21 @@ +# Sed script that converts quotations, by replacing ASCII quotation marks +# with Unicode quotation marks and highlighting the quotations in bold face. +# +# Copyright (C) 2001 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# This file is offered as-is, without any warranty. +# +# Written by Bruno Haible , 2001. +# +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g +s/“/“/g +s/”/”/g +s/‘/‘/g +s/’/’/g diff --git a/miniconda3/share/gettext/po/en@boldquot.header b/miniconda3/share/gettext/po/en@boldquot.header new file mode 100644 index 0000000000000000000000000000000000000000..ac96ad9f36ee27a09491803d5eeb3b17da367e47 --- /dev/null +++ b/miniconda3/share/gettext/po/en@boldquot.header @@ -0,0 +1,35 @@ +%% A header that gets inserted into message catalogs named en@boldquot.po. +%% +%% Copyright (C) 2001 Free Software Foundation, Inc. +%% This file is free software; the Free Software Foundation +%% gives unlimited permission to copy and/or distribute it, +%% with or without modifications, as long as this notice is preserved. +%% This file is offered as-is, without any warranty. +%% +%% Written by Bruno Haible , 2001. +%% +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# +# This catalog furthermore displays the text between the quotation marks in +# bold face, assuming the VT100/XTerm escape sequences. +# diff --git a/miniconda3/share/gettext/po/en@quot.header b/miniconda3/share/gettext/po/en@quot.header new file mode 100644 index 0000000000000000000000000000000000000000..287e2e735b91018e0fec016f079e824f68241fbd --- /dev/null +++ b/miniconda3/share/gettext/po/en@quot.header @@ -0,0 +1,32 @@ +%% A header that gets inserted into message catalogs named en@quot.po. +%% +%% Copyright (C) 2001 Free Software Foundation, Inc. +%% This file is free software; the Free Software Foundation +%% gives unlimited permission to copy and/or distribute it, +%% with or without modifications, as long as this notice is preserved. +%% This file is offered as-is, without any warranty. +%% +%% Written by Bruno Haible , 2001. +%% +# All this catalog "translates" are quotation characters. +# The msgids must be ASCII and therefore cannot contain real quotation +# characters, only substitutes like grave accent (0x60), apostrophe (0x27) +# and double quote (0x22). These substitutes look strange; see +# https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html +# +# This catalog translates grave accent (0x60) and apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019). +# It also translates pairs of apostrophe (0x27) to +# left single quotation mark (U+2018) and right single quotation mark (U+2019) +# and pairs of quotation mark (0x22) to +# left double quotation mark (U+201C) and right double quotation mark (U+201D). +# +# When output to an UTF-8 terminal, the quotation characters appear perfectly. +# When output to an ISO-8859-1 terminal, the single quotation marks are +# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to +# grave/acute accent (by libiconv), and the double quotation marks are +# transliterated to 0x22. +# When output to an ASCII terminal, the single quotation marks are +# transliterated to apostrophes, and the double quotation marks are +# transliterated to 0x22. +# diff --git a/miniconda3/share/gettext/po/insert-header.sed b/miniconda3/share/gettext/po/insert-header.sed new file mode 100644 index 0000000000000000000000000000000000000000..f9534e7edf9d4652ee0abedf47b308a3ff58b963 --- /dev/null +++ b/miniconda3/share/gettext/po/insert-header.sed @@ -0,0 +1,31 @@ +# Sed script that inserts the file called HEADER before the header entry. +# +# Copyright (C) 2001 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# This file is offered as-is, without any warranty. +# +# Written by Bruno Haible , 2001. +# +# At each occurrence of a line starting with "msgid ", we execute the following +# commands. At the first occurrence, insert the file. At the following +# occurrences, do nothing. The distinction between the first and the following +# occurrences is achieved by looking at the hold space. +/^msgid /{ +x +# Test if the hold space is empty. +s/m/m/ +ta +# Yes it was empty. First occurrence. Read the file. +r HEADER +# Output the file's contents by reading the next line. But don't lose the +# current line while doing this. +g +N +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} diff --git a/miniconda3/share/gettext/po/quot.sed b/miniconda3/share/gettext/po/quot.sed new file mode 100644 index 0000000000000000000000000000000000000000..eb0e08dad08f82b535aaf739ce1efb5752e3b1ae --- /dev/null +++ b/miniconda3/share/gettext/po/quot.sed @@ -0,0 +1,17 @@ +# Sed script that converts quotations, by replacing ASCII quotation marks +# with Unicode quotation marks. +# +# Copyright (C) 2001 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# This file is offered as-is, without any warranty. +# +# Written by Bruno Haible , 2001. +# +s/"\([^"]*\)"/“\1”/g +s/`\([^`']*\)'/‘\1’/g +s/ '\([^`']*\)' / ‘\1’ /g +s/ '\([^`']*\)'$/ ‘\1’/g +s/^'\([^`']*\)' /‘\1’ /g +s/“”/""/g diff --git a/miniconda3/share/gettext/po/remove-potcdate.sed b/miniconda3/share/gettext/po/remove-potcdate.sed new file mode 100644 index 0000000000000000000000000000000000000000..8c70dfbf1488022cd0da639ad521ade041d31c27 --- /dev/null +++ b/miniconda3/share/gettext/po/remove-potcdate.sed @@ -0,0 +1,25 @@ +# Sed script that removes the POT-Creation-Date line in the header entry +# from a POT file. +# +# Copyright (C) 2002 Free Software Foundation, Inc. +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. This file is offered as-is, +# without any warranty. +# +# The distinction between the first and the following occurrences of the +# pattern is achieved by looking at the hold space. +/^"POT-Creation-Date: .*"$/{ +x +# Test if the hold space is empty. +s/P/P/ +ta +# Yes it was empty. First occurrence. Remove the line. +g +d +bb +:a +# The hold space was nonempty. Following occurrences. Do nothing. +x +:b +} diff --git a/miniconda3/share/gettext/projects/GNOME/team-address b/miniconda3/share/gettext/projects/GNOME/team-address new file mode 100644 index 0000000000000000000000000000000000000000..0496b5d21c069d6f5c9e4773023468aba6946935 --- /dev/null +++ b/miniconda3/share/gettext/projects/GNOME/team-address @@ -0,0 +1,47 @@ +#!/bin/sh +# +# Copyright (C) 2001, 2005, 2010 Free Software Foundation, Inc. +# Written by Bruno Haible , 2001. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Print the team's address (to stdout) and output additional instructions +# (to stderr). + +projectsdir="$1" +progdir="$2" +catalog="$3" # e.g. "pt_BR" +language="$4" # e.g. "pt" + +url=`cat "$projectsdir/GNOME/teams.url"` +html=`"$progdir/urlget" "$url" "$projectsdir/GNOME/teams.html"` +sed_addnl='s,,\ +,g' +sed_extract_address='s,^.*"/teams/'"$catalog"'">[^<>]*.*]*>\(.*\).*]*>.*.*,\1,p' +address=`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e "$sed_extract_address"` +if test -n "$address"; then + (echo "Please consider joining your translation team, and visit" + echo " $address" + echo " https://l10n.gnome.org/" + ) 1>&2 +else + (echo "A translation team for your "`if test "$catalog" = "$language"; then echo "language ($language)"; else echo "local dialect ($catalog)"; fi` + echo "may not exist yet. Please visit" + echo " $url" + echo " https://l10n.gnome.org/" + echo "and decide whether you want to create a new translation team." + ) 1>&2 + address= +fi +exit 0 diff --git a/miniconda3/share/gettext/projects/GNOME/teams.html b/miniconda3/share/gettext/projects/GNOME/teams.html new file mode 100644 index 0000000000000000000000000000000000000000..6879bf23b2ef7c5c88d59f2559f8d186fe1d417d --- /dev/null +++ b/miniconda3/share/gettext/projects/GNOME/teams.html @@ -0,0 +1,1849 @@ + + + + + + + GNOME Translation Teams + + + + + + + + + + + + +
+ + +
+ +
+ + Log in + +
+ +
+
+ + + +
+ +

GNOME Translation Teams

+ + +

Select a team below to see more information about it:

+ + + +

If anything should be changed on this page, please submit a bug report.

+ + + +
+ +
+ + + +
+ + diff --git a/miniconda3/share/gettext/projects/GNOME/teams.url b/miniconda3/share/gettext/projects/GNOME/teams.url new file mode 100644 index 0000000000000000000000000000000000000000..0f85a4d931e7fc593a902cee88cb9e8d52641dcc --- /dev/null +++ b/miniconda3/share/gettext/projects/GNOME/teams.url @@ -0,0 +1 @@ +https://l10n.gnome.org/teams/ diff --git a/miniconda3/share/gettext/projects/GNOME/trigger b/miniconda3/share/gettext/projects/GNOME/trigger new file mode 100644 index 0000000000000000000000000000000000000000..0678561ba306dd626edbe77e264c82f21d490383 --- /dev/null +++ b/miniconda3/share/gettext/projects/GNOME/trigger @@ -0,0 +1,55 @@ +#!/bin/sh +# +# Copyright (C) 2001, 2005 Free Software Foundation, Inc. +# Written by Bruno Haible , 2001. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Test whether the current package is a GNOME package. + +# NLS nuisances: Letter ranges are different in the Estonian locale. +LC_ALL=C + +while true; do + configfiles= + if test -f configure.in; then + configfiles="$configfiles configure.in" + fi + if test -f configure.ac; then + configfiles="$configfiles configure.ac" + fi + if test -n "$configfiles"; then + if grep '^GNOME_' $configfiles >/dev/null 2>&1 ; then + exit 0 + fi + exit 1 + fi + dir=`basename \`pwd\`` + case "$dir" in + i18n) + # This directory name, used in GNU make, is not the top level directory. + ;; + *[A-Za-z]*[0-9]*) + # Reached the top level directory. + exit 1 + esac + # Go to parent directory + last=`/bin/pwd` + cd .. + curr=`/bin/pwd` + if test "$last" = "$curr"; then + # Oops, didn't find the top level directory. + exit 1 + fi +done diff --git a/miniconda3/share/gettext/projects/KDE/team-address b/miniconda3/share/gettext/projects/KDE/team-address new file mode 100644 index 0000000000000000000000000000000000000000..00cf4e6656073bb42bfe010429b5869b46f58886 --- /dev/null +++ b/miniconda3/share/gettext/projects/KDE/team-address @@ -0,0 +1,133 @@ +#!/bin/sh +# +# Copyright (C) 2001 Free Software Foundation, Inc. +# Written by Bruno Haible , 2001. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Print the team's address (to stdout) and output additional instructions +# (to stderr). + +projectsdir="$1" +progdir="$2" +catalog="$3" # e.g. "pt_BR" +language="$4" # e.g. "pt" + +url=`cat "$projectsdir/KDE/teams.url"` +html=`"$progdir/urlget" "$url" "$projectsdir/KDE/teams.html"` +# The HTML page says they are "presently switching from the 2-letter codes +# to the 3-letter codes". So it is safest to use the English name and +# translate ourselves... +case "$catalog" in + af) english=Afrikaans;; + ar) english=Arabic;; + az) english=Azerbaijani;; + bg) english=Bulgarian;; + bn) english=Bengali;; + bo) english=Tibetan;; + br) english=Breton;; + bs) english=Bosnian;; + ca) english=Catalan;; + cs) english=Czech;; + cy) english=Welsh;; + da) english=Danish;; + de) english=German;; + el) english=Greek;; + en_GB) english="British English";; + eo) english=Esperanto;; + es) english=Spanish;; + et) english=Estonian;; + eu) english=Basque;; + fa) english=Farsi;; + fi) english=Finnish;; + fo) english=Faroese;; + fr) english=French;; + ga) english=Irish;; + gl) english=Gallegan;; + gu) english=Gujarati;; + he) english=Hebrew;; + hi) english=Hindi;; + hr) english=Croatian;; + hu) english=Hungarian;; + id) english=Indonesian;; + is) english=Icelandic;; + it) english=Italian;; + ja) english=Japanese;; + km) english=Khmer;; + ko) english=Korean;; + ku) english=Kurdish;; + lt) english=Lithuanian;; + lv) english=Latvian;; + mi) english=Maori;; + mk) english=Macedonian;; + mr) english=Marathi;; + mt) english=Maltese;; + nl) english=Dutch;; + no) english="Norwegian (Bokm";; + nn) english="Norwegian (Nynorsk)";; + oc) english=Occitan;; + pl) english=Polish;; + pt) english=Portuguese;; + pt_BR) english="Brazilian Portuguese";; + ro) english=Romanian;; + ru) english=Russian;; + sk) english=Slovak;; + sl) english=Slovenian;; + sr) english=Serbian;; + sv) english=Swedish;; + ta) english=Tamil;; + tg) english=Tajik;; + th) english=Thai;; + tr) english=Turkish;; + uk) english=Ukrainian;; + vi) english=Vietnamese;; + # ??) english=Walloon;; + xh) english=Xhosa;; + zh_CN) english="Simplified Chinese";; + zh_TW) english="Traditional Chinese";; + *) english=;; +esac +if test -n "$english"; then + (echo "Please consider joining your translation team, and visit" + sed_addnl='s,,\ +,g' + anchor=`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e 's,^.*.*>'"$english"'[^<>]*team<.*$,\1,p'` + if test -n "$anchor"; then + echo " $url#$anchor" + fi + echo " $url" + echo " https://l10n.kde.org/" + ) 1>&2 + address1=`echo "$html" | tr '\012' '|' | sed -n -e 's,^.*>'"$english"'[^<>]*team<\(.*\)$,\1,p' | sed -e "$sed_addnl" | sed -e 2q -e 1d | sed -n -e 's,^.*mailing list\(.*\)$,\1,p' | sed -e 's,.*,,' | sed -e 's,.*,,' | sed -n -e 's,^.*HREF="\([^"]*\)">[^<>]*.*$,\1,p'` + case "$address1" in + mailto:*) address1=`echo "$address1" | sed -e 's,^mailto:,<,' -e 's,$,>,'` ;; + esac + address1=`echo "$address1" | sed -e 's,-request@,@,'` + address2=`echo "$html" | tr '\012' '|' | sed -n -e 's,^.*>'"$english"'[^<>]*team<\(.*\)$,\1,p' | sed -e "$sed_addnl" | sed -e 2q -e 1d | sed -n -e 's,^.*web site\(.*\)$,\1,p' | sed -e 's,.*,,' | sed -e 's,.*,,' | sed -n -e 's,^.*HREF="\([^"]*\)">[^<>]*.*$,\1,p'` + if test -n "$address1" && test -n "$address2"; then + address="$address1 $address2" + else + address="$address1$address2" + fi + # address can be empty or contain 1 or more space separated URLs. +else + (echo "A translation team for your "`if test "$catalog" = "$language"; then echo "language ($language)"; else echo "local dialect ($catalog)"; fi` + echo "may not exist yet. Please visit" + echo " $url" + echo " https://l10n.kde.org/" + echo "and decide whether you want to create a new translation team." + ) 1>&2 + address= +fi +exit 0 diff --git a/miniconda3/share/gettext/projects/KDE/teams.html b/miniconda3/share/gettext/projects/KDE/teams.html new file mode 100644 index 0000000000000000000000000000000000000000..8924e91ee9afbaaa5ca3816f5da454f94209b877 --- /dev/null +++ b/miniconda3/share/gettext/projects/KDE/teams.html @@ -0,0 +1,2036 @@ + + + + + The KDE Translation Teams + + +
+ + + + +
+

The KDE Translation Teams

+

Many KDE applications have been translated to more than 50 + languages already and the number of both the translated applications and + the supported languages is still growing. For information on how complete the + translation of the current KDE user interface to the individual languages + really is please see the respective statistics page. (Documentation translation is still in + its first stages for many teams.) The languages distributed with the last + official KDE version are listed on a separate + page.

+

Almost all language teams are looking for additional + translators. And, of course, there are still a lot of languages missing in KDE. + So if you have some spare time and a good knowledge of English, please consider + joining one of the teams and help translating KDE to your native language. Just + write to the appropriate team coordinator in the list below. If there's no + coordinator listed for your language, take a look at the + Translation HOWTO for more information on + how new languages are introduced to KDE and subscribe to the + mailinglist + for translators and documenters.

+

The team table below is sorted according to the official lists + of ISO 639 language codes. (See + http://lcweb.loc.g + ov/standards/iso639-2/englangn.html). We are + presently switching from the 2-letter codes to the 3-letter codes.) In addition + to the basic team data like the coordinator(s), the + mailing list, and the team's web site, the + list now contains links to:

+
    +
  • compressed archives of all GUI and documentation + files that were already translated by the respective language team; + these files are usually of the type ".po" (GNU gettext) and ".docbook" + (XML)
  • +
  • text files that contain all message strings of the + translated .po files -- these files are sometimes called + "compendia" and are used for instance by specialized + translation programs like KBabel (the + recommended one for KDE translation).
  • +
  • the "highscore list" for each team: an + overview which .po files were already translated but are in need of an + overhaul.
  • +
  • the doc statistics: an overview of the + current status if there are any doc translations available
  • +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
afAfrikaans team
  +
araArabic team
  +
azAzerbaijani team
  +
bgBulgarian team
  +
bnBengali team
  +
    +
  • team coordinator(s): + Ahmed, Taneem
  • +
  • mailing list: --
  • +
  • web site: --
  • +
  • .po and doc archive:--
  • +
  • .po messages translated: --
  • +
  • .po files in need of a revision: --
  • +
  • doc statistics: --
  • +
boTibetan team
  +
    +
  • team coordinator(s): Katrin Norbu
  • +
  • mailing list: --
  • +
  • web site: --
  • +
  • .po and doc archive:--
  • +
  • .po messages translated: --
  • +
  • .po files in need of a revision: --
  • +
  • doc statistics: --
  • +
brBreton team
  +
bsBosnian team
  +
caCatalan team
  +
csCzech team
  +
cyWelsh team
  +
daDanish team
  +
deGerman team
  +
elGreek team
  +
en_GBBritish English Team
  +
eoEsperanto team
  +
esSpanish team
  +
etEstonian team
  +
euBasque team
  +
faFarsi (Persian) team
  +
fiFinnish team
  +
foFaroese team
  +
    +
  • coordinator(s): Aki Nielsen
  • +
  • mailing list: --
  • +
  • web site: --
  • +
  • .po and doc archive: --
  • +
  • .po messages translated: --
  • +
  • .po files in need of a revision: --
  • +
  • doc statistics: --
  • +
frFrench team
  +
gaIrish Gaelic team
  +
glGallegan team
  +
guGujarati team
  +
    +
  • coordinator(s): Apu + Shah
  • +
  • mailing list: --
  • +
  • web site: --
  • +
  • .po and doc archive: --
  • +
  • .po messages translated: --
  • +
  • .po files in need of a revision: --
  • +
  • doc statistics: --
  • +
heHebrew team
  +
hiHindi team
  +
    +
  • coordinator(s): Harsh + Kumar
  • +
  • mailing list: --
  • +
  • web site: --
  • +
  • .po and doc archive: --
  • +
  • .po messages translated: --
  • +
  • .po files in need of a revision: --
  • +
  • doc statistics: --
  • +
hrCroatian team
  +
huHungarian team
  +
id/indIndonesian team
  +
isIcelandic team
  +
itItalian team
  +
jaJapanese team
  +
kmKhmer (Cambodian) team
  +
    +
  • coordinator(s): Neang, + Savun
  • +
  • mailing list: kdelist@khmermp3.com (no subscription info + available yet)
  • +
  • web site: kde.khmermp3.com
  • +
  • .po and doc archive: --
  • +
  • .po messages translated: --
  • +
  • .po files in need of a revision: --
  • +
  • doc statistics: --
  • +
koKorean team
  +
kurKurdish team
  +
ltLithuanian team
  +
lvLatvian team
  +
miMaori team
  +
mkMacedonian team
  +
mrMarathi team
  +
    +
  • coordinator(s): Rahul + Palkar
  • +
  • mailing list: --
  • +
  • web site: --
  • +
  • .po and doc archive: --
  • +
  • .po messages translated: --
  • +
  • .po files in need of a revision: --
  • +
  • doc statistics: --
  • +
mtMaltese team
  +
    +
  • coordinator(s): Ramon + Casha
  • +
  • mailing list: --
  • +
  • web site: --
  • +
  • .po and doc archive: --
  • +
  • .po messages translated: --
  • +
  • .po files in need of a revision: --
  • +
  • doc statistics: --
  • +
nlDutch team
  +
noNorwegian (Bokmål) team
  +
no_NYNorwegian (Nynorsk) team
  +
ocOccitan team
  +
plPolish team
  +
ptPortuguese team
  +
pt_BRBrazilian Portuguese team
  +
roRomanian team
  +
ruRussian team
  +
skSlovak team
  +
slSlovenian team
  +
srSerbian team
  +
svSwedish team
  +
taTamil team
  +
tgTajik team
  +
    +
  • coordinator(s): + Roger Kovacs
  • +
  • mailing list: --
  • +
  • web site: www.khujandcomptech.dyn.tj
  • +
  • .po and doc archive:--
  • +
  • .po messages translated: --
  • +
  • .po files in need of a revision: --
  • +
  • doc statistics: --
  • +
thThai team
  +
trTurkish team
  +
ukUkrainian team
  +
viVietnamese team
  +
waWalloon team
  +
xhXhosa team
  +
    +
  • team coordinator(s): Dwayne Bailey
  • +
  • mailing list: --
  • +
  • web site: translate.org.za
  • +
  • .po and doc archive: --
  • +
  • .po messages translated: --
  • +
  • .po files in need of a revision: --
  • +
  • doc statistics: --
  • +
zh_CN.GB2312Simplified Chinese team
  +
zh_TW.Big5Traditional Chinese team
  +
+

Page maintained by + Thomas Diehl. Last update 11 Oktober + 2001
+ diff --git a/miniconda3/share/gettext/projects/KDE/teams.url b/miniconda3/share/gettext/projects/KDE/teams.url new file mode 100644 index 0000000000000000000000000000000000000000..de9f64d844693b7de7fa994654ad30100a9dd339 --- /dev/null +++ b/miniconda3/share/gettext/projects/KDE/teams.url @@ -0,0 +1 @@ +https://l10n.kde.org/teams-list.php diff --git a/miniconda3/share/gettext/projects/KDE/trigger b/miniconda3/share/gettext/projects/KDE/trigger new file mode 100644 index 0000000000000000000000000000000000000000..afffbf6e50680b558561b575c39ea9ad0e140f52 --- /dev/null +++ b/miniconda3/share/gettext/projects/KDE/trigger @@ -0,0 +1,57 @@ +#!/bin/sh +# +# Copyright (C) 2001, 2005 Free Software Foundation, Inc. +# Written by Bruno Haible , 2001. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Test whether the current package is a KDE package. + +# NLS nuisances: Letter ranges are different in the Estonian locale. +LC_ALL=C + +while true; do + configfiles= + if test -f configure.in; then + configfiles="$configfiles configure.in" + fi + if test -f configure.ac; then + configfiles="$configfiles configure.ac" + fi + if test -n "$configfiles"; then + if grep '^KDE_' $configfiles >/dev/null 2>&1 || \ + grep '^AC_PATH_KDE' $configfiles >/dev/null 2>&1 || \ + grep '^AM_KDE_WITH_NLS' $configfiles >/dev/null 2>&1 ; then + exit 0 + fi + exit 1 + fi + dir=`basename \`pwd\`` + case "$dir" in + i18n) + # This directory name, used in GNU make, is not the top level directory. + ;; + *[A-Za-z]*[0-9]*) + # Reached the top level directory. + exit 1 + esac + # Go to parent directory + last=`/bin/pwd` + cd .. + curr=`/bin/pwd` + if test "$last" = "$curr"; then + # Oops, didn't find the top level directory. + exit 1 + fi +done diff --git a/miniconda3/share/gettext/projects/TP/team-address b/miniconda3/share/gettext/projects/TP/team-address new file mode 100644 index 0000000000000000000000000000000000000000..fc47e2a95760e8dd12945186de1228f17d82cc8a --- /dev/null +++ b/miniconda3/share/gettext/projects/TP/team-address @@ -0,0 +1,81 @@ +#!/bin/sh +# +# Copyright (C) 2001, 2007, 2019 Free Software Foundation, Inc. +# Written by Bruno Haible , 2001. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Print the team's address (to stdout) and output additional instructions +# (to stderr). + +projectsdir="$1" +progdir="$2" +catalog="$3" # e.g. "pt_BR" +language="$4" # e.g. "pt" + +url=`cat "$projectsdir/TP/teams.url"` +url_parent=`echo "$url" | sed -e 's,/[^/]*\$,/,'` +url_grandparent=`echo "$url" | sed -e 's,/[^/]*/[^/]*\$,/,'` +sed_absolute_dotdot_urls="s,href=\"\\.\\./,href=${url_grandparent},g" +html=`"$progdir/urlget" "$url" "$projectsdir/TP/teams.html" | sed -e "$sed_absolute_dotdot_urls"` +sed_addnl='s,,\ +,g' +address=`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e "s,^.*$catalog[^<>]*[^<>]*.*\$,\\1,p" | sed 1q` +if test -n "$address"; then + case "$address" in + mailto:*) address=`echo "$address" | sed -e 's,^mailto:,<,' -e 's,$,>,'` ;; + esac + (echo "Please visit your translation team's homepage at" + echo " ${url_parent}"`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e "s,^.*[^<>]*[^<>]*$catalog.*\$,\\1,p" | sed 1q` + echo " https://translationproject.org/team/index.html" + echo " https://translationproject.org/html/translators.html" + echo " https://translationproject.org/html/welcome.html" + echo "and consider joining your translation team's mailing list" + echo " $address" + ) 1>&2 + echo "$address" + exit 0 +fi +address=`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e "s,^.*$language[^<>]*[^<>]*.*\$,\\1,p" | sed 1q` +if test -n "$address"; then + case "$address" in + mailto:*) address=`echo "$address" | sed -e 's,^mailto:,<,' -e 's,$,>,'` ;; + esac + (echo "A translation team exists for your language ($language) but not for" + echo "your local dialect ($catalog). You can either join the existing" + echo "translation team for $language or create a new translation team for $catalog." + echo + echo "Please visit the existing translation team's homepage at" + echo " ${url_parent}"`echo "$html" | tr '\012' '|' | sed -e "$sed_addnl" | sed -n -e "s,^.*[^<>]*[^<>]*$language.*\$,\\1,p" | sed 1q` + echo " https://translationproject.org/team/index.html" + echo " https://translationproject.org/html/translators.html" + echo " https://translationproject.org/html/welcome.html" + echo "and consider joining the translation team's mailing list" + echo " $address" + echo + echo "If you want to create a new translation team for $catalog, please visit" + echo " https://translationproject.org/team/index.html" + echo " https://translationproject.org/html/leaders.html" + echo " https://translationproject.org/html/welcome.html" + ) 1>&2 + echo "$address" + exit 0 +fi +(echo "A translation team for your language ($language) does not exist yet." + echo "If you want to create a new translation team for $language"`test "$catalog" = "$language" || echo " or $catalog"`", please visit" + echo " https://translationproject.org/team/index.html" + echo " https://translationproject.org/html/leaders.html" + echo " https://translationproject.org/html/welcome.html" +) 1>&2 +exit 0 diff --git a/miniconda3/share/gettext/projects/TP/teams.html b/miniconda3/share/gettext/projects/TP/teams.html new file mode 100644 index 0000000000000000000000000000000000000000..4d85aeb6ad560a626ccce32e066dfb1d34665c89 --- /dev/null +++ b/miniconda3/share/gettext/projects/TP/teams.html @@ -0,0 +1,536 @@ + + + + + Translation teams + + + + + +
+ TP Translation Project + You code, we translate. +
+ + + +
+ + +
+

Translation teams

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LanguageCodeTeam address
Afrikaansafi18n@af.org.za
Albaniansqtranslation-team-sq@lists.sourceforge.net
Amharicamlocales@geez.org
Arabicar(nothing)
Aragoneseansoftaragones@googlegroups.com
Armenianhytranslation-team-hy@lists.sourceforge.net
Assameseas(nothing)
Asturianastalministradores@softastur.org
Azerbaijaniaztranslation-team-az@lists.sourceforge.net
Basqueeutranslation-team-eu@googlegroups.com
Belarusianbedebian-l10n-belarusian@lists.debian.org
Bengalibn(nothing)
Bengali (India)bn_INdiscuss@lists.ankur.org.in
Bosnianbsmtodorov@alu.hr
Brazilian Portuguesept_BRldpbr-translation@lists.sourceforge.net
Bulgarianbgdict@ludost.net
Catalancaca@dodds.net
Chinese (Hong Kong)zh_HK(nothing)
Chinese (simplified)zh_CNi18n-zh@googlegroups.com
Chinese (traditional)zh_TWzh-l10n@lists.slat.org
Crimean Tatar (Crimean Turkish)crhtilde-birlik-tercime@lists.sourceforge.net
Croatianhrlokalizacija@linux.hr
Czechcstranslation-team-cs@lists.sourceforge.net
Danishdadansk@dansk-gruppen.dk
Dutchnlvertaling@vrijschrift.org
English (British)en_GB(nothing)
English (South African)en_ZA(nothing)
Esperantoeotranslation-team-eo@lists.sourceforge.net
Estonianetlinux-ee@lists.eenet.ee
Finnishfitranslation-team-fi@lists.sourceforge.net
Frenchfrtraduc@traduc.org
Friulianfurf.t.public@gmail.com
Galicianglproxecto@trasno.gal
Georgianka(nothing)
Germandetranslation-team-de@lists.sourceforge.net
Greekelteam@lists.gnome.gr
Gujaratiguindianoss-gujarati@lists.sourceforge.net
Hebrewheeliz@gnu.org
Hindihifedora-trans-hi@redhat.com
Hungarianhutranslation-team-hu@lists.sourceforge.net
Icelandicistranslation-team-is@lists.sourceforge.net
Indonesianidtranslation-team-id@lists.sourceforge.net
Interlinguaiatranslation-team-ia@lists.sourceforge.net
Irishgagaeilge-gnulinux@lists.sourceforge.net
Italianittp@lists.linux.it
Japanesejatranslation-team-ja@lists.sourceforge.net
Kannadakndebian-l10n-kannada@lists.debian.org
Kazakhkk(nothing)
Kinyarwandarwtranslation-team-rw@lists.sourceforge.net
Kirghizkyi18n-team-ky-kyrgyz@lists.sourceforge.net
Koreankotranslation-team-ko@googlegroups.com
Kurdishkutranslation-team-ku (at) ferheng.org
Laolo(nothing)
Latvianlvtranslation-team-lv@lists.sourceforge.net
Lithuanianltkomp_lt@konferencijos.lt
Lugandalgkbirabwa@yahoo.co.uk
Macedonianmkufo@linux.net.mk
Malaymstranslation-team-ms@lists.sourceforge.net
Malayalammlsmc-discuss@googlegroups.com
Maltesemttranslation-team-mt@lists.sourceforge.net
Mandarin Chinesecmnhant-l10n@freelists.org
Marathimrsshedmak@redhat.com
Mongolianmnopenmn-translation@lists.sourceforge.net
Nepalinetranslation-team-ne@lists.sourceforge.net
Norwegian Bokmaalnbi18n-nb@lister.ping.uio.no
Norwegian Nynorsknni18n-nn@lister.ping.uio.no
Oriyaortranslation-team-or@lists.sourceforge.net
Pashtopspathanisation@googlegroups.com
Persianfatranslation-team-fa@lists.sourceforge.net
Polishpltranslation-team-pl@lists.sourceforge.net
Portuguesepttranslation-team-pt@lists.sourceforge.net
Punjabipapunjabi-l10n@lists.sourceforge.net
Romanianrotranslation-team-ro@lists.sourceforge.net
Russianrugnu@d07.ru
Scottish Gaelicgdfios@foramnagaidhlig.net
Serbiansr(nothing)
Slovaksksk-i18n@lists.linux.sk
Sloveniansltranslation-team-sl@lists.sourceforge.net
Spanisheses@tp.org.es
Swahiliswtranslation-team-sw@lists.sourceforge.net
Swedishsvtp-sv@listor.tp-sv.se
Tajiktgrkovacs@khujand.org
Tamiltatamil@systemreboot.net
Telugute(nothing)
Thaiththai-l10n@googlegroups.com
Tibetanbotranslation-team-bo@lists.sourceforge.net
Turkishtrgnu-tr-u12a@lists.sourceforge.net
Ukrainianuktranslation-team-uk@lists.sourceforge.net
Urduurjessbody@gmail.com
Uzbekuzhamza.foziljonov@gmail.com
Vietnamesevitranslation-team-vi@lists.sourceforge.net
Walloonwalinux-wa@walon.org
Wolofwotranslation-team-wo@lists.sourceforge.net
+
+
+ +
+
Your comments are welcome.
+
Last updated on 2019-01-20 09:30 +0100.
+
+ + diff --git a/miniconda3/share/gettext/projects/TP/teams.url b/miniconda3/share/gettext/projects/TP/teams.url new file mode 100644 index 0000000000000000000000000000000000000000..9471a22a4771995f0267650ab2c0f6d73134d11f --- /dev/null +++ b/miniconda3/share/gettext/projects/TP/teams.url @@ -0,0 +1 @@ +https://translationproject.org/team/index.html diff --git a/miniconda3/share/gettext/projects/TP/trigger b/miniconda3/share/gettext/projects/TP/trigger new file mode 100644 index 0000000000000000000000000000000000000000..4486daf92a49fc2a07c5a1884fb71a1edfef085b --- /dev/null +++ b/miniconda3/share/gettext/projects/TP/trigger @@ -0,0 +1,3 @@ +#!/bin/sh +# All translations not belonging to other projects are welcome in the TP. +true diff --git a/miniconda3/share/gettext/projects/index b/miniconda3/share/gettext/projects/index new file mode 100644 index 0000000000000000000000000000000000000000..9b56e1303f825e2983865fc42646681dde6e2967 --- /dev/null +++ b/miniconda3/share/gettext/projects/index @@ -0,0 +1,3 @@ +KDE +GNOME +TP diff --git a/miniconda3/share/gettext/projects/team-address b/miniconda3/share/gettext/projects/team-address new file mode 100644 index 0000000000000000000000000000000000000000..f6bc8af84ac308723d98db1607562ac3594b6acb --- /dev/null +++ b/miniconda3/share/gettext/projects/team-address @@ -0,0 +1,34 @@ +#!/bin/sh +# +# Copyright (C) 2001 Free Software Foundation, Inc. +# Written by Bruno Haible , 2001. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Print the team's address (to stdout) and output additional instructions +# (to stderr). + +projectsdir="$1" +progdir="$2" +catalog="$3" # e.g. "pt_BR" +language="$4" # e.g. "pt" + +for project in `cat "$projectsdir/index"`; do + if /bin/sh "$projectsdir/$project/trigger"; then + /bin/sh "$projectsdir/$project/team-address" "$projectsdir" "$progdir" "$catalog" "$language" + exit $? + fi +done + +exit 0 diff --git a/miniconda3/share/gettext/schema/its-extensions.xsd b/miniconda3/share/gettext/schema/its-extensions.xsd new file mode 100644 index 0000000000000000000000000000000000000000..97cc703f3e6fbcf04fa6717de9cbf73cf97b04fc --- /dev/null +++ b/miniconda3/share/gettext/schema/its-extensions.xsd @@ -0,0 +1,75 @@ + + + + + XML schema extensions for *.its files, as understood by GNU gettext. + +Copyright (C) 2015-2024 Free Software Foundation, Inc. + +This file is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published +by the Free Software Foundation, either version 3 of the License, +or (at your option) any later version. + +This file is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <https://www.gnu.org/licenses/>. + +Written by Bruno Haible <bruno@clisp.org>, 2024. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/miniconda3/share/gettext/schema/its.xsd10 b/miniconda3/share/gettext/schema/its.xsd10 new file mode 100644 index 0000000000000000000000000000000000000000..326edfbe177933016f9fc0b5ce5a43beba5e2abf --- /dev/null +++ b/miniconda3/share/gettext/schema/its.xsd10 @@ -0,0 +1,139 @@ + + + + + XML schema 1.0 of *.its files, as understood by GNU gettext. + +Copyright (C) 2015-2024 Free Software Foundation, Inc. + +This file is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published +by the Free Software Foundation, either version 3 of the License, +or (at your option) any later version. + +This file is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <https://www.gnu.org/licenses/>. + +Written by Bruno Haible <bruno@clisp.org>, 2024. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Note: An instance should not have both the 'locNotePointer' attribute and a 'locNote' child at the same time. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/miniconda3/share/gettext/schema/its.xsd11 b/miniconda3/share/gettext/schema/its.xsd11 new file mode 100644 index 0000000000000000000000000000000000000000..5280bbaf3bb16e868b121b64ca096264a546a8e6 --- /dev/null +++ b/miniconda3/share/gettext/schema/its.xsd11 @@ -0,0 +1,115 @@ + + + + + XML schema 1.1 of *.its files, as understood by GNU gettext. + +Copyright (C) 2015-2024 Free Software Foundation, Inc. + +This file is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published +by the Free Software Foundation, either version 3 of the License, +or (at your option) any later version. + +This file is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <https://www.gnu.org/licenses/>. + +Written by Bruno Haible <bruno@clisp.org>, 2024. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Note: An instance should not have both the 'locNotePointer' attribute and a 'locNote' child at the same time. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/miniconda3/share/gettext/schema/locating-rules.xsd10 b/miniconda3/share/gettext/schema/locating-rules.xsd10 new file mode 100644 index 0000000000000000000000000000000000000000..1795e6ea4a7112bd4c45e5077915b393758c1301 --- /dev/null +++ b/miniconda3/share/gettext/schema/locating-rules.xsd10 @@ -0,0 +1,88 @@ + + + + + XML schema 1.0 of *.loc files, as understood by GNU gettext. + +Copyright (C) 2015-2024 Free Software Foundation, Inc. + +This file is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published +by the Free Software Foundation, either version 3 of the License, +or (at your option) any later version. + +This file is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <https://www.gnu.org/licenses/>. + +Written by Bruno Haible <bruno@clisp.org>, 2024. + + + + + + + + + + + Example: +<locatingRules> + <locatingRule name="Glade" pattern="*.glade"> + <documentRule localName="GTK-Interface" target="glade1.its"/> + <documentRule localName="glade-interface" target="glade2.its"/> + <documentRule localName="interface" target="gtkbuilder.its"/> + </locatingRule> + <locatingRule name="Glade" pattern="*.glade2"> + <documentRule localName="glade-interface" target="glade2.its"/> + </locatingRule> + <locatingRule name="Glade" pattern="*.ui"> + <documentRule localName="interface" target="gtkbuilder.its"/> + </locatingRule> +</locatingRules> + + + + + + + + + + + + Example: +&lt;locatingRule name=&quot;Glade&quot; pattern=&quot;*.glade&quot;&gt; + &lt;documentRule localName=&quot;GTK-Interface&quot; target=&quot;glade1.its&quot;/&gt; + &lt;documentRule localName=&quot;glade-interface&quot; target=&quot;glade2.its&quot;/&gt; + &lt;documentRule localName=&quot;interface&quot; target=&quot;gtkbuilder.its&quot;/&gt; +&lt;/locatingRule&gt; + +Note: An instance should not have both the 'target' attribute and a 'documentRule' child at the same time. + + + + + + + + + + + + + Example: +<documentRule localName="GTK-Interface" target="glade1.its"/> + + + + + + + diff --git a/miniconda3/share/gettext/schema/locating-rules.xsd11 b/miniconda3/share/gettext/schema/locating-rules.xsd11 new file mode 100644 index 0000000000000000000000000000000000000000..d4bac98bbbaa446a92cd122cec9fdbbae5093cba --- /dev/null +++ b/miniconda3/share/gettext/schema/locating-rules.xsd11 @@ -0,0 +1,87 @@ + + + + + XML schema 1.1 of *.loc files, as understood by GNU gettext. + +Copyright (C) 2015-2024 Free Software Foundation, Inc. + +This file is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published +by the Free Software Foundation, either version 3 of the License, +or (at your option) any later version. + +This file is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <https://www.gnu.org/licenses/>. + +Written by Bruno Haible <bruno@clisp.org>, 2024. + + + + + + + + + + + Example: +<locatingRules> + <locatingRule name="Glade" pattern="*.glade"> + <documentRule localName="GTK-Interface" target="glade1.its"/> + <documentRule localName="glade-interface" target="glade2.its"/> + <documentRule localName="interface" target="gtkbuilder.its"/> + </locatingRule> + <locatingRule name="Glade" pattern="*.glade2"> + <documentRule localName="glade-interface" target="glade2.its"/> + </locatingRule> + <locatingRule name="Glade" pattern="*.ui"> + <documentRule localName="interface" target="gtkbuilder.its"/> + </locatingRule> +</locatingRules> + + + + + + + + + + + + Example: +&lt;locatingRule name=&quot;Glade&quot; pattern=&quot;*.glade&quot;&gt; + &lt;documentRule localName=&quot;GTK-Interface&quot; target=&quot;glade1.its&quot;/&gt; + &lt;documentRule localName=&quot;glade-interface&quot; target=&quot;glade2.its&quot;/&gt; + &lt;documentRule localName=&quot;interface&quot; target=&quot;gtkbuilder.its&quot;/&gt; +&lt;/locatingRule&gt; + +Note: An instance should not have both the 'target' attribute and a 'documentRule' child at the same time. + + + + + + + + + + + + + + Example: +<documentRule localName="GTK-Interface" target="glade1.its"/> + + + + + + + diff --git a/miniconda3/share/gettext/styles/po-default.css b/miniconda3/share/gettext/styles/po-default.css new file mode 100644 index 0000000000000000000000000000000000000000..c120c508363f4567bf5ff979175fe1c078ace5c9 --- /dev/null +++ b/miniconda3/share/gettext/styles/po-default.css @@ -0,0 +1,26 @@ +/* Default styling rules for PO files when doing terminal output. + Copyright (C) 2006-2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +.translator-comment { color : green; } +.obsolete { color : green; } +.extracted-comment { color : green; font-weight: bold; } +.flag { text-decoration : underline; } +.fuzzy-flag { text-decoration : none; } +.text { color : magenta; } +.msgstr .text { color : blue; } +.fuzzy .msgstr .text { color : red; } +.format-directive { font-weight: bold; } +.invalid-format-directive { background-color : red; color : white; font-weight: bold; } diff --git a/miniconda3/share/gettext/styles/po-emacs-x.css b/miniconda3/share/gettext/styles/po-emacs-x.css new file mode 100644 index 0000000000000000000000000000000000000000..eb876e8eb61f72d4d5a3ddfc3fe9b707e11de78d --- /dev/null +++ b/miniconda3/share/gettext/styles/po-emacs-x.css @@ -0,0 +1,24 @@ +/* Styling rules for PO files, imitating emacs 21 and 22 in an X window. + Copyright (C) 2006-2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +.comment { color : rgb(178,34,34); } +.reference { color : rgb(95,158,160); } +.flag { color : rgb(0,0,0); } +.keyword { color : rgb(160,32,240); } +.string { color : rgb(160,32,240); } +.text { color : rgb(0,0,0); } +.escape-sequence { color : rgb(184,134,11); } +.format-directive { color : rgb(184,134,11); } diff --git a/miniconda3/share/gettext/styles/po-emacs-xterm.css b/miniconda3/share/gettext/styles/po-emacs-xterm.css new file mode 100644 index 0000000000000000000000000000000000000000..a5efdbe241aaa903b9d7748689544e633bbcda3b --- /dev/null +++ b/miniconda3/share/gettext/styles/po-emacs-xterm.css @@ -0,0 +1,22 @@ +/* Styling rules for PO files, imitating emacs 22 in an xterm terminal. + Copyright (C) 2006-2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +.reference { color : rgb(205,0,205); } +.keyword { color : rgb(0,255,255); font-weight : bold; } +.string { color : rgb(0,255,255); font-weight : bold; } +.text { color : rgb(0,0,0); font-weight : normal; } +.escape-sequence { color : rgb(205,205,0); } +.format-directive { color : rgb(205,205,0); } diff --git a/miniconda3/share/gettext/styles/po-emacs-xterm16.css b/miniconda3/share/gettext/styles/po-emacs-xterm16.css new file mode 100644 index 0000000000000000000000000000000000000000..4c8caa26d2e2531bdb761eb4c1aac619db149f46 --- /dev/null +++ b/miniconda3/share/gettext/styles/po-emacs-xterm16.css @@ -0,0 +1,24 @@ +/* Styling rules for PO files, imitating emacs 22 in an xterm-16color terminal. + Copyright (C) 2006-2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +.comment { color : rgb(205,0,0); } +.reference { color : rgb(0,205,205); } +.flag { color : rgb(0,0,0); } +.keyword { color : rgb(205,0,205); } +.string { color : rgb(205,0,205); } +.text { color : rgb(0,0,0); } +.escape-sequence { color : rgb(205,205,0); } +.format-directive { color : rgb(205,205,0); } diff --git a/miniconda3/share/gettext/styles/po-emacs-xterm256.css b/miniconda3/share/gettext/styles/po-emacs-xterm256.css new file mode 100644 index 0000000000000000000000000000000000000000..a1aaf3be8715b8ce878a1c5ca12e34010bf351bf --- /dev/null +++ b/miniconda3/share/gettext/styles/po-emacs-xterm256.css @@ -0,0 +1,24 @@ +/* Styling rules for PO files, imitating emacs 22 in an xterm-256color terminal. + Copyright (C) 2006-2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +.comment { color : rgb(175,0,0); } +.reference { color : rgb(95,175,175); } +.flag { color : rgb(0,0,0); } +.keyword { color : rgb(175,0,255); } +.string { color : rgb(175,0,255); } +.text { color : rgb(0,0,0); } +.escape-sequence { color : rgb(175,135,0); } +.format-directive { color : rgb(175,135,0); } diff --git a/miniconda3/share/gettext/styles/po-vim.css b/miniconda3/share/gettext/styles/po-vim.css new file mode 100644 index 0000000000000000000000000000000000000000..ae593208fbaae0fc97b78399cf24f4453bca151f --- /dev/null +++ b/miniconda3/share/gettext/styles/po-vim.css @@ -0,0 +1,24 @@ +/* Styling rules for PO files, imitating vim 7. + Copyright (C) 2006-2007 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +.comment { color : rgb(0,0,205); } +.reference-comment { color : rgb(205,0,205); } +.flag-comment { color : rgb(205,0,205); } +.fuzzy-flag { color : rgb(0,0,0); background-color : rgb(205,205,0); } +.keyword { color : rgb(205,205,0); } +.string { color : rgb(205,0,0); } +.escape-sequence { color : rgb(205,0,205); } +.format-directive { color : rgb(205,0,205); } diff --git a/miniconda3/share/icu/73.1/LICENSE b/miniconda3/share/icu/73.1/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..22472dc2ec219cd7d4d97a66e9a3cce6e2a4acc1 --- /dev/null +++ b/miniconda3/share/icu/73.1/LICENSE @@ -0,0 +1,519 @@ +UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE + +See Terms of Use +for definitions of Unicode Inc.’s Data Files and Software. + +NOTICE TO USER: Carefully read the following legal agreement. +BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. +IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +THE DATA FILES OR SOFTWARE. + +COPYRIGHT AND PERMISSION NOTICE + +Copyright © 1991-2023 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in https://www.unicode.org/copyright.html. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. + +---------------------------------------------------------------------- + +Third-Party Software Licenses + +This section contains third-party software notices and/or additional +terms for licensed third-party software components included within ICU +libraries. + +---------------------------------------------------------------------- + +ICU License - ICU 1.8.1 to ICU 57.1 + +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1995-2016 International Business Machines Corporation and others +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, and/or sell copies of the Software, and to permit persons +to whom the Software is furnished to do so, provided that the above +copyright notice(s) and this permission notice appear in all copies of +the Software and that both the above copyright notice(s) and this +permission notice appear in supporting documentation. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY +SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF +CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, use +or other dealings in this Software without prior written authorization +of the copyright holder. + +All trademarks and registered trademarks mentioned herein are the +property of their respective owners. + +---------------------------------------------------------------------- + +Chinese/Japanese Word Break Dictionary Data (cjdict.txt) + + # The Google Chrome software developed by Google is licensed under + # the BSD license. Other software included in this distribution is + # provided under other licenses, as set forth below. + # + # The BSD License + # http://opensource.org/licenses/bsd-license.php + # Copyright (C) 2006-2008, Google Inc. + # + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are met: + # + # Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # Redistributions in binary form must reproduce the above + # copyright notice, this list of conditions and the following + # disclaimer in the documentation and/or other materials provided with + # the distribution. + # Neither the name of Google Inc. nor the names of its + # contributors may be used to endorse or promote products derived from + # this software without specific prior written permission. + # + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + # + # + # The word list in cjdict.txt are generated by combining three word lists + # listed below with further processing for compound word breaking. The + # frequency is generated with an iterative training against Google web + # corpora. + # + # * Libtabe (Chinese) + # - https://sourceforge.net/project/?group_id=1519 + # - Its license terms and conditions are shown below. + # + # * IPADIC (Japanese) + # - http://chasen.aist-nara.ac.jp/chasen/distribution.html + # - Its license terms and conditions are shown below. + # + # ---------COPYING.libtabe ---- BEGIN-------------------- + # + # /* + # * Copyright (c) 1999 TaBE Project. + # * Copyright (c) 1999 Pai-Hsiang Hsiao. + # * All rights reserved. + # * + # * Redistribution and use in source and binary forms, with or without + # * modification, are permitted provided that the following conditions + # * are met: + # * + # * . Redistributions of source code must retain the above copyright + # * notice, this list of conditions and the following disclaimer. + # * . Redistributions in binary form must reproduce the above copyright + # * notice, this list of conditions and the following disclaimer in + # * the documentation and/or other materials provided with the + # * distribution. + # * . Neither the name of the TaBE Project nor the names of its + # * contributors may be used to endorse or promote products derived + # * from this software without specific prior written permission. + # * + # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # * OF THE POSSIBILITY OF SUCH DAMAGE. + # */ + # + # /* + # * Copyright (c) 1999 Computer Systems and Communication Lab, + # * Institute of Information Science, Academia + # * Sinica. All rights reserved. + # * + # * Redistribution and use in source and binary forms, with or without + # * modification, are permitted provided that the following conditions + # * are met: + # * + # * . Redistributions of source code must retain the above copyright + # * notice, this list of conditions and the following disclaimer. + # * . Redistributions in binary form must reproduce the above copyright + # * notice, this list of conditions and the following disclaimer in + # * the documentation and/or other materials provided with the + # * distribution. + # * . Neither the name of the Computer Systems and Communication Lab + # * nor the names of its contributors may be used to endorse or + # * promote products derived from this software without specific + # * prior written permission. + # * + # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # * OF THE POSSIBILITY OF SUCH DAMAGE. + # */ + # + # Copyright 1996 Chih-Hao Tsai @ Beckman Institute, + # University of Illinois + # c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 + # + # ---------------COPYING.libtabe-----END-------------------------------- + # + # + # ---------------COPYING.ipadic-----BEGIN------------------------------- + # + # Copyright 2000, 2001, 2002, 2003 Nara Institute of Science + # and Technology. All Rights Reserved. + # + # Use, reproduction, and distribution of this software is permitted. + # Any copy of this software, whether in its original form or modified, + # must include both the above copyright notice and the following + # paragraphs. + # + # Nara Institute of Science and Technology (NAIST), + # the copyright holders, disclaims all warranties with regard to this + # software, including all implied warranties of merchantability and + # fitness, in no event shall NAIST be liable for + # any special, indirect or consequential damages or any damages + # whatsoever resulting from loss of use, data or profits, whether in an + # action of contract, negligence or other tortuous action, arising out + # of or in connection with the use or performance of this software. + # + # A large portion of the dictionary entries + # originate from ICOT Free Software. The following conditions for ICOT + # Free Software applies to the current dictionary as well. + # + # Each User may also freely distribute the Program, whether in its + # original form or modified, to any third party or parties, PROVIDED + # that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear + # on, or be attached to, the Program, which is distributed substantially + # in the same form as set out herein and that such intended + # distribution, if actually made, will neither violate or otherwise + # contravene any of the laws and regulations of the countries having + # jurisdiction over the User or the intended distribution itself. + # + # NO WARRANTY + # + # The program was produced on an experimental basis in the course of the + # research and development conducted during the project and is provided + # to users as so produced on an experimental basis. Accordingly, the + # program is provided without any warranty whatsoever, whether express, + # implied, statutory or otherwise. The term "warranty" used herein + # includes, but is not limited to, any warranty of the quality, + # performance, merchantability and fitness for a particular purpose of + # the program and the nonexistence of any infringement or violation of + # any right of any third party. + # + # Each user of the program will agree and understand, and be deemed to + # have agreed and understood, that there is no warranty whatsoever for + # the program and, accordingly, the entire risk arising from or + # otherwise connected with the program is assumed by the user. + # + # Therefore, neither ICOT, the copyright holder, or any other + # organization that participated in or was otherwise related to the + # development of the program and their respective officials, directors, + # officers and other employees shall be held liable for any and all + # damages, including, without limitation, general, special, incidental + # and consequential damages, arising out of or otherwise in connection + # with the use or inability to use the program or any product, material + # or result produced or otherwise obtained by using the program, + # regardless of whether they have been advised of, or otherwise had + # knowledge of, the possibility of such damages at any time during the + # project or thereafter. Each user will be deemed to have agreed to the + # foregoing by his or her commencement of use of the program. The term + # "use" as used herein includes, but is not limited to, the use, + # modification, copying and distribution of the program and the + # production of secondary products from the program. + # + # In the case where the program, whether in its original form or + # modified, was distributed or delivered to or received by a user from + # any person, organization or entity other than ICOT, unless it makes or + # grants independently of ICOT any specific warranty to the user in + # writing, such person, organization or entity, will also be exempted + # from and not be held liable to the user for any such damages as noted + # above as far as the program is concerned. + # + # ---------------COPYING.ipadic-----END---------------------------------- + +---------------------------------------------------------------------- + +Lao Word Break Dictionary Data (laodict.txt) + + # Copyright (C) 2016 and later: Unicode, Inc. and others. + # License & terms of use: http://www.unicode.org/copyright.html + # Copyright (c) 2015 International Business Machines Corporation + # and others. All Rights Reserved. + # + # Project: https://github.com/rober42539/lao-dictionary + # Dictionary: https://github.com/rober42539/lao-dictionary/laodict.txt + # License: https://github.com/rober42539/lao-dictionary/LICENSE.txt + # (copied below) + # + # This file is derived from the above dictionary version of Nov 22, 2020 + # ---------------------------------------------------------------------- + # Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are met: + # + # Redistributions of source code must retain the above copyright notice, this + # list of conditions and the following disclaimer. Redistributions in binary + # form must reproduce the above copyright notice, this list of conditions and + # the following disclaimer in the documentation and/or other materials + # provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # OF THE POSSIBILITY OF SUCH DAMAGE. + # -------------------------------------------------------------------------- + +---------------------------------------------------------------------- + +Burmese Word Break Dictionary Data (burmesedict.txt) + + # Copyright (c) 2014 International Business Machines Corporation + # and others. All Rights Reserved. + # + # This list is part of a project hosted at: + # github.com/kanyawtech/myanmar-karen-word-lists + # + # -------------------------------------------------------------------------- + # Copyright (c) 2013, LeRoy Benjamin Sharon + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions + # are met: Redistributions of source code must retain the above + # copyright notice, this list of conditions and the following + # disclaimer. Redistributions in binary form must reproduce the + # above copyright notice, this list of conditions and the following + # disclaimer in the documentation and/or other materials provided + # with the distribution. + # + # Neither the name Myanmar Karen Word Lists, nor the names of its + # contributors may be used to endorse or promote products derived + # from this software without specific prior written permission. + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS + # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + # SUCH DAMAGE. + # -------------------------------------------------------------------------- + +---------------------------------------------------------------------- + +Time Zone Database + + ICU uses the public domain data and code derived from Time Zone +Database for its time zone support. The ownership of the TZ database +is explained in BCP 175: Procedure for Maintaining the Time Zone +Database section 7. + + # 7. Database Ownership + # + # The TZ database itself is not an IETF Contribution or an IETF + # document. Rather it is a pre-existing and regularly updated work + # that is in the public domain, and is intended to remain in the + # public domain. Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do + # not apply to the TZ Database or contributions that individuals make + # to it. Should any claims be made and substantiated against the TZ + # Database, the organization that is providing the IANA + # Considerations defined in this RFC, under the memorandum of + # understanding with the IETF, currently ICANN, may act in accordance + # with all competent court orders. No ownership claims will be made + # by ICANN or the IETF Trust on the database or the code. Any person + # making a contribution to the database or code waives all rights to + # future claims in that contribution or in the TZ Database. + +---------------------------------------------------------------------- + +Google double-conversion + +Copyright 2006-2011, the V8 project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- + +File: aclocal.m4 (only for ICU4C) +Section: pkg.m4 - Macros to locate and utilise pkg-config. + + +Copyright © 2004 Scott James Remnant . +Copyright © 2012-2015 Dan Nicholson + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. + +As a special exception to the GNU General Public License, if you +distribute this file as part of a program that contains a +configuration script generated by Autoconf, you may include it under +the same distribution terms that you use for the rest of that +program. + + +(The condition for the exception is fulfilled because +ICU4C includes a configuration script generated by Autoconf, +namely the `configure` script.) + +---------------------------------------------------------------------- + +File: config.guess (only for ICU4C) + + +This file is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, see . + +As a special exception to the GNU General Public License, if you +distribute this file as part of a program that contains a +configuration script generated by Autoconf, you may include it under +the same distribution terms that you use for the rest of that +program. This Exception is an additional permission under section 7 +of the GNU General Public License, version 3 ("GPLv3"). + + +(The condition for the exception is fulfilled because +ICU4C includes a configuration script generated by Autoconf, +namely the `configure` script.) + +---------------------------------------------------------------------- + +File: install-sh (only for ICU4C) + + +Copyright 1991 by the Massachusetts Institute of Technology + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of M.I.T. not be used in advertising or +publicity pertaining to distribution of the software without specific, +written prior permission. M.I.T. makes no representations about the +suitability of this software for any purpose. It is provided "as is" +without express or implied warranty. diff --git a/miniconda3/share/icu/73.1/config/mh-linux b/miniconda3/share/icu/73.1/config/mh-linux new file mode 100644 index 0000000000000000000000000000000000000000..53d6780d68bc855bdade442921440fdfaf0d9d03 --- /dev/null +++ b/miniconda3/share/icu/73.1/config/mh-linux @@ -0,0 +1,87 @@ +## -*-makefile-*- +## Copyright (C) 2016 and later: Unicode, Inc. and others. +## License & terms of use: http://www.unicode.org/copyright.html +## Linux-specific setup +## Copyright (c) 1999-2013, International Business Machines Corporation and +## others. All Rights Reserved. + +## Commands to generate dependency files +GEN_DEPS.c= $(CC) -E -MM $(DEFS) $(CPPFLAGS) +GEN_DEPS.cc= $(CXX) -E -MM $(DEFS) $(CPPFLAGS) $(CXXFLAGS) + +## Flags for position independent code +SHAREDLIBCFLAGS = -fPIC +SHAREDLIBCXXFLAGS = -fPIC +SHAREDLIBCPPFLAGS = -DPIC + +## Additional flags when building libraries and with threads +THREADSCPPFLAGS = -D_REENTRANT +LIBCPPFLAGS = + +## Compiler switch to embed a runtime search path +LD_RPATH= -Wl,-zorigin,-rpath,'$$'ORIGIN +LD_RPATH_PRE = -Wl,-rpath, + +## These are the library specific LDFLAGS +LDFLAGSICUDT=-nodefaultlibs -nostdlib + +## Compiler switch to embed a library name +# The initial tab in the next line is to prevent icu-config from reading it. + LD_SONAME = -Wl,-soname -Wl,$(notdir $(MIDDLE_SO_TARGET)) +#SH# # We can't depend on MIDDLE_SO_TARGET being set. +#SH# LD_SONAME= + +## Shared library options +LD_SOOPTIONS= -Wl,-Bsymbolic + +## Shared object suffix +SO = so +## Non-shared intermediate object suffix +STATIC_O = ao + +## Compilation rules +%.$(STATIC_O): $(srcdir)/%.c + $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(STATICCPPFLAGS) $(STATICCFLAGS)) -o $@ $<) +%.o: $(srcdir)/%.c + $(call SILENT_COMPILE,$(strip $(COMPILE.c) $(DYNAMICCPPFLAGS) $(DYNAMICCFLAGS)) -o $@ $<) + +%.$(STATIC_O): $(srcdir)/%.cpp + $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(STATICCPPFLAGS) $(STATICCXXFLAGS)) -o $@ $<) +%.o: $(srcdir)/%.cpp + $(call SILENT_COMPILE,$(strip $(COMPILE.cc) $(DYNAMICCPPFLAGS) $(DYNAMICCXXFLAGS)) -o $@ $<) + + +## Dependency rules +%.d: $(srcdir)/%.c + $(call ICU_MSG,(deps)) $< + @$(SHELL) -ec '$(GEN_DEPS.c) $< \ + | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ + [ -s $@ ] || rm -f $@' + +%.d: $(srcdir)/%.cpp + $(call ICU_MSG,(deps)) $< + @$(SHELL) -ec '$(GEN_DEPS.cc) $< \ + | sed '\''s%\($*\)\.o[ :]*%\1.o $@ : %g'\'' > $@; \ + [ -s $@ ] || rm -f $@' + +## Versioned libraries rules + +%.$(SO).$(SO_TARGET_VERSION_MAJOR): %.$(SO).$(SO_TARGET_VERSION) + $(RM) $@ && ln -s ${ +# Created: 1993-05-16 +# Public domain + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/miniconda3/share/info/autosprintf.info b/miniconda3/share/info/autosprintf.info new file mode 100644 index 0000000000000000000000000000000000000000..11b15c8e7cdd0b4c4c642684a4cf1123b8f0f9b5 --- /dev/null +++ b/miniconda3/share/info/autosprintf.info @@ -0,0 +1,1546 @@ +This is autosprintf.info, produced by makeinfo version 7.1 from +autosprintf.texi. + + Copyright (C) 2002-2003, 2006-2007, 2018-2019 Free Software +Foundation, Inc. + + This manual is free documentation. It is dually licensed under the +GNU FDL and the GNU GPL. This means that you can redistribute this +manual under either of these two licenses, at your choice. + + This manual is covered by the GNU FDL. Permission is granted to copy, +distribute and/or modify this document under the terms of the GNU Free +Documentation License (FDL), either version 1.3 of the License, or (at +your option) any later version published by the Free Software Foundation +(FSF); with no Invariant Sections, with no Front-Cover Text, and with no +Back-Cover Texts. A copy of the license is at +. + + This manual is covered by the GNU GPL. You can redistribute it and/or +modify it under the terms of the GNU General Public License (GPL), +either version 2 of the License, or (at your option) any later version +published by the Free Software Foundation (FSF). A copy of the license +is at . +INFO-DIR-SECTION C++ libraries +START-INFO-DIR-ENTRY +* autosprintf: (autosprintf). Support for printf format strings in C++. +END-INFO-DIR-ENTRY + + This file provides documentation for GNU ‘autosprintf’ library. + + +File: autosprintf.info, Node: Top, Next: Introduction, Up: (dir) + +GNU autosprintf +*************** + + This manual documents the GNU autosprintf class, version 1.0. + +* Menu: + +* Introduction:: Introduction +* Class autosprintf:: The ‘autosprintf’ class +* Using autosprintf:: Using ‘autosprintf’ in own programs +* Licenses:: + + +File: autosprintf.info, Node: Introduction, Next: Class autosprintf, Prev: Top, Up: Top + +1 Introduction +************** + + This package makes the C formatted output routines (‘fprintf’ et al.) +usable in C++ programs, for use with the ‘’ strings and the +‘’ streams. + + It allows to write code like + + cerr << autosprintf ("syntax error in %s:%d: %s", filename, line, errstring); + +instead of + + cerr << "syntax error in " << filename << ":" << line << ": " << errstring; + + The benefits of the autosprintf syntax are: + + • It reuses the standard POSIX printf facility. Easy migration from + C to C++. + + • English sentences are kept together. + + • It makes internationalization possible. Internationalization + requires format strings, because in some cases the translator needs + to change the order of a sentence, and more generally it is easier + for the translator to work with a single string for a sentence than + with multiple string pieces. + + • It reduces the risk of programming errors due to forgotten state in + the output stream (e.g. ‘cout << hex;’ not followed by ‘cout << + dec;’). + + +File: autosprintf.info, Node: Class autosprintf, Next: Using autosprintf, Prev: Introduction, Up: Top + +2 The ‘autosprintf’ class +************************* + + An instance of class ‘autosprintf’ just contains a string with the +formatted output result. Such an instance is usually allocated as an +automatic storage variable, i.e. on the stack, not with ‘new’ on the +heap. + + The constructor ‘autosprintf (const char *format, ...)’ takes a +format string and additional arguments, like the C function ‘printf’. + + Conversions to ‘char *’ and ‘std::string’ are defined that return the +encapsulated string. The conversion to ‘char *’ returns a freshly +allocated copy of the encapsulated string; it needs to be freed using +‘delete[]’. The conversion to ‘std::string’ returns a copy of the +encapsulated string, with automatic memory management. + + The destructor ‘~autosprintf ()’ destroys the encapsulated string. + + An ‘operator <<’ is provided that outputs the encapsulated string to +the given ‘ostream’. + + +File: autosprintf.info, Node: Using autosprintf, Next: Licenses, Prev: Class autosprintf, Up: Top + +3 Using ‘autosprintf’ in own programs +************************************* + + To use the ‘autosprintf’ class in your programs, you need to add + + #include "autosprintf.h" + using gnu::autosprintf; + +to your source code. The include file defines the class ‘autosprintf’, +in a namespace called ‘gnu’. The ‘using’ statement makes it possible to +use the class without the (otherwise natural) ‘gnu::’ prefix. + + When linking your program, you need to link with ‘libasprintf’, +because that's where the class is defined. In projects using GNU +‘autoconf’, this means adding ‘AC_LIB_LINKFLAGS([asprintf])’ to +‘configure.in’ or ‘configure.ac’, and using the @LIBASPRINTF@ Makefile +variable that it provides. + + +File: autosprintf.info, Node: Licenses, Prev: Using autosprintf, Up: Top + +Appendix A Licenses +******************* + + The files of this package are covered by the licenses indicated in +each particular file or directory. Here is a summary: + + • The ‘libasprintf’ library is covered by the GNU Lesser General + Public License (LGPL), either version 2.1 of the License, or (at + your option) any later version published by the Free Software + Foundation (FSF). A copy of the license is included in *note GNU + LGPL::. + + • This manual is free documentation. It is dually licensed under the + GNU FDL and the GNU GPL. This means that you can redistribute this + manual under either of these two licenses, at your choice. + This manual is covered by the GNU FDL. Permission is granted to + copy, distribute and/or modify this document under the terms of the + GNU Free Documentation License (FDL), either version 1.2 of the + License, or (at your option) any later version published by the + Free Software Foundation (FSF); with no Invariant Sections, with no + Front-Cover Text, and with no Back-Cover Texts. A copy of the + license is included in *note GNU FDL::. + This manual is covered by the GNU GPL. You can redistribute it + and/or modify it under the terms of the GNU General Public License + (GPL), either version 2 of the License, or (at your option) any + later version published by the Free Software Foundation (FSF). A + copy of the license is included in *note GNU GPL::. + +* Menu: + +* GNU LGPL:: GNU Lesser General Public License +* GNU GPL:: GNU General Public License +* GNU FDL:: GNU Free Documentation License + + +File: autosprintf.info, Node: GNU LGPL, Next: GNU GPL, Up: Licenses + +A.1 GNU LESSER GENERAL PUBLIC LICENSE +===================================== + + Version 2.1, February 1999 + + Copyright © 1991, 1999 Free Software Foundation, Inc. + + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + [This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence the + version number 2.1.] + +Preamble +-------- + + The licenses for most software are designed to take away your freedom +to share and change it. By contrast, the GNU General Public Licenses +are intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software--typically libraries--of the Free Software +Foundation and other authors who decide to use it. You can use it too, +but we suggest you first think carefully about whether this license or +the ordinary General Public License is the better strategy to use in any +particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of it +in new free programs; and that you are informed that you can do these +things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling it. +And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that there +is no warranty for the free library. Also, if the library is modified +by someone else and passed on, the recipients should know that what they +have is not the original version, so that the original author's +reputation will not be affected by problems that might be introduced by +others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that any +patent license obtained for a version of the library must be consistent +with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and is +quite different from the ordinary General Public License. We use this +license for certain libraries in order to permit linking those libraries +into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the entire +combination fits its criteria of freedom. The Lesser General Public +License permits more lax criteria for linking other code with the +library. + + We call this license the “Lesser” General Public License because it +does _Less_ to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less of +an advantage over competing non-free programs. These disadvantages are +the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free library +does the same job as widely used non-free libraries. In this case, +there is little to gain by limiting the free library to free software +only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of free +software. For example, permission to use the GNU C Library in non-free +programs enables many more people to use the whole GNU operating system, +as well as its variant, the GNU/Linux operating system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is linked +with the Library has the freedom and the wherewithal to run that program +using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +--------------------------------------------------------------- + + 0. This License Agreement applies to any software library or other + program which contains a notice placed by the copyright holder or + other authorized party saying it may be distributed under the terms + of this Lesser General Public License (also called "this License"). + Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data + prepared so as to be conveniently linked with application programs + (which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work + which has been distributed under these terms. A "work based on the + Library" means either the Library or any derivative work under + copyright law: that is to say, a work containing the Library or a + portion of it, either verbatim or with modifications and/or + translated straightforwardly into another language. (Hereinafter, + translation is included without limitation in the term + "modification".) + + "Source code" for a work means the preferred form of the work for + making modifications to it. For a library, complete source code + means all the source code for all modules it contains, plus any + associated interface definition files, plus the scripts used to + control compilation and installation of the library. + + Activities other than copying, distribution and modification are + not covered by this License; they are outside its scope. The act + of running a program using the Library is not restricted, and + output from such a program is covered only if its contents + constitute a work based on the Library (independent of the use of + the Library in a tool for writing it). Whether that is true + depends on what the Library does and what the program that uses the + Library does. + + 1. You may copy and distribute verbatim copies of the Library's + complete source code as you receive it, in any medium, provided + that you conspicuously and appropriately publish on each copy an + appropriate copyright notice and disclaimer of warranty; keep + intact all the notices that refer to this License and to the + absence of any warranty; and distribute a copy of this License + along with the Library. + + You may charge a fee for the physical act of transferring a copy, + and you may at your option offer warranty protection in exchange + for a fee. + + 2. You may modify your copy or copies of the Library or any portion of + it, thus forming a work based on the Library, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + a. The modified work must itself be a software library. + + b. You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c. You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d. If a facility in the modified Library refers to a function or + a table of data to be supplied by an application program that + uses the facility, other than as an argument passed when the + facility is invoked, then you must make a good faith effort to + ensure that, in the event an application does not supply such + function or table, the facility still operates, and performs + whatever part of its purpose remains meaningful. + + (For example, a function in a library to compute square roots + has a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function + must be optional: if the application does not supply it, the + square root function must still compute square roots.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the + Library, and can be reasonably considered independent and separate + works in themselves, then this License, and its terms, do not apply + to those sections when you distribute them as separate works. But + when you distribute the same sections as part of a whole which is a + work based on the Library, the distribution of the whole must be on + the terms of this License, whose permissions for other licensees + extend to the entire whole, and thus to each and every part + regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or + contest your rights to work written entirely by you; rather, the + intent is to exercise the right to control the distribution of + derivative or collective works based on the Library. + + In addition, mere aggregation of another work not based on the + Library with the Library (or with a work based on the Library) on a + volume of a storage or distribution medium does not bring the other + work under the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public + License instead of this License to a given copy of the Library. To + do this, you must alter all the notices that refer to this License, + so that they refer to the ordinary GNU General Public License, + version 2, instead of to this License. (If a newer version than + version 2 of the ordinary GNU General Public License has appeared, + then you can specify that version instead if you wish.) Do not + make any other change in these notices. + + Once this change is made in a given copy, it is irreversible for + that copy, so the ordinary GNU General Public License applies to + all subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of the + Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or derivative + of it, under Section 2) in object code or executable form under the + terms of Sections 1 and 2 above provided that you accompany it with + the complete corresponding machine-readable source code, which must + be distributed under the terms of Sections 1 and 2 above on a + medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy + from a designated place, then offering equivalent access to copy + the source code from the same place satisfies the requirement to + distribute the source code, even though third parties are not + compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the + Library, but is designed to work with the Library by being compiled + or linked with it, is called a "work that uses the Library". Such + a work, in isolation, is not a derivative work of the Library, and + therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library + creates an executable that is a derivative of the Library (because + it contains portions of the Library), rather than a "work that uses + the library". The executable is therefore covered by this License. + Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header + file that is part of the Library, the object code for the work may + be a derivative work of the Library even though the source code is + not. Whether this is true is especially significant if the work + can be linked without the Library, or if the work is itself a + library. The threshold for this to be true is not precisely + defined by law. + + If such an object file uses only numerical parameters, data + structure layouts and accessors, and small macros and small inline + functions (ten lines or less in length), then the use of the object + file is unrestricted, regardless of whether it is legally a + derivative work. (Executables containing this object code plus + portions of the Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may + distribute the object code for the work under the terms of Section + 6. Any executables containing that work also fall under Section 6, + whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or link + a "work that uses the Library" with the Library to produce a work + containing portions of the Library, and distribute that work under + terms of your choice, provided that the terms permit modification + of the work for the customer's own use and reverse engineering for + debugging such modifications. + + You must give prominent notice with each copy of the work that the + Library is used in it and that the Library and its use are covered + by this License. You must supply a copy of this License. If the + work during execution displays copyright notices, you must include + the copyright notice for the Library among them, as well as a + reference directing the user to the copy of this License. Also, + you must do one of these things: + + a. Accompany the work with the complete corresponding + machine-readable source code for the Library including + whatever changes were used in the work (which must be + distributed under Sections 1 and 2 above); and, if the work is + an executable linked with the Library, with the complete + machine-readable "work that uses the Library", as object code + and/or source code, so that the user can modify the Library + and then relink to produce a modified executable containing + the modified Library. (It is understood that the user who + changes the contents of definitions files in the Library will + not necessarily be able to recompile the application to use + the modified definitions.) + + b. Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run + time a copy of the library already present on the user's + computer system, rather than copying library functions into + the executable, and (2) will operate properly with a modified + version of the library, if the user installs one, as long as + the modified version is interface-compatible with the version + that the work was made with. + + c. Accompany the work with a written offer, valid for at least + three years, to give the same user the materials specified in + Subsection 6a, above, for a charge no more than the cost of + performing this distribution. + + d. If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the + above specified materials from the same place. + + e. Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the + Library" must include any data and utility programs needed for + reproducing the executable from it. However, as a special + exception, the materials to be distributed need not include + anything that is normally distributed (in either source or binary + form) with the major components (compiler, kernel, and so on) of + the operating system on which the executable runs, unless that + component itself accompanies the executable. + + It may happen that this requirement contradicts the license + restrictions of other proprietary libraries that do not normally + accompany the operating system. Such a contradiction means you + cannot use both them and the Library together in an executable that + you distribute. + + 7. You may place library facilities that are a work based on the + Library side-by-side in a single library together with other + library facilities not covered by this License, and distribute such + a combined library, provided that the separate distribution of the + work based on the Library and of the other library facilities is + otherwise permitted, and provided that you do these two things: + + a. Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b. Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same + work. + + 8. You may not copy, modify, sublicense, link with, or distribute the + Library except as expressly provided under this License. Any + attempt otherwise to copy, modify, sublicense, link with, or + distribute the Library is void, and will automatically terminate + your rights under this License. However, parties who have received + copies, or rights, from you under this License will not have their + licenses terminated so long as such parties remain in full + compliance. + + 9. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify + or distribute the Library or its derivative works. These actions + are prohibited by law if you do not accept this License. + Therefore, by modifying or distributing the Library (or any work + based on the Library), you indicate your acceptance of this License + to do so, and all its terms and conditions for copying, + distributing or modifying the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the + Library), the recipient automatically receives a license from the + original licensor to copy, distribute, link with or modify the + Library subject to these terms and conditions. You may not impose + any further restrictions on the recipients' exercise of the rights + granted herein. You are not responsible for enforcing compliance + by third parties with this License. + + 11. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent + issues), conditions are imposed on you (whether by court order, + agreement or otherwise) that contradict the conditions of this + License, they do not excuse you from the conditions of this + License. If you cannot distribute so as to satisfy simultaneously + your obligations under this License and any other pertinent + obligations, then as a consequence you may not distribute the + Library at all. For example, if a patent license would not permit + royalty-free redistribution of the Library by all those who receive + copies directly or indirectly through you, then the only way you + could satisfy both it and this License would be to refrain entirely + from distribution of the Library. + + If any portion of this section is held invalid or unenforceable + under any particular circumstance, the balance of the section is + intended to apply, and the section as a whole is intended to apply + in other circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of + any such claims; this section has the sole purpose of protecting + the integrity of the free software distribution system which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is + willing to distribute software through any other system and a + licensee cannot impose that choice. + + This section is intended to make thoroughly clear what is believed + to be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in + certain countries either by patents or by copyrighted interfaces, + the original copyright holder who places the Library under this + License may add an explicit geographical distribution limitation + excluding those countries, so that distribution is permitted only + in or among countries not thus excluded. In such case, this + License incorporates the limitation as if written in the body of + this License. + + 13. The Free Software Foundation may publish revised and/or new + versions of the Lesser General Public License from time to time. + Such new versions will be similar in spirit to the present version, + but may differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the + Library specifies a version number of this License which applies to + it and "any later version", you have the option of following the + terms and conditions either of that version or of any later version + published by the Free Software Foundation. If the Library does not + specify a license version number, you may choose any version ever + published by the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free + programs whose distribution conditions are incompatible with these, + write to the author to ask for permission. For software which is + copyrighted by the Free Software Foundation, write to the Free + Software Foundation; we sometimes make exceptions for this. Our + decision will be guided by the two goals of preserving the free + status of all derivatives of our free software and of promoting the + sharing and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO + WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE + LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS + AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY + OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND + PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE + DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR + OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN + WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY + MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE + LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, + INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR + INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF + DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU + OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY + OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS +--------------------------- + +How to Apply These Terms to Your New Libraries +---------------------------------------------- + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of +the ordinary General Public License). + + To apply these terms, attach the following notices to the library. +It is safest to attach them to the start of each source file to most +effectively convey the exclusion of warranty; and each file should have +at least the "copyright" line and a pointer to where the full notice is +found. + + ONE LINE TO GIVE THE LIBRARY'S NAME AND AN IDEA OF WHAT IT DOES. + Copyright (C) YEAR NAME OF AUTHOR + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or (at + your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, see . + + Also add information on how to contact you by electronic and paper +mail. + + You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the library, +if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the library + `Frob' (a library for tweaking knobs) written by James Random Hacker. + + SIGNATURE OF MOE GHOUL, 1 April 1990 + Moe Ghoul, President of Vice + + That's all there is to it! + + +File: autosprintf.info, Node: GNU GPL, Next: GNU FDL, Prev: GNU LGPL, Up: Licenses + +A.2 GNU GENERAL PUBLIC LICENSE +============================== + + Version 2, June 1991 + + Copyright © 1989, 1991 Free Software Foundation, Inc. + + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +Preamble +======== + + The licenses for most software are designed to take away your freedom +to share and change it. By contrast, the GNU General Public License is +intended to guarantee your freedom to share and change free software--to +make sure the software is free for all its users. This General Public +License applies to most of the Free Software Foundation's software and +to any other program whose authors commit to using it. (Some other Free +Software Foundation software is covered by the GNU Lesser General Public +License instead.) You can apply it to your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it if +you want it, that you can change the software or use pieces of it in new +free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, +and (2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +=============================================================== + + 0. This License applies to any program or other work which contains a + notice placed by the copyright holder saying it may be distributed + under the terms of this General Public License. The "Program", + below, refers to any such program or work, and a "work based on the + Program" means either the Program or any derivative work under + copyright law: that is to say, a work containing the Program or a + portion of it, either verbatim or with modifications and/or + translated into another language. (Hereinafter, translation is + included without limitation in the term "modification".) Each + licensee is addressed as "you". + + Activities other than copying, distribution and modification are + not covered by this License; they are outside its scope. The act + of running the Program is not restricted, and the output from the + Program is covered only if its contents constitute a work based on + the Program (independent of having been made by running the + Program). Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's source + code as you receive it, in any medium, provided that you + conspicuously and appropriately publish on each copy an appropriate + copyright notice and disclaimer of warranty; keep intact all the + notices that refer to this License and to the absence of any + warranty; and give any other recipients of the Program a copy of + this License along with the Program. + + You may charge a fee for the physical act of transferring a copy, + and you may at your option offer warranty protection in exchange + for a fee. + + 2. You may modify your copy or copies of the Program or any portion of + it, thus forming a work based on the Program, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + a. You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b. You must cause any work that you distribute or publish, that + in whole or in part contains or is derived from the Program or + any part thereof, to be licensed as a whole at no charge to + all third parties under the terms of this License. + + c. If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display + an announcement including an appropriate copyright notice and + a notice that there is no warranty (or else, saying that you + provide a warranty) and that users may redistribute the + program under these conditions, and telling the user how to + view a copy of this License. (Exception: if the Program + itself is interactive but does not normally print such an + announcement, your work based on the Program is not required + to print an announcement.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the + Program, and can be reasonably considered independent and separate + works in themselves, then this License, and its terms, do not apply + to those sections when you distribute them as separate works. But + when you distribute the same sections as part of a whole which is a + work based on the Program, the distribution of the whole must be on + the terms of this License, whose permissions for other licensees + extend to the entire whole, and thus to each and every part + regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or + contest your rights to work written entirely by you; rather, the + intent is to exercise the right to control the distribution of + derivative or collective works based on the Program. + + In addition, mere aggregation of another work not based on the + Program with the Program (or with a work based on the Program) on a + volume of a storage or distribution medium does not bring the other + work under the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, + under Section 2) in object code or executable form under the terms + of Sections 1 and 2 above provided that you also do one of the + following: + + a. Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of + Sections 1 and 2 above on a medium customarily used for + software interchange; or, + + b. Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a + medium customarily used for software interchange; or, + + c. Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with + such an offer, in accord with Subsection b above.) + + The source code for a work means the preferred form of the work for + making modifications to it. For an executable work, complete + source code means all the source code for all modules it contains, + plus any associated interface definition files, plus the scripts + used to control compilation and installation of the executable. + However, as a special exception, the source code distributed need + not include anything that is normally distributed (in either source + or binary form) with the major components (compiler, kernel, and so + on) of the operating system on which the executable runs, unless + that component itself accompanies the executable. + + If distribution of executable or object code is made by offering + access to copy from a designated place, then offering equivalent + access to copy the source code from the same place counts as + distribution of the source code, even though third parties are not + compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense or distribute the Program is + void, and will automatically terminate your rights under this + License. However, parties who have received copies, or rights, + from you under this License will not have their licenses terminated + so long as such parties remain in full compliance. + + 5. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify + or distribute the Program or its derivative works. These actions + are prohibited by law if you do not accept this License. + Therefore, by modifying or distributing the Program (or any work + based on the Program), you indicate your acceptance of this License + to do so, and all its terms and conditions for copying, + distributing or modifying the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the + Program), the recipient automatically receives a license from the + original licensor to copy, distribute or modify the Program subject + to these terms and conditions. You may not impose any further + restrictions on the recipients' exercise of the rights granted + herein. You are not responsible for enforcing compliance by third + parties to this License. + + 7. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent + issues), conditions are imposed on you (whether by court order, + agreement or otherwise) that contradict the conditions of this + License, they do not excuse you from the conditions of this + License. If you cannot distribute so as to satisfy simultaneously + your obligations under this License and any other pertinent + obligations, then as a consequence you may not distribute the + Program at all. For example, if a patent license would not permit + royalty-free redistribution of the Program by all those who receive + copies directly or indirectly through you, then the only way you + could satisfy both it and this License would be to refrain entirely + from distribution of the Program. + + If any portion of this section is held invalid or unenforceable + under any particular circumstance, the balance of the section is + intended to apply and the section as a whole is intended to apply + in other circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of + any such claims; this section has the sole purpose of protecting + the integrity of the free software distribution system, which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is + willing to distribute software through any other system and a + licensee cannot impose that choice. + + This section is intended to make thoroughly clear what is believed + to be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, + the original copyright holder who places the Program under this + License may add an explicit geographical distribution limitation + excluding those countries, so that distribution is permitted only + in or among countries not thus excluded. In such case, this + License incorporates the limitation as if written in the body of + this License. + + 9. The Free Software Foundation may publish revised and/or new + versions of the General Public License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the + Program specifies a version number of this License which applies to + it and "any later version", you have the option of following the + terms and conditions either of that version or of any later version + published by the Free Software Foundation. If the Program does not + specify a version number of this License, you may choose any + version ever published by the Free Software Foundation. + + 10. If you wish to incorporate parts of the Program into other free + programs whose distribution conditions are different, write to the + author to ask for permission. For software which is copyrighted by + the Free Software Foundation, write to the Free Software + Foundation; we sometimes make exceptions for this. Our decision + will be guided by the two goals of preserving the free status of + all derivatives of our free software and of promoting the sharing + and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO + WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE + LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS + AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY + OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND + PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE + DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR + OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN + WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY + MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE + LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, + INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR + INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF + DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU + OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY + OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +Appendix: How to Apply These Terms to Your New Programs +======================================================= + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. + Copyright (C) YYYY NAME OF AUTHOR + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . + + Also add information on how to contact you by electronic and paper +mail. + + If the program is interactive, make it output a short notice like +this when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) YEAR NAME OF AUTHOR + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + + The hypothetical commands ‘show w’ and ‘show c’ should show the +appropriate parts of the General Public License. Of course, the +commands you use may be called something other than ‘show w’ and ‘show +c’; they could even be mouse-clicks or menu items--whatever suits your +program. + + You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the program, +if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + SIGNATURE OF MOE GHOUL, 1 April 1989 + Moe Ghoul, President of Vice + + This General Public License does not permit incorporating your +program into proprietary programs. If your program is a subroutine +library, you may consider it more useful to permit linking proprietary +applications with the library. If this is what you want to do, use the +GNU Lesser General Public License instead of this License. + + +File: autosprintf.info, Node: GNU FDL, Prev: GNU GPL, Up: Licenses + +A.3 GNU Free Documentation License +================================== + + Version 1.3, 3 November 2008 + + Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + functional and useful document “free” in the sense of freedom: to + assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or + noncommercially. Secondarily, this License preserves for the + author and publisher a way to get credit for their work, while not + being considered responsible for modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. We + recommend this License principally for works whose purpose is + instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work, in any medium, + that contains a notice placed by the copyright holder saying it can + be distributed under the terms of this License. Such a notice + grants a world-wide, royalty-free license, unlimited in duration, + to use that work under the conditions stated herein. The + "Document", below, refers to any such manual or work. Any member + of the public is a licensee, and is addressed as "you". You accept + the license if you copy, modify or distribute the work in a way + requiring permission under copyright law. + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter section + of the Document that deals exclusively with the relationship of the + publishers or authors of the Document to the Document's overall + subject (or to related matters) and contains nothing that could + fall directly within that overall subject. (Thus, if the Document + is in part a textbook of mathematics, a Secondary Section may not + explain any mathematics.) The relationship could be a matter of + historical connection with the subject or with related matters, or + of legal, commercial, philosophical, ethical or political position + regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in the + notice that says that the Document is released under this License. + If a section does not fit the above definition of Secondary then it + is not allowed to be designated as Invariant. The Document may + contain zero Invariant Sections. If the Document does not identify + any Invariant Sections then there are none. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. A + Front-Cover Text may be at most 5 words, and a Back-Cover Text may + be at most 25 words. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, that is suitable for revising the document + straightforwardly with generic text editors or (for images composed + of pixels) generic paint programs or (for drawings) some widely + available drawing editor, and that is suitable for input to text + formatters or for automatic translation to a variety of formats + suitable for input to text formatters. A copy made in an otherwise + Transparent file format whose markup, or absence of markup, has + been arranged to thwart or discourage subsequent modification by + readers is not Transparent. An image format is not Transparent if + used for any substantial amount of text. A copy that is not + "Transparent" is called "Opaque". + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and standard-conforming + simple HTML, PostScript or PDF designed for human modification. + Examples of transparent image formats include PNG, XCF and JPG. + Opaque formats include proprietary formats that can be read and + edited only by proprietary word processors, SGML or XML for which + the DTD and/or processing tools are not generally available, and + the machine-generated HTML, PostScript or PDF produced by some word + processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + The "publisher" means any person or entity that distributes copies + of the Document to the public. + + A section "Entitled XYZ" means a named subunit of the Document + whose title either is precisely XYZ or contains XYZ in parentheses + following text that translates XYZ in another language. (Here XYZ + stands for a specific section name mentioned below, such as + "Acknowledgements", "Dedications", "Endorsements", or "History".) + To "Preserve the Title" of such a section when you modify the + Document means that it remains a section "Entitled XYZ" according + to this definition. + + The Document may include Warranty Disclaimers next to the notice + which states that this License applies to the Document. These + Warranty Disclaimers are considered to be included by reference in + this License, but only as regards disclaiming warranties: any other + implication that these Warranty Disclaimers may have is void and + has no effect on the meaning of this License. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow the + conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies (or copies in media that commonly + have printed covers) of the Document, numbering more than 100, and + the Document's license notice requires Cover Texts, you must + enclose the copies in covers that carry, clearly and legibly, all + these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the title + equally prominent and visible. You may add other material on the + covers in addition. Copying with changes limited to the covers, as + long as they preserve the title of the Document and satisfy these + conditions, can be treated as verbatim copying in other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a machine-readable + Transparent copy along with each Opaque copy, or state in or with + each Opaque copy a computer-network location from which the general + network-using public has access to download using public-standard + network protocols a complete Transparent copy of the Document, free + of added material. If you use the latter option, you must take + reasonably prudent steps, when you begin distribution of Opaque + copies in quantity, to ensure that this Transparent copy will + remain thus accessible at the stated location until at least one + year after the last time you distribute an Opaque copy (directly or + through your agents or retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of copies, + to give them a chance to provide you with an updated version of the + Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with the + Modified Version filling the role of the Document, thus licensing + distribution and modification of the Modified Version to whoever + possesses a copy of it. In addition, you must do these things in + the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of previous + versions (which should, if there were any, be listed in the + History section of the Document). You may use the same title + as a previous version if the original publisher of that + version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has fewer than five), unless they release you + from this requirement. + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section Entitled "History", Preserve its Title, + and add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on the + Title Page. If there is no section Entitled "History" in the + Document, create one stating the title, year, authors, and + publisher of the Document as given on its Title Page, then add + an item describing the Modified Version as stated in the + previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in the + "History" section. You may omit a network location for a work + that was published at least four years before the Document + itself, or if the original publisher of the version it refers + to gives permission. + + K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section + all the substance and tone of each of the contributor + acknowledgements and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, unaltered + in their text and in their titles. Section numbers or the + equivalent are not considered part of the section titles. + + M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section to be Entitled + "Endorsements" or to conflict in title with any Invariant + Section. + + O. Preserve any Warranty Disclaimers. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option designate + some or all of these sections as invariant. To do this, add their + titles to the list of Invariant Sections in the Modified Version's + license notice. These titles must be distinct from any other + section titles. + + You may add a section Entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties--for example, statements of peer review or that the text + has been approved by an organization as the authoritative + definition of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end of + the list of Cover Texts in the Modified Version. Only one passage + of Front-Cover Text and one of Back-Cover Text may be added by (or + through arrangements made by) any one entity. If the Document + already includes a cover text for the same cover, previously added + by you or by arrangement made by the same entity you are acting on + behalf of, you may not add another; but you may replace the old + one, on explicit permission from the previous publisher that added + the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination all + of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice, and that you preserve all + their Warranty Disclaimers. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections Entitled + "History" in the various original documents, forming one section + Entitled "History"; likewise combine any sections Entitled + "Acknowledgements", and any sections Entitled "Dedications". You + must delete all sections Entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the documents + in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow this + License in all other respects regarding verbatim copying of that + document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of a + storage or distribution medium, is called an "aggregate" if the + copyright resulting from the compilation is not used to limit the + legal rights of the compilation's users beyond what the individual + works permit. When the Document is included in an aggregate, this + License does not apply to the other works in the aggregate which + are not themselves derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one half + of the entire aggregate, the Document's Cover Texts may be placed + on covers that bracket the Document within the aggregate, or the + electronic equivalent of covers if the Document is in electronic + form. Otherwise they must appear on printed covers that bracket + the whole aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License, and all the license notices in the + Document, and any Warranty Disclaimers, provided that you also + include the original English version of this License and the + original versions of those notices and disclaimers. In case of a + disagreement between the translation and the original version of + this License or a notice or disclaimer, the original version will + prevail. + + If a section in the Document is Entitled "Acknowledgements", + "Dedications", or "History", the requirement (section 4) to + Preserve its Title (section 1) will typically require changing the + actual title. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense, or distribute it is void, + and will automatically terminate your rights under this License. + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly and + finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from + that copyright holder, and you cure the violation prior to 30 days + after your receipt of the notice. + + Termination of your rights under this section does not terminate + the licenses of parties who have received copies or rights from you + under this License. If your rights have been terminated and not + permanently reinstated, receipt of a copy of some or all of the + same material does not give you any rights to use it. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + . + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If the + Document does not specify a version number of this License, you may + choose any version ever published (not as a draft) by the Free + Software Foundation. If the Document specifies that a proxy can + decide which future versions of this License can be used, that + proxy's public statement of acceptance of a version permanently + authorizes you to choose that version for the Document. + + 11. RELICENSING + + "Massive Multiauthor Collaboration Site" (or "MMC Site") means any + World Wide Web server that publishes copyrightable works and also + provides prominent facilities for anybody to edit those works. A + public wiki that anybody can edit is an example of such a server. + A "Massive Multiauthor Collaboration" (or "MMC") contained in the + site means any set of copyrightable works thus published on the MMC + site. + + "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 + license published by Creative Commons Corporation, a not-for-profit + corporation with a principal place of business in San Francisco, + California, as well as future copyleft versions of that license + published by that same organization. + + "Incorporate" means to publish or republish a Document, in whole or + in part, as part of another Document. + + An MMC is "eligible for relicensing" if it is licensed under this + License, and if all works that were first published under this + License somewhere other than this MMC, and subsequently + incorporated in whole or in part into the MMC, (1) had no cover + texts or invariant sections, and (2) were thus incorporated prior + to November 1, 2008. + + The operator of an MMC Site may republish an MMC contained in the + site under CC-BY-SA on the same site at any time before August 1, + 2009, provided the MMC is eligible for relicensing. + +ADDENDUM: How to use this License for your documents +==================================================== + + To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + + If you have Invariant Sections, Front-Cover Texts and Back-Cover +Texts, replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with + the Front-Cover Texts being LIST, and with the Back-Cover Texts + being LIST. + + If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of free +software license, such as the GNU General Public License, to permit +their use in free software. + + + +Tag Table: +Node: Top1359 +Node: Introduction1729 +Node: Class autosprintf2913 +Node: Using autosprintf3979 +Node: Licenses4838 +Node: GNU LGPL6591 +Node: GNU GPL34608 +Node: GNU FDL53772 + +End Tag Table + + +Local Variables: +coding: utf-8 +End: diff --git a/miniconda3/share/info/gettext.info b/miniconda3/share/info/gettext.info new file mode 100644 index 0000000000000000000000000000000000000000..03d92bd2bd72d25b84262009c7eaad16d7d30d1c --- /dev/null +++ b/miniconda3/share/info/gettext.info @@ -0,0 +1,21938 @@ +This is gettext.info, produced by makeinfo version 7.1 from +gettext.texi. + + Copyright (C) 1995-1998, 2001-2025 Free Software Foundation, Inc. + + This manual is free documentation. It is dually licensed under the +GNU FDL and the GNU GPL. This means that you can redistribute this +manual under either of these two licenses, at your choice. + + This manual is covered by the GNU FDL. Permission is granted to copy, +distribute and/or modify this document under the terms of the GNU Free +Documentation License (FDL), either version 1.2 of the License, or (at +your option) any later version published by the Free Software Foundation +(FSF); with no Invariant Sections, with no Front-Cover Text, and with no +Back-Cover Texts. A copy of the license is included in *note GNU FDL::. + + This manual is covered by the GNU GPL. You can redistribute it and/or +modify it under the terms of the GNU General Public License (GPL), +either version 2 of the License, or (at your option) any later version +published by the Free Software Foundation (FSF). A copy of the license +is included in *note GNU GPL::. +INFO-DIR-SECTION GNU Gettext Utilities +START-INFO-DIR-ENTRY +* gettext: (gettext). GNU gettext utilities. +* autopoint: (gettext)autopoint Invocation. Copy gettext infrastructure. +* envsubst: (gettext)envsubst Invocation. Expand environment variables. +* gettextize: (gettext)gettextize Invocation. Prepare a package for gettext. +* msgattrib: (gettext)msgattrib Invocation. Select part of a PO file. +* msgcat: (gettext)msgcat Invocation. Combine several PO files. +* msgcmp: (gettext)msgcmp Invocation. Compare a PO file and template. +* msgcomm: (gettext)msgcomm Invocation. Match two PO files. +* msgconv: (gettext)msgconv Invocation. Convert PO file to encoding. +* msgen: (gettext)msgen Invocation. Create an English PO file. +* msgexec: (gettext)msgexec Invocation. Process a PO file. +* msgfilter: (gettext)msgfilter Invocation. Pipe a PO file through a filter. +* msgfmt: (gettext)msgfmt Invocation. Make MO files out of PO files. +* msggrep: (gettext)msggrep Invocation. Select part of a PO file. +* msginit: (gettext)msginit Invocation. Create a fresh PO file. +* msgmerge: (gettext)msgmerge Invocation. Update a PO file from template. +* msgunfmt: (gettext)msgunfmt Invocation. Uncompile MO file into PO file. +* msguniq: (gettext)msguniq Invocation. Unify duplicates for PO file. +* ngettext: (gettext)ngettext Invocation. Translate a message with plural. +* xgettext: (gettext)xgettext Invocation. Extract strings into a PO file. +* ISO639: (gettext)Language Codes. ISO 639 language codes. +* ISO3166: (gettext)Country Codes. ISO 3166 country codes. +END-INFO-DIR-ENTRY + + This file provides documentation for GNU ‘gettext’ utilities. It +also serves as a reference for the free Translation Project. + + +File: gettext.info, Node: Top, Next: Introduction, Up: (dir) + +GNU ‘gettext’ utilities +*********************** + + This manual documents the GNU gettext tools and the GNU libintl +library, version 0.25.1. + +* Menu: + +* Introduction:: Introduction +* Users:: The User's View +* PO Files:: The Format of PO Files +* Sources:: Preparing Program Sources +* Template:: Making the PO Template File +* Creating:: Creating a New PO File +* Updating:: Updating Existing PO Files +* Editing:: Editing PO Files +* Manipulating:: Manipulating PO Files +* Binaries:: Producing Binary MO Files +* Programmers:: The Programmer's View +* Translators:: The Translator's View +* Maintainers:: The Maintainer's View +* Installers:: The Installer's and Distributor's View +* Programming Languages:: Other Programming Languages +* Data Formats:: Other Data Formats +* Conclusion:: Concluding Remarks + +* Language Codes:: ISO 639 language codes +* Country Codes:: ISO 3166 country codes +* Licenses:: Licenses + +* Program Index:: Index of Programs +* Option Index:: Index of Command-Line Options +* Variable Index:: Index of Environment Variables +* PO Mode Index:: Index of Emacs PO Mode Commands +* Autoconf Macro Index:: Index of Autoconf Macros +* Index:: General Index + + -- The Detailed Node Listing -- + +Introduction + +* Why:: The Purpose of GNU ‘gettext’ +* Concepts:: I18n, L10n, and Such +* Aspects:: Aspects in Native Language Support +* Files:: Files Conveying Translations +* Overview:: Overview of GNU ‘gettext’ + +The User's View + +* System Installation:: Questions During Operating System Installation +* Setting the GUI Locale:: How to Specify the Locale Used by GUI Programs +* Setting the POSIX Locale:: How to Specify the Locale According to POSIX +* Working in a Windows console:: Obtaining good output in a Windows console +* Installing Localizations:: How to Install Additional Translations + +Setting the Locale through Environment Variables + +* Locale Names:: How a Locale Specification Looks Like +* Locale Environment Variables:: Which Environment Variable Specfies What +* The LANGUAGE variable:: How to Specify a Priority List of Languages + +Preparing Program Sources + +* Importing:: Importing the ‘gettext’ declaration +* Triggering:: Triggering ‘gettext’ Operations +* Preparing Strings:: Preparing Translatable Strings +* Mark Keywords:: How Marks Appear in Sources +* Marking:: Marking Translatable Strings +* Translator advice:: Adding advice for translators +* c-format Flag:: Telling something about the following string +* Special cases:: Special Cases of Translatable Strings +* Bug Report Address:: Letting Users Report Translation Bugs +* Names:: Marking Proper Names for Translation +* Libraries:: Preparing Library Sources + +Making the PO Template File + +* xgettext Invocation:: Invoking the ‘xgettext’ Program +* Combining POTs:: Combining PO Template Files + +Creating a New PO File + +* msginit Invocation:: Invoking the ‘msginit’ Program +* Header Entry:: Filling in the Header Entry + +Updating Existing PO Files + +* msgmerge Invocation:: Invoking the ‘msgmerge’ Program + +Editing PO Files + +* Web based localization:: Web-based PO editing +* Lokalize:: KDE's PO File Editor +* Gtranslator:: GNOME's PO File Editor +* Poedit:: A simple PO File Editor +* OmegaT:: A powerful Translation Editor +* Virtaal:: The Virtaal Translation Editor +* PO Mode:: Emacs's PO File Editor +* Vim:: Editing PO Files in vim +* Compendium:: Using Translation Compendia + +Emacs's PO File Editor + +* Installation:: Completing GNU ‘gettext’ Installation +* Main PO Commands:: Main Commands +* Entry Positioning:: Entry Positioning +* Normalizing:: Normalizing Strings in Entries +* Translated Entries:: Translated Entries +* Fuzzy Entries:: Fuzzy Entries +* Untranslated Entries:: Untranslated Entries +* Obsolete Entries:: Obsolete Entries +* Modifying Translations:: Modifying Translations +* Modifying Comments:: Modifying Comments +* Subedit:: Mode for Editing Translations +* C Sources Context:: C Sources Context +* Auxiliary:: Consulting Auxiliary PO Files + +Using Translation Compendia + +* Creating Compendia:: Merging translations for later use +* Using Compendia:: Using older translations if they fit + +Manipulating PO Files + +* msgcat Invocation:: Invoking the ‘msgcat’ Program +* msgconv Invocation:: Invoking the ‘msgconv’ Program +* msggrep Invocation:: Invoking the ‘msggrep’ Program +* msgfilter Invocation:: Invoking the ‘msgfilter’ Program +* msguniq Invocation:: Invoking the ‘msguniq’ Program +* msgcomm Invocation:: Invoking the ‘msgcomm’ Program +* msgcmp Invocation:: Invoking the ‘msgcmp’ Program +* msgattrib Invocation:: Invoking the ‘msgattrib’ Program +* msgen Invocation:: Invoking the ‘msgen’ Program +* msgexec Invocation:: Invoking the ‘msgexec’ Program +* Colorizing:: Highlighting parts of PO files +* Other tools:: Other tools for manipulating PO files +* libgettextpo:: Writing your own programs that process PO files + +Highlighting parts of PO files + +* The --color option:: Triggering colorized output +* The TERM variable:: The environment variable ‘TERM’ +* The --style option:: The ‘--style’ option +* Style rules:: Style rules for PO files +* Customizing less:: Customizing ‘less’ for viewing PO files + +Producing Binary MO Files + +* msgfmt Invocation:: Invoking the ‘msgfmt’ Program +* msgunfmt Invocation:: Invoking the ‘msgunfmt’ Program +* MO Files:: The Format of GNU MO Files + +The Programmer's View + +* catgets:: About ‘catgets’ +* gettext:: About ‘gettext’ +* Comparison:: Comparing the two interfaces +* Using libintl.a:: Using libintl.a in own programs +* gettext grok:: Being a ‘gettext’ grok +* Temp Programmers:: Temporary Notes for the Programmers Chapter + +About ‘catgets’ + +* Interface to catgets:: The interface +* Problems with catgets:: Problems with the ‘catgets’ interface?! + +About ‘gettext’ + +* Interface to gettext:: The interface +* Ambiguities:: Solving ambiguities +* Locating Catalogs:: Locating message catalog files +* Charset conversion:: How to request conversion to Unicode +* Contexts:: Solving ambiguities in GUI programs +* Plural forms:: Additional functions for handling plurals +* Optimized gettext:: Optimization of the *gettext functions + +Temporary Notes for the Programmers Chapter + +* Temp Implementations:: Temporary - Two Possible Implementations +* Temp catgets:: Temporary - About ‘catgets’ +* Temp WSI:: Temporary - Why a single implementation +* Temp Notes:: Temporary - Notes + +The Translator's View + +* Organization:: Organization +* Responsibilities:: Responsibilities in the Translation Project +* Dialects:: Language dialects +* Translating plural forms:: How to fill in ‘msgstr[0]’, ‘msgstr[1]’ +* Prioritizing messages:: How to find which messages to translate first + +The Maintainer's View + +* Flat and Non-Flat:: Flat or Non-Flat Directory Structures +* Prerequisites:: Prerequisite Works +* gettextize Invocation:: Invoking the ‘gettextize’ Program +* Adjusting Files:: Files You Must Create or Alter +* autoconf macros:: Autoconf macros for use in ‘configure.ac’ +* Version Control Issues:: +* Release Management:: Creating a Distribution Tarball + +Files You Must Create or Alter + +* po/POTFILES.in:: ‘POTFILES.in’ in ‘po/’ +* po/LINGUAS:: ‘LINGUAS’ in ‘po/’ +* po/Makevars:: ‘Makevars’ in ‘po/’ +* po/Rules-*:: Extending ‘Makefile’ in ‘po/’ +* configure.ac:: ‘configure.ac’ at top level +* config.guess:: ‘config.guess’, ‘config.sub’ at top level +* mkinstalldirs:: ‘mkinstalldirs’ at top level +* aclocal:: ‘aclocal.m4’ at top level +* config.h.in:: ‘config.h.in’ at top level +* Makefile:: ‘Makefile.in’ at top level +* src/Makefile:: ‘Makefile.in’ in ‘src/’ +* lib/gettext.h:: ‘gettext.h’ in ‘lib/’ + +Autoconf macros for use in ‘configure.ac’ + +* AM_GNU_GETTEXT:: AM_GNU_GETTEXT in ‘gettext.m4’ +* AM_GNU_GETTEXT_VERSION:: AM_GNU_GETTEXT_VERSION in ‘gettext.m4’ +* AM_GNU_GETTEXT_NEED:: AM_GNU_GETTEXT_NEED in ‘gettext.m4’ +* AM_PO_SUBDIRS:: AM_PO_SUBDIRS in ‘po.m4’ +* AM_XGETTEXT_OPTION:: AM_XGETTEXT_OPTION in ‘po.m4’ +* AM_ICONV:: AM_ICONV in ‘iconv.m4’ + +Integrating with Version Control Systems + +* Distributed Development:: Avoiding version mismatch in distributed development +* Files under Version Control:: Files to put under version control +* Translations under Version Control:: Put PO Files under Version Control +* autopoint Invocation:: Invoking the ‘autopoint’ Program + +Other Programming Languages + +* Language Implementors:: The Language Implementor's View +* Programmers for other Languages:: The Programmer's View +* Translators for other Languages:: The Translator's View +* Maintainers for other Languages:: The Maintainer's View +* List of Programming Languages:: Individual Programming Languages + +The Translator's View + +* c-format:: C Format Strings +* objc-format:: Objective C Format Strings +* c++-format:: C++ Format Strings +* python-format:: Python Format Strings +* java-format:: Java Format Strings +* csharp-format:: C# Format Strings +* javascript-format:: JavaScript Format Strings +* scheme-format:: Scheme Format Strings +* lisp-format:: Lisp Format Strings +* elisp-format:: Emacs Lisp Format Strings +* librep-format:: librep Format Strings +* rust-format:: Rust Format Strings +* go-format:: Go Format Strings +* ruby-format:: Ruby Format Strings +* sh-format:: Shell Format Strings +* awk-format:: awk Format Strings +* lua-format:: Lua Format Strings +* object-pascal-format:: Object Pascal Format Strings +* modula2-format:: Modula-2 Format Strings +* d-format:: D Format Strings +* smalltalk-format:: Smalltalk Format Strings +* qt-format:: Qt Format Strings +* qt-plural-format:: Qt Plural Format Strings +* kde-format:: KDE Format Strings +* kde-kuit-format:: KUIT Format Strings +* boost-format:: Boost Format Strings +* tcl-format:: Tcl Format Strings +* perl-format:: Perl Format Strings +* php-format:: PHP Format Strings +* gcc-internal-format:: GCC internal Format Strings +* gfc-internal-format:: GFC internal Format Strings +* ycp-format:: YCP Format Strings + +Individual Programming Languages + +* C:: C, C++, Objective C +* Python:: Python +* Java:: Java +* C#:: C# +* JavaScript:: JavaScript +* TypeScript:: TypeScript +* Scheme:: GNU guile - Scheme +* Common Lisp:: GNU clisp - Common Lisp +* clisp C:: GNU clisp C sources +* Emacs Lisp:: Emacs Lisp +* librep:: librep +* Rust:: Rust +* Go:: Go +* Ruby:: Ruby +* sh:: sh - Shell Script +* bash:: bash - Bourne-Again Shell Script +* gawk:: GNU awk +* Lua:: Lua +* Pascal:: Pascal - Free Pascal Compiler +* Modula-2:: Modula-2 +* Smalltalk:: GNU Smalltalk +* Vala:: Vala +* wxWidgets:: wxWidgets library +* Tcl:: Tcl - Tk's scripting language +* Perl:: Perl +* PHP:: PHP Hypertext Preprocessor +* Pike:: Pike +* GCC-source:: GNU Compiler Collection sources +* YCP:: YCP - YaST2 scripting language + +sh - Shell Script + +* Preparing Shell Scripts:: Preparing Shell Scripts for Internationalization +* gettext.sh:: Contents of ‘gettext.sh’ +* gettext Invocation:: Invoking the ‘gettext’ program +* ngettext Invocation:: Invoking the ‘ngettext’ program +* envsubst Invocation:: Invoking the ‘envsubst’ program +* eval_gettext Invocation:: Invoking the ‘eval_gettext’ function +* eval_ngettext Invocation:: Invoking the ‘eval_ngettext’ function +* eval_pgettext Invocation:: Invoking the ‘eval_pgettext’ function +* eval_npgettext Invocation:: Invoking the ‘eval_npgettext’ function + +Perl + +* General Problems:: General Problems Parsing Perl Code +* Default Keywords:: Which Keywords Will xgettext Look For? +* Special Keywords:: How to Extract Hash Keys +* Quote-like Expressions:: What are Strings And Quote-like Expressions? +* Interpolation I:: Unsupported String Interpolation +* Interpolation II:: Valid String Interpolation +* Parentheses:: When To Use Parentheses +* Long Lines:: How To Grok with Long Lines +* Perl Pitfalls:: Bugs, Pitfalls, and Things That Do Not Work + +Other Data Formats + +* Internationalizable Data:: Internationalizable Data Formats +* Localized Data:: Localized Data Formats + +Internationalizable Data Formats + +* POT:: POT - Portable Object Template +* RST:: Resource String Table +* Glade:: Glade - GNOME user interface description +* GSettings:: GSettings - GNOME user configuration schema +* AppData:: AppData - freedesktop.org application description +* Preparing ITS Rules:: Preparing Rules for XML Internationalization + +Preparing Rules for XML Internationalization + +* ITS Rules:: Specifying ITS Rules +* Locating Rules:: Specifying where to find the ITS Rules + +Localized Data Formats + +* Editable Message Catalogs:: Editable Message Catalogs +* Compiled Message Catalogs:: Compiled Message Catalogs +* Desktop Entry:: Desktop Entry files +* XML:: XML files + +Editable Message Catalogs + +* PO:: PO - Portable Object +* Java .properties:: Java .properties +* GNUstep .strings:: NeXTstep/GNUstep .strings + +Compiled Message Catalogs + +* MO:: MO - Machine Object +* Java ResourceBundle:: Java ResourceBundle +* C# Satellite Assembly:: C# Satellite Assembly +* C# Resource:: C# Resource +* Tcl message catalog:: Tcl message catalog +* Qt message catalog:: Qt message catalog + +Concluding Remarks + +* History:: History of GNU ‘gettext’ +* The original ABOUT-NLS:: Historical introduction +* References:: Related Readings + +Language Codes + +* Usual Language Codes:: Two-letter ISO 639 language codes +* Rare Language Codes:: Three-letter ISO 639 language codes + +Licenses + +* GNU GPL:: GNU General Public License +* GNU LGPL:: GNU Lesser General Public License +* GNU FDL:: GNU Free Documentation License + + + +File: gettext.info, Node: Introduction, Next: Users, Prev: Top, Up: Top + +1 Introduction +************** + + This chapter explains the goals sought in the creation of GNU +‘gettext’ and the free Translation Project. Then, it explains a few +broad concepts around Native Language Support, and positions message +translation with regard to other aspects of national and cultural +variance, as they apply to programs. It also surveys those files used +to convey the translations. It explains how the various tools interact +in the initial generation of these files, and later, how the maintenance +cycle should usually operate. + + In this manual, we use _he_ when speaking of the programmer or +maintainer, _she_ when speaking of the translator, and _they_ when +speaking of the installers or end users of the translated program. This +is only a convenience for clarifying the documentation. It is +_absolutely_ not meant to imply that some roles are more appropriate to +males or females. Besides, as you might guess, GNU ‘gettext’ is meant +to be useful for people using computers, whatever their sex, race, +religion or nationality! + + Please submit suggestions and corrections + • either in the bug tracker at + + • or by email to ‘bug-gettext@gnu.org’. + +Please include the manual's edition number and update date in your +messages. + +* Menu: + +* Why:: The Purpose of GNU ‘gettext’ +* Concepts:: I18n, L10n, and Such +* Aspects:: Aspects in Native Language Support +* Files:: Files Conveying Translations +* Overview:: Overview of GNU ‘gettext’ + + +File: gettext.info, Node: Why, Next: Concepts, Up: Introduction + +1.1 The Purpose of GNU ‘gettext’ +================================ + + Usually, programs are written and documented in English, and use +English at execution time to interact with users. This is true not only +of GNU software, but also of a great deal of proprietary and free +software. Using a common language is quite handy for communication +between developers, maintainers and users from all countries. On the +other hand, most people are less comfortable with English than with +their own native language, and would prefer to use their mother tongue +for day to day's work, as far as possible. Many would simply _love_ to +see their computer screen showing a lot less of English, and far more of +their own language. + + However, to many people, this dream might appear so far fetched that +they may believe it is not even worth spending time thinking about it. +They have no confidence at all that the dream might ever become true. +Yet some have not lost hope, and have organized themselves. The +Translation Project is a formalization of this hope into a workable +structure, which has a good chance to get all of us nearer the +achievement of a truly multi-lingual set of programs. + + GNU ‘gettext’ is an important step for the Translation Project, as it +is an asset on which we may build many other steps. This package offers +to programmers, translators and even users, a well integrated set of +tools and documentation. Specifically, the GNU ‘gettext’ utilities are +a set of tools that provides a framework within which other free +packages may produce multi-lingual messages. These tools include + + • A set of conventions about how programs should be written to + support message catalogs. + + • A directory and file naming organization for the message catalogs + themselves. + + • A runtime library supporting the retrieval of translated messages. + + • A few stand-alone programs to massage in various ways the sets of + translatable strings, or already translated strings. + + • A library supporting the parsing and creation of files containing + translated messages. + + • A special mode for Emacs(1) which helps preparing these sets and + bringing them up to date. + + GNU ‘gettext’ is designed to minimize the impact of +internationalization on program sources, keeping this impact as small +and hardly noticeable as possible. Internationalization has better +chances of succeeding if it is very light weighted, or at least, appear +to be so, when looking at program sources. + + The Translation Project also uses the GNU ‘gettext’ distribution as a +vehicle for documenting its structure and methods. This goes beyond the +strict technicalities of documenting the GNU ‘gettext’ proper. By so +doing, translators will find in a single place, as far as possible, all +they need to know for properly doing their translating work. Also, this +supplemental documentation might also help programmers, and even curious +users, in understanding how GNU ‘gettext’ is related to the remainder of +the Translation Project, and consequently, have a glimpse at the _big +picture_. + + ---------- Footnotes ---------- + + (1) In this manual, all mentions of Emacs refers to either GNU Emacs +or to XEmacs, which people sometimes call FSF Emacs and Lucid Emacs, +respectively. + + +File: gettext.info, Node: Concepts, Next: Aspects, Prev: Why, Up: Introduction + +1.2 I18n, L10n, and Such +======================== + + Two long words appear all the time when we discuss support of native +language in programs, and these words have a precise meaning, worth +being explained here, once and for all in this document. The words are +_internationalization_ and _localization_. Many people, tired of +writing these long words over and over again, took the habit of writing +“i18n” and “l10n” instead, quoting the first and last letter of each +word, and replacing the run of intermediate letters by a number merely +telling how many such letters there are. But in this manual, in the +sake of clarity, we will patiently write the names in full, each time... + + By “internationalization”, one refers to the operation by which a +program, or a set of programs turned into a package, is made aware of +and able to support multiple languages. This is a generalization +process, by which the programs are untied from calling only English +strings or other English specific habits, and connected to generic ways +of doing the same, instead. Program developers may use various +techniques to internationalize their programs. Some of these have been +standardized. GNU ‘gettext’ offers one of these standards. *Note +Programmers::. + + By “localization”, one means the operation by which, in a set of +programs already internationalized, one gives the program all needed +information so that it can adapt itself to handle its input and output +in a fashion which is correct for some native language and cultural +habits. This is a particularisation process, by which generic methods +already implemented in an internationalized program are used in specific +ways. The programming environment puts several functions to the +programmers disposal which allow this runtime configuration. The formal +description of specific set of cultural habits for some country, +together with all associated translations targeted to the same native +language, is called the “locale” for this language or country. Users +achieve localization of programs by setting proper values to special +environment variables, prior to executing those programs, identifying +which locale should be used. + + In fact, locale message support is only one component of the cultural +data that makes up a particular locale. There are a whole host of +routines and functions provided to aid programmers in developing +internationalized software and which allow them to access the data +stored in a particular locale. When someone presently refers to a +particular locale, they are obviously referring to the data stored +within that particular locale. Similarly, if a programmer is referring +to "accessing the locale routines", they are referring to the complete +suite of routines that access all of the locale's information. + + One uses the expression “Native Language Support”, or merely NLS, for +speaking of the overall activity or feature encompassing both +internationalization and localization, allowing for multi-lingual +interactions in a program. In a nutshell, one could say that +internationalization is the operation by which further localizations are +made possible. + + Also, very roughly said, when it comes to multi-lingual messages, +internationalization is usually taken care of by programmers, and +localization is usually taken care of by translators. + + +File: gettext.info, Node: Aspects, Next: Files, Prev: Concepts, Up: Introduction + +1.3 Aspects in Native Language Support +====================================== + + For a totally multi-lingual distribution, there are many things to +translate beyond output messages. + + • As of today, GNU ‘gettext’ offers a complete toolset for + translating messages output by C programs. Perl scripts and shell + scripts will also need to be translated. Even if there are today + some hooks by which this can be done, these hooks are not + integrated as well as they should be. + + • Some programs, like ‘autoconf’ or ‘bison’, are able to produce + other programs (or scripts). Even if the generating programs + themselves are internationalized, the generated programs they + produce may need internationalization on their own, and this + indirect internationalization could be automated right from the + generating program. In fact, quite usually, generating and + generated programs could be internationalized independently, as the + effort needed is fairly orthogonal. + + • A few programs include textual tables which might need translation + themselves, independently of the strings contained in the program + itself. For example, RFC 1345 gives an English description for + each character which the ‘recode’ program is able to reconstruct at + execution. Since these descriptions are extracted from the RFC by + mechanical means, translating them properly would require a prior + translation of the RFC itself. + + • Almost all programs accept options, which are often worded out so + to be descriptive for the English readers; one might want to + consider offering translated versions for program options as well. + + • Many programs read, interpret, compile, or are somewhat driven by + input files which are texts containing keywords, identifiers, or + replies which are inherently translatable. For example, one may + want ‘gcc’ to allow diacriticized characters in identifiers or use + translated keywords; ‘rm -i’ might accept something else than ‘y’ + or ‘n’ for replies, etc. Even if the program will eventually make + most of its output in the foreign languages, one has to decide + whether the input syntax, option values, etc., are to be localized + or not. + + • The manual accompanying a package, as well as all documentation + files in the distribution, could surely be translated, too. + Translating a manual, with the intent of later keeping up with + updates, is a major undertaking in itself, generally. + + As we already stressed, translation is only one aspect of locales. +Other internationalization aspects are system services and are handled +in GNU ‘libc’. There are many attributes that are needed to define a +country's cultural conventions. These attributes include beside the +country's native language, the formatting of the date and time, the +representation of numbers, the symbols for currency, etc. These local +“rules” are termed the country's locale. The locale represents the +knowledge needed to support the country's native attributes. + + There are a few major areas which may vary between countries and +hence, define what a locale must describe. The following list helps +putting multi-lingual messages into the proper context of other tasks +related to locales. See the GNU ‘libc’ manual for details. + +_Characters and Codesets_ + + The codeset most commonly used through out the USA and most English + speaking parts of the world is the ASCII codeset. However, there + are many characters needed by various locales that are not found + within this codeset. The 8-bit ISO 8859-1 code set has most of the + special characters needed to handle the major European languages. + However, in many cases, choosing ISO 8859-1 is nevertheless not + adequate: it doesn't even handle the major European currency. + Hence each locale will need to specify which codeset they need to + use and will need to have the appropriate character handling + routines to cope with the codeset. + +_Currency_ + + The symbols used vary from country to country as does the position + used by the symbol. Software needs to be able to transparently + display currency figures in the native mode for each locale. + +_Dates_ + + The format of date varies between locales. For example, Christmas + day in 1994 is written as 12/25/94 in the USA and as 25/12/94 in + Australia. Other countries might use ISO 8601 dates, etc. + + Time of the day may be noted as HH:MM, HH.MM, or otherwise. Some + locales require time to be specified in 24-hour mode rather than as + AM or PM. Further, the nature and yearly extent of the Daylight + Saving correction vary widely between countries. + +_Numbers_ + + Numbers can be represented differently in different locales. For + example, the following numbers are all written correctly for their + respective locales: + + 12,345.67 English + 12.345,67 German + 12345,67 French + 1,2345.67 Asia + + Some programs could go further and use different unit systems, like + English units or Metric units, or even take into account variants + about how numbers are spelled in full. + +_Messages_ + + The most obvious area is the language support within a locale. + This is where GNU ‘gettext’ provides the means for developers and + users to easily change the language that the software uses to + communicate to the user. + + These areas of cultural conventions are called _locale categories_. +It is an unfortunate term; _locale aspects_ or _locale feature +categories_ would be a better term, because each "locale category" +describes an area or task that requires localization. The concrete data +that describes the cultural conventions for such an area and for a +particular culture is also called a _locale category_. In this sense, a +locale is composed of several locale categories: the locale category +describing the codeset, the locale category describing the formatting of +numbers, the locale category containing the translated messages, and so +on. + + Components of locale outside of message handling are standardized in +the ISO C standard and the POSIX:2001 standard (also known as the SUSV3 +specification). GNU ‘libc’ fully implements this, and most other modern +systems provide a more or less reasonable support for at least some of +the missing components. + + +File: gettext.info, Node: Files, Next: Overview, Prev: Aspects, Up: Introduction + +1.4 Files Conveying Translations +================================ + + The letters PO in ‘.po’ files means Portable Object, to distinguish +it from ‘.mo’ files, where MO stands for Machine Object. This paradigm, +as well as the PO file format, is inspired by the NLS standard developed +by Uniforum, and first implemented by Sun in their Solaris system. + + PO files are meant to be read and edited by humans, and associate +each original, translatable string of a given package with its +translation in a particular target language. A single PO file is +dedicated to a single target language. If a package supports many +languages, there is one such PO file per language supported, and each +package has its own set of PO files. These PO files are best created by +the ‘xgettext’ program, and later updated or refreshed through the +‘msgmerge’ program. Program ‘xgettext’ extracts all marked messages +from a set of C files and initializes a PO file with empty translations. +Program ‘msgmerge’ takes care of adjusting PO files between releases of +the corresponding sources, commenting obsolete entries, initializing new +ones, and updating all source line references. Files ending with ‘.pot’ +are kind of base translation files found in distributions, in PO file +format. + + MO files are meant to be read by programs, and are binary in nature. +A few systems already offer tools for creating and handling MO files as +part of the Native Language Support coming with the system, but the +format of these MO files is often different from system to system, and +non-portable. The tools already provided with these systems don't +support all the features of GNU ‘gettext’. Therefore GNU ‘gettext’ uses +its own format for MO files. Files ending with ‘.gmo’ are really MO +files, when it is known that these files use the GNU format. + + +File: gettext.info, Node: Overview, Prev: Files, Up: Introduction + +1.5 Overview of GNU ‘gettext’ +============================= + + The following diagram summarizes the relation between the files +handled by GNU ‘gettext’ and the tools acting on these files. It is +followed by somewhat detailed explanations, which you should read while +keeping an eye on the diagram. Having a clear understanding of these +interrelations will surely help programmers, translators and +maintainers. + + Original C Sources ---> Preparation ---> Marked C Sources ---. + | + .---------<--- GNU gettext Library | + .--- make <---+ | + | `---------<--------------------+---------------' + | | + | .-----<--- PACKAGE.pot <--- xgettext <---' .---<--- PO Compendium + | | | ^ + | | `---. | + | `---. +---> PO editor ---. + | +----> msgmerge ------> LANG.po ---->--------' | + | .---' | + | | | + | `-------------<---------------. | + | +--- New LANG.po <--------------------' + | .--- LANG.gmo <--- msgfmt <---' + | | + | `---> install ---> /.../LANG/PACKAGE.mo ---. + | +---> "Hello world!" + `-------> install ---> /.../bin/PROGRAM -------' + + As a programmer, the first step to bringing GNU ‘gettext’ into your +package is identifying, right in the C sources, those strings which are +meant to be translatable, and those which are untranslatable. This +tedious job can be done a little more comfortably using emacs PO mode, +but you can use any means familiar to you for modifying your C sources. +Beside this some other simple, standard changes are needed to properly +initialize the translation library. *Note Sources::, for more +information about all this. + + For newly written software the strings of course can and should be +marked while writing it. The ‘gettext’ approach makes this very easy. +Simply put the following lines at the beginning of each file or in a +central header file: + + #define _(String) (String) + #define N_(String) String + #define textdomain(Domain) + #define bindtextdomain(Package, Directory) + +Doing this allows you to prepare the sources for internationalization. +Later when you feel ready for the step to use the ‘gettext’ library +simply replace these definitions by the following: + + #include + #define _(String) gettext (String) + #define gettext_noop(String) String + #define N_(String) gettext_noop (String) + +and link against ‘libintl.a’ or ‘libintl.so’. Note that on GNU systems, +you don't need to link with ‘libintl’ because the ‘gettext’ library +functions are already contained in GNU libc. That is all you have to +change. + + Once the C sources have been modified, the ‘xgettext’ program is used +to find and extract all translatable strings, and create a PO template +file out of all these. This ‘PACKAGE.pot’ file contains all original +program strings. It has sets of pointers to exactly where in C sources +each string is used. All translations are set to empty. The letter ‘t’ +in ‘.pot’ marks this as a Template PO file, not yet oriented towards any +particular language. *Note xgettext Invocation::, for more details +about how one calls the ‘xgettext’ program. If you are _really_ lazy, +you might be interested at working a lot more right away, and preparing +the whole distribution setup (*note Maintainers::). By doing so, you +spare yourself typing the ‘xgettext’ command, as ‘make’ should now +generate the proper things automatically for you! + + The first time through, there is no ‘LANG.po’ yet, so the ‘msgmerge’ +step may be skipped and replaced by a mere copy of ‘PACKAGE.pot’ to +‘LANG.po’, where LANG represents the target language. See *note +Creating:: for details. + + Then comes the initial translation of messages. Translation in +itself is a whole matter, still exclusively meant for humans, and whose +complexity far overwhelms the level of this manual. Nevertheless, a few +hints are given in some other chapter of this manual (*note +Translators::). You will also find there indications about how to +contact translating teams, or becoming part of them, for sharing your +translating concerns with others who target the same native language. + + While adding the translated messages into the ‘LANG.po’ PO file, if +you are not using one of the dedicated PO file editors (*note +Editing::), you are on your own for ensuring that your efforts fully +respect the PO file format, and quoting conventions (*note PO Files::). +This is surely not an impossible task, as this is the way many people +have handled PO files around 1995. On the other hand, by using a PO +file editor, most details of PO file format are taken care of for you, +but you have to acquire some familiarity with PO file editor itself. + + If some common translations have already been saved into a compendium +PO file, translators may use PO mode for initializing untranslated +entries from the compendium, and also save selected translations into +the compendium, updating it (*note Compendium::). Compendium files are +meant to be exchanged between members of a given translation team. + + Programs, or packages of programs, are dynamic in nature: users write +bug reports and suggestion for improvements, maintainers react by +modifying programs in various ways. The fact that a package has already +been internationalized should not make maintainers shy of adding new +strings, or modifying strings already translated. They just do their +job the best they can. For the Translation Project to work smoothly, it +is important that maintainers do not carry translation concerns on their +already loaded shoulders, and that translators be kept as free as +possible of programming concerns. + + The only concern maintainers should have is carefully marking new +strings as translatable, when they should be, and do not otherwise worry +about them being translated, as this will come in proper time. +Consequently, when programs and their strings are adjusted in various +ways by maintainers, and for matters usually unrelated to translation, +‘xgettext’ would construct ‘PACKAGE.pot’ files which are evolving over +time, so the translations carried by ‘LANG.po’ are slowly fading out of +date. + + It is important for translators (and even maintainers) to understand +that package translation is a continuous process in the lifetime of a +package, and not something which is done once and for all at the start. +After an initial burst of translation activity for a given package, +interventions are needed once in a while, because here and there, +translated entries become obsolete, and new untranslated entries appear, +needing translation. + + The ‘msgmerge’ program has the purpose of refreshing an already +existing ‘LANG.po’ file, by comparing it with a newer ‘PACKAGE.pot’ +template file, extracted by ‘xgettext’ out of recent C sources. The +refreshing operation adjusts all references to C source locations for +strings, since these strings move as programs are modified. Also, +‘msgmerge’ comments out as obsolete, in ‘LANG.po’, those already +translated entries which are no longer used in the program sources +(*note Obsolete Entries::). It finally discovers new strings and +inserts them in the resulting PO file as untranslated entries (*note +Untranslated Entries::). *Note msgmerge Invocation::, for more +information about what ‘msgmerge’ really does. + + Whatever route or means taken, the goal is to obtain an updated +‘LANG.po’ file offering translations for all strings. + + The temporal mobility, or fluidity of PO files, is an integral part +of the translation game, and should be well understood, and accepted. +People resisting it will have a hard time participating in the +Translation Project, or will give a hard time to other participants! In +particular, maintainers should relax and include all available official +PO files in their distributions, even if these have not recently been +updated, without exerting pressure on the translator teams to get the +job done. The pressure should rather come from the community of users +speaking a particular language, and maintainers should consider +themselves fairly relieved of any concern about the adequacy of +translation files. On the other hand, translators should reasonably try +updating the PO files they are responsible for, while the package is +undergoing pretest, prior to an official distribution. + + Once the PO file is complete and dependable, the ‘msgfmt’ program is +used for turning the PO file into a machine-oriented format, which may +yield efficient retrieval of translations by the programs of the +package, whenever needed at runtime (*note MO Files::). *Note msgfmt +Invocation::, for more information about all modes of execution for the +‘msgfmt’ program. + + Finally, the modified and marked C sources are compiled and linked +with the GNU ‘gettext’ library, usually through the operation of ‘make’, +given a suitable ‘Makefile’ exists for the project, and the resulting +executable is installed somewhere users will find it. The MO files +themselves should also be properly installed. Given the appropriate +environment variables are set (*note Setting the POSIX Locale::), the +program should localize itself automatically, whenever it executes. + + Shipping the MO files as separate files, as opposed to embedding them +in the executable, has three advantages: + • For the users: It allows users to prepare and install new + translations, without needing to rebuild the package (which may + require developer skills). + • For the distributors: It allows distributions to ship translations + that were produced after the release of the package. + • For the vendors of complex packages: When lengthy quality assurance + steps are required before making a release, this quality assurance + can start before the translators have produced the translations, + shortening the critical path of the release schedule by a week or + two. +Embedding the translations in the executable, whether by the ISO C +‘#embed’ directive or through other means, would deprive users without +developer skills of the ability to fix translation mistakes and add new +translations. + + The remainder of this manual has the purpose of explaining in depth +the various steps outlined above. + + +File: gettext.info, Node: Users, Next: PO Files, Prev: Introduction, Up: Top + +2 The User's View +***************** + + Nowadays, when users log into a computer, they usually find that all +their programs show messages in their native language - at least for +users of languages with an active free software community, like French +or German; to a lesser extent for languages with a smaller participation +in free software and the GNU project, like Hindi and Filipino. + + How does this work? How can the user influence the language that is +used by the programs? This chapter will answer it. + +* Menu: + +* System Installation:: Questions During Operating System Installation +* Setting the GUI Locale:: How to Specify the Locale Used by GUI Programs +* Setting the POSIX Locale:: How to Specify the Locale According to POSIX +* Working in a Windows console:: Obtaining good output in a Windows console +* Installing Localizations:: How to Install Additional Translations + + +File: gettext.info, Node: System Installation, Next: Setting the GUI Locale, Up: Users + +2.1 Operating System Installation +================================= + + The default language is often already specified during operating +system installation. When the operating system is installed, the +installer typically asks for the language used for the installation +process and, separately, for the language to use in the installed +system. Some OS installers only ask for the language once. + + This determines the system-wide default language for all users. But +the installers often give the possibility to install extra localizations +for additional languages. For example, the localizations of KDE (the K +Desktop Environment) and LibreOffice are often bundled separately, as +one installable package per language. + + At this point it is good to consider the intended use of the machine: +If it is a machine designated for personal use, additional localizations +are probably not necessary. If, however, the machine is in use in an +organization or company that has international relationships, one can +consider the needs of guest users. If you have a guest from abroad, for +a week, what could be his preferred locales? It may be worth installing +these additional localizations ahead of time, since they cost only a bit +of disk space at this point. + + The system-wide default language is the locale configuration that is +used when a new user account is created. But the user can have his own +locale configuration that is different from the one of the other users +of the same machine. He can specify it, typically after the first +login, as described in the next section. + + +File: gettext.info, Node: Setting the GUI Locale, Next: Setting the POSIX Locale, Prev: System Installation, Up: Users + +2.2 Setting the Locale Used by GUI Programs +=========================================== + + The immediately available programs in a user's desktop come from a +group of programs called a "desktop environment"; it usually includes +the window manager, a web browser, a text editor, and more. The most +common free desktop environments are KDE, GNOME, and Xfce. + + The locale used by GUI programs of the desktop environment can be +specified in a configuration screen called "control center", "language +settings" or "country settings". + + Individual GUI programs that are not part of the desktop environment +can have their locale specified either in a settings panel, or through +environment variables. + + For some programs, it is possible to specify the locale through +environment variables, possibly even to a different locale than the +desktop's locale. This means, instead of starting a program through a +menu or from the file system, you can start it from the command-line, +after having set some environment variables. The environment variables +can be those specified in the next section (*note Setting the POSIX +Locale::); for some versions of KDE, however, the locale is specified +through a variable ‘KDE_LANG’, rather than ‘LANG’ or ‘LC_ALL’. + + +File: gettext.info, Node: Setting the POSIX Locale, Next: Working in a Windows console, Prev: Setting the GUI Locale, Up: Users + +2.3 Setting the Locale through Environment Variables +==================================================== + + As a user, if your language has been installed for this package, in +the simplest case, you only have to set the ‘LANG’ environment variable +to the appropriate ‘LL_CC’ combination. For example, let's suppose that +you speak German and live in Germany. At the shell prompt, merely +execute ‘setenv LANG de_DE’ (in ‘csh’), ‘export LANG; LANG=de_DE’ (in +‘sh’) or ‘export LANG=de_DE’ (in ‘bash’). This can be done from your +‘.login’ or ‘.profile’ file, once and for all. + +* Menu: + +* Locale Names:: How a Locale Specification Looks Like +* Locale Environment Variables:: Which Environment Variable Specfies What +* The LANGUAGE variable:: How to Specify a Priority List of Languages + + +File: gettext.info, Node: Locale Names, Next: Locale Environment Variables, Up: Setting the POSIX Locale + +2.3.1 Locale Names +------------------ + + A locale name usually has the form ‘LL_CC’. Here + + • ‘LL’ is an ISO 639 two-letter language code. For some languages, a + two-letter code does not exist, and a three-letter code is used + instead. + • ‘CC’ is an ISO 3166 two-letter code of a country or territory. + +For example, for German in Germany, LL is ‘de’, and CC is ‘DE’. You +find a list of the language codes in appendix *note Language Codes:: and +a list of the country codes in appendix *note Country Codes::. + + You might think that the country code specification is redundant. +But in fact, some languages have dialects in different countries. For +example, ‘de_AT’ is used for Austria, and ‘pt_BR’ for Brazil. The +country code serves to distinguish the dialects. + + Many locale names have an extended syntax ‘LL_CC.ENCODING’ that also +specifies the character encoding. These are in use because between 2000 +and 2005, most users have switched to locales in UTF-8 encoding. For +example, the German locale on glibc systems is nowadays ‘de_DE.UTF-8’. +The older name ‘de_DE’ still refers to the German locale as of 2000 that +stores characters in ISO-8859-1 encoding - a text encoding that cannot +even accommodate the Euro currency sign. + + Some locale names use ‘LL_CC@VARIANT’ instead of ‘LL_CC’. The +‘@VARIANT’ can denote any kind of characteristics that is not already +implied by the language LL and the country CC. It can denote a +particular monetary unit. For example, on glibc systems, ‘de_DE@euro’ +denotes the locale that uses the Euro currency, in contrast to the older +locale ‘de_DE’ which implies the use of the currency before 2002. It +can also denote a dialect of the language, or the script used to write +text (for example, ‘sr_RS@latin’ uses the Latin script, whereas ‘sr_RS’ +uses the Cyrillic script to write Serbian), or the orthography rules, or +similar. + + On other systems, some variations of this scheme are used, such as +‘LL’. You can get the list of locales supported by your system for your +language by running the command ‘locale -a | grep '^LL'’. + + There are also two special locales: + • The locale called ‘C’. + When it is used, it disables all localization: in this locale, all + programs standardized by POSIX use English messages and an + unspecified character encoding (often US-ASCII, but sometimes also + ISO-8859-1 or UTF-8, depending on the operating system). + • The locale called ‘C.UTF-8’. + This locale exists on all modern GNU and Unix systems, but not on + all operating systems. When it is used, it disables all + localization as well. It uses UTF-8 as character encoding. + + +File: gettext.info, Node: Locale Environment Variables, Next: The LANGUAGE variable, Prev: Locale Names, Up: Setting the POSIX Locale + +2.3.2 Locale Environment Variables +---------------------------------- + + A locale is composed of several _locale categories_, see *note +Aspects::. When a program looks up locale dependent values, it does +this according to the following environment variables, in priority +order: + + 1. ‘LANGUAGE’ + 2. ‘LC_ALL’ + 3. ‘LC_xxx’, according to selected locale category: ‘LC_CTYPE’, + ‘LC_NUMERIC’, ‘LC_TIME’, ‘LC_COLLATE’, ‘LC_MONETARY’, + ‘LC_MESSAGES’, ... + 4. ‘LANG’ + + Variables whose value is set but is empty are ignored in this lookup. + + ‘LANG’ is the normal environment variable for specifying a locale. +As a user, you normally set this variable (unless some of the other +variables have already been set by the system, in ‘/etc/profile’ or +similar initialization files). + + ‘LC_CTYPE’, ‘LC_NUMERIC’, ‘LC_TIME’, ‘LC_COLLATE’, ‘LC_MONETARY’, +‘LC_MESSAGES’, and so on, are the environment variables meant to +override ‘LANG’ and affecting a single locale category only. For +example, assume you are a Swedish user in Spain, and you want your +programs to handle numbers and dates according to Spanish conventions, +and only the messages should be in Swedish. Then you could create a +locale named ‘sv_ES’ or ‘sv_ES.UTF-8’ by use of the ‘localedef’ program. +But it is simpler, and achieves the same effect, to set the ‘LANG’ +variable to ‘es_ES.UTF-8’ and the ‘LC_MESSAGES’ variable to +‘sv_SE.UTF-8’; these two locales come already preinstalled with the +operating system. + + ‘LC_ALL’ is an environment variable that overrides all of these. It +is typically used in scripts that run particular programs. For example, +‘configure’ scripts generated by GNU autoconf use ‘LC_ALL’ to make sure +that the configuration tests don't operate in locale dependent ways. + + Some systems, unfortunately, set ‘LC_ALL’ in ‘/etc/profile’ or in +similar initialization files. As a user, you therefore have to unset +this variable if you want to set ‘LANG’ and optionally some of the other +‘LC_xxx’ variables. + + The ‘LANGUAGE’ variable is described in the next subsection. + + +File: gettext.info, Node: The LANGUAGE variable, Prev: Locale Environment Variables, Up: Setting the POSIX Locale + +2.3.3 Specifying a Priority List of Languages +--------------------------------------------- + + Not all programs have translations for all languages. By default, an +English message is shown in place of a nonexistent translation. If you +understand other languages, you can set up a priority list of languages. +This is done through a different environment variable, called +‘LANGUAGE’. GNU ‘gettext’ gives preference to ‘LANGUAGE’ over ‘LC_ALL’ +and ‘LANG’ for the purpose of message handling, but you still need to +have ‘LANG’ (or ‘LC_ALL’) set to the primary language; this is required +by other parts of the system libraries. For example, some Swedish users +who would rather read translations in German than English for when +Swedish is not available, set ‘LANGUAGE’ to ‘sv:de’ while leaving ‘LANG’ +to ‘sv_SE’. + + Special advice for Norwegian users: The language code for Norwegian +bokmål changed from ‘no’ to ‘nb’ back in 2003. Most of the message +catalogs for this language are installed under ‘nb’. But in order to +also use the older ones installed under ‘no’, it is recommended for +Norwegian users to set ‘LANGUAGE’ to ‘nb:no’. + + In the ‘LANGUAGE’ environment variable, but not in the other +environment variables, ‘LL_CC’ combinations can be abbreviated as ‘LL’ +to denote the language's main dialect. For example, ‘de’ is equivalent +to ‘de_DE’ (German as spoken in Germany), and ‘pt’ to ‘pt_PT’ +(Portuguese as spoken in Portugal) in this context. + + Special advice for Chinese users: Users who want to see translations +with Simplified Chinese characters should set ‘LANGUAGE’ to ‘zh_CN’, +whereas users who want to see translations with Traditional Chinese +characters should set ‘LANGUAGE’ to ‘zh_TW’. Chinese users in Singapore +will want to set it to ‘zh_SG:zh_CN’, Chinese users in Hong Kong will +want to set it to ‘zh_HK:zh_TW’, and Chinese users in Macao will want to +set it to ‘zh_MO:zh_TW’. Here ‘zh_CN’ or ‘zh_TW’, respectively, acts as +fallback, since only few packages have translations for ‘zh_SG’, +‘zh_HK’, or ‘zh_MO’. + + Note: The variable ‘LANGUAGE’ is ignored if the locale is set to ‘C’. +In other words, you have to first enable localization, by setting ‘LANG’ +(or ‘LC_ALL’) to a value other than ‘C’, before you can use a language +priority list through the ‘LANGUAGE’ variable. + + +File: gettext.info, Node: Working in a Windows console, Next: Installing Localizations, Prev: Setting the POSIX Locale, Up: Users + +2.4 Obtaining good output in a Windows console +============================================== + + On Windows, consoles such as the one started by the ‘cmd.exe’ program +do input and output in an encoding, called "OEM code page", that is +different from the encoding that text-mode programs usually use, called +"ANSI code page". (Note: This problem does not exist for Cygwin +consoles; these consoles do input and output in the UTF-8 encoding.) As +a workaround, you may request that the programs produce output in this +"OEM" encoding. To do so, set the environment variable ‘OUTPUT_CHARSET’ +to the "OEM" encoding, through a command such as + set OUTPUT_CHARSET=CP850 + Note: This has an effect only on strings looked up in message +catalogs; other categories of text are usually not affected by this +setting. Note also that this environment variable also affects output +sent to a file or to a pipe; output to a file is most often expected to +be in the "ANSI" or in the UTF-8 encoding. + + Here are examples of the "ANSI" and "OEM" code pages: + +Territories ANSI encoding OEM encoding + +--------------------------------------------------------------------------- +Western Europe CP1252 CP850 +Slavic countries (Latin 2) CP1250 CP852 +Baltic countries CP1257 CP775 +Russia CP1251 CP866 + + +File: gettext.info, Node: Installing Localizations, Prev: Working in a Windows console, Up: Users + +2.5 Installing Translations for Particular Programs +=================================================== + + Languages are not equally well supported in all packages using GNU +‘gettext’, and more translations are added over time. Usually, you use +the translations that are shipped with the operating system or with +particular packages that you install afterwards. But you can also +install newer localizations directly. For doing this, you will need an +understanding where each localization file is stored on the file system. + + For programs that participate in the Translation Project, you can +start looking for translations here: +. + + For programs that are part of the KDE project, the starting point is: +. + + For programs that are part of the GNOME project, the starting point +is: . + + For other programs, you may check whether the program's source code +package contains some ‘LL.po’ files; often they are kept together in a +directory called ‘po/’. Each ‘LL.po’ file contains the message +translations for the language whose abbreviation of LL. + + +File: gettext.info, Node: PO Files, Next: Sources, Prev: Users, Up: Top + +3 The Format of PO Files +************************ + + The GNU ‘gettext’ toolset helps programmers and translators at +producing, updating and using translation files, mainly those PO files +which are textual, editable files. This chapter explains the format of +PO files. + + A PO file is made up of many entries, each entry holding the relation +between an original untranslated string and its corresponding +translation. All entries in a given PO file usually pertain to a single +project, and all translations are expressed in a single target language. +One PO file “entry” has the following schematic structure: + + WHITE-SPACE + # TRANSLATOR-COMMENTS + #. EXTRACTED-COMMENTS + #: REFERENCE... + #, FLAG... + #| msgid PREVIOUS-UNTRANSLATED-STRING + msgid UNTRANSLATED-STRING + msgstr TRANSLATED-STRING + + The general structure of a PO file should be well understood by the +translator. When using PO mode, very little has to be known about the +format details, as PO mode takes care of them for her. + + A simple entry can look like this: + + #: lib/error.c:116 + msgid "Unknown system error" + msgstr "Error desconegut del sistema" + + Entries begin with some optional white space. Usually, when +generated through GNU ‘gettext’ tools, there is exactly one blank line +between entries. Then comments follow, on lines all starting with the +character ‘#’. There are two kinds of comments: those which have some +white space immediately following the ‘#’ - the TRANSLATOR COMMENTS -, +which comments are created and maintained exclusively by the translator, +and those which have some non-white character just after the ‘#’ - the +AUTOMATIC COMMENTS -, which comments are created and maintained +automatically by GNU ‘gettext’ tools. Comment lines starting with ‘#.’ +contain comments given by the programmer, directed at the translator; +these comments are called EXTRACTED COMMENTS because the ‘xgettext’ +program extracts them from the program's source code. Comment lines +starting with ‘#:’ contain references to the program's source code. +Comment lines starting with ‘#,’ contain flags; more about these below. +Comment lines starting with ‘#|’ contain the previous untranslated +string for which the translator gave a translation. + + All comments, of either kind, are optional. + + References to the program's source code, in lines that start with +‘#:’, are of the form ‘FILE_NAME:LINE_NUMBER’ or just FILE_NAME. If the +FILE_NAME contains spaces. it is enclosed within Unicode characters +U+2068 and U+2069. + + After white space and comments, entries show two strings, namely +first the untranslated string as it appears in the original program +sources, and then, the translation of this string. The original string +is introduced by the keyword ‘msgid’, and the translation, by ‘msgstr’. +The two strings, untranslated and translated, are quoted in various ways +in the PO file, using ‘"’ delimiters and ‘\’ escapes, but the translator +does not really have to pay attention to the precise quoting format, as +PO mode fully takes care of quoting for her. + + The ‘msgid’ strings, as well as automatic comments, are produced and +managed by other GNU ‘gettext’ tools, and PO mode does not provide means +for the translator to alter these. The most she can do is merely +deleting them, and only by deleting the whole entry. On the other hand, +the ‘msgstr’ string, as well as translator comments, are really meant +for the translator, and PO mode gives her the full control she needs. + + The comment lines beginning with ‘#,’ are special because they are +not completely ignored by the programs as comments generally are. The +comma separated list of FLAGs is used by the ‘msgfmt’ program to give +the user some better diagnostic messages. Currently there are two forms +of flags defined: + +‘fuzzy’ + This flag can be generated by the ‘msgmerge’ program or it can be + inserted by the translator herself. It shows that the ‘msgstr’ + string might not be a correct translation (anymore). Only the + translator can judge if the translation requires further + modification, or is acceptable as is. Once satisfied with the + translation, she then removes this ‘fuzzy’ attribute. The + ‘msgmerge’ program inserts this when it combined the ‘msgid’ and + ‘msgstr’ entries after fuzzy search only. *Note Fuzzy Entries::. + +‘c-format’ +‘no-c-format’ + These flags should not be added by a human. Instead only the + ‘xgettext’ program adds them. In an automated PO file processing + system as proposed here, the user's changes would be thrown away + again as soon as the ‘xgettext’ program generates a new template + file. + + The ‘c-format’ flag indicates that the untranslated string and the + translation are supposed to be C format strings. The ‘no-c-format’ + flag indicates that they are not C format strings, even though the + untranslated string happens to look like a C format string (with + ‘%’ directives). + + When the ‘c-format’ flag is given for a string the ‘msgfmt’ program + does some more tests to check the validity of the translation. + *Note msgfmt Invocation::, *note c-format Flag:: and *note + c-format::. + +‘objc-format’ +‘no-objc-format’ + Likewise for Objective C, see *note objc-format::. + +‘c++-format’ +‘no-c++-format’ + Likewise for C++, see *note c++-format::. + +‘python-format’ +‘no-python-format’ + Likewise for Python, see *note python-format::. + +‘python-brace-format’ +‘no-python-brace-format’ + Likewise for Python brace, see *note python-format::. + +‘java-format’ +‘no-java-format’ + Likewise for Java ‘MessageFormat’ format strings, see *note + java-format::. + +‘java-printf-format’ +‘no-java-printf-format’ + Likewise for Java ‘printf’ format strings, see *note java-format::. + +‘csharp-format’ +‘no-csharp-format’ + Likewise for C#, see *note csharp-format::. + +‘javascript-format’ +‘no-javascript-format’ + Likewise for JavaScript, see *note javascript-format::. + +‘scheme-format’ +‘no-scheme-format’ + Likewise for Scheme, see *note scheme-format::. + +‘lisp-format’ +‘no-lisp-format’ + Likewise for Lisp, see *note lisp-format::. + +‘elisp-format’ +‘no-elisp-format’ + Likewise for Emacs Lisp, see *note elisp-format::. + +‘librep-format’ +‘no-librep-format’ + Likewise for librep, see *note librep-format::. + +‘rust-format’ +‘no-rust-format’ + Likewise for Rust, see *note rust-format::. + +‘go-format’ +‘no-go-format’ + Likewise for Go, see *note go-format::. + +‘ruby-format’ +‘no-ruby-format’ + Likewise for Ruby, see *note ruby-format::. + +‘sh-format’ +‘no-sh-format’ + Likewise for Shell, see *note sh-format::. + +‘awk-format’ +‘no-awk-format’ + Likewise for awk, see *note awk-format::. + +‘lua-format’ +‘no-lua-format’ + Likewise for Lua, see *note lua-format::. + +‘object-pascal-format’ +‘no-object-pascal-format’ + Likewise for Object Pascal, see *note object-pascal-format::. + +‘modula2-format’ +‘no-modula2-format’ + Likewise for Modula-2, see *note modula2-format::. + +‘d-format’ +‘no-d-format’ + Likewise for D, see *note d-format::. + +‘smalltalk-format’ +‘no-smalltalk-format’ + Likewise for Smalltalk, see *note smalltalk-format::. + +‘qt-format’ +‘no-qt-format’ + Likewise for Qt, see *note qt-format::. + +‘qt-plural-format’ +‘no-qt-plural-format’ + Likewise for Qt plural forms, see *note qt-plural-format::. + +‘kde-format’ +‘no-kde-format’ + Likewise for KDE, see *note kde-format::. + +‘boost-format’ +‘no-boost-format’ + Likewise for Boost, see *note boost-format::. + +‘tcl-format’ +‘no-tcl-format’ + Likewise for Tcl, see *note tcl-format::. + +‘perl-format’ +‘no-perl-format’ + Likewise for Perl, see *note perl-format::. + +‘perl-brace-format’ +‘no-perl-brace-format’ + Likewise for Perl brace, see *note perl-format::. + +‘php-format’ +‘no-php-format’ + Likewise for PHP, see *note php-format::. + +‘gcc-internal-format’ +‘no-gcc-internal-format’ + Likewise for the GCC sources, see *note gcc-internal-format::. + +‘gfc-internal-format’ +‘no-gfc-internal-format’ + Likewise for the GNU Fortran Compiler sources, see *note + gfc-internal-format::. + +‘ycp-format’ +‘no-ycp-format’ + Likewise for YCP, see *note ycp-format::. + + It is also possible to have entries with a context specifier. They +look like this: + + WHITE-SPACE + # TRANSLATOR-COMMENTS + #. EXTRACTED-COMMENTS + #: REFERENCE... + #, FLAG... + #| msgctxt PREVIOUS-CONTEXT + #| msgid PREVIOUS-UNTRANSLATED-STRING + msgctxt CONTEXT + msgid UNTRANSLATED-STRING + msgstr TRANSLATED-STRING + + The context serves to disambiguate messages with the same +UNTRANSLATED-STRING. It is possible to have several entries with the +same UNTRANSLATED-STRING in a PO file, provided that they each have a +different CONTEXT. Note that an empty CONTEXT string and an absent +‘msgctxt’ line do not mean the same thing. + + A different kind of entries is used for translations which involve +plural forms. + + WHITE-SPACE + # TRANSLATOR-COMMENTS + #. EXTRACTED-COMMENTS + #: REFERENCE... + #, FLAG... + #| msgid PREVIOUS-UNTRANSLATED-STRING-SINGULAR + #| msgid_plural PREVIOUS-UNTRANSLATED-STRING-PLURAL + msgid UNTRANSLATED-STRING-SINGULAR + msgid_plural UNTRANSLATED-STRING-PLURAL + msgstr[0] TRANSLATED-STRING-CASE-0 + ... + msgstr[N] TRANSLATED-STRING-CASE-N + + Such an entry can look like this: + + #: src/msgcmp.c:338 src/po-lex.c:699 + #, c-format + msgid "found %d fatal error" + msgid_plural "found %d fatal errors" + msgstr[0] "s'ha trobat %d error fatal" + msgstr[1] "s'han trobat %d errors fatals" + + Here also, a ‘msgctxt’ context can be specified before ‘msgid’, like +above. + + Here, additional kinds of flags can be used: + +‘range:’ + This flag is followed by a range of non-negative numbers, using the + syntax ‘range: MINIMUM-VALUE..MAXIMUM-VALUE’. It designates the + possible values that the numeric parameter of the message can take. + In some languages, translators may produce slightly better + translations if they know that the value can only take on values + between 0 and 10, for example. + + The PREVIOUS-UNTRANSLATED-STRING is optionally inserted by the +‘msgmerge’ program, at the same time when it marks a message fuzzy. It +helps the translator to see which changes were done by the developers on +the UNTRANSLATED-STRING. + + It happens that some lines, usually whitespace or comments, follow +the very last entry of a PO file. Such lines are not part of any entry, +and will be dropped when the PO file is processed by the tools, or may +disturb some PO file editors. + + The remainder of this section may be safely skipped by those using a +PO file editor, yet it may be interesting for everybody to have a better +idea of the precise format of a PO file. On the other hand, those +wishing to modify PO files by hand should carefully continue reading on. + + An empty UNTRANSLATED-STRING is reserved to contain the header entry +with the meta information (*note Header Entry::). This header entry +should be the first entry of the file. The empty UNTRANSLATED-STRING is +reserved for this purpose and must not be used anywhere else. + + Each of UNTRANSLATED-STRING and TRANSLATED-STRING respects the C +syntax for a character string, including the surrounding quotes and +embedded backslashed escape sequences, except that universal character +escape sequences (‘\u’ and ‘\U’) are not allowed. When the time comes +to write multi-line strings, one should not use escaped newlines. +Instead, a closing quote should follow the last character on the line to +be continued, and an opening quote should resume the string at the +beginning of the following PO file line. For example: + + msgid "" + "Here is an example of how one might continue a very long string\n" + "for the common case the string represents multi-line output.\n" + +In this example, the empty string is used on the first line, to allow +better alignment of the ‘H’ from the word ‘Here’ over the ‘f’ from the +word ‘for’. In this example, the ‘msgid’ keyword is followed by three +strings, which are meant to be concatenated. Concatenating the empty +string does not change the resulting overall string, but it is a way for +us to comply with the necessity of ‘msgid’ to be followed by a string on +the same line, while keeping the multi-line presentation left-justified, +as we find this to be a cleaner disposition. The empty string could +have been omitted, but only if the string starting with ‘Here’ was +promoted on the first line, right after ‘msgid’.(1) It was not really +necessary either to switch between the two last quoted strings +immediately after the newline ‘\n’, the switch could have occurred after +_any_ other character, we just did it this way because it is neater. + + One should carefully distinguish between end of lines marked as ‘\n’ +_inside_ quotes, which are part of the represented string, and end of +lines in the PO file itself, outside string quotes, which have no +incidence on the represented string. + + Outside strings, white lines and comments may be used freely. +Comments start at the beginning of a line with ‘#’ and extend until the +end of the PO file line. Comments written by translators should have +the initial ‘#’ immediately followed by some white space. If the ‘#’ is +not immediately followed by white space, this comment is most likely +generated and managed by specialized GNU tools, and might disappear or +be replaced unexpectedly when the PO file is given to ‘msgmerge’. + + For a PO file to be valid, no two entries without ‘msgctxt’ may have +the same UNTRANSLATED-STRING or UNTRANSLATED-STRING-SINGULAR. +Similarly, no two entries may have the same ‘msgctxt’ and the same +UNTRANSLATED-STRING or UNTRANSLATED-STRING-SINGULAR. + + ---------- Footnotes ---------- + + (1) This limitation is not imposed by GNU ‘gettext’, but is for +compatibility with the ‘msgfmt’ implementation on Solaris. + + +File: gettext.info, Node: Sources, Next: Template, Prev: PO Files, Up: Top + +4 Preparing Program Sources +*************************** + + For the programmer, changes to the C source code fall into three +categories. First, you have to make the localization functions known to +all modules needing message translation. Second, you should properly +trigger the operation of GNU ‘gettext’ when the program initializes, +usually from the ‘main’ function. Last, you should identify, adjust and +mark all constant strings in your program needing translation. + +* Menu: + +* Importing:: Importing the ‘gettext’ declaration +* Triggering:: Triggering ‘gettext’ Operations +* Preparing Strings:: Preparing Translatable Strings +* Mark Keywords:: How Marks Appear in Sources +* Marking:: Marking Translatable Strings +* Translator advice:: Adding advice for translators +* c-format Flag:: Telling something about the following string +* Special cases:: Special Cases of Translatable Strings +* Bug Report Address:: Letting Users Report Translation Bugs +* Names:: Marking Proper Names for Translation +* Libraries:: Preparing Library Sources + + +File: gettext.info, Node: Importing, Next: Triggering, Up: Sources + +4.1 Importing the ‘gettext’ declaration +======================================= + + Presuming that your set of programs, or package, has been adjusted so +all needed GNU ‘gettext’ files are available, and your ‘Makefile’ files +are adjusted (*note Maintainers::), each C module having translated C +strings should contain the line: + + #include + + Similarly, each C module containing ‘printf()’/‘fprintf()’/... calls +with a format string that could be a translated C string (even if the C +string comes from a different C module) should contain the line: + + #include + + +File: gettext.info, Node: Triggering, Next: Preparing Strings, Prev: Importing, Up: Sources + +4.2 Triggering ‘gettext’ Operations +=================================== + + The initialization of locale data should be done with more or less +the same code in every program, as demonstrated below: + + int + main (int argc, char *argv[]) + { + ... + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + ... + } + + PACKAGE and LOCALEDIR should be provided either by ‘config.h’ or by +the Makefile. For now consult the ‘gettext’ or ‘hello’ sources for more +information. + + The use of ‘LC_ALL’ might not be appropriate for you. ‘LC_ALL’ +includes all locale categories and especially ‘LC_CTYPE’. This latter +category is responsible for determining character classes with the +‘isalnum’ etc. functions from ‘ctype.h’ which could especially for +programs, which process some kind of input language, be wrong. For +example this would mean that a source code using the ç (c-cedilla +character) is runnable in France but not in the U.S. + + Some systems also have problems with parsing numbers using the +‘scanf’ functions if an other but the ‘LC_ALL’ locale category is used. +The standards say that additional formats but the one known in the ‘"C"’ +locale might be recognized. But some systems seem to reject numbers in +the ‘"C"’ locale format. In some situation, it might also be a problem +with the notation itself which makes it impossible to recognize whether +the number is in the ‘"C"’ locale or the local format. This can happen +if thousands separator characters are used. Some locales define this +character according to the national conventions to ‘'.'’ which is the +same character used in the ‘"C"’ locale to denote the decimal point. + + So it is sometimes necessary to replace the ‘LC_ALL’ line in the code +above by a sequence of ‘setlocale’ lines + + { + ... + setlocale (LC_CTYPE, ""); + setlocale (LC_MESSAGES, ""); + ... + } + +On all POSIX conformant systems the locale categories ‘LC_CTYPE’, +‘LC_MESSAGES’, ‘LC_COLLATE’, ‘LC_MONETARY’, ‘LC_NUMERIC’, and ‘LC_TIME’ +are available. On some systems which are only ISO C compliant, +‘LC_MESSAGES’ is missing, but a substitute for it is defined in GNU +gettext's ‘’ and in GNU gnulib's ‘’. + + Note that changing the ‘LC_CTYPE’ also affects the functions declared +in the ‘’ standard header and some functions declared in the +‘’ and ‘’ standard headers. If this is not +desirable in your application (for example in a compiler's parser), you +can use a set of substitute functions which hardwire the C locale, such +as found in the modules ‘c-ctype’, ‘c-strcase’, ‘c-strcasestr’, +‘c-snprintf’, ‘c-strtod’, ‘c-strtold’, ‘c-dtoastr’, ‘c-ldtoastr’ in the +GNU gnulib source distribution. + + It is also possible to switch the locale forth and back between the +environment dependent locale and the C locale, but this approach is +normally avoided because a ‘setlocale’ call is expensive, because it is +tedious to determine the places where a locale switch is needed in a +large program's source, and because switching a locale is not +multithread-safe. + + +File: gettext.info, Node: Preparing Strings, Next: Mark Keywords, Prev: Triggering, Up: Sources + +4.3 Preparing Translatable Strings +================================== + + Before strings can be marked for translations, they sometimes need to +be adjusted. Usually preparing a string for translation is done right +before marking it, during the marking phase which is described in the +next sections. What you have to keep in mind while doing that is the +following. + + • Decent English style. + + • Entire sentences. + + • Split at paragraphs. + + • Use format strings instead of string concatenation. + + • Use placeholders in format strings instead of embedded URLs. + + • Use placeholders in format strings instead of programmer-defined + format string directives. + + • Avoid unusual markup and unusual control characters. + +Let's look at some examples of these guidelines. + +* Menu: + +* Decent English style:: +* Entire sentences:: +* Split at paragraphs:: +* No string concatenation:: +* No embedded URLs:: +* No custom format directives:: +* No unusual markup:: + + +File: gettext.info, Node: Decent English style, Next: Entire sentences, Up: Preparing Strings + +4.3.1 Decent English style +-------------------------- + + Translatable strings should be in good English style. If slang +language with abbreviations and shortcuts is used, often translators +will not understand the message and will produce very inappropriate +translations. + + "%s: is parameter\n" + +This is nearly untranslatable: Is the displayed item _a_ parameter or +_the_ parameter? + + "No match" + +The ambiguity in this message makes it unintelligible: Is the program +attempting to set something on fire? Does it mean "The given object +does not match the template"? Does it mean "The template does not fit +for any of the objects"? + + In both cases, adding more words to the message will help both the +translator and the English speaking user. + + +File: gettext.info, Node: Entire sentences, Next: Split at paragraphs, Prev: Decent English style, Up: Preparing Strings + +4.3.2 Entire sentences +---------------------- + + Translatable strings should be entire sentences. It is often not +possible to translate single verbs or adjectives in a substitutable way. + + printf ("File %s is %s protected", filename, rw ? "write" : "read"); + +Most translators will not look at the source and will thus only see the +string ‘"File %s is %s protected"’, which is unintelligible. Change +this to + + printf (rw ? "File %s is write protected" : "File %s is read protected", + filename); + +This way the translator will not only understand the message, she will +also be able to find the appropriate grammatical construction. A French +translator for example translates "write protected" like "protected +against writing". + + Entire sentences are also important because in many languages, the +declination of some word in a sentence depends on the gender or the +number (singular/plural) of another part of the sentence. There are +usually more interdependencies between words than in English. The +consequence is that asking a translator to translate two half-sentences +and then combining these two half-sentences through dumb string +concatenation will not work, for many languages, even though it would +work for English. That's why translators need to handle entire +sentences. + + Often sentences don't fit into a single line. If a sentence is +output using two subsequent ‘printf’ statements, like this + + printf ("Locale charset \"%s\" is different from\n", lcharset); + printf ("input file charset \"%s\".\n", fcharset); + +the translator would have to translate two half sentences, but nothing +in the POT file would tell her that the two half sentences belong +together. It is necessary to merge the two ‘printf’ statements so that +the translator can handle the entire sentence at once and decide at +which place to insert a line break in the translation (if at all): + + printf ("Locale charset \"%s\" is different from\n\ + input file charset \"%s\".\n", lcharset, fcharset); + + You may now ask: how about two or more adjacent sentences? Like in +this case: + + puts ("Apollo 13 scenario: Stack overflow handling failed."); + puts ("On the next stack overflow we will crash!!!"); + +Should these two statements merged into a single one? I would recommend +to merge them if the two sentences are related to each other, because +then it makes it easier for the translator to understand and translate +both. On the other hand, if one of the two messages is a stereotypic +one, occurring in other places as well, you will do a favour to the +translator by not merging the two. (Identical messages occurring in +several places are combined by ‘xgettext’, so the translator has to +handle them once only.) + + +File: gettext.info, Node: Split at paragraphs, Next: No string concatenation, Prev: Entire sentences, Up: Preparing Strings + +4.3.3 Split at paragraphs +------------------------- + + Translatable strings should be limited to one paragraph; don't let a +single message be longer than ten lines. The reason is that when the +translatable string changes, the translator is faced with the task of +updating the entire translated string. Maybe only a single word will +have changed in the English string, but the translator doesn't see that +(with the current translation tools), therefore she has to proofread the +entire message. + + Many GNU programs have a ‘--help’ output that extends over several +screen pages. It is a courtesy towards the translators to split such a +message into several ones of five to ten lines each. While doing that, +you can also attempt to split the documented options into groups, such +as the input options, the output options, and the informative output +options. This will help every user to find the option he is looking +for. + + +File: gettext.info, Node: No string concatenation, Next: No embedded URLs, Prev: Split at paragraphs, Up: Preparing Strings + +4.3.4 No string concatenation +----------------------------- + + Hardcoded string concatenation is sometimes used to construct English +strings: + + strcpy (s, "Replace "); + strcat (s, object1); + strcat (s, " with "); + strcat (s, object2); + strcat (s, "?"); + +In order to present to the translator only entire sentences, and also +because in some languages the translator might want to swap the order of +‘object1’ and ‘object2’, it is necessary to change this to use a format +string: + + sprintf (s, "Replace %s with %s?", object1, object2); + +String concatenation operator +----------------------------- + + In many programming languages, a particular operator denotes string +concatenation at runtime (or possibly at compile time, if the compiler +supports that). + + • In C++, string concatenation of ‘std::string’ objects is denoted by + the ‘+’ operator. + • In Python, string concatenation is denoted by the ‘+’ operator. + • In Java, string concatenation is denoted by the ‘+’ operator. + • In C#, string concatenation is denoted by the ‘+’ operator. + • In JavaScript and TypeScript, string concatenation is denoted by + the ‘+’ operator. + • In Go, string concatenation is denoted by the ‘+’ operator. + • In Ruby, string concatenation is denoted by the ‘+’ operator. + • In Shell, string concatenation is denoted by mere juxtaposition of + strings. + • In awk, string concatenation is denoted by mere juxtaposition of + strings. + • In Lua, string concatenation is denoted by the ‘..’ operator. + • In Modula-2, string concatenation is denoted by the ‘+’ operator. + • In D, string concatenation is denoted by the ‘~’ operator. + • In Smalltalk, string concatenation is denoted by the ‘,’ operator. + • In Vala, string concatenation is denoted by the ‘+’ operator. + • In Perl, string concatenation is denoted by the ‘.’ operator. + • In PHP, string concatenation is denoted by the ‘.’ operator. + + So, for example, in Java, you would change + + System.out.println("Replace "+object1+" with "+object2+"?"); + +into a statement involving a format string: + + System.out.println( + MessageFormat.format("Replace {0} with {1}?", + new Object[] { object1, object2 })); + +Similarly, in C#, you would change + + Console.WriteLine("Replace "+object1+" with "+object2+"?"); + +into a statement involving a format string: + + Console.WriteLine( + String.Format("Replace {0} with {1}?", object1, object2)); + +Strings with embedded expressions +--------------------------------- + + In some programming languages, it is possible to have strings with +embedded expressions. The expressions can refer to variables of the +program. The value of such an expression is converted to a string and +inserted in place of the expression; but no formatting function is +called. + + • In Python, _f-strings_ can contain expressions. Such as ‘f"Hello, + {name}!"’. + • In C#, since C# 6.0, _interpolated strings_ can contain + expressions. Such as ‘$"Hello, {name}!"’. + • In JavaScript, since ES6, and in TypeScript, _template literals_ + can contain expressions. Such as ‘`Hello, ${name}!`’. + • In Ruby, _interpolated strings_ can contain expressions. Such as + ‘"Hello, #{name}!"’. + • In Shell language, double-quoted strings can contain references to + variables, along with default values and string operations. Such + as ‘"Hello, $name!"’ or ‘"Hello, ${name}!"’. + • In D, _interpolation expression sequences_ can contain expressions. + Such as ‘i"Hello, $(name)!"’. + • In Tcl, strings are subject to _variable substitution_. Such as + ‘"Hello, $name!"’. + • In Perl, _interpolated strings_ can contain expressions. Such as + ‘"Hello, $name!"’. + • In PHP, string literals are subject to _variable parsing_. Such as + ‘"Hello, $name!"’. + + These cases are effectively string concatenation as well, just with a +different syntax. + + So, for example, in Python, you would change + + print (f'Replace {object1.name} with {object2.name}?') + +into a statement involving a format string: + + print ('Replace %(name1)s with %(name2)s?' + % { 'name1': object1.name, 'name2': object2.name }) + +or equivalently + print ('Replace {name1} with {name2}?' + .format(name1 = object1.name, name2 = object2.name)) + + And in JavaScript, you would change + + print (`Replace ${object1.name} with ${object2.name}?`) + +into a statement involving a format string: + + print ('Replace %s with %s?'.format(object1.name, object2.name)) + +Specifically in JavaScript, an alternative is to use a _tagged_ template +literal: + + print (TAG`Replace ${object1.name} with ${object2.name}?`) + +and pass an option ‘--tag=TAG:FORMAT’ to ‘xgettext’. + +Format strings with embedded named references +--------------------------------------------- + + Format strings with embedded named references are different: They are +suitable for internationalization, because it is possible to insert a +call to the ‘gettext’ function (that will return a translated format +string) _before_ the argument values are inserted in place of the +placeholders. + + The format string types that allow embedded named references are: + + • *note Shell format strings: sh-format. + • In Python, those *note Python format strings: python-format. that + take a dictionary as argument, and the *note Python brace format + strings: python-format. + • In Ruby, those *note Ruby format strings: ruby-format. that take a + hash table as argument. + • In Perl, the *note Perl brace format strings: perl-format. + +The ‘’ macros +------------------------- + + A similar case is compile time concatenation of strings. The ISO C +99 include file ‘’ contains a macro ‘PRId64’ that can be +used as a formatting directive for outputting an ‘int64_t’ integer +through ‘printf’. It expands to a constant string, usually "d" or "ld" +or "lld" or something like this, depending on the platform. Assume you +have code like + + printf ("The amount is %0" PRId64 "\n", number); + +The ‘gettext’ tools and library have special support for these +‘’ macros. You can therefore simply write + + printf (gettext ("The amount is %0" PRId64 "\n"), number); + +The PO file will contain the string "The amount is %0\n". The +translators will provide a translation containing "%0" as well, +and at runtime the ‘gettext’ function's result will contain the +appropriate constant string, "d" or "ld" or "lld". + + This works only for the predefined ‘’ macros. If you +have defined your own similar macros, let's say ‘MYPRId64’, that are not +known to ‘xgettext’, the solution for this problem is to change the code +like this: + + char buf1[100]; + sprintf (buf1, "%0" MYPRId64, number); + printf (gettext ("The amount is %s\n"), buf1); + + This means, you put the platform dependent code in one statement, and +the internationalization code in a different statement. Note that a +buffer length of 100 is safe, because all available hardware integer +types are limited to 128 bits, and to print a 128 bit integer one needs +at most 54 characters, regardless whether in decimal, octal or +hexadecimal. + + +File: gettext.info, Node: No embedded URLs, Next: No custom format directives, Prev: No string concatenation, Up: Preparing Strings + +4.3.5 No embedded URLs +---------------------- + + It is good to not embed URLs in translatable strings, for several +reasons: + • It avoids possible mistakes during copy and paste. + • Translators cannot translate the URLs or, by mistake, use the URLs + from other packages that are present in their compendium. + • When the URLs change, translators don't need to revisit the + translation of the string. + + The same holds for email addresses. + + So, you would change + + fputs (_("GNU GPL version 3 \n"), + stream); + +to + + fprintf (stream, _("GNU GPL version 3 <%s>\n"), + "https://gnu.org/licenses/gpl.html"); + + +File: gettext.info, Node: No custom format directives, Next: No unusual markup, Prev: No embedded URLs, Up: Preparing Strings + +4.3.6 No programmer-defined format string directives +---------------------------------------------------- + + The GNU C Library's ‘’ facility and the C++ standard +library's ‘’ header file make it possible for the programmer to +define their own format string directives. However, such format +directives cannot be used in translatable strings, for two reasons: + • There is no reference documentation for format strings with such + directives, that the translators could consult. They would + therefore have to guess where the directive starts and where it + ends. + • An ‘msgfmt -c’ invocation cannot check whether the translator has + produced a compatible translation of the format string. As a + consequence, when a format string contains a programmer-defined + directive, the program may crash at runtime when it uses the + translated format string. + + To avoid this situation, you need to move the formatting with the +custom directive into a format string that does not get translated. + + For example, assuming code that makes use of a ‘%r’ directive: + + fprintf (stream, _("The contents is: %r"), data); + +you would rewrite it to: + + char *tmp; + if (asprintf (&tmp, "%r", data) < 0) + error (...); + fprintf (stream, _("The contents is: %s"), tmp); + free (tmp); + + Similarly, in C++, assuming you have defined a custom ‘formatter’ for +the type of ‘data’, the code + + cout << format (_("The contents is: {:#$#}"), data); + +should be rewritten to: + + string tmp = format ("{:#$#}", data); + cout << format (_("The contents is: {}"), tmp); + + +File: gettext.info, Node: No unusual markup, Prev: No custom format directives, Up: Preparing Strings + +4.3.7 No unusual markup +----------------------- + + Unusual markup or control characters should not be used in +translatable strings. Translators will likely not understand the +particular meaning of the markup or control characters. + + For example, if you have a convention that ‘|’ delimits the left-hand +and right-hand part of some GUI elements, translators will often not +understand it without specific comments. It might be better to have the +translator translate the left-hand and right-hand part separately. + + Another example is the ‘argp’ convention to use a single ‘\v’ +(vertical tab) control character to delimit two sections inside a +string. This is flawed. Some translators may convert it to a simple +newline, some to blank lines. With some PO file editors it may not be +easy to even enter a vertical tab control character. So, you cannot be +sure that the translation will contain a ‘\v’ character, at the +corresponding position. The solution is, again, to let the translator +translate two separate strings and combine at run-time the two +translated strings with the ‘\v’ required by the convention. + + HTML markup, however, is common enough that it's probably ok to use +in translatable strings. But please bear in mind that the GNU gettext +tools don't verify that the translations are well-formed HTML. + + +File: gettext.info, Node: Mark Keywords, Next: Marking, Prev: Preparing Strings, Up: Sources + +4.4 How Marks Appear in Sources +=============================== + + All strings requiring translation should be marked in the C sources. +Marking is done in such a way that each translatable string appears to +be the sole argument of some function or preprocessor macro. There are +only a few such possible functions or macros meant for translation, and +their names are said to be marking keywords. The marking is attached to +strings themselves, rather than to what we do with them. This approach +has more uses. A blatant example is an error message produced by +formatting. The format string needs translation, as well as some +strings inserted through some ‘%s’ specification in the format, while +the result from ‘sprintf’ may have so many different instances that it +is impractical to list them all in some ‘error_string_out()’ routine, +say. + + This marking operation has two goals. The first goal of marking is +for triggering the retrieval of the translation, at run time. The +keyword is possibly resolved into a routine able to dynamically return +the proper translation, as far as possible or wanted, for the argument +string. Most localizable strings are found in executable positions, +that is, attached to variables or given as parameters to functions. But +this is not universal usage, and some translatable strings appear in +structured initializations. *Note Special cases::. + + The second goal of the marking operation is to help ‘xgettext’ at +properly extracting all translatable strings when it scans a set of +program sources and produces PO file templates. + + The canonical keyword for marking translatable strings is ‘gettext’, +it gave its name to the whole GNU ‘gettext’ package. For packages +making only light use of the ‘gettext’ keyword, macro or function, it is +easily used _as is_. However, for packages using the ‘gettext’ +interface more heavily, it is usually more convenient to give the main +keyword a shorter, less obtrusive name. Indeed, the keyword might +appear on a lot of strings all over the package, and programmers usually +do not want nor need their program sources to remind them forcefully, +all the time, that they are internationalized. Further, a long keyword +has the disadvantage of using more horizontal space, forcing more +indentation work on sources for those trying to keep them within 79 or +80 columns. + + Many packages use ‘_’ (a simple underline) as a keyword, and write +‘_("Translatable string")’ instead of ‘gettext ("Translatable string")’. +Further, the coding rule, from GNU standards, wanting that there is a +space between the keyword and the opening parenthesis is relaxed, in +practice, for this particular usage. So, the textual overhead per +translatable string is reduced to only three characters: the underline +and the two parentheses. However, even if GNU ‘gettext’ uses this +convention internally, it does not offer it officially. The real, +genuine keyword is truly ‘gettext’ indeed. It is fairly easy for those +wanting to use ‘_’ instead of ‘gettext’ to declare: + + #include + #define _(String) gettext (String) + +instead of merely using ‘#include ’. + + The marking keywords ‘gettext’ and ‘_’ take the translatable string +as sole argument. It is also possible to define marking functions that +take it at another argument position. It is even possible to make the +marked argument position depend on the total number of arguments of the +function call; this is useful in C++. All this is achieved using +‘xgettext’'s ‘--keyword’ option. How to pass such an option to +‘xgettext’, assuming that ‘gettextize’ is used, is described in *note +po/Makevars:: and *note AM_XGETTEXT_OPTION::. + + Note also that long strings can be split across lines, into multiple +adjacent string tokens. Automatic string concatenation is performed at +compile time according to ISO C and ISO C++; ‘xgettext’ also supports +this syntax. + + In C++, marking a C++ format string requires a small code change, +because the first argument to ‘std::format’ must be a constant +expression. For example, + std::format ("{} {}!", "Hello", "world") +needs to be changed to + std::vformat (gettext ("{} {}!"), std::make_format_args("Hello", "world")) + + Later on, the maintenance is relatively easy. If, as a programmer, +you add or modify a string, you will have to ask yourself if the new or +altered string requires translation, and include it within ‘_()’ if you +think it should be translated. For example, ‘"%s"’ is an example of +string _not_ requiring translation. But ‘"%s: %d"’ _does_ require +translation, because in French, unlike in English, it's customary to put +a space before a colon. + + +File: gettext.info, Node: Marking, Next: Translator advice, Prev: Mark Keywords, Up: Sources + +4.5 Marking Translatable Strings +================================ + + In PO mode, one set of features is meant more for the programmer than +for the translator, and allows him to interactively mark which strings, +in a set of program sources, are translatable, and which are not. Even +if it is a fairly easy job for a programmer to find and mark such +strings by other means, using any editor of his choice, PO mode makes +this work more comfortable. Further, this gives translators who feel a +little like programmers, or programmers who feel a little like +translators, a tool letting them work at marking translatable strings in +the program sources, while simultaneously producing a set of translation +in some language, for the package being internationalized. + + The set of program sources, targeted by the PO mode commands describe +here, should have an Emacs tags table constructed for your project, +prior to using these PO file commands. This is easy to do. In any +shell window, change the directory to the root of your project, then +execute a command resembling: + + etags src/*.[hc] lib/*.[hc] + +presuming here you want to process all ‘.h’ and ‘.c’ files from the +‘src/’ and ‘lib/’ directories. This command will explore all said files +and create a ‘TAGS’ file in your root directory, somewhat summarizing +the contents using a special file format Emacs can understand. + + For packages following the GNU coding standards, there is a make goal +‘tags’ or ‘TAGS’ which constructs the tag files in all directories and +for all files containing source code. + + Once your ‘TAGS’ file is ready, the following commands assist the +programmer at marking translatable strings in his set of sources. But +these commands are necessarily driven from within a PO file window, and +it is likely that you do not even have such a PO file yet. This is not +a problem at all, as you may safely open a new, empty PO file, mainly +for using these commands. This empty PO file will slowly fill in while +you mark strings as translatable in your program sources. + +‘,’ + Search through program sources for a string which looks like a + candidate for translation (‘po-tags-search’). + +‘M-,’ + Mark the last string found with ‘_()’ (‘po-mark-translatable’). + +‘M-.’ + Mark the last string found with a keyword taken from a set of + possible keywords. This command with a prefix allows some + management of these keywords (‘po-select-mark-and-mark’). + + The ‘,’ (‘po-tags-search’) command searches for the next occurrence +of a string which looks like a possible candidate for translation, and +displays the program source in another Emacs window, positioned in such +a way that the string is near the top of this other window. If the +string is too big to fit whole in this window, it is positioned so only +its end is shown. In any case, the cursor is left in the PO file +window. If the shown string would be better presented differently in +different native languages, you may mark it using ‘M-,’ or ‘M-.’. +Otherwise, you might rather ignore it and skip to the next string by +merely repeating the ‘,’ command. + + A string is a good candidate for translation if it contains a +sequence of three or more letters. A string containing at most two +letters in a row will be considered as a candidate if it has more +letters than non-letters. The command disregards strings containing no +letters, or isolated letters only. It also disregards strings within +comments, or strings already marked with some keyword PO mode knows (see +below). + + If you have never told Emacs about some ‘TAGS’ file to use, the +command will request that you specify one from the minibuffer, the first +time you use the command. You may later change your ‘TAGS’ file by +using the regular Emacs command ‘M-x visit-tags-table’, which will ask +you to name the precise ‘TAGS’ file you want to use. *Note Tag Tables: +(emacs)Tags. + + Each time you use the ‘,’ command, the search resumes from where it +was left by the previous search, and goes through all program sources, +obeying the ‘TAGS’ file, until all sources have been processed. +However, by giving a prefix argument to the command (‘C-u ,’), you may +request that the search be restarted all over again from the first +program source; but in this case, strings that you recently marked as +translatable will be automatically skipped. + + Using this ‘,’ command does not prevent using of other regular Emacs +tags commands. For example, regular ‘tags-search’ or +‘tags-query-replace’ commands may be used without disrupting the +independent ‘,’ search sequence. However, as implemented, the _initial_ +‘,’ command (or the ‘,’ command is used with a prefix) might also +reinitialize the regular Emacs tags searching to the first tags file, +this reinitialization might be considered spurious. + + The ‘M-,’ (‘po-mark-translatable’) command will mark the recently +found string with the ‘_’ keyword. The ‘M-.’ +(‘po-select-mark-and-mark’) command will request that you type one +keyword from the minibuffer and use that keyword for marking the string. +Both commands will automatically create a new PO file untranslated entry +for the string being marked, and make it the current entry (making it +easy for you to immediately proceed to its translation, if you feel like +doing it right away). It is possible that the modifications made to the +program source by ‘M-,’ or ‘M-.’ render some source line longer than 80 +columns, forcing you to break and re-indent this line differently. You +may use the ‘O’ command from PO mode, or any other window changing +command from Emacs, to break out into the program source window, and do +any needed adjustments. You will have to use some regular Emacs command +to return the cursor to the PO file window, if you want command ‘,’ for +the next string, say. + + The ‘M-.’ command has a few built-in speedups, so you do not have to +explicitly type all keywords all the time. The first such speedup is +that you are presented with a _preferred_ keyword, which you may accept +by merely typing ‘’ at the prompt. The second speedup is that you +may type any non-ambiguous prefix of the keyword you really mean, and +the command will complete it automatically for you. This also means +that PO mode has to _know_ all your possible keywords, and that it will +not accept mistyped keywords. + + If you reply ‘?’ to the keyword request, the command gives a list of +all known keywords, from which you may choose. When the command is +prefixed by an argument (‘C-u M-.’), it inhibits updating any program +source or PO file buffer, and does some simple keyword management +instead. In this case, the command asks for a keyword, written in full, +which becomes a new allowed keyword for later ‘M-.’ commands. Moreover, +this new keyword automatically becomes the _preferred_ keyword for later +commands. By typing an already known keyword in response to ‘C-u M-.’, +one merely changes the _preferred_ keyword and does nothing more. + + All keywords known for ‘M-.’ are recognized by the ‘,’ command when +scanning for strings, and strings already marked by any of those known +keywords are automatically skipped. If many PO files are opened +simultaneously, each one has its own independent set of known keywords. +There is no provision in PO mode, currently, for deleting a known +keyword, you have to quit the file (maybe using ‘q’) and reopen it +afresh. When a PO file is newly brought up in an Emacs window, only +‘gettext’ and ‘_’ are known as keywords, and ‘gettext’ is preferred for +the ‘M-.’ command. In fact, this is not useful to prefer ‘_’, as this +one is already built in the ‘M-,’ command. + + +File: gettext.info, Node: Translator advice, Next: c-format Flag, Prev: Marking, Up: Sources + +4.6 Adding advice for translators +================================= + + Sometimes you might want to add advice for the translators to a +particular message. For example: + • The translatable string might be decent English but nevertheless + ambiguous. + • The translatable string refers to something in English culture + (such as a film's name) that is different in other cultures. + • The translator should make an adjustment that is specific to her + locale. + + The way to do this is to add comments, before the ‘gettext’ +invocation or inside the ‘gettext’ invocation but before the string, +that start with the substring ‘TRANSLATORS:’. These comments will be +extracted into the POT file, so that translators can see them. For +example, when you write + + /* TRANSLATORS: This is an English idiom, + meaning not to reveal a secret. */ + puts (gettext ("Don't spill the beans!")); + +the POT file will contain: + + #. TRANSLATORS: This is an English idiom, + #. meaning not to reveal a secret. + #: source.c:213 + msgid "Don't spill the beans!" + msgstr "" + +and the translators will be shown the advice in a particular place in +their translation tool. + + Only comments that immediately precede the ‘gettext’ invocation or +the translatable string are considered. Intervening blank lines are OK, +but if there is other code between the comment and the translatable +string, the comment no longer applies. + + Note: The string ‘TRANSLATORS:’ is a convention, enabled by the +‘Makefile.in.in’ file that is part of a package's build system. It is +not enabled by default in ‘xgettext’. If you are using ‘xgettext’ +without the ‘Makefile.in.in’ infrastructure, you will need to pass the +option ‘--add-comments=TRANSLATORS:’ yourself. + + +File: gettext.info, Node: c-format Flag, Next: Special cases, Prev: Translator advice, Up: Sources + +4.7 Special Comments preceding Keywords +======================================= + + In C programs strings are often used within calls of functions from +the ‘printf’ family. The special thing about these format strings is +that they can contain format specifiers introduced with ‘%’. Assume we +have the code + + printf (gettext ("String `%s' has %d characters\n"), s, strlen (s)); + +A possible German translation for the above string might be: + + "%d Zeichen lang ist die Zeichenkette `%s'" + + A C programmer, even if he cannot speak German, will recognize that +there is something wrong here. The order of the two format specifiers +is changed but of course the arguments in the ‘printf’ don't have. This +will most probably lead to problems because now the length of the string +is regarded as the address. + + To prevent errors at runtime caused by translations, the ‘msgfmt’ +tool can check statically whether the arguments in the original and the +translation string match in type and number. If this is not the case +and the ‘-c’ option has been passed to ‘msgfmt’, ‘msgfmt’ will give an +error and refuse to produce a MO file. Thus consistent use of ‘msgfmt +-c’ will catch the error, so that it cannot cause problems at runtime. + +If the word order in the above German translation would be correct one +would have to write + + "%2$d Zeichen lang ist die Zeichenkette `%1$s'" + +The routines in ‘msgfmt’ know about this special notation. + + Because not all strings in a program will be format strings, it is +not useful for ‘msgfmt’ to test all the strings in the ‘.po’ file. This +might cause problems because the string might contain what looks like a +format specifier, but the string is not used in ‘printf’. + + Therefore ‘xgettext’ adds a special tag to those messages it thinks +might be a format string. There is no absolute rule for this, only a +heuristic. In the ‘.po’ file the entry is marked using the ‘c-format’ +flag in the ‘#,’ comment line (*note PO Files::). + + The careful reader now might say that this again can cause problems. +The heuristic might guess it wrong. This is true and therefore +‘xgettext’ knows about a special kind of comment which lets the +programmer take over the decision. If in the same line as or the +immediately preceding line to the ‘gettext’ keyword the ‘xgettext’ +program finds a comment containing the words ‘xgettext:c-format’, it +will mark the string in any case with the ‘c-format’ flag. This kind of +comment should be used when ‘xgettext’ does not recognize the string as +a format string but it really is one and it should be tested. Please +note that when the comment is in the same line as the ‘gettext’ keyword, +it must be before the string to be translated. Also note that a comment +such as ‘xgettext:c-format’ applies only to the first string in the same +or the next line, not to multiple strings. + + This situation happens quite often. The ‘printf’ function is often +called with strings which do not contain a format specifier. Of course +one would normally use ‘fputs’ but it does happen. In this case +‘xgettext’ does not recognize this as a format string but what happens +if the translation introduces a valid format specifier? The ‘printf’ +function will try to access one of the parameters but none exists +because the original code does not pass any parameters. + + ‘xgettext’ of course could make a wrong decision the other way round, +i.e. a string marked as a format string actually is not a format string. +In this case the ‘msgfmt’ might give too many warnings and would prevent +translating the ‘.po’ file. The method to prevent this wrong decision +is similar to the one used above, only the comment to use must contain +the string ‘xgettext:no-c-format’. + + If a string is marked with ‘c-format’ and this is not correct the +user can find out who is responsible for the decision. See *note +xgettext Invocation:: to see how the ‘--debug’ option can be used for +solving this problem. + + +File: gettext.info, Node: Special cases, Next: Bug Report Address, Prev: c-format Flag, Up: Sources + +4.8 Special Cases of Translatable Strings +========================================= + + The attentive reader might now point out that it is not always +possible to mark translatable string with ‘gettext’ or something like +this. Consider the following case: + + { + static const char *messages[] = { + "some very meaningful message", + "and another one" + }; + const char *string; + ... + string + = index > 1 ? "a default message" : messages[index]; + + fputs (string); + ... + } + + While it is no problem to mark the string ‘"a default message"’ it is +not possible to mark the string initializers for ‘messages’. What is to +be done? We have to fulfill two tasks. First we have to mark the +strings so that the ‘xgettext’ program (*note xgettext Invocation::) can +find them, and second we have to translate the string at runtime before +printing them. + + The first task can be fulfilled by creating a new keyword, which +names a no-op. For the second we have to mark all access points to a +string from the array. So one solution can look like this: + + #define gettext_noop(String) String + + { + static const char *messages[] = { + gettext_noop ("some very meaningful message"), + gettext_noop ("and another one") + }; + const char *string; + ... + string + = index > 1 ? gettext ("a default message") : gettext (messages[index]); + + fputs (string); + ... + } + + Please convince yourself that the string which is written by ‘fputs’ +is translated in any case. How to get ‘xgettext’ know the additional +keyword ‘gettext_noop’ is explained in *note xgettext Invocation::. + + The above is of course not the only solution. You could also come +along with the following one: + + #define gettext_noop(String) String + + { + static const char *messages[] = { + gettext_noop ("some very meaningful message"), + gettext_noop ("and another one") + }; + const char *string; + ... + string + = index > 1 ? gettext_noop ("a default message") : messages[index]; + + fputs (gettext (string)); + ... + } + + But this has a drawback. The programmer has to take care that he +uses ‘gettext_noop’ for the string ‘"a default message"’. A use of +‘gettext’ could have in rare cases unpredictable results. + + One advantage is that you need not make control flow analysis to make +sure the output is really translated in any case. But this analysis is +generally not very difficult. If it should be in any situation you can +use this second method in this situation. + + +File: gettext.info, Node: Bug Report Address, Next: Names, Prev: Special cases, Up: Sources + +4.9 Letting Users Report Translation Bugs +========================================= + + Code sometimes has bugs, but translations sometimes have bugs too. +The users need to be able to report them. Reporting translation bugs to +the programmer or maintainer of a package is not very useful, since the +maintainer must never change a translation, except on behalf of the +translator. Hence the translation bugs must be reported to the +translators. + + Here is a way to organize this so that the maintainer does not need +to forward translation bug reports, nor even keep a list of the +addresses of the translators or their translation teams. + + Every program has a place where is shows the bug report address. For +GNU programs, it is the code which handles the "-help" option, typically +in a function called "usage". In this place, instruct the translator to +add her own bug reporting address. For example, if that code has a +statement + + printf (_("Report bugs to <%s>.\n"), PACKAGE_BUGREPORT); + + you can add some translator instructions like this: + + /* TRANSLATORS: The placeholder indicates the bug-reporting address + for this package. Please add _another line_ saying + "Report translation bugs to <...>\n" with the address for translation + bugs (typically your translation team's web or email address). */ + printf (_("Report bugs to <%s>.\n"), PACKAGE_BUGREPORT); + + These will be extracted by ‘xgettext’, leading to a .pot file that +contains this: + + #. TRANSLATORS: The placeholder indicates the bug-reporting address + #. for this package. Please add _another line_ saying + #. "Report translation bugs to <...>\n" with the address for translation + #. bugs (typically your translation team's web or email address). + #: src/hello.c:178 + #, c-format + msgid "Report bugs to <%s>.\n" + msgstr "" + + +File: gettext.info, Node: Names, Next: Libraries, Prev: Bug Report Address, Up: Sources + +4.10 Marking Proper Names for Translation +========================================= + + Should names of persons, cities, locations etc. be marked for +translation or not? People who only know languages that can be written +with Latin letters (English, Spanish, French, German, etc.) are tempted +to say "no", because names usually do not change when transported +between these languages. However, in general when translating from one +script to another, names are translated too, usually phonetically or by +transliteration. For example, Russian or Greek names are converted to +the Latin alphabet when being translated to English, and English or +French names are converted to the Katakana script when being translated +to Japanese. This is necessary because the speakers of the target +language in general cannot read the script the name is originally +written in. + + As a programmer, you should therefore make sure that names are marked +for translation, with a special comment telling the translators that it +is a proper name and how to pronounce it. In its simple form, it looks +like this: + + printf (_("Written by %s.\n"), + /* TRANSLATORS: This is a proper name. See the gettext + manual, section Names. Note this is actually a non-ASCII + name: The first name is (with Unicode escapes) + "Fran\u00e7ois" or (with HTML entities) "François". + Pronunciation is like "fraa-swa pee-nar". */ + _("Francois Pinard")); + +The GNU gnulib library offers a module ‘propername’ +() +which takes care to automatically append the original name, in +parentheses, to the translated name. For names that cannot be written +in ASCII, it also frees the translator from the task of entering the +appropriate non-ASCII characters if no script change is needed. In this +more comfortable form, it looks like this: + + printf (_("Written by %s and %s.\n"), + proper_name ("Ulrich Drepper"), + /* TRANSLATORS: This is a proper name. See the gettext + manual, section Names. Note this is actually a non-ASCII + name: The first name is (with Unicode escapes) + "Fran\u00e7ois" or (with HTML entities) "François". + Pronunciation is like "fraa-swa pee-nar". */ + proper_name_utf8 ("Francois Pinard", "Fran\303\247ois Pinard")); + +You can also write the original name directly in Unicode (rather than +with Unicode escapes or HTML entities) and denote the pronunciation +using the International Phonetic Alphabet (see +). + + As a translator, you should use some care when translating names, +because it is frustrating if people see their names mutilated or +distorted. + + If your language uses the Latin script, all you need to do is to +reproduce the name as perfectly as you can within the usual character +set of your language. In this particular case, this means to provide a +translation containing the c-cedilla character. If your language uses a +different script and the people speaking it don't usually read Latin +words, it means transliteration. If the programmer used the simple +case, you should still give, in parentheses, the original writing of the +name - for the sake of the people that do read the Latin script. If the +programmer used the ‘propername’ module mentioned above, you don't need +to give the original writing of the name in parentheses, because the +program will already do so. Here is an example, using Greek as the +target script: + + #. This is a proper name. See the gettext + #. manual, section Names. Note this is actually a non-ASCII + #. name: The first name is (with Unicode escapes) + #. "Fran\u00e7ois" or (with HTML entities) "François". + #. Pronunciation is like "fraa-swa pee-nar". + msgid "Francois Pinard" + msgstr "\phi\rho\alpha\sigma\omicron\alpha \pi\iota\nu\alpha\rho" + " (Francois Pinard)" + + Because translation of names is such a sensitive domain, it is a good +idea to test your translation before submitting it. + + +File: gettext.info, Node: Libraries, Prev: Names, Up: Sources + +4.11 Preparing Library Sources +============================== + + When you are preparing a library, not a program, for the use of +‘gettext’, only a few details are different. Here we assume that the +library has a translation domain and a POT file of its own. (If it uses +the translation domain and POT file of the main program, then the +previous sections apply without changes.) + + 1. The library code doesn't call ‘setlocale (LC_ALL, "")’. It's the + responsibility of the main program to set the locale. The + library's documentation should mention this fact, so that + developers of programs using the library are aware of it. + + 2. The library code doesn't call ‘textdomain (PACKAGE)’, because it + would interfere with the text domain set by the main program. + + 3. The initialization code for a program was + + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + For a library it is reduced to + + bindtextdomain (PACKAGE, LOCALEDIR); + + If your library's API doesn't already have an initialization + function, you need to create one, containing at least the + ‘bindtextdomain’ invocation. However, you usually don't need to + export and document this initialization function: It is sufficient + that all entry points of the library call the initialization + function if it hasn't been called before. The typical idiom used + to achieve this is a static boolean variable that indicates whether + the initialization function has been called. If the library is + meant to be used in multithreaded applications, this variable needs + to be marked ‘volatile’, so that its value get propagated between + threads. Like this: + + static volatile bool libfoo_initialized; + + static void + libfoo_initialize (void) + { + bindtextdomain (PACKAGE, LOCALEDIR); + libfoo_initialized = true; + } + + /* This function is part of the exported API. */ + struct foo * + create_foo (...) + { + /* Must ensure the initialization is performed. */ + if (!libfoo_initialized) + libfoo_initialize (); + ... + } + + /* This function is part of the exported API. The argument must be + non-NULL and have been created through create_foo(). */ + int + foo_refcount (struct foo *argument) + { + /* No need to invoke the initialization function here, because + create_foo() must already have been called before. */ + ... + } + + The more general solution for initialization functions, POSIX + ‘pthread_once’, is not needed in this case. + + 4. The usual declaration of the ‘_’ macro in each source file was + + #include + #define _(String) gettext (String) + + for a program. For a library, which has its own translation + domain, it reads like this: + + #include + #define _(String) dgettext (PACKAGE, String) + + In other words, ‘dgettext’ is used instead of ‘gettext’. + Similarly, the ‘dngettext’ function should be used in place of the + ‘ngettext’ function. + + +File: gettext.info, Node: Template, Next: Creating, Prev: Sources, Up: Top + +5 Making the PO Template File +***************************** + + After preparing the sources, the programmer creates a PO template +file. This section explains how to use ‘xgettext’ for this purpose. + + ‘xgettext’ creates a file named ‘DOMAINNAME.po’. You should then +rename it to ‘DOMAINNAME.pot’. (Why doesn't ‘xgettext’ create it under +the name ‘DOMAINNAME.pot’ right away? The answer is: for historical +reasons. When ‘xgettext’ was specified, the distinction between a PO +file and PO file template was fuzzy, and the suffix ‘.pot’ wasn't in use +at that time.) + +* Menu: + +* xgettext Invocation:: Invoking the ‘xgettext’ Program +* Combining POTs:: Combining PO Template Files + + +File: gettext.info, Node: xgettext Invocation, Next: Combining POTs, Up: Template + +5.1 Invoking the ‘xgettext’ Program +=================================== + + xgettext [OPTION] [INPUTFILE] ... + + The ‘xgettext’ program extracts translatable strings from given input +files. + +5.1.1 Input file location +------------------------- + +‘INPUTFILE ...’ + Input files. + +‘-f FILE’ +‘--files-from=FILE’ + Read the names of the input files from FILE instead of getting them + from the command line. + + Often FILE is a temporary file, generated during the build process. + In this case, you should also pass the ‘--generated=FILE’ option. + +‘-D DIRECTORY’ +‘--directory=DIRECTORY’ + Add DIRECTORY to the list of directories. Source files are + searched relative to this list of directories. The resulting ‘.po’ + file will be written relative to the current directory, though. + + If INPUTFILE is ‘-’, standard input is read. + +5.1.2 Output file location +-------------------------- + +‘-d NAME’ +‘--default-domain=NAME’ + Use ‘NAME.po’ for output (instead of ‘messages.po’). + +‘-o FILE’ +‘--output=FILE’ + Write output to specified file (instead of ‘NAME.po’ or + ‘messages.po’). + +‘-p DIR’ +‘--output-dir=DIR’ + Output files will be placed in directory DIR. + + If the output FILE is ‘-’ or ‘/dev/stdout’, the output is written to +standard output. + +5.1.3 Choice of input file language +----------------------------------- + +‘-L NAME’ +‘--language=NAME’ + Specifies the language of the input files. The supported languages + are ‘C’, ‘C++’, ‘ObjectiveC’, ‘PO’, ‘Python’, ‘Java’, + ‘JavaProperties’, ‘C#’, ‘JavaScript’, ‘TypeScript’, ‘TSX’, + ‘Scheme’, ‘Guile’, ‘Lisp’, ‘EmacsLisp’, ‘librep’, ‘Rust’, ‘Go’, + ‘Ruby’, ‘Shell’, ‘awk’, ‘Lua’, ‘Modula-2’, ‘D’, ‘Smalltalk’, + ‘Vala’, ‘Tcl’, ‘Perl’, ‘PHP’, ‘GCC-source’, ‘YCP’, ‘NXStringTable’, + ‘RST’, ‘RSJ’, ‘Glade’, ‘GSettings’, ‘Desktop’. + +‘-C’ +‘--c++’ + This is a shorthand for ‘--language=C++’. + + By default the language is guessed depending on the input file name +extension. + +5.1.4 Input file interpretation +------------------------------- + +‘--from-code=NAME’ + Specifies the encoding of the input files. This option is needed + only if some untranslated message strings or their corresponding + comments contain non-ASCII characters. Note that Tcl and Glade + input files are always assumed to be in UTF-8, regardless of this + option. + + By default the input files are assumed to be in ASCII. + +5.1.5 Operation mode +-------------------- + +‘-j’ +‘--join-existing’ + Join messages with existing file. + +‘-x FILE’ +‘--exclude-file=FILE’ + Entries from FILE are not extracted. FILE should be a PO or POT + file. + +‘-c[TAG]’ +‘--add-comments[=TAG]’ + Place comment blocks starting with TAG and preceding keyword lines + in the output file. Without a TAG, the option means to put _all_ + comment blocks preceding keyword lines in the output file. + + Note that comment blocks are only extracted if there is no program + code between the comment and the string that gets extracted. For + example, in the following C source code: + + /* This is the first comment. */ + gettext ("foo"); + + /* This is the second comment: not extracted */ + gettext ( + "bar"); + + gettext ( + /* This is the third comment. */ + "baz"); + + /* This is the fourth comment. */ + + gettext ("I love blank lines in my programs"); + + the second comment line will not be extracted, because there is a + line with some tokens between the comment line and the line that + contains the string. But the fourth comment is extracted, because + between it and the line with the string there is merely a blank + line. + +‘--check[=CHECK]’ + Perform a syntax check on msgid and msgid_plural. The supported + checks are: + + ‘ellipsis-unicode’ + Prefer Unicode ellipsis character over ASCII ‘...’ + + ‘space-ellipsis’ + Prohibit whitespace before an ellipsis character + + ‘quote-unicode’ + Prefer Unicode quotation marks over ASCII ‘"'`’ + + ‘bullet-unicode’ + Prefer Unicode bullet character over ASCII ‘*’ or ‘-’ + + The option has an effect on all input files. To enable or disable + checks for a certain string, you can mark it with an ‘xgettext:’ + special comment in the source file. For example, if you specify + the ‘--check=space-ellipsis’ option, but want to suppress the check + on a particular string, add the following comment: + + /* xgettext: no-space-ellipsis-check */ + gettext ("We really want a space before ellipsis here ..."); + + The ‘xgettext:’ comment can be followed by flags separated with a + comma. The possible flags are of the form ‘[no-]NAME-check’, where + NAME is the name of a valid syntax check. If a flag is prefixed by + ‘no-’, the meaning is negated. + + Some tests apply the checks to each sentence within the msgid, + rather than the whole string. xgettext detects the end of sentence + by performing a pattern match, which usually looks for a period + followed by a certain number of spaces. The number is specified + with the ‘--sentence-end’ option. + +‘--sentence-end[=TYPE]’ + The supported values are: + + ‘single-space’ + Expect at least one whitespace after a period + + ‘double-space’ + Expect at least two whitespaces after a period + +5.1.6 Language specific options +------------------------------- + +‘-a’ +‘--extract-all’ + Extract all strings. + + This option has an effect with most languages, namely C, C++, + ObjectiveC, Python, Java, C#, JavaScript, Scheme, Guile, Lisp, + EmacsLisp, librep, Rust, Go, Shell, awk, Lua, Modula-2, D, Vala, + Tcl, Perl, PHP, GCC-source, Glade, GSettings. + +‘-k[KEYWORDSPEC]’ +‘--keyword[=KEYWORDSPEC]’ + Specify KEYWORDSPEC as an additional keyword to be looked for. + Without a KEYWORDSPEC, the option means to not use default + keywords. + + If KEYWORDSPEC is a C identifier ID, ‘xgettext’ looks for strings + in the first argument of each call to the function or macro ID. If + KEYWORDSPEC is of the form ‘ID:ARGNUM’, ‘xgettext’ looks for + strings in the ARGNUMth argument of the call. If KEYWORDSPEC is of + the form ‘ID:ARGNUM1,ARGNUM2’, ‘xgettext’ looks for strings in the + ARGNUM1st argument and in the ARGNUM2nd argument of the call, and + treats them as singular/plural variants for a message with plural + handling. Also, if KEYWORDSPEC is of the form + ‘ID:CONTEXTARGNUMc,ARGNUM’ or ‘ID:ARGNUM,CONTEXTARGNUMc’, + ‘xgettext’ treats strings in the CONTEXTARGNUMth argument as a + context specifier. And, as a special-purpose support for GNOME, if + KEYWORDSPEC is of the form ‘ID:ARGNUMg’, ‘xgettext’ recognizes the + ARGNUMth argument as a string with context, using the GNOME ‘glib’ + syntax ‘"msgctxt|msgid"’. + Furthermore, if KEYWORDSPEC is of the form ‘ID:...,TOTALNUMARGSt’, + ‘xgettext’ recognizes this argument specification only if the + number of actual arguments is equal to TOTALNUMARGS. This is + useful for disambiguating overloaded function calls in C++. + Finally, if KEYWORDSPEC is of the form ‘ID:ARGNUM...,"XCOMMENT"’, + ‘xgettext’, when extracting a message from the specified argument + strings, adds an extracted comment XCOMMENT to the message. Note + that when used through a normal shell command line, the + double-quotes around the XCOMMENT need to be escaped. + + This option has an effect with most languages, namely C, C++, + ObjectiveC, Python, Java, C#, JavaScript, TypeScript, TSX, Scheme, + Guile, Lisp, EmacsLisp, librep, Rust, Go, Shell, awk, Lua, + Modula-2, D, Vala, Tcl, Perl, PHP, GCC-source, Glade, GSettings, + Desktop. + + The default keyword specifications, which are always looked for if + not explicitly disabled, are language dependent. They are: + + • For C, C++, and GCC-source: ‘gettext’, ‘dgettext:2’, + ‘dcgettext:2’, ‘ngettext:1,2’, ‘dngettext:2,3’, + ‘dcngettext:2,3’, ‘gettext_noop’, and ‘pgettext:1c,2’, + ‘dpgettext:2c,3’, ‘dcpgettext:2c,3’, ‘npgettext:1c,2,3’, + ‘dnpgettext:2c,3,4’, ‘dcnpgettext:2c,3,4’. + + • For Objective C: Like for C, and also ‘NSLocalizedString’, + ‘_’, ‘NSLocalizedStaticString’, ‘__’. + + • For Shell scripts: ‘gettext’, ‘ngettext:1,2’, ‘eval_gettext’, + ‘eval_ngettext:1,2’, ‘eval_pgettext:1c,2’, + ‘eval_npgettext:1c,2,3’. + + • For Python: ‘gettext’, ‘ugettext’, ‘dgettext:2’, + ‘ngettext:1,2’, ‘ungettext:1,2’, ‘dngettext:2,3’, ‘_’. + + • For Lisp: ‘gettext’, ‘ngettext:1,2’, ‘gettext-noop’. + + • For EmacsLisp: ‘_’. + + • For librep: ‘_’. + + • For Scheme and Guile: ‘gettext’, ‘ngettext:1,2’, + ‘gettext-noop’. + + • For Java: ‘GettextResource.gettext:2’, + ‘GettextResource.ngettext:2,3’, + ‘GettextResource.pgettext:2c,3’, + ‘GettextResource.npgettext:2c,3,4’, ‘gettext’, ‘ngettext:1,2’, + ‘pgettext:1c,2’, ‘npgettext:1c,2,3’, ‘getString’. + + • For C#: ‘GetString’, ‘GetPluralString:1,2’, + ‘GetParticularString:1c,2’, + ‘GetParticularPluralString:1c,2,3’. + + • For awk: ‘dcgettext’, ‘dcngettext:1,2’. + + • For Tcl: ‘::msgcat::mc’. + + • For Perl: ‘gettext’, ‘%gettext’, ‘$gettext’, ‘dgettext:2’, + ‘dcgettext:2’, ‘ngettext:1,2’, ‘dngettext:2,3’, + ‘dcngettext:2,3’, ‘gettext_noop’. + + • For PHP: ‘_’, ‘gettext’, ‘dgettext:2’, ‘dcgettext:2’, + ‘ngettext:1,2’, ‘dngettext:2,3’, ‘dcngettext:2,3’. + + • For Glade 1: ‘label’, ‘title’, ‘text’, ‘format’, ‘copyright’, + ‘comments’, ‘preview_text’, ‘tooltip’. + + • For Lua: ‘_’, ‘gettext.gettext’, ‘gettext.dgettext:2’, + ‘gettext.dcgettext:2’, ‘gettext.ngettext:1,2’, + ‘gettext.dngettext:2,3’, ‘gettext.dcngettext:2,3’. + + • For D: ‘gettext’, ‘dgettext:2’, ‘dcgettext:2’, ‘ngettext:1,2’, + ‘dngettext:2,3’, ‘dcngettext:2,3’. + + • For JavaScript, TypeScript, TSX: ‘_’, ‘gettext’, ‘dgettext:2’, + ‘dcgettext:2’, ‘ngettext:1,2’, ‘dngettext:2,3’, + ‘pgettext:1c,2’, ‘dpgettext:2c,3’. + + • For Vala: ‘_’, ‘Q_’, ‘N_’, ‘NC_’, ‘dgettext:2’, ‘dcgettext:2’, + ‘ngettext:1,2’, ‘dngettext:2,3’, ‘dpgettext:2c,3’, + ‘dpgettext2:2c,3’. + + • For Desktop: ‘Name’, ‘GenericName’, ‘Comment’, ‘Keywords’. + + To disable the default keyword specifications, the option ‘-k’ or + ‘--keyword’ or ‘--keyword=’, without a KEYWORDSPEC, can be used. + +‘--flag=WORD:ARG:FLAG’ + Specifies additional flags for strings occurring as part of the + ARGth argument of the function WORD. The possible flags are the + possible format string indicators, such as ‘c-format’, and their + negations, such as ‘no-c-format’, possibly prefixed with ‘pass-’. + The meaning of ‘--flag=FUNCTION:ARG:LANG-format’ is that in + language LANG, the specified FUNCTION expects as ARGth argument a + format string. (For those of you familiar with GCC function + attributes, ‘--flag=FUNCTION:ARG:c-format’ is roughly equivalent to + the declaration ‘__attribute__ ((__format__ (__printf__, ARG, + ...)))’ attached to FUNCTION in a C source file.) For example, if + you use the ‘error’ function from GNU libc, you can specify its + behaviour through ‘--flag=error:3:c-format’. The effect of this + specification is that ‘xgettext’ will mark as format strings all + ‘gettext’ invocations that occur as ARGth argument of FUNCTION. + This is useful when such strings contain no format string + directives: together with the checks done by ‘msgfmt -c’ it will + ensure that translators cannot accidentally use format string + directives that would lead to a crash at runtime. + The meaning of ‘--flag=FUNCTION:ARG:pass-LANG-format’ is that in + language LANG, if the FUNCTION call occurs in a position that must + yield a format string, then its ARGth argument must yield a format + string of the same type as well. (If you know GCC function + attributes, the ‘--flag=FUNCTION:ARG:pass-c-format’ option is + roughly equivalent to the declaration ‘__attribute__ + ((__format_arg__ (ARG)))’ attached to FUNCTION in a C source file.) + For example, if you use the ‘_’ shortcut for the ‘gettext’ + function, you should use ‘--flag=_:1:pass-c-format’. The effect of + this specification is that ‘xgettext’ will propagate a format + string requirement for a ‘_("string")’ call to its first argument, + the literal ‘"string"’, and thus mark it as a format string. This + is useful when such strings contain no format string directives: + together with the checks done by ‘msgfmt -c’ it will ensure that + translators cannot accidentally use format string directives that + would lead to a crash at runtime. + This option has an effect with most languages, namely C, C++, + ObjectiveC, Python, Java, C#, JavaScript, TypeScript, TSX, Scheme, + Guile, Lisp, EmacsLisp, librep, Rust, Go, Shell, awk, Lua, + Modula-2, D, Vala, Tcl, Perl, PHP, GCC-source, YCP. + +‘--tag=WORD:FORMAT’ + Defines the behaviour of tagged template literals with tag WORD. + This option has an effect only with language JavaScript. + FORMAT is a symbolic description of the first step of the + JavaScript function named WORD, namely how this function constructs + a format string based on the parts of the template literal. + Currently only one value is supported: ‘javascript-gnome-format’, + which describes the construction of a format string with numbered + placeholders ‘{0}’, ‘{1}’, ‘{2}’, etc. For example, + ‘javascript-gnome-format’ transforms the template literal ‘WORD`My + name is ${id.name} and I am ${id.age} years old.`’ into the format + string ‘"My name is {0} and I am {1} years old."’. + +‘-T’ +‘--trigraphs’ + Understand ANSI C trigraphs for input (deprecated, since trigraphs + have been removed from ISO C 23). + This option has an effect only with the languages C, C++, + ObjectiveC. + +‘--qt’ + Recognize Qt format strings. + This option has an effect only with the language C++. + +‘--kde’ + Recognize KDE 4 format strings. + This option has an effect only with the language C++. + +‘--boost’ + Recognize Boost format strings. + This option has an effect only with the language C++. + +‘--debug’ + Use the flags ‘c-format’ and ‘possible-c-format’ to show who was + responsible for marking a message as a format string. The latter + form is used if the ‘xgettext’ program decided, the former form is + used if the programmer prescribed it. + + By default only the ‘c-format’ form is used. The translator should + not have to care about these details. + + This implementation of ‘xgettext’ is able to process a few awkward +cases, like strings in preprocessor macros, ANSI concatenation of +adjacent strings, and escaped end of lines for continued strings. + +5.1.7 Options for XML input files +--------------------------------- + + When some of the input files are XML files and they are not of one of +the types covered by the system-wide installed *.its files, a *.its file +is needed for each such file type, so that ‘xgettext’ can handle them. +There are two ways to specify such a file: + + • ‘--its=FILE’ + Use the ITS rules defined in FILE. + + • The environment variable ‘GETTEXTDATADIRS’. Together with the + *.its file, you need a corresponding *.loc file (*note Preparing + ITS Rules::). Furthermore you need to store these files in a + directory ‘PARENT_DIR/its/’ and set the environment variable + ‘GETTEXTDATADIRS’ to include ‘PARENT_DIR’. More generally, the + value of ‘GETTEXTDATADIRS’ should be a colon-separated list of + directory names. + + Note that when the option ‘--its’ is specified, the system-wide +installed *.its files are ignored and the environment variable +‘GETTEXTDATADIRS’ has no effect either. + +5.1.8 Output details +-------------------- + +‘--color’ +‘--color=WHEN’ + Specify whether or when to use colors and other text attributes. + See *note The --color option:: for details. + +‘--style=STYLE_FILE’ + Specify the CSS style rule file to use for ‘--color’. See *note + The --style option:: for details. + +‘--force-po’ + Always write an output file even if no message is defined. + +‘-i’ +‘--indent’ + Write the .po file using indented style. + +‘--no-location’ + Do not write ‘#: FILENAME:LINE’ lines. Note that using this option + makes it harder for technically skilled translators to understand + each message's context. + +‘-n’ +‘--add-location=TYPE’ + Generate ‘#: FILENAME:LINE’ lines (default). + + The optional TYPE can be either ‘full’, ‘file’, or ‘never’. If it + is not given or ‘full’, it generates the lines with both file name + and line number. If it is ‘file’, the line number part is omitted. + If it is ‘never’, it completely suppresses the lines (same as + ‘--no-location’). + +‘--strict’ + Write out a strict Uniforum conforming PO file. Note that this + Uniforum format should be avoided because it doesn't support the + GNU extensions. + +‘--properties-output’ + Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note + that this file format doesn't support plural forms and silently + drops obsolete messages. + +‘--stringtable-output’ + Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ + syntax. Note that this file format doesn't support plural forms. + +‘--itstool’ + Write out comments recognized by itstool (). + Note that this is only effective with XML files. + +‘-w NUMBER’ +‘--width=NUMBER’ + Set the output page width. Long strings in the output files will + be split across multiple lines in order to ensure that each line's + width (= number of screen columns) is less or equal to the given + NUMBER. + +‘--no-wrap’ + Do not break long message lines. Message lines whose width exceeds + the output page width will not be split into several lines. Only + file reference lines which are wider than the output page width + will be split. + +‘-s’ +‘--sort-output’ + Generate sorted output (deprecated). Note that using this option + makes it much harder for the translator to understand each + message's context. + +‘-F’ +‘--sort-by-file’ + Sort output by file location. + +‘--omit-header’ + Don't write header with ‘msgid ""’ entry. Note: Using this option + may lead to an error in subsequent operations if the output + contains non-ASCII characters. + + This is useful for testing purposes because it eliminates a source + of variance for generated ‘.gmo’ files. With ‘--omit-header’, two + invocations of ‘xgettext’ on the same files with the same options + at different times are guaranteed to produce the same results. + + Note that using this option will lead to an error if the resulting + file would not entirely be in ASCII. + +‘--no-git’ + Don't use the ‘git’ program to produce a reproducible + ‘POT-Creation-Date’ field in the output. + + Use this option, for speed, if your project has a very long ‘Git’ + history (hundreds of thousands of commits) or you are specifying + thousands of input files. + + By default, ‘xgettext’ determines the ‘POT-Creation-Date’ as the + maximum version-controlled modification time among all the given + input files. With this option, you can specify that it should + instead use the maximum modification time (time stamp on disk) + among all the given input files. + + By "version control", here we mean the ‘Git’ version control + system. + +‘--copyright-holder=STRING’ + Set the copyright holder in the output. STRING should be the + copyright holder of the surrounding package. (Note that the + ‘msgid’ strings, extracted from the package's sources, belong to + the copyright holder of the package.) Translators are expected to + transfer or disclaim the copyright for their translations, so that + package maintainers can distribute them without legal risk. If + STRING is empty, the output files are marked as being in the public + domain; in this case, the translators are expected to disclaim + their copyright, again so that package maintainers can distribute + them without legal risk. + + The default value for STRING is the Free Software Foundation, Inc., + simply because ‘xgettext’ was first used in the GNU project. + +‘--foreign-user’ + Omit FSF copyright in output. This option is equivalent to + ‘--copyright-holder=''’. It can be useful for packages outside the + GNU project that want their translations to be in the public + domain. + +‘--package-name=PACKAGE’ + Set the package name in the header of the output. + +‘--package-version=VERSION’ + Set the package version in the header of the output. This option + has an effect only if the ‘--package-name’ option is also used. + +‘--msgid-bugs-address=EMAIL@ADDRESS’ + Set the reporting address for msgid bugs. This is the email + address or URL to which the translators shall report bugs in the + untranslated strings: + + - Strings which are not entire sentences; see the maintainer + guidelines in *note Preparing Strings::. + - Strings which use unclear terms or require additional context + to be understood. + - Strings which make invalid assumptions about notation of date, + time or money. + - Pluralisation problems. + - Incorrect English spelling. + - Incorrect formatting. + + It can be your email address, or a mailing list address where + translators can write to without being subscribed, or the URL of a + web page through which the translators can contact you. + + The default value is empty, which means that translators will be + clueless! Don't forget to specify this option. + +‘--generated=FILE’ + + Declares that the given FILE is generated and therefore should not + have an influence on the ‘POT-Creation-Date’ field in the output. + + When you specify this option, you should also specify one or more + ‘--reference’ options, to indicate the files from which the given + FILE was generated. + +‘--reference=FILE’ + + Declares that the output depends on the contents of the given FILE. + This has an influence on the ‘POT-Creation-Date’ field in the + output. + + By default, ‘xgettext’ determines the ‘POT-Creation-Date’ as the + maximum version-controlled modification time among all the given + input files. With this option, you can specify that the output + depends also on some other files. For example, use this option + when some of the input files is not under version control but + instead is generated from one or more files that are under version + control. + + By "version control", here we mean the ‘Git’ version control + system. + +‘-m[STRING]’ +‘--msgstr-prefix[=STRING]’ + Use STRING (or "" if not specified) as prefix for msgstr values. + +‘-M[STRING]’ +‘--msgstr-suffix[=STRING]’ + Use STRING (or "" if not specified) as suffix for msgstr values. + +5.1.9 Informative output +------------------------ + +‘-h’ +‘--help’ + Display this help and exit. + +‘-V’ +‘--version’ + Output version information and exit. + +‘-v’ +‘--verbose’ + Increase verbosity level. + +5.1.10 Example +-------------- + + A sample invocation of ‘xgettext’, in a project that has a single +source file ‘src/hello.c’ that uses ‘_’ as shorthand for the ‘gettext’ +function, could be: + + xgettext -o hello.pot \ + --add-comments=TRANSLATORS: \ + --keyword=_ --flag=_:1:pass-c-format \ + --directory=.. \ + src/hello.c + + +File: gettext.info, Node: Combining POTs, Prev: xgettext Invocation, Up: Template + +5.2 Combining PO Template Files +=============================== + + When a package contains sources in different programming languages +and different, incompatible ‘xgettext’ command line options are required +for these different parts of the package, the solution is to create +intermediate PO template files for each of the parts and then combine +(merge) them together. + + For example, assume you have two source files ‘a.c’ and ‘b.py’, and +want to extract their translatable strings in separate steps. + + Each of the following command sequences does this. The output is the +same. + + • This command sequence creates intermediate POT files and then + combines them. + xgettext -o part-c.pot a.c + xgettext -o part-py.pot b.py + xgettext -o all.pot part-c.pot part-py.pot + • This command sequence does several ‘xgettext’ invocations, with a + single POT file that accumulates the translatable strings. + xgettext -o all.pot a.c + xgettext -o all.pot --join-existing b.py + • Likewise here, but a ‘--default-domain’ option is used to denote + the output file rather than a ‘-o’ option. + xgettext --default-domain=all a.c + xgettext --default-domain=all --join-existing b.py + mv all.po all.pot + + One might be tempted to think that ‘msgcat’ can do the same thing, +through a command sequence such as: + xgettext -o part-c.pot a.c + xgettext -o part-py.pot b.py + msgcat -o all.pot part-c.pot part-py.pot +But no, this does not work reliably, because sometimes ‘part-c.pot’ and +‘part-py.pot’ will contain different ‘POT-Creation-Date’ values, and +‘msgcat’ then produces an ‘all.pot’ file that has conflict markers in +the header entry. This is because ‘msgcat’ generally is meant to +produce PO files that are to be reviewed and edited by a translator; +this is not desired here. + + +File: gettext.info, Node: Creating, Next: Updating, Prev: Template, Up: Top + +6 Creating a New PO File +************************ + + When starting a new translation, the translator creates a file called +‘LANG.po’, as a copy of the ‘PACKAGE.pot’ template file with +modifications in the initial comments (at the beginning of the file) and +in the header entry (the first entry, near the beginning of the file). + + The easiest way to do so is by use of the ‘msginit’ program. For +example: + + $ cd PACKAGE-VERSION + $ cd po + $ msginit + + The alternative way is to do the copy and modifications by hand. To +do so, the translator copies ‘PACKAGE.pot’ to ‘LANG.po’. Then she +modifies the initial comments and the header entry of this file. + +* Menu: + +* msginit Invocation:: Invoking the ‘msginit’ Program +* Header Entry:: Filling in the Header Entry + + +File: gettext.info, Node: msginit Invocation, Next: Header Entry, Up: Creating + +6.1 Invoking the ‘msginit’ Program +================================== + + msginit [OPTION] + + The ‘msginit’ program creates a new PO file, initializing the meta +information with values from the user's environment. + + Here are more details. The following header fields of a PO file are +automatically filled, when possible. + +‘Project-Id-Version’ + The value is guessed from the ‘configure’ script or any other files + in the current directory. + +‘PO-Revision-Date’ + The value is taken from the ‘PO-Creation-Data’ in the input POT + file, or the current date is used. + +‘Last-Translator’ + The value is taken from user's password file entry and the mailer + configuration files. + +‘Language-Team, Language’ + These values are set according to the current locale and the + predefined list of translation teams. + +‘MIME-Version, Content-Type, Content-Transfer-Encoding’ + These values are set according to the content of the POT file and + the current locale. If the POT file contains charset=UTF-8, it + means that the POT file contains non-ASCII characters, and we keep + the UTF-8 encoding. Otherwise, when the POT file is plain ASCII, + we use the locale's encoding. + +‘Plural-Forms’ + The value is first looked up from the embedded table. + + As an experimental feature, you can instruct ‘msginit’ to use the + information from Unicode CLDR, by setting the ‘GETTEXTCLDRDIR’ + environment variable. The program will look for a file named + ‘common/supplemental/plurals.xml’ under that directory. You can + get the CLDR data from . + +6.1.1 Input file location +------------------------- + +‘-i INPUTFILE’ +‘--input=INPUTFILE’ + Input POT file. + + If no INPUTFILE is given, the current directory is searched for the +POT file. If it is ‘-’, standard input is read. + +6.1.2 Output file location +-------------------------- + +‘-o FILE’ +‘--output-file=FILE’ + Write output to specified PO file. + + If no output file is given, it depends on the ‘--locale’ option or +the user's locale setting. If it is ‘-’, the results are written to +standard output. + +6.1.3 Input file syntax +----------------------- + +‘-P’ +‘--properties-input’ + Assume the input file is a Java ResourceBundle in Java + ‘.properties’ syntax, not in PO file syntax. + +‘--stringtable-input’ + Assume the input file is a NeXTstep/GNUstep localized resource file + in ‘.strings’ syntax, not in PO file syntax. + +6.1.4 Output details +-------------------- + +‘-l LL_CC[.ENCODING]’ +‘--locale=LL_CC[.ENCODING]’ + Set target locale. LL should be a language code, and CC should be + a country code. The optional part .ENCODING specifies the encoding + of the locale; most often this part is ‘.UTF-8’. The command + ‘locale -a’ can be used to output a list of all installed locales. + The default is the user's locale setting. + +‘--no-translator’ + Declares that the PO file will not have a human translator and is + instead automatically generated. + +‘--color’ +‘--color=WHEN’ + Specify whether or when to use colors and other text attributes. + See *note The --color option:: for details. + +‘--style=STYLE_FILE’ + Specify the CSS style rule file to use for ‘--color’. See *note + The --style option:: for details. + +‘-p’ +‘--properties-output’ + Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note + that this file format doesn't support plural forms and silently + drops obsolete messages. + +‘--stringtable-output’ + Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ + syntax. Note that this file format doesn't support plural forms. + +‘-w NUMBER’ +‘--width=NUMBER’ + Set the output page width. Long strings in the output files will + be split across multiple lines in order to ensure that each line's + width (= number of screen columns) is less or equal to the given + NUMBER. + +‘--no-wrap’ + Do not break long message lines. Message lines whose width exceeds + the output page width will not be split into several lines. Only + file reference lines which are wider than the output page width + will be split. + +6.1.5 Informative output +------------------------ + +‘-h’ +‘--help’ + Display this help and exit. + +‘-V’ +‘--version’ + Output version information and exit. + + +File: gettext.info, Node: Header Entry, Prev: msginit Invocation, Up: Creating + +6.2 Filling in the Header Entry +=============================== + + The initial comments "SOME DESCRIPTIVE TITLE", "YEAR" and "FIRST +AUTHOR , YEAR" ought to be replaced by sensible +information. This can be done in any text editor; if Emacs is used and +it switched to PO mode automatically (because it has recognized the +file's suffix), you can disable it by typing ‘M-x fundamental-mode’. + + Modifying the header entry can already be done using PO mode: in +Emacs, type ‘M-x po-mode RET’ and then ‘RET’ again to start editing the +entry. You should fill in the following fields. + +Project-Id-Version + This is the name and version of the package. Fill it in if it has + not already been filled in by ‘xgettext’. + +Report-Msgid-Bugs-To + This has already been filled in by ‘xgettext’. It contains an + email address or URL where you can report bugs in the untranslated + strings: + + - Strings which are not entire sentences, see the maintainer + guidelines in *note Preparing Strings::. + - Strings which use unclear terms or require additional context + to be understood. + - Strings which make invalid assumptions about notation of date, + time or money. + - Pluralisation problems. + - Incorrect English spelling. + - Incorrect formatting. + +POT-Creation-Date + This has already been filled in by ‘xgettext’. + +PO-Revision-Date + You don't need to fill this in. It will be filled by the PO file + editor when you save the file. + +Last-Translator + Fill in your name and email address (without double quotes). + +Language-Team + Fill in the English name of the language, and the email address or + homepage URL of the language team you are part of. + + Before starting a translation, it is a good idea to get in touch + with your translation team, not only to make sure you don't do + duplicated work, but also to coordinate difficult linguistic + issues. + + In the Free Translation Project, each translation team has its own + mailing list. The up-to-date list of teams can be found at the + Free Translation Project's homepage, + , in the "Teams" area. + +Language + Fill in the language code of the language. This can be in one of + three forms: + + - ‘LL’, an ISO 639 two-letter language code (lowercase). For + some languages, a two-letter code does not exist, and a + three-letter code is used instead. See *note Language Codes:: + for the list of codes. + + - ‘LL_CC’, where ‘LL’ is an ISO 639 two-letter or three-letter + language code (lowercase) and ‘CC’ is an ISO 3166 two-letter + country code (uppercase). The country code specification is + not redundant: Some languages have dialects in different + countries. For example, ‘de_AT’ is used for Austria, and + ‘pt_BR’ for Brazil. The country code serves to distinguish + the dialects. See *note Language Codes:: and *note Country + Codes:: for the lists of codes. + + - ‘LL_CC@VARIANT’, where ‘LL’ is an ISO 639 two-letter or + three-letter language code (lowercase), ‘CC’ is an ISO 3166 + two-letter country code (uppercase), and ‘VARIANT’ is a + variant designator. The variant designator (lowercase) can be + a script designator, such as ‘latin’ or ‘cyrillic’. + + The naming convention ‘LL_CC’ is also the way locales are named on + systems based on GNU libc. But there are three important + differences: + + • In this PO file field, but not in locale names, ‘LL_CC’ + combinations denoting a language's main dialect are + abbreviated as ‘LL’. For example, ‘de’ is equivalent to + ‘de_DE’ (German as spoken in Germany), and ‘pt’ to ‘pt_PT’ + (Portuguese as spoken in Portugal) in this context. + + • In this PO file field, suffixes like ‘.ENCODING’ are not used. + + • In this PO file field, variant designators that are not + relevant to message translation, such as ‘@euro’, are not + used. + + So, if your locale name is ‘de_DE.UTF-8’, the language + specification in PO files is just ‘de’. + +Content-Type + Replace ‘CHARSET’ with the character encoding used for your + language, in your locale, or UTF-8. This field is needed for + correct operation of the ‘msgmerge’ and ‘msgfmt’ programs, as well + as for users whose locale's character encoding differs from yours + (see *note Charset conversion::). + + You get the character encoding of your locale by running the shell + command ‘locale charmap’. If the result is ‘C’ or + ‘ANSI_X3.4-1968’, which is equivalent to ‘ASCII’ (= ‘US-ASCII’), it + means that your locale is not correctly configured. In this case, + ask your translation team which charset to use. ‘ASCII’ is not + usable for any language except Latin. + + Because the PO files must be portable to operating systems with + less advanced internationalization facilities, the character + encodings that can be used are limited to those supported by both + GNU ‘libc’ and GNU ‘libiconv’. These are: ‘ASCII’, ‘ISO-8859-1’, + ‘ISO-8859-2’, ‘ISO-8859-3’, ‘ISO-8859-4’, ‘ISO-8859-5’, + ‘ISO-8859-6’, ‘ISO-8859-7’, ‘ISO-8859-8’, ‘ISO-8859-9’, + ‘ISO-8859-13’, ‘ISO-8859-14’, ‘ISO-8859-15’, ‘KOI8-R’, ‘KOI8-U’, + ‘KOI8-T’, ‘CP850’, ‘CP866’, ‘CP874’, ‘CP932’, ‘CP949’, ‘CP950’, + ‘CP1250’, ‘CP1251’, ‘CP1252’, ‘CP1253’, ‘CP1254’, ‘CP1255’, + ‘CP1256’, ‘CP1257’, ‘GB2312’, ‘EUC-JP’, ‘EUC-KR’, ‘EUC-TW’, ‘BIG5’, + ‘BIG5-HKSCS’, ‘GBK’, ‘GB18030’, ‘SHIFT_JIS’, ‘JOHAB’, ‘TIS-620’, + ‘VISCII’, ‘GEORGIAN-PS’, ‘UTF-8’. + + In the GNU system, the following encodings are frequently used for + the corresponding languages. + + • ‘ISO-8859-1’ for Afrikaans, Albanian, Basque, Breton, Catalan, + Cornish, Danish, Dutch, English, Estonian, Faroese, Finnish, + French, Galician, German, Greenlandic, Icelandic, Indonesian, + Irish, Italian, Malay, Manx, Norwegian, Occitan, Portuguese, + Spanish, Swedish, Tagalog, Uzbek, Walloon, + • ‘ISO-8859-2’ for Bosnian, Croatian, Czech, Hungarian, Polish, + Romanian, Serbian, Slovak, Slovenian, + • ‘ISO-8859-3’ for Maltese, + • ‘ISO-8859-5’ for Macedonian, Serbian, + • ‘ISO-8859-6’ for Arabic, + • ‘ISO-8859-7’ for Greek, + • ‘ISO-8859-8’ for Hebrew, + • ‘ISO-8859-9’ for Turkish, + • ‘ISO-8859-13’ for Latvian, Lithuanian, Maori, + • ‘ISO-8859-14’ for Welsh, + • ‘ISO-8859-15’ for Basque, Catalan, Dutch, English, Finnish, + French, Galician, German, Irish, Italian, Portuguese, Spanish, + Swedish, Walloon, + • ‘KOI8-R’ for Russian, + • ‘KOI8-U’ for Ukrainian, + • ‘KOI8-T’ for Tajik, + • ‘CP1251’ for Bulgarian, Belarusian, + • ‘GB2312’, ‘GBK’, ‘GB18030’ for simplified writing of Chinese, + • ‘BIG5’, ‘BIG5-HKSCS’ for traditional writing of Chinese, + • ‘EUC-JP’ for Japanese, + • ‘EUC-KR’ for Korean, + • ‘TIS-620’ for Thai, + • ‘GEORGIAN-PS’ for Georgian, + • ‘UTF-8’ for any language, including those listed above. + + When single quote characters or double quote characters are used in + translations for your language, and your locale's encoding is one + of the ISO-8859-* charsets, it is best if you create your PO files + in UTF-8 encoding, instead of your locale's encoding. This is + because in UTF-8 the real quote characters can be represented + (single quote characters: U+2018, U+2019, double quote characters: + U+201C, U+201D), whereas none of ISO-8859-* charsets has them all. + Users in UTF-8 locales will see the real quote characters, whereas + users in ISO-8859-* locales will see the vertical apostrophe and + the vertical double quote instead (because that's what the + character set conversion will transliterate them to). + + To enter such quote characters under X11, you can change your + keyboard mapping using the ‘xmodmap’ program. The X11 names of the + quote characters are "leftsinglequotemark", "rightsinglequotemark", + "leftdoublequotemark", "rightdoublequotemark", + "singlelowquotemark", "doublelowquotemark". + + The character encoding name can be written in either upper or lower + case. Usually upper case is preferred. + +Content-Transfer-Encoding + Set this to ‘8bit’. + +Plural-Forms + This field is optional. It is only needed if the PO file has + plural forms. You can find them by searching for the + ‘msgid_plural’ keyword. The format of the plural forms field is + described in *note Plural forms:: and *note Translating plural + forms::. + + +File: gettext.info, Node: Updating, Next: Editing, Prev: Creating, Up: Top + +7 Updating Existing PO Files +**************************** + +* Menu: + +* msgmerge Invocation:: Invoking the ‘msgmerge’ Program + + +File: gettext.info, Node: msgmerge Invocation, Up: Updating + +7.1 Invoking the ‘msgmerge’ Program +=================================== + + msgmerge [OPTION] DEF.po REF.pot + + The ‘msgmerge’ program merges two Uniforum style .po files together. +The DEF.po file is an existing PO file with translations which will be +taken over to the newly created file as long as they still match; +comments will be preserved, but extracted comments and file positions +will be discarded. The REF.pot file is the last created PO file with +up-to-date source references but old translations, or a PO Template file +(generally created by ‘xgettext’); any translations or comments in the +file will be discarded, however dot comments and file positions will be +preserved. Where an exact match cannot be found, fuzzy matching is used +to produce better results. + +7.1.1 Input file location +------------------------- + +‘DEF.po’ + Translations referring to old sources. + +‘REF.pot’ + References to the new sources. + +‘-D DIRECTORY’ +‘--directory=DIRECTORY’ + Add DIRECTORY to the list of directories. Source files are + searched relative to this list of directories. The resulting ‘.po’ + file will be written relative to the current directory, though. + +‘-C FILE’ +‘--compendium=FILE’ + Specify an additional library of message translations. *Note + Compendium::. This option may be specified more than once. + +7.1.2 Operation mode +-------------------- + +‘-U’ +‘--update’ + Update DEF.po. Do nothing if DEF.po is already up to date. + +7.1.3 Output file location +-------------------------- + +‘-o FILE’ +‘--output-file=FILE’ + Write output to specified file. + + The results are written to standard output if no output file is +specified or if it is ‘-’. + +7.1.4 Output file location in update mode +----------------------------------------- + + The result is written back to DEF.po. + +‘--backup=CONTROL’ + Make a backup of DEF.po + +‘--suffix=SUFFIX’ + Override the usual backup suffix. + + The version control method may be selected via the ‘--backup’ option +or through the ‘VERSION_CONTROL’ environment variable. Here are the +values: + +‘none’ +‘off’ + Never make backups (even if ‘--backup’ is given). + +‘numbered’ +‘t’ + Make numbered backups. + +‘existing’ +‘nil’ + Make numbered backups if numbered backups for this file already + exist, otherwise make simple backups. + +‘simple’ +‘never’ + Always make simple backups. + + The backup suffix is ‘~’, unless set with ‘--suffix’ or the +‘SIMPLE_BACKUP_SUFFIX’ environment variable. + +7.1.5 Operation modifiers +------------------------- + +‘-m’ +‘--multi-domain’ + Apply REF.pot to each of the domains in DEF.po. + +‘--for-msgfmt’ + Produce a PO file meant for ‘msgfmt’ only, not for a translator. + This option omits untranslated messages, fuzzy messages (except the + header entry), and obsolete messages from the output. Also, it + omits translator comments and ‘#: FILENAME:LINE’ lines from the + output. In particular, this option implies ‘--no-fuzzy-matching’. + +‘-N’ +‘--no-fuzzy-matching’ + Do not use fuzzy matching when an exact match is not found. This + may speed up the operation considerably. + +‘--previous’ + Keep the previous msgids of translated messages, marked with ‘#|’, + when adding the fuzzy marker to such messages. + +7.1.6 Input file syntax +----------------------- + +‘-P’ +‘--properties-input’ + Assume the input files are Java ResourceBundles in Java + ‘.properties’ syntax, not in PO file syntax. + +‘--stringtable-input’ + Assume the input files are NeXTstep/GNUstep localized resource + files in ‘.strings’ syntax, not in PO file syntax. + +7.1.7 Output details +-------------------- + +‘--lang=CATALOGNAME’ + Specify the ‘Language’ field to be used in the header entry. See + *note Header Entry:: for the meaning of this field. Note: The + ‘Language-Team’ and ‘Plural-Forms’ fields are left unchanged. If + this option is not specified, the ‘Language’ field is inferred, as + best as possible, from the ‘Language-Team’ field. + +‘--color’ +‘--color=WHEN’ + Specify whether or when to use colors and other text attributes. + See *note The --color option:: for details. + +‘--style=STYLE_FILE’ + Specify the CSS style rule file to use for ‘--color’. See *note + The --style option:: for details. + +‘--force-po’ + Always write an output file even if it contains no message. + +‘-i’ +‘--indent’ + Write the .po file using indented style. + +‘--no-location’ + Do not write ‘#: FILENAME:LINE’ lines. + +‘-n’ +‘--add-location=TYPE’ + Generate ‘#: FILENAME:LINE’ lines (default). + + The optional TYPE can be either ‘full’, ‘file’, or ‘never’. If it + is not given or ‘full’, it generates the lines with both file name + and line number. If it is ‘file’, the line number part is omitted. + If it is ‘never’, it completely suppresses the lines (same as + ‘--no-location’). + +‘--strict’ + Write out a strict Uniforum conforming PO file. Note that this + Uniforum format should be avoided because it doesn't support the + GNU extensions. + +‘-p’ +‘--properties-output’ + Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note + that this file format doesn't support plural forms and silently + drops obsolete messages. + +‘--stringtable-output’ + Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ + syntax. Note that this file format doesn't support plural forms. + +‘-w NUMBER’ +‘--width=NUMBER’ + Set the output page width. Long strings in the output files will + be split across multiple lines in order to ensure that each line's + width (= number of screen columns) is less or equal to the given + NUMBER. + +‘--no-wrap’ + Do not break long message lines. Message lines whose width exceeds + the output page width will not be split into several lines. Only + file reference lines which are wider than the output page width + will be split. + +‘-s’ +‘--sort-output’ + Generate sorted output (deprecated). Note that using this option + makes it much harder for the translator to understand each + message's context. + +‘-F’ +‘--sort-by-file’ + Sort output by file location. + +7.1.8 Informative output +------------------------ + +‘-h’ +‘--help’ + Display this help and exit. + +‘-V’ +‘--version’ + Output version information and exit. + +‘-v’ +‘--verbose’ + Increase verbosity level. + +‘-q’ +‘--quiet’ +‘--silent’ + Suppress progress indicators. + + +File: gettext.info, Node: Editing, Next: Manipulating, Prev: Updating, Up: Top + +8 Editing PO Files +****************** + + As a translator, you will typically edit a PO file in an editor that +has built-in knowledge about the PO file format. You most probably +won't want to edit a PO file in a text editor for plain-text files, +because that would be cumbersome regarding cursor navigation and would +also easily lead to syntax mistakes. + +* Menu: + +* Web based localization:: Web-based PO editing +* Lokalize:: KDE's PO File Editor +* Gtranslator:: GNOME's PO File Editor +* Poedit:: A simple PO File Editor +* OmegaT:: A powerful Translation Editor +* Virtaal:: The Virtaal Translation Editor +* PO Mode:: Emacs's PO File Editor +* Vim:: Editing PO Files in vim +* Compendium:: Using Translation Compendia + + +File: gettext.info, Node: Web based localization, Next: Lokalize, Up: Editing + +8.1 Web-based PO editing +======================== + + There are two ways to edit a PO file: either through a web-based PO +editor, in a browser, or through a PO editor that you can install on +your computer. Which one you choose, depends on your habits. + + Typically, the software project for which you want to provide +translations has set up a workflow that you, as a translator, have to +follow. + + • There are projects which use the Weblate (https://weblate.org/) + localization suite. In this case, you have the choice between a + web-based PO editor + (https://docs.weblate.org/en/latest/user/translating.html) and a + workflow (https://docs.weblate.org/en/latest/user/files.html) where + you download the previous translation, update it with your + preferred PO editor, and then upload it back. + + • There are projects which offer you only a web-based PO editor, as + only choice. Since web-based tools restrict your freedom as a user + - you cannot make modifications on your own to that tool -, you + should complain to that project and claim the choice of using a + locally installed PO editor, because that is the only way that can + guarantee your freedom of choice and freedom to modify the + software. + + • There are projects which do not support web-based localizations. + In this case, pick a PO file editor as listed in the next few + sections. Examples for such projects are the Free Translation + Project (https://translationproject.org/), as well as projects + where you directly interact with the version control system of the + project. + + +File: gettext.info, Node: Lokalize, Next: Gtranslator, Prev: Web based localization, Up: Editing + +8.2 KDE's PO File Editor +======================== + + Lokalize () is the PO file editor +made by the KDE project. It is present in many +(https://repology.org/project/lokalize/versions) GNU/Linux +distributions. + + +File: gettext.info, Node: Gtranslator, Next: Poedit, Prev: Lokalize, Up: Editing + +8.3 GNOME's PO File Editor +========================== + + Gtranslator () is the PO +file editor made by the GNOME project. It is present in many +(https://repology.org/project/gtranslator/versions) GNU/Linux +distributions. + + +File: gettext.info, Node: Poedit, Next: OmegaT, Prev: Gtranslator, Up: Editing + +8.4 Poedit +========== + + Poedit () is another decent PO +file editor. It works on all major desktop OSes and is present in many +(https://repology.org/project/poedit/versions) GNU/Linux distributions. + + +File: gettext.info, Node: OmegaT, Next: Virtaal, Prev: Poedit, Up: Editing + +8.5 OmegaT +========== + + OmegaT (Wikipedia: , home page: +, code: ) is +a translation editor that focuses on speeding up the translator's work +through advanced features like translation memory, spell-checking, +glossaries, dictionaries. It supports not only PO files, but also +direct translation of various file formats (such as plain text, web +pages, OpenDocument files, DocBook XML, etc.) without using +intermediate files. It is present in many +(https://repology.org/omegat/poedit/versions) GNU/Linux distributions. + + +File: gettext.info, Node: Virtaal, Next: PO Mode, Prev: OmegaT, Up: Editing + +8.6 The Virtaal Translation Editor +================================== + + Virtaal (Wikipedia: , home +page: , code: +) is a translation editor that +supports not only PO files but also XLIFF files. It is present in some +(https://repology.org/project/virtaal/versions) GNU/Linux distributions, +such as Debian up to Debian 11. + + +File: gettext.info, Node: PO Mode, Next: Vim, Prev: Virtaal, Up: Editing + +8.7 Emacs's PO File Editor +========================== + + For those of you being the lucky users of Emacs, PO mode has been +specifically created for providing a cozy environment for editing or +modifying PO files. While editing a PO file, PO mode allows for the +easy browsing of auxiliary and compendium PO files, as well as for +following references into the set of C program sources from which PO +files have been derived. It has a few special features, among which are +the interactive marking of program strings as translatable, and the +validation of PO files with easy repositioning to PO file lines showing +errors. + + For the beginning, besides main PO mode commands (*note Main PO +Commands::), you should know how to move between entries (*note Entry +Positioning::), and how to handle untranslated entries (*note +Untranslated Entries::). + +* Menu: + +* Installation:: Completing GNU ‘gettext’ Installation +* Main PO Commands:: Main Commands +* Entry Positioning:: Entry Positioning +* Normalizing:: Normalizing Strings in Entries +* Translated Entries:: Translated Entries +* Fuzzy Entries:: Fuzzy Entries +* Untranslated Entries:: Untranslated Entries +* Obsolete Entries:: Obsolete Entries +* Modifying Translations:: Modifying Translations +* Modifying Comments:: Modifying Comments +* Subedit:: Mode for Editing Translations +* C Sources Context:: C Sources Context +* Auxiliary:: Consulting Auxiliary PO Files + + +File: gettext.info, Node: Installation, Next: Main PO Commands, Up: PO Mode + +8.7.1 Completing GNU ‘gettext’ Installation +------------------------------------------- + + Once you have received, unpacked, configured and compiled the GNU +‘gettext’ distribution, the ‘make install’ command puts in place the +programs ‘xgettext’, ‘msgfmt’, ‘gettext’, and ‘msgmerge’, as well as +their available message catalogs. To top off a comfortable +installation, you might also want to make the PO mode available to your +Emacs users. + + During the installation of the PO mode, you might want to modify your +file ‘.emacs’, once and for all, so it contains a few lines looking +like: + + (setq auto-mode-alist + (cons '("\\.po\\'\\|\\.po\\." . po-mode) auto-mode-alist)) + (autoload 'po-mode "po-mode" "Major mode for translators to edit PO files" t) + + Later, whenever you edit some ‘.po’ file, or any file having the +string ‘.po.’ within its name, Emacs loads ‘po-mode.elc’ (or +‘po-mode.el’) as needed, and automatically activates PO mode commands +for the associated buffer. The string _PO_ appears in the mode line for +any buffer for which PO mode is active. Many PO files may be active at +once in a single Emacs session. + + If you are using Emacs version 20 or newer, and have already +installed the appropriate international fonts on your system, you may +also tell Emacs how to determine automatically the coding system of +every PO file. This will often (but not always) cause the necessary +fonts to be loaded and used for displaying the translations on your +Emacs screen. For this to happen, add the lines: + + (modify-coding-system-alist 'file "\\.po\\'\\|\\.po\\." + 'po-find-file-coding-system) + (autoload 'po-find-file-coding-system "po-mode") + +to your ‘.emacs’ file. If, with this, you still see boxes instead of +international characters, try a different font set (via Shift Mouse +button 1). + + +File: gettext.info, Node: Main PO Commands, Next: Entry Positioning, Prev: Installation, Up: PO Mode + +8.7.2 Main PO mode Commands +--------------------------- + + After setting up Emacs with something similar to the lines in *note +Installation::, PO mode is activated for a window when Emacs finds a PO +file in that window. This puts the window read-only and establishes a +po-mode-map, which is a genuine Emacs mode, in a way that is not derived +from text mode in any way. Functions found on ‘po-mode-hook’, if any, +will be executed. + + When PO mode is active in a window, the letters ‘PO’ appear in the +mode line for that window. The mode line also displays how many entries +of each kind are held in the PO file. For example, the string +‘132t+3f+10u+2o’ would tell the translator that the PO mode contains 132 +translated entries (*note Translated Entries::, 3 fuzzy entries (*note +Fuzzy Entries::), 10 untranslated entries (*note Untranslated Entries::) +and 2 obsolete entries (*note Obsolete Entries::). Zero-coefficients +items are not shown. So, in this example, if the fuzzy entries were +unfuzzied, the untranslated entries were translated and the obsolete +entries were deleted, the mode line would merely display ‘145t’ for the +counters. + + The main PO commands are those which do not fit into the other +categories of subsequent sections. These allow for quitting PO mode or +for managing windows in special ways. + +‘_’ + Undo last modification to the PO file (‘po-undo’). + +‘Q’ + Quit processing and save the PO file (‘po-quit’). + +‘q’ + Quit processing, possibly after confirmation + (‘po-confirm-and-quit’). + +‘0’ + Temporary leave the PO file window (‘po-other-window’). + +‘?’ +‘h’ + Show help about PO mode (‘po-help’). + +‘=’ + Give some PO file statistics (‘po-statistics’). + +‘V’ + Batch validate the format of the whole PO file (‘po-validate’). + + The command ‘_’ (‘po-undo’) interfaces to the Emacs _undo_ facility. +*Note Undoing Changes: (emacs)Undo. Each time ‘_’ is typed, +modifications which the translator did to the PO file are undone a +little more. For the purpose of undoing, each PO mode command is +atomic. This is especially true for the ‘’ command: the whole +edition made by using a single use of this command is undone at once, +even if the edition itself implied several actions. However, while in +the editing window, one can undo the edition work quite parsimoniously. + + The commands ‘Q’ (‘po-quit’) and ‘q’ (‘po-confirm-and-quit’) are used +when the translator is done with the PO file. The former is a bit less +verbose than the latter. If the file has been modified, it is saved to +disk first. In both cases, and prior to all this, the commands check if +any untranslated messages remain in the PO file and, if so, the +translator is asked if she really wants to leave off working with this +PO file. This is the preferred way of getting rid of an Emacs PO file +buffer. Merely killing it through the usual command ‘C-x k’ +(‘kill-buffer’) is not the tidiest way to proceed. + + The command ‘0’ (‘po-other-window’) is another, softer way, to leave +PO mode, temporarily. It just moves the cursor to some other Emacs +window, and pops one if necessary. For example, if the translator just +got PO mode to show some source context in some other, she might +discover some apparent bug in the program source that needs correction. +This command allows the translator to change sex, become a programmer, +and have the cursor right into the window containing the program she (or +rather _he_) wants to modify. By later getting the cursor back in the +PO file window, or by asking Emacs to edit this file once again, PO mode +is then recovered. + + The command ‘h’ (‘po-help’) displays a summary of all available PO +mode commands. The translator should then type any character to resume +normal PO mode operations. The command ‘?’ has the same effect as ‘h’. + + The command ‘=’ (‘po-statistics’) computes the total number of +entries in the PO file, the ordinal of the current entry (counted from +1), the number of untranslated entries, the number of obsolete entries, +and displays all these numbers. + + The command ‘V’ (‘po-validate’) launches ‘msgfmt’ in checking and +verbose mode over the current PO file. This command first offers to +save the current PO file on disk. The ‘msgfmt’ tool, from GNU +‘gettext’, has the purpose of creating a MO file out of a PO file, and +PO mode uses the features of this program for checking the overall +format of a PO file, as well as all individual entries. + + The program ‘msgfmt’ runs asynchronously with Emacs, so the +translator regains control immediately while her PO file is being +studied. Error output is collected in the Emacs ‘*compilation*’ buffer, +displayed in another window. The regular Emacs command ‘C-x`’ +(‘next-error’), as well as other usual compile commands, allow the +translator to reposition quickly to the offending parts of the PO file. +Once the cursor is on the line in error, the translator may decide on +any PO mode action which would help correcting the error. + + +File: gettext.info, Node: Entry Positioning, Next: Normalizing, Prev: Main PO Commands, Up: PO Mode + +8.7.3 Entry Positioning +----------------------- + + The cursor in a PO file window is almost always part of an entry. +The only exceptions are the special case when the cursor is after the +last entry in the file, or when the PO file is empty. The entry where +the cursor is found to be is said to be the current entry. Many PO mode +commands operate on the current entry, so moving the cursor does more +than allowing the translator to browse the PO file, this also selects on +which entry commands operate. + + Some PO mode commands alter the position of the cursor in a +specialized way. A few of those special purpose positioning are +described here, the others are described in following sections (for a +complete list try ‘C-h m’): + +‘.’ + Redisplay the current entry (‘po-current-entry’). + +‘n’ + Select the entry after the current one (‘po-next-entry’). + +‘p’ + Select the entry before the current one (‘po-previous-entry’). + +‘<’ + Select the first entry in the PO file (‘po-first-entry’). + +‘>’ + Select the last entry in the PO file (‘po-last-entry’). + +‘m’ + Record the location of the current entry for later use + (‘po-push-location’). + +‘r’ + Return to a previously saved entry location (‘po-pop-location’). + +‘x’ + Exchange the current entry location with the previously saved one + (‘po-exchange-location’). + + Any Emacs command able to reposition the cursor may be used to select +the current entry in PO mode, including commands which move by +characters, lines, paragraphs, screens or pages, and search commands. +However, there is a kind of standard way to display the current entry in +PO mode, which usual Emacs commands moving the cursor do not especially +try to enforce. The command ‘.’ (‘po-current-entry’) has the sole +purpose of redisplaying the current entry properly, after the current +entry has been changed by means external to PO mode, or the Emacs screen +otherwise altered. + + It is yet to be decided if PO mode helps the translator, or otherwise +irritates her, by forcing a rigid window disposition while she is doing +her work. We originally had quite precise ideas about how windows +should behave, but on the other hand, anyone used to Emacs is often +happy to keep full control. Maybe a fixed window disposition might be +offered as a PO mode option that the translator might activate or +deactivate at will, so it could be offered on an experimental basis. If +nobody feels a real need for using it, or a compulsion for writing it, +we should drop this whole idea. The incentive for doing it should come +from translators rather than programmers, as opinions from an +experienced translator are surely more worth to me than opinions from +programmers _thinking_ about how _others_ should do translation. + + The commands ‘n’ (‘po-next-entry’) and ‘p’ (‘po-previous-entry’) move +the cursor the entry following, or preceding, the current one. If ‘n’ +is given while the cursor is on the last entry of the PO file, or if ‘p’ +is given while the cursor is on the first entry, no move is done. + + The commands ‘<’ (‘po-first-entry’) and ‘>’ (‘po-last-entry’) move +the cursor to the first entry, or last entry, of the PO file. When the +cursor is located past the last entry in a PO file, most PO mode +commands will return an error saying ‘After last entry’. Moreover, the +commands ‘<’ and ‘>’ have the special property of being able to work +even when the cursor is not into some PO file entry, and one may use +them for nicely correcting this situation. But even these commands will +fail on a truly empty PO file. There are development plans for the PO +mode for it to interactively fill an empty PO file from sources. *Note +Marking::. + + The translator may decide, before working at the translation of a +particular entry, that she needs to browse the remainder of the PO file, +maybe for finding the terminology or phraseology used in related +entries. She can of course use the standard Emacs idioms for saving the +current cursor location in some register, and use that register for +getting back, or else, use the location ring. + + PO mode offers another approach, by which cursor locations may be +saved onto a special stack. The command ‘m’ (‘po-push-location’) merely +adds the location of current entry to the stack, pushing the already +saved locations under the new one. The command ‘r’ (‘po-pop-location’) +consumes the top stack element and repositions the cursor to the entry +associated with that top element. This position is then lost, for the +next ‘r’ will move the cursor to the previously saved location, and so +on until no locations remain on the stack. + + If the translator wants the position to be kept on the location +stack, maybe for taking a look at the entry associated with the top +element, then go elsewhere with the intent of getting back later, she +ought to use ‘m’ immediately after ‘r’. + + The command ‘x’ (‘po-exchange-location’) simultaneously repositions +the cursor to the entry associated with the top element of the stack of +saved locations, and replaces that top element with the location of the +current entry before the move. Consequently, repeating the ‘x’ command +toggles alternatively between two entries. For achieving this, the +translator will position the cursor on the first entry, use ‘m’, then +position to the second entry, and merely use ‘x’ for making the switch. + + +File: gettext.info, Node: Normalizing, Next: Translated Entries, Prev: Entry Positioning, Up: PO Mode + +8.7.4 Normalizing Strings in Entries +------------------------------------ + + There are many different ways for encoding a particular string into a +PO file entry, because there are so many different ways to split and +quote multi-line strings, and even, to represent special characters by +backslashed escaped sequences. Some features of PO mode rely on the +ability for PO mode to scan an already existing PO file for a particular +string encoded into the ‘msgid’ field of some entry. Even if PO mode +has internally all the built-in machinery for implementing this +recognition easily, doing it fast is technically difficult. To +facilitate a solution to this efficiency problem, we decided on a +canonical representation for strings. + + A conventional representation of strings in a PO file is currently +under discussion, and PO mode experiments with a canonical +representation. Having both ‘xgettext’ and PO mode converging towards a +uniform way of representing equivalent strings would be useful, as the +internal normalization needed by PO mode could be automatically +satisfied when using ‘xgettext’ from GNU ‘gettext’. An explicit PO mode +normalization should then be only necessary for PO files imported from +elsewhere, or for when the convention itself evolves. + + So, for achieving normalization of at least the strings of a given PO +file needing a canonical representation, the following PO mode command +is available: + +‘M-x po-normalize’ + Tidy the whole PO file by making entries more uniform. + + The special command ‘M-x po-normalize’, which has no associated keys, +revises all entries, ensuring that strings of both original and +translated entries use uniform internal quoting in the PO file. It also +removes any crumb after the last entry. This command may be useful for +PO files freshly imported from elsewhere, or if we ever improve on the +canonical quoting format we use. This canonical format is not only +meant for getting cleaner PO files, but also for greatly speeding up +‘msgid’ string lookup for some other PO mode commands. + + ‘M-x po-normalize’ presently makes three passes over the entries. +The first implements heuristics for converting PO files for GNU +‘gettext’ 0.6 and earlier, in which ‘msgid’ and ‘msgstr’ fields were +using K&R style C string syntax for multi-line strings. These +heuristics may fail for comments not related to obsolete entries and +ending with a backslash; they also depend on subsequent passes for +finalizing the proper commenting of continued lines for obsolete +entries. This first pass might disappear once all oldish PO files would +have been adjusted. The second and third pass normalize all ‘msgid’ and +‘msgstr’ strings respectively. They also clean out those trailing +backslashes used by XView's ‘msgfmt’ for continued lines. + + Having such an explicit normalizing command allows for importing PO +files from other sources, but also eases the evolution of the current +convention, evolution driven mostly by aesthetic concerns, as of now. +It is easy to make suggested adjustments at a later time, as the +normalizing command and eventually, other GNU ‘gettext’ tools should +greatly automate conformance. A description of the canonical string +format is given below, for the particular benefit of those not having +Emacs handy, and who would nevertheless want to handcraft their PO files +in nice ways. + + Right now, in PO mode, strings are single line or multi-line. A +string goes multi-line if and only if it has _embedded_ newlines, that +is, if it matches ‘[^\n]\n+[^\n]’. So, we would have: + + msgstr "\n\nHello, world!\n\n\n" + + but, replacing the space by a newline, this becomes: + + msgstr "" + "\n" + "\n" + "Hello,\n" + "world!\n" + "\n" + "\n" + + We are deliberately using a caricatural example, here, to make the +point clearer. Usually, multi-lines are not that bad looking. It is +probable that we will implement the following suggestion. We might lump +together all initial newlines into the empty string, and also all +newlines introducing empty lines (that is, for N > 1, the N-1'th last +newlines would go together on a separate string), so making the previous +example appear: + + msgstr "\n\n" + "Hello,\n" + "world!\n" + "\n\n" + + There are a few yet undecided little points about string +normalization, to be documented in this manual, once these questions +settle. + + +File: gettext.info, Node: Translated Entries, Next: Fuzzy Entries, Prev: Normalizing, Up: PO Mode + +8.7.5 Translated Entries +------------------------ + + Each PO file entry for which the ‘msgstr’ field has been filled with +a translation, and which is not marked as fuzzy (*note Fuzzy Entries::), +is said to be a “translated” entry. Only translated entries will later +be compiled by GNU ‘msgfmt’ and become usable in programs. Other entry +types will be excluded; translation will not occur for them. + + Some commands are more specifically related to translated entry +processing. + +‘t’ + Find the next translated entry (‘po-next-translated-entry’). + +‘T’ + Find the previous translated entry + (‘po-previous-translated-entry’). + + The commands ‘t’ (‘po-next-translated-entry’) and ‘T’ +(‘po-previous-translated-entry’) move forwards or backwards, chasing for +an translated entry. If none is found, the search is extended and wraps +around in the PO file buffer. + + Translated entries usually result from the translator having edited +in a translation for them, *note Modifying Translations::. However, if +the variable ‘po-auto-fuzzy-on-edit’ is not ‘nil’, the entry having +received a new translation first becomes a fuzzy entry, which ought to +be later unfuzzied before becoming an official, genuine translated +entry. *Note Fuzzy Entries::. + + +File: gettext.info, Node: Fuzzy Entries, Next: Untranslated Entries, Prev: Translated Entries, Up: PO Mode + +8.7.6 Fuzzy Entries +------------------- + + Each PO file entry may have a set of “attributes”, which are +qualities given a name and explicitly associated with the translation, +using a special system comment. One of these attributes has the name +‘fuzzy’, and entries having this attribute are said to have a fuzzy +translation. They are called fuzzy entries, for short. + + Fuzzy entries, even if they account for translated entries for most +other purposes, usually call for revision by the translator. Those may +be produced by applying the program ‘msgmerge’ to update an older +translated PO files according to a new PO template file, when this tool +hypothesises that some new ‘msgid’ has been modified only slightly out +of an older one, and chooses to pair what it thinks to be the old +translation for the new modified entry. The slight alteration in the +original string (the ‘msgid’ string) should often be reflected in the +translated string, and this requires the intervention of the translator. +For this reason, ‘msgmerge’ might mark some entries as being fuzzy. + + Also, the translator may decide herself to mark an entry as fuzzy for +her own convenience, when she wants to remember that the entry has to be +later revisited. So, some commands are more specifically related to +fuzzy entry processing. + +‘f’ + Find the next fuzzy entry (‘po-next-fuzzy-entry’). + +‘F’ + Find the previous fuzzy entry (‘po-previous-fuzzy-entry’). + +‘’ + Remove the fuzzy attribute of the current entry (‘po-unfuzzy’). + + The commands ‘f’ (‘po-next-fuzzy-entry’) and ‘F’ +(‘po-previous-fuzzy-entry’) move forwards or backwards, chasing for a +fuzzy entry. If none is found, the search is extended and wraps around +in the PO file buffer. + + The command ‘’ (‘po-unfuzzy’) removes the fuzzy attribute +associated with an entry, usually leaving it translated. Further, if +the variable ‘po-auto-select-on-unfuzzy’ has not the ‘nil’ value, the +‘’ command will automatically chase for another interesting entry +to work on. The initial value of ‘po-auto-select-on-unfuzzy’ is ‘nil’. + + The initial value of ‘po-auto-fuzzy-on-edit’ is ‘nil’. However, if +the variable ‘po-auto-fuzzy-on-edit’ is set to ‘t’, any entry edited +through the ‘’ command is marked fuzzy, as a way to ensure some +kind of double check, later. In this case, the usual paradigm is that +an entry becomes fuzzy (if not already) whenever the translator modifies +it. If she is satisfied with the translation, she then uses ‘’ to +pick another entry to work on, clearing the fuzzy attribute on the same +blow. If she is not satisfied yet, she merely uses ‘’ to chase +another entry, leaving the entry fuzzy. + + The translator may also use the ‘’ command (‘po-fade-out-entry’) +over any translated entry to mark it as being fuzzy, when she wants to +easily leave a trace she wants to later return working at this entry. + + Also, when time comes to quit working on a PO file buffer with the +‘q’ command, the translator is asked for confirmation, if fuzzy string +still exists. + + +File: gettext.info, Node: Untranslated Entries, Next: Obsolete Entries, Prev: Fuzzy Entries, Up: PO Mode + +8.7.7 Untranslated Entries +-------------------------- + + When ‘xgettext’ originally creates a PO file, unless told otherwise, +it initializes the ‘msgid’ field with the untranslated string, and +leaves the ‘msgstr’ string to be empty. Such entries, having an empty +translation, are said to be “untranslated” entries. Later, when the +programmer slightly modifies some string right in the program, this +change is later reflected in the PO file by the appearance of a new +untranslated entry for the modified string. + + The usual commands moving from entry to entry consider untranslated +entries on the same level as active entries. Untranslated entries are +easily recognizable by the fact they end with ‘msgstr ""’. + + The work of the translator might be (quite naively) seen as the +process of seeking for an untranslated entry, editing a translation for +it, and repeating these actions until no untranslated entries remain. +Some commands are more specifically related to untranslated entry +processing. + +‘u’ + Find the next untranslated entry (‘po-next-untranslated-entry’). + +‘U’ + Find the previous untranslated entry + (‘po-previous-untransted-entry’). + +‘k’ + Turn the current entry into an untranslated one (‘po-kill-msgstr’). + + The commands ‘u’ (‘po-next-untranslated-entry’) and ‘U’ +(‘po-previous-untransted-entry’) move forwards or backwards, chasing for +an untranslated entry. If none is found, the search is extended and +wraps around in the PO file buffer. + + An entry can be turned back into an untranslated entry by merely +emptying its translation, using the command ‘k’ (‘po-kill-msgstr’). +*Note Modifying Translations::. + + Also, when time comes to quit working on a PO file buffer with the +‘q’ command, the translator is asked for confirmation, if some +untranslated string still exists. + + +File: gettext.info, Node: Obsolete Entries, Next: Modifying Translations, Prev: Untranslated Entries, Up: PO Mode + +8.7.8 Obsolete Entries +---------------------- + + By “obsolete” PO file entries, we mean those entries which are +commented out, usually by ‘msgmerge’ when it found that the translation +is not needed anymore by the package being localized. + + The usual commands moving from entry to entry consider obsolete +entries on the same level as active entries. Obsolete entries are +easily recognizable by the fact that all their lines start with ‘#’, +even those lines containing ‘msgid’ or ‘msgstr’. + + Commands exist for emptying the translation or reinitializing it to +the original untranslated string. Commands interfacing with the kill +ring may force some previously saved text into the translation. The +user may interactively edit the translation. All these commands may +apply to obsolete entries, carefully leaving the entry obsolete after +the fact. + + Moreover, some commands are more specifically related to obsolete +entry processing. + +‘o’ + Find the next obsolete entry (‘po-next-obsolete-entry’). + +‘O’ + Find the previous obsolete entry (‘po-previous-obsolete-entry’). + +‘’ + Make an active entry obsolete, or zap out an obsolete entry + (‘po-fade-out-entry’). + + The commands ‘o’ (‘po-next-obsolete-entry’) and ‘O’ +(‘po-previous-obsolete-entry’) move forwards or backwards, chasing for +an obsolete entry. If none is found, the search is extended and wraps +around in the PO file buffer. + + PO mode does not provide ways for un-commenting an obsolete entry and +making it active, because this would reintroduce an original +untranslated string which does not correspond to any marked string in +the program sources. This goes with the philosophy of never introducing +useless ‘msgid’ values. + + However, it is possible to comment out an active entry, so making it +obsolete. GNU ‘gettext’ utilities will later react to the disappearance +of a translation by using the untranslated string. The command ‘’ +(‘po-fade-out-entry’) pushes the current entry a little further towards +annihilation. If the entry is active (it is a translated entry), then +it is first made fuzzy. If it is already fuzzy, then the entry is +merely commented out, with confirmation. If the entry is already +obsolete, then it is completely deleted from the PO file. It is easy to +recycle the translation so deleted into some other PO file entry, +usually one which is untranslated. *Note Modifying Translations::. + + Here is a quite interesting problem to solve for later development of +PO mode, for those nights you are not sleepy. The idea would be that PO +mode might become bright enough, one of these days, to make good guesses +at retrieving the most probable candidate, among all obsolete entries, +for initializing the translation of a newly appeared string. I think it +might be a quite hard problem to do this algorithmically, as we have to +develop good and efficient measures of string similarity. Right now, PO +mode completely lets the decision to the translator, when the time comes +to find the adequate obsolete translation, it merely tries to provide +handy tools for helping her to do so. + + +File: gettext.info, Node: Modifying Translations, Next: Modifying Comments, Prev: Obsolete Entries, Up: PO Mode + +8.7.9 Modifying Translations +---------------------------- + + PO mode prevents direct modification of the PO file, by the usual +means Emacs gives for altering a buffer's contents. By doing so, it +pretends helping the translator to avoid little clerical errors about +the overall file format, or the proper quoting of strings, as those +errors would be easily made. Other kinds of errors are still possible, +but some may be caught and diagnosed by the batch validation process, +which the translator may always trigger by the ‘V’ command. For all +other errors, the translator has to rely on her own judgment, and also +on the linguistic reports submitted to her by the users of the +translated package, having the same mother tongue. + + When the time comes to create a translation, correct an error +diagnosed mechanically or reported by a user, the translators have to +resort to using the following commands for modifying the translations. + +‘’ + Interactively edit the translation (‘po-edit-msgstr’). + +‘’ +‘C-j’ + Reinitialize the translation with the original, untranslated string + (‘po-msgid-to-msgstr’). + +‘k’ + Save the translation on the kill ring, and delete it + (‘po-kill-msgstr’). + +‘w’ + Save the translation on the kill ring, without deleting it + (‘po-kill-ring-save-msgstr’). + +‘y’ + Replace the translation, taking the new from the kill ring + (‘po-yank-msgstr’). + + The command ‘’ (‘po-edit-msgstr’) opens a new Emacs window meant +to edit in a new translation, or to modify an already existing +translation. The new window contains a copy of the translation taken +from the current PO file entry, all ready for edition, expunged of all +quoting marks, fully modifiable and with the complete extent of Emacs +modifying commands. When the translator is done with her modifications, +she may use ‘C-c C-c’ to close the subedit window with the automatically +requoted results, or ‘C-c C-k’ to abort her modifications. *Note +Subedit::, for more information. + + The command ‘’ (‘po-msgid-to-msgstr’) initializes, or +reinitializes the translation with the original string. This command is +normally used when the translator wants to redo a fresh translation of +the original string, disregarding any previous work. + + It is possible to arrange so, whenever editing an untranslated entry, +the ‘’ command be automatically executed. If you set +‘po-auto-edit-with-msgid’ to ‘t’, the translation gets initialised with +the original string, in case none exists already. The default value for +‘po-auto-edit-with-msgid’ is ‘nil’. + + In fact, whether it is best to start a translation with an empty +string, or rather with a copy of the original string, is a matter of +taste or habit. Sometimes, the source language and the target language +are so different that is simply best to start writing on an empty page. +At other times, the source and target languages are so close that it +would be a waste to retype a number of words already being written in +the original string. A translator may also like having the original +string right under her eyes, as she will progressively overwrite the +original text with the translation, even if this requires some extra +editing work to get rid of the original. + + The command ‘k’ (‘po-kill-msgstr’) merely empties the translation +string, so turning the entry into an untranslated one. But while doing +so, its previous contents is put apart in a special place, known as the +kill ring. The command ‘w’ (‘po-kill-ring-save-msgstr’) has also the +effect of taking a copy of the translation onto the kill ring, but it +otherwise leaves the entry alone, and does _not_ remove the translation +from the entry. Both commands use exactly the Emacs kill ring, which is +shared between buffers, and which is well known already to Emacs lovers. + + The translator may use ‘k’ or ‘w’ many times in the course of her +work, as the kill ring may hold several saved translations. From the +kill ring, strings may later be reinserted in various Emacs buffers. In +particular, the kill ring may be used for moving translation strings +between different entries of a single PO file buffer, or if the +translator is handling many such buffers at once, even between PO files. + + To facilitate exchanges with buffers which are not in PO mode, the +translation string put on the kill ring by the ‘k’ command is fully +unquoted before being saved: external quotes are removed, multi-line +strings are concatenated, and backslash escaped sequences are turned +into their corresponding characters. In the special case of obsolete +entries, the translation is also uncommented prior to saving. + + The command ‘y’ (‘po-yank-msgstr’) completely replaces the +translation of the current entry by a string taken from the kill ring. +Following Emacs terminology, we then say that the replacement string is +“yanked” into the PO file buffer. *Note (emacs)Yanking::. The first +time ‘y’ is used, the translation receives the value of the most recent +addition to the kill ring. If ‘y’ is typed once again, immediately, +without intervening keystrokes, the translation just inserted is taken +away and replaced by the second most recent addition to the kill ring. +By repeating ‘y’ many times in a row, the translator may travel along +the kill ring for saved strings, until she finds the string she really +wanted. + + When a string is yanked into a PO file entry, it is fully and +automatically requoted for complying with the format PO files should +have. Further, if the entry is obsolete, PO mode then appropriately +push the inserted string inside comments. Once again, translators +should not burden themselves with quoting considerations besides, of +course, the necessity of the translated string itself respective to the +program using it. + + Note that ‘k’ or ‘w’ are not the only commands pushing strings on the +kill ring, as almost any PO mode command replacing translation strings +(or the translator comments) automatically saves the old string on the +kill ring. The main exceptions to this general rule are the yanking +commands themselves. + + To better illustrate the operation of killing and yanking, let's use +an actual example, taken from a common situation. When the programmer +slightly modifies some string right in the program, his change is later +reflected in the PO file by the appearance of a new untranslated entry +for the modified string, and the fact that the entry translating the +original or unmodified string becomes obsolete. In many cases, the +translator might spare herself some work by retrieving the unmodified +translation from the obsolete entry, then initializing the untranslated +entry ‘msgstr’ field with this retrieved translation. Once this done, +the obsolete entry is not wanted anymore, and may be safely deleted. + + When the translator finds an untranslated entry and suspects that a +slight variant of the translation exists, she immediately uses ‘m’ to +mark the current entry location, then starts chasing obsolete entries +with ‘o’, hoping to find some translation corresponding to the +unmodified string. Once found, she uses the ‘’ command for +deleting the obsolete entry, knowing that ‘’ also _kills_ the +translation, that is, pushes the translation on the kill ring. Then, +‘r’ returns to the initial untranslated entry, and ‘y’ then _yanks_ the +saved translation right into the ‘msgstr’ field. The translator is then +free to use ‘’ for fine tuning the translation contents, and maybe +to later use ‘u’, then ‘m’ again, for going on with the next +untranslated string. + + When some sequence of keys has to be typed over and over again, the +translator may find it useful to become better acquainted with the Emacs +capability of learning these sequences and playing them back under +request. *Note (emacs)Keyboard Macros::. + + +File: gettext.info, Node: Modifying Comments, Next: Subedit, Prev: Modifying Translations, Up: PO Mode + +8.7.10 Modifying Comments +------------------------- + + Any translation work done seriously will raise many linguistic +difficulties, for which decisions have to be made, and the choices +further documented. These documents may be saved within the PO file in +form of translator comments, which the translator is free to create, +delete, or modify at will. These comments may be useful to herself when +she returns to this PO file after a while. + + Comments not having whitespace after the initial ‘#’, for example, +those beginning with ‘#.’ or ‘#:’, are _not_ translator comments, they +are exclusively created by other ‘gettext’ tools. So, the commands +below will never alter such system added comments, they are not meant +for the translator to modify. *Note PO Files::. + + The following commands are somewhat similar to those modifying +translations, so the general indications given for those apply here. +*Note Modifying Translations::. + +‘#’ + Interactively edit the translator comments (‘po-edit-comment’). + +‘K’ + Save the translator comments on the kill ring, and delete it + (‘po-kill-comment’). + +‘W’ + Save the translator comments on the kill ring, without deleting it + (‘po-kill-ring-save-comment’). + +‘Y’ + Replace the translator comments, taking the new from the kill ring + (‘po-yank-comment’). + + These commands parallel PO mode commands for modifying the +translation strings, and behave much the same way as they do, except +that they handle this part of PO file comments meant for translator +usage, rather than the translation strings. So, if the descriptions +given below are slightly succinct, it is because the full details have +already been given. *Note Modifying Translations::. + + The command ‘#’ (‘po-edit-comment’) opens a new Emacs window +containing a copy of the translator comments on the current PO file +entry. If there are no such comments, PO mode understands that the +translator wants to add a comment to the entry, and she is presented +with an empty screen. Comment marks (‘#’) and the space following them +are automatically removed before edition, and reinstated after. For +translator comments pertaining to obsolete entries, the uncommenting and +recommenting operations are done twice. Once in the editing window, the +keys ‘C-c C-c’ allow the translator to tell she is finished with editing +the comment. *Note Subedit::, for further details. + + Functions found on ‘po-subedit-mode-hook’, if any, are executed after +the string has been inserted in the edit buffer. + + The command ‘K’ (‘po-kill-comment’) gets rid of all translator +comments, while saving those comments on the kill ring. The command ‘W’ +(‘po-kill-ring-save-comment’) takes a copy of the translator comments on +the kill ring, but leaves them undisturbed in the current entry. The +command ‘Y’ (‘po-yank-comment’) completely replaces the translator +comments by a string taken at the front of the kill ring. When this +command is immediately repeated, the comments just inserted are +withdrawn, and replaced by other strings taken along the kill ring. + + On the kill ring, all strings have the same nature. There is no +distinction between _translation_ strings and _translator comments_ +strings. So, for example, let's presume the translator has just +finished editing a translation, and wants to create a new translator +comment to document why the previous translation was not good, just to +remember what was the problem. Foreseeing that she will do that in her +documentation, the translator may want to quote the previous translation +in her translator comments. To do so, she may initialize the translator +comments with the previous translation, still at the head of the kill +ring. Because editing already pushed the previous translation on the +kill ring, she merely has to type ‘M-w’ prior to ‘#’, and the previous +translation will be right there, all ready for being introduced by some +explanatory text. + + On the other hand, presume there are some translator comments already +and that the translator wants to add to those comments, instead of +wholly replacing them. Then, she should edit the comment right away +with ‘#’. Once inside the editing window, she can use the regular Emacs +commands ‘C-y’ (‘yank’) and ‘M-y’ (‘yank-pop’) to get the previous +translation where she likes. + + +File: gettext.info, Node: Subedit, Next: C Sources Context, Prev: Modifying Comments, Up: PO Mode + +8.7.11 Details of Sub Edition +----------------------------- + + The PO subedit minor mode has a few peculiarities worth being +described in fuller detail. It installs a few commands over the usual +editing set of Emacs, which are described below. + +‘C-c C-c’ + Complete edition (‘po-subedit-exit’). + +‘C-c C-k’ + Abort edition (‘po-subedit-abort’). + +‘C-c C-a’ + Consult auxiliary PO files (‘po-subedit-cycle-auxiliary’). + + The window's contents represents a translation for a given message, +or a translator comment. The translator may modify this window to her +heart's content. Once this is done, the command ‘C-c C-c’ +(‘po-subedit-exit’) may be used to return the edited translation into +the PO file, replacing the original translation, even if it moved out of +sight or if buffers were switched. + + If the translator becomes unsatisfied with her translation or +comment, to the extent she prefers keeping what was existent prior to +the ‘’ or ‘#’ command, she may use the command ‘C-c C-k’ +(‘po-subedit-abort’) to merely get rid of edition, while preserving the +original translation or comment. Another way would be for her to exit +normally with ‘C-c C-c’, then type ‘U’ once for undoing the whole effect +of last edition. + + The command ‘C-c C-a’ (‘po-subedit-cycle-auxiliary’) allows for +glancing through translations already achieved in other languages, +directly while editing the current translation. This may be quite +convenient when the translator is fluent at many languages, but of +course, only makes sense when such completed auxiliary PO files are +already available to her (*note Auxiliary::). + + Functions found on ‘po-subedit-mode-hook’, if any, are executed after +the string has been inserted in the edit buffer. + + While editing her translation, the translator should pay attention to +not inserting unwanted ‘’ (newline) characters at the end of the +translated string if those are not meant to be there, or to removing +such characters when they are required. Since these characters are not +visible in the editing buffer, they are easily introduced by mistake. +To help her, ‘’ automatically puts the character ‘<’ at the end of +the string being edited, but this ‘<’ is not really part of the string. +On exiting the editing window with ‘C-c C-c’, PO mode automatically +removes such ‘<’ and all whitespace added after it. If the translator +adds characters after the terminating ‘<’, it looses its delimiting +property and integrally becomes part of the string. If she removes the +delimiting ‘<’, then the edited string is taken _as is_, with all +trailing newlines, even if invisible. Also, if the translated string +ought to end itself with a genuine ‘<’, then the delimiting ‘<’ may not +be removed; so the string should appear, in the editing window, as +ending with two ‘<’ in a row. + + When a translation (or a comment) is being edited, the translator may +move the cursor back into the PO file buffer and freely move to other +entries, browsing at will. If, with an edition pending, the translator +wanders in the PO file buffer, she may decide to start modifying another +entry. Each entry being edited has its own subedit buffer. It is +possible to simultaneously edit the translation _and_ the comment of a +single entry, or to edit entries in different PO files, all at once. +Typing ‘’ on a field already being edited merely resumes that +particular edit. Yet, the translator should better be comfortable at +handling many Emacs windows! + + Pending subedits may be completed or aborted in any order, regardless +of how or when they were started. When many subedits are pending and +the translator asks for quitting the PO file (with the ‘q’ command), +subedits are automatically resumed one at a time, so she may decide for +each of them. + + +File: gettext.info, Node: C Sources Context, Next: Auxiliary, Prev: Subedit, Up: PO Mode + +8.7.12 C Sources Context +------------------------ + + PO mode is particularly powerful when used with PO files created +through GNU ‘gettext’ utilities, as those utilities insert special +comments in the PO files they generate. Some of these special comments +relate the PO file entry to exactly where the untranslated string +appears in the program sources. + + When the translator gets to an untranslated entry, she is fairly +often faced with an original string which is not as informative as it +normally should be, being succinct, cryptic, or otherwise ambiguous. +Before choosing how to translate the string, she needs to understand +better what the string really means and how tight the translation has to +be. Most of the time, when problems arise, the only way left to make +her judgment is looking at the true program sources from where this +string originated, searching for surrounding comments the programmer +might have put in there, and looking around for helping clues of _any_ +kind. + + Surely, when looking at program sources, the translator will receive +more help if she is a fluent programmer. However, even if she is not +versed in programming and feels a little lost in C code, the translator +should not be shy at taking a look, once in a while. It is most +probable that she will still be able to find some of the hints she +needs. She will learn quickly to not feel uncomfortable in program +code, paying more attention to programmer's comments, variable and +function names (if he dared choosing them well), and overall +organization, than to the program code itself. + + The following commands are meant to help the translator at getting +program source context for a PO file entry. + +‘s’ + Resume the display of a program source context, or cycle through + them (‘po-cycle-source-reference’). + +‘M-s’ + Display of a program source context selected by menu + (‘po-select-source-reference’). + +‘S’ + Add a directory to the search path for source files + (‘po-consider-source-path’). + +‘M-S’ + Delete a directory from the search path for source files + (‘po-ignore-source-path’). + + The commands ‘s’ (‘po-cycle-source-reference’) and ‘M-s’ +(‘po-select-source-reference’) both open another window displaying some +source program file, and already positioned in such a way that it shows +an actual use of the string to be translated. By doing so, the command +gives source program context for the string. But if the entry has no +source context references, or if all references are unresolved along the +search path for program sources, then the command diagnoses this as an +error. + + Even if ‘s’ (or ‘M-s’) opens a new window, the cursor stays in the PO +file window. If the translator really wants to get into the program +source window, she ought to do it explicitly, maybe by using command +‘O’. + + When ‘s’ is typed for the first time, or for a PO file entry which is +different of the last one used for getting source context, then the +command reacts by giving the first context available for this entry, if +any. If some context has already been recently displayed for the +current PO file entry, and the translator wandered off to do other +things, typing ‘s’ again will merely resume, in another window, the +context last displayed. In particular, if the translator moved the +cursor away from the context in the source file, the command will bring +the cursor back to the context. By using ‘s’ many times in a row, with +no other commands intervening, PO mode will cycle to the next available +contexts for this particular entry, getting back to the first context +once the last has been shown. + + The command ‘M-s’ behaves differently. Instead of cycling through +references, it lets the translator choose a particular reference among +many, and displays that reference. It is best used with completion, if +the translator types ‘’ immediately after ‘M-s’, in response to the +question, she will be offered a menu of all possible references, as a +reminder of which are the acceptable answers. This command is useful +only where there are really many contexts available for a single string +to translate. + + Program source files are usually found relative to where the PO file +stands. As a special provision, when this fails, the file is also +looked for, but relative to the directory immediately above it. Those +two cases take proper care of most PO files. However, it might happen +that a PO file has been moved, or is edited in a different place than +its normal location. When this happens, the translator should tell PO +mode in which directory normally sits the genuine PO file. Many such +directories may be specified, and all together, they constitute what is +called the “search path” for program sources. The command ‘S’ +(‘po-consider-source-path’) is used to interactively enter a new +directory at the front of the search path, and the command ‘M-S’ +(‘po-ignore-source-path’) is used to select, with completion, one of the +directories she does not want anymore on the search path. + + +File: gettext.info, Node: Auxiliary, Prev: C Sources Context, Up: PO Mode + +8.7.13 Consulting Auxiliary PO Files +------------------------------------ + + PO mode is able to help the knowledgeable translator, being fluent in +many languages, at taking advantage of translations already achieved in +other languages she just happens to know. It provides these other +language translations as additional context for her own work. Moreover, +it has features to ease the production of translations for many +languages at once, for translators preferring to work in this way. + + An “auxiliary” PO file is an existing PO file meant for the same +package the translator is working on, but targeted to a different mother +tongue language. Commands exist for declaring and handling auxiliary PO +files, and also for showing contexts for the entry under work. + + Here are the auxiliary file commands available in PO mode. + +‘a’ + Seek auxiliary files for another translation for the same entry + (‘po-cycle-auxiliary’). + +‘C-c C-a’ + Switch to a particular auxiliary file (‘po-select-auxiliary’). + +‘A’ + Declare this PO file as an auxiliary file + (‘po-consider-as-auxiliary’). + +‘M-A’ + Remove this PO file from the list of auxiliary files + (‘po-ignore-as-auxiliary’). + + Command ‘A’ (‘po-consider-as-auxiliary’) adds the current PO file to +the list of auxiliary files, while command ‘M-A’ +(‘po-ignore-as-auxiliary’ just removes it. + + The command ‘a’ (‘po-cycle-auxiliary’) seeks all auxiliary PO files, +round-robin, searching for a translated entry in some other language +having an ‘msgid’ field identical as the one for the current entry. The +found PO file, if any, takes the place of the current PO file in the +display (its window gets on top). Before doing so, the current PO file +is also made into an auxiliary file, if not already. So, ‘a’ in this +newly displayed PO file will seek another PO file, and so on, so +repeating ‘a’ will eventually yield back the original PO file. + + The command ‘C-c C-a’ (‘po-select-auxiliary’) asks the translator for +her choice of a particular auxiliary file, with completion, and then +switches to that selected PO file. The command also checks if the +selected file has an ‘msgid’ field identical as the one for the current +entry, and if yes, this entry becomes current. Otherwise, the cursor of +the selected file is left undisturbed. + + For all this to work fully, auxiliary PO files will have to be +normalized, in that way that ‘msgid’ fields should be written _exactly_ +the same way. It is possible to write ‘msgid’ fields in various ways +for representing the same string, different writing would break the +proper behaviour of the auxiliary file commands of PO mode. This is not +expected to be much a problem in practice, as most existing PO files +have their ‘msgid’ entries written by the same GNU ‘gettext’ tools. + + However, PO files initially created by PO mode itself, while marking +strings in source files, are normalised differently. So are PO files +resulting of the ‘M-x normalize’ command. Until these discrepancies +between PO mode and other GNU ‘gettext’ tools get fully resolved, the +translator should stay aware of normalisation issues. + + +File: gettext.info, Node: Vim, Next: Compendium, Prev: PO Mode, Up: Editing + +8.8 Editing PO Files in vim +=========================== + + FIXME: Try these scripts. Do they work well? How do they compare? + + There are two ‘vim’ plugins for editing PO files in ‘vim’: + + • The one by Aleksandar Jelenak (2005), at + . + + • A fork of it (2009), at + . + + Additionally, if you only need syntax highlighting, not editing, of +PO files, there is a ‘vim’ script for that at +. + + +File: gettext.info, Node: Compendium, Prev: Vim, Up: Editing + +8.9 Using Translation Compendia +=============================== + + A “compendium” is a special PO file containing a set of translations +recurring in many different packages. The translator can use gettext +tools to build a new compendium, to add entries to her compendium, and +to initialize untranslated entries, or to update already translated +entries, from translations kept in the compendium. + +* Menu: + +* Creating Compendia:: Merging translations for later use +* Using Compendia:: Using older translations if they fit + + +File: gettext.info, Node: Creating Compendia, Next: Using Compendia, Up: Compendium + +8.9.1 Creating Compendia +------------------------ + + Basically every PO file consisting of translated entries only can be +declared as a valid compendium. Often the translator wants to have +special compendia; let's consider two cases: ‘concatenating PO files’ +and ‘extracting a message subset from a PO file’. + +8.9.1.1 Concatenate PO Files +............................ + + To concatenate several valid PO files into one compendium file you +can use ‘msgcomm’ or ‘msgcat’ (the latter preferred): + + msgcat -o compendium.po file1.po file2.po + + By default, ‘msgcat’ will accumulate divergent translations for the +same string. Those occurrences will be marked as ‘fuzzy’ and highly +visible decorated; calling ‘msgcat’ on ‘file1.po’: + + #: src/hello.c:200 + #, c-format + msgid "Report bugs to <%s>.\n" + msgstr "Comunicar `bugs' a <%s>.\n" + +and ‘file2.po’: + + #: src/bye.c:100 + #, c-format + msgid "Report bugs to <%s>.\n" + msgstr "Comunicar \"bugs\" a <%s>.\n" + +will result in: + + #: src/hello.c:200 src/bye.c:100 + #, fuzzy, c-format + msgid "Report bugs to <%s>.\n" + msgstr "" + "#-#-#-#-# file1.po #-#-#-#-#\n" + "Comunicar `bugs' a <%s>.\n" + "#-#-#-#-# file2.po #-#-#-#-#\n" + "Comunicar \"bugs\" a <%s>.\n" + +The translator will have to resolve this "conflict" manually; she has to +decide whether the first or the second version is appropriate (or +provide a new translation), to delete the "marker lines", and finally to +remove the ‘fuzzy’ mark. + + If the translator knows in advance the first found translation of a +message is always the best translation she can make use to the +‘--use-first’ switch: + + msgcat --use-first -o compendium.po file1.po file2.po + + A good compendium file must not contain ‘fuzzy’ or untranslated +entries. If input files are "dirty" you must preprocess the input files +or postprocess the result using ‘msgattrib --translated --no-fuzzy’. + +8.9.1.2 Extract a Message Subset from a PO File +............................................... + + Nobody wants to translate the same messages again and again; thus you +may wish to have a compendium file containing ‘getopt.c’ messages. + + To extract a message subset (e.g., all ‘getopt.c’ messages) from an +existing PO file into one compendium file you can use ‘msggrep’: + + msggrep --location src/getopt.c -o compendium.po file.po + + +File: gettext.info, Node: Using Compendia, Prev: Creating Compendia, Up: Compendium + +8.9.2 Using Compendia +--------------------- + + You can use a compendium file to initialize a translation from +scratch or to update an already existing translation. + +8.9.2.1 Initialize a New Translation File +......................................... + + Since a PO file with translations does not exist the translator can +merely use ‘/dev/null’ to fake the "old" translation file. + + msgmerge --compendium compendium.po -o file.po /dev/null file.pot + +8.9.2.2 Update an Existing Translation File +........................................... + + Concatenate the compendium file(s) and the existing PO, merge the +result with the POT file and remove the obsolete entries (optional, here +done using ‘msgattrib’): + + msgcat --use-first -o update.po compendium1.po compendium2.po file.po + msgmerge update.po file.pot | msgattrib --no-obsolete > file.po + + +File: gettext.info, Node: Manipulating, Next: Binaries, Prev: Editing, Up: Top + +9 Manipulating PO Files +*********************** + + Sometimes it is necessary to manipulate PO files in a way that is +better performed automatically than by hand. GNU ‘gettext’ includes a +complete set of tools for this purpose. + + When merging two packages into a single package, the resulting POT +file will be the concatenation of the two packages' POT files. Thus the +maintainer must concatenate the two existing package translations into a +single translation catalog, for each language. This is best performed +using ‘msgcat’. It is then the translators' duty to deal with any +possible conflicts that arose during the merge. + + When a translator takes over the translation job from another +translator, but she uses a different character encoding in her locale, +she will convert the catalog to her character encoding. This is best +done through the ‘msgconv’ program. + + When a maintainer takes a source file with tagged messages from +another package, he should also take the existing translations for this +source file (and not let the translators do the same job twice). One +way to do this is through ‘msggrep’, another is to create a POT file for +that source file and use ‘msgmerge’. + + When a translator wants to adjust some translation catalog for a +special dialect or orthography -- for example, German as written in +Switzerland versus German as written in Germany -- she needs to apply +some text processing to every message in the catalog. The tool for +doing this is ‘msgfilter’. + + Another use of ‘msgfilter’ is to produce approximately the POT file +for which a given PO file was made. This can be done through a filter +command like ‘msgfilter sed -e d | sed -e '/^# /d'’. Note that the +original POT file may have had different comments and different plural +message counts, that's why it's better to use the original POT file if +available. + + When a translator wants to check her translations, for example +according to orthography rules or using a non-interactive spell checker, +she can do so using the ‘msgexec’ program. + + When third party tools create PO or POT files, sometimes duplicates +cannot be avoided. But the GNU ‘gettext’ tools give an error when they +encounter duplicate msgids in the same file and in the same domain. To +merge duplicates, the ‘msguniq’ program can be used. + + ‘msgcomm’ is a more general tool for keeping or throwing away +duplicates, occurring in different files. + + ‘msgcmp’ can be used to check whether a translation catalog is +completely translated. + + ‘msgattrib’ can be used to select and extract only the fuzzy or +untranslated messages of a translation catalog. + + ‘msgen’ is useful as a first step for preparing English translation +catalogs. It copies each message's msgid to its msgstr. + + Finally, for those applications where all these various programs are +not sufficient, a library ‘libgettextpo’ is provided that can be used to +write other specialized programs that process PO files. + +* Menu: + +* msgcat Invocation:: Invoking the ‘msgcat’ Program +* msgconv Invocation:: Invoking the ‘msgconv’ Program +* msggrep Invocation:: Invoking the ‘msggrep’ Program +* msgfilter Invocation:: Invoking the ‘msgfilter’ Program +* msguniq Invocation:: Invoking the ‘msguniq’ Program +* msgcomm Invocation:: Invoking the ‘msgcomm’ Program +* msgcmp Invocation:: Invoking the ‘msgcmp’ Program +* msgattrib Invocation:: Invoking the ‘msgattrib’ Program +* msgen Invocation:: Invoking the ‘msgen’ Program +* msgexec Invocation:: Invoking the ‘msgexec’ Program +* Colorizing:: Highlighting parts of PO files +* Other tools:: Other tools for manipulating PO files +* libgettextpo:: Writing your own programs that process PO files + + +File: gettext.info, Node: msgcat Invocation, Next: msgconv Invocation, Up: Manipulating + +9.1 Invoking the ‘msgcat’ Program +================================= + + msgcat [OPTION] [INPUTFILE]... + + The ‘msgcat’ program concatenates and merges the specified PO files. +It finds messages which are common to two or more of the specified PO +files. By using the ‘--more-than’ option, greater commonality may be +requested before messages are printed. Conversely, the ‘--less-than’ +option may be used to specify less commonality before messages are +printed (i.e. ‘--less-than=2’ will only print the unique messages). +Translations, comments, extracted comments, and file positions will be +cumulated, except that if ‘--use-first’ is specified, they will be taken +from the first PO file to define them. + + To concatenate POT files, better use ‘xgettext’, not ‘msgcat’, +because ‘msgcat’ would choke on the undefined charsets in the specified +POT files. + +9.1.1 Input file location +------------------------- + +‘INPUTFILE ...’ + Input files. + +‘-f FILE’ +‘--files-from=FILE’ + Read the names of the input files from FILE instead of getting them + from the command line. + +‘-D DIRECTORY’ +‘--directory=DIRECTORY’ + Add DIRECTORY to the list of directories. Source files are + searched relative to this list of directories. The resulting ‘.po’ + file will be written relative to the current directory, though. + + If INPUTFILE is ‘-’, standard input is read. + +9.1.2 Output file location +-------------------------- + +‘-o FILE’ +‘--output-file=FILE’ + Write output to specified file. + + The results are written to standard output if no output file is +specified or if it is ‘-’. + +9.1.3 Message selection +----------------------- + +‘-< NUMBER’ +‘--less-than=NUMBER’ + Print messages with less than NUMBER definitions, defaults to + infinite if not set. + +‘-> NUMBER’ +‘--more-than=NUMBER’ + Print messages with more than NUMBER definitions, defaults to 0 if + not set. + +‘-u’ +‘--unique’ + Shorthand for ‘--less-than=2’. Requests that only unique messages + be printed. + +9.1.4 Input file syntax +----------------------- + +‘-P’ +‘--properties-input’ + Assume the input files are Java ResourceBundles in Java + ‘.properties’ syntax, not in PO file syntax. + +‘--stringtable-input’ + Assume the input files are NeXTstep/GNUstep localized resource + files in ‘.strings’ syntax, not in PO file syntax. + +9.1.5 Output details +-------------------- + +‘-t’ +‘--to-code=NAME’ + Specify encoding for output. + +‘--use-first’ + Use first available translation for each message. Don't merge + several translations into one. + +‘--lang=CATALOGNAME’ + Specify the ‘Language’ field to be used in the header entry. See + *note Header Entry:: for the meaning of this field. Note: The + ‘Language-Team’ and ‘Plural-Forms’ fields are left unchanged. + +‘--color’ +‘--color=WHEN’ + Specify whether or when to use colors and other text attributes. + See *note The --color option:: for details. + +‘--style=STYLE_FILE’ + Specify the CSS style rule file to use for ‘--color’. See *note + The --style option:: for details. + +‘--force-po’ + Always write an output file even if it contains no message. + +‘-i’ +‘--indent’ + Write the .po file using indented style. + +‘--no-location’ + Do not write ‘#: FILENAME:LINE’ lines. + +‘-n’ +‘--add-location=TYPE’ + Generate ‘#: FILENAME:LINE’ lines (default). + + The optional TYPE can be either ‘full’, ‘file’, or ‘never’. If it + is not given or ‘full’, it generates the lines with both file name + and line number. If it is ‘file’, the line number part is omitted. + If it is ‘never’, it completely suppresses the lines (same as + ‘--no-location’). + +‘--strict’ + Write out a strict Uniforum conforming PO file. Note that this + Uniforum format should be avoided because it doesn't support the + GNU extensions. + +‘-p’ +‘--properties-output’ + Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note + that this file format doesn't support plural forms and silently + drops obsolete messages. + +‘--stringtable-output’ + Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ + syntax. Note that this file format doesn't support plural forms. + +‘-w NUMBER’ +‘--width=NUMBER’ + Set the output page width. Long strings in the output files will + be split across multiple lines in order to ensure that each line's + width (= number of screen columns) is less or equal to the given + NUMBER. + +‘--no-wrap’ + Do not break long message lines. Message lines whose width exceeds + the output page width will not be split into several lines. Only + file reference lines which are wider than the output page width + will be split. + +‘-s’ +‘--sort-output’ + Generate sorted output. Note that using this option makes it much + harder for the translator to understand each message's context. + +‘-F’ +‘--sort-by-file’ + Sort output by file location. + +9.1.6 Informative output +------------------------ + +‘-h’ +‘--help’ + Display this help and exit. + +‘-V’ +‘--version’ + Output version information and exit. + + +File: gettext.info, Node: msgconv Invocation, Next: msggrep Invocation, Prev: msgcat Invocation, Up: Manipulating + +9.2 Invoking the ‘msgconv’ Program +================================== + + msgconv [OPTION] [INPUTFILE] + + The ‘msgconv’ program converts a translation catalog to a different +character encoding. + +9.2.1 Input file location +------------------------- + +‘INPUTFILE’ + Input PO file. + +‘-D DIRECTORY’ +‘--directory=DIRECTORY’ + Add DIRECTORY to the list of directories. Source files are + searched relative to this list of directories. The resulting ‘.po’ + file will be written relative to the current directory, though. + + If no INPUTFILE is given or if it is ‘-’, standard input is read. + +9.2.2 Output file location +-------------------------- + +‘-o FILE’ +‘--output-file=FILE’ + Write output to specified file. + + The results are written to standard output if no output file is +specified or if it is ‘-’. + +9.2.3 Conversion target +----------------------- + +‘-t’ +‘--to-code=NAME’ + Specify encoding for output. + + The default encoding is the current locale's encoding. + +9.2.4 Input file syntax +----------------------- + +‘-P’ +‘--properties-input’ + Assume the input file is a Java ResourceBundle in Java + ‘.properties’ syntax, not in PO file syntax. + +‘--stringtable-input’ + Assume the input file is a NeXTstep/GNUstep localized resource file + in ‘.strings’ syntax, not in PO file syntax. + +9.2.5 Output details +-------------------- + +‘--color’ +‘--color=WHEN’ + Specify whether or when to use colors and other text attributes. + See *note The --color option:: for details. + +‘--style=STYLE_FILE’ + Specify the CSS style rule file to use for ‘--color’. See *note + The --style option:: for details. + +‘--force-po’ + Always write an output file even if it contains no message. + +‘-i’ +‘--indent’ + Write the .po file using indented style. + +‘--no-location’ + Do not write ‘#: FILENAME:LINE’ lines. + +‘-n’ +‘--add-location=TYPE’ + Generate ‘#: FILENAME:LINE’ lines (default). + + The optional TYPE can be either ‘full’, ‘file’, or ‘never’. If it + is not given or ‘full’, it generates the lines with both file name + and line number. If it is ‘file’, the line number part is omitted. + If it is ‘never’, it completely suppresses the lines (same as + ‘--no-location’). + +‘--strict’ + Write out a strict Uniforum conforming PO file. Note that this + Uniforum format should be avoided because it doesn't support the + GNU extensions. + +‘-p’ +‘--properties-output’ + Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note + that this file format doesn't support plural forms and silently + drops obsolete messages. + +‘--stringtable-output’ + Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ + syntax. Note that this file format doesn't support plural forms. + +‘-w NUMBER’ +‘--width=NUMBER’ + Set the output page width. Long strings in the output files will + be split across multiple lines in order to ensure that each line's + width (= number of screen columns) is less or equal to the given + NUMBER. + +‘--no-wrap’ + Do not break long message lines. Message lines whose width exceeds + the output page width will not be split into several lines. Only + file reference lines which are wider than the output page width + will be split. + +‘-s’ +‘--sort-output’ + Generate sorted output. Note that using this option makes it much + harder for the translator to understand each message's context. + +‘-F’ +‘--sort-by-file’ + Sort output by file location. + +9.2.6 Informative output +------------------------ + +‘-h’ +‘--help’ + Display this help and exit. + +‘-V’ +‘--version’ + Output version information and exit. + + +File: gettext.info, Node: msggrep Invocation, Next: msgfilter Invocation, Prev: msgconv Invocation, Up: Manipulating + +9.3 Invoking the ‘msggrep’ Program +================================== + + msggrep [OPTION] [INPUTFILE] + + The ‘msggrep’ program extracts all messages of a translation catalog +that match a given pattern or belong to some given source files. + +9.3.1 Input file location +------------------------- + +‘INPUTFILE’ + Input PO file. + +‘-D DIRECTORY’ +‘--directory=DIRECTORY’ + Add DIRECTORY to the list of directories. Source files are + searched relative to this list of directories. The resulting ‘.po’ + file will be written relative to the current directory, though. + + If no INPUTFILE is given or if it is ‘-’, standard input is read. + +9.3.2 Output file location +-------------------------- + +‘-o FILE’ +‘--output-file=FILE’ + Write output to specified file. + + The results are written to standard output if no output file is +specified or if it is ‘-’. + +9.3.3 Message selection +----------------------- + + [-N SOURCEFILE]... [-M DOMAINNAME]... + [-J MSGCTXT-PATTERN] [-K MSGID-PATTERN] [-T MSGSTR-PATTERN] + [-C COMMENT-PATTERN] + + A message is selected if + • it comes from one of the specified source files, + • or if it comes from one of the specified domains, + • or if ‘-J’ is given and its context (msgctxt) matches + MSGCTXT-PATTERN, + • or if ‘-K’ is given and its key (msgid or msgid_plural) matches + MSGID-PATTERN, + • or if ‘-T’ is given and its translation (msgstr) matches + MSGSTR-PATTERN, + • or if ‘-C’ is given and the translator's comment matches + COMMENT-PATTERN. + + When more than one selection criterion is specified, the set of +selected messages is the union of the selected messages of each +criterion. + + MSGCTXT-PATTERN or MSGID-PATTERN or MSGSTR-PATTERN syntax: + [-E | -F] [-e PATTERN | -f FILE]... + PATTERNs are basic regular expressions by default, or extended +regular expressions if -E is given, or fixed strings if -F is given. + +‘-N SOURCEFILE’ +‘--location=SOURCEFILE’ + Select messages extracted from SOURCEFILE. SOURCEFILE can be + either a literal file name or a wildcard pattern. + +‘-M DOMAINNAME’ +‘--domain=DOMAINNAME’ + Select messages belonging to domain DOMAINNAME. + +‘-J’ +‘--msgctxt’ + Start of patterns for the msgctxt. + +‘-K’ +‘--msgid’ + Start of patterns for the msgid. + +‘-T’ +‘--msgstr’ + Start of patterns for the msgstr. + +‘-C’ +‘--comment’ + Start of patterns for the translator's comment. + +‘-X’ +‘--extracted-comment’ + Start of patterns for the extracted comments. + +‘-E’ +‘--extended-regexp’ + Specify that PATTERN is an extended regular expression. + +‘-F’ +‘--fixed-strings’ + Specify that PATTERN is a set of newline-separated strings. + +‘-e PATTERN’ +‘--regexp=PATTERN’ + Use PATTERN as a regular expression. + +‘-f FILE’ +‘--file=FILE’ + Obtain PATTERN from FILE. + +‘-i’ +‘--ignore-case’ + Ignore case distinctions. + +‘-v’ +‘--invert-match’ + Output only the messages that do not match any selection criterion, + instead of the messages that match a selection criterion. + +9.3.4 Input file syntax +----------------------- + +‘-P’ +‘--properties-input’ + Assume the input file is a Java ResourceBundle in Java + ‘.properties’ syntax, not in PO file syntax. + +‘--stringtable-input’ + Assume the input file is a NeXTstep/GNUstep localized resource file + in ‘.strings’ syntax, not in PO file syntax. + +9.3.5 Output details +-------------------- + +‘--color’ +‘--color=WHEN’ + Specify whether or when to use colors and other text attributes. + See *note The --color option:: for details. + +‘--style=STYLE_FILE’ + Specify the CSS style rule file to use for ‘--color’. See *note + The --style option:: for details. + +‘--force-po’ + Always write an output file even if it contains no message. + +‘--indent’ + Write the .po file using indented style. + +‘--no-location’ + Do not write ‘#: FILENAME:LINE’ lines. + +‘-n’ +‘--add-location=TYPE’ + Generate ‘#: FILENAME:LINE’ lines (default). + + The optional TYPE can be either ‘full’, ‘file’, or ‘never’. If it + is not given or ‘full’, it generates the lines with both file name + and line number. If it is ‘file’, the line number part is omitted. + If it is ‘never’, it completely suppresses the lines (same as + ‘--no-location’). + +‘--strict’ + Write out a strict Uniforum conforming PO file. Note that this + Uniforum format should be avoided because it doesn't support the + GNU extensions. + +‘-p’ +‘--properties-output’ + Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note + that this file format doesn't support plural forms and silently + drops obsolete messages. + +‘--stringtable-output’ + Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ + syntax. Note that this file format doesn't support plural forms. + +‘-w NUMBER’ +‘--width=NUMBER’ + Set the output page width. Long strings in the output files will + be split across multiple lines in order to ensure that each line's + width (= number of screen columns) is less or equal to the given + NUMBER. + +‘--no-wrap’ + Do not break long message lines. Message lines whose width exceeds + the output page width will not be split into several lines. Only + file reference lines which are wider than the output page width + will be split. + +‘--sort-output’ + Generate sorted output. Note that using this option makes it much + harder for the translator to understand each message's context. + +‘--sort-by-file’ + Sort output by file location. + +9.3.6 Informative output +------------------------ + +‘-h’ +‘--help’ + Display this help and exit. + +‘-V’ +‘--version’ + Output version information and exit. + +9.3.7 Examples +-------------- + + To extract the messages that come from the source files +‘gnulib-lib/error.c’ and ‘gnulib-lib/getopt.c’: + + msggrep -N gnulib-lib/error.c -N gnulib-lib/getopt.c input.po + + To extract the messages that contain the string "Please specify" in +the original string: + + msggrep --msgid -F -e 'Please specify' input.po + + To extract the messages that have a context specifier of either +"Menu>File" or "Menu>Edit" or a submenu of them: + + msggrep --msgctxt -E -e '^Menu>(File|Edit)' input.po + + To extract the messages whose translation contains one of the strings +in the file ‘wordlist.txt’: + + msggrep --msgstr -F -f wordlist.txt input.po + + +File: gettext.info, Node: msgfilter Invocation, Next: msguniq Invocation, Prev: msggrep Invocation, Up: Manipulating + +9.4 Invoking the ‘msgfilter’ Program +==================================== + + msgfilter [OPTION] FILTER [FILTER-OPTION] + + The ‘msgfilter’ program applies a filter to all translations of a +translation catalog. + + During each FILTER invocation, the environment variable +‘MSGFILTER_MSGID’ is bound to the message's msgid, and the environment +variable ‘MSGFILTER_LOCATION’ is bound to the location in the PO file of +the message. If the message has a context, the environment variable +‘MSGFILTER_MSGCTXT’ is bound to the message's msgctxt, otherwise it is +unbound. If the message has a plural form, environment variable +‘MSGFILTER_MSGID_PLURAL’ is bound to the message's msgid_plural and +‘MSGFILTER_PLURAL_FORM’ is bound to the order number of the plural +actually processed (starting with 0), otherwise both are unbound. If +the message has a previous msgid (added by ‘msgmerge’), environment +variable ‘MSGFILTER_PREV_MSGCTXT’ is bound to the message's previous +msgctxt, ‘MSGFILTER_PREV_MSGID’ is bound to the previous msgid, and +‘MSGFILTER_PREV_MSGID_PLURAL’ is bound to the previous msgid_plural. + +9.4.1 Input file location +------------------------- + +‘-i INPUTFILE’ +‘--input=INPUTFILE’ + Input PO file. + +‘-D DIRECTORY’ +‘--directory=DIRECTORY’ + Add DIRECTORY to the list of directories. Source files are + searched relative to this list of directories. The resulting ‘.po’ + file will be written relative to the current directory, though. + + If no INPUTFILE is given or if it is ‘-’, standard input is read. + +9.4.2 Output file location +-------------------------- + +‘-o FILE’ +‘--output-file=FILE’ + Write output to specified file. + + The results are written to standard output if no output file is +specified or if it is ‘-’. + +9.4.3 The filter +---------------- + + The FILTER can be any program that reads a translation from standard +input and writes a modified translation to standard output. A +frequently used filter is ‘sed’. A few particular built-in filters are +also recognized. + +‘--newline’ + Add newline at the end of each input line and also strip the ending + newline from the output line. + + Note: If the filter is not a built-in filter, you have to care about +encodings: It is your responsibility to ensure that the FILTER can cope +with input encoded in the translation catalog's encoding. If the FILTER +wants input in a particular encoding, you can in a first step convert +the translation catalog to that encoding using the ‘msgconv’ program, +before invoking ‘msgfilter’. If the FILTER wants input in the locale's +encoding, but you want to avoid the locale's encoding, then you can +first convert the translation catalog to UTF-8 using the ‘msgconv’ +program and then make ‘msgfilter’ work in an UTF-8 locale, by using the +‘LC_ALL’ environment variable. + + Note: Most translations in a translation catalog don't end with a +newline character. For this reason, unless the ‘--newline’ option is +used, it is important that the FILTER recognizes its last input line +even if it ends without a newline, and that it doesn't add an undesired +trailing newline at the end. The ‘sed’ program on some platforms is +known to ignore the last line of input if it is not terminated with a +newline. You can use GNU ‘sed’ instead; it does not have this +limitation. + +9.4.4 Useful FILTER-OPTIONs when the FILTER is ‘sed’ +---------------------------------------------------- + +‘-e SCRIPT’ +‘--expression=SCRIPT’ + Add SCRIPT to the commands to be executed. + +‘-f SCRIPTFILE’ +‘--file=SCRIPTFILE’ + Add the contents of SCRIPTFILE to the commands to be executed. + +‘-n’ +‘--quiet’ +‘--silent’ + Suppress automatic printing of pattern space. + +9.4.5 Built-in FILTERs +---------------------- + + The filter ‘recode-sr-latin’ is recognized as a built-in filter. The +command ‘recode-sr-latin’ converts Serbian text, written in the Cyrillic +script, to the Latin script. The command ‘msgfilter recode-sr-latin’ +applies this conversion to the translations of a PO file. Thus, it can +be used to convert an ‘sr.po’ file to an ‘sr@latin.po’ file. + + The filter ‘quot’ is recognized as a built-in filter. The command +‘msgfilter quot’ converts any quotations surrounded by a pair of ‘"’, +‘'’, and ‘`’. + + The filter ‘boldquot’ is recognized as a built-in filter. The +command ‘msgfilter boldquot’ converts any quotations surrounded by a +pair of ‘"’, ‘'’, and ‘`’, also adding the VT100 escape sequences to the +text to decorate it as bold. + + The use of built-in filters is not sensitive to the current locale's +encoding. Moreover, when used with a built-in filter, ‘msgfilter’ can +automatically convert the message catalog to the UTF-8 encoding when +needed. + +9.4.6 Input file syntax +----------------------- + +‘-P’ +‘--properties-input’ + Assume the input file is a Java ResourceBundle in Java + ‘.properties’ syntax, not in PO file syntax. + +‘--stringtable-input’ + Assume the input file is a NeXTstep/GNUstep localized resource file + in ‘.strings’ syntax, not in PO file syntax. + +9.4.7 Output details +-------------------- + +‘--color’ +‘--color=WHEN’ + Specify whether or when to use colors and other text attributes. + See *note The --color option:: for details. + +‘--style=STYLE_FILE’ + Specify the CSS style rule file to use for ‘--color’. See *note + The --style option:: for details. + +‘--force-po’ + Always write an output file even if it contains no message. + +‘--indent’ + Write the .po file using indented style. + +‘--keep-header’ + Keep the header entry, i.e. the message with ‘msgid ""’, + unmodified, instead of filtering it. By default, the header entry + is subject to filtering like any other message. + +‘--no-location’ + Do not write ‘#: FILENAME:LINE’ lines. + +‘-n’ +‘--add-location=TYPE’ + Generate ‘#: FILENAME:LINE’ lines (default). + + The optional TYPE can be either ‘full’, ‘file’, or ‘never’. If it + is not given or ‘full’, it generates the lines with both file name + and line number. If it is ‘file’, the line number part is omitted. + If it is ‘never’, it completely suppresses the lines (same as + ‘--no-location’). + +‘--strict’ + Write out a strict Uniforum conforming PO file. Note that this + Uniforum format should be avoided because it doesn't support the + GNU extensions. + +‘-p’ +‘--properties-output’ + Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note + that this file format doesn't support plural forms and silently + drops obsolete messages. + +‘--stringtable-output’ + Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ + syntax. Note that this file format doesn't support plural forms. + +‘-w NUMBER’ +‘--width=NUMBER’ + Set the output page width. Long strings in the output files will + be split across multiple lines in order to ensure that each line's + width (= number of screen columns) is less or equal to the given + NUMBER. + +‘--no-wrap’ + Do not break long message lines. Message lines whose width exceeds + the output page width will not be split into several lines. Only + file reference lines which are wider than the output page width + will be split. + +‘-s’ +‘--sort-output’ + Generate sorted output. Note that using this option makes it much + harder for the translator to understand each message's context. + +‘-F’ +‘--sort-by-file’ + Sort output by file location. + +9.4.8 Informative output +------------------------ + +‘-h’ +‘--help’ + Display this help and exit. + +‘-V’ +‘--version’ + Output version information and exit. + +9.4.9 Examples +-------------- + + To convert German translations to Swiss orthography (in an UTF-8 +locale): + + msgconv -t UTF-8 de.po | msgfilter sed -e 's/ß/ss/g' + + To convert Serbian translations in Cyrillic script to Latin script: + + msgfilter recode-sr-latin < sr.po + + +File: gettext.info, Node: msguniq Invocation, Next: msgcomm Invocation, Prev: msgfilter Invocation, Up: Manipulating + +9.5 Invoking the ‘msguniq’ Program +================================== + + msguniq [OPTION] [INPUTFILE] + + The ‘msguniq’ program unifies duplicate translations in a translation +catalog. It finds duplicate translations of the same message ID. Such +duplicates are invalid input for other programs like ‘msgfmt’, +‘msgmerge’ or ‘msgcat’. By default, duplicates are merged together. +When using the ‘--repeated’ option, only duplicates are output, and all +other messages are discarded. Comments and extracted comments will be +cumulated, except that if ‘--use-first’ is specified, they will be taken +from the first translation. File positions will be cumulated. When +using the ‘--unique’ option, duplicates are discarded. + +9.5.1 Input file location +------------------------- + +‘INPUTFILE’ + Input PO file. + +‘-D DIRECTORY’ +‘--directory=DIRECTORY’ + Add DIRECTORY to the list of directories. Source files are + searched relative to this list of directories. The resulting ‘.po’ + file will be written relative to the current directory, though. + + If no INPUTFILE is given or if it is ‘-’, standard input is read. + +9.5.2 Output file location +-------------------------- + +‘-o FILE’ +‘--output-file=FILE’ + Write output to specified file. + + The results are written to standard output if no output file is +specified or if it is ‘-’. + +9.5.3 Message selection +----------------------- + +‘-d’ +‘--repeated’ + Print only duplicates. + +‘-u’ +‘--unique’ + Print only unique messages, discard duplicates. + +9.5.4 Input file syntax +----------------------- + +‘-P’ +‘--properties-input’ + Assume the input file is a Java ResourceBundle in Java + ‘.properties’ syntax, not in PO file syntax. + +‘--stringtable-input’ + Assume the input file is a NeXTstep/GNUstep localized resource file + in ‘.strings’ syntax, not in PO file syntax. + +9.5.5 Output details +-------------------- + +‘-t’ +‘--to-code=NAME’ + Specify encoding for output. + +‘--use-first’ + Use first available translation for each message. Don't merge + several translations into one. + +‘--color’ +‘--color=WHEN’ + Specify whether or when to use colors and other text attributes. + See *note The --color option:: for details. + +‘--style=STYLE_FILE’ + Specify the CSS style rule file to use for ‘--color’. See *note + The --style option:: for details. + +‘--force-po’ + Always write an output file even if it contains no message. + +‘-i’ +‘--indent’ + Write the .po file using indented style. + +‘--no-location’ + Do not write ‘#: FILENAME:LINE’ lines. + +‘-n’ +‘--add-location=TYPE’ + Generate ‘#: FILENAME:LINE’ lines (default). + + The optional TYPE can be either ‘full’, ‘file’, or ‘never’. If it + is not given or ‘full’, it generates the lines with both file name + and line number. If it is ‘file’, the line number part is omitted. + If it is ‘never’, it completely suppresses the lines (same as + ‘--no-location’). + +‘--strict’ + Write out a strict Uniforum conforming PO file. Note that this + Uniforum format should be avoided because it doesn't support the + GNU extensions. + +‘-p’ +‘--properties-output’ + Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note + that this file format doesn't support plural forms and silently + drops obsolete messages. + +‘--stringtable-output’ + Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ + syntax. Note that this file format doesn't support plural forms. + +‘-w NUMBER’ +‘--width=NUMBER’ + Set the output page width. Long strings in the output files will + be split across multiple lines in order to ensure that each line's + width (= number of screen columns) is less or equal to the given + NUMBER. + +‘--no-wrap’ + Do not break long message lines. Message lines whose width exceeds + the output page width will not be split into several lines. Only + file reference lines which are wider than the output page width + will be split. + +‘-s’ +‘--sort-output’ + Generate sorted output. Note that using this option makes it much + harder for the translator to understand each message's context. + +‘-F’ +‘--sort-by-file’ + Sort output by file location. + +9.5.6 Informative output +------------------------ + +‘-h’ +‘--help’ + Display this help and exit. + +‘-V’ +‘--version’ + Output version information and exit. + + +File: gettext.info, Node: msgcomm Invocation, Next: msgcmp Invocation, Prev: msguniq Invocation, Up: Manipulating + +9.6 Invoking the ‘msgcomm’ Program +================================== + + msgcomm [OPTION] [INPUTFILE]... + + The ‘msgcomm’ program finds messages which are common to two or more +of the specified PO files. By using the ‘--more-than’ option, greater +commonality may be requested before messages are printed. Conversely, +the ‘--less-than’ option may be used to specify less commonality before +messages are printed (i.e. ‘--less-than=2’ will only print the unique +messages). Translations, comments and extracted comments will be +preserved, but only from the first PO file to define them. File +positions from all PO files will be cumulated. + +9.6.1 Input file location +------------------------- + +‘INPUTFILE ...’ + Input files. + +‘-f FILE’ +‘--files-from=FILE’ + Read the names of the input files from FILE instead of getting them + from the command line. + +‘-D DIRECTORY’ +‘--directory=DIRECTORY’ + Add DIRECTORY to the list of directories. Source files are + searched relative to this list of directories. The resulting ‘.po’ + file will be written relative to the current directory, though. + + If INPUTFILE is ‘-’, standard input is read. + +9.6.2 Output file location +-------------------------- + +‘-o FILE’ +‘--output-file=FILE’ + Write output to specified file. + + The results are written to standard output if no output file is +specified or if it is ‘-’. + +9.6.3 Message selection +----------------------- + +‘-< NUMBER’ +‘--less-than=NUMBER’ + Print messages with less than NUMBER definitions, defaults to + infinite if not set. + +‘-> NUMBER’ +‘--more-than=NUMBER’ + Print messages with more than NUMBER definitions, defaults to 1 if + not set. + +‘-u’ +‘--unique’ + Shorthand for ‘--less-than=2’. Requests that only unique messages + be printed. + +9.6.4 Input file syntax +----------------------- + +‘-P’ +‘--properties-input’ + Assume the input files are Java ResourceBundles in Java + ‘.properties’ syntax, not in PO file syntax. + +‘--stringtable-input’ + Assume the input files are NeXTstep/GNUstep localized resource + files in ‘.strings’ syntax, not in PO file syntax. + +9.6.5 Output details +-------------------- + +‘--color’ +‘--color=WHEN’ + Specify whether or when to use colors and other text attributes. + See *note The --color option:: for details. + +‘--style=STYLE_FILE’ + Specify the CSS style rule file to use for ‘--color’. See *note + The --style option:: for details. + +‘--force-po’ + Always write an output file even if it contains no message. + +‘-i’ +‘--indent’ + Write the .po file using indented style. + +‘--no-location’ + Do not write ‘#: FILENAME:LINE’ lines. + +‘-n’ +‘--add-location=TYPE’ + Generate ‘#: FILENAME:LINE’ lines (default). + + The optional TYPE can be either ‘full’, ‘file’, or ‘never’. If it + is not given or ‘full’, it generates the lines with both file name + and line number. If it is ‘file’, the line number part is omitted. + If it is ‘never’, it completely suppresses the lines (same as + ‘--no-location’). + +‘--strict’ + Write out a strict Uniforum conforming PO file. Note that this + Uniforum format should be avoided because it doesn't support the + GNU extensions. + +‘-p’ +‘--properties-output’ + Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note + that this file format doesn't support plural forms and silently + drops obsolete messages. + +‘--stringtable-output’ + Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ + syntax. Note that this file format doesn't support plural forms. + +‘-w NUMBER’ +‘--width=NUMBER’ + Set the output page width. Long strings in the output files will + be split across multiple lines in order to ensure that each line's + width (= number of screen columns) is less or equal to the given + NUMBER. + +‘--no-wrap’ + Do not break long message lines. Message lines whose width exceeds + the output page width will not be split into several lines. Only + file reference lines which are wider than the output page width + will be split. + +‘-s’ +‘--sort-output’ + Generate sorted output. Note that using this option makes it much + harder for the translator to understand each message's context. + +‘-F’ +‘--sort-by-file’ + Sort output by file location. + +‘--omit-header’ + Don't write header with ‘msgid ""’ entry. Note: Using this option + may lead to an error in subsequent operations if the output + contains non-ASCII characters. + +9.6.6 Informative output +------------------------ + +‘-h’ +‘--help’ + Display this help and exit. + +‘-V’ +‘--version’ + Output version information and exit. + + +File: gettext.info, Node: msgcmp Invocation, Next: msgattrib Invocation, Prev: msgcomm Invocation, Up: Manipulating + +9.7 Invoking the ‘msgcmp’ Program +================================= + + msgcmp [OPTION] DEF.po REF.pot + + The ‘msgcmp’ program compares two Uniforum style .po files to check +that both contain the same set of msgid strings. The DEF.po file is an +existing PO file with the translations. The REF.pot file is the last +created PO file, or a PO Template file (generally created by +‘xgettext’). This is useful for checking that you have translated each +and every message in your program. Where an exact match cannot be +found, fuzzy matching is used to produce better diagnostics. + +9.7.1 Input file location +------------------------- + +‘DEF.po’ + Translations. + +‘REF.pot’ + References to the sources. + +‘-D DIRECTORY’ +‘--directory=DIRECTORY’ + Add DIRECTORY to the list of directories. Source files are + searched relative to this list of directories. + +9.7.2 Operation modifiers +------------------------- + +‘-m’ +‘--multi-domain’ + Apply REF.pot to each of the domains in DEF.po. + +‘-N’ +‘--no-fuzzy-matching’ + Do not use fuzzy matching when an exact match is not found. This + may speed up the operation considerably. + +‘--use-fuzzy’ + Consider fuzzy messages in the DEF.po file like translated + messages. Note that using this option is usually wrong, because + fuzzy messages are exactly those which have not been validated by a + human translator. + +‘--use-untranslated’ + Consider untranslated messages in the DEF.po file like translated + messages. Note that using this option is usually wrong. + +9.7.3 Input file syntax +----------------------- + +‘-P’ +‘--properties-input’ + Assume the input files are Java ResourceBundles in Java + ‘.properties’ syntax, not in PO file syntax. + +‘--stringtable-input’ + Assume the input files are NeXTstep/GNUstep localized resource + files in ‘.strings’ syntax, not in PO file syntax. + +9.7.4 Informative output +------------------------ + +‘-h’ +‘--help’ + Display this help and exit. + +‘-V’ +‘--version’ + Output version information and exit. + + +File: gettext.info, Node: msgattrib Invocation, Next: msgen Invocation, Prev: msgcmp Invocation, Up: Manipulating + +9.8 Invoking the ‘msgattrib’ Program +==================================== + + msgattrib [OPTION] [INPUTFILE] + + The ‘msgattrib’ program filters the messages of a translation catalog +according to their attributes, and manipulates the attributes. + +9.8.1 Input file location +------------------------- + +‘INPUTFILE’ + Input PO file. + +‘-D DIRECTORY’ +‘--directory=DIRECTORY’ + Add DIRECTORY to the list of directories. Source files are + searched relative to this list of directories. The resulting ‘.po’ + file will be written relative to the current directory, though. + + If no INPUTFILE is given or if it is ‘-’, standard input is read. + +9.8.2 Output file location +-------------------------- + +‘-o FILE’ +‘--output-file=FILE’ + Write output to specified file. + + The results are written to standard output if no output file is +specified or if it is ‘-’. + +9.8.3 Message selection +----------------------- + +‘--translated’ + Keep translated messages, remove untranslated messages. + +‘--untranslated’ + Keep untranslated messages, remove translated messages. + +‘--no-fuzzy’ + Remove 'fuzzy' marked messages. + +‘--only-fuzzy’ + Keep 'fuzzy' marked messages, remove all other messages. + +‘--no-obsolete’ + Remove obsolete #~ messages. + +‘--only-obsolete’ + Keep obsolete #~ messages, remove all other messages. + +9.8.4 Attribute manipulation +---------------------------- + + Attributes are modified after the message selection/removal has been +performed. If the ‘--only-file’ or ‘--ignore-file’ option is specified, +the attribute modification is applied only to those messages that are +listed in the ONLY-FILE and not listed in the IGNORE-FILE. + +‘--set-fuzzy’ + Set all messages 'fuzzy'. + +‘--clear-fuzzy’ + Set all messages non-'fuzzy'. + +‘--set-obsolete’ + Set all messages obsolete. + +‘--clear-obsolete’ + Set all messages non-obsolete. + +‘--previous’ + When setting 'fuzzy' mark, keep "previous msgid" of translated + messages. + +‘--clear-previous’ + Remove the "previous msgid" (‘#|’) comments from all messages. + +‘--empty’ + When removing 'fuzzy' mark, also set msgstr empty. + +‘--only-file=FILE’ + Limit the attribute changes to entries that are listed in FILE. + FILE should be a PO or POT file. + +‘--ignore-file=FILE’ + Limit the attribute changes to entries that are not listed in FILE. + FILE should be a PO or POT file. + +‘--fuzzy’ + Synonym for ‘--only-fuzzy --clear-fuzzy’: It keeps only the fuzzy + messages and removes their 'fuzzy' mark. + +‘--obsolete’ + Synonym for ‘--only-obsolete --clear-obsolete’: It keeps only the + obsolete messages and makes them non-obsolete. + +9.8.5 Input file syntax +----------------------- + +‘-P’ +‘--properties-input’ + Assume the input file is a Java ResourceBundle in Java + ‘.properties’ syntax, not in PO file syntax. + +‘--stringtable-input’ + Assume the input file is a NeXTstep/GNUstep localized resource file + in ‘.strings’ syntax, not in PO file syntax. + +9.8.6 Output details +-------------------- + +‘--color’ +‘--color=WHEN’ + Specify whether or when to use colors and other text attributes. + See *note The --color option:: for details. + +‘--style=STYLE_FILE’ + Specify the CSS style rule file to use for ‘--color’. See *note + The --style option:: for details. + +‘--force-po’ + Always write an output file even if it contains no message. + +‘-i’ +‘--indent’ + Write the .po file using indented style. + +‘--no-location’ + Do not write ‘#: FILENAME:LINE’ lines. + +‘-n’ +‘--add-location=TYPE’ + Generate ‘#: FILENAME:LINE’ lines (default). + + The optional TYPE can be either ‘full’, ‘file’, or ‘never’. If it + is not given or ‘full’, it generates the lines with both file name + and line number. If it is ‘file’, the line number part is omitted. + If it is ‘never’, it completely suppresses the lines (same as + ‘--no-location’). + +‘--strict’ + Write out a strict Uniforum conforming PO file. Note that this + Uniforum format should be avoided because it doesn't support the + GNU extensions. + +‘-p’ +‘--properties-output’ + Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note + that this file format doesn't support plural forms and silently + drops obsolete messages. + +‘--stringtable-output’ + Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ + syntax. Note that this file format doesn't support plural forms. + +‘-w NUMBER’ +‘--width=NUMBER’ + Set the output page width. Long strings in the output files will + be split across multiple lines in order to ensure that each line's + width (= number of screen columns) is less or equal to the given + NUMBER. + +‘--no-wrap’ + Do not break long message lines. Message lines whose width exceeds + the output page width will not be split into several lines. Only + file reference lines which are wider than the output page width + will be split. + +‘-s’ +‘--sort-output’ + Generate sorted output. Note that using this option makes it much + harder for the translator to understand each message's context. + +‘-F’ +‘--sort-by-file’ + Sort output by file location. + +9.8.7 Informative output +------------------------ + +‘-h’ +‘--help’ + Display this help and exit. + +‘-V’ +‘--version’ + Output version information and exit. + + +File: gettext.info, Node: msgen Invocation, Next: msgexec Invocation, Prev: msgattrib Invocation, Up: Manipulating + +9.9 Invoking the ‘msgen’ Program +================================ + + msgen [OPTION] INPUTFILE + + The ‘msgen’ program creates an English translation catalog. The +input file is the last created English PO file, or a PO Template file +(generally created by xgettext). Untranslated entries are assigned a +translation that is identical to the msgid. + + Note: ‘msginit --no-translator --locale=en’ performs a very similar +task. The main difference is that ‘msginit’ cares specially about the +header entry, whereas ‘msgen’ doesn't. + +9.9.1 Input file location +------------------------- + +‘INPUTFILE’ + Input PO or POT file. + +‘-D DIRECTORY’ +‘--directory=DIRECTORY’ + Add DIRECTORY to the list of directories. Source files are + searched relative to this list of directories. The resulting ‘.po’ + file will be written relative to the current directory, though. + + If INPUTFILE is ‘-’, standard input is read. + +9.9.2 Output file location +-------------------------- + +‘-o FILE’ +‘--output-file=FILE’ + Write output to specified file. + + The results are written to standard output if no output file is +specified or if it is ‘-’. + +9.9.3 Input file syntax +----------------------- + +‘-P’ +‘--properties-input’ + Assume the input file is a Java ResourceBundle in Java + ‘.properties’ syntax, not in PO file syntax. + +‘--stringtable-input’ + Assume the input file is a NeXTstep/GNUstep localized resource file + in ‘.strings’ syntax, not in PO file syntax. + +9.9.4 Output details +-------------------- + +‘--lang=CATALOGNAME’ + Specify the ‘Language’ field to be used in the header entry. See + *note Header Entry:: for the meaning of this field. Note: The + ‘Language-Team’ and ‘Plural-Forms’ fields are not set by this + option. + +‘--color’ +‘--color=WHEN’ + Specify whether or when to use colors and other text attributes. + See *note The --color option:: for details. + +‘--style=STYLE_FILE’ + Specify the CSS style rule file to use for ‘--color’. See *note + The --style option:: for details. + +‘--force-po’ + Always write an output file even if it contains no message. + +‘-i’ +‘--indent’ + Write the .po file using indented style. + +‘--no-location’ + Do not write ‘#: FILENAME:LINE’ lines. + +‘-n’ +‘--add-location=TYPE’ + Generate ‘#: FILENAME:LINE’ lines (default). + + The optional TYPE can be either ‘full’, ‘file’, or ‘never’. If it + is not given or ‘full’, it generates the lines with both file name + and line number. If it is ‘file’, the line number part is omitted. + If it is ‘never’, it completely suppresses the lines (same as + ‘--no-location’). + +‘--strict’ + Write out a strict Uniforum conforming PO file. Note that this + Uniforum format should be avoided because it doesn't support the + GNU extensions. + +‘-p’ +‘--properties-output’ + Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note + that this file format doesn't support plural forms and silently + drops obsolete messages. + +‘--stringtable-output’ + Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ + syntax. Note that this file format doesn't support plural forms. + +‘-w NUMBER’ +‘--width=NUMBER’ + Set the output page width. Long strings in the output files will + be split across multiple lines in order to ensure that each line's + width (= number of screen columns) is less or equal to the given + NUMBER. + +‘--no-wrap’ + Do not break long message lines. Message lines whose width exceeds + the output page width will not be split into several lines. Only + file reference lines which are wider than the output page width + will be split. + +‘-s’ +‘--sort-output’ + Generate sorted output. Note that using this option makes it much + harder for the translator to understand each message's context. + +‘-F’ +‘--sort-by-file’ + Sort output by file location. + +9.9.5 Informative output +------------------------ + +‘-h’ +‘--help’ + Display this help and exit. + +‘-V’ +‘--version’ + Output version information and exit. + + +File: gettext.info, Node: msgexec Invocation, Next: Colorizing, Prev: msgen Invocation, Up: Manipulating + +9.10 Invoking the ‘msgexec’ Program +=================================== + + msgexec [OPTION] COMMAND [COMMAND-OPTION] + + The ‘msgexec’ program applies a command to all translations of a +translation catalog. The COMMAND can be any program that reads a +translation from standard input. It is invoked once for each +translation. Its output becomes msgexec's output. ‘msgexec’'s return +code is the maximum return code across all invocations. + + A special builtin command called ‘0’ outputs the translation, +followed by a null byte. The output of ‘msgexec 0’ is suitable as input +for ‘xargs -0’. + +‘--newline’ + Add newline at the end of each input line. + + During each COMMAND invocation, the environment variable +‘MSGEXEC_MSGID’ is bound to the message's msgid, and the environment +variable ‘MSGEXEC_LOCATION’ is bound to the location in the PO file of +the message. If the message has a context, the environment variable +‘MSGEXEC_MSGCTXT’ is bound to the message's msgctxt, otherwise it is +unbound. If the message has a plural form, environment variable +‘MSGEXEC_MSGID_PLURAL’ is bound to the message's msgid_plural and +‘MSGEXEC_PLURAL_FORM’ is bound to the order number of the plural +actually processed (starting with 0), otherwise both are unbound. If +the message has a previous msgid (added by ‘msgmerge’), environment +variable ‘MSGEXEC_PREV_MSGCTXT’ is bound to the message's previous +msgctxt, ‘MSGEXEC_PREV_MSGID’ is bound to the previous msgid, and +‘MSGEXEC_PREV_MSGID_PLURAL’ is bound to the previous msgid_plural. + + Note: It is your responsibility to ensure that the COMMAND can cope +with input encoded in the translation catalog's encoding. If the +COMMAND wants input in a particular encoding, you can in a first step +convert the translation catalog to that encoding using the ‘msgconv’ +program, before invoking ‘msgexec’. If the COMMAND wants input in the +locale's encoding, but you want to avoid the locale's encoding, then you +can first convert the translation catalog to UTF-8 using the ‘msgconv’ +program and then make ‘msgexec’ work in an UTF-8 locale, by using the +‘LC_ALL’ environment variable. + +9.10.1 Input file location +-------------------------- + +‘-i INPUTFILE’ +‘--input=INPUTFILE’ + Input PO file. + +‘-D DIRECTORY’ +‘--directory=DIRECTORY’ + Add DIRECTORY to the list of directories. Source files are + searched relative to this list of directories. The resulting ‘.po’ + file will be written relative to the current directory, though. + + If no INPUTFILE is given or if it is ‘-’, standard input is read. + +9.10.2 Input file syntax +------------------------ + +‘-P’ +‘--properties-input’ + Assume the input file is a Java ResourceBundle in Java + ‘.properties’ syntax, not in PO file syntax. + +‘--stringtable-input’ + Assume the input file is a NeXTstep/GNUstep localized resource file + in ‘.strings’ syntax, not in PO file syntax. + +9.10.3 Informative output +------------------------- + +‘-h’ +‘--help’ + Display this help and exit. + +‘-V’ +‘--version’ + Output version information and exit. + + +File: gettext.info, Node: Colorizing, Next: Other tools, Prev: msgexec Invocation, Up: Manipulating + +9.11 Highlighting parts of PO files +=================================== + + Translators are usually only interested in seeing the untranslated +and fuzzy messages of a PO file. Also, when a message is set fuzzy +because the msgid changed, they want to see the differences between the +previous msgid and the current one (especially if the msgid is long and +only few words in it have changed). Finally, it's always welcome to +highlight the different sections of a message in a PO file (comments, +msgid, msgstr, etc.). + + Such highlighting is possible through the options ‘--color’ and +‘--style’. They are supported by all the programs that produce a PO +file on standard output, such as ‘msgcat’, ‘msgmerge’, and ‘msgunfmt’. + +* Menu: + +* The --color option:: Triggering colorized output +* The TERM variable:: The environment variable ‘TERM’ +* The --style option:: The ‘--style’ option +* Style rules:: Style rules for PO files +* Customizing less:: Customizing ‘less’ for viewing PO files + + +File: gettext.info, Node: The --color option, Next: The TERM variable, Up: Colorizing + +9.11.1 The ‘--color’ option +--------------------------- + + The ‘--color=WHEN’ option specifies under which conditions colorized +output should be generated. The WHEN part can be one of the following: + +‘always’ +‘yes’ + The output will be colorized. + +‘never’ +‘no’ + The output will not be colorized. + +‘auto’ +‘tty’ + The output will be colorized if the output device is a tty, i.e. + when the output goes directly to a text screen or terminal emulator + window. + +‘html’ + The output will be colorized and be in HTML format. + +‘test’ + This is a special value, understood only by the ‘msgcat’ program. + It is explained in the next section (*note The TERM variable::). + +‘--color’ is equivalent to ‘--color=yes’. The default is +‘--color=auto’. + + Thus, a command like ‘msgcat vi.po’ will produce colorized output +when called by itself in a command window. Whereas in a pipe, such as +‘msgcat vi.po | less -R’, it will not produce colorized output. To get +colorized output in this situation nevertheless, use the command ‘msgcat +--color vi.po | less -R’. + + The ‘--color=html’ option will produce output that can be viewed in a +browser. This can be useful, for example, for Indic languages, because +the renderic of Indic scripts in browsers is usually better than in +terminal emulators. + + Note that the output produced with the ‘--color’ option is _not_ a +valid PO file in itself. It contains additional terminal-specific +escape sequences or HTML tags. A PO file reader will give a syntax +error when confronted with such content. Except for the ‘--color=html’ +case, you therefore normally don't need to save output produced with the +‘--color’ option in a file. + + +File: gettext.info, Node: The TERM variable, Next: The --style option, Prev: The --color option, Up: Colorizing + +9.11.2 The environment variable ‘TERM’ +-------------------------------------- + + The environment variable ‘TERM’ contains a identifier for the text +window's capabilities. You can get a detailed list of these +cababilities by using the ‘infocmp’ command, using ‘man 5 terminfo’ as a +reference. + + When producing text with embedded color directives, ‘msgcat’ looks at +the ‘TERM’ variable. Text windows today typically support at least 8 +colors. Often, however, the text window supports 16 or more colors, +even though the ‘TERM’ variable is set to a identifier denoting only 8 +supported colors. It can be worth setting the ‘TERM’ variable to a +different value in these cases: + +‘xterm’ + ‘xterm’ is in most cases built with support for 16 colors. It can + also be built with support for 88 or 256 colors (but not both). + You can try to set ‘TERM’ to either ‘xterm-16color’, + ‘xterm-88color’, or ‘xterm-256color’. + +‘rxvt’ + ‘rxvt’ is often built with support for 16 colors. You can try to + set ‘TERM’ to ‘rxvt-16color’. + +‘konsole’ + ‘konsole’ too is often built with support for 16 colors. You can + try to set ‘TERM’ to ‘konsole-16color’ or ‘xterm-16color’. + + After setting ‘TERM’, you can verify it by invoking ‘msgcat +--color=test’ and seeing whether the output looks like a reasonable +color map. + + +File: gettext.info, Node: The --style option, Next: Style rules, Prev: The TERM variable, Up: Colorizing + +9.11.3 The ‘--style’ option +--------------------------- + + The ‘--style=STYLE_FILE’ option specifies the style file to use when +colorizing. It has an effect only when the ‘--color’ option is +effective. + + If the ‘--style’ option is not specified, the environment variable +‘PO_STYLE’ is considered. It is meant to point to the user's preferred +style for PO files. + + The default style file is +‘$prefix/share/gettext/styles/po-default.css’, where ‘$prefix’ is the +installation location. + + A few style files are predefined: +‘po-vim.css’ + This style imitates the look used by vim 7. + +‘po-emacs-x.css’ + This style imitates the look used by GNU Emacs 21 and 22 in an X11 + window. + +‘po-emacs-xterm.css’ +‘po-emacs-xterm16.css’ +‘po-emacs-xterm256.css’ + This style imitates the look used by GNU Emacs 22 in a terminal of + type ‘xterm’ (8 colors) or ‘xterm-16color’ (16 colors) or + ‘xterm-256color’ (256 colors), respectively. + +You can use these styles without specifying a directory. They are +actually located in ‘$prefix/share/gettext/styles/’, where ‘$prefix’ is +the installation location. + + You can also design your own styles. This is described in the next +section. + + +File: gettext.info, Node: Style rules, Next: Customizing less, Prev: The --style option, Up: Colorizing + +9.11.4 Style rules for PO files +------------------------------- + + The same style file can be used for styling of a PO file, for +terminal output and for HTML output. It is written in CSS (Cascading +Style Sheet) syntax. See for a +formal definition of CSS. Many HTML authoring tutorials also contain +explanations of CSS. + + In the case of HTML output, the style file is embedded in the HTML +output. In the case of text output, the style file is interpreted by +the ‘msgcat’ program. This means, in particular, that when ‘@import’ is +used with relative file names, the file names are + + − relative to the resulting HTML file, in the case of HTML output, + + − relative to the style sheet containing the ‘@import’, in the case + of text output. (Actually, ‘@import’s are not yet supported in + this case, due to a limitation in ‘libcroco’.) + + CSS rules are built up from selectors and declarations. The +declarations specify graphical properties; the selectors specify when +they apply. + + In PO files, the following simple selectors (based on "CSS classes", +see the CSS2 spec, section 5.8.3) are supported. + + • Selectors that apply to entire messages: + + ‘.header’ + This matches the header entry of a PO file. + + ‘.translated’ + This matches a translated message. + + ‘.untranslated’ + This matches an untranslated message (i.e. a message with + empty translation). + + ‘.fuzzy’ + This matches a fuzzy message (i.e. a message which has a + translation that needs review by the translator). + + ‘.obsolete’ + This matches an obsolete message (i.e. a message that was + translated but is not needed by the current POT file any + more). + + • Selectors that apply to parts of a message in PO syntax. Recall + the general structure of a message in PO syntax: + + WHITE-SPACE + # TRANSLATOR-COMMENTS + #. EXTRACTED-COMMENTS + #: REFERENCE... + #, FLAG... + #| msgid PREVIOUS-UNTRANSLATED-STRING + msgid UNTRANSLATED-STRING + msgstr TRANSLATED-STRING + + ‘.comment’ + This matches all comments (translator comments, extracted + comments, source file reference comments, flag comments, + previous message comments, as well as the entire obsolete + messages). + + ‘.translator-comment’ + This matches the translator comments. + + ‘.extracted-comment’ + This matches the extracted comments, i.e. the comments placed + by the programmer at the attention of the translator. + + ‘.reference-comment’ + This matches the source file reference comments (entire + lines). + + ‘.reference’ + This matches the individual source file references inside the + source file reference comment lines. + + ‘.flag-comment’ + This matches the flag comment lines (entire lines). + + ‘.flag’ + This matches the individual flags inside flag comment lines. + + ‘.fuzzy-flag’ + This matches the 'fuzzy' flag inside flag comment lines. + + ‘.previous-comment’ + This matches the comments containing the previous untranslated + string (entire lines). + + ‘.previous’ + This matches the previous untranslated string including the + string delimiters, the associated keywords (‘msgid’ etc.) and + the spaces between them. + + ‘.msgid’ + This matches the untranslated string including the string + delimiters, the associated keywords (‘msgid’ etc.) and the + spaces between them. + + ‘.msgstr’ + This matches the translated string including the string + delimiters, the associated keywords (‘msgstr’ etc.) and the + spaces between them. + + ‘.keyword’ + This matches the keywords (‘msgid’, ‘msgstr’, etc.). + + ‘.string’ + This matches strings, including the string delimiters (double + quotes). + + • Selectors that apply to parts of strings: + + ‘.text’ + This matches the entire contents of a string (excluding the + string delimiters, i.e. the double quotes). + + ‘.escape-sequence’ + This matches an escape sequence (starting with a backslash). + + ‘.format-directive’ + This matches a format string directive (starting with a ‘%’ + sign in the case of most programming languages, with a ‘{’ in + the case of ‘java-format’ and ‘csharp-format’, with a ‘~’ in + the case of ‘lisp-format’ and ‘scheme-format’, or with ‘$’ in + the case of ‘sh-format’). + + ‘.invalid-format-directive’ + This matches an invalid format string directive. + + ‘.added’ + In an untranslated string, this matches a part of the string + that was not present in the previous untranslated string. + (Not yet implemented in this release.) + + ‘.changed’ + In an untranslated string or in a previous untranslated + string, this matches a part of the string that is changed or + replaced. (Not yet implemented in this release.) + + ‘.removed’ + In a previous untranslated string, this matches a part of the + string that is not present in the current untranslated string. + (Not yet implemented in this release.) + + These selectors can be combined to hierarchical selectors. For +example, + + .msgstr .invalid-format-directive { color: red; } + +will highlight the invalid format directives in the translated strings. + + In text mode, pseudo-classes (CSS2 spec, section 5.11) and +pseudo-elements (CSS2 spec, section 5.12) are not supported. + + The declarations in HTML mode are not limited; any graphical +attribute supported by the browsers can be used. + + The declarations in text mode are limited to the following +properties. Other properties will be silently ignored. + +‘color’ (CSS2 spec, section 14.1) +‘background-color’ (CSS2 spec, section 14.2.1) + These properties is supported. Colors will be adjusted to match + the terminal's capabilities. Note that many terminals support only + 8 colors. + +‘font-weight’ (CSS2 spec, section 15.2.3) + This property is supported, but most terminals can only render two + different weights: ‘normal’ and ‘bold’. Values >= 600 are rendered + as ‘bold’. + +‘font-style’ (CSS2 spec, section 15.2.3) + This property is supported. The values ‘italic’ and ‘oblique’ are + rendered the same way. + +‘text-decoration’ (CSS2 spec, section 16.3.1) + This property is supported, limited to the values ‘none’ and + ‘underline’. + + +File: gettext.info, Node: Customizing less, Prev: Style rules, Up: Colorizing + +9.11.5 Customizing ‘less’ for viewing PO files +---------------------------------------------- + + The ‘less’ program is a popular text file browser for use in a text +screen or terminal emulator. It also supports text with embedded escape +sequences for colors and text decorations. + + You can use ‘less’ to view a PO file like this (assuming an UTF-8 +environment): + + msgcat --to-code=UTF-8 --color xyz.po | less -R + + You can simplify this to this simple command: + + less xyz.po + +after these three preparations: + + 1. Add the options ‘-R’ and ‘-f’ to the ‘LESS’ environment variable. + In sh shells: + $ LESS="$LESS -R -f" + $ export LESS + + 2. If your system does not already have the ‘lessopen.sh’ and + ‘lessclose.sh’ scripts, create them and set the ‘LESSOPEN’ and + ‘LESSCLOSE’ environment variables, as indicated in the manual page + (‘man less’). + + 3. Add to ‘lessopen.sh’ a piece of script that recognizes PO files + through their file extension and invokes ‘msgcat’ on them, + producing a temporary file. Like this: + + case "$1" in + *.po) + tmpfile=`mktemp "${TMPDIR-/tmp}/less.XXXXXX"` + msgcat --to-code=UTF-8 --color "$1" > "$tmpfile" + echo "$tmpfile" + exit 0 + ;; + esac + + +File: gettext.info, Node: Other tools, Next: libgettextpo, Prev: Colorizing, Up: Manipulating + +9.12 Other tools for manipulating PO files +========================================== + +Pology +------ + + The "Pology" package is a Free Software package for manipulating PO +files. It features, in particular: + + • Examination and in-place modification of collections of PO files. + • Format-aware diffing and patching of PO files. + • Handling of version-control branches. + • Fine-grained asynchronous review workflow. + • Custom translation validation. + • Language and project specific support. + + Its home page is at . + +Translate Toolkit +----------------- + + The "Translate Toolkit" is a Free Software package. It contains a +set of programs to convert between PO files and other file formats, +merge translations, and perform various checks. + + Its home page is at . The code +is at . + + +File: gettext.info, Node: libgettextpo, Prev: Other tools, Up: Manipulating + +9.13 Writing your own programs that process PO files +==================================================== + + For the tasks for which a combination of ‘msgattrib’, ‘msgcat’ etc. +is not sufficient, a set of C functions is provided in a library, to +make it possible to process PO files in your own programs. When you use +this library, you don't need to write routines to parse the PO file; +instead, you retrieve a pointer in memory to each of messages contained +in the PO file. Functions for writing those memory structures to a file +after working with them are provided too. + + The functions are declared in the header file ‘’, and +are defined in a library called ‘libgettextpo’. + + The library is multithread-safe in the following sense: Different +threads can safely use the various functions simultaneously on unrelated +data objects. For example, if several threads have created separate +‘po_file_t’ objects, each of them can safely work on its respective +‘po_file_t’ object, without caring about the other threads. + +* Menu: + +* Error Handling:: Error handling functions +* po_file_t API:: File management +* po_message_iterator_t API:: Message iteration +* po_message_t API:: The basic units of the file +* PO Header Entry API:: Meta information of the file +* po_filepos_t API:: References to the sources +* Format Type API:: Supported format types +* Checking API:: Enforcing constraints + + The following example shows code how these functions can be used. +Error handling code is omitted, as its implementation is delegated to +the user provided functions. + + struct po_xerror_handler handler = + { + .xerror = ..., + .xerror2 = ... + }; + const char *filename = ...; + /* Read the file into memory. */ + po_file_t file = po_file_read (filename, &handler); + + { + const char * const *domains = po_file_domains (file); + const char * const *domainp; + + /* Iterate the domains contained in the file. */ + for (domainp = domains; *domainp; domainp++) + { + po_message_t *message; + const char *domain = *domainp; + po_message_iterator_t iterator = po_message_iterator (file, domain); + + /* Iterate each message inside the domain. */ + while ((message = po_next_message (iterator)) != NULL) + { + /* Read data from the message ... */ + const char *msgid = po_message_msgid (message); + const char *msgstr = po_message_msgstr (message); + + ... + + /* Modify its contents ... */ + if (perform_some_tests (msgid, msgstr)) + po_message_set_fuzzy (message, 1); + + ... + } + /* Always release returned po_message_iterator_t. */ + po_message_iterator_free (iterator); + } + + /* Write back the result. */ + po_file_t result = po_file_write (file, filename, &handler); + } + + /* Always release the returned po_file_t. */ + po_file_free (file); + + +File: gettext.info, Node: Error Handling, Next: po_file_t API, Up: libgettextpo + +9.13.1 Error Handling +--------------------- + + Error management is performed through callbacks provided by the user +of the library. They are provided through a parameter with the +following type: + + -- Data Type: struct po_xerror_handler + Its pointer is defined as ‘po_xerror_handler_t’. Contains two + fields, ‘xerror’ and ‘xerror2’, with the following function + signatures. + + -- Function: void xerror (int SEVERITY, po_message_t MESSAGE, + const char *FILENAME, size_t LINENO, size_t COLUMN, + int MULTILINE_P, const char *MESSAGE_TEXT) + + This function is called to signal a problem of the given SEVERITY. + It _must not return_ if SEVERITY is ‘PO_SEVERITY_FATAL_ERROR’. + + MESSAGE_TEXT is the problem description. When MULTILINE_P is true, + it can contain multiple lines of text, each terminated with a + newline, otherwise a single line. + + MESSAGE and/or FILENAME and LINENO indicate where the problem + occurred: + + • If FILENAME is ‘NULL’, FILENAME and LINENO and COLUMN should + be ignored. + + • If LINENO is ‘(size_t)(-1)’, LINENO and COLUMN should be + ignored. + + • If COLUMN is ‘(size_t)(-1)’, it should be ignored. + + -- Function: void xerror2 (int SEVERITY, po_message_t MESSAGE1, + const char *FILENAME1, size_t LINENO1, size_t COLUMN1, + int MULTILINE_P1, const char *MESSAGE_TEXT1, + po_message_t MESSAGE2, const char *FILENAME2, size_t LINENO2, + size_t COLUMN2, int MULTILINE_P2, const char *MESSAGE_TEXT2) + + This function is called to signal a problem of the given SEVERITY + that refers to two messages. It _must not return_ if SEVERITY is + ‘PO_SEVERITY_FATAL_ERROR’. + + It is similar to two calls to xerror. If possible, an ellipsis can + be appended to MESSAGE_TEXT1 and prepended to MESSAGE_TEXT2. + + +File: gettext.info, Node: po_file_t API, Next: po_message_iterator_t API, Prev: Error Handling, Up: libgettextpo + +9.13.2 po_file_t API +-------------------- + + -- Data Type: po_file_t + This is a pointer type that refers to the contents of a PO file, + after it has been read into memory. + + -- Function: po_file_t po_file_create () + The ‘po_file_create’ function creates an empty PO file + representation in memory. + + -- Function: po_file_t po_file_read (const char *FILENAME, + struct po_xerror_handler *HANDLER) + The ‘po_file_read’ function reads a PO file into memory. The file + name is given as argument. The return value is a handle to the PO + file's contents, valid until ‘po_file_free’ is called on it. In + case of error, the functions from HANDLER are called to signal it. + + This function is exported as ‘po_file_read_v3’ at ABI level, but is + defined as ‘po_file_read’ in C code after the inclusion of + ‘’. + + -- Function: po_file_t po_file_write (po_file_t FILE, + const char *FILENAME, struct po_xerror_handler *HANDLER) + The ‘po_file_write’ function writes the contents of the memory + structure FILE the FILENAME given. The return value is FILE after + a successful operation. In case of error, the functions from + HANDLER are called to signal it. + + This function is exported as ‘po_file_write_v2’ at ABI level, but + is defined as ‘po_file_write’ in C code after the inclusion of + ‘’. + + -- Function: void po_file_free (po_file_t FILE) + The ‘po_file_free’ function frees a PO file's contents from memory, + including all messages that are only implicitly accessible through + iterators. + + -- Function: const char * const * po_file_domains (po_file_t FILE) + The ‘po_file_domains’ function returns the domains for which the + given PO file has messages. The return value is a ‘NULL’ + terminated array which is valid as long as the FILE handle is + valid. For PO files which contain no ‘domain’ directive, the + return value contains only one domain, namely the default domain + ‘"messages"’. + + +File: gettext.info, Node: po_message_iterator_t API, Next: po_message_t API, Prev: po_file_t API, Up: libgettextpo + +9.13.3 po_message_iterator_t API +-------------------------------- + + -- Data Type: po_message_iterator_t + This is a pointer type that refers to an iterator that produces a + sequence of messages. + + -- Function: po_message_iterator_t po_message_iterator (po_file_t FILE, + const char *DOMAIN) + The ‘po_message_iterator’ returns an iterator that will produce the + messages of FILE that belong to the given DOMAIN. If DOMAIN is + ‘NULL’, the default domain is used instead. To list the messages, + use the function ‘po_next_message’ repeatedly. + + -- Function: void po_message_iterator_free + (po_message_iterator_t ITERATOR) + The ‘po_message_iterator_free’ function frees an iterator + previously allocated through the ‘po_message_iterator’ function. + + -- Function: po_message_t po_next_message + (po_message_iterator_t ITERATOR) + The ‘po_next_message’ function returns the next message from + ITERATOR and advances the iterator. It returns ‘NULL’ when the + iterator has reached the end of its message list. + + +File: gettext.info, Node: po_message_t API, Next: PO Header Entry API, Prev: po_message_iterator_t API, Up: libgettextpo + +9.13.4 po_message_t API +----------------------- + + -- Data Type: po_message_t + This is a pointer type that refers to a message of a PO file, + including its translation. + + -- Function: po_message_t po_message_create (void) + Returns a freshly constructed message. To finish initializing the + message, you must set the ‘msgid’ and ‘msgstr’. It _must_ be + inserted into a file to manage its memory, as there is no + ‘po_message_free’ available to the user of the library. + + The following functions access details of a ‘po_message_t’. Recall +that the results are valid as long as the FILE handle is valid. + + -- Function: const char * po_message_msgctxt (po_message_t MESSAGE) + The ‘po_message_msgctxt’ function returns the ‘msgctxt’, the + context of MESSAGE. Returns ‘NULL’ for a message not restricted to + a context. + + -- Function: void po_message_set_msgctxt (po_message_t MESSAGE, + const char *MSGCTXT) + The ‘po_message_set_msgctxt’ function changes the ‘msgctxt’, the + context of the message, to the value provided through MSGCTXT. The + value ‘NULL’ removes the restriction. + + -- Function: const char * po_message_msgid (po_message_t MESSAGE) + The ‘po_message_msgid’ function returns the ‘msgid’ (untranslated + English string) of MESSAGE. This is guaranteed to be non-‘NULL’. + + -- Function: void po_message_set_msgid (po_message_t MESSAGE, + const char *MSGID) + The ‘po_message_set_msgid’ function changes the ‘msgid’ + (untranslated English string) of MESSAGE to the value provided + through MSGID, a non-‘NULL’ string. + + -- Function: const char * po_message_msgid_plural + (po_message_t MESSAGE) + The ‘po_message_msgid_plural’ function returns the ‘msgid_plural’ + (untranslated English plural string) of MESSAGE, a message with + plurals, or ‘NULL’ for a message without plural. + + -- Function: void po_message_set_msgid_plural (po_message_t MESSAGE, + const char *MSGID_PLURAL) + The ‘po_message_set_msgid_plural’ function changes the + ‘msgid_plural’ (untranslated English plural string) of a message to + the value provided through MSGID_PLURAL, or removes the plurals if + ‘NULL’ is provided as MSGID_PLURAL. + + -- Function: const char * po_message_msgstr (po_message_t MESSAGE) + The ‘po_message_msgstr’ function returns the ‘msgstr’ (translation) + of MESSAGE. For an untranslated message, the return value is an + empty string. + + -- Function: void po_message_set_msgstr (po_message_t MESSAGE, + const char *MSGSTR) + The ‘po_message_set_msgstr’ function changes the ‘msgstr’ + (translation) of MESSAGE to the value provided through MSGSTR, a + non-‘NULL’ string. + + -- Function: const char * po_message_msgstr_plural + (po_message_t MESSAGE, int INDEX) + The ‘po_message_msgstr_plural’ function returns the ‘msgstr[INDEX]’ + of MESSAGE, a message with plurals, or ‘NULL’ when the INDEX is out + of range or for a message without plural. + + -- Function: void po_message_set_msgstr_plural (po_message_t MESSAGE, + int INDEX, const char *MSGSTR_PLURAL) + The ‘po_message_set_msgstr_plural’ function changes the + ‘msgstr[INDEX]’ of MESSAGE, a message with plurals, to the value + provided through MSGSTR_PLURAL. MESSAGE must be a message with + plurals. Use ‘NULL’ as the value of MSGSTR_PLURAL with INDEX + pointing to the last element to reduce the number of plural forms. + + -- Function: const char * po_message_comments (po_message_t MESSAGE) + The ‘po_message_comments’ function returns the comments of MESSAGE, + a multiline string, ending in a newline, or a non-‘NULL’ empty + string. + + -- Function: void po_message_set_comments (po_message_t MESSAGE, + const char *COMMENTS) + The ‘po_message_set_comments’ function changes the comments of + MESSAGE to the value COMMENTS, a multiline string, ending in a + newline, or a non-‘NULL’ empty string. + + -- Function: const char * po_message_extracted_comments + (po_message_t MESSAGE) + The ‘po_message_extracted_comments’ function returns the extracted + comments of MESSAGE, a multiline string, ending in a newline, or a + non-‘NULL’ empty string. + + -- Function: void po_message_set_extracted_comments + (po_message_t MESSAGE, const char *EXTRACTED_COMMENTS) + The ‘po_message_set_extracted_comments’ function changes the + comments of MESSAGE to the value EXTRACTED_COMMENTS, a multiline + string, ending in a newline, or a non-‘NULL’ empty string. + + -- Function: const char * po_message_prev_msgctxt + (po_message_t MESSAGE) + The ‘po_message_prev_msgctxt’ function returns the previous + ‘msgctxt’, the previous context of MESSAGE. Return ‘NULL’ for a + message that does not have a previous context. + + -- Function: void po_message_set_prev_msgctxt (po_message_t MESSAGE, + const char *PREV_MSGCTXT) + The ‘po_message_set_prev_msgctxt’ function changes the previous + ‘msgctxt’, the context of the message, to the value provided + through PREV_MSGCTXT. The value ‘NULL’ removes the stored previous + msgctxt. + + -- Function: const char * po_message_prev_msgid (po_message_t MESSAGE) + The ‘po_message_prev_msgid’ function returns the previous ‘msgid’ + (untranslated English string) of MESSAGE, or ‘NULL’ if there is no + previous ‘msgid’ stored. + + -- Function: void po_message_set_prev_msgid (po_message_t MESSAGE, + const char *PREV_MSGID) + The ‘po_message_set_prev_msgid’ function changes the previous + ‘msgid’ (untranslated English string) of MESSAGE to the value + provided through PREV_MSGID, or removes the message when it is + ‘NULL’. + + -- Function: const char * po_message_prev_msgid_plural + (po_message_t MESSAGE) + The ‘po_message_prev_msgid_plural’ function returns the previous + ‘msgid_plural’ (untranslated English plural string) of MESSAGE, a + message with plurals, or ‘NULL’ for a message without plural + without any stored previous ‘msgid_plural’. + + -- Function: void po_message_set_prev_msgid_plural + (po_message_t MESSAGE, const char *PREV_MSGID_PLURAL) + The ‘po_message_set_prev_msgid_plural’ function changes the + previous ‘msgid_plural’ (untranslated English plural string) of a + message to the value provided through PREV_MSGID_PLURAL, or removes + the stored previous ‘msgid_plural’ if ‘NULL’ is provided as + PREV_MSGID_PLURAL. + + -- Function: int po_message_is_obsolete (po_message_t MESSAGE) + The ‘po_message_is_obsolete’ function returns true when MESSAGE is + marked as obsolete. + + -- Function: void po_message_set_obsolete (po_message_t MESSAGE, + int OBSOLETE) + The ‘po_message_set_obsolete’ function changes the obsolete mark of + MESSAGE. + + -- Function: int po_message_is_fuzzy (po_message_t MESSAGE) + The ‘po_message_is_fuzzy’ function returns true when MESSAGE is + marked as fuzzy. + + -- Function: void po_message_set_fuzzy (po_message_t MESSAGE, + int FUZZY) + The ‘po_message_set_fuzzy’ function changes the fuzzy mark of + MESSAGE. + + -- Function: int po_message_is_format (po_message_t MESSAGE, + const char *FORMAT_TYPE) + The ‘po_message_is_format’ function returns true when the message + is marked as being a format string of FORMAT_TYPE. + + -- Function: void po_message_set_format (po_message_t MESSAGE, + const char *FORMAT_TYPE, int VALUE) + The ‘po_message_set_format’ function changes the format string mark + of the message for the FORMAT_TYPE provided. Pass VALUE = 1 to + assert the format string mark (leading to e.g. ‘c-format’), VALUE + = 0 to assert the opposite (leading to e.g. ‘no-c-format’), or + VALUE = -1 to remove the format string mark and its opposite. + + -- Function: int po_message_is_range (po_message_t MESSAGE, int *MINP, + int *MAXP) + The ‘po_message_is_range’ function returns true when the message + has a numeric range set, and stores the minimum and maximum value + in the locations pointed by MINP and MAXP respectively. + + -- Function: void po_message_set_range (po_message_t MESSAGE, int MIN, + int MAX) + The ‘po_message_set_range’ function changes the numeric range of + the message. MIN and MAX must be non-negative, with MIN < MAX. + Use MIN and MAX with value ‘-1’ to remove the numeric range of + MESSAGE. + + +File: gettext.info, Node: PO Header Entry API, Next: po_filepos_t API, Prev: po_message_t API, Up: libgettextpo + +9.13.5 PO Header Entry API +-------------------------- + + The following functions provide an interface to extract and +manipulate the header entry (*note Header Entry::) from a file loaded in +memory. The meta information must be written back into the domain +message with the empty string as ‘msgid’. + + -- Function: const char * po_file_domain_header (po_file_t FILE, + const char *DOMAIN) + Returns the header entry of a domain from FILE, a PO file loaded in + memory. The value ‘NULL’ provided as DOMAIN denotes the default + domain. Returns ‘NULL’ if there is no header entry. + + -- Function: char * po_header_field (const char *HEADER, + const char *FIELD) + Returns the value of FIELD in the HEADER entry. The return value + is either a freshly allocated string, to be freed by the caller, or + ‘NULL’. + + -- Function: char * po_header_set_field (const char *HEADER, + const char *FIELD, const char *VALUE) + Returns a freshly allocated string which contains the entry from + HEADER with FIELD set to VALUE. The field is added if necessary. + + +File: gettext.info, Node: po_filepos_t API, Next: Format Type API, Prev: PO Header Entry API, Up: libgettextpo + +9.13.6 po_filepos_t API +----------------------- + + -- Data Type: po_filepos_t + This is a pointer type that refers to a string's position within a + source file. + + The following functions provide an interface to extract and +manipulate these references. + + -- Function: po_filepos_t po_message_filepos (po_message_t MESSAGE, + int INDEX) + Returns the file reference in position INDEX from the message. If + INDEX is out of range, returns ‘NULL’. + + -- Function: void po_message_remove_filepos (po_message_t MESSAGE, + int INDEX) + Removes the file reference in position INDEX from the message. It + moves all references following INDEX one position backwards. + + -- Function: void po_message_add_filepos (po_message_t MESSAGE, + const char *FILE, size_t START_LINE) + Adds a reference to the string from FILE starting at START_LINE, if + it is not already present for the message. The value + ‘(size_t)(-1)’ for START_LINE denotes that the line number is not + available. + + +File: gettext.info, Node: Format Type API, Next: Checking API, Prev: po_filepos_t API, Up: libgettextpo + +9.13.7 Format Type API +---------------------- + + -- Function: const char * const * po_format_list (void) + Returns a ‘NULL’ terminated array of the supported format types. + + -- Function: const char * po_format_pretty_name + (const char *FORMAT_TYPE) + Returns the pretty name associated with FORMAT_TYPE. For example, + it returns "C#" when FORMAT_TYPE is "csharp_format". Return ‘NULL’ + if FORMAT_TYPE is not a supported format type. + + +File: gettext.info, Node: Checking API, Prev: Format Type API, Up: libgettextpo + +9.13.8 Checking API +------------------- + + -- Function: void po_file_check_all (po_file_t FILE, + po_xerror_handler_t HANDLER) + Tests whether the entire FILE is valid, like ‘msgfmt’ does it. If + it is invalid, passes the reasons to HANDLER. + + -- Function: void po_message_check_all (po_message_t MESSAGE, + po_message_iterator_t ITERATOR, po_xerror_handler_t HANDLER) + Tests MESSAGE, to be inserted at ITERATOR in a PO file in memory, + like ‘msgfmt’ does it. If it is invalid, passes the reasons to + HANDLER. ITERATOR is not modified by this call; it only specifies + the file and the domain. + + -- Function: void po_message_check_format (po_message_t MESSAGE, + po_xerror_handler_t HANDLER) + Tests whether the message translation from MESSAGE is a valid + format string if the message is marked as being a format string. + If it is invalid, passes the reasons to HANDLER. + + This function is exported as ‘po_message_check_format_v2’ at ABI + level, but is defined as ‘po_message_check_format’ in C code after + the inclusion of ‘’. + + +File: gettext.info, Node: Binaries, Next: Programmers, Prev: Manipulating, Up: Top + +10 Producing Binary MO Files +**************************** + +* Menu: + +* msgfmt Invocation:: Invoking the ‘msgfmt’ Program +* msgunfmt Invocation:: Invoking the ‘msgunfmt’ Program +* MO Files:: The Format of GNU MO Files + + +File: gettext.info, Node: msgfmt Invocation, Next: msgunfmt Invocation, Up: Binaries + +10.1 Invoking the ‘msgfmt’ Program +================================== + + msgfmt [OPTION] FILENAME.po ... + + The ‘msgfmt’ programs generates a binary message catalog from a +textual translation description. + +10.1.1 Input file location +-------------------------- + +‘FILENAME.po ...’ + +‘-D DIRECTORY’ +‘--directory=DIRECTORY’ + Add DIRECTORY to the list of directories. Source files are + searched relative to this list of directories. The resulting + binary file will be written relative to the current directory, + though. + + If an input file is ‘-’, standard input is read. + +10.1.2 Operation mode +--------------------- + +‘-j’ +‘--java’ + Java mode: generate a Java ‘ResourceBundle’ class. + +‘--java2’ + Like -java, and assume Java2 (JDK 1.2 or higher). + +‘--csharp’ + C# mode: generate a .NET .dll file containing a subclass of + ‘GettextResourceSet’. + +‘--csharp-resources’ + C# resources mode: generate a .NET ‘.resources’ file. + +‘--tcl’ + Tcl mode: generate a tcl/msgcat ‘.msg’ file. + +‘--qt’ + Qt mode: generate a Qt ‘.qm’ file. + +‘--desktop’ + Desktop Entry mode: generate a ‘.desktop’ file. + +‘--xml’ + XML mode: generate an XML file. + +10.1.3 Output file location +--------------------------- + +‘-o FILE’ +‘--output-file=FILE’ + Write output to specified file. + +‘--strict’ + Direct the program to work strictly following the Uniforum/Sun + implementation. Currently this only affects the naming of the + output file. If this option is not given the name of the output + file is the same as the domain name. If the strict Uniforum mode + is enabled the suffix ‘.mo’ is added to the file name if it is not + already present. + + We find this behaviour of Sun's implementation rather silly and so + by default this mode is _not_ selected. + + If the output FILE is ‘-’, output is written to standard output. + +10.1.4 Output file location in Java mode +---------------------------------------- + +‘-r RESOURCE’ +‘--resource=RESOURCE’ + Specify the resource name. + +‘-l LOCALE’ +‘--locale=LOCALE’ + Specify the locale name, either a language specification of the + form LL or a combined language and country specification of the + form LL_CC. + +‘-d DIRECTORY’ + Specify the base directory of classes directory hierarchy. + +‘--source’ + Produce a .java source file, instead of a compiled .class file. + + The class name is determined by appending the locale name to the +resource name, separated with an underscore. The ‘-d’ option is +mandatory. The class is written under the specified directory. + +10.1.5 Output file location in C# mode +-------------------------------------- + +‘-r RESOURCE’ +‘--resource=RESOURCE’ + Specify the resource name. + +‘-l LOCALE’ +‘--locale=LOCALE’ + Specify the locale name, either a language specification of the + form LL or a combined language and country specification of the + form LL_CC. + +‘-d DIRECTORY’ + Specify the base directory for locale dependent ‘.dll’ files. + + The ‘-l’ and ‘-d’ options are mandatory. The ‘.dll’ file is written +in a subdirectory of the specified directory whose name depends on the +locale. + +10.1.6 Output file location in Tcl mode +--------------------------------------- + +‘-l LOCALE’ +‘--locale=LOCALE’ + Specify the locale name, either a language specification of the + form LL or a combined language and country specification of the + form LL_CC. + +‘-d DIRECTORY’ + Specify the base directory of ‘.msg’ message catalogs. + + The ‘-l’ and ‘-d’ options are mandatory. The ‘.msg’ file is written +in the specified directory. + +10.1.7 Desktop Entry mode options +--------------------------------- + +‘--template=TEMPLATE’ + Specify a .desktop file used as a template. + +‘-k[KEYWORDSPEC]’ +‘--keyword[=KEYWORDSPEC]’ + Specify KEYWORDSPEC as an additional keyword to be looked for. + Without a KEYWORDSPEC, the option means to not use default + keywords. + +‘-l LOCALE’ +‘--locale=LOCALE’ + Specify the locale name, either a language specification of the + form LL or a combined language and country specification of the + form LL_CC. + +‘-d DIRECTORY’ + Specify the directory where PO files are read. The directory must + contain the ‘LINGUAS’ file. + + To generate a ‘.desktop’ file for a single locale, you can use it as +follows. + + msgfmt --desktop --template=TEMPLATE --locale=LOCALE \ + -o FILE FILENAME.po ... + + msgfmt provides a special "bulk" operation mode to process multiple +‘.po’ files at a time. + + msgfmt --desktop --template=TEMPLATE -d DIRECTORY -o FILE + + msgfmt first reads the ‘LINGUAS’ file under DIRECTORY, and then +processes all ‘.po’ files listed there. You can also limit the locales +to a subset, through the ‘LINGUAS’ environment variable. + + For either operation modes, the ‘-o’ and ‘--template’ options are +mandatory. + +10.1.8 XML mode options +----------------------- + +‘--template=TEMPLATE’ + Specify an XML file used as a template. + +‘-L NAME’ +‘--language=NAME’ + Specifies the language of the input files. + +‘-l LOCALE’ +‘--locale=LOCALE’ + Specify the locale name, either a language specification of the + form LL or a combined language and country specification of the + form LL_CC. + +‘-d DIRECTORY’ + Specify the base directory of ‘.po’ message catalogs. + +‘--replace-text’ + Output XML with translated text replacing the original text, not + augmenting the original text. With this option, ‘msgfmt’ produces + a mono-lingual XML file. Without this option, it produces a + multi-lingual XML file. + + To generate an XML file for a single locale, you can use it as +follows. + + msgfmt --xml --template=TEMPLATE --locale=LOCALE \ + -o FILE FILENAME.po ... + + msgfmt provides a special "bulk" operation mode to process multiple +‘.po’ files at a time. + + msgfmt --xml --template=TEMPLATE -d DIRECTORY -o FILE + + msgfmt first reads the ‘LINGUAS’ file under DIRECTORY, and then +processes all ‘.po’ files listed there. You can also limit the locales +to a subset, through the ‘LINGUAS’ environment variable. + + For either operation modes, the ‘-o’ and ‘--template’ options are +mandatory. + + If your XML file is not of one of the types covered by the +system-wide installed *.its files, you need a particular *.its file and +a corresponding *.loc file (*note Preparing ITS Rules::). Furthermore +you need to store these files in a directory ‘PARENT_DIR/its/’ and set +the environment variable ‘GETTEXTDATADIRS’ to include ‘PARENT_DIR’. +More generally, the value of ‘GETTEXTDATADIRS’ should be a +colon-separated list of directory names. + +10.1.9 Input file syntax +------------------------ + +‘-P’ +‘--properties-input’ + Assume the input files are Java ResourceBundles in Java + ‘.properties’ syntax, not in PO file syntax. + +‘--stringtable-input’ + Assume the input files are NeXTstep/GNUstep localized resource + files in ‘.strings’ syntax, not in PO file syntax. + +10.1.10 Input file interpretation +--------------------------------- + +‘-c’ +‘--check’ + Perform all the checks implied by ‘--check-format’, + ‘--check-header’, ‘--check-domain’. + +‘--check-format’ + Check language dependent format strings. + + If the string represents a format string used in a ‘printf’-like + function both strings should have the same number of ‘%’ format + specifiers, with matching types. If the flag ‘c-format’ or + ‘possible-c-format’ appears in the special comment <#,> for this + entry a check is performed. For example, the check will diagnose + using ‘%.*s’ against ‘%s’, or ‘%d’ against ‘%s’, or ‘%d’ against + ‘%x’. It can even handle positional parameters. + + Normally the ‘xgettext’ program automatically decides whether a + string is a format string or not. This algorithm is not perfect, + though. It might regard a string as a format string though it is + not used in a ‘printf’-like function and so ‘msgfmt’ might report + errors where there are none. + + To solve this problem the programmer can dictate the decision to + the ‘xgettext’ program (*note c-format::). The translator should + not consider removing the flag from the <#,> line. This "fix" + would be reversed again as soon as ‘msgmerge’ is called the next + time. + +‘--check-header’ + Verify presence and contents of the header entry. *Note Header + Entry::, for a description of the various fields in the header + entry. + +‘--check-domain’ + Check for conflicts between domain directives and the + ‘--output-file’ option + +‘-C’ +‘--check-compatibility’ + Check that GNU msgfmt behaves like X/Open msgfmt. This will give + an error when attempting to use the GNU extensions. + +‘--check-accelerators[=CHAR]’ + Check presence of keyboard accelerators for menu items. This is + based on the convention used in some GUIs that a keyboard + accelerator in a menu item string is designated by an immediately + preceding ‘&’ character. Sometimes a keyboard accelerator is also + called "keyboard mnemonic". This check verifies that if the + untranslated string has exactly one ‘&’ character, the translated + string has exactly one ‘&’ as well. If this option is given with a + CHAR argument, this CHAR should be a non-alphanumeric character and + is used as keyboard accelerator mark instead of ‘&’. + +‘-f’ +‘--use-fuzzy’ + Use fuzzy entries in output. Note that using this option is + usually wrong, because fuzzy messages are exactly those which have + not been validated by a human translator. + +10.1.11 Output details +---------------------- + +‘--no-convert’ + Don't convert the messages to UTF-8 encoding. By default, messages + are converted to UTF-8 encoding before being stored in a MO file; + this helps avoiding conversions at run time, since nowadays most + locales use the UTF-8 encoding. + +‘--no-redundancy’ + Don't pre-expand ISO C 99 format string directive + macros. By default, messages that are marked as ‘c-format’ and + contain ISO C 99 format string directive macros are + pre-expanded for selected platforms, and these redundant expansions + are stored in the MO file. These redundant expansions make the + translations of these messages work with the ‘gettext’ + implementation in the ‘libc’ of that platform, without requiring + GNU ‘gettext’'s ‘libintl’. The platforms that benefit from this + pre-expansion are those with the musl libc. + +‘-a NUMBER’ +‘--alignment=NUMBER’ + Align strings to NUMBER bytes (default: 1). + +‘--endianness=BYTEORDER’ + Write out 32-bit numbers in the given byte order. The possible + values are ‘big’ and ‘little’. The default is ‘little’. + + MO files of any endianness can be used on any platform. When a MO + file has an endianness other than the platform's one, the 32-bit + numbers from the MO file are swapped at runtime. The performance + impact is negligible. + + This option can be useful to produce MO files that are optimized + for one platform. + +‘--no-hash’ + Don't include a hash table in the binary file. Lookup will be more + expensive at run time (binary search instead of hash table lookup). + +10.1.12 Informative output +-------------------------- + +‘-h’ +‘--help’ + Display this help and exit. + +‘-V’ +‘--version’ + Output version information and exit. + +‘--statistics’ + Print statistics about translations. When the option ‘--verbose’ + is used in combination with ‘--statistics’, the input file name is + printed in front of the statistics line. + +‘-v’ +‘--verbose’ + Increase verbosity level. + + +File: gettext.info, Node: msgunfmt Invocation, Next: MO Files, Prev: msgfmt Invocation, Up: Binaries + +10.2 Invoking the ‘msgunfmt’ Program +==================================== + + msgunfmt [OPTION] [FILE]... + + The ‘msgunfmt’ program converts a binary message catalog to a +Uniforum style .po file. + +10.2.1 Operation mode +--------------------- + +‘-j’ +‘--java’ + Java mode: input is a Java ‘ResourceBundle’ class. + +‘--csharp’ + C# mode: input is a .NET .dll file containing a subclass of + ‘GettextResourceSet’. + +‘--csharp-resources’ + C# resources mode: input is a .NET ‘.resources’ file. + +‘--tcl’ + Tcl mode: input is a tcl/msgcat ‘.msg’ file. + +10.2.2 Input file location +-------------------------- + +‘FILE ...’ + Input .mo files. + + If no input FILE is given or if it is ‘-’, standard input is read. + +10.2.3 Input file location in Java mode +--------------------------------------- + +‘-r RESOURCE’ +‘--resource=RESOURCE’ + Specify the resource name. + +‘-l LOCALE’ +‘--locale=LOCALE’ + Specify the locale name, either a language specification of the + form LL or a combined language and country specification of the + form LL_CC. + + The class name is determined by appending the locale name to the +resource name, separated with an underscore. The class is located using +the ‘CLASSPATH’. + +10.2.4 Input file location in C# mode +------------------------------------- + +‘-r RESOURCE’ +‘--resource=RESOURCE’ + Specify the resource name. + +‘-l LOCALE’ +‘--locale=LOCALE’ + Specify the locale name, either a language specification of the + form LL or a combined language and country specification of the + form LL_CC. + +‘-d DIRECTORY’ + Specify the base directory for locale dependent ‘.dll’ files. + + The ‘-l’ and ‘-d’ options are mandatory. The ‘.msg’ file is located +in a subdirectory of the specified directory whose name depends on the +locale. + +10.2.5 Input file location in Tcl mode +-------------------------------------- + +‘-l LOCALE’ +‘--locale=LOCALE’ + Specify the locale name, either a language specification of the + form LL or a combined language and country specification of the + form LL_CC. + +‘-d DIRECTORY’ + Specify the base directory of ‘.msg’ message catalogs. + + The ‘-l’ and ‘-d’ options are mandatory. The ‘.msg’ file is located +in the specified directory. + +10.2.6 Output file location +--------------------------- + +‘-o FILE’ +‘--output-file=FILE’ + Write output to specified file. + + The results are written to standard output if no output file is +specified or if it is ‘-’. + +10.2.7 Output details +--------------------- + +‘--color’ +‘--color=WHEN’ + Specify whether or when to use colors and other text attributes. + See *note The --color option:: for details. + +‘--style=STYLE_FILE’ + Specify the CSS style rule file to use for ‘--color’. See *note + The --style option:: for details. + +‘--force-po’ + Always write an output file even if it contains no message. + +‘-i’ +‘--indent’ + Write the .po file using indented style. + +‘--strict’ + Write out a strict Uniforum conforming PO file. Note that this + Uniforum format should be avoided because it doesn't support the + GNU extensions. + +‘-p’ +‘--properties-output’ + Write out a Java ResourceBundle in Java ‘.properties’ syntax. Note + that this file format doesn't support plural forms and silently + drops obsolete messages. + +‘--stringtable-output’ + Write out a NeXTstep/GNUstep localized resource file in ‘.strings’ + syntax. Note that this file format doesn't support plural forms. + +‘-w NUMBER’ +‘--width=NUMBER’ + Set the output page width. Long strings in the output files will + be split across multiple lines in order to ensure that each line's + width (= number of screen columns) is less or equal to the given + NUMBER. + +‘--no-wrap’ + Do not break long message lines. Message lines whose width exceeds + the output page width will not be split into several lines. Only + file reference lines which are wider than the output page width + will be split. + +‘-s’ +‘--sort-output’ + Generate sorted output. Note that using this option makes it much + harder for the translator to understand each message's context. + +10.2.8 Informative output +------------------------- + +‘-h’ +‘--help’ + Display this help and exit. + +‘-V’ +‘--version’ + Output version information and exit. + +‘-v’ +‘--verbose’ + Increase verbosity level. + + +File: gettext.info, Node: MO Files, Prev: msgunfmt Invocation, Up: Binaries + +10.3 The Format of GNU MO Files +=============================== + + The format of the generated MO files is best described by a picture, +which appears below. + + The first two words serve the identification of the file. The magic +number will always signal GNU MO files. The number is stored in the +byte order used when the MO file was generated, so the magic number +really is two numbers: ‘0x950412de’ and ‘0xde120495’. + + The second word describes the current revision of the file format, +composed of a major and a minor revision number. The revision numbers +ensure that the readers of MO files can distinguish new formats from old +ones and handle their contents, as far as possible. For now the major +revision is 0 or 1, and the minor revision is also 0 or 1. More +revisions might be added in the future. A program seeing an unexpected +major revision number should stop reading the MO file entirely; whereas +an unexpected minor revision number means that the file can be read but +will not reveal its full contents, when parsed by a program that +supports only smaller minor revision numbers. + + The version is kept separate from the magic number, instead of using +different magic numbers for different formats, mainly because +‘/etc/magic’ is not updated often. + + Follow a number of pointers to later tables in the file, allowing for +the extension of the prefix part of MO files without having to recompile +programs reading them. This might become useful for later inserting a +few flag bits, indication about the charset used, new tables, or other +things. + + Then, at offset O and offset T in the picture, two tables of string +descriptors can be found. In both tables, each string descriptor uses +two 32 bits integers, one for the string length, another for the offset +of the string in the MO file, counting in bytes from the start of the +file. The first table contains descriptors for the original strings, +and is sorted so the original strings are in increasing lexicographical +order. The second table contains descriptors for the translated +strings, and is parallel to the first table: to find the corresponding +translation one has to access the array slot in the second array with +the same index. + + Having the original strings sorted enables the use of simple binary +search, for when the MO file does not contain an hashing table, or for +when it is not practical to use the hashing table provided in the MO +file. This also has another advantage, as the empty string in a PO file +GNU ‘gettext’ is usually _translated_ into some system information +attached to that particular MO file, and the empty string necessarily +becomes the first in both the original and translated tables, making the +system information very easy to find. + + The size S of the hash table can be zero. In this case, the hash +table itself is not contained in the MO file. Some people might prefer +this because a precomputed hashing table takes disk space, and does not +win _that_ much speed. The hash table contains indices to the sorted +array of strings in the MO file. Conflict resolution is done by double +hashing. The precise hashing algorithm used is fairly dependent on GNU +‘gettext’ code, and is not documented here. + + As for the strings themselves, they follow the hash file, and each is +terminated with a , and this is not counted in the length +which appears in the string descriptor. The ‘msgfmt’ program has an +option selecting the alignment for MO file strings. With this option, +each string is separately aligned so it starts at an offset which is a +multiple of the alignment value. On some RISC machines, a correct +alignment will speed things up. + + Contexts are stored by storing the concatenation of the context, a + byte, and the original string, instead of the original string. + + Plural forms are stored by letting the plural of the original string +follow the singular of the original string, separated through a +byte. The length which appears in the string descriptor includes both. +However, only the singular of the original string takes part in the hash +table lookup. The plural variants of the translation are all stored +consecutively, separated through a byte. Here also, the length in +the string descriptor includes all of them. + + The character encoding of the strings can be any standard +ASCII-compatible encoding, such as UTF-8, ISO-8859-1, EUC-JP, etc., as +long as the encoding's name is stated in the header entry (*note Header +Entry::). Starting with GNU ‘gettext’ version 0.22, the MO files +produced by ‘msgfmt’ have them in UTF-8 encoding, unless the ‘msgfmt’ +option ‘--no-convert’ is used. + + Nothing prevents a MO file from having embedded s in strings. +However, the program interface currently used already presumes that +strings are terminated, so embedded s are somewhat useless. +But the MO file format is general enough so other interfaces would be +later possible, if for example, we ever want to implement wide +characters right in MO files, where bytes may accidentally appear. +(No, we don't want to have wide characters in MO files. They would make +the file unnecessarily large, and the ‘wchar_t’ type being platform +dependent, MO files would be platform dependent as well.) + + This particular issue has been strongly debated in the GNU ‘gettext’ +development forum, and it is expectable that MO file format will evolve +or change over time. It is even possible that many formats may later be +supported concurrently. But surely, we have to start somewhere, and the +MO file format described here is a good start. Nothing is cast in +concrete, and the format may later evolve fairly easily, so we should +feel comfortable with the current approach. + + byte + +------------------------------------------+ + 0 | magic number = 0x950412de | + | | + 4 | file format revision = 0 | + | | + 8 | number of strings | == N + | | + 12 | offset of table with original strings | == O + | | + 16 | offset of table with translation strings | == T + | | + 20 | size of hashing table | == S + | | + 24 | offset of hashing table | == H + | | + . . + . (possibly more entries later) . + . . + | | + O | length & offset 0th string ----------------. + O + 8 | length & offset 1st string ------------------. + ... ... | | + O + ((N-1)*8)| length & offset (N-1)th string | | | + | | | | + T | length & offset 0th translation ---------------. + T + 8 | length & offset 1st translation -----------------. + ... ... | | | | + T + ((N-1)*8)| length & offset (N-1)th translation | | | | | + | | | | | | + H | start hash table | | | | | + ... ... | | | | + H + S * 4 | end hash table | | | | | + | | | | | | + | NUL terminated 0th string <----------------' | | | + | | | | | + | NUL terminated 1st string <------------------' | | + | | | | + ... ... | | + | | | | + | NUL terminated 0th translation <---------------' | + | | | + | NUL terminated 1st translation <-----------------' + | | + ... ... + | | + +------------------------------------------+ + + +File: gettext.info, Node: Programmers, Next: Translators, Prev: Binaries, Up: Top + +11 The Programmer's View +************************ + + One aim of the current message catalog implementation provided by GNU +‘gettext’ was to use the system's message catalog handling, if the +installer wishes to do so. So we perhaps should first take a look at +the solutions we know about. The people in the POSIX committee did not +manage to agree on one of the semi-official standards which we'll +describe below. In fact they couldn't agree on anything, so they +decided only to include an example of an interface. The major Unix +vendors are split in the usage of the two most important specifications: +X/Open's catgets vs. Uniforum's gettext interface. We'll describe them +both and later explain our solution of this dilemma. + +* Menu: + +* catgets:: About ‘catgets’ +* gettext:: About ‘gettext’ +* Comparison:: Comparing the two interfaces +* Using libintl.a:: Using libintl.a in own programs +* gettext grok:: Being a ‘gettext’ grok +* Temp Programmers:: Temporary Notes for the Programmers Chapter + + +File: gettext.info, Node: catgets, Next: gettext, Up: Programmers + +11.1 About ‘catgets’ +==================== + + The ‘catgets’ implementation is defined in the X/Open Portability +Guide, Volume 3, XSI Supplementary Definitions, Chapter 5. But the +process of creating this standard seemed to be too slow for some of the +Unix vendors so they created their implementations on preliminary +versions of the standard. Of course this leads again to problems while +writing platform independent programs: even the usage of ‘catgets’ does +not guarantee a unique interface. + + Another, personal comment on this that only a bunch of committee +members could have made this interface. They never really tried to +program using this interface. It is a fast, memory-saving +implementation, an user can happily live with it. But programmers hate +it (at least I and some others do...) + + But we must not forget one point: after all the trouble with +transferring the rights on Unix they at last came to X/Open, the very +same who published this specification. This leads me to making the +prediction that this interface will be in future Unix standards (e.g. +Spec1170) and therefore part of all Unix implementation +(implementations, which are _allowed_ to wear this name). + +* Menu: + +* Interface to catgets:: The interface +* Problems with catgets:: Problems with the ‘catgets’ interface?! + + +File: gettext.info, Node: Interface to catgets, Next: Problems with catgets, Up: catgets + +11.1.1 The Interface +-------------------- + + The interface to the ‘catgets’ implementation consists of three +functions which correspond to those used in file access: ‘catopen’ to +open the catalog for using, ‘catgets’ for accessing the message tables, +and ‘catclose’ for closing after work is done. Prototypes for the +functions and the needed definitions are in the ‘’ header +file. + + ‘catopen’ is used like in this: + + nl_catd catd = catopen ("catalog_name", 0); + + The function takes as the argument the name of the catalog. This +usual refers to the name of the program or the package. The second +parameter is not further specified in the standard. I don't even know +whether it is implemented consistently among various systems. So the +common advice is to use ‘0’ as the value. The return value is a handle +to the message catalog, equivalent to handles to file returned by +‘open’. + + This handle is of course used in the ‘catgets’ function which can be +used like this: + + char *translation = catgets (catd, set_no, msg_id, "original string"); + + The first parameter is this catalog descriptor. The second parameter +specifies the set of messages in this catalog, in which the message +described by ‘msg_id’ is obtained. ‘catgets’ therefore uses a +three-stage addressing: + + catalog name ⇒ set number ⇒ message ID ⇒ translation + + The fourth argument is not used to address the translation. It is +given as a default value in case when one of the addressing stages fail. +One important thing to remember is that although the return type of +catgets is ‘char *’ the resulting string _must not_ be changed. It +should better be ‘const char *’, but the standard is published in 1988, +one year before ANSI C. + +The last of these functions is used and behaves as expected: + + catclose (catd); + + After this no ‘catgets’ call using the descriptor is legal anymore. + + +File: gettext.info, Node: Problems with catgets, Prev: Interface to catgets, Up: catgets + +11.1.2 Problems with the ‘catgets’ Interface?! +---------------------------------------------- + + Now that this description seemed to be really easy -- where are the +problems we speak of? In fact the interface could be used in a +reasonable way, but constructing the message catalogs is a pain. The +reason for this lies in the third argument of ‘catgets’: the unique +message ID. This has to be a numeric value for all messages in a single +set. Perhaps you could imagine the problems keeping such a list while +changing the source code. Add a new message here, remove one there. Of +course there have been developed a lot of tools helping to organize this +chaos but one as the other fails in one aspect or the other. We don't +want to say that the other approach has no problems but they are far +more easy to manage. + + +File: gettext.info, Node: gettext, Next: Comparison, Prev: catgets, Up: Programmers + +11.2 About ‘gettext’ +==================== + + The definition of the ‘gettext’ interface comes from a Uniforum +proposal. It was submitted there by Sun, who had implemented the +‘gettext’ function in SunOS 4, around 1990. Nowadays, the ‘gettext’ +interface is specified by the OpenI18N standard. + + The main point about this solution is that it does not follow the +method of normal file handling (open-use-close) and that it does not +burden the programmer with so many tasks, especially the unique key +handling. Of course here also a unique key is needed, but this key is +the message itself (how long or short it is). See *note Comparison:: +for a more detailed comparison of the two methods. + + The following section contains a rather detailed description of the +interface. We make it that detailed because this is the interface we +chose for the GNU ‘gettext’ Library. Programmers interested in using +this library will be interested in this description. + +* Menu: + +* Interface to gettext:: The interface +* Ambiguities:: Solving ambiguities +* Locating Catalogs:: Locating message catalog files +* Charset conversion:: How to request conversion to Unicode +* Contexts:: Solving ambiguities in GUI programs +* Plural forms:: Additional functions for handling plurals +* Optimized gettext:: Optimization of the *gettext functions + + +File: gettext.info, Node: Interface to gettext, Next: Ambiguities, Up: gettext + +11.2.1 The Interface +-------------------- + + The minimal functionality an interface must have is a) to select a +domain the strings are coming from (a single domain for all programs is +not reasonable because its construction and maintenance is difficult, +perhaps impossible) and b) to access a string in a selected domain. + + This is principally the description of the ‘gettext’ interface. It +has a global domain which unqualified usages reference. Of course this +domain is selectable by the user. + + char *textdomain (const char *domain_name); + + This provides the possibility to change or query the current status +of the current global domain of the ‘LC_MESSAGE’ category. The argument +is a null-terminated string, whose characters must be legal in the use +in filenames. If the DOMAIN_NAME argument is ‘NULL’, the function +returns the current value. If no value has been set before, the name of +the default domain is returned: _messages_. Please note that although +the return value of ‘textdomain’ is of type ‘char *’ no changing is +allowed. It is also important to know that no checks of the +availability are made. If the name is not available you will see this +by the fact that no translations are provided. + +To use a domain set by ‘textdomain’ the function + + char *gettext (const char *msgid); + +is to be used. This is the simplest reasonable form one can imagine. +The translation of the string MSGID is returned if it is available in +the current domain. If it is not available, the argument itself is +returned. If the argument is ‘NULL’ the result is undefined. + + One thing which should come into mind is that no explicit dependency +to the used domain is given. The current value of the domain is used. +If this changes between two executions of the same ‘gettext’ call in the +program, both calls reference a different message catalog. + + For the easiest case, which is normally used in internationalized +packages, once at the beginning of execution a call to ‘textdomain’ is +issued, setting the domain to a unique name, normally the package name. +In the following code all strings which have to be translated are +filtered through the gettext function. That's all, the package speaks +your language. + + +File: gettext.info, Node: Ambiguities, Next: Locating Catalogs, Prev: Interface to gettext, Up: gettext + +11.2.2 Solving Ambiguities +-------------------------- + + While this single name domain works well for most applications there +might be the need to get translations from more than one domain. Of +course one could switch between different domains with calls to +‘textdomain’, but this is really not convenient nor is it fast. A +possible situation could be one case subject to discussion during this +writing: all error messages of functions in the set of common used +functions should go into a separate domain ‘error’. By this mean we +would only need to translate them once. Another case are messages from +a library, as these _have_ to be independent of the current domain set +by the application. + +For this reasons there are two more functions to retrieve strings: + + char *dgettext (const char *domain_name, const char *msgid); + char *dcgettext (const char *domain_name, const char *msgid, + int category); + + Both take an additional argument at the first place, which +corresponds to the argument of ‘textdomain’. The third argument of +‘dcgettext’ allows to use another locale category but ‘LC_MESSAGES’. +But I really don't know where this can be useful. If the DOMAIN_NAME is +‘NULL’ or CATEGORY has an value beside the known ones, the result is +undefined. It should also be noted that this function is not part of +the second known implementation of this function family, the one found +in Solaris. + + A second ambiguity can arise by the fact, that perhaps more than one +domain has the same name. This can be solved by specifying where the +needed message catalog files can be found. + + char *bindtextdomain (const char *domain_name, + const char *dir_name); + + Calling this function binds the given domain to a file in the +specified directory (how this file is determined follows below). +Especially a file in the systems default place is not favored against +the specified file anymore (as it would be by solely using +‘textdomain’). A ‘NULL’ pointer for the DIR_NAME parameter returns the +binding associated with DOMAIN_NAME. If DOMAIN_NAME itself is ‘NULL’ +nothing happens and a ‘NULL’ pointer is returned. Here again as for all +the other functions is true that none of the return value must be +changed! + + It is important to remember that relative path names for the DIR_NAME +parameter can be trouble. Since the path is always computed relative to +the current directory different results will be achieved when the +program executes a ‘chdir’ command. Relative paths should always be +avoided to avoid dependencies and unreliabilities. + + wchar_t *wbindtextdomain (const char *domain_name, + const wchar_t *dir_name); + + This function is provided only on native Windows platforms. It is +like ‘bindtextdomain’, except that the DIR_NAME parameter is a wide +string (in UTF-16 encoding, as usual on Windows). + + +File: gettext.info, Node: Locating Catalogs, Next: Charset conversion, Prev: Ambiguities, Up: gettext + +11.2.3 Locating Message Catalog Files +------------------------------------- + + Because many different languages for many different packages have to +be stored we need some way to add these information to file message +catalog files. The way usually used in Unix environments is have this +encoding in the file name. This is also done here. The directory name +given in ‘bindtextdomain’s second argument (or the default directory), +followed by the name of the locale, the locale category, and the domain +name are concatenated: + + DIR_NAME/LOCALE/LC_CATEGORY/DOMAIN_NAME.mo + + The default value for DIR_NAME is system specific. For the GNU +library, and for packages adhering to its conventions, it's: + /usr/local/share/locale + +LOCALE is the name of the locale category which is designated by +‘LC_CATEGORY’. For ‘gettext’ and ‘dgettext’ this ‘LC_CATEGORY’ is +always ‘LC_MESSAGES’.(1) The name of the locale category is determined +through ‘setlocale (LC_CATEGORY, NULL)’. (2) When using the function +‘dcgettext’, you can specify the locale category through the third +argument. + + ---------- Footnotes ---------- + + (1) Some system, e.g. mingw, don't have ‘LC_MESSAGES’. Here we use a +more or less arbitrary value for it, namely 1729, the smallest positive +integer which can be represented in two different ways as the sum of two +cubes. + + (2) When the system does not support ‘setlocale’ its behavior in +setting the locale values is simulated by looking at the environment +variables. + + +File: gettext.info, Node: Charset conversion, Next: Contexts, Prev: Locating Catalogs, Up: gettext + +11.2.4 How to specify the output character set ‘gettext’ uses +------------------------------------------------------------- + + ‘gettext’ not only looks up a translation in a message catalog. It +also converts the translation on the fly to the desired output character +set. This is useful if the user is working in a different character set +than the translator who created the message catalog, because it avoids +distributing variants of message catalogs which differ only in the +character set. + + The output character set is, by default, the value of ‘nl_langinfo +(CODESET)’, which depends on the ‘LC_CTYPE’ part of the current locale. +But programs which store strings in a locale independent way (e.g. +UTF-8) can request that ‘gettext’ and related functions return the +translations in that encoding, by use of the ‘bind_textdomain_codeset’ +function. + + Note that the MSGID argument to ‘gettext’ is not subject to character +set conversion. Also, when ‘gettext’ does not find a translation for +MSGID, it returns MSGID unchanged - independently of the current output +character set. It is therefore recommended that all MSGIDs be US-ASCII +strings. + + -- Function: char * bind_textdomain_codeset (const char *DOMAINNAME, + const char *CODESET) + The ‘bind_textdomain_codeset’ function can be used to specify the + output character set for message catalogs for domain DOMAINNAME. + The CODESET argument must be a valid codeset name which can be used + for the ‘iconv_open’ function, or a null pointer. + + If the CODESET parameter is the null pointer, + ‘bind_textdomain_codeset’ returns the currently selected codeset + for the domain with the name DOMAINNAME. It returns ‘NULL’ if no + codeset has yet been selected. + + The ‘bind_textdomain_codeset’ function can be used several times. + If used multiple times with the same DOMAINNAME argument, the later + call overrides the settings made by the earlier one. + + The ‘bind_textdomain_codeset’ function returns a pointer to a + string containing the name of the selected codeset. The string is + allocated internally in the function and must not be changed by the + user. If the system went out of core during the execution of + ‘bind_textdomain_codeset’, the return value is ‘NULL’ and the + global variable ERRNO is set accordingly. + + +File: gettext.info, Node: Contexts, Next: Plural forms, Prev: Charset conversion, Up: gettext + +11.2.5 Using contexts for solving ambiguities +--------------------------------------------- + + One place where the ‘gettext’ functions, if used normally, have big +problems is within programs with graphical user interfaces (GUIs). The +problem is that many of the strings which have to be translated are very +short. They have to appear in pull-down menus which restricts the +length. But strings which are not containing entire sentences or at +least large fragments of a sentence may appear in more than one +situation in the program but might have different translations. This is +especially true for the one-word strings which are frequently used in +GUI programs. + + As a consequence many people say that the ‘gettext’ approach is wrong +and instead ‘catgets’ should be used which indeed does not have this +problem. But there is a very simple and powerful method to handle this +kind of problems with the ‘gettext’ functions. + + Contexts can be added to strings to be translated. A context +dependent translation lookup is when a translation for a given string is +searched, that is limited to a given context. The translation for the +same string in a different context can be different. The different +translations of the same string in different contexts can be stored in +the in the same MO file, and can be edited by the translator in the same +PO file. + + The ‘gettext.h’ include file contains the lookup macros for strings +with contexts. They are implemented as thin macros and inline functions +over the functions from ‘’. + + const char *pgettext (const char *msgctxt, const char *msgid); + + In a call of this macro, MSGCTXT and MSGID must be string literals. +The macro returns the translation of MSGID, restricted to the context +given by MSGCTXT. + + The MSGCTXT string is visible in the PO file to the translator. You +should try to make it somehow canonical and never changing. Because +every time you change an MSGCTXT, the translator will have to review the +translation of MSGID. + + Finding a canonical MSGCTXT string that doesn't change over time can +be hard. But you shouldn't use the file name or class name containing +the ‘pgettext’ call - because it is a common development task to rename +a file or a class, and it shouldn't cause translator work. Also you +shouldn't use a comment in the form of a complete English sentence as +MSGCTXT - because orthography or grammar changes are often applied to +such sentences, and again, it shouldn't force the translator to do a +review. + + The ‘p’ in ‘pgettext’ stands for "particular": ‘pgettext’ fetches a +particular translation of the MSGID. + + const char *dpgettext (const char *domain_name, + const char *msgctxt, const char *msgid); + const char *dcpgettext (const char *domain_name, + const char *msgctxt, const char *msgid, + int category); + + These are generalizations of ‘pgettext’. They behave similarly to +‘dgettext’ and ‘dcgettext’, respectively. The DOMAIN_NAME argument +defines the translation domain. The CATEGORY argument allows to use +another locale category than ‘LC_MESSAGES’. + + As as example consider the following fictional situation. A GUI +program has a menu bar with the following entries: + + +------------+------------+--------------------------------------+ + | File | Printer | | + +------------+------------+--------------------------------------+ + | Open | | Select | + | New | | Open | + +----------+ | Connect | + +----------+ + + To have the strings ‘File’, ‘Printer’, ‘Open’, ‘New’, ‘Select’, and +‘Connect’ translated there has to be at some point in the code a call to +a function of the ‘gettext’ family. But in two places the string passed +into the function would be ‘Open’. The translations might not be the +same and therefore we are in the dilemma described above. + + What distinguishes the two places is the menu path from the menu root +to the particular menu entries: + + Menu|File + Menu|Printer + Menu|File|Open + Menu|File|New + Menu|Printer|Select + Menu|Printer|Open + Menu|Printer|Connect + + The context is thus the menu path without its last part. So, the +calls look like this: + + pgettext ("Menu|", "File") + pgettext ("Menu|", "Printer") + pgettext ("Menu|File|", "Open") + pgettext ("Menu|File|", "New") + pgettext ("Menu|Printer|", "Select") + pgettext ("Menu|Printer|", "Open") + pgettext ("Menu|Printer|", "Connect") + + Whether or not to use the ‘|’ character at the end of the context is +a matter of style. + + For more complex cases, where the MSGCTXT or MSGID are not string +literals, more general macros are available: + + const char *pgettext_expr (const char *msgctxt, const char *msgid); + const char *dpgettext_expr (const char *domain_name, + const char *msgctxt, const char *msgid); + const char *dcpgettext_expr (const char *domain_name, + const char *msgctxt, const char *msgid, + int category); + + Here MSGCTXT and MSGID can be arbitrary string-valued expressions. +These macros are more general. But in the case that both argument +expressions are string literals, the macros without the ‘_expr’ suffix +are more efficient. + + +File: gettext.info, Node: Plural forms, Next: Optimized gettext, Prev: Contexts, Up: gettext + +11.2.6 Additional functions for plural forms +-------------------------------------------- + + The functions of the ‘gettext’ family described so far (and all the +‘catgets’ functions as well) have one problem in the real world which +have been neglected completely in all existing approaches. What is +meant here is the handling of plural forms. + + Looking through Unix source code before the time anybody thought +about internationalization (and, sadly, even afterwards) one can often +find code similar to the following: + + printf ("%d file%s deleted", n, n == 1 ? "" : "s"); + +After the first complaints from people internationalizing the code +people either completely avoided formulations like this or used strings +like ‘"file(s)"’. Both look unnatural and should be avoided. First +tries to solve the problem correctly looked like this: + + if (n == 1) + printf ("%d file deleted", n); + else + printf ("%d files deleted", n); + + But this does not solve the problem. It helps languages where the +plural form of a noun is not simply constructed by adding an 's' but +that is all. Once again people fell into the trap of believing the +rules their language is using are universal. But the handling of plural +forms differs widely between the language families. For example, Rafal +Maszkowski ‘’ reports: + + In Polish we use e.g. plik (file) this way: + 1 plik + 2,3,4 pliki + 5-21 pliko'w + 22-24 pliki + 25-31 pliko'w + and so on (o' means 8859-2 oacute which should be rather okreska, + similar to aogonek). + + There are two things which can differ between languages (and even +inside language families); + + • The form how plural forms are built differs. This is a problem + with languages which have many irregularities. German, for + instance, is a drastic case. Though English and German are part of + the same language family (Germanic), the almost regular forming of + plural noun forms (appending an 's') is hardly found in German. + + • The number of plural forms differ. This is somewhat surprising for + those who only have experiences with Romanic and Germanic languages + since here the number is the same (there are two). + + But other language families have only one form or many forms. More + information on this in an extra section. + + The consequence of this is that application writers should not try to +solve the problem in their code. This would be localization since it is +only usable for certain, hardcoded language environments. Instead the +extended ‘gettext’ interface should be used. + + These extra functions are taking instead of the one key string two +strings and a numerical argument. The idea behind this is that using +the numerical argument and the first string as a key, the implementation +can select using rules specified by the translator the right plural +form. The two string arguments then will be used to provide a return +value in case no message catalog is found (similar to the normal +‘gettext’ behavior). In this case the rules for Germanic language is +used and it is assumed that the first string argument is the singular +form, the second the plural form. + + This has the consequence that programs without language catalogs can +display the correct strings only if the program itself is written using +a Germanic language. This is a limitation but since the GNU C library +(as well as the GNU ‘gettext’ package) are written as part of the GNU +package and the coding standards for the GNU project require program +being written in English, this solution nevertheless fulfills its +purpose. + + -- Function: char * ngettext (const char *MSGID1, const char *MSGID2, + unsigned long int N) + The ‘ngettext’ function is similar to the ‘gettext’ function as it + finds the message catalogs in the same way. But it takes two extra + arguments. The MSGID1 parameter must contain the singular form of + the string to be converted. It is also used as the key for the + search in the catalog. The MSGID2 parameter is the plural form. + The parameter N is used to determine the plural form. If no + message catalog is found MSGID1 is returned if ‘n == 1’, otherwise + ‘msgid2’. + + An example for the use of this function is: + + printf (ngettext ("%d file removed", "%d files removed", n), n); + + Please note that the numeric value N has to be passed to the + ‘printf’ function as well. It is not sufficient to pass it only to + ‘ngettext’. + + In the English singular case, the number - always 1 - can be + replaced with "one": + + printf (ngettext ("One file removed", "%d files removed", n), n); + + This works because the ‘printf’ function discards excess arguments + that are not consumed by the format string. + + If this function is meant to yield a format string that takes two + or more arguments, you can not use it like this: + + printf (ngettext ("%d file removed from directory %s", + "%d files removed from directory %s", + n), + n, dir); + + because in many languages the translators want to replace the ‘%d’ + with an explicit word in the singular case, just like "one" in + English, and C format strings cannot consume the second argument + but skip the first argument. Instead, you have to reorder the + arguments so that ‘n’ comes last: + + printf (ngettext ("%2$d file removed from directory %1$s", + "%2$d files removed from directory %1$s", + n), + dir, n); + + See *note c-format:: for details about this argument reordering + syntax. + + When you know that the value of ‘n’ is within a given range, you + can specify it as a comment directed to the ‘xgettext’ tool. This + information may help translators to use more adequate translations. + Like this: + + if (days > 7 && days < 14) + /* xgettext: range: 1..6 */ + printf (ngettext ("one week and one day", "one week and %d days", + days - 7), + days - 7); + + There is one case where using ‘ngettext’ is *not* appropriate, + however: namely, when neither of the two strings contains a + cardinal number. Consider the following example: + + puts (ngettext ("Delete the selected file?", + "Delete the selected files?", + n)); + The Russian language translator would need to provide separate + translations for the following count forms: + • 1, 21, 31, 41, 51, 61, 71, 81, 91... + • 2-4, 22-24, 32-34, 42-44... + • 5-20, 25-30, 35-40... + As you can see, the case ‘n == 1’ cannot be expressed with the + Russian plural forms. Instead, in this case, you need to use + separate calls to ‘gettext’: + puts (n == 1 ? gettext ("Delete the selected file?") + : gettext ("Delete the selected files?")); + The translator will then use the right grammar constructs for + singular and plural _without_ a number. + + -- Function: char * dngettext (const char *DOMAIN, const char *MSGID1, + const char *MSGID2, unsigned long int N) + The ‘dngettext’ is similar to the ‘dgettext’ function in the way + the message catalog is selected. The difference is that it takes + two extra parameter to provide the correct plural form. These two + parameters are handled in the same way ‘ngettext’ handles them. + + -- Function: char * dcngettext (const char *DOMAIN, const char *MSGID1, + const char *MSGID2, unsigned long int N, int CATEGORY) + The ‘dcngettext’ is similar to the ‘dcgettext’ function in the way + the message catalog is selected. The difference is that it takes + two extra parameter to provide the correct plural form. These two + parameters are handled in the same way ‘ngettext’ handles them. + + Now, how do these functions solve the problem of the plural forms? +Without the input of linguists (which was not available) it was not +possible to determine whether there are only a few different forms in +which plural forms are formed or whether the number can increase with +every new supported language. + + Therefore the solution implemented is to allow the translator to +specify the rules of how to select the plural form. Since the formula +varies with every language this is the only viable solution except for +hardcoding the information in the code (which still would require the +possibility of extensions to not prevent the use of new languages). + + The information about the plural form selection has to be stored in +the header entry of the PO file (the one with the empty ‘msgid’ string). +The plural form information looks like this: + + Plural-Forms: nplurals=2; plural=n == 1 ? 0 : 1; + + The ‘nplurals’ value must be a decimal number which specifies how +many different plural forms exist for this language. The string +following ‘plural’ is an expression which is using the C language +syntax. Exceptions are that no negative numbers are allowed, numbers +must be decimal, and the only variable allowed is ‘n’. Spaces are +allowed in the expression, but backslash-newlines are not; in the +examples below the backslash-newlines are present for formatting +purposes only. This expression will be evaluated whenever one of the +functions ‘ngettext’, ‘dngettext’, or ‘dcngettext’ is called. The +numeric value passed to these functions is then substituted for all uses +of the variable ‘n’ in the expression. The resulting value then must be +greater or equal to zero and smaller than the value given as the value +of ‘nplurals’. + +The following rules are known at this point. The language with families +are listed. But this does not necessarily mean the information can be +generalized for the whole family (as can be easily seen in the table +below).(1) + +Only one form: + Some languages only require one single form. There is no + distinction between the singular and plural form. An appropriate + header entry would look like this: + + Plural-Forms: nplurals=1; plural=0; + + Languages with this property include: + + Asian family + Japanese, Vietnamese, Korean + Tai-Kadai family + Thai + +Two forms, singular used for one only + This is the form used in most existing programs since it is what + English is using. A header entry would look like this: + + Plural-Forms: nplurals=2; plural=n != 1; + + (Note: this uses the feature of C expressions that boolean + expressions have to value zero or one.) + + Languages with this property include: + + Germanic family + English, German, Dutch, Swedish, Danish, Norwegian, Faroese + Romanic family + Spanish, Portuguese, Italian + Latin/Greek family + Greek + Slavic family + Bulgarian + Finno-Ugric family + Finnish, Estonian + Semitic family + Hebrew + Austronesian family + Bahasa Indonesian + Artificial + Esperanto + + Other languages using the same header entry are: + + Finno-Ugric family + Hungarian + Turkic/Altaic family + Turkish + + Hungarian does not appear to have a plural if you look at sentences + involving cardinal numbers. For example, "1 apple" is "1 alma", + and "123 apples" is "123 alma". But when the number is not + explicit, the distinction between singular and plural exists: "the + apple" is "az alma", and "the apples" is "az almák". Since + ‘ngettext’ has to support both types of sentences, it is classified + here, under "two forms". + + The same holds for Turkish: "1 apple" is "1 elma", and "123 apples" + is "123 elma". But when the number is omitted, the distinction + between singular and plural exists: "the apple" is "elma", and "the + apples" is "elmalar". + +Two forms, singular used for zero and one + Exceptional case in the language family. The header entry would + be: + + Plural-Forms: nplurals=2; plural=n>1; + + Languages with this property include: + + Romanic family + Brazilian Portuguese, French + +Three forms, special case for zero + The header entry would be: + + Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2; + + Languages with this property include: + + Baltic family + Latvian + +Three forms, special cases for one and two + The header entry would be: + + Plural-Forms: nplurals=3; plural=n==1 ? 0 : n==2 ? 1 : 2; + + Languages with this property include: + + Celtic + Gaeilge (Irish) + +Three forms, special case for numbers ending in 00 or [2-9][0-9] + The header entry would be: + + Plural-Forms: nplurals=3; \ + plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2; + + Languages with this property include: + + Romanic family + Romanian + +Three forms, special case for numbers ending in 1[2-9] + The header entry would look like this: + + Plural-Forms: nplurals=3; \ + plural=n%10==1 && n%100!=11 ? 0 : \ + n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2; + + Languages with this property include: + + Baltic family + Lithuanian + +Three forms, special cases for numbers ending in 1 and 2, 3, 4, except those ending in 1[1-4] + The header entry would look like this: + + Plural-Forms: nplurals=3; \ + plural=n%10==1 && n%100!=11 ? 0 : \ + n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2; + + Languages with this property include: + + Slavic family + Russian, Ukrainian, Belarusian, Serbian, Croatian + +Three forms, special cases for 1 and 2, 3, 4 + The header entry would look like this: + + Plural-Forms: nplurals=3; \ + plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2; + + Languages with this property include: + + Slavic family + Czech, Slovak + +Three forms, special case for one and some numbers ending in 2, 3, or 4 + The header entry would look like this: + + Plural-Forms: nplurals=3; \ + plural=n==1 ? 0 : \ + n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2; + + Languages with this property include: + + Slavic family + Polish + +Four forms, special case for one and all numbers ending in 02, 03, or 04 + The header entry would look like this: + + Plural-Forms: nplurals=4; \ + plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3; + + Languages with this property include: + + Slavic family + Slovenian + +Six forms, special cases for one, two, all numbers ending in 02, 03, ... 10, all numbers ending in 11 ... 99, and others + The header entry would look like this: + + Plural-Forms: nplurals=6; \ + plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 \ + : n%100>=11 ? 4 : 5; + + Languages with this property include: + + Afroasiatic family + Arabic + + You might now ask, ‘ngettext’ handles only numbers N of type +‘unsigned long’. What about larger integer types? What about negative +numbers? What about floating-point numbers? + + About larger integer types, such as ‘uintmax_t’ or ‘unsigned long +long’: they can be handled by reducing the value to a range that fits in +an ‘unsigned long’. Simply casting the value to ‘unsigned long’ would +not do the right thing, since it would treat ‘ULONG_MAX + 1’ like zero, +‘ULONG_MAX + 2’ like singular, and the like. Here you can exploit the +fact that all mentioned plural form formulas eventually become periodic, +with a period that is a divisor of 100 (or 1000 or 1000000). So, when +you reduce a large value to another one in the range [1000000, 1999999] +that ends in the same 6 decimal digits, you can assume that it will lead +to the same plural form selection. This code does this: + + #include + uintmax_t nbytes = ...; + printf (ngettext ("The file has %"PRIuMAX" byte.", + "The file has %"PRIuMAX" bytes.", + (nbytes > ULONG_MAX + ? (nbytes % 1000000) + 1000000 + : nbytes)), + nbytes); + + Negative and floating-point values usually represent physical +entities for which singular and plural don't clearly apply. In such +cases, there is no need to use ‘ngettext’; a simple ‘gettext’ call with +a form suitable for all values will do. For example: + + printf (gettext ("Time elapsed: %.3f seconds"), + num_milliseconds * 0.001); + +Even if NUM_MILLISECONDS happens to be a multiple of 1000, the output + Time elapsed: 1.000 seconds +is acceptable in English, and similarly for other languages. + + The translators' perspective regarding plural forms is explained in +*note Translating plural forms::. + + ---------- Footnotes ---------- + + (1) Additions are welcome. Send appropriate information to + and . The Unicode CLDR +Project () provides a comprehensive set of +plural forms in a different format. The ‘msginit’ program has +preliminary support for the format so you can use it as a baseline +(*note msginit Invocation::). + + +File: gettext.info, Node: Optimized gettext, Prev: Plural forms, Up: gettext + +11.2.7 Optimization of the *gettext functions +--------------------------------------------- + + At this point of the discussion we should talk about an advantage of +the GNU ‘gettext’ implementation. Some readers might have pointed out +that an internationalized program might have a poor performance if some +string has to be translated in an inner loop. While this is unavoidable +when the string varies from one run of the loop to the other it is +simply a waste of time when the string is always the same. Take the +following example: + + { + while (...) + { + puts (gettext ("Hello world")); + } + } + +When the locale selection does not change between two runs the resulting +string is always the same. One way to use this is: + + { + str = gettext ("Hello world"); + while (...) + { + puts (str); + } + } + +But this solution is not usable in all situation (e.g. when the locale +selection changes) nor does it lead to legible code. + + For this reason, GNU ‘gettext’ caches previous translation results. +When the same translation is requested twice, with no new message +catalogs being loaded in between, ‘gettext’ will, the second time, find +the result through a single cache lookup. + + +File: gettext.info, Node: Comparison, Next: Using libintl.a, Prev: gettext, Up: Programmers + +11.3 Comparing the Two Interfaces +================================= + + The following discussion is perhaps a little bit colored. As said +above we implemented GNU ‘gettext’ following the Uniforum proposal and +this surely has its reasons. But it should show how we came to this +decision. + + First we take a look at the developing process. When we write an +application using NLS provided by ‘gettext’ we proceed as always. Only +when we come to a string which might be seen by the users and thus has +to be translated we use ‘gettext("...")’ instead of ‘"..."’. At the +beginning of each source file (or in a central header file) we define + + #define gettext(String) (String) + + Even this definition can be avoided when the system supports the +‘gettext’ function in its C library. When we compile this code the +result is the same as if no NLS code is used. When you take a look at +the GNU ‘gettext’ code you will see that we use ‘_("...")’ instead of +‘gettext("...")’. This reduces the number of additional characters per +translatable string to _3_ (in words: three). + + When now a production version of the program is needed we simply +replace the definition + + #define _(String) (String) + +by + + #include + #define _(String) gettext (String) + +Additionally we run the program ‘xgettext’ on all source code file which +contain translatable strings and that's it: we have a running program +which does not depend on translations to be available, but which can use +any that becomes available. + + The same procedure can be done for the ‘gettext_noop’ invocations +(*note Special cases::). One usually defines ‘gettext_noop’ as a no-op +macro. So you should consider the following code for your project: + + #define gettext_noop(String) String + #define N_(String) gettext_noop (String) + + ‘N_’ is a short form similar to ‘_’. The ‘Makefile’ in the ‘po/’ +directory of GNU ‘gettext’ knows by default both of the mentioned short +forms so you are invited to follow this proposal for your own ease. + + Now to ‘catgets’. The main problem is the work for the programmer. +Every time he comes to a translatable string he has to define a number +(or a symbolic constant) which has also be defined in the message +catalog file. He also has to take care for duplicate entries, duplicate +message IDs etc. If he wants to have the same quality in the message +catalog as the GNU ‘gettext’ program provides he also has to put the +descriptive comments for the strings and the location in all source code +files in the message catalog. This is nearly a Mission: Impossible. + + But there are also some points people might call advantages speaking +for ‘catgets’. If you have a single word in a string and this string is +used in different contexts it is likely that in one or the other +language the word has different translations. Example: + + printf ("%s: %d", gettext ("number"), number_of_errors) + + printf ("you should see %d %s", number_count, + number_count == 1 ? gettext ("number") : gettext ("numbers")) + + Here we have to translate two times the string ‘"number"’. Even if +you do not speak a language beside English it might be possible to +recognize that the two words have a different meaning. In German the +first appearance has to be translated to ‘"Anzahl"’ and the second to +‘"Zahl"’. + + Now you can say that this example is really esoteric. And you are +right! This is exactly how we felt about this problem and decide that +it does not weight that much. The solution for the above problem could +be very easy: + + printf ("%s %d", gettext ("number:"), number_of_errors) + + printf (number_count == 1 ? gettext ("you should see %d number") + : gettext ("you should see %d numbers"), + number_count) + + We believe that we can solve all conflicts with this method. If it +is difficult one can also consider changing one of the conflicting +string a little bit. But it is not impossible to overcome. + + ‘catgets’ allows same original entry to have different translations, +but ‘gettext’ has another, scalable approach for solving ambiguities of +this kind: *Note Ambiguities::. + + +File: gettext.info, Node: Using libintl.a, Next: gettext grok, Prev: Comparison, Up: Programmers + +11.4 Using libintl.a in own programs +==================================== + + Starting with version 0.9.4 the library ‘libintl.h’ should be +self-contained. I.e., you can use it in your own programs without +providing additional functions. The ‘Makefile’ will put the header and +the library in directories selected using the ‘$(prefix)’. + + +File: gettext.info, Node: gettext grok, Next: Temp Programmers, Prev: Using libintl.a, Up: Programmers + +11.5 Being a ‘gettext’ grok +=========================== + + * NOTE: * This documentation section is outdated and needs to be +revised. + + To fully exploit the functionality of the GNU ‘gettext’ library it is +surely helpful to read the source code. But for those who don't want to +spend that much time in reading the (sometimes complicated) code here is +a list comments: + + • Changing the language at runtime + + For interactive programs it might be useful to offer a selection of + the used language at runtime. To understand how to do this one + need to know how the used language is determined while executing + the ‘gettext’ function. The method which is presented here only + works correctly with the GNU implementation of the ‘gettext’ + functions. + + In the function ‘dcgettext’ at every call the current setting of + the highest priority environment variable is determined and used. + Highest priority means here the following list with decreasing + priority: + + 1. ‘LANGUAGE’ + 2. ‘LC_ALL’ + 3. ‘LC_xxx’, according to selected locale category + 4. ‘LANG’ + + Afterwards the path is constructed using the found value and the + translation file is loaded if available. + + What happens now when the value for, say, ‘LANGUAGE’ changes? + According to the process explained above the new value of this + variable is found as soon as the ‘dcgettext’ function is called. + But this also means the (perhaps) different message catalog file is + loaded. In other words: the used language is changed. + + But there is one little hook. The code for gcc-2.7.0 and up + provides some optimization. This optimization normally prevents + the calling of the ‘dcgettext’ function as long as no new catalog + is loaded. But if ‘dcgettext’ is not called the program also + cannot find the ‘LANGUAGE’ variable be changed (*note Optimized + gettext::). A solution for this is very easy. Include the + following code in the language switching function. + + /* Change language. */ + setenv ("LANGUAGE", "fr", 1); + + /* Make change known. */ + { + extern int _nl_msg_cat_cntr; + ++_nl_msg_cat_cntr; + } + + The variable ‘_nl_msg_cat_cntr’ is defined in ‘loadmsgcat.c’. You + don't need to know what this is for. But it can be used to detect + whether a ‘gettext’ implementation is GNU gettext and not non-GNU + system's native gettext implementation. + + +File: gettext.info, Node: Temp Programmers, Prev: gettext grok, Up: Programmers + +11.6 Temporary Notes for the Programmers Chapter +================================================ + + * NOTE: * This documentation section is outdated and needs to be +revised. + +* Menu: + +* Temp Implementations:: Temporary - Two Possible Implementations +* Temp catgets:: Temporary - About ‘catgets’ +* Temp WSI:: Temporary - Why a single implementation +* Temp Notes:: Temporary - Notes + + +File: gettext.info, Node: Temp Implementations, Next: Temp catgets, Up: Temp Programmers + +11.6.1 Temporary - Two Possible Implementations +----------------------------------------------- + + There are two competing methods for language independent messages: +the X/Open ‘catgets’ method, and the Uniforum ‘gettext’ method. The +‘catgets’ method indexes messages by integers; the ‘gettext’ method +indexes them by their English translations. The ‘catgets’ method has +been around longer and is supported by more vendors. The ‘gettext’ +method is supported by Sun, and it has been heard that the COSE +multi-vendor initiative is supporting it. Neither method is a POSIX +standard; the POSIX.1 committee had a lot of disagreement in this area. + + Neither one is in the POSIX standard. There was much disagreement in +the POSIX.1 committee about using the ‘gettext’ routines vs. ‘catgets’ +(XPG). In the end the committee couldn't agree on anything, so no +messaging system was included as part of the standard. I believe the +informative annex of the standard includes the XPG3 messaging +interfaces, "...as an example of a messaging system that has been +implemented..." + + They were very careful not to say anywhere that you should use one +set of interfaces over the other. For more on this topic please see the +Programming for Internationalization FAQ. + + +File: gettext.info, Node: Temp catgets, Next: Temp WSI, Prev: Temp Implementations, Up: Temp Programmers + +11.6.2 Temporary - About ‘catgets’ +---------------------------------- + + There have been a few discussions of late on the use of ‘catgets’ as +a base. I think it important to present both sides of the argument and +hence am opting to play devil's advocate for a little bit. + + I'll not deny the fact that ‘catgets’ could have been designed a lot +better. It currently has quite a number of limitations and these have +already been pointed out. + + However there is a great deal to be said for consistency and +standardization. A common recurring problem when writing Unix software +is the myriad portability problems across Unix platforms. It seems as +if every Unix vendor had a look at the operating system and found parts +they could improve upon. Undoubtedly, these modifications are probably +innovative and solve real problems. However, software developers have a +hard time keeping up with all these changes across so many platforms. + + And this has prompted the Unix vendors to begin to standardize their +systems. Hence the impetus for Spec1170. Every major Unix vendor has +committed to supporting this standard and every Unix software developer +waits with glee the day they can write software to this standard and +simply recompile (without having to use autoconf) across different +platforms. + + As I understand it, Spec1170 is roughly based upon version 4 of the +X/Open Portability Guidelines (XPG4). Because ‘catgets’ and friends are +defined in XPG4, I'm led to believe that ‘catgets’ is a part of Spec1170 +and hence will become a standardized component of all Unix systems. + + +File: gettext.info, Node: Temp WSI, Next: Temp Notes, Prev: Temp catgets, Up: Temp Programmers + +11.6.3 Temporary - Why a single implementation +---------------------------------------------- + + Now it seems kind of wasteful to me to have two different systems +installed for accessing message catalogs. If we do want to remedy +‘catgets’ deficiencies why don't we try to expand ‘catgets’ (in a +compatible manner) rather than implement an entirely new system. +Otherwise, we'll end up with two message catalog access systems +installed with an operating system - one set of routines for packages +using GNU ‘gettext’ for their internationalization, and another set of +routines (catgets) for all other software. Bloated? + + Supposing another catalog access system is implemented. Which do we +recommend? At least for Linux, we need to attract as many software +developers as possible. Hence we need to make it as easy for them to +port their software as possible. Which means supporting ‘catgets’. We +will be implementing the ‘libintl’ code within our ‘libc’, but does this +mean we also have to incorporate another message catalog access scheme +within our ‘libc’ as well? And what about people who are going to be +using the ‘libintl’ + non-‘catgets’ routines. When they port their +software to other platforms, they're now going to have to include the +front-end (‘libintl’) code plus the back-end code (the non-‘catgets’ +access routines) with their software instead of just including the +‘libintl’ code with their software. + + Message catalog support is however only the tip of the iceberg. What +about the data for the other locale categories? They also have a number +of deficiencies. Are we going to abandon them as well and develop +another duplicate set of routines (should ‘libintl’ expand beyond +message catalog support)? + + Like many parts of Unix that can be improved upon, we're stuck with +balancing compatibility with the past with useful improvements and +innovations for the future. + + +File: gettext.info, Node: Temp Notes, Prev: Temp WSI, Up: Temp Programmers + +11.6.4 Temporary - Notes +------------------------ + + X/Open agreed very late on the standard form so that many +implementations differ from the final form. Both of my system (old +Linux catgets and Ultrix-4) have a strange variation. + + OK. After incorporating the last changes I have to spend some time on +making the GNU/Linux ‘libc’ ‘gettext’ functions. So in future Solaris +is not the only system having ‘gettext’. + + +File: gettext.info, Node: Translators, Next: Maintainers, Prev: Programmers, Up: Top + +12 The Translator's View +************************ + +* Menu: + +* Organization:: Organization +* Responsibilities:: Responsibilities in the Translation Project +* Dialects:: Language dialects +* Translating plural forms:: How to fill in ‘msgstr[0]’, ‘msgstr[1]’ +* Prioritizing messages:: How to find which messages to translate first + + +File: gettext.info, Node: Organization, Next: Responsibilities, Up: Translators + +12.1 Organization +================= + + For some software packages, each translator works on her own and +communicates directly with the developers of the package. For some +other software packages, on the other hand, translators are organized +into _translation projects_ and _translation teams_. + + A _translation project_ applies to a group of software packages and +shares procedures and methodologies regarding the translation. + + There are currently three major translation projects: + + • The "Translation Project", which is used by all kinds of Free + Software packages, but in particular by GNU packages. It has its + home at . + + • The "KDE Localization Project", which is used by KDE packages. It + is at . + + • The "GNOME Localization Project", which is used by GNOME packages. + It is at . + + A _translation team_ is a group of translators for a single language, +in the scope of a translation project. + + +File: gettext.info, Node: Responsibilities, Next: Dialects, Prev: Organization, Up: Translators + +12.2 Responsibilities in the Translation Project +================================================ + + The following rules and habits apply to the Translation Project. + + The translator's responsibilities are: + • She submits a translations disclaimer to the Free Software + Foundation (once only, and only when she wants to translate a + package that requires a disclaimer). + + A disclaimer is a legal document that allows the software package + to distribute her translation work. It is not as strong as a + copyright assignment. Merely, it says that the signer will never + make use of the copyright on her translations: will never forbid + copying them, and will never ask for some kind of compensation. + This guarantees that the FSF (and everyone else) will always be + allowed to freely distribute these translations. The FSF wishes to + have this guarantee in a legally binding manner, to be on the safe + side. + + There are two ways to submit the disclaimer: Either online through + this form on the FSF's web site, or by printing, signing, and + submitting the file ‘disclaim-translations.txt’ found in the GNU + gettext distribution. + + • Agree with the other translators of the same team who is "in + charge" for the translations of a particular package. + + The Translation Project has a coordinator. He can be reached at +‘coordinator@translationproject.org’. His responsibilities are: + • He maintains the web site . + • When he receives a release or prerelease announcement from one of + the software package maintainers, he extracts the POT file(s) and + sends notifications to all translation teams about it. + + The responsibilities of the package maintainers are: + • To incorporate the translations in the software package before a + release. + • To forward bug reports about the translations to the respective + translation team. A developer or maintainer should never apply a + translation fix himself, because that would cause conflicts with + the translation team. + + +File: gettext.info, Node: Dialects, Next: Translating plural forms, Prev: Responsibilities, Up: Translators + +12.3 Language dialects +====================== + + For many languages, a translation into the main dialect is +intelligible by all speakers of the language. Speakers of another +dialect can have a separate translation if they wish so. In fact, since +the fallback mechanism implemented in GNU libc and GNU libintl applies +on a per-message basis, the message catalog for the dialect needs only +to contain the translations that differ from those in the main language. + + For example, French speakers in Canada (that is, users in the locale +‘fr_CA’) can use and do accept translations produced by French speakers +in France (typical file name: ‘fr.po’). Nevertheless, the translation +system with PO files enables them to produce special message catalogs +(file name: ‘fr_CA.po’) that will take priority over ‘fr.po’ for users +in that locale. Similarly for users in Austria, where message catalogs +‘de_AT.po’ take priority over the catalogs named ‘de.po’ that reflect +German as spoken in Germany. + + The situation is different for Chinese, though: Since users in the +People's Republic of China and in Singapore want translations with +Simplified Chinese characters, whereas Chinese users in other +territories (such as Taiwan, Hong Kong, and Macao) want translations +with Traditional Chinese characters, no translator should ever submit a +file named ‘zh.po’. Instead, there will typically be two separate +translation teams: a team that produces translations with Simplified +Chinese characters (file name ‘zh_CN.po’) and a team that produces +translations with Traditional Chinese characters (file name ‘zh_TW.po’). + + +File: gettext.info, Node: Translating plural forms, Next: Prioritizing messages, Prev: Dialects, Up: Translators + +12.4 Translating plural forms +============================= + + Suppose you are translating a PO file, and it contains an entry like +this: + + #, c-format + msgid "One file removed" + msgid_plural "%d files removed" + msgstr[0] "" + msgstr[1] "" + +What does this mean? How do you fill it in? + + Such an entry denotes a message with plural forms, that is, a message +where the text depends on a cardinal number. The general form of the +message, in English, is the ‘msgid_plural’ line. The ‘msgid’ line is +the English singular form, that is, the form for when the number is +equal to 1. More details about plural forms are explained in *note +Plural forms::. + + The first thing you need to look at is the ‘Plural-Forms’ line in the +header entry of the PO file. It contains the number of plural forms and +a formula. If the PO file does not yet have such a line, you have to +add it. It only depends on the language into which you are translating. +You can get this info by using the ‘msginit’ command (see *note +Creating::) - it contains a database of known plural formulas - or by +asking other members of your translation team. + + Suppose the line looks as follows: + + "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" + "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + + It's logically one line; recall that the PO file formatting is +allowed to break long lines so that each physical line fits in 80 +monospaced columns. + + The value of ‘nplurals’ here tells you that there are three plural +forms. The first thing you need to do is to ensure that the entry +contains an ‘msgstr’ line for each of the forms: + + #, c-format + msgid "One file removed" + msgid_plural "%d files removed" + msgstr[0] "" + msgstr[1] "" + msgstr[2] "" + + Then translate the ‘msgid_plural’ line and fill it in into each +‘msgstr’ line: + + #, c-format + msgid "One file removed" + msgid_plural "%d files removed" + msgstr[0] "%d slika uklonjenih" + msgstr[1] "%d slika uklonjenih" + msgstr[2] "%d slika uklonjenih" + + Now you can refine the translation so that it matches the plural +form. According to the formula above, ‘msgstr[0]’ is used when the +number ends in 1 but does not end in 11; ‘msgstr[1]’ is used when the +number ends in 2, 3, 4, but not in 12, 13, 14; and ‘msgstr[2]’ is used +in all other cases. With this knowledge, you can refine the +translations: + + #, c-format + msgid "One file removed" + msgid_plural "%d files removed" + msgstr[0] "%d slika je uklonjena" + msgstr[1] "%d datoteke uklonjenih" + msgstr[2] "%d slika uklonjenih" + + You noticed that in the English singular form (‘msgid’) the number +placeholder could be omitted and replaced by the numeral word "one". +Can you do this in your translation as well? + + msgstr[0] "jednom datotekom je uklonjen" + +Well, it depends on whether ‘msgstr[0]’ applies only to the number 1, or +to other numbers as well. If, according to the plural formula, +‘msgstr[0]’ applies only to ‘n == 1’, then you can use the specialized +translation without the number placeholder. In our case, however, +‘msgstr[0]’ also applies to the numbers 21, 31, 41, etc., and therefore +you cannot omit the placeholder. + + +File: gettext.info, Node: Prioritizing messages, Prev: Translating plural forms, Up: Translators + +12.5 Prioritizing messages: How to determine which messages to translate first +============================================================================== + + A translator sometimes has only a limited amount of time per week to +spend on a package, and some packages have quite large message catalogs +(over 1000 messages). Therefore she wishes to translate the messages +first that are the most visible to the user, or that occur most +frequently. This section describes how to determine these "most urgent" +messages. It also applies to determine the "next most urgent" messages +after the message catalog has already been partially translated. + + In a first step, she uses the programs like a user would do. While +she does this, the GNU ‘gettext’ library logs into a file the not yet +translated messages for which a translation was requested from the +program. + + In a second step, she uses the PO mode to translate precisely this +set of messages. + + Here are more details. The GNU ‘libintl’ library (but not the +corresponding functions in GNU ‘libc’) supports an environment variable +‘GETTEXT_LOG_UNTRANSLATED’. The GNU ‘libintl’ library will log into +this file the messages for which ‘gettext()’ and related functions +couldn't find the translation. If the file doesn't exist, it will be +created as needed. On systems with GNU ‘libc’ a shared library +‘preloadable_libintl.so’ is provided that can be used with the ELF +‘LD_PRELOAD’ mechanism. + + So, in the first step, the translator uses these commands on systems +with GNU ‘libc’: + + $ LD_PRELOAD=/usr/local/lib/preloadable_libintl.so + $ export LD_PRELOAD + $ GETTEXT_LOG_UNTRANSLATED=$HOME/gettextlogused + $ export GETTEXT_LOG_UNTRANSLATED + +and these commands on other systems: + + $ GETTEXT_LOG_UNTRANSLATED=$HOME/gettextlogused + $ export GETTEXT_LOG_UNTRANSLATED + + Then she uses and peruses the programs. (It is a good and +recommended practice to use the programs for which you provide +translations: it gives you the needed context.) When done, she removes +the environment variables: + + $ unset LD_PRELOAD + $ unset GETTEXT_LOG_UNTRANSLATED + + The second step starts with removing duplicates: + + $ msguniq $HOME/gettextlogused > missing.po + + The result is a PO file, but needs some preprocessing before a PO +file editor can be used with it. First, it is a multi-domain PO file, +containing messages from many translation domains. Second, it lacks all +translator comments and source references. Here is how to get a list of +the affected translation domains: + + $ sed -n -e 's,^domain "\(.*\)"$,\1,p' < missing.po | sort | uniq + + Then the translator can handle the domains one by one. For +simplicity, let's use environment variables to denote the language, +domain and source package. + + $ lang=nl # your language + $ domain=coreutils # the name of the domain to be handled + $ package=/usr/src/gnu/coreutils-4.5.4 # the package where it comes from + + She takes the latest copy of ‘$lang.po’ from the Translation Project, +or from the package (in most cases, ‘$package/po/$lang.po’), or creates +a fresh one if she's the first translator (see *note Creating::). She +then uses the following commands to mark the not urgent messages as +"obsolete". (This doesn't mean that these messages - translated and +untranslated ones - will go away. It simply means that the PO file +editor will ignore them in the following editing session.) + + $ msggrep --domain=$domain missing.po | grep -v '^domain' \ + > $domain-missing.po + $ msgattrib --set-obsolete --ignore-file $domain-missing.po $domain.$lang.po \ + > $domain.$lang-urgent.po + + Then she translates ‘$domain.$lang-urgent.po’ by use of a PO file +editor (*note Editing::). (FIXME: I don't know whether ‘Lokalize’ and +‘gtranslator’ also preserve obsolete messages, as they should.) Finally +she restores the not urgent messages (with their earlier translations, +for those which were already translated) through this command: + + $ msgmerge --no-fuzzy-matching $domain.$lang-urgent.po $package/po/$domain.pot \ + > $domain.$lang.po + + Then she can submit ‘$domain.$lang.po’ and proceed to the next +domain. + + +File: gettext.info, Node: Maintainers, Next: Installers, Prev: Translators, Up: Top + +13 The Maintainer's View +************************ + + The maintainer of a package has many responsibilities. One of them +is ensuring that the package will install easily on many platforms, and +that the magic we described earlier (*note Users::) will work for +installers and end users. + + Of course, there are many possible ways by which GNU ‘gettext’ might +be integrated in a distribution, and this chapter does not cover them in +all generality. Instead, it details one possible approach which is +especially adequate for many free software distributions following GNU +standards, or even better, Gnits standards, because GNU ‘gettext’ is +purposely for helping the internationalization of the whole GNU project, +and as many other good free packages as possible. So, the maintainer's +view presented here presumes that the package already has a +‘configure.ac’ file and uses GNU Autoconf. + + Nevertheless, GNU ‘gettext’ may surely be useful for free packages +not following GNU standards and conventions, but the maintainers of such +packages might have to show imagination and initiative in organizing +their distributions so ‘gettext’ work for them in all situations. There +are surely many, out there. + + Even if ‘gettext’ methods are now stabilizing, slight adjustments +might be needed between successive ‘gettext’ versions, so you should +ideally revise this chapter in subsequent releases, looking for changes. + +* Menu: + +* Flat and Non-Flat:: Flat or Non-Flat Directory Structures +* Prerequisites:: Prerequisite Works +* gettextize Invocation:: Invoking the ‘gettextize’ Program +* Adjusting Files:: Files You Must Create or Alter +* autoconf macros:: Autoconf macros for use in ‘configure.ac’ +* Version Control Issues:: +* Release Management:: Creating a Distribution Tarball + + +File: gettext.info, Node: Flat and Non-Flat, Next: Prerequisites, Up: Maintainers + +13.1 Flat or Non-Flat Directory Structures +========================================== + + Some free software packages are distributed as ‘tar’ files which +unpack in a single directory, these are said to be “flat” distributions. +Other free software packages have a one level hierarchy of +subdirectories, using for example a subdirectory named ‘doc/’ for the +Texinfo manual and man pages, another called ‘lib/’ for holding +functions meant to replace or complement C libraries, and a subdirectory +‘src/’ for holding the proper sources for the package. These other +distributions are said to be “non-flat”. + + We cannot say much about flat distributions. A flat directory +structure has the disadvantage of increasing the difficulty of updating +to a new version of GNU ‘gettext’. Also, if you have many PO files, +this could somewhat pollute your single directory. Also, GNU +‘gettext’'s libintl sources consist of C sources, shell scripts, ‘sed’ +scripts and complicated Makefile rules, which don't fit well into an +existing flat structure. For these reasons, we recommend to use +non-flat approach in this case as well. + + Maybe because GNU ‘gettext’ itself has a non-flat structure, we have +more experience with this approach, and this is what will be described +in the remaining of this chapter. Some maintainers might use this as an +opportunity to unflatten their package structure. + + +File: gettext.info, Node: Prerequisites, Next: gettextize Invocation, Prev: Flat and Non-Flat, Up: Maintainers + +13.2 Prerequisite Works +======================= + + There are some works which are required for using GNU ‘gettext’ in +one of your package. These works have some kind of generality that +escape the point by point descriptions used in the remainder of this +chapter. So, we describe them here. + + • Before attempting to use ‘gettextize’ you should install some other + packages first. Ensure that recent versions of GNU ‘m4’, GNU + Autoconf and GNU ‘gettext’ are already installed at your site, and + if not, proceed to do this first. If you get to install these + things, beware that GNU ‘m4’ must be fully installed before GNU + Autoconf is even _configured_. + + To further ease the task of a package maintainer the ‘automake’ + package was designed and implemented. GNU ‘gettext’ now uses this + tool and the ‘Makefile’ in the ‘po/’ directory therefore knows + about all the goals necessary for using ‘automake’. + + Those four packages are only needed by you, as a maintainer; the + installers of your own package and end users do not really need any + of GNU ‘m4’, GNU Autoconf, GNU ‘gettext’, or GNU ‘automake’ for + successfully installing and running your package, with messages + properly translated. But this is not completely true if you + provide internationalized shell scripts within your own package: + GNU ‘gettext’ shall then be installed at the user site if the end + users want to see the translation of shell script messages. + + • Your package should use Autoconf and have a ‘configure.ac’ or + ‘configure.in’ file. If it does not, you have to learn how. The + Autoconf documentation is quite well written, it is a good idea + that you print it and get familiar with it. + + • Your C sources should have already been modified according to + instructions given earlier in this manual. *Note Sources::. + + • Your ‘po/’ directory should receive all PO files submitted to you + by the translator teams, each having ‘LL.po’ as a name. This is + not usually easy to get translation work done before your package + gets internationalized and available! Since the cycle has to start + somewhere, the easiest for the maintainer is to start with + absolutely no PO files, and wait until various translator teams get + interested in your package, and submit PO files. + + It is worth adding here a few words about how the maintainer should +ideally behave with PO files submissions. As a maintainer, your role is +to authenticate the origin of the submission as being the representative +of the appropriate translating teams of the Translation Project (forward +the submission to ‘coordinator@translationproject.org’ in case of +doubt), to ensure that the PO file format is not severely broken and +does not prevent successful installation, and for the rest, to merely +put these PO files in ‘po/’ for distribution. + + As a maintainer, you do not have to take on your shoulders the +responsibility of checking if the translations are adequate or complete, +and should avoid diving into linguistic matters. Translation teams +drive themselves and are fully responsible of their linguistic choices +for the Translation Project. Keep in mind that translator teams are +_not_ driven by maintainers. You can help by carefully redirecting all +communications and reports from users about linguistic matters to the +appropriate translation team, or explain users how to reach or join +their team. + + Maintainers should _never ever_ apply PO file bug reports themselves, +short-cutting translation teams. If some translator has difficulty to +get some of her points through her team, it should not be an option for +her to directly negotiate translations with maintainers. Teams ought to +settle their problems themselves, if any. If you, as a maintainer, ever +think there is a real problem with a team, please never try to _solve_ a +team's problem on your own. + + +File: gettext.info, Node: gettextize Invocation, Next: Adjusting Files, Prev: Prerequisites, Up: Maintainers + +13.3 Invoking the ‘gettextize’ Program +====================================== + + The ‘gettextize’ program is an interactive tool that helps the +maintainer of a package internationalized through GNU ‘gettext’. It is +used for two purposes: + + • As a wizard, when a package is modified to use GNU ‘gettext’ for + the first time. + + • As a migration tool, for upgrading the GNU ‘gettext’ support in a + package from a previous to a newer version of GNU ‘gettext’. + + This program performs the following tasks: + + • It copies into the package some files that are consistently and + identically needed in every package internationalized through GNU + ‘gettext’. + + • It performs as many of the tasks mentioned in the next section + *note Adjusting Files:: as can be performed automatically. + + • It removes obsolete files and idioms used for previous GNU + ‘gettext’ versions to the form recommended for the current GNU + ‘gettext’ version. + + • It prints a summary of the tasks that ought to be done manually and + could not be done automatically by ‘gettextize’. + + It can be invoked as follows: + + gettextize [ OPTION... ] [ DIRECTORY ] + +and accepts the following options: + +‘-f’ +‘--force’ + Force replacement of files which already exist. + +‘--po-dir=DIR’ + Specify a directory containing PO files. Such a directory contains + the translations into various languages of a particular POT file. + This option can be specified multiple times, once for each + translation domain. If it is not specified, the directory named + ‘po/’ is updated. + +‘--no-changelog’ + Don't update or create ChangeLog files. By default, ‘gettextize’ + logs all changes (file additions, modifications and removals) in a + file called ‘ChangeLog’ in each affected directory. + +‘--symlink’ + Make symbolic links instead of copying the needed files. This can + be useful to save a few kilobytes of disk space, but it requires + extra effort to create self-contained tarballs, it may disturb some + mechanism the maintainer applies to the sources, and it is likely + to introduce bugs when a newer version of ‘gettext’ is installed on + the system. + +‘-n’ +‘--dry-run’ + Print modifications but don't perform them. All actions that + ‘gettextize’ would normally execute are inhibited and instead only + listed on standard output. + +‘--help’ + Display this help and exit. + +‘--version’ + Output version information and exit. + + If DIRECTORY is given, this is the top level directory of a package +to prepare for using GNU ‘gettext’. If not given, it is assumed that +the current directory is the top level directory of such a package. + + The program ‘gettextize’ provides the following files. However, no +existing file will be replaced unless the option ‘--force’ (‘-f’) is +specified. + + 1. The ‘ABOUT-NLS’ file is copied in the main directory of your + package, the one being at the top level. This file contains a + reference to the GNU gettext documentation. It also avoids an + error from Automake in packages that use the Automake option + ‘gnits’: "error: required file './ABOUT-NLS' not found". + + 2. A ‘po/’ directory is created for eventually holding all translation + files, but initially only containing the file ‘po/Makefile.in.in’ + from the GNU ‘gettext’ distribution (beware the double ‘.in’ in the + file name) and a few auxiliary files. If the ‘po/’ directory + already exists, it will be preserved along with the files it + contains, and only ‘Makefile.in.in’ and the auxiliary files will be + overwritten. + + If ‘--po-dir’ has been specified, this holds for every directory + specified through ‘--po-dir’, instead of ‘po/’. + + 3. The file ‘config.rpath’ is copied into the directory containing + configuration support files. It is needed by the ‘AM_GNU_GETTEXT’ + autoconf macro. + + 4. Only if the project is using GNU ‘automake’: A set of ‘autoconf’ + macro files is copied into the package's ‘autoconf’ macro + repository, usually in a directory called ‘m4/’. + + If your site support symbolic links, ‘gettextize’ will not actually +copy the files into your package, but establish symbolic links instead. +This avoids duplicating the disk space needed in all packages. Merely +using the ‘-h’ option while creating the ‘tar’ archive of your +distribution will resolve each link by an actual copy in the +distribution archive. So, to insist, you really should use ‘-h’ option +with ‘tar’ within your ‘dist’ goal of your main ‘Makefile.in’. + + Furthermore, ‘gettextize’ will update all ‘Makefile.am’ files in each +affected directory, as well as the top level ‘configure.ac’ or +‘configure.in’ file. + + It is interesting to understand that most new files for supporting +GNU ‘gettext’ facilities in one package go in ‘po/’ and ‘m4/’ +subdirectories. Still, these directories will mostly contain package +dependent files. + + The ‘gettextize’ program makes backup files for all files it replaces +or changes, and also write ChangeLog entries about these changes. This +way, the careful maintainer can check after running ‘gettextize’ whether +its changes are acceptable to him, and possibly adjust them. An +exception to this rule is the ‘intl/’ directory, which is removed as a +whole if it still existed. + + It is important to understand that ‘gettextize’ can not do the entire +job of adapting a package for using GNU ‘gettext’. The amount of +remaining work depends on whether the package uses GNU ‘automake’ or +not. But in any case, the maintainer should still read the section +*note Adjusting Files:: after invoking ‘gettextize’. + + In particular, if after using ‘gettexize’, you get an error +‘AC_COMPILE_IFELSE was called before AC_GNU_SOURCE’ or ‘AC_RUN_IFELSE +was called before AC_GNU_SOURCE’, you can fix it by modifying +‘configure.ac’, as described in *note configure.ac::. + + It is also important to understand that ‘gettextize’ is not part of +the GNU build system, in the sense that it should not be invoked +automatically, and not be invoked by someone who doesn't assume the +responsibilities of a package maintainer. For the latter purpose, a +separate tool is provided, see *note autopoint Invocation::. + + +File: gettext.info, Node: Adjusting Files, Next: autoconf macros, Prev: gettextize Invocation, Up: Maintainers + +13.4 Files You Must Create or Alter +=================================== + + Besides files which are automatically added through ‘gettextize’, +there are many files needing revision for properly interacting with GNU +‘gettext’. If you are closely following GNU standards for Makefile +engineering and auto-configuration, the adaptations should be easier to +achieve. Here is a point by point description of the changes needed in +each. + + So, here comes a list of files, each one followed by a description of +all alterations it needs. Many examples are taken out from the GNU +‘gettext’ 0.25.1 distribution itself, or from the GNU ‘hello’ +distribution (). You may indeed +refer to the source code of the GNU ‘gettext’ and GNU ‘hello’ packages, +as they are intended to be good examples for using GNU gettext +functionality. + +* Menu: + +* po/POTFILES.in:: ‘POTFILES.in’ in ‘po/’ +* po/LINGUAS:: ‘LINGUAS’ in ‘po/’ +* po/Makevars:: ‘Makevars’ in ‘po/’ +* po/Rules-*:: Extending ‘Makefile’ in ‘po/’ +* configure.ac:: ‘configure.ac’ at top level +* config.guess:: ‘config.guess’, ‘config.sub’ at top level +* mkinstalldirs:: ‘mkinstalldirs’ at top level +* aclocal:: ‘aclocal.m4’ at top level +* config.h.in:: ‘config.h.in’ at top level +* Makefile:: ‘Makefile.in’ at top level +* src/Makefile:: ‘Makefile.in’ in ‘src/’ +* lib/gettext.h:: ‘gettext.h’ in ‘lib/’ + + +File: gettext.info, Node: po/POTFILES.in, Next: po/LINGUAS, Up: Adjusting Files + +13.4.1 ‘POTFILES.in’ in ‘po/’ +----------------------------- + + The ‘po/’ directory should receive a file named ‘POTFILES.in’. This +file tells which files, among all program sources, have marked strings +needing translation. Here is an example of such a file: + + # List of source files containing translatable strings. + # Copyright (C) 1995 Free Software Foundation, Inc. + + # Common library files + lib/error.c + lib/getopt.c + lib/xmalloc.c + + # Package source files + src/gettext.c + src/msgfmt.c + src/xgettext.c + +Hash-marked comments and white lines are ignored. All other lines list +those source files containing strings marked for translation (*note Mark +Keywords::), in a notation relative to the top level of your whole +distribution, rather than the location of the ‘POTFILES.in’ file itself. + + When a C file is automatically generated by a tool, like ‘flex’ or +‘bison’, that doesn't introduce translatable strings by itself, it is +recommended to list in ‘po/POTFILES.in’ the real source file (ending in +‘.l’ in the case of ‘flex’, or in ‘.y’ in the case of ‘bison’), not the +generated C file. + + +File: gettext.info, Node: po/LINGUAS, Next: po/Makevars, Prev: po/POTFILES.in, Up: Adjusting Files + +13.4.2 ‘LINGUAS’ in ‘po/’ +------------------------- + + The ‘po/’ directory should also receive a file named ‘LINGUAS’. This +file contains the list of available translations. It is a whitespace +separated list. Hash-marked comments and white lines are ignored. Here +is an example file: + + # Set of available languages. + de fr + +This example means that German and French PO files are available, so +that these languages are currently supported by your package. If you +want to further restrict, at installation time, the set of installed +languages, this should not be done by modifying the ‘LINGUAS’ file, but +rather by using the ‘LINGUAS’ environment variable (*note Installers::). + + It is recommended that you add the "languages" ‘en@quot’ and +‘en@boldquot’ to the ‘LINGUAS’ file. ‘en@quot’ is a variant of English +message catalogs (‘en’) which uses real quotation marks instead of the +ugly looking asymmetric ASCII substitutes ‘`’ and ‘'’. ‘en@boldquot’ is +a variant of ‘en@quot’ that additionally outputs quoted pieces of text +in a bold font, when used in a terminal emulator which supports the +VT100 escape sequences (such as ‘xterm’ or the Linux console, but not +Emacs in ‘M-x shell’ mode). + + These extra message catalogs ‘en@quot’ and ‘en@boldquot’ are +constructed automatically, not by translators; to support them, you need +the files ‘Rules-quot’, ‘quot.sed’, ‘boldquot.sed’, ‘en@quot.header’, +‘en@boldquot.header’, ‘insert-header.sed’ in the ‘po/’ directory. You +can copy them from GNU gettext's ‘po/’ directory; they are also +installed by running ‘gettextize’. + + +File: gettext.info, Node: po/Makevars, Next: po/Rules-*, Prev: po/LINGUAS, Up: Adjusting Files + +13.4.3 ‘Makevars’ in ‘po/’ +-------------------------- + + The ‘po/’ directory also has a file named ‘Makevars’. It contains +variables that are specific to your project. ‘po/Makevars’ gets +inserted into the ‘po/Makefile’ when the latter is created. The +variables thus take effect when the POT file is created or updated, and +when the message catalogs get installed. + + The first three variables can be left unmodified if your package has +a single message domain and, accordingly, a single ‘po/’ directory. +Only packages which have multiple ‘po/’ directories at different +locations need to adjust the three first variables defined in +‘Makevars’. + + As an alternative to the ‘XGETTEXT_OPTIONS’ variable, it is also +possible to specify ‘xgettext’ options through the ‘AM_XGETTEXT_OPTION’ +autoconf macro. See *note AM_XGETTEXT_OPTION::. + + +File: gettext.info, Node: po/Rules-*, Next: configure.ac, Prev: po/Makevars, Up: Adjusting Files + +13.4.4 Extending ‘Makefile’ in ‘po/’ +------------------------------------ + + All files called ‘Rules-*’ in the ‘po/’ directory get appended to the +‘po/Makefile’ when it is created. They present an opportunity to add +rules for special PO files to the Makefile, without needing to mess with +‘po/Makefile.in.in’. + + GNU gettext comes with a ‘Rules-quot’ file, containing rules for +building catalogs ‘en@quot.po’ and ‘en@boldquot.po’. The effect of +‘en@quot.po’ is that people who set their ‘LANGUAGE’ environment +variable to ‘en@quot’ will get messages with proper looking symmetric +Unicode quotation marks instead of abusing the ASCII grave accent and +the ASCII apostrophe for indicating quotations. To enable this catalog, +simply add ‘en@quot’ to the ‘po/LINGUAS’ file. The effect of +‘en@boldquot.po’ is that people who set ‘LANGUAGE’ to ‘en@boldquot’ will +get not only proper quotation marks, but also the quoted text will be +shown in a bold font on terminals and consoles. This catalog is useful +only for command-line programs, not GUI programs. To enable it, +similarly add ‘en@boldquot’ to the ‘po/LINGUAS’ file. + + Similarly, you can create rules for building message catalogs for the +‘sr@latin’ locale - Serbian written with the Latin alphabet - from those +for the ‘sr’ locale - Serbian written with Cyrillic letters. See *note +msgfilter Invocation::. + + +File: gettext.info, Node: configure.ac, Next: config.guess, Prev: po/Rules-*, Up: Adjusting Files + +13.4.5 ‘configure.ac’ at top level +---------------------------------- + + ‘configure.ac’ or ‘configure.in’ - this is the source from which +‘autoconf’ generates the ‘configure’ script. + + 1. Declare the package and version. + + This is done by a set of lines like these: + + PACKAGE=gettext + VERSION=0.25.1 + AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") + AC_DEFINE_UNQUOTED(VERSION, "$VERSION") + AC_SUBST(PACKAGE) + AC_SUBST(VERSION) + + or, if you are using GNU ‘automake’, by a line like this: + + AM_INIT_AUTOMAKE(gettext, 0.25.1) + + Of course, you replace ‘gettext’ with the name of your package, and + ‘0.25.1’ by its version numbers, exactly as they should appear in + the packaged ‘tar’ file name of your distribution + (‘gettext-0.25.1.tar.gz’, here). + + 2. Check for internationalization support. + + Here is the main ‘m4’ macro for triggering internationalization + support. Just add this line to ‘configure.ac’: + + AM_GNU_GETTEXT([external]) + + This call is purposely simple, even if it generates a lot of + configure time checking and actions. + + 3. Have output files created. + + The ‘AC_OUTPUT’ directive, at the end of your ‘configure.ac’ file, + needs to be modified in two ways: + + AC_OUTPUT([EXISTING CONFIGURATION FILES po/Makefile.in], + [EXISTING ADDITIONAL ACTIONS]) + + The modification to the first argument to ‘AC_OUTPUT’ asks for + substitution in the ‘po/’ directory. Note the ‘.in’ suffix used + for ‘po/’ only. This is because the distributed file is really + ‘po/Makefile.in.in’. + + +File: gettext.info, Node: config.guess, Next: mkinstalldirs, Prev: configure.ac, Up: Adjusting Files + +13.4.6 ‘config.guess’, ‘config.sub’ at top level +------------------------------------------------ + + You need to add the GNU ‘config.guess’ and ‘config.sub’ files to your +distribution. They are needed because the ‘AM_ICONV’ macro contains +knowledge about specific platforms and therefore needs to identify the +platform. + + You can obtain the newest version of ‘config.guess’ and ‘config.sub’ +from the ‘config’ project at ‘https://savannah.gnu.org/’. The commands +to fetch them are + $ wget -O config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' + $ wget -O config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' +Less recent versions are also contained in the GNU ‘automake’ and GNU +‘libtool’ packages. + + Normally, ‘config.guess’ and ‘config.sub’ are put at the top level of +a distribution. But it is also possible to put them in a subdirectory, +altogether with other configuration support files like ‘install-sh’, +‘ltconfig’, ‘ltmain.sh’ or ‘missing’. All you need to do, other than +moving the files, is to add the following line to your ‘configure.ac’. + + AC_CONFIG_AUX_DIR([SUBDIR]) + + +File: gettext.info, Node: mkinstalldirs, Next: aclocal, Prev: config.guess, Up: Adjusting Files + +13.4.7 ‘mkinstalldirs’ at top level +----------------------------------- + + With earlier versions of GNU gettext, you needed to add the GNU +‘mkinstalldirs’ script to your distribution. This is not needed any +more. You can remove it. + + +File: gettext.info, Node: aclocal, Next: config.h.in, Prev: mkinstalldirs, Up: Adjusting Files + +13.4.8 ‘aclocal.m4’ at top level +-------------------------------- + + If you do not have an ‘aclocal.m4’ file in your distribution, the +simplest is to concatenate the files ‘build-to-host.m4’, ‘gettext.m4’, +‘host-cpu-c-abi.m4’, ‘intlmacosx.m4’, ‘iconv.m4’, ‘lib-ld.m4’, +‘lib-link.m4’, ‘lib-prefix.m4’, ‘nls.m4’, ‘po.m4’, ‘progtest.m4’ from +GNU ‘gettext’'s ‘PREFIX/share/gettext/m4/’ directory into a single file. + + If you already have an ‘aclocal.m4’ file, then you will have to merge +the said macro files into your ‘aclocal.m4’. Note that if you are +upgrading from a previous release of GNU ‘gettext’, you should most +probably _replace_ the macros (‘AM_GNU_GETTEXT’, etc.), as they usually +change a little from one release of GNU ‘gettext’ to the next. Their +contents may vary as we get more experience with strange systems out +there. + + You should be using GNU ‘automake’ 1.9 or newer. With it, you need +to copy the files ‘build-to-host.m4’, ‘gettext.m4’, ‘host-cpu-c-abi.m4’, +‘intlmacosx.m4’, ‘iconv.m4’, ‘lib-ld.m4’, ‘lib-link.m4’, +‘lib-prefix.m4’, ‘nls.m4’, ‘po.m4’, ‘progtest.m4’ from GNU ‘gettext’'s +‘PREFIX/share/gettext/m4/’ directory to a subdirectory named ‘m4/’ and +add the line + + ACLOCAL_AMFLAGS = -I m4 + +to your top level ‘Makefile.am’. + + If you are using GNU ‘automake’ 1.12 or newer, it is even easier: Add +the line + + ACLOCAL_AMFLAGS = -I m4 + +to your top level ‘Makefile.am’, and run ‘aclocal --install +--system-acdir=PREFIX/share/gettext/m4 -I m4’. This will copy the +needed files to the ‘m4/’ subdirectory automatically, before updating +‘aclocal.m4’. + + Note: This ‘--system-acdir’ option should only be used here, once. +If you were to use it after ‘autopoint’ has been run, it would destroy +the consistency that ‘autopoint’ guarantees and lead to all sorts of +malfunction at build time. + + These macros check for the internationalization support functions and +related information. + + +File: gettext.info, Node: config.h.in, Next: Makefile, Prev: aclocal, Up: Adjusting Files + +13.4.9 ‘config.h.in’ at top level +--------------------------------- + + The include file template that holds the C macros to be defined by +‘configure’ is usually called ‘config.h.in’ and may be maintained either +manually or automatically. + + If it is maintained automatically, by use of the ‘autoheader’ +program, you need to do nothing about it. This is the case in +particular if you are using GNU ‘automake’. + + If it is maintained manually, you can get away by adding the +following lines to ‘config.h.in’: + + /* Define to 1 if translation of program messages to the user's + native language is requested. */ + #undef ENABLE_NLS + + +File: gettext.info, Node: Makefile, Next: src/Makefile, Prev: config.h.in, Up: Adjusting Files + +13.4.10 ‘Makefile.in’ at top level +---------------------------------- + + Here are a few modifications you need to make to your main, top-level +‘Makefile.in’ file. + + 1. Add the following lines near the beginning of your ‘Makefile.in’, + so the ‘dist:’ goal will work properly (as explained further down): + + PACKAGE = @PACKAGE@ + VERSION = @VERSION@ + + 2. Wherever you process subdirectories in your ‘Makefile.in’, be sure + you also process the subdirectory ‘po’. Special rules in the + ‘Makefiles’ take care for the case where no internationalization is + wanted. + + If you are using Makefiles, either generated by automake, or + hand-written so they carefully follow the GNU coding standards, the + effected goals for which the new subdirectories must be handled + include ‘installdirs’, ‘install’, ‘uninstall’, ‘clean’, + ‘distclean’. + + Here is an example of a canonical order of processing. In this + example, we also define ‘SUBDIRS’ in ‘Makefile.in’ for it to be + further used in the ‘dist:’ goal. + + SUBDIRS = doc lib src po + + 3. A delicate point is the ‘dist:’ goal, as ‘po/Makefile’ will later + assume that the proper directory has been set up from the main + ‘Makefile’. Here is an example at what the ‘dist:’ goal might look + like: + + distdir = $(PACKAGE)-$(VERSION) + dist: Makefile + rm -fr $(distdir) + mkdir $(distdir) + chmod 777 $(distdir) + for file in $(DISTFILES); do \ + ln $$file $(distdir) 2>/dev/null || cp -p $$file $(distdir); \ + done + for subdir in $(SUBDIRS); do \ + mkdir $(distdir)/$$subdir || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $@) || exit 1; \ + done + tar chozf $(distdir).tar.gz $(distdir) + rm -fr $(distdir) + + Note that if you are using GNU ‘automake’, ‘Makefile.in’ is +automatically generated from ‘Makefile.am’, and all needed changes to +‘Makefile.am’ are already made by running ‘gettextize’. + + +File: gettext.info, Node: src/Makefile, Next: lib/gettext.h, Prev: Makefile, Up: Adjusting Files + +13.4.11 ‘Makefile.in’ in ‘src/’ +------------------------------- + + Some of the modifications made in the main ‘Makefile.in’ will also be +needed in the ‘Makefile.in’ from your package sources, which we assume +here to be in the ‘src/’ subdirectory. Here are all the modifications +needed in ‘src/Makefile.in’: + + 1. In view of the ‘dist:’ goal, you should have these lines near the + beginning of ‘src/Makefile.in’: + + PACKAGE = @PACKAGE@ + VERSION = @VERSION@ + + 2. If not done already, you should guarantee that ‘top_srcdir’ gets + defined. This will serve for ‘cpp’ include files. Just add the + line: + + top_srcdir = @top_srcdir@ + + 3. You might also want to define ‘subdir’ as ‘src’, later allowing for + almost uniform ‘dist:’ goals in all your ‘Makefile.in’. At list, + the ‘dist:’ goal below assume that you used: + + subdir = src + + 4. The ‘main’ function of your program will normally call + ‘bindtextdomain’ (see *note Triggering::), like this: + + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); + + On native Windows platforms, the ‘main’ function may call + ‘wbindtextdomain’ instead of ‘bindtextdomain’. + + To make LOCALEDIR known to the program, add the following lines to + ‘Makefile.in’: + + datadir = @datadir@ + datarootdir= @datarootdir@ + localedir = @localedir@ + DEFS = -DLOCALEDIR=$(localedir_c_make) @DEFS@ + + ‘$(localedir_c_make)’ expands to the value of ‘localedir’, in C + syntax, escaped for use in a ‘Makefile’. Note that ‘@datadir@’ + defaults to ‘$(prefix)/share’, and ‘$(localedir)’ defaults to + ‘$(prefix)/share/locale’. + + 5. You should ensure that the final linking will use ‘@LIBINTL@’ or + ‘@LTLIBINTL@’ as a library. ‘@LIBINTL@’ is for use without + ‘libtool’, ‘@LTLIBINTL@’ is for use with ‘libtool’. An easy way to + achieve this is to manage that it gets into ‘LIBS’, like this: + + LIBS = @LIBINTL@ @LIBS@ + + In most packages internationalized with GNU ‘gettext’, one will + find a directory ‘lib/’ in which a library containing some helper + functions will be build. (You need at least the few functions + which the GNU ‘gettext’ Library itself needs.) However some of the + functions in the ‘lib/’ also give messages to the user which of + course should be translated, too. Taking care of this, the support + library (say ‘libsupport.a’) should be placed before ‘@LIBINTL@’ + and ‘@LIBS@’ in the above example. So one has to write this: + + LIBS = ../lib/libsupport.a @LIBINTL@ @LIBS@ + + 6. Your ‘dist:’ goal has to conform with others. Here is a reasonable + definition for it: + + distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) + dist: Makefile $(DISTFILES) + for file in $(DISTFILES); do \ + ln $$file $(distdir) 2>/dev/null || cp -p $$file $(distdir) || exit 1; \ + done + + Note that if you are using GNU ‘automake’, ‘Makefile.in’ is +automatically generated from ‘Makefile.am’, and the first three changes +and the last change are not necessary. The remaining needed +‘Makefile.am’ modifications are the following: + + 1. To make LOCALEDIR known to the program, add the following to + ‘Makefile.am’: + + _CPPFLAGS = -DLOCALEDIR=$(localedir_c_make) + + for each specific module or compilation unit, or + + AM_CPPFLAGS = -DLOCALEDIR=$(localedir_c_make) + + for all modules and compilation units together. + + 2. To ensure that the final linking will use ‘@LIBINTL@’ or + ‘@LTLIBINTL@’ as a library, add the following to ‘Makefile.am’: + + _LDADD = @LIBINTL@ + + for each specific program, or + + LDADD = @LIBINTL@ + + for all programs together. Remember that when you use ‘libtool’ to + link a program, you need to use @LTLIBINTL@ instead of @LIBINTL@ + for that program. + + +File: gettext.info, Node: lib/gettext.h, Prev: src/Makefile, Up: Adjusting Files + +13.4.12 ‘gettext.h’ in ‘lib/’ +----------------------------- + + Internationalization of packages, as provided by GNU ‘gettext’, is +optional. It can be turned off in two situations: + + • When the installer has specified ‘./configure --disable-nls’. This + can be useful when small binaries are more important than features, + for example when building utilities for boot diskettes. It can + also be useful in order to get some specific C compiler warnings + about code quality with some older versions of GCC (older than + 3.0). + + • When the libintl.h header (with its associated libintl library, if + any) is not already installed on the system, it is preferable that + the package builds without internationalization support, rather + than to give a compilation error. + + A C preprocessor macro can be used to detect these two cases. +Usually, when ‘libintl.h’ was found and not explicitly disabled, the +‘ENABLE_NLS’ macro will be defined to 1 in the autoconf generated +configuration file (usually called ‘config.h’). In the two negative +situations, however, this macro will not be defined, thus it will +evaluate to 0 in C preprocessor expressions. + + ‘gettext.h’ is a convenience header file for conditional use of +‘’, depending on the ‘ENABLE_NLS’ macro. If ‘ENABLE_NLS’ is +set, it includes ‘’; otherwise it defines no-op substitutes +for the libintl.h functions. We recommend the use of ‘"gettext.h"’ over +direct use of ‘’, so that portability to older systems is +guaranteed and installers can turn off internationalization if they want +to. In the C code, you will then write + + #include "gettext.h" + +instead of + + #include + + The location of ‘gettext.h’ is usually in a directory containing +auxiliary include files. In many GNU packages, there is a directory +‘lib/’ containing helper functions; ‘gettext.h’ fits there. In other +packages, it can go into the ‘src’ directory. + + Do not install the ‘gettext.h’ file in public locations. Every +package that needs it should contain a copy of it on its own. + + +File: gettext.info, Node: autoconf macros, Next: Version Control Issues, Prev: Adjusting Files, Up: Maintainers + +13.5 Autoconf macros for use in ‘configure.ac’ +============================================== + + GNU ‘gettext’ installs macros for use in a package's ‘configure.ac’ +or ‘configure.in’. *Note Introduction: (autoconf)Top. + + In order to copy these macros into your package, use the ‘gettextize’ +or ‘autopoint’ programs. See *note gettextize Invocation:: or *note +autopoint Invocation::. Attempts to use the ‘autoreconf’ program for +this purpose are unreliable. + + The primary macro is, of course, ‘AM_GNU_GETTEXT’. + +* Menu: + +* AM_GNU_GETTEXT:: AM_GNU_GETTEXT in ‘gettext.m4’ +* AM_GNU_GETTEXT_VERSION:: AM_GNU_GETTEXT_VERSION in ‘gettext.m4’ +* AM_GNU_GETTEXT_NEED:: AM_GNU_GETTEXT_NEED in ‘gettext.m4’ +* AM_PO_SUBDIRS:: AM_PO_SUBDIRS in ‘po.m4’ +* AM_XGETTEXT_OPTION:: AM_XGETTEXT_OPTION in ‘po.m4’ +* AM_ICONV:: AM_ICONV in ‘iconv.m4’ + + +File: gettext.info, Node: AM_GNU_GETTEXT, Next: AM_GNU_GETTEXT_VERSION, Up: autoconf macros + +13.5.1 AM_GNU_GETTEXT in ‘gettext.m4’ +------------------------------------- + + The ‘AM_GNU_GETTEXT’ macro tests for the presence of the GNU gettext +function family in either the C library or a separate ‘libintl’ library +(shared or static libraries are both supported). It also invokes +‘AM_PO_SUBDIRS’, thus preparing the ‘po/’ directories of the package for +building. + + ‘AM_GNU_GETTEXT’ accepts up to two optional arguments. The general +syntax is + + AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL]) + + INTLSYMBOL should always be ‘external’. + + If NEEDSYMBOL is specified and is ‘need-ngettext’, then GNU gettext +implementations (in libc or libintl) without the ‘ngettext()’ function +will be ignored. If NEEDSYMBOL is specified and is +‘need-formatstring-macros’, then GNU gettext implementations that don't +support the ISO C 99 ‘’ formatstring macros will be ignored. +Only one NEEDSYMBOL can be specified. These requirements can also be +specified by using the macro ‘AM_GNU_GETTEXT_NEED’ elsewhere. To +specify more than one requirement, just specify the strongest one among +them, or invoke the ‘AM_GNU_GETTEXT_NEED’ macro several times. The +hierarchy among the various alternatives is as follows: +‘need-formatstring-macros’ implies ‘need-ngettext’. + + The ‘AM_GNU_GETTEXT’ macro determines whether GNU gettext is +available and should be used. If so, it sets the ‘USE_NLS’ variable to +‘yes’; it defines ‘ENABLE_NLS’ to 1 in the autoconf generated +configuration file (usually called ‘config.h’); it sets the variables +‘LIBINTL’ and ‘LTLIBINTL’ to the linker options for use in a Makefile +(‘LIBINTL’ for use without libtool, ‘LTLIBINTL’ for use with libtool); +it adds an ‘-I’ option to ‘CPPFLAGS’ if necessary. In the negative +case, it sets ‘USE_NLS’ to ‘no’; it sets ‘LIBINTL’ and ‘LTLIBINTL’ to +empty and doesn't change ‘CPPFLAGS’. + + The complexities that ‘AM_GNU_GETTEXT’ deals with are the following: + + • Some operating systems have ‘gettext’ in the C library, for example + glibc. Some have it in a separate library ‘libintl’. GNU + ‘libintl’ might have been installed as part of the GNU ‘gettext’ + package. + + • GNU ‘libintl’, if installed, is not necessarily already in the + search path (‘CPPFLAGS’ for the include file search path, ‘LDFLAGS’ + for the library search path). + + • Except for glibc and the Solaris 11 libc, the operating system's + native ‘gettext’ cannot exploit the GNU mo files, doesn't have the + necessary locale dependency features, and cannot convert messages + from the catalog's text encoding to the user's locale encoding. + + • GNU ‘libintl’, if installed, is not necessarily already in the run + time library search path. To avoid the need for setting an + environment variable like ‘LD_LIBRARY_PATH’, the macro adds the + appropriate run time search path options to the ‘LIBINTL’ and + ‘LTLIBINTL’ variables. This works on most systems, but not on some + operating systems with limited shared library support, like SCO. + + • GNU ‘libintl’ relies on POSIX/XSI ‘iconv’. The macro checks for + linker options needed to use iconv and appends them to the + ‘LIBINTL’ and ‘LTLIBINTL’ variables. + + Additionally, the ‘AM_GNU_GETTEXT’ macro sets two variables, for +convenience. Both are derived from the ‘--localedir’ configure option. +They are correct even on native Windows, where directories frequently +contain backslashes. +‘localedir_c’ + This is the value of ‘localedir’, in C syntax. This variable is + meant to be substituted into C or C++ code through + ‘AC_CONFIG_FILES’. + +‘localedir_c_make’ + This is the value of ‘localedir’, in C syntax, escaped for use in a + ‘Makefile’. This variable is meant to be used in Makefiles, for + example for defining a C macro named ‘LOCALEDIR’: + AM_CPPFLAGS = ... -DLOCALEDIR=$(localedir_c_make) ... + + +File: gettext.info, Node: AM_GNU_GETTEXT_VERSION, Next: AM_GNU_GETTEXT_NEED, Prev: AM_GNU_GETTEXT, Up: autoconf macros + +13.5.2 AM_GNU_GETTEXT_VERSION in ‘gettext.m4’ +--------------------------------------------- + + The ‘AM_GNU_GETTEXT_VERSION’ macro declares the version number of the +GNU gettext infrastructure that is used by the package. + + The use of this macro is optional; only the ‘autopoint’ program makes +use of it (*note Version Control Issues::). + + +File: gettext.info, Node: AM_GNU_GETTEXT_NEED, Next: AM_PO_SUBDIRS, Prev: AM_GNU_GETTEXT_VERSION, Up: autoconf macros + +13.5.3 AM_GNU_GETTEXT_NEED in ‘gettext.m4’ +------------------------------------------ + + The ‘AM_GNU_GETTEXT_NEED’ macro declares a constraint regarding the +GNU gettext implementation. The syntax is + + AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) + + If NEEDSYMBOL is ‘need-ngettext’, then GNU gettext implementations +(in libc or libintl) without the ‘ngettext()’ function will be ignored. +If NEEDSYMBOL is ‘need-formatstring-macros’, then GNU gettext +implementations that don't support the ISO C 99 ‘’ +formatstring macros will be ignored. + + The optional second argument of ‘AM_GNU_GETTEXT’ is also taken into +account. + + The ‘AM_GNU_GETTEXT_NEED’ invocations can occur before or after the +‘AM_GNU_GETTEXT’ invocation; the order doesn't matter. + + +File: gettext.info, Node: AM_PO_SUBDIRS, Next: AM_XGETTEXT_OPTION, Prev: AM_GNU_GETTEXT_NEED, Up: autoconf macros + +13.5.4 AM_PO_SUBDIRS in ‘po.m4’ +------------------------------- + + The ‘AM_PO_SUBDIRS’ macro prepares the ‘po/’ directories of the +package for building. This macro should be used in internationalized +programs written in other programming languages than C, C++, Objective +C, for example ‘sh’, ‘Python’, ‘Lisp’. See *note Programming +Languages:: for a list of programming languages that support +localization through PO files. + + The ‘AM_PO_SUBDIRS’ macro determines whether internationalization +should be used. If so, it sets the ‘USE_NLS’ variable to ‘yes’, +otherwise to ‘no’. It also determines the right values for Makefile +variables in each ‘po/’ directory. + + +File: gettext.info, Node: AM_XGETTEXT_OPTION, Next: AM_ICONV, Prev: AM_PO_SUBDIRS, Up: autoconf macros + +13.5.5 AM_XGETTEXT_OPTION in ‘po.m4’ +------------------------------------ + + The ‘AM_XGETTEXT_OPTION’ macro registers a command-line option to be +used in the invocations of ‘xgettext’ in the ‘po/’ directories of the +package. + + For example, if you have a source file that defines a function +‘error_at_line’ whose fifth argument is a format string, you can use + AM_XGETTEXT_OPTION([--flag=error_at_line:5:c-format]) +to instruct ‘xgettext’ to mark all translatable strings in ‘gettext’ +invocations that occur as fifth argument to this function as ‘c-format’. + + See *note xgettext Invocation:: for the list of options that +‘xgettext’ accepts. + + The use of this macro is an alternative to the use of the +‘XGETTEXT_OPTIONS’ variable in ‘po/Makevars’. + + +File: gettext.info, Node: AM_ICONV, Prev: AM_XGETTEXT_OPTION, Up: autoconf macros + +13.5.6 AM_ICONV in ‘iconv.m4’ +----------------------------- + + The ‘AM_ICONV’ macro tests for the presence of the POSIX/XSI ‘iconv’ +function family in either the C library or a separate ‘libiconv’ +library. If found, it sets the ‘am_cv_func_iconv’ variable to ‘yes’; it +defines ‘HAVE_ICONV’ to 1 in the autoconf generated configuration file +(usually called ‘config.h’); it defines ‘ICONV_CONST’ to ‘const’ or to +empty, depending on whether the second argument of ‘iconv()’ is of type +‘const char **’ or ‘char **’; it sets the variables ‘LIBICONV’ and +‘LTLIBICONV’ to the linker options for use in a Makefile (‘LIBICONV’ for +use without libtool, ‘LTLIBICONV’ for use with libtool); it adds an ‘-I’ +option to ‘CPPFLAGS’ if necessary. If not found, it sets ‘LIBICONV’ and +‘LTLIBICONV’ to empty and doesn't change ‘CPPFLAGS’. + + The complexities that ‘AM_ICONV’ deals with are the following: + + • Some operating systems have ‘iconv’ in the C library, for example + glibc. Some have it in a separate library ‘libiconv’, for example + OSF/1 or FreeBSD. Regardless of the operating system, GNU + ‘libiconv’ might have been installed. In that case, it should be + used instead of the operating system's native ‘iconv’. + + • GNU ‘libiconv’, if installed, is not necessarily already in the + search path (‘CPPFLAGS’ for the include file search path, ‘LDFLAGS’ + for the library search path). + + • GNU ‘libiconv’ is binary incompatible with some operating system's + native ‘iconv’, for example on FreeBSD. Use of an ‘iconv.h’ and + ‘libiconv.so’ that don't fit together would produce program + crashes. + + • GNU ‘libiconv’, if installed, is not necessarily already in the run + time library search path. To avoid the need for setting an + environment variable like ‘LD_LIBRARY_PATH’, the macro adds the + appropriate run time search path options to the ‘LIBICONV’ + variable. This works on most systems, but not on some operating + systems with limited shared library support, like SCO. + + ‘iconv.m4’ is distributed with the GNU gettext package because +‘gettext.m4’ relies on it. + + +File: gettext.info, Node: Version Control Issues, Next: Release Management, Prev: autoconf macros, Up: Maintainers + +13.6 Integrating with Version Control Systems +============================================= + + Many projects use version control systems for distributed development +and source backup. This section gives some advice how to manage the +uses of ‘gettextize’, ‘autopoint’ and ‘autoconf’ on version controlled +files. + +* Menu: + +* Distributed Development:: Avoiding version mismatch in distributed development +* Files under Version Control:: Files to put under version control +* Translations under Version Control:: Put PO Files under Version Control +* autopoint Invocation:: Invoking the ‘autopoint’ Program + + +File: gettext.info, Node: Distributed Development, Next: Files under Version Control, Up: Version Control Issues + +13.6.1 Avoiding version mismatch in distributed development +----------------------------------------------------------- + + In a project development with multiple developers, there should be a +single developer who occasionally - when there is desire to upgrade to a +new ‘gettext’ version - runs ‘gettextize’ and performs the changes +listed in *note Adjusting Files::, and then commits his changes to the +repository. + + It is highly recommended that all developers on a project use the +same version of GNU ‘gettext’ in the package. In other words, if a +developer runs ‘gettextize’, he should go the whole way, make the +necessary remaining changes and commit his changes to the repository. +Otherwise the following damages will likely occur: + + • Apparent version mismatch between developers. Since some ‘gettext’ + specific portions in ‘configure.ac’, ‘configure.in’ and + ‘Makefile.am’, ‘Makefile.in’ files depend on the ‘gettext’ version, + the use of infrastructure files belonging to different ‘gettext’ + versions can easily lead to build errors. + + • Hidden version mismatch. Such version mismatch can also lead to + malfunctioning of the package, that may be undiscovered by the + developers. The worst case of hidden version mismatch is that + internationalization of the package doesn't work at all. + + • Release risks. All developers implicitly perform constant testing + on a package. This is important in the days and weeks before a + release. If the guy who makes the release tar files uses a + different version of GNU ‘gettext’ than the other developers, the + distribution will be less well tested than if all had been using + the same ‘gettext’ version. For example, it is possible that a + platform specific bug goes undiscovered due to this constellation. + + +File: gettext.info, Node: Files under Version Control, Next: Translations under Version Control, Prev: Distributed Development, Up: Version Control Issues + +13.6.2 Files to put under version control +----------------------------------------- + + There are basically three ways to deal with generated files in the +context of a version controlled repository, such as ‘configure’ +generated from ‘configure.ac’, ‘PARSER.c’ generated from ‘PARSER.y’, or +‘po/Makefile.in.in’ autoinstalled by ‘gettextize’ or ‘autopoint’. + + 1. All generated files are always committed into the repository. + + 2. All generated files are committed into the repository occasionally, + for example each time a release is made. + + 3. Generated files are never committed into the repository. + + Each of these three approaches has different advantages and +drawbacks. + + 1. The advantage is that anyone can check out the source at any moment + and gets a working build. The drawbacks are: 1a. It requires some + frequent "push" actions by the maintainers. 1b. The repository + grows in size quite fast. + + 2. The advantage is that anyone can check out the source, and the + usual "./configure; make" will work. The drawbacks are: 2a. The + one who checks out the repository needs tools like GNU ‘automake’, + GNU ‘autoconf’, GNU ‘m4’ installed in his PATH; sometimes he even + needs particular versions of them. 2b. When a release is made and + a commit is made on the generated files, the other developers get + conflicts on the generated files when merging the local work back + to the repository. Although these conflicts are easy to resolve, + they are annoying. + + 3. The advantage is less work for the maintainers. The drawback is + that anyone who checks out the source not only needs tools like GNU + ‘automake’, GNU ‘autoconf’, GNU ‘m4’ installed in his PATH, but + also that he needs to perform a package specific pre-build step + before being able to "./configure; make". + + For the first and second approach, all files modified or brought in +by the occasional ‘gettextize’ invocation and update should be committed +into the repository. + + For the third approach, the maintainer can omit from the repository +all the files that ‘gettextize’ mentions as "copy". Instead, he adds to +the ‘configure.ac’ or ‘configure.in’ a line of the form + + AM_GNU_GETTEXT_VERSION(0.25.1) + +and adds to the package's pre-build script an invocation of ‘autopoint’. +For everyone who checks out the source, this ‘autopoint’ invocation will +copy into the right place the ‘gettext’ infrastructure files that have +been omitted from the repository. + + The version number used as argument to ‘AM_GNU_GETTEXT_VERSION’ is +the version of the ‘gettext’ infrastructure that the package wants to +use. It is also the minimum version number of the ‘autopoint’ program. +So, if you write ‘AM_GNU_GETTEXT_VERSION(0.11.5)’ then the developers +can have any version >= 0.11.5 installed; the package will work with the +0.11.5 infrastructure in all developers' builds. When the maintainer +then runs gettextize from, say, version 0.12.1 on the package, the +occurrence of ‘AM_GNU_GETTEXT_VERSION(0.11.5)’ will be changed into +‘AM_GNU_GETTEXT_VERSION(0.12.1)’, and all other developers that use the +CVS will henceforth need to have GNU ‘gettext’ 0.12.1 or newer +installed. + + +File: gettext.info, Node: Translations under Version Control, Next: autopoint Invocation, Prev: Files under Version Control, Up: Version Control Issues + +13.6.3 Put PO Files under Version Control +----------------------------------------- + + Since translations are valuable assets as well as the source code, it +would make sense to put them under version control. The GNU gettext +infrastructure supports two ways to deal with translations in the +context of a version controlled repository. + + 1. Both POT file and PO files are committed into the repository. + + 2. Only PO files are committed into the repository. + + If a POT file is absent when building, it will be generated by +scanning the source files with ‘xgettext’, and then the PO files are +regenerated as a dependency. On the other hand, some maintainers want +to keep the POT file unchanged during the development phase. So, even +if a POT file is present and older than the source code, it won't be +updated automatically. You can manually update it with ‘make +$(DOMAIN).pot-update’, and commit it at certain point. + + Special advices for particular version control systems: + + • Recent version control systems, Git for instance, ignore file's + timestamp. In that case, PO files can be accidentally updated even + if a POT file is not updated. To prevent this, you can set + ‘PO_DEPENDS_ON_POT’ variable to ‘no’ in the ‘Makevars’ file and do + ‘make update-po’ manually. + + • Location comments such as ‘#: lib/error.c:116’ are sometimes + annoying, since these comments are volatile and may introduce + unwanted change to the working copy when building. To mitigate + this, you can decide to omit those comments from the PO files in + the repository. + + This is possible with the ‘--no-location’ option of the ‘msgmerge’ + command (1). The drawback is that, if the location information is + needed, translators have to recover the location comments by + running ‘msgmerge’ again. + + ---------- Footnotes ---------- + + (1) you can also use it through the ‘MSGMERGE_OPTIONS’ option from +‘Makevars’ + + +File: gettext.info, Node: autopoint Invocation, Prev: Translations under Version Control, Up: Version Control Issues + +13.6.4 Invoking the ‘autopoint’ Program +--------------------------------------- + + autopoint [OPTION]... + + The ‘autopoint’ program copies standard gettext infrastructure files +into a source package. It extracts from a macro call of the form +‘AM_GNU_GETTEXT_VERSION(VERSION)’, found in the package's ‘configure.in’ +or ‘configure.ac’ file, the gettext version used by the package, and +copies the infrastructure files belonging to this version into the +package. + + To extract the latest available infrastructure which satisfies a +version requirement, then you can use the form +‘AM_GNU_GETTEXT_REQUIRE_VERSION(VERSION)’ instead. For example, if +gettext 0.25.1 is installed on your system and ‘0.19.1’ is requested, +then the infrastructure files of version 0.25.1 will be copied into a +source package. + +13.6.4.1 Options +................ + +‘-f’ +‘--force’ + Force overwriting of files that already exist. + +‘-n’ +‘--dry-run’ + Print modifications but don't perform them. All file copying + actions that ‘autopoint’ would normally execute are inhibited and + instead only listed on standard output. + +13.6.4.2 Informative output +........................... + +‘--help’ + Display this help and exit. + +‘--version’ + Output version information and exit. + + ‘autopoint’ supports the GNU ‘gettext’ versions from 0.10.35 to the +current one, 0.25.1. In order to apply ‘autopoint’ to a package using a +‘gettext’ version newer than 0.25.1, you need to install this same +version of GNU ‘gettext’ at least. + + In packages using GNU ‘automake’, an invocation of ‘autopoint’ should +be followed by invocations of ‘aclocal’ and then ‘autoconf’ and +‘autoheader’. The reason is that ‘autopoint’ installs some autoconf +macro files, which are used by ‘aclocal’ to create ‘aclocal.m4’, and the +latter is used by ‘autoconf’ to create the package's ‘configure’ script +and by ‘autoheader’ to create the package's ‘config.h.in’ include file +template. + + The name ‘autopoint’ is an abbreviation of ‘auto-po-intl-m4’; in +earlier versions, the tool copied or updated mostly files in the ‘po’, +‘intl’, ‘m4’ directories. + + +File: gettext.info, Node: Release Management, Prev: Version Control Issues, Up: Maintainers + +13.7 Creating a Distribution Tarball +==================================== + + In projects that use GNU ‘automake’, the usual commands for creating +a distribution tarball, ‘make dist’ or ‘make distcheck’, automatically +update the PO files as needed. + + If GNU ‘automake’ is not used, the maintainer needs to perform this +update before making a release: + + $ ./configure + $ (cd po; make update-po) + $ make distclean + + +File: gettext.info, Node: Installers, Next: Programming Languages, Prev: Maintainers, Up: Top + +14 The Installer's and Distributor's View +***************************************** + + By default, packages fully using GNU ‘gettext’, internally, are +installed in such a way as to allow translation of messages. At +_configuration_ time, those packages should automatically detect whether +the underlying host system already provides the GNU ‘gettext’ functions. +If not, the GNU ‘gettext’ library should be automatically prepared and +used. Installers may use special options at configuration time for +changing this behavior. The command ‘./configure +--with-included-gettext’ bypasses system ‘gettext’ to use the included +GNU ‘gettext’ instead, while ‘./configure --disable-nls’ produces +programs totally unable to translate messages. + + Internationalized packages have usually many ‘LL.po’ or ‘LL_CC.po’ +files, where + + • LL gives an ISO 639 two-letter code identifying the language. For + some languages, a two-letter code does not exist, and a + three-letter code is used instead. + • The optional CC is an ISO 3166 two-letter code of a country or + territory. + +Unless translations are disabled, all those available are installed +together with the package. However, the environment variable ‘LINGUAS’ +may be set, prior to configuration, to limit the installed set. +‘LINGUAS’ should then contain a space separated list of locale names (of +the form ‘LL’ or ‘LL_CC’), stating which languages or language variants +are allowed. + + GNU ‘gettext’ uses *.its and *.loc files (*note Preparing ITS +Rules::) from other packages, provided they are installed in +‘PREFIX/share/gettext/its/’, where ‘PREFIX’ is the value of the +‘--prefix’ option passed to ‘gettext’'s ‘configure’ script. So, this is +the canonical location for installing *.its and *.loc files from other +packages. + + +File: gettext.info, Node: Programming Languages, Next: Data Formats, Prev: Installers, Up: Top + +15 Other Programming Languages +****************************** + + While the presentation of ‘gettext’ focuses mostly on C and +implicitly applies to C++ as well, its scope is far broader than that: +Many programming languages, scripting languages and other textual data +like GUI resources or package descriptions can make use of the gettext +approach. + +* Menu: + +* Language Implementors:: The Language Implementor's View +* Programmers for other Languages:: The Programmer's View +* Translators for other Languages:: The Translator's View +* Maintainers for other Languages:: The Maintainer's View +* List of Programming Languages:: Individual Programming Languages + + +File: gettext.info, Node: Language Implementors, Next: Programmers for other Languages, Up: Programming Languages + +15.1 The Language Implementor's View +==================================== + + All programming and scripting languages that have the notion of +strings are eligible to supporting ‘gettext’. Supporting ‘gettext’ +means the following: + + 1. You should add to the language a syntax for translatable strings. + In principle, a function call of ‘gettext’ would do, but a + shorthand syntax helps keeping the legibility of internationalized + programs. For example, in C we use the syntax ‘_("string")’, and + in GNU awk we use the shorthand ‘_"string"’. + + 2. You should arrange that evaluation of such a translatable string at + runtime calls the ‘gettext’ function, or performs equivalent + processing. + + 3. Similarly, you should make the functions ‘ngettext’, ‘dcgettext’, + ‘dcngettext’ available from within the language. These functions + are less often used, but are nevertheless necessary for particular + purposes: ‘ngettext’ for correct plural handling, and ‘dcgettext’ + and ‘dcngettext’ for obeying other locale-related environment + variables than ‘LC_MESSAGES’, such as ‘LC_TIME’ or ‘LC_MONETARY’. + For these latter functions, you need to make the ‘LC_*’ constants, + available in the C header ‘’, referenceable from within + the language, usually either as enumeration values or as strings. + + 4. You should allow the programmer to designate a message domain, + either by making the ‘textdomain’ function available from within + the language, or by introducing a magic variable called + ‘TEXTDOMAIN’. Similarly, you should allow the programmer to + designate where to search for message catalogs, by providing access + to the ‘bindtextdomain’ function or -- on native Windows platforms + -- to the ‘wbindtextdomain’ function. + + 5. You should either perform a ‘setlocale (LC_ALL, "")’ call during + the startup of your language runtime, or allow the programmer to do + so. Remember that gettext will act as a no-op if the ‘LC_MESSAGES’ + and ‘LC_CTYPE’ locale categories are not both set. + + 6. A programmer should have a way to extract translatable strings from + a program into a PO file. The GNU ‘xgettext’ program is being + extended to support very different programming languages. Please + contact the GNU ‘gettext’ maintainers to help them doing this. The + GNU ‘gettext’ maintainers will need from you a formal description + of the lexical structure of source files. It should answer the + questions: + • What does a token look like? + • What does a string literal look like? What escape characters + exist inside a string? + • What escape characters exist outside of strings? If Unicode + escapes are supported, are they applied before or after + tokenization? + • What is the syntax for function calls? How are consecutive + arguments in the same function call separated? + • What is the syntax for comments? + Based on this description, the GNU ‘gettext’ maintainers can add + support to ‘xgettext’. + + If the string extractor is best integrated into your language's + parser, GNU ‘xgettext’ can function as a front end to your string + extractor. + + 7. The language's library should have a string formatting facility. + Additionally: + 1. There must be a way, in the format string, to denote the + arguments by a positional number or a name. This is needed + because for some languages and some messages with more than + one substitutable argument, the translation will need to + output the substituted arguments in different order. *Note + c-format Flag::. + 2. The syntax of format strings must be documented in a way that + translators can understand. The GNU ‘gettext’ manual will be + extended to include a pointer to this documentation. + Based on this, the GNU ‘gettext’ maintainers can add a format + string equivalence checker to ‘msgfmt’, so that translators get + told immediately when they have made a mistake during the + translation of a format string. + + 8. If the language has more than one implementation, and not all of + the implementations use ‘gettext’, but the programs should be + portable across implementations, you should provide a no-i18n + emulation, that makes the other implementations accept programs + written for yours, without actually translating the strings. + + 9. To help the programmer in the task of marking translatable strings, + which is sometimes performed using the Emacs PO mode (*note + Marking::), you are welcome to contact the GNU ‘gettext’ + maintainers, so they can add support for your language to + ‘po-mode.el’. + + On the implementation side, two approaches are possible, with +different effects on portability and copyright: + + • You may link against GNU ‘gettext’ functions if they are found in + the C library. For example, an autoconf test for ‘gettext()’ and + ‘ngettext()’ will detect this situation. For the moment, this test + will succeed on GNU systems and on Solaris 11 platforms. No severe + copyright restrictions apply, except if you want to distribute + statically linked binaries. + + • You may emulate or reimplement the GNU ‘gettext’ functionality. + This has the advantage of full portability and no copyright + restrictions, but also the drawback that you have to reimplement + the GNU ‘gettext’ features (such as the ‘LANGUAGE’ environment + variable, the locale aliases database, the automatic charset + conversion, and plural handling). + + +File: gettext.info, Node: Programmers for other Languages, Next: Translators for other Languages, Prev: Language Implementors, Up: Programming Languages + +15.2 The Programmer's View +========================== + + For the programmer, the general procedure is the same as for the C +language. The Emacs PO mode marking supports other languages, and the +GNU ‘xgettext’ string extractor recognizes other languages based on the +file extension or a command-line option. In some languages, ‘setlocale’ +is not needed because it is already performed by the underlying language +runtime. + + +File: gettext.info, Node: Translators for other Languages, Next: Maintainers for other Languages, Prev: Programmers for other Languages, Up: Programming Languages + +15.3 The Translator's View +========================== + + The translator works exactly as in the C language case. The only +difference is that when translating format strings, she has to be aware +of the language's particular syntax for positional arguments in format +strings. + +* Menu: + +* c-format:: C Format Strings +* objc-format:: Objective C Format Strings +* c++-format:: C++ Format Strings +* python-format:: Python Format Strings +* java-format:: Java Format Strings +* csharp-format:: C# Format Strings +* javascript-format:: JavaScript Format Strings +* scheme-format:: Scheme Format Strings +* lisp-format:: Lisp Format Strings +* elisp-format:: Emacs Lisp Format Strings +* librep-format:: librep Format Strings +* rust-format:: Rust Format Strings +* go-format:: Go Format Strings +* ruby-format:: Ruby Format Strings +* sh-format:: Shell Format Strings +* awk-format:: awk Format Strings +* lua-format:: Lua Format Strings +* object-pascal-format:: Object Pascal Format Strings +* modula2-format:: Modula-2 Format Strings +* d-format:: D Format Strings +* smalltalk-format:: Smalltalk Format Strings +* qt-format:: Qt Format Strings +* qt-plural-format:: Qt Plural Format Strings +* kde-format:: KDE Format Strings +* kde-kuit-format:: KUIT Format Strings +* boost-format:: Boost Format Strings +* tcl-format:: Tcl Format Strings +* perl-format:: Perl Format Strings +* php-format:: PHP Format Strings +* gcc-internal-format:: GCC internal Format Strings +* gfc-internal-format:: GFC internal Format Strings +* ycp-format:: YCP Format Strings + + +File: gettext.info, Node: c-format, Next: objc-format, Up: Translators for other Languages + +15.3.1 C Format Strings +----------------------- + + C format strings are described in POSIX (IEEE P1003.1 2001), section +XSH 3 fprintf(), +. +See also the fprintf() manual page man fprintf. + + Although format strings with positions that reorder arguments, such +as + + "Only %2$d bytes free on '%1$s'." + +which is semantically equivalent to + + "'%s' has only %d bytes free." + +are a POSIX/XSI feature and not specified by ISO C 99, translators can +rely on this reordering ability: On the few platforms where ‘printf()’, +‘fprintf()’ etc. don't support this feature natively, ‘libintl.a’ or +‘libintl.so’ provides replacement functions, and GNU ‘’ +activates these replacement functions automatically. + + C format strings can contain placeholders that reference macros +defined in ISO C 99 ‘’. For example, ‘’ references +the macro ‘PRId64’. The value of such a macro is system-dependent, but +programmers and translators do not need to know this value. ISO C 23 +specifies system-independent format string elements, for example, +‘"%w64d"’ instead of ‘"%" PRId64’; however, as of 2024, these are not +implemented across systems and therefore cannot be used portably. + + As a special feature for Farsi (Persian) and maybe Arabic, +translators can insert an ‘I’ flag into numeric format directives. For +example, the translation of ‘"%d"’ can be ‘"%Id"’. The effect of this +flag, on systems with GNU ‘libc’, is that in the output, the ASCII +digits are replaced with the ‘outdigits’ defined in the ‘LC_CTYPE’ +locale category. On other systems, the ‘gettext’ function removes this +flag, so that it has no effect. + + Note that the programmer should _not_ put this flag into the +untranslated string. (Putting the ‘I’ format directive flag into an +MSGID string would lead to undefined behaviour on platforms without +glibc when NLS is disabled.) + + +File: gettext.info, Node: objc-format, Next: c++-format, Prev: c-format, Up: Translators for other Languages + +15.3.2 Objective C Format Strings +--------------------------------- + + Objective C format strings are like C format strings. They support +an additional format directive: "%@", which when executed consumes an +argument of type ‘Object *’. + + Objective C format strings, like C format strings, can contain +placeholders that reference macros defined in ISO C 99 ‘’. + + +File: gettext.info, Node: c++-format, Next: python-format, Prev: objc-format, Up: Translators for other Languages + +15.3.3 C++ Format Strings +------------------------- + + C++ format strings are described in ISO C++ 20, namely in +, +section 20.20.2 Format string [format.string]. + + An easier-to-read description is found at + and +. + + +File: gettext.info, Node: python-format, Next: java-format, Prev: c++-format, Up: Translators for other Languages + +15.3.4 Python Format Strings +---------------------------- + + There are two kinds of format strings in Python: those acceptable to +the Python built-in format operator ‘%’, labelled as ‘python-format’, +and those acceptable to the ‘format’ method of the ‘str’ object. + + Python ‘%’ format strings are described in Python Library reference / +5. Built-in Types / 5.6. Sequence Types / +5.6.2. String Formatting Operations. +. + + Python brace format strings are described in +PEP 3101 - Advanced String Formatting, +. + + +File: gettext.info, Node: java-format, Next: csharp-format, Prev: python-format, Up: Translators for other Languages + +15.3.5 Java Format Strings +-------------------------- + + There are two kinds of format strings in Java: those acceptable to +the ‘MessageFormat.format’ function, labelled as ‘java-format’, and +those acceptable to the ‘String.format’ and ‘PrintStream.printf’ +functions, labelled as ‘java-printf-format’. + + Java format strings are described in the JDK documentation for class +‘java.text.MessageFormat’, +. +See also the ICU documentation +. + + Java ‘printf’ format strings are described in the JDK documentation +for class ‘java.util.Formatter’, +. + + +File: gettext.info, Node: csharp-format, Next: javascript-format, Prev: java-format, Up: Translators for other Languages + +15.3.6 C# Format Strings +------------------------ + + C# format strings are described in the .NET documentation for class +‘System.String’ and in +. + + +File: gettext.info, Node: javascript-format, Next: scheme-format, Prev: csharp-format, Up: Translators for other Languages + +15.3.7 JavaScript Format Strings +-------------------------------- + + Although JavaScript specification itself does not define any format +strings, many JavaScript implementations provide printf-like functions. +‘xgettext’ understands a set of common format strings used in popular +JavaScript implementations including Gjs, Seed, and Node.JS. In such a +format string, a directive starts with ‘%’ and is finished by a +specifier: ‘%’ denotes a literal percent sign, ‘c’ denotes a character, +‘s’ denotes a string, ‘b’, ‘d’, ‘o’, ‘x’, ‘X’ denote an integer, ‘f’ +denotes floating-point number, ‘j’ denotes a JSON object. + + +File: gettext.info, Node: scheme-format, Next: lisp-format, Prev: javascript-format, Up: Translators for other Languages + +15.3.8 Scheme Format Strings +---------------------------- + + Scheme format strings are documented in the SLIB manual, section +Format Specification. + + +File: gettext.info, Node: lisp-format, Next: elisp-format, Prev: scheme-format, Up: Translators for other Languages + +15.3.9 Lisp Format Strings +-------------------------- + + Lisp format strings are described in the Common Lisp HyperSpec, +chapter 22.3 Formatted Output, +. + + +File: gettext.info, Node: elisp-format, Next: librep-format, Prev: lisp-format, Up: Translators for other Languages + +15.3.10 Emacs Lisp Format Strings +--------------------------------- + + Emacs Lisp format strings are documented in the Emacs Lisp reference, +section Formatting Strings, +. +Note that as of version 21, XEmacs supports numbered argument +specifications in format strings while FSF Emacs doesn't. + + +File: gettext.info, Node: librep-format, Next: rust-format, Prev: elisp-format, Up: Translators for other Languages + +15.3.11 librep Format Strings +----------------------------- + + librep format strings are documented in the librep manual, section +Formatted Output, +, +. + + +File: gettext.info, Node: rust-format, Next: go-format, Prev: librep-format, Up: Translators for other Languages + +15.3.12 Rust Format Strings +--------------------------- + + Rust format strings are those supported by the ‘formatx’ library +. These are those supported by the +‘format!’ built-in with the +restrictions listed in , section +"Limitations". + + A Rust format string consists of + • an opening brace ‘{’, + • an optional non-empty sequence of digits or an optional identifier, + • optionally, a ‘:’ and a format specifier, where a format specifier + is of the form + ‘[[FILL]ALIGN][SIGN][#][0][MINIMUMWIDTH][.PRECISION][TYPE]’ where + - the FILL character is any character, + - the ALIGN flag is one of ‘<’, ‘>’, ‘^’, + - the SIGN is one of ‘+’, ‘-’, + - the # flag is ‘#’, + - the 0 flag is ‘0’, + - MINIMUMWIDTH is a non-empty sequence of digits, + - PRECISION is a non-empty sequence of digits, + - TYPE is ‘?’, + • optional white-space, + • a closing brace ‘}’. +Brace characters ‘{’ and ‘}’ can be escaped by doubling them: ‘{{’ and +‘}}’. + + +File: gettext.info, Node: go-format, Next: ruby-format, Prev: rust-format, Up: Translators for other Languages + +15.3.13 Go Format Strings +------------------------- + + Go format strings are documented on the Go packages site, for package +‘fmt’, at . + + +File: gettext.info, Node: ruby-format, Next: sh-format, Prev: go-format, Up: Translators for other Languages + +15.3.14 Ruby Format Strings +--------------------------- + + Ruby format strings are described in the documentation of the Ruby +functions ‘format’ and ‘sprintf’, in +. + + There are two kinds of format strings in Ruby: + • Those that take a list of arguments without names. They support + argument reordering by use of the ‘%N$’ syntax. Note that if one + argument uses this syntax, all must use this syntax. + • Those that take a hash table, containing named arguments. The + syntax is ‘%’. Note that ‘%{NAME}’ is equivalent to + ‘%s’. + + +File: gettext.info, Node: sh-format, Next: awk-format, Prev: ruby-format, Up: Translators for other Languages + +15.3.15 Shell Format Strings +---------------------------- + + Shell format strings, as supported by GNU gettext and the ‘envsubst’ +program, are strings with references to shell variables in the form +‘$VARIABLE’ or ‘${VARIABLE}’. References of the form +‘${VARIABLE-DEFAULT}’, ‘${VARIABLE:-DEFAULT}’, ‘${VARIABLE=DEFAULT}’, +‘${VARIABLE:=DEFAULT}’, ‘${VARIABLE+REPLACEMENT}’, +‘${VARIABLE:+REPLACEMENT}’, ‘${VARIABLE?IGNORED}’, +‘${VARIABLE:?IGNORED}’, that would be valid inside shell scripts, are +not supported. The VARIABLE names must consist solely of alphanumeric +or underscore ASCII characters, not start with a digit and be nonempty; +otherwise such a variable reference is ignored. + + +File: gettext.info, Node: awk-format, Next: lua-format, Prev: sh-format, Up: Translators for other Languages + +15.3.16 awk Format Strings +-------------------------- + + awk format strings are described in the gawk documentation, section +Printf, . + + +File: gettext.info, Node: lua-format, Next: object-pascal-format, Prev: awk-format, Up: Translators for other Languages + +15.3.17 Lua Format Strings +-------------------------- + + Lua format strings are described in the Lua reference manual, section +String Manipulation, +. + + +File: gettext.info, Node: object-pascal-format, Next: modula2-format, Prev: lua-format, Up: Translators for other Languages + +15.3.18 Object Pascal Format Strings +------------------------------------ + + Object Pascal format strings are described in the documentation of +the Free Pascal runtime library, section Format, +. + + +File: gettext.info, Node: modula2-format, Next: d-format, Prev: object-pascal-format, Up: Translators for other Languages + +15.3.19 Modula-2 Format Strings +------------------------------- + + Modula-2 format strings are defined as follows: + 1. Escape sequences are processed. These escape sequences are + understood: ‘\a’, ‘\b’, ‘\e’, ‘\f’, ‘\n’, ‘\r’, ‘\xHEX-DIGITS’, + ‘\OCTAL-DIGITS’. Other than that, a backslash is ignored. + 2. A directive consists of + • a ‘%’ character, + • optionally a flag character ‘-’, + • optionally a flag character ‘0’, + • optionally a width specification (a nonnegative integer), + • and finally a specifier: ‘s’ that formats a string, ‘c’ that + formats a character, ‘d’ and ‘u’, that format a + (signed/unsigned) integer in decimal, or ‘x’, that formats an + unsigned integer in hexadecimal. + There is also the directive ‘%%’, that produces a single percent + character. + + +File: gettext.info, Node: d-format, Next: smalltalk-format, Prev: modula2-format, Up: Translators for other Languages + +15.3.20 D Format Strings +------------------------ + + D format strings are described in the documentation of the D module +‘std.format’, at . + + +File: gettext.info, Node: smalltalk-format, Next: qt-format, Prev: d-format, Up: Translators for other Languages + +15.3.21 Smalltalk Format Strings +-------------------------------- + + Smalltalk format strings are described in the GNU Smalltalk +documentation, class ‘CharArray’, methods ‘bindWith:’ and +‘bindWithArguments:’. +. +In summary, a directive starts with ‘%’ and is followed by ‘%’ or a +nonzero digit (‘1’ to ‘9’). + + +File: gettext.info, Node: qt-format, Next: qt-plural-format, Prev: smalltalk-format, Up: Translators for other Languages + +15.3.22 Qt Format Strings +------------------------- + + Qt format strings are described in the documentation of the QString +class . In summary, a +directive consists of a ‘%’ followed by a digit. The same directive +cannot occur more than once in a format string. + + +File: gettext.info, Node: qt-plural-format, Next: kde-format, Prev: qt-format, Up: Translators for other Languages + +15.3.23 Qt Format Strings +------------------------- + + Qt format strings are described in the documentation of the +QObject::tr method . In +summary, the only allowed directive is ‘%n’. + + +File: gettext.info, Node: kde-format, Next: kde-kuit-format, Prev: qt-plural-format, Up: Translators for other Languages + +15.3.24 KDE Format Strings +-------------------------- + + KDE 4 format strings are defined as follows: A directive consists of +a ‘%’ followed by a non-zero decimal number. If a ‘%n’ occurs in a +format strings, all of ‘%1’, ..., ‘%(n-1)’ must occur as well, except +possibly one of them. + + +File: gettext.info, Node: kde-kuit-format, Next: boost-format, Prev: kde-format, Up: Translators for other Languages + +15.3.25 KUIT Format Strings +--------------------------- + + KUIT (KDE User Interface Text) is compatible with KDE 4 format +strings, while it also allows programmers to add semantic information to +a format string, through XML markup tags. For example, if the first +format directive in a string is a filename, programmers could indicate +that with a ‘filename’ tag, like ‘%1’. + + KUIT format strings are described in +. + + +File: gettext.info, Node: boost-format, Next: tcl-format, Prev: kde-kuit-format, Up: Translators for other Languages + +15.3.26 Boost Format Strings +---------------------------- + + Boost format strings are described in the documentation of the +‘boost::format’ class, at +. In summary, a +directive has either the same syntax as in a C format string, such as +‘%1$+5d’, or may be surrounded by vertical bars, such as ‘%|1$+5d|’ or +‘%|1$+5|’, or consists of just an argument number between percent signs, +such as ‘%1%’. + + +File: gettext.info, Node: tcl-format, Next: perl-format, Prev: boost-format, Up: Translators for other Languages + +15.3.27 Tcl Format Strings +-------------------------- + + Tcl format strings are described in the ‘format.n’ manual page, +. + + +File: gettext.info, Node: perl-format, Next: php-format, Prev: tcl-format, Up: Translators for other Languages + +15.3.28 Perl Format Strings +--------------------------- + + There are two kinds of format strings in Perl: those acceptable to +the Perl built-in function ‘printf’, labelled as ‘perl-format’, and +those acceptable to the ‘libintl-perl’ function ‘__x’, labelled as +‘perl-brace-format’. + + Perl ‘printf’ format strings are described in the ‘sprintf’ section +of ‘man perlfunc’. + + Perl brace format strings are described in the +‘Locale::TextDomain(3pm)’ manual page of the CPAN package libintl-perl. +In brief, Perl format uses placeholders put between braces (‘{’ and +‘}’). The placeholder must have the syntax of simple identifiers. + + +File: gettext.info, Node: php-format, Next: gcc-internal-format, Prev: perl-format, Up: Translators for other Languages + +15.3.29 PHP Format Strings +-------------------------- + + PHP format strings are described in the documentation of the PHP +function ‘sprintf’, in ‘phpdoc/manual/function.sprintf.html’ or +. + + +File: gettext.info, Node: gcc-internal-format, Next: gfc-internal-format, Prev: php-format, Up: Translators for other Languages + +15.3.30 GCC internal Format Strings +----------------------------------- + + These format strings are used inside the GCC sources. In such a +format string, a directive starts with ‘%’, is optionally followed by a +size specifier ‘l’, an optional flag ‘+’, another optional flag ‘#’, and +is finished by a specifier: ‘%’ denotes a literal percent sign, ‘c’ +denotes a character, ‘s’ denotes a string, ‘i’ and ‘d’ denote an +integer, ‘o’, ‘u’, ‘x’ denote an unsigned integer, ‘.*s’ denotes a +string preceded by a width specification, ‘H’ denotes a ‘location_t *’ +pointer, ‘D’ denotes a general declaration, ‘F’ denotes a function +declaration, ‘T’ denotes a type, ‘A’ denotes a function argument, ‘C’ +denotes a tree code, ‘E’ denotes an expression, ‘L’ denotes a +programming language, ‘O’ denotes a binary operator, ‘P’ denotes a +function parameter, ‘Q’ denotes an assignment operator, ‘V’ denotes a +const/volatile qualifier. + + +File: gettext.info, Node: gfc-internal-format, Next: ycp-format, Prev: gcc-internal-format, Up: Translators for other Languages + +15.3.31 GFC internal Format Strings +----------------------------------- + + These format strings are used inside the GNU Fortran Compiler +sources, that is, the Fortran frontend in the GCC sources. In such a +format string, a directive starts with ‘%’ and is finished by a +specifier: ‘%’ denotes a literal percent sign, ‘C’ denotes the current +source location, ‘L’ denotes a source location, ‘c’ denotes a character, +‘s’ denotes a string, ‘i’ and ‘d’ denote an integer, ‘u’ denotes an +unsigned integer. ‘i’, ‘d’, and ‘u’ may be preceded by a size specifier +‘l’. + + +File: gettext.info, Node: ycp-format, Prev: gfc-internal-format, Up: Translators for other Languages + +15.3.32 YCP Format Strings +-------------------------- + + YCP sformat strings are described in the libycp documentation +. In summary, a +directive starts with ‘%’ and is followed by ‘%’ or a nonzero digit (‘1’ +to ‘9’). + + +File: gettext.info, Node: Maintainers for other Languages, Next: List of Programming Languages, Prev: Translators for other Languages, Up: Programming Languages + +15.4 The Maintainer's View +========================== + + For the maintainer, the general procedure differs from the C language +case: + + • If only a single programming language is used, the + ‘XGETTEXT_OPTIONS’ variable in ‘po/Makevars’ (*note po/Makevars::) + should be adjusted to match the ‘xgettext’ options for that + particular programming language. If the package uses more than one + programming language with ‘gettext’ support, it becomes necessary + to change the POT file construction rule in ‘po/Makefile.in.in’. + It is recommended to make one ‘xgettext’ invocation per programming + language, each with the options appropriate for that language, and + to combine the resulting files using ‘msgcat’. + + +File: gettext.info, Node: List of Programming Languages, Prev: Maintainers for other Languages, Up: Programming Languages + +15.5 Individual Programming Languages +===================================== + +* Menu: + +* C:: C, C++, Objective C +* Python:: Python +* Java:: Java +* C#:: C# +* JavaScript:: JavaScript +* TypeScript:: TypeScript +* Scheme:: GNU guile - Scheme +* Common Lisp:: GNU clisp - Common Lisp +* clisp C:: GNU clisp C sources +* Emacs Lisp:: Emacs Lisp +* librep:: librep +* Rust:: Rust +* Go:: Go +* Ruby:: Ruby +* sh:: sh - Shell Script +* bash:: bash - Bourne-Again Shell Script +* gawk:: GNU awk +* Lua:: Lua +* Pascal:: Pascal - Free Pascal Compiler +* Modula-2:: Modula-2 +* D:: D +* Smalltalk:: GNU Smalltalk +* Vala:: Vala +* wxWidgets:: wxWidgets library +* Tcl:: Tcl - Tk's scripting language +* Perl:: Perl +* PHP:: PHP Hypertext Preprocessor +* Pike:: Pike +* GCC-source:: GNU Compiler Collection sources +* YCP:: YCP - YaST2 scripting language + + +File: gettext.info, Node: C, Next: Python, Up: List of Programming Languages + +15.5.1 C, C++, Objective C +-------------------------- + +RPMs + gcc, gpp, gobjc, glibc, gettext + +Ubuntu packages + gcc, g++, gobjc, libc6-dev, libasprintf-dev + +File extension + For C: ‘c’, ‘h’. + For C++: ‘C’, ‘c++’, ‘cc’, ‘cxx’, ‘cpp’, ‘hpp’. + For Objective C: ‘m’. + +String syntax + ‘"abc"’ + +gettext shorthand + ‘_("abc")’ + +gettext/ngettext functions + ‘gettext’, ‘dgettext’, ‘dcgettext’, ‘ngettext’, ‘dngettext’, + ‘dcngettext’ + +textdomain + ‘textdomain’ function + +bindtextdomain + ‘bindtextdomain’ and ‘wbindtextdomain’ functions + +setlocale + Programmer must call ‘setlocale (LC_ALL, "")’ + +Prerequisite + ‘#include ’ + ‘#include ’ + ‘#define _(string) gettext (string)’ + +Use or emulate GNU gettext + Use + +Extractor + ‘xgettext -k_’ + +Formatting with positions + ‘fprintf "%2$d %1$d"’ + In C++: ‘autosprintf "%2$d %1$d"’ (*note Introduction: + (autosprintf)Top.) + In C++ 20 or newer: ‘std::vformat "{1} {0}"’ + +Portability + autoconf (gettext.m4) and #if ENABLE_NLS + +po-mode marking + yes + + The following examples are available in the ‘examples’ directory: +‘hello-c’, ‘hello-c-gnome2’, ‘hello-c-gnome3’, ‘hello-c-http’, +‘hello-c++’, ‘hello-c++20’, ‘hello-c++-qt’, ‘hello-c++-kde’, +‘hello-c++-gnome2’, ‘hello-c++-gnome3’, ‘hello-c++-wxwidgets’, +‘hello-objc’, ‘hello-objc-gnustep’, ‘hello-objc-gnome2’. + + +File: gettext.info, Node: Python, Next: Java, Prev: C, Up: List of Programming Languages + +15.5.2 Python +------------- + +RPMs + python + +Ubuntu packages + python + +File extension + ‘py’ + +String syntax + ‘'abc'’, ‘u'abc'’, ‘r'abc'’, ‘ur'abc'’, + ‘"abc"’, ‘u"abc"’, ‘r"abc"’, ‘ur"abc"’, + ‘'''abc'''’, ‘u'''abc'''’, ‘r'''abc'''’, ‘ur'''abc'''’, + ‘"""abc"""’, ‘u"""abc"""’, ‘r"""abc"""’, ‘ur"""abc"""’ + +gettext shorthand + ‘_('abc')’ etc. + +gettext/ngettext functions + ‘gettext.gettext’, ‘gettext.dgettext’, ‘gettext.ngettext’, + ‘gettext.dngettext’, also ‘ugettext’, ‘ungettext’ + +textdomain + ‘gettext.textdomain’ function, or ‘gettext.install(DOMAIN)’ + function + +bindtextdomain + ‘gettext.bindtextdomain’ function, or + ‘gettext.install(DOMAIN,LOCALEDIR)’ function + +setlocale + not used by the gettext emulation + +Prerequisite + ‘import gettext’ + +Use or emulate GNU gettext + emulate + +Extractor + ‘xgettext’ + +Formatting with positions + ‘'...%(ident)d...' % { 'ident': value }’ + ‘'...{ident}...'.format(ident=value)’ (see PEP 3101) + +Portability + fully portable + +po-mode marking + -- + + An example is available in the ‘examples’ directory: ‘hello-python’. + + A note about format strings: Python supports format strings with +unnamed arguments, such as ‘'...%d...'’, and format strings with named +arguments, such as ‘'...%(ident)d...'’. The latter are preferable for +internationalized programs, for two reasons: + + • When a format string takes more than one argument, the translator + can provide a translation that uses the arguments in a different + order, if the format string uses named arguments. For example, the + translator can reformulate + "'%(volume)s' has only %(freespace)d bytes free." + to + "Only %(freespace)d bytes free on '%(volume)s'." + Additionally, the identifiers also provide some context to the + translator. + + • In the context of plural forms, the format string used for the + singular form does not use the numeric argument in many languages. + Even in English, one prefers to write ‘"one hour"’ instead of ‘"1 + hour"’. Omitting individual arguments from format strings like + this is only possible with the named argument syntax. (With + unnamed arguments, Python - unlike C - verifies that the format + string uses all supplied arguments.) + + A note about f-strings (PEP 498): ‘xgettext’ + • syntactically recognizes f-strings, + • is able to extract f-strings that contain no sub-expressions. +However, ‘xgettext’ does not extract f-strings marked for translation +that contain sub-expressions. This will not work as expected: + _(f"The file {file[i]} does not exist.") +because the translator is generally not a programmer and should thus not +be confronted with expressions from the programming language. + +Related software +---------------- + + An internationalization system based on GNU gettext and PO files is +Babel (https://babel.pocoo.org/). + + +File: gettext.info, Node: Java, Next: C#, Prev: Python, Up: List of Programming Languages + +15.5.3 Java +----------- + +RPMs + java, java2 + +Ubuntu packages + default-jdk + +File extension + ‘java’ + +String syntax + "abc", """text block""" + +gettext shorthand + i18n("abc") + +gettext/ngettext functions + ‘GettextResource.gettext’, ‘GettextResource.ngettext’, + ‘GettextResource.pgettext’, ‘GettextResource.npgettext’ + +textdomain + --, use ‘ResourceBundle.getResource’ instead + +bindtextdomain + --, use CLASSPATH instead + +setlocale + automatic + +Prerequisite + -- + +Use or emulate GNU gettext + --, uses a Java specific message catalog format + +Extractor + ‘xgettext -ki18n’ + +Formatting with positions + ‘MessageFormat.format "{1,number} {0,number}"’ or ‘String.format + "%2$d %1$d"’ + +Portability + fully portable + +po-mode marking + -- + + Before marking strings as internationalizable, uses of the string +concatenation operator need to be converted to ‘MessageFormat’ +applications. For example, ‘"file "+filename+" not found"’ becomes +‘MessageFormat.format("file {0} not found", new Object[] { filename })’. +Only after this is done, can the strings be marked and extracted. + + GNU gettext uses the native Java internationalization mechanism, +namely ‘ResourceBundle’s. There are two formats of ‘ResourceBundle’s: +‘.properties’ files and ‘.class’ files. The ‘.properties’ format is a +text file which the translators can directly edit, like PO files, but +which doesn't support plural forms. Whereas the ‘.class’ format is +compiled from ‘.java’ source code and can support plural forms (provided +it is accessed through an appropriate API, see below). + + To convert a PO file to a ‘.properties’ file, the ‘msgcat’ program +can be used with the option ‘--properties-output’. To convert a +‘.properties’ file back to a PO file, the ‘msgcat’ program can be used +with the option ‘--properties-input’. All the tools that manipulate PO +files can work with ‘.properties’ files as well, if given the +‘--properties-input’ and/or ‘--properties-output’ option. + + To convert a PO file to a ResourceBundle class, the ‘msgfmt’ program +can be used with the option ‘--java’ or ‘--java2’. To convert a +ResourceBundle back to a PO file, the ‘msgunfmt’ program can be used +with the option ‘--java’. + + Two different programmatic APIs can be used to access +ResourceBundles. Note that both APIs work with all kinds of +ResourceBundles, whether GNU gettext generated classes, or other +‘.class’ or ‘.properties’ files. + + 1. The ‘java.util.ResourceBundle’ API. + + In particular, its ‘getString’ function returns a string + translation. Note that a missing translation yields a + ‘MissingResourceException’. + + This has the advantage of being the standard API. And it does not + require any additional libraries, only the ‘msgcat’ generated + ‘.properties’ files or the ‘msgfmt’ generated ‘.class’ files. But + it cannot do plural handling, even if the resource was generated by + ‘msgfmt’ from a PO file with plural handling. + + 2. The ‘gnu.gettext.GettextResource’ API. + + Reference documentation in Javadoc 1.1 style format is in the + javadoc2 directory (javadoc2/index.html). + + Its ‘gettext’ function returns a string translation. Note that + when a translation is missing, the MSGID argument is returned + unchanged. + + This has the advantage of having the ‘ngettext’ function for plural + handling and the ‘pgettext’ and ‘npgettext’ for strings constraint + to a particular context. + + To use this API, one needs the ‘libintl.jar’ file which is part of + the GNU gettext package and distributed under the LGPL. + + Four examples, using the second API, are available in the ‘examples’ +directory: ‘hello-java’, ‘hello-java-awt’, ‘hello-java-swing’, +‘hello-java-qtjambi’. + + Now, to make use of the API and define a shorthand for ‘getString’, +there are three idioms that you can choose from: + + • (This one assumes Java 1.5 or newer.) In a unique class of your + project, say ‘Util’, define a static variable holding the + ‘ResourceBundle’ instance and the shorthand: + + private static ResourceBundle myResources = + ResourceBundle.getBundle("domain-name"); + public static String i18n(String s) { + return myResources.getString(s); + } + + All classes containing internationalized strings then contain + + import static Util.i18n; + + and the shorthand is used like this: + + System.out.println(i18n("Operation completed.")); + + • In a unique class of your project, say ‘Util’, define a static + variable holding the ‘ResourceBundle’ instance: + + public static ResourceBundle myResources = + ResourceBundle.getBundle("domain-name"); + + All classes containing internationalized strings then contain + + private static ResourceBundle res = Util.myResources; + private static String i18n(String s) { return res.getString(s); } + + and the shorthand is used like this: + + System.out.println(i18n("Operation completed.")); + + • You add a class with a very short name, say ‘S’, containing just + the definition of the resource bundle and of the shorthand: + + public class S { + public static ResourceBundle myResources = + ResourceBundle.getBundle("domain-name"); + public static String i18n(String s) { + return myResources.getString(s); + } + } + + and the shorthand is used like this: + + System.out.println(S.i18n("Operation completed.")); + + Which of the three idioms you choose, will depend on whether your +project requires portability to Java versions prior to Java 1.5 and, if +so, whether copying two lines of codes into every class is more +acceptable in your project than a class with a single-letter name. + + +File: gettext.info, Node: C#, Next: JavaScript, Prev: Java, Up: List of Programming Languages + +15.5.4 C# +--------- + +RPMs + mono or dotnet8.0 + +Ubuntu packages + mono-mcs or dotnet8 + +File extension + ‘cs’ + +String syntax + ‘"abc"’, ‘@"abc"’ + +gettext shorthand + _("abc") + +gettext/ngettext functions + ‘GettextResourceManager.GetString’, + ‘GettextResourceManager.GetPluralString’ + ‘GettextResourceManager.GetParticularString’ + ‘GettextResourceManager.GetParticularPluralString’ + +textdomain + ‘new GettextResourceManager(domain)’ + +bindtextdomain + --, compiled message catalogs are located in subdirectories of the + directory containing the executable + +setlocale + automatic + +Prerequisite + -- + +Use or emulate GNU gettext + --, uses a C# specific message catalog format + +Extractor + ‘xgettext -k_’ + +Formatting with positions + ‘String.Format "{1} {0}"’ + +Portability + fully portable + +po-mode marking + -- + + Before marking strings as internationalizable, uses of the string +concatenation operator need to be converted to ‘String.Format’ +invocations. For example, ‘"file "+filename+" not found"’ becomes +‘String.Format("file {0} not found", filename)’. Only after this is +done, can the strings be marked and extracted. + + GNU gettext uses the native C#/.NET internationalization mechanism, +namely the classes ‘ResourceManager’ and ‘ResourceSet’. Applications +use the ‘ResourceManager’ methods to retrieve the native language +translation of strings. An instance of ‘ResourceSet’ is the in-memory +representation of a message catalog file. The ‘ResourceManager’ loads +and accesses ‘ResourceSet’ instances as needed to look up the +translations. + + There are two formats of ‘ResourceSet’s that can be directly loaded +by the C# runtime: ‘.resources’ files and ‘.dll’ files. + + • The ‘.resources’ format is a binary file usually generated through + the ‘resgen’ or ‘monoresgen’ utility, but which doesn't support + plural forms. ‘.resources’ files can also be embedded in .NET + ‘.exe’ files. This only affects whether a file system access is + performed to load the message catalog; it doesn't affect the + contents of the message catalog. + + • On the other hand, the ‘.dll’ format is a binary file that is + compiled from ‘.cs’ source code and can support plural forms + (provided it is accessed through the GNU gettext API, see below). + + Note that these .NET ‘.dll’ and ‘.exe’ files are not tied to a +particular platform; their file format and GNU gettext for C# can be +used on any platform. + + To convert a PO file to a ‘.resources’ file, the ‘msgfmt’ program can +be used with the option ‘--csharp-resources’. To convert a ‘.resources’ +file back to a PO file, the ‘msgunfmt’ program can be used with the +option ‘--csharp-resources’. You can also, in some cases, use the +‘monoresgen’ program (from the ‘mono’/‘mcs’ package). This program can +also convert a ‘.resources’ file back to a PO file. But beware: as of +this writing (January 2004), the ‘monoresgen’ converter is quite buggy. + + To convert a PO file to a ‘.dll’ file, the ‘msgfmt’ program can be +used with the option ‘--csharp’. The result will be a ‘.dll’ file +containing a subclass of ‘GettextResourceSet’, which itself is a +subclass of ‘ResourceSet’. To convert a ‘.dll’ file containing a +‘GettextResourceSet’ subclass back to a PO file, the ‘msgunfmt’ program +can be used with the option ‘--csharp’. + + The advantages of the ‘.dll’ format over the ‘.resources’ format are: + + 1. Freedom to localize: Users can add their own translations to an + application after it has been built and distributed. Whereas when + the programmer uses a ‘ResourceManager’ constructor provided by the + system, the set of ‘.resources’ files for an application must be + specified when the application is built and cannot be extended + afterwards. + + 2. Plural handling: A message catalog in ‘.dll’ format supports the + plural handling function ‘GetPluralString’. Whereas ‘.resources’ + files can only contain data and only support lookups that depend on + a single string. + + 3. Context handling: A message catalog in ‘.dll’ format supports the + query-with-context functions ‘GetParticularString’ and + ‘GetParticularPluralString’. Whereas ‘.resources’ files can only + contain data and only support lookups that depend on a single + string. + + 4. The ‘GettextResourceManager’ that loads the message catalogs in + ‘.dll’ format also provides for inheritance on a per-message basis. + For example, in Austrian (‘de_AT’) locale, translations from the + German (‘de’) message catalog will be used for messages not found + in the Austrian message catalog. This has the consequence that the + Austrian translators need only translate those few messages for + which the translation into Austrian differs from the German one. + Whereas when working with ‘.resources’ files, each message catalog + must provide the translations of all messages by itself. + + 5. The ‘GettextResourceManager’ that loads the message catalogs in + ‘.dll’ format also provides for a fallback: The English MSGID is + returned when no translation can be found. Whereas when working + with ‘.resources’ files, a language-neutral ‘.resources’ file must + explicitly be provided as a fallback. + + On the side of the programmatic APIs, the programmer can use either +the standard ‘ResourceManager’ API and the GNU ‘GettextResourceManager’ +API. The latter is an extension of the former, because +‘GettextResourceManager’ is a subclass of ‘ResourceManager’. + + 1. The ‘System.Resources.ResourceManager’ API. + + This API works with resources in ‘.resources’ format. + + The creation of the ‘ResourceManager’ is done through + new ResourceManager(domainname, Assembly.GetExecutingAssembly()) + + The ‘GetString’ function returns a string's translation. Note that + this function returns null when a translation is missing (i.e. not + even found in the fallback resource file). + + 2. The ‘GNU.Gettext.GettextResourceManager’ API. + + This API works with resources in ‘.dll’ format. + + Reference documentation is in the csharpdoc directory + (csharpdoc/index.html). + + The creation of the ‘ResourceManager’ is done through + new GettextResourceManager(domainname) + + The ‘GetString’ function returns a string's translation. Note that + when a translation is missing, the MSGID argument is returned + unchanged. + + The ‘GetPluralString’ function returns a string translation with + plural handling, like the ‘ngettext’ function in C. + + The ‘GetParticularString’ function returns a string's translation, + specific to a particular context, like the ‘pgettext’ function in + C. Note that when a translation is missing, the MSGID argument is + returned unchanged. + + The ‘GetParticularPluralString’ function returns a string + translation, specific to a particular context, with plural + handling, like the ‘npgettext’ function in C. + + To use this API, one needs the ‘GNU.Gettext.dll’ file which is part + of the GNU gettext package and distributed under the LGPL. + + You can also mix both approaches: use the +‘GNU.Gettext.GettextResourceManager’ constructor, but otherwise use only +the ‘ResourceManager’ type and only the ‘GetString’ method. This is +appropriate when you want to profit from the tools for PO files, but +don't want to change an existing source code that uses ‘ResourceManager’ +and don't (yet) need the ‘GetPluralString’ method. + + Two examples, using the second API, are available in the ‘examples’ +directory: ‘hello-csharp’, ‘hello-csharp-forms’. + + Now, to make use of the API and define a shorthand for ‘GetString’, +there are two idioms that you can choose from: + + • In a unique class of your project, say ‘Util’, define a static + variable holding the ‘ResourceManager’ instance: + + public static GettextResourceManager MyResourceManager = + new GettextResourceManager("domain-name"); + + All classes containing internationalized strings then contain + + private static GettextResourceManager Res = Util.MyResourceManager; + private static String _(String s) { return Res.GetString(s); } + + and the shorthand is used like this: + + Console.WriteLine(_("Operation completed.")); + + • You add a class with a very short name, say ‘S’, containing just + the definition of the resource manager and of the shorthand: + + public class S { + public static GettextResourceManager MyResourceManager = + new GettextResourceManager("domain-name"); + public static String _(String s) { + return MyResourceManager.GetString(s); + } + } + + and the shorthand is used like this: + + Console.WriteLine(S._("Operation completed.")); + + Which of the two idioms you choose, will depend on whether copying +two lines of codes into every class is more acceptable in your project +than a class with a single-letter name. + + +File: gettext.info, Node: JavaScript, Next: TypeScript, Prev: C#, Up: List of Programming Languages + +15.5.5 JavaScript +----------------- + +RPMs + js + +Ubuntu packages + gjs + +File extension + ‘js’ + +String syntax + + • ‘"abc"’ + + • ‘'abc'’ + + • ‘`abc`’ + + • ‘TAG`abc${EXPRESSION}def{EXPRESSION}...`’, see the description + of ‘--tag’ in *note xgettext Invocation::. + +gettext shorthand + ‘_("abc")’ + +gettext/ngettext functions + ‘gettext’, ‘dgettext’, ‘dcgettext’, ‘ngettext’, ‘dngettext’ + +textdomain + ‘textdomain’ function + +bindtextdomain + ‘bindtextdomain’ function + +setlocale + automatic + +Prerequisite + -- + +Use or emulate GNU gettext + use, or emulate + +Extractor + ‘xgettext’ + +Formatting with positions + A ‘format’ method on strings can be used. But since it is not + standard in JavaScript, you have to enable it yourself, through + + const Format = imports.format; + String.prototype.format = Format.format; + +Portability + On platforms without gettext, the functions are not available. + +po-mode marking + -- + + +File: gettext.info, Node: TypeScript, Next: Scheme, Prev: JavaScript, Up: List of Programming Languages + +15.5.6 TypeScript and TSX +------------------------- + +RPMs + js + +Ubuntu packages + gjs + +File extension + ‘ts’ for TypeScript, ‘tsx’ for TSX (TypeScript with JSX) + +String syntax + + • ‘"abc"’ + + • ‘'abc'’ + + • ‘`abc`’ + +gettext shorthand + ‘_("abc")’ + +gettext/ngettext functions + ‘gettext’, ‘dgettext’, ‘dcgettext’, ‘ngettext’, ‘dngettext’ + +textdomain + ‘textdomain’ function + +bindtextdomain + ‘bindtextdomain’ function + +setlocale + automatic + +Prerequisite + unknown + +Use or emulate GNU gettext + use, or emulate + +Extractor + ‘xgettext’ + +Formatting with positions + A ‘format’ method on strings can be used. But since it is not + standard in TypeScript, you have to enable it yourself. + +Portability + On platforms without gettext, the functions are not available. + +po-mode marking + -- + + +File: gettext.info, Node: Scheme, Next: Common Lisp, Prev: TypeScript, Up: List of Programming Languages + +15.5.7 GNU guile - Scheme +------------------------- + +RPMs + guile + +Ubuntu packages + guile-2.0 + +File extension + ‘scm’ + +String syntax + ‘"abc"’ + +gettext shorthand + ‘(_ "abc")’, ‘_"abc"’ (GIMP script-fu extension) + +gettext/ngettext functions + ‘gettext’, ‘ngettext’ + +textdomain + ‘textdomain’ + +bindtextdomain + ‘bindtextdomain’ + +setlocale + ‘(catch #t (lambda () (setlocale LC_ALL "")) (lambda args #f))’ + +Prerequisite + ‘(use-modules (ice-9 format))’ + +Use or emulate GNU gettext + use + +Extractor + ‘xgettext -L Guile -k_’ + + ‘xgettext -L Scheme’ and ‘xgettext -L Guile’ are nearly equivalent. + They differ in the interpretation of escape sequences in string + literals: While ‘xgettext -L Scheme’ assumes the R6RS and R7RS + syntax of string literals, ‘xgettext -L Guile’ assumes the syntax + of string literals understood by Guile 2.x and 3.0 (without + command-line option ‘--r6rs’ or ‘--r7rs’, and before a ‘#!r6rs’ + directive is seen). After a ‘#!r6rs’ directive, there is no + difference any more between ‘xgettext -L Scheme’ and ‘xgettext -L + Guile’ for the rest of the file. + +Formatting with positions + -- + +Portability + On platforms without gettext, no translation. + +po-mode marking + -- + + An example is available in the ‘examples’ directory: ‘hello-guile’. + + +File: gettext.info, Node: Common Lisp, Next: clisp C, Prev: Scheme, Up: List of Programming Languages + +15.5.8 GNU clisp - Common Lisp +------------------------------ + +RPMs + clisp 2.28 or newer + +Ubuntu packages + clisp + +File extension + ‘lisp’ + +String syntax + ‘"abc"’ + +gettext shorthand + ‘(_ "abc")’, ‘(ENGLISH "abc")’ + +gettext/ngettext functions + ‘i18n:gettext’, ‘i18n:ngettext’ + +textdomain + ‘i18n:textdomain’ + +bindtextdomain + ‘i18n:textdomaindir’ + +setlocale + automatic + +Prerequisite + -- + +Use or emulate GNU gettext + use + +Extractor + ‘xgettext -k_ -kENGLISH’ + +Formatting with positions + ‘format "~1@*~D ~0@*~D"’ + +Portability + On platforms without gettext, no translation. + +po-mode marking + -- + + An example is available in the ‘examples’ directory: ‘hello-clisp’. + + +File: gettext.info, Node: clisp C, Next: Emacs Lisp, Prev: Common Lisp, Up: List of Programming Languages + +15.5.9 GNU clisp C sources +-------------------------- + +RPMs + clisp + +Ubuntu packages + clisp + +File extension + ‘d’ + +String syntax + ‘"abc"’ + +gettext shorthand + ‘ENGLISH ? "abc" : ""’ + ‘GETTEXT("abc")’ + ‘GETTEXTL("abc")’ + +gettext/ngettext functions + ‘clgettext’, ‘clgettextl’ + +textdomain + -- + +bindtextdomain + -- + +setlocale + automatic + +Prerequisite + ‘#include "lispbibl.c"’ + +Use or emulate GNU gettext + use + +Extractor + ‘clisp-xgettext’ + +Formatting with positions + ‘fprintf "%2$d %1$d"’ + +Portability + On platforms without gettext, no translation. + +po-mode marking + -- + + +File: gettext.info, Node: Emacs Lisp, Next: librep, Prev: clisp C, Up: List of Programming Languages + +15.5.10 Emacs Lisp +------------------ + +RPMs + emacs, xemacs + +Ubuntu packages + emacs, xemacs21 + +File extension + ‘el’ + +String syntax + ‘"abc"’ + +gettext shorthand + ‘(_"abc")’ + +gettext/ngettext functions + ‘gettext’, ‘dgettext’ (xemacs only) + +textdomain + ‘domain’ special form (xemacs only) + +bindtextdomain + ‘bind-text-domain’ function (xemacs only) + +setlocale + automatic + +Prerequisite + -- + +Use or emulate GNU gettext + use + +Extractor + ‘xgettext’ + +Formatting with positions + ‘format "%2$d %1$d"’ + +Portability + Only XEmacs. Without ‘I18N3’ defined at build time, no + translation. + +po-mode marking + -- + + +File: gettext.info, Node: librep, Next: Rust, Prev: Emacs Lisp, Up: List of Programming Languages + +15.5.11 librep +-------------- + +RPMs + librep 0.15.3 or newer + +Ubuntu packages + librep16 + +File extension + ‘jl’ + +String syntax + ‘"abc"’ + +gettext shorthand + ‘(_"abc")’ + +gettext/ngettext functions + ‘gettext’ + +textdomain + ‘textdomain’ function + +bindtextdomain + ‘bindtextdomain’ function + +setlocale + -- + +Prerequisite + ‘(require 'rep.i18n.gettext)’ + +Use or emulate GNU gettext + use + +Extractor + ‘xgettext’ + +Formatting with positions + ‘format "%2$d %1$d"’ + +Portability + On platforms without gettext, no translation. + +po-mode marking + -- + + An example is available in the ‘examples’ directory: ‘hello-librep’. + + +File: gettext.info, Node: Rust, Next: Go, Prev: librep, Up: List of Programming Languages + +15.5.12 Rust +------------ + +RPMs + rust, rust-cargo + +Ubuntu packages + rustc, cargo + +File extension + ‘rs’ + +String syntax + ‘"abc"’, ‘r"abc"’, ‘r#"abc"#’ etc. + +gettext shorthand + -- + +gettext/ngettext functions + ‘gettext’, ‘ngettext’ + +textdomain + ‘textdomain’ function + +bindtextdomain + ‘bindtextdomain’ function + +setlocale + ‘setlocale’ function + +Prerequisite + ‘$ cargo add gettext-rs’ + + ‘use gettextrs::*;’ + + Note: We recommend the ‘gettext-rs’ crate. We do not recommend the + ‘gettext’ crate, because (as of 2025) it does not handle catalog + fallback (e.g. from ‘de_AT’ to ‘de’) nor the ‘LANGUAGE’ + environment variable. + +Use or emulate GNU gettext + use + +Extractor + ‘xgettext’ + +Formatting with positions + There are three common ways of doing string formatting in Rust: + • Using the built-ins ‘format!’, ‘println!’, etc. This facility + supports only constant strings, known at compile-time. Thus + it cannot be used with translated format strings. You would + get an error such as "error: format argument must be a string + literal". + • Using the ‘strfmt’ library. The facility cannot be + recommended, because it does not support the case where some + of the values are strings and some of the values are numbers + (without an excessive amount of contortions). + • Using the ‘formatx’ library. This is the one we recommend. + + So, you have to convert the ‘format!’, ‘println!’, etc. + invocations to use ‘formatx’. For example, + println!("Hello {}, you got {} coins.", name, left); + becomes + println!("{}", formatx!(gettext("Hello {}, you got {} coins."), + name, left) + .unwrap()); + + For swapped positions, a translator may translate ‘"Hello {}, you + got {} coins."’ with ‘"Hello, {1} coins are left for you, {0}."’ + +Portability + fully portable + +po-mode marking + -- + + An example is available in the ‘examples’ directory: ‘hello-rust’. + + +File: gettext.info, Node: Go, Next: Ruby, Prev: Rust, Up: List of Programming Languages + +15.5.13 Go +---------- + + Three packages are available, that can be used for message +localization with PO files: + • The ‘github.com/leonelquinteros/gotext’ package. + + Documentation: + + + Source code: + • The ‘github.com/gosexy/gettext’ package. + + Documentation: + + Source code: + • The ‘github.com/snapcore/go-gettext’ package. + + Documentation: + + Source code: + + Go programs can be classified as one of: + • _Single-locale_ programs, that use the same locale across all + threads of the program. Example: Most command-line programs. + • _Multi-locale_ programs, that use one locale per thread. Example: + Web servers. + + The three different packages support these two classes of programs +differently: + • ‘github.com/leonelquinteros/gotext’ package: It has two different + APIs, one for the single-locale case and one for the multi-locale + case. + • ‘github.com/gosexy/gettext’ package: Its API supports only the + single-locale case. + • ‘github.com/snapcore/go-gettext’ package: Its API supports the + single-locale case and the multi-locale case in the same way. + +Gettext support characteristics: +-------------------------------- + +RPMs + golang + +Ubuntu packages + golang-go (which provides the ‘go’ program), or gccgo (which + provides a ‘go-VERSION’ command). + gccgo has better portability; for example it works on SPARC CPUs. + +File extension + ‘go’ + +String syntax + ‘"abc"’, ‘`abc`’ + +gettext shorthand + -- + +gettext/ngettext functions + This depends on the API: + • ‘github.com/leonelquinteros/gotext’ API: ‘Get’, ‘GetD’, + ‘GetN’, ‘GetND’ + • ‘github.com/gosexy/gettext’ API: ‘Gettext’, ‘DGettext’, + ‘DCGettext’, ‘NGettext’, ‘DNGettext’, ‘DCNGettext’ + • ‘github.com/snapcore/go-gettext’ API: ‘Gettext’, ‘NGettext’ + + Note that the ‘ngettext’-like functions need to take two argument + strings that consume the same number of arguments. For example, + you cannot write ‘fmt.Sprintf(gotext.GetN("a piece", "%d pieces", + n), n)’ because in the singular case, ‘fmt.Sprintf’ would treat the + unused argument as an error and produce ‘"a piece%!(EXTRA int=1)"’ + instead of the desired ‘"a piece"’. As a workaround, you need to + convert ‘n’ to a string and format that string with precision zero: + ‘fmt.Sprintf(gotext.GetN("%.0sa piece", "%s pieces", n), + strconv.Itoa(n))’ + +textdomain + This depends on the API: + • ‘github.com/leonelquinteros/gotext’ API: ‘Locale.AddDomain’ + method or ‘gotext.Configure’ function + • ‘github.com/gosexy/gettext’ API: ‘Textdomain’ function + • ‘github.com/snapcore/go-gettext’ API: ‘TextDomain’ constructor + +bindtextdomain + This depends on the API: + • ‘github.com/leonelquinteros/gotext’ API: ‘gotext.NewLocale’ + function or ‘gotext.Configure’ function + • ‘github.com/gosexy/gettext’ API: ‘BindTextdomain’ function + • ‘github.com/snapcore/go-gettext’ API: ‘TextDomain’ constructor + +setlocale + This depends on the API: + • ‘github.com/leonelquinteros/gotext’ API: Programmer must + determine the appropriate locale and pass it to the + ‘gotext.NewLocale’ function or ‘gotext.Configure’ function. + • ‘github.com/gosexy/gettext’ API: Programmer must call + ‘gettext.SetLocale(gettext.LcAll, "")’. + • ‘github.com/snapcore/go-gettext’ API: Programmer must + determine the appropriate locale and pass it to the + ‘TextDomain.Locale’ method. + +Prerequisite + This depends on the API: + • ‘github.com/leonelquinteros/gotext’ API: ‘import + ("github.com/leonelquinteros/gotext")’ + • ‘github.com/gosexy/gettext’ API: ‘import + ("github.com/gosexy/gettext")’ + • ‘github.com/snapcore/go-gettext’ API: ‘import + ("github.com/snapcore/go-gettext")’ + +Use or emulate GNU gettext + This depends on the API: + • ‘github.com/leonelquinteros/gotext’ API: Emulate + • ‘github.com/gosexy/gettext’ API: Use + • ‘github.com/snapcore/go-gettext’ API: Emulate + +Extractor + ‘xgettext’ + +Formatting with positions + ‘fmt.Sprintf("%[2]d %[1]d", ...)’ + +Portability + fully portable + +po-mode marking + -- + + Two examples are available in the ‘examples’ directory: ‘hello-go’ +and ‘hello-go-http’. + + +File: gettext.info, Node: Ruby, Next: sh, Prev: Go, Up: List of Programming Languages + +15.5.14 Ruby +------------ + +RPMs + ruby, ruby-gettext + +Ubuntu packages + ruby, ruby-gettext + +File extension + ‘rb’ + +String syntax + ‘"abc"’, ‘'abc'’, ‘%q/abc/’ etc., ‘%q(abc)’, ‘%q[abc]’, ‘%q{abc}’ + +gettext shorthand + ‘_("abc")’ + +gettext/ngettext functions + ‘gettext’, ‘ngettext’ + +textdomain + -- + +bindtextdomain + ‘bindtextdomain’ function + +setlocale + -- + +Prerequisite + ‘require 'gettext'’ ‘include GetText’ + +Use or emulate GNU gettext + emulate + +Extractor + ‘xgettext’ + +Formatting with positions + ‘sprintf("%2$d %1$d", x, y)’ + ‘"%{new} replaces %{old}" % {:old => oldvalue, :new => newvalue}’ + +Portability + fully portable + +po-mode marking + -- + + An example is available in the ‘examples’ directory: ‘hello-ruby’. + + +File: gettext.info, Node: sh, Next: bash, Prev: Ruby, Up: List of Programming Languages + +15.5.15 sh - Shell Script +------------------------- + +RPMs + bash, gettext + +Ubuntu packages + bash, gettext-base + +File extension + ‘sh’ + +String syntax + ‘"abc"’, ‘'abc'’, ‘abc’ + +gettext shorthand + ‘"`gettext \"abc\"`"’ + +gettext/ngettext functions + ‘gettext’, ‘ngettext’ programs + ‘eval_gettext’, ‘eval_ngettext’, ‘eval_pgettext’, ‘eval_npgettext’ + shell functions + +textdomain + environment variable ‘TEXTDOMAIN’ + +bindtextdomain + environment variable ‘TEXTDOMAINDIR’ + +setlocale + automatic + +Prerequisite + ‘. gettext.sh’ + +Use or emulate GNU gettext + use + +Extractor + ‘xgettext’ + +Formatting with positions + -- + +Portability + fully portable + +po-mode marking + -- + + An example is available in the ‘examples’ directory: ‘hello-sh’. + +* Menu: + +* Preparing Shell Scripts:: Preparing Shell Scripts for Internationalization +* gettext.sh:: Contents of ‘gettext.sh’ +* gettext Invocation:: Invoking the ‘gettext’ program +* ngettext Invocation:: Invoking the ‘ngettext’ program +* envsubst Invocation:: Invoking the ‘envsubst’ program +* eval_gettext Invocation:: Invoking the ‘eval_gettext’ function +* eval_ngettext Invocation:: Invoking the ‘eval_ngettext’ function +* eval_pgettext Invocation:: Invoking the ‘eval_pgettext’ function +* eval_npgettext Invocation:: Invoking the ‘eval_npgettext’ function + + +File: gettext.info, Node: Preparing Shell Scripts, Next: gettext.sh, Up: sh + +15.5.15.1 Preparing Shell Scripts for Internationalization +.......................................................... + + Preparing a shell script for internationalization is conceptually +similar to the steps described in *note Sources::. The concrete steps +for shell scripts are as follows. + + 1. Insert the line + + . gettext.sh + + near the top of the script. ‘gettext.sh’ is a shell function + library that provides the functions ‘eval_gettext’ (see *note + eval_gettext Invocation::), ‘eval_ngettext’ (see *note + eval_ngettext Invocation::), ‘eval_pgettext’ (see *note + eval_pgettext Invocation::), and ‘eval_npgettext’ (see *note + eval_npgettext Invocation::). You have to ensure that ‘gettext.sh’ + can be found in the ‘PATH’. + + 2. Set and export the ‘TEXTDOMAIN’ and ‘TEXTDOMAINDIR’ environment + variables. Usually ‘TEXTDOMAIN’ is the package or program name, + and ‘TEXTDOMAINDIR’ is the absolute pathname corresponding to + ‘$prefix/share/locale’, where ‘$prefix’ is the installation + location. + + TEXTDOMAIN=@PACKAGE@ + export TEXTDOMAIN + TEXTDOMAINDIR=@LOCALEDIR@ + export TEXTDOMAINDIR + + 3. Prepare the strings for translation, as described in *note + Preparing Strings::. + + 4. Simplify translatable strings so that they don't contain command + substitution (‘"`...`"’ or ‘"$(...)"’), variable access with + defaulting (like ‘${VARIABLE-DEFAULT}’), access to positional + arguments (like ‘$0’, ‘$1’, ...) or highly volatile shell + variables (like ‘$?’). This can always be done through simple + local code restructuring. For example, + + echo "Usage: $0 [OPTION] FILE..." + + becomes + + program_name=$0 + echo "Usage: $program_name [OPTION] FILE..." + + Similarly, + + echo "Remaining files: `ls | wc -l`" + + becomes + + filecount="`ls | wc -l`" + echo "Remaining files: $filecount" + + 5. For each translatable string, change the output command ‘echo’ or + ‘$echo’ to ‘gettext’ (if the string contains no references to shell + variables) or to ‘eval_gettext’ (if it refers to shell variables), + followed by a no-argument ‘echo’ command (to account for the + terminating newline). Similarly, for cases with plural handling, + replace a conditional ‘echo’ command with an invocation of + ‘ngettext’ or ‘eval_ngettext’, followed by a no-argument ‘echo’ + command. + + When doing this, you also need to add an extra backslash before the + dollar sign in references to shell variables, so that the + ‘eval_gettext’ function receives the translatable string before the + variable values are substituted into it. For example, + + echo "Remaining files: $filecount" + + becomes + + eval_gettext "Remaining files: \$filecount"; echo + + If the output command is not ‘echo’, you can make it use ‘echo’ + nevertheless, through the use of backquotes. However, note that + inside backquotes, backslashes must be doubled to be effective + (because the backquoting eats one level of backslashes). For + example, assuming that ‘error’ is a shell function that signals an + error, + + error "file not found: $filename" + + is first transformed into + + error "`echo \"file not found: \$filename\"`" + + which then becomes + + error "`eval_gettext \"file not found: \\\$filename\"`" + + +File: gettext.info, Node: gettext.sh, Next: gettext Invocation, Prev: Preparing Shell Scripts, Up: sh + +15.5.15.2 Contents of ‘gettext.sh’ +.................................. + + ‘gettext.sh’, contained in the run-time package of GNU gettext, +provides the following: + + • $echo The variable ‘echo’ is set to a command that outputs its + first argument and a newline, without interpreting backslashes in + the argument string. + + • eval_gettext See *note eval_gettext Invocation::. + + • eval_ngettext See *note eval_ngettext Invocation::. + + • eval_pgettext See *note eval_pgettext Invocation::. + + • eval_npgettext See *note eval_npgettext Invocation::. + + +File: gettext.info, Node: gettext Invocation, Next: ngettext Invocation, Prev: gettext.sh, Up: sh + +15.5.15.3 Invoking the ‘gettext’ program +........................................ + + gettext [OPTION] [[TEXTDOMAIN] MSGID] + gettext [OPTION] -s [MSGID]... + + The ‘gettext’ program displays the native language translation of a +textual message. + +*Arguments* + +‘-c CONTEXT’ +‘--context=CONTEXT’ + Specify the context for the messages to be translated. See *note + Contexts:: for details. + +‘-d TEXTDOMAIN’ +‘--domain=TEXTDOMAIN’ + Retrieve translated messages from TEXTDOMAIN. Usually a TEXTDOMAIN + corresponds to a package, a program, or a module of a program. + +‘-e’ + Enable expansion of some escape sequences. This option is for + compatibility with the ‘echo’ program or shell built-in. The + escape sequences ‘\a’, ‘\b’, ‘\c’, ‘\f’, ‘\n’, ‘\r’, ‘\t’, ‘\v’, + ‘\\’, and ‘\’ followed by one to three octal digits, are + interpreted like the System V ‘echo’ program did. + +‘-E’ + This option is only for compatibility with the ‘echo’ program or + shell built-in. It has no effect. + +‘-h’ +‘--help’ + Display this help and exit. + +‘-n’ + This option has only an effect if the ‘-s’ option is given. It + suppresses the additional newline at the end. + +‘-V’ +‘--version’ + Output version information and exit. + +‘[TEXTDOMAIN] MSGID’ + Retrieve translated message corresponding to MSGID from TEXTDOMAIN. + + If the TEXTDOMAIN parameter is not given, the domain is determined +from the environment variable ‘TEXTDOMAIN’. If the message catalog is +not found in the regular directory, another location can be specified +with the environment variable ‘TEXTDOMAINDIR’. + + When used with the ‘-s’ option the program behaves like the ‘echo’ +command. But it does not simply copy its arguments to stdout. Instead +those messages found in the selected catalog are translated. Also, a +newline is added at the end, unless either the option ‘-n’ is specified +or the option ‘-e’ is specified and some of the argument strings +contains a ‘\c’ escape sequence. + + Note: ‘xgettext’ supports only the one-argument form of the ‘gettext’ +invocation, where no options are present and the TEXTDOMAIN is implicit, +from the environment. + + +File: gettext.info, Node: ngettext Invocation, Next: envsubst Invocation, Prev: gettext Invocation, Up: sh + +15.5.15.4 Invoking the ‘ngettext’ program +......................................... + + ngettext [OPTION] [TEXTDOMAIN] MSGID MSGID-PLURAL COUNT + + The ‘ngettext’ program displays the native language translation of a +textual message whose grammatical form depends on a number. + +*Arguments* + +‘-c CONTEXT’ +‘--context=CONTEXT’ + Specify the context for the messages to be translated. See *note + Contexts:: for details. + +‘-d TEXTDOMAIN’ +‘--domain=TEXTDOMAIN’ + Retrieve translated messages from TEXTDOMAIN. Usually a TEXTDOMAIN + corresponds to a package, a program, or a module of a program. + +‘-e’ + Enable expansion of some escape sequences. This option is for + compatibility with the ‘gettext’ program. The escape sequences + ‘\a’, ‘\b’, ‘\f’, ‘\n’, ‘\r’, ‘\t’, ‘\v’, ‘\\’, and ‘\’ followed by + one to three octal digits, are interpreted like the System V ‘echo’ + program did. + +‘-E’ + This option is only for compatibility with the ‘gettext’ program. + It has no effect. + +‘-h’ +‘--help’ + Display this help and exit. + +‘-V’ +‘--version’ + Output version information and exit. + +‘TEXTDOMAIN’ + Retrieve translated message from TEXTDOMAIN. + +‘MSGID MSGID-PLURAL’ + Translate MSGID (English singular) / MSGID-PLURAL (English plural). + +‘COUNT’ + Choose singular/plural form based on this value. + + If the TEXTDOMAIN parameter is not given, the domain is determined +from the environment variable ‘TEXTDOMAIN’. If the message catalog is +not found in the regular directory, another location can be specified +with the environment variable ‘TEXTDOMAINDIR’. + + Note: ‘xgettext’ supports only the three-arguments form of the +‘ngettext’ invocation, where no options are present and the TEXTDOMAIN +is implicit, from the environment. + + +File: gettext.info, Node: envsubst Invocation, Next: eval_gettext Invocation, Prev: ngettext Invocation, Up: sh + +15.5.15.5 Invoking the ‘envsubst’ program +......................................... + + envsubst [OPTION] [SHELL-FORMAT] + + The ‘envsubst’ program substitutes the values of environment +variables. + +*Operation mode* + +‘-v’ +‘--variables’ + Output the variables occurring in SHELL-FORMAT. + +*Informative output* + +‘-h’ +‘--help’ + Display this help and exit. + +‘-V’ +‘--version’ + Output version information and exit. + + In normal operation mode, standard input is copied to standard +output, with references to environment variables of the form ‘$VARIABLE’ +or ‘${VARIABLE}’ being replaced with the corresponding values. If a +SHELL-FORMAT is given, only those environment variables that are +referenced in SHELL-FORMAT are substituted; otherwise all environment +variables references occurring in standard input are substituted. + + These substitutions are a subset of the substitutions that a shell +performs on unquoted and double-quoted strings. Other kinds of +substitutions done by a shell, such as ‘${VARIABLE-DEFAULT}’ or +‘$(COMMAND-LIST)’ or ‘`COMMAND-LIST`’, are not performed by the +‘envsubst’ program, due to security reasons. + + When ‘--variables’ is used, standard input is ignored, and the output +consists of the environment variables that are referenced in +SHELL-FORMAT, one per line. + + +File: gettext.info, Node: eval_gettext Invocation, Next: eval_ngettext Invocation, Prev: envsubst Invocation, Up: sh + +15.5.15.6 Invoking the ‘eval_gettext’ function +.............................................. + + eval_gettext MSGID + + This function outputs the native language translation of a textual +message, performing dollar-substitution on the result. Note that only +shell variables mentioned in MSGID will be dollar-substituted in the +result. + + +File: gettext.info, Node: eval_ngettext Invocation, Next: eval_pgettext Invocation, Prev: eval_gettext Invocation, Up: sh + +15.5.15.7 Invoking the ‘eval_ngettext’ function +............................................... + + eval_ngettext MSGID MSGID-PLURAL COUNT + + This function outputs the native language translation of a textual +message whose grammatical form depends on a number, performing +dollar-substitution on the result. Note that only shell variables +mentioned in MSGID or MSGID-PLURAL will be dollar-substituted in the +result. + + +File: gettext.info, Node: eval_pgettext Invocation, Next: eval_npgettext Invocation, Prev: eval_ngettext Invocation, Up: sh + +15.5.15.8 Invoking the ‘eval_pgettext’ function +............................................... + + eval_pgettext MSGCTXT MSGID + + This function outputs the native language translation of a textual +message in the given context MSGCTXT (see *note Contexts::), performing +dollar-substitution on the result. Note that only shell variables +mentioned in MSGID will be dollar-substituted in the result. + + +File: gettext.info, Node: eval_npgettext Invocation, Prev: eval_pgettext Invocation, Up: sh + +15.5.15.9 Invoking the ‘eval_npgettext’ function +................................................ + + eval_npgettext MSGCTXT MSGID MSGID-PLURAL COUNT + + This function outputs the native language translation of a textual +message whose grammatical form depends on a number in the given context +MSGCTXT (see *note Contexts::), performing dollar-substitution on the +result. Note that only shell variables mentioned in MSGID or +MSGID-PLURAL will be dollar-substituted in the result. + + +File: gettext.info, Node: bash, Next: gawk, Prev: sh, Up: List of Programming Languages + +15.5.16 bash - Bourne-Again Shell Script +---------------------------------------- + + GNU ‘bash’ 2.0 or newer has a special shorthand for translating a +string and substituting variable values in it: ‘$"msgid"’. But the use +of this construct is *discouraged*, due to the security holes it opens +and due to its portability problems. + + The security holes of ‘$"..."’ come from the fact that after looking +up the translation of the string, ‘bash’ processes it like it processes +any double-quoted string: dollar and backquote processing, like ‘eval’ +does. + + 1. In a locale whose encoding is one of BIG5, BIG5-HKSCS, GBK, + GB18030, SHIFT_JIS, JOHAB, some double-byte characters have a + second byte whose value is ‘0x60’. For example, the byte sequence + ‘\xe0\x60’ is a single character in these locales. Many versions + of ‘bash’ (all versions up to bash-2.05, and newer versions on + platforms without ‘mbsrtowcs()’ function) don't know about + character boundaries and see a backquote character where there is + only a particular Chinese character. Thus it can start executing + part of the translation as a command list. This situation can + occur even without the translator being aware of it: if the + translator provides translations in the UTF-8 encoding, it is the + ‘gettext()’ function which will, during its conversion from the + translator's encoding to the user's locale's encoding, produce the + dangerous ‘\x60’ bytes. + + 2. A translator could - voluntarily or inadvertently - use backquotes + ‘"`...`"’ or dollar-parentheses ‘"$(...)"’ in her translations. + The enclosed strings would be executed as command lists by the + shell. + + The portability problem is that ‘bash’ must be built with +internationalization support; this is normally not the case on systems +that don't have the ‘gettext()’ function in libc. + + +File: gettext.info, Node: gawk, Next: Lua, Prev: bash, Up: List of Programming Languages + +15.5.17 GNU awk +--------------- + +RPMs + gawk 3.1 or newer + +Ubuntu packages + gawk + +File extension + ‘awk’, ‘gawk’, ‘twjr’. The file extension ‘twjr’ is used by + TexiWeb Jr (). + +String syntax + ‘"abc"’ + +gettext shorthand + ‘_"abc"’ + +gettext/ngettext functions + ‘dcgettext’, missing ‘dcngettext’ in gawk-3.1.0 + +textdomain + ‘TEXTDOMAIN’ variable + +bindtextdomain + ‘bindtextdomain’ function + +setlocale + automatic, but missing ‘setlocale (LC_MESSAGES, "")’ in gawk-3.1.0 + +Prerequisite + -- + +Use or emulate GNU gettext + use + +Extractor + ‘xgettext’ + +Formatting with positions + ‘printf "%2$d %1$d"’ (GNU awk only) + +Portability + On platforms without gettext, no translation. On non-GNU awks, you + must define ‘dcgettext’, ‘dcngettext’ and ‘bindtextdomain’ + yourself. + +po-mode marking + -- + + An example is available in the ‘examples’ directory: ‘hello-gawk’. + + +File: gettext.info, Node: Lua, Next: Pascal, Prev: gawk, Up: List of Programming Languages + +15.5.18 Lua +----------- + +RPMs + lua + +Ubuntu packages + lua, lua-gettext + You need to install the ‘lua-gettext’ package from + . + Debian and Ubuntu packages of it are available. Download the + appropriate one, and install it through ‘sudo dpkg -i + lua-gettext_0.0+nmu1_amd64.deb’. + +File extension + ‘lua’ + +String syntax + + • ‘"abc"’ + + • ‘'abc'’ + + • ‘[[abc]]’ + + • ‘[=[abc]=]’ + + • ‘[==[abc]==]’ + + • ... + +gettext shorthand + ‘_("abc")’ + +gettext/ngettext functions + ‘gettext.gettext’, ‘gettext.dgettext’, ‘gettext.dcgettext’, + ‘gettext.ngettext’, ‘gettext.dngettext’, ‘gettext.dcngettext’ + +textdomain + ‘textdomain’ function + +bindtextdomain + ‘bindtextdomain’ function + +setlocale + automatic + +Prerequisite + ‘require 'gettext'’ or running lua interpreter with ‘-l gettext’ + option + +Use or emulate GNU gettext + use + +Extractor + ‘xgettext’ + +Formatting with positions + -- + +Portability + On platforms without gettext, the functions are not available. + +po-mode marking + -- + + +File: gettext.info, Node: Pascal, Next: Modula-2, Prev: Lua, Up: List of Programming Languages + +15.5.19 Pascal - Free Pascal Compiler +------------------------------------- + +RPMs + fpc + +Ubuntu packages + fp-compiler, fp-units-fcl + +File extension + ‘pp’, ‘pas’ + +String syntax + ‘'abc'’ + +gettext shorthand + automatic + +gettext/ngettext functions + --, use ‘ResourceString’ data type instead + +textdomain + --, use ‘TranslateResourceStrings’ function instead + +bindtextdomain + --, use ‘TranslateResourceStrings’ function instead + +setlocale + automatic, but uses only LANG, not LC_MESSAGES or LC_ALL + +Prerequisite + ‘{$mode delphi}’ or ‘{$mode objfpc}’ + ‘uses gettext;’ + +Use or emulate GNU gettext + emulate partially + +Extractor + ‘ppc386’ followed by ‘xgettext’ or ‘rstconv’ + +Formatting with positions + ‘uses sysutils;’ + ‘format "%1:d %0:d"’ + +Portability + ? + +po-mode marking + -- + + The Pascal compiler has special support for the ‘ResourceString’ data +type. It generates a ‘.rst’ file. This is then converted to a ‘.pot’ +file by use of ‘xgettext’ or ‘rstconv’. At runtime, a ‘.mo’ file +corresponding to translations of this ‘.pot’ file can be loaded using +the ‘TranslateResourceStrings’ function in the ‘gettext’ unit. + + An example is available in the ‘examples’ directory: ‘hello-pascal’. + + +File: gettext.info, Node: Modula-2, Next: D, Prev: Pascal, Up: List of Programming Languages + +15.5.20 Modula-2 +---------------- + +RPMs + gcc-gm2, libgm2 + +Ubuntu packages + gm2 + +File extension + ‘mod’, ‘def’ + +String syntax + ‘'abc'’, ‘"abc"’ + +gettext shorthand + -- + +gettext/ngettext functions + ‘Gettext’, ‘DGettext’, ‘DCGettext’, ‘NGettext’, ‘DNGettext’, + ‘DCNGettext’ + +textdomain + ‘TextDomain’ function + +bindtextdomain + ‘BindTextDomain’ function + +setlocale + Programmer must call ‘SetLocale (LC_ALL, "")’ + +Prerequisite + ‘FROM Libintl IMPORT Gettext ...;’ + +Use or emulate GNU gettext + Use + +Extractor + ‘xgettext’ + +Formatting with positions + -- + +Portability + fully portable to all platforms supported by GNU Modula-2 + +po-mode marking + -- + + An example is available in the ‘examples’ directory: ‘hello-modula2’. + + +File: gettext.info, Node: D, Next: Smalltalk, Prev: Modula-2, Up: List of Programming Languages + +15.5.21 D +--------- + +RPMs + gcc-gdc or ldc + +Ubuntu packages + gdc or ldc + +File extension + ‘d’ + +String syntax + ‘r"abc"’, ‘`abc`’, ‘"abc"’, ‘q"[abc]"’, ‘q"(abc)"’, ‘q""’, + ‘q"{abc}"’, ‘q{abc}’, ‘x"6A 6B 6C"’ + +gettext shorthand + ‘_("abc")’ + +gettext/ngettext functions + ‘gettext’, ‘dgettext’, ‘dcgettext’, ‘ngettext’, ‘dngettext’, + ‘dcngettext’ + + Note that the ‘ngettext’-like functions need to take two argument + strings that consume the same number of arguments. For example, + you cannot write ‘format(ngettext("a piece", "%d pieces", n), n)’ + because in the singular case, ‘format’ would treat the unused + argument as an error and throw an exception. As a workaround, you + need to convert ‘n’ to a string and format that string with + precision zero: ‘format(ngettext("%.0sa piece", "%s pieces", n), + to!string(n))’ or ‘format(ngettext("%.0sa piece", "%s pieces", n), + text(n))’ + +textdomain + ‘textdomain’ function + +bindtextdomain + ‘bindtextdomain’ function + +setlocale + Programmer must call ‘setlocale (LC_ALL, "")’ + +Prerequisite + ‘import gnu.libintl;’ + ‘alias _ = gettext;’ + +Use or emulate GNU gettext + Use + +Extractor + ‘xgettext -k_ --flag=_:1:pass-c-format --flag=_:1:pass-d-format’ + +Formatting with positions + ‘fprintf "%2$d %1$d"’, ‘format "%2$d %1$d"’ + +Portability + fully portable + +po-mode marking + -- + + An example is available in the ‘examples’ directory: ‘hello-d’. + + +File: gettext.info, Node: Smalltalk, Next: Vala, Prev: D, Up: List of Programming Languages + +15.5.22 GNU Smalltalk +--------------------- + +RPMs + smalltalk + +Ubuntu packages + gnu-smalltalk + +File extension + ‘st’ + +String syntax + ‘'abc'’ + +gettext shorthand + ‘NLS ? 'abc'’ + +gettext/ngettext functions + ‘LcMessagesDomain>>#at:’, ‘LcMessagesDomain>>#at:plural:with:’ + +textdomain + ‘LcMessages>>#domain:localeDirectory:’ (returns a + ‘LcMessagesDomain’ object). + Example: ‘I18N Locale default messages domain: 'gettext' + localeDirectory: /usr/local/share/locale'’ + +bindtextdomain + ‘LcMessages>>#domain:localeDirectory:’, see above. + +setlocale + Automatic if you use ‘I18N Locale default’. + +Prerequisite + ‘PackageLoader fileInPackage: 'I18N'!’ + +Use or emulate GNU gettext + emulate + +Extractor + ‘xgettext’ + +Formatting with positions + ‘'%1 %2' bindWith: 'Hello' with: 'world'’ + +Portability + fully portable + +po-mode marking + -- + + An example is available in the ‘examples’ directory: +‘hello-smalltalk’. + + +File: gettext.info, Node: Vala, Next: wxWidgets, Prev: Smalltalk, Up: List of Programming Languages + +15.5.23 Vala +------------ + +RPMs + vala + +Ubuntu packages + valac + +File extension + ‘vala’ + +String syntax + + • ‘"abc"’ + + • ‘"""abc"""’ + +gettext shorthand + ‘_("abc")’ + +gettext/ngettext functions + ‘gettext’, ‘dgettext’, ‘dcgettext’, ‘ngettext’, ‘dngettext’, + ‘dpgettext’, ‘dpgettext2’ + +textdomain + ‘textdomain’ function, defined under the ‘Intl’ namespace + +bindtextdomain + ‘bindtextdomain’ function, defined under the ‘Intl’ namespace + +setlocale + Programmer must call ‘Intl.setlocale (LocaleCategory.ALL, "")’ + +Prerequisite + -- + +Use or emulate GNU gettext + Use + +Extractor + ‘xgettext’ + +Formatting with positions + Same as for the C language. + +Portability + autoconf (gettext.m4) and #if ENABLE_NLS + +po-mode marking + yes + + +File: gettext.info, Node: wxWidgets, Next: Tcl, Prev: Vala, Up: List of Programming Languages + +15.5.24 wxWidgets library +------------------------- + +RPMs + wxGTK, gettext + +Ubuntu packages + libwxgtk3.0-dev or libwxgtk3.2-dev + +File extension + ‘cpp’ + +String syntax + ‘"abc"’ + +gettext shorthand + ‘_("abc")’ + +gettext/ngettext functions + ‘wxLocale::GetString’, ‘wxGetTranslation’ + +textdomain + ‘wxLocale::AddCatalog’ + +bindtextdomain + ‘wxLocale::AddCatalogLookupPathPrefix’ + +setlocale + ‘wxLocale::Init’, ‘wxSetLocale’ + +Prerequisite + ‘#include ’ + +Use or emulate GNU gettext + emulate, see ‘include/wx/intl.h’ and ‘src/common/intl.cpp’ + +Extractor + ‘xgettext’ + +Formatting with positions + wxString::Format supports positions if and only if the system has + ‘wprintf()’, ‘vswprintf()’ functions and they support positions + according to POSIX. + +Portability + fully portable + +po-mode marking + yes + + +File: gettext.info, Node: Tcl, Next: Perl, Prev: wxWidgets, Up: List of Programming Languages + +15.5.25 Tcl - Tk's scripting language +------------------------------------- + +RPMs + tcl + +Ubuntu packages + tcl + +File extension + ‘tcl’ + +String syntax + ‘"abc"’ + +gettext shorthand + ‘[_ "abc"]’ + +gettext/ngettext functions + ‘::msgcat::mc’ + +textdomain + -- + +bindtextdomain + --, use ‘::msgcat::mcload’ instead + +setlocale + automatic, uses LANG, but ignores LC_MESSAGES and LC_ALL + +Prerequisite + ‘package require msgcat’ + ‘proc _ {s} {return [::msgcat::mc $s]}’ + +Use or emulate GNU gettext + --, uses a Tcl specific message catalog format + +Extractor + ‘xgettext -k_’ + +Formatting with positions + ‘format "%2\$d %1\$d"’ + +Portability + fully portable + +po-mode marking + -- + + Two examples are available in the ‘examples’ directory: ‘hello-tcl’, +‘hello-tcl-tk’. + + Before marking strings as internationalizable, substitutions of +variables into the string need to be converted to ‘format’ applications. +For example, ‘"file $filename not found"’ becomes ‘[format "file %s not +found" $filename]’. Only after this is done, can the strings be marked +and extracted. After marking, this example becomes ‘[format [_ "file %s +not found"] $filename]’ or ‘[msgcat::mc "file %s not found" $filename]’. +Note that the ‘msgcat::mc’ function implicitly calls ‘format’ when more +than one argument is given. + + +File: gettext.info, Node: Perl, Next: PHP, Prev: Tcl, Up: List of Programming Languages + +15.5.26 Perl +------------ + +RPMs + perl + +Ubuntu packages + perl, libintl-perl + +File extension + ‘pl’, ‘PL’, ‘pm’, ‘perl’, ‘cgi’ + +String syntax + + • ‘"abc"’ + + • ‘'abc'’ + + • ‘qq (abc)’ + + • ‘q (abc)’ + + • ‘qr /abc/’ + + • ‘qx (/bin/date)’ + + • ‘/pattern match/’ + + • ‘?pattern match?’ + + • ‘s/substitution/operators/’ + + • ‘$tied_hash{"message"}’ + + • ‘$tied_hash_reference->{"message"}’ + + • etc., issue the command ‘man perlsyn’ for details + +gettext shorthand + ‘__’ (double underscore) + +gettext/ngettext functions + ‘gettext’, ‘dgettext’, ‘dcgettext’, ‘ngettext’, ‘dngettext’, + ‘dcngettext’, ‘pgettext’, ‘dpgettext’, ‘dcpgettext’, ‘npgettext’, + ‘dnpgettext’, ‘dcnpgettext’ + +textdomain + ‘textdomain’ function + +bindtextdomain + ‘bindtextdomain’ function + +bind_textdomain_codeset + ‘bind_textdomain_codeset’ function + +setlocale + Use ‘setlocale (LC_ALL, "");’ + +Prerequisite + ‘use POSIX;’ + ‘use Locale::TextDomain;’ (included in the package libintl-perl + which is available on the Comprehensive Perl Archive Network CPAN, + https://www.cpan.org/). + +Use or emulate GNU gettext + platform dependent: gettext_pp emulates, gettext_xs uses GNU + gettext + +Extractor + ‘xgettext -k__ -k\$__ -k%__ -k__x -k__n:1,2 -k__nx:1,2 -k__xn:1,2 + -kN__ -kN__n:1,2 -k__p:1c,2 -k__np:1c,2,3 -kN__p:1c,2 + -kN__np:1c,2,3’ + +Formatting with positions + Both kinds of format strings support formatting with positions. + ‘printf "%2\$d %1\$d", ...’ (requires Perl 5.8.0 or newer) + ‘__expand("[new] replaces [old]", old => $oldvalue, new => + $newvalue)’ + +Portability + The ‘libintl-perl’ package is platform independent but is not part + of the Perl core. The programmer is responsible for providing a + dummy implementation of the required functions if the package is + not installed on the target system. + +po-mode marking + -- + +Documentation + Included in ‘libintl-perl’, available on CPAN + (https://www.cpan.org/). + + An example is available in the ‘examples’ directory: ‘hello-perl’. + + The ‘xgettext’ parser backend for Perl differs significantly from the +parser backends for other programming languages, just as Perl itself +differs significantly from other programming languages. The Perl parser +backend offers many more string marking facilities than the other +backends but it also has some Perl specific limitations, the worst +probably being its imperfectness. + +* Menu: + +* General Problems:: General Problems Parsing Perl Code +* Default Keywords:: Which Keywords Will xgettext Look For? +* Special Keywords:: How to Extract Hash Keys +* Quote-like Expressions:: What are Strings And Quote-like Expressions? +* Interpolation I:: Unsupported String Interpolation +* Interpolation II:: Valid String Interpolation +* Parentheses:: When To Use Parentheses +* Long Lines:: How To Grok with Long Lines +* Perl Pitfalls:: Bugs, Pitfalls, and Things That Do Not Work + + +File: gettext.info, Node: General Problems, Next: Default Keywords, Up: Perl + +15.5.26.1 General Problems Parsing Perl Code +............................................ + + It is often heard that only Perl can parse Perl. This is not true. +Perl cannot be _parsed_ at all, it can only be _executed_. Perl has +various built-in ambiguities that can only be resolved at runtime. + + The following example may illustrate one common problem: + + print gettext "Hello World!"; + + Although this example looks like a bullet-proof case of a function +invocation, it is not: + + open gettext, ">testfile" or die; + print gettext "Hello world!" + + In this context, the string ‘gettext’ looks more like a file handle. +But not necessarily: + + use Locale::Messages qw (:libintl_h); + open gettext ">testfile" or die; + print gettext "Hello world!"; + + Now, the file is probably syntactically incorrect, provided that the +module ‘Locale::Messages’ found first in the Perl include path exports a +function ‘gettext’. But what if the module ‘Locale::Messages’ really +looks like this? + + use vars qw (*gettext); + + 1; + + In this case, the string ‘gettext’ will be interpreted as a file +handle again, and the above example will create a file ‘testfile’ and +write the string "Hello world!" into it. Even advanced control flow +analysis will not really help: + + if (0.5 < rand) { + eval "use Sane"; + } else { + eval "use InSane"; + } + print gettext "Hello world!"; + + If the module ‘Sane’ exports a function ‘gettext’ that does what we +expect, and the module ‘InSane’ opens a file for writing and associates +the _handle_ ‘gettext’ with this output stream, we are clueless again +about what will happen at runtime. It is completely unpredictable. The +truth is that Perl has so many ways to fill its symbol table at runtime +that it is impossible to interpret a particular piece of code without +executing it. + + Of course, ‘xgettext’ will not execute your Perl sources while +scanning for translatable strings, but rather use heuristics in order to +guess what you meant. + + Another problem is the ambiguity of the slash and the question mark. +Their interpretation depends on the context: + + # A pattern match. + print "OK\n" if /foobar/; + + # A division. + print 1 / 2; + + # Another pattern match. + print "OK\n" if ?foobar?; + + # Conditional. + print $x ? "foo" : "bar"; + + The slash may either act as the division operator or introduce a +pattern match, whereas the question mark may act as the ternary +conditional operator or as a pattern match, too. Other programming +languages like ‘awk’ present similar problems, but the consequences of a +misinterpretation are particularly nasty with Perl sources. In ‘awk’ +for instance, a statement can never exceed one line and the parser can +recover from a parsing error at the next newline and interpret the rest +of the input stream correctly. Perl is different, as a pattern match is +terminated by the next appearance of the delimiter (the slash or the +question mark) in the input stream, regardless of the semantic context. +If a slash is really a division sign but mis-interpreted as a pattern +match, the rest of the input file is most probably parsed incorrectly. + + There are certain cases, where the ambiguity cannot be resolved at +all: + + $x = wantarray ? 1 : 0; + + The Perl built-in function ‘wantarray’ does not accept any arguments. +The Perl parser therefore knows that the question mark does not start a +regular expression but is the ternary conditional operator. + + sub wantarrays {} + $x = wantarrays ? 1 : 0; + + Now the situation is different. The function ‘wantarrays’ takes a +variable number of arguments (like any non-prototyped Perl function). +The question mark is now the delimiter of a pattern match, and hence the +piece of code does not compile. + + sub wantarrays() {} + $x = wantarrays ? 1 : 0; + + Now the function is prototyped, Perl knows that it does not accept +any arguments, and the question mark is therefore interpreted as the +ternaray operator again. But that unfortunately outsmarts ‘xgettext’. + + The Perl parser in ‘xgettext’ cannot know whether a function has a +prototype and what that prototype would look like. It therefore makes +an educated guess. If a function is known to be a Perl built-in and +this function does not accept any arguments, a following question mark +or slash is treated as an operator, otherwise as the delimiter of a +following regular expression. The Perl built-ins that do not accept +arguments are ‘wantarray’, ‘fork’, ‘time’, ‘times’, ‘getlogin’, +‘getppid’, ‘getpwent’, ‘getgrent’, ‘gethostent’, ‘getnetent’, +‘getprotoent’, ‘getservent’, ‘setpwent’, ‘setgrent’, ‘endpwent’, +‘endgrent’, ‘endhostent’, ‘endnetent’, ‘endprotoent’, and ‘endservent’. + + If you find that ‘xgettext’ fails to extract strings from portions of +your sources, you should therefore look out for slashes and/or question +marks preceding these sections. You may have come across a bug in +‘xgettext’'s Perl parser (and of course you should report that bug). In +the meantime you should consider to reformulate your code in a manner +less challenging to ‘xgettext’. + + In particular, if the parser is too dumb to see that a function does +not accept arguments, use parentheses: + + $x = somefunc() ? 1 : 0; + $y = (somefunc) ? 1 : 0; + + In fact the Perl parser itself has similar problems and warns you +about such constructs. + + +File: gettext.info, Node: Default Keywords, Next: Special Keywords, Prev: General Problems, Up: Perl + +15.5.26.2 Which keywords will xgettext look for? +................................................ + + Unless you instruct ‘xgettext’ otherwise by invoking it with one of +the options ‘--keyword’ or ‘-k’, it will recognize the following +keywords in your Perl sources: + + • ‘gettext’ + + • ‘dgettext:2’ + + The second argument will be extracted. + + • ‘dcgettext:2’ + + The second argument will be extracted. + + • ‘ngettext:1,2’ + + The first (singular) and the second (plural) argument will be + extracted. + + • ‘dngettext:2,3’ + + The second (singular) and the third (plural) argument will be + extracted. + + • ‘dcngettext:2,3’ + + The second (singular) and the third (plural) argument will be + extracted. + + • ‘pgettext:1c,2’ + + The first (message context) and the second argument will be + extracted. + + • ‘dpgettext:2c,3’ + + The second (message context) and the third argument will be + extracted. + + • ‘dcpgettext:2c,3’ + + The second (message context) and the third argument will be + extracted. + + • ‘npgettext:1c,2,3’ + + The first (message context), second (singular), and third (plural) + argument will be extracted. + + • ‘dnpgettext:2c,3,4’ + + The second (message context), third (singular), and fourth (plural) + argument will be extracted. + + • ‘dcnpgettext:2c,3,4’ + + The second (message context), third (singular), and fourth (plural) + argument will be extracted. + + • ‘gettext_noop’ + + • ‘%gettext’ + + The keys of lookups into the hash ‘%gettext’ will be extracted. + + • ‘$gettext’ + + The keys of lookups into the hash reference ‘$gettext’ will be + extracted. + + +File: gettext.info, Node: Special Keywords, Next: Quote-like Expressions, Prev: Default Keywords, Up: Perl + +15.5.26.3 How to Extract Hash Keys +.................................. + + Translating messages at runtime is normally performed by looking up +the original string in the translation database and returning the +translated version. The "natural" Perl implementation is a hash lookup, +and, of course, ‘xgettext’ supports such practice. + + print __"Hello world!"; + print $__{"Hello world!"}; + print $__->{"Hello world!"}; + print $$__{"Hello world!"}; + + The above four lines all do the same thing. The Perl module +‘Locale::TextDomain’ exports by default a hash ‘%__’ that is tied to the +function ‘__()’. It also exports a reference ‘$__’ to ‘%__’. + + If an argument to the ‘xgettext’ option ‘--keyword’, resp. ‘-k’ +starts with a percent sign, the rest of the keyword is interpreted as +the name of a hash. If it starts with a dollar sign, the rest of the +keyword is interpreted as a reference to a hash. + + Note that you can omit the quotation marks (single or double) around +the hash key (almost) whenever Perl itself allows it: + + print $gettext{Error}; + + The exact rule is: You can omit the surrounding quotes, when the hash +key is a valid C (!) identifier, i.e. when it starts with an underscore +or an ASCII letter and is followed by an arbitrary number of +underscores, ASCII letters or digits. Other Unicode characters are +_not_ allowed, regardless of the ‘use utf8’ pragma. + + +File: gettext.info, Node: Quote-like Expressions, Next: Interpolation I, Prev: Special Keywords, Up: Perl + +15.5.26.4 What are Strings And Quote-like Expressions? +...................................................... + + Perl offers a plethora of different string constructs. Those that +can be used either as arguments to functions or inside braces for hash +lookups are generally supported by ‘xgettext’. + + • *double-quoted strings* + print gettext "Hello World!"; + + • *single-quoted strings* + print gettext 'Hello World!'; + + • *the operator qq* + print gettext qq |Hello World!|; + print gettext qq >; + + The operator ‘qq’ is fully supported. You can use arbitrary + delimiters, including the four bracketing delimiters (round, angle, + square, curly) that nest. + + • *the operator q* + print gettext q |Hello World!|; + print gettext q >; + + The operator ‘q’ is fully supported. You can use arbitrary + delimiters, including the four bracketing delimiters (round, angle, + square, curly) that nest. + + • *the operator qx* + print gettext qx ;LANGUAGE=C /bin/date; + print gettext qx [/usr/bin/ls | grep '^[A-Z]*']; + + The operator ‘qx’ is fully supported. You can use arbitrary + delimiters, including the four bracketing delimiters (round, angle, + square, curly) that nest. + + The example is actually a useless use of ‘gettext’. It will invoke + the ‘gettext’ function on the output of the command specified with + the ‘qx’ operator. The feature was included in order to make the + interface consistent (the parser will extract all strings and + quote-like expressions). + + • *here documents* + print gettext <<'EOF'; + program not found in $PATH + EOF + + print ngettext <My Homepage + + EOF + + The parser will extract the entire here document, and it will appear +entirely in the resulting PO file, including the JavaScript snippet +embedded in the HTML code. If you exaggerate with constructs like the +above, you will run the risk that the translators of your package will +look out for a less challenging project. You should consider an +alternative expression here: + + print <$gettext{"My Homepage"} + + EOF + + Only the translatable portions of the code will be extracted here, +and the resulting PO file will begrudgingly improve in terms of +readability. + + You can interpolate hash lookups in all strings or quote-like +expressions that are subject to interpolation (see the manual page ‘man +perlop’ for details). Double interpolation is unsupported, however: + + # TRANSLATORS: Replace "the earth" with the name of your planet. + print gettext qq{Welcome to $gettext->{"the earth"}}; + + The ‘qq’-quoted string is recognized as an argument to ‘xgettext’ in +the first place, and checked for unsupported variable interpolation. +The dollar sign of hash-dereferencing will therefore terminate the +parser with an "unsupported interpolation" warning. + + It is valid to interpolate hash lookups in regular expressions: + + if ($var =~ /$gettext{"the earth"}/) { + print gettext "Match!\n"; + } + s/$gettext{"U. S. A."}/$gettext{"U. S. A."} $gettext{"(dial +0)"}/g; + + +File: gettext.info, Node: Parentheses, Next: Long Lines, Prev: Interpolation II, Up: Perl + +15.5.26.7 When To Use Parentheses +................................. + + In Perl, parentheses around function arguments are mostly optional. +‘xgettext’ will always assume that all recognized keywords (except for +hashes and hash references) are names of properly prototyped functions, +and will (hopefully) only require parentheses where Perl itself requires +them. All constructs in the following example are therefore ok to use: + + print gettext ("Hello World!\n"); + print gettext "Hello World!\n"; + print dgettext ($package => "Hello World!\n"); + print dgettext $package, "Hello World!\n"; + + # The "fat comma" => turns the left-hand side argument into a + # single-quoted string! + print dgettext smellovision => "Hello World!\n"; + + # The following assignment only works with prototyped functions. + # Otherwise, the functions will act as "greedy" list operators and + # eat up all following arguments. + my $anonymous_hash = { + planet => gettext "earth", + cakes => ngettext "one cake", "several cakes", $n, + still => $works, + }; + # The same without fat comma: + my $other_hash = { + 'planet', gettext "earth", + 'cakes', ngettext "one cake", "several cakes", $n, + 'still', $works, + }; + + # Parentheses are only significant for the first argument. + print dngettext 'package', ("one cake", "several cakes", $n), $discarded; + + +File: gettext.info, Node: Long Lines, Next: Perl Pitfalls, Prev: Parentheses, Up: Perl + +15.5.26.8 How To Grok with Long Lines +..................................... + + The necessity of long messages can often lead to a cumbersome or +unreadable coding style. Perl has several options that may prevent you +from writing unreadable code, and ‘xgettext’ does its best to do +likewise. This is where the dot operator (the string concatenation +operator) may come in handy: + + print gettext ("This is a very long" + . " message that is still" + . " readable, because" + . " it is split into" + . " multiple lines.\n"); + + Perl is smart enough to concatenate these constant string fragments +into one long string at compile time, and so is ‘xgettext’. You will +only find one long message in the resulting POT file. + + Note that the future Perl 6 will probably use the underscore (‘_’) as +the string concatenation operator, and the dot (‘.’) for dereferencing. +This new syntax is not yet supported by ‘xgettext’. + + If embedded newline characters are not an issue, or even desired, you +may also insert newline characters inside quoted strings wherever you +feel like it: + + print gettext ("In HTML output + embedded newlines are generally no + problem, since adjacent whitespace + is always rendered into a single + space character."); + + You may also consider to use here documents: + + print gettext <In HTML output + embedded newlines are generally no + problem, since adjacent whitespace + is always rendered into a single + space character. + EOF + + Please do not forget that the line breaks are real, i.e. they +translate into newline characters that will consequently show up in the +resulting POT file. + + +File: gettext.info, Node: Perl Pitfalls, Prev: Long Lines, Up: Perl + +15.5.26.9 Bugs, Pitfalls, And Things That Do Not Work +..................................................... + + The foregoing sections should have proven that ‘xgettext’ is quite +smart in extracting translatable strings from Perl sources. Yet, some +more or less exotic constructs that could be expected to work, actually +do not work. + + One of the more relevant limitations can be found in the +implementation of variable interpolation inside quoted strings. Only +simple hash lookups can be used there: + + print </gettext ("Sunday")/e; + + The modifier ‘e’ will cause the substitution to be interpreted as an +evaluable statement. Consequently, at runtime the function ‘gettext()’ +is called, but again, the parser fails to extract the string "Sunday". +Use a temporary variable as a simple workaround if you really happen to +need this feature: + + my $sunday = gettext "Sunday"; + s//$sunday/; + + Hash slices would also be handy but are not recognized: + + my @weekdays = @gettext{'Sunday', 'Monday', 'Tuesday', 'Wednesday', + 'Thursday', 'Friday', 'Saturday'}; + # Or even: + @weekdays = @gettext{qw (Sunday Monday Tuesday Wednesday Thursday + Friday Saturday) }; + + This is perfectly valid usage of the tied hash ‘%gettext’ but the +strings are not recognized and therefore will not be extracted. + + Another caveat of the current version is its rudimentary support for +non-ASCII characters in identifiers. You may encounter serious problems +if you use identifiers with characters outside the range of 'A'-'Z', +'a'-'z', '0'-'9' and the underscore '_'. + + Maybe some of these missing features will be implemented in future +versions, but since you can always make do without them at minimal +effort, these todos have very low priority. + + A nasty problem are brace format strings that already contain braces +as part of the normal text, for example the usage strings typically +encountered in programs: + + die "usage: $0 {OPTIONS} FILENAME...\n"; + + If you want to internationalize this code with Perl brace format +strings, you will run into a problem: + + die __x ("usage: {program} {OPTIONS} FILENAME...\n", program => $0); + + Whereas ‘{program}’ is a placeholder, ‘{OPTIONS}’ is not and should +probably be translated. Yet, there is no way to teach the Perl parser +in ‘xgettext’ to recognize the first one, and leave the other one alone. + + There are two possible work-arounds for this problem. If you are +sure that your program will run under Perl 5.8.0 or newer (these Perl +versions handle positional parameters in ‘printf()’) or if you are sure +that the translator will not have to reorder the arguments in her +translation - for example if you have only one brace placeholder in your +string, or if it describes a syntax, like in this one -, you can mark +the string as ‘no-perl-brace-format’ and use ‘printf()’: + + # xgettext: no-perl-brace-format + die sprintf ("usage: %s {OPTIONS} FILENAME...\n", $0); + + If you want to use the more portable Perl brace format, you will have +to do put placeholders in place of the literal braces: + + die __x ("usage: {program} {[}OPTIONS{]} FILENAME...\n", + program => $0, '[' => '{', ']' => '}'); + + Perl brace format strings know no escaping mechanism. No matter how +this escaping mechanism looked like, it would either give the programmer +a hard time, make translating Perl brace format strings heavy-going, or +result in a performance penalty at runtime, when the format directives +get executed. Most of the time you will happily get along with +‘printf()’ for this special case. + + +File: gettext.info, Node: PHP, Next: Pike, Prev: Perl, Up: List of Programming Languages + +15.5.27 PHP Hypertext Preprocessor +---------------------------------- + +RPMs + php + +Ubuntu packages + php + +File extension + ‘php’, ‘php3’, ‘php4’ + +String syntax + ‘"abc"’, ‘'abc'’, ‘<<. + +RPMs + appdata-tools, appstream, libappstream-glib, + libappstream-glib-builder + +Ubuntu packages + appdata-tools, appstream, libappstream-glib-dev + +File extension + ‘appdata.xml’, ‘metainfo.xml’ + +Extractor + ‘xgettext’, ‘intltool-extract’, ‘itstool’ + + +File: gettext.info, Node: Preparing ITS Rules, Prev: AppData, Up: Internationalizable Data + +16.1.6 Preparing Rules for XML Internationalization +--------------------------------------------------- + +* Menu: + +* ITS Rules:: Specifying ITS Rules +* Locating Rules:: Specifying where to find the ITS Rules + + +File: gettext.info, Node: ITS Rules, Next: Locating Rules, Up: Preparing ITS Rules + +16.1.6.1 Specifying ITS Rules +............................. + + Marking translatable strings in an XML file is done through a +separate "rule" file, making use of the Internationalization Tag Set +standard (ITS, ). The currently supported +ITS data categories are: ‘Translate’, ‘Localization Note’, ‘Elements +Within Text’, and ‘Preserve Space’. In addition to them, ‘xgettext’ +also recognizes the following extended data categories: + +‘Context’ + + This data category associates ‘msgctxt’ to the extracted text. In + the global rule, the ‘contextRule’ element contains the following: + + • A required ‘selector’ attribute. It contains an absolute + selector that selects the nodes to which this rule applies. + + • A required ‘contextPointer’ attribute that contains a relative + selector pointing to a node that holds the ‘msgctxt’ value. + + • An optional ‘textPointer’ attribute that contains a relative + selector pointing to a node that holds the ‘msgid’ value. + +‘Extended Preserve Space’ + + This data category extends the standard ‘Preserve Space’ data + category with the additional values ‘trim’ and ‘paragraph’. ‘trim’ + means to remove the leading and trailing whitespaces of the + content, but not to normalize whitespaces in the middle. + ‘paragraph’ means to normalize the content but keep the paragraph + boundaries. In the global rule, the ‘preserveSpaceRule’ element + contains the following: + + • A required ‘selector’ attribute. It contains an absolute + selector that selects the nodes to which this rule applies. + + • A required ‘space’ attribute with the value ‘default’, + ‘preserve’, ‘trim’, or ‘paragraph’. + +‘Escape Special Characters’ + + This data category indicates whether the special XML characters + (‘<’, ‘>’, ‘&’, ‘"’) are escaped with entity references. In the + global rule, the ‘escapeRule’ element contains the following: + + • A required ‘selector’ attribute. It contains an absolute + selector that selects the nodes to which this rule applies. + + • A required ‘escape’ attribute with the value ‘yes’ or ‘no’. + + • An optional ‘unescape-if’ attribute with the value ‘xml’, + ‘xhtml’, ‘html’, or ‘no’. + + The default values, ‘escape="no"’ and ‘unescape-if="no"’, should be + good for most XML file types. A rule with ‘escape="no"’, that was + necessary with GNU gettext versions before 0.23, is now redundant. + + The ‘unescape-if’ attribute is useful for XML file types which + present messages with embedded XML elements to the translator. + Such file types are for example DocBook or XHTML. If + ‘unescape-if="xml"’ is specified and the translation of a message + looks like valid XML, the usual escaping of ‘<’, ‘>’, and character + references is omitted. The resulting XML document then is likely + what the translator intended. However, if the translator did not + merely copy the XML markup from the message to the translation, but + added or removed markup, the resulting XML document may be invalid. + It is therefore useful if, after invoking ‘msgfmt’, you check the + resulting XML document against the appropriate XML schema or DTD. + + Similarly, if ‘unescape-if="xhtml"’ is specified and the + translation looks like valid XHTML, the usual escaping is omitted. + And likewise for ‘unescape-if="html"’. + + All those extended data categories can only be expressed with global +rules, and the rule elements have to have the +‘https://www.gnu.org/s/gettext/ns/its/extensions/1.0’ namespace. + + Given the following XML document in a file ‘messages.xml’: + + + + +

A translatable string

+
+ +

A non-translatable string

+
+
+ + To extract the first text content ("A translatable string"), but not +the second ("A non-translatable string"), the following ITS rules can be +used: + + + + + + + + + + + ITS rules files must have the ‘.its’ file extension and obey the XML +schema version 1.0 encoded by ‘its.xsd10’ or the XML schema version 1.1 +encoded by ‘its.xsd11’ and its auxiliary schema ‘its-extensions.xsd’. + + +File: gettext.info, Node: Locating Rules, Prev: ITS Rules, Up: Preparing ITS Rules + +16.1.6.2 Specifying where to find the ITS Rules +............................................... + + ‘xgettext’ needs another file called "locating rules" to associate an +ITS rule with an XML file. If the above ITS file is saved as +‘messages.its’, the locating rules file would look like: + + + + + + + + + + The ‘locatingRule’ element must have a ‘pattern’ attribute, which +denotes either a literal file name or a wildcard pattern of the XML +file(1). The ‘locatingRule’ element can have child ‘documentRule’ +element, which adds checks on the content of the XML file. + + The first rule matches any file with the ‘.xml’ file extension, but +it only applies to XML files whose root element is ‘’. + + The second rule indicates that the same ITS rules file are also +applicable to any file with the ‘.msg’ file extension. The optional +‘name’ attribute of ‘locatingRule’ allows to choose rules by name, +typically with ‘xgettext’'s ‘-L’ option. + + The associated ITS rules file is indicated by the ‘target’ attribute +of ‘locatingRule’ or ‘documentRule’. If it is specified in a +‘documentRule’ element, the parent ‘locatingRule’ shouldn't have the +‘target’ attribute. + + Locating rules files must have the ‘.loc’ file extension and obey the +XML schema version 1.0 encoded by ‘locating-rules.xsd10’ or the XML +schema version 1.1 encoded by ‘locating-rules.xsd11’. Both ITS rules +files and locating rules files must be installed in the +‘$prefix/share/gettext/its’ directory. Once those files are properly +installed, ‘xgettext’ can extract translatable strings from the matching +XML files. + +16.1.6.3 Two Use-cases of Translated Strings in XML +................................................... + + After strings have been extracted from an XML file to a POT file +through ‘xgettext’ and the translator has produced a PO file with +translations, it can be used in two ways: + + • The PO file (or the MO file generated from it) can be directly + consumed by a program. + + • Or the translated strings can be merged back to the original XML + document. To do this use the ‘msgfmt’ program with the option + ‘--xml’. *Note msgfmt Invocation::, for more details about how one + calls the ‘msgfmt’ program. + + During this merge from a PO file into an XML file, it may happen + that more escaping of special characters for XML is needed than + what ‘msgfmt’ does by default. In this case, you can enforce more + escaping either throuch an ‘’ ITS rule, or through an + attribute ‘gt:escape="yes"’ on the particular XML element. + + ---------- Footnotes ---------- + + (1) Note that the file name matching is done after removing any ‘.in’ +suffix from the input file name. Thus the ‘pattern’ attribute must not +include a pattern matching ‘.in’. For example, if the input file name +is ‘foo.msg.in’, the pattern should be either ‘*.msg’ or just ‘*’, +rather than ‘*.in’. + + +File: gettext.info, Node: Localized Data, Prev: Internationalizable Data, Up: Data Formats + +16.2 Localized Data Formats +=========================== + + Here is a list of file formats that contain localized data and that +the GNU gettext tools can manipulate. + +* Menu: + +* Editable Message Catalogs:: Editable Message Catalogs +* Compiled Message Catalogs:: Compiled Message Catalogs +* Desktop Entry:: Desktop Entry files +* XML:: XML files + + +File: gettext.info, Node: Editable Message Catalogs, Next: Compiled Message Catalogs, Up: Localized Data + +16.2.1 Editable Message Catalogs +-------------------------------- + + These file formats can be used with all of the ‘msg*’ tools and with +the ‘xgettext’ program. + + If you just want to convert among these formats, you can use the +‘msgcat’ program (with the appropriate option) or the ‘xgettext’ +program. + +* Menu: + +* PO:: PO - Portable Object +* Java .properties:: Java .properties +* GNUstep .strings:: NeXTstep/GNUstep .strings + + +File: gettext.info, Node: PO, Next: Java .properties, Up: Editable Message Catalogs + +16.2.1.1 PO - Portable Object +............................. + +File extension + ‘po’ + + +File: gettext.info, Node: Java .properties, Next: GNUstep .strings, Prev: PO, Up: Editable Message Catalogs + +16.2.1.2 Java .properties +......................... + +File extension + ‘properties’ + + +File: gettext.info, Node: GNUstep .strings, Prev: Java .properties, Up: Editable Message Catalogs + +16.2.1.3 NeXTstep/GNUstep .strings +.................................. + +File extension + ‘strings’ + + +File: gettext.info, Node: Compiled Message Catalogs, Next: Desktop Entry, Prev: Editable Message Catalogs, Up: Localized Data + +16.2.2 Compiled Message Catalogs +-------------------------------- + + These file formats can be created through ‘msgfmt’ and converted back +to PO format through ‘msgunfmt’. + +* Menu: + +* MO:: MO - Machine Object +* Java ResourceBundle:: Java ResourceBundle +* C# Satellite Assembly:: C# Satellite Assembly +* C# Resource:: C# Resource +* Tcl message catalog:: Tcl message catalog +* Qt message catalog:: Qt message catalog + + +File: gettext.info, Node: MO, Next: Java ResourceBundle, Up: Compiled Message Catalogs + +16.2.2.1 MO - Machine Object +............................ + +File extension + ‘mo’ + + See section *note MO Files:: for details. + + +File: gettext.info, Node: Java ResourceBundle, Next: C# Satellite Assembly, Prev: MO, Up: Compiled Message Catalogs + +16.2.2.2 Java ResourceBundle +............................ + +File extension + ‘class’ + + For more information, see the section *note Java:: and the examples +‘hello-java’, ‘hello-java-awt’, ‘hello-java-swing’. + + +File: gettext.info, Node: C# Satellite Assembly, Next: C# Resource, Prev: Java ResourceBundle, Up: Compiled Message Catalogs + +16.2.2.3 C# Satellite Assembly +.............................. + +File extension + ‘dll’ + + For more information, see the section *note C#::. + + +File: gettext.info, Node: C# Resource, Next: Tcl message catalog, Prev: C# Satellite Assembly, Up: Compiled Message Catalogs + +16.2.2.4 C# Resource +.................... + +File extension + ‘resources’ + + For more information, see the section *note C#::. + + +File: gettext.info, Node: Tcl message catalog, Next: Qt message catalog, Prev: C# Resource, Up: Compiled Message Catalogs + +16.2.2.5 Tcl message catalog +............................ + +File extension + ‘msg’ + + For more information, see the section *note Tcl:: and the examples +‘hello-tcl’, ‘hello-tcl-tk’. + + +File: gettext.info, Node: Qt message catalog, Prev: Tcl message catalog, Up: Compiled Message Catalogs + +16.2.2.6 Qt message catalog +........................... + +File extension + ‘qm’ + + For more information, see the examples ‘hello-c++-qt’ and +‘hello-c++-kde’. + + +File: gettext.info, Node: Desktop Entry, Next: XML, Prev: Compiled Message Catalogs, Up: Localized Data + +16.2.3 Desktop Entry files +-------------------------- + + The programmer produces a desktop entry file template with only the +English strings. These strings get included in the POT file, by way of +‘xgettext’ (usually by listing the template in ‘po/POTFILES.in’). The +translators produce PO files, one for each language. Finally, an +‘msgfmt --desktop’ invocation collects all the translations in the +desktop entry file. + + For more information, see the example ‘hello-c-gnome3’. + +* Menu: + +* Icons:: Handling icons + + +File: gettext.info, Node: Icons, Up: Desktop Entry + +16.2.3.1 How to handle icons in Desktop Entry files +................................................... + + Icons are generally locale dependent, for the following reasons: + + • Icons may contain signs that are considered rude in some cultures. + For example, the high-five sign, in some cultures, is perceived as + an unfriendly "stop" sign. + • Icons may contain metaphors that are culture specific. For + example, a mailbox in the U.S. looks different than mailboxes all + around the world. + • Icons may need to be mirrored for right-to-left locales. + • Icons may contain text strings (a bad practice, but anyway). + + However, icons are not covered by GNU gettext localization, because + • Icons cannot be easily embedded in PO files, + • The need to localize an icon is rare, and the ability to do so in a + PO file would introduce translator mistakes. + + Desktop Entry files may contain an ‘Icon’ property, and this property +is localizable. If a translator wishes to localize an icon, she should +do so by bypassing the normal workflow with PO files: + 1. The translator contacts the package developers directly, sending + them the icon appropriate for her locale, with a request to change + the template file. + 2. The package developers add the icon file to their repository, and a + line + Icon[LOCALE]=ICON_FILE_NAME + to the template file. +This line remains in place when this template file is merged with the +translators' PO files, through ‘msgfmt’. + + +File: gettext.info, Node: XML, Prev: Desktop Entry, Up: Localized Data + +16.2.4 XML files +---------------- + + See the section *note Preparing ITS Rules:: and *note msgfmt +Invocation::, subsection "XML mode operations". + + +File: gettext.info, Node: Conclusion, Next: Language Codes, Prev: Data Formats, Up: Top + +17 Concluding Remarks +********************* + + We would like to conclude this GNU ‘gettext’ manual by presenting an +history of the Translation Project so far. We finally give a few +pointers for those who want to do further research or readings about +Native Language Support matters. + +* Menu: + +* History:: History of GNU ‘gettext’ +* The original ABOUT-NLS:: Historical introduction +* References:: Related Readings + + +File: gettext.info, Node: History, Next: The original ABOUT-NLS, Up: Conclusion + +17.1 History of GNU ‘gettext’ +============================= + + Internationalization concerns and algorithms have been informally and +casually discussed for years in GNU, sometimes around GNU ‘libc’, maybe +around the incoming ‘Hurd’, or otherwise (nobody clearly remembers). +And even then, when the work started for real, this was somewhat +independently of these previous discussions. + + This all began in July 1994, when Patrick D'Cruze had the idea and +initiative of internationalizing version 3.9.2 of GNU ‘fileutils’. He +then asked Jim Meyering, the maintainer, how to get those changes folded +into an official release. That first draft was full of ‘#ifdef’s and +somewhat disconcerting, and Jim wanted to find nicer ways. Patrick and +Jim shared some tries and experimentations in this area. Then, feeling +that this might eventually have a deeper impact on GNU, Jim wanted to +know what standards were, and contacted Richard Stallman, who very +quickly and verbally described an overall design for what was meant to +become ‘glocale’, at that time. + + Jim implemented ‘glocale’ and got a lot of exhausting feedback from +Patrick and Richard, of course, but also from Mitchum DSouza (who wrote +a ‘catgets’-like package), Roland McGrath, maybe David MacKenzie, +François Pinard, and Paul Eggert, all pushing and pulling in various +directions, not always compatible, to the extent that after a couple of +test releases, ‘glocale’ was torn apart. In particular, Paul Eggert - +always keeping an eye on developments in Solaris - advocated the use of +the ‘gettext’ API over ‘glocale’'s ‘catgets’-based API. + + While Jim took some distance and time and became dad for a second +time, Roland wanted to get GNU ‘libc’ internationalized, and got Ulrich +Drepper involved in that project. Instead of starting from ‘glocale’, +Ulrich rewrote something from scratch, but more conforming to the set of +guidelines who emerged out of the ‘glocale’ effort. Then, Ulrich got +people from the previous forum to involve themselves into this new +project, and the switch from ‘glocale’ to what was first named +‘msgutils’, renamed ‘nlsutils’, and later ‘gettext’, became officially +accepted by Richard in May 1995 or so. + + Let's summarize by saying that Ulrich Drepper wrote GNU ‘gettext’ in +April 1995. The first official release of the package, including PO +mode, occurred in July 1995, and was numbered 0.7. Other people +contributed to the effort by providing a discussion forum around Ulrich, +writing little pieces of code, or testing. These are quoted in the +‘THANKS’ file which comes with the GNU ‘gettext’ distribution. + + While this was being done, François adapted half a dozen of GNU +packages to ‘glocale’ first, then later to ‘gettext’, putting them in +pretest, so providing along the way an effective user environment for +fine tuning the evolving tools. He also took the responsibility of +organizing and coordinating the Translation Project. After nearly a +year of informal exchanges between people from many countries, +translator teams started to exist in May 1995, through the creation and +support by Patrick D'Cruze of twenty unmoderated mailing lists for that +many native languages, and two moderated lists: one for reaching all +teams at once, the other for reaching all willing maintainers of +internationalized free software packages. + + François also wrote PO mode in June 1995 with the collaboration of +Greg McGary, as a kind of contribution to Ulrich's package. He also +gave a hand with the GNU ‘gettext’ Texinfo manual. + + In 1997, Ulrich Drepper released the GNU libc 2.0, which included the +‘gettext’, ‘textdomain’ and ‘bindtextdomain’ functions. + + In 2000, Ulrich Drepper added plural form handling (the ‘ngettext’ +function) to GNU libc. Later, in 2001, he released GNU libc 2.2.x, +which is the first free C library with full internationalization +support. + + Ulrich being quite busy in his role of General Maintainer of GNU +libc, he handed over the GNU ‘gettext’ maintenance to Bruno Haible in +2000. Bruno added the plural form handling to the tools as well, added +support for UTF-8 and CJK locales, and wrote a few new tools for +manipulating PO files. + + +File: gettext.info, Node: The original ABOUT-NLS, Next: References, Prev: History, Up: Conclusion + +17.2 Notes on the Free Translation Project +========================================== + + This section contains the text that was, for a long time, distributed +as a file named ‘ABOUT-NLS’. + + * NOTE: * This documentation section is outdated. It it included +here for historical purposes only. + + Free software is going international! The Free Translation Project +is a way to get maintainers of free software, translators, and users all +together, so that free software will gradually become able to speak many +languages. A few packages already provide translations for their +messages. + + If you found this ‘ABOUT-NLS’ file inside a distribution, you may +assume that the distributed package does use GNU ‘gettext’ internally, +itself available at your nearest GNU archive site. But you do _not_ +need to install GNU ‘gettext’ prior to configuring, installing or using +this package with messages translated. + + Installers will find here some useful hints. These notes also +explain how users should proceed for getting the programs to use the +available translations. They tell how people wanting to contribute and +work on translations can contact the appropriate team. + +* Menu: + +* INSTALL Matters:: +* Using This Package:: +* Translating Teams:: +* Available Packages:: +* Using gettext in own code:: + + +File: gettext.info, Node: INSTALL Matters, Next: Using This Package, Up: The original ABOUT-NLS + +17.2.1 INSTALL Matters +---------------------- + + Some packages are “localizable” when properly installed; the programs +they contain can be made to speak your own native language. Most such +packages use GNU ‘gettext’. Other packages have their own ways to +internationalization, predating GNU ‘gettext’. + + By default, this package will be installed to allow translation of +messages. It will automatically detect whether the system already +provides the GNU ‘gettext’ functions. Installers may use special +options at configuration time for changing the default behaviour. The +command: + + ./configure --disable-nls + +will _totally_ disable translation of messages. + + When you already have GNU ‘gettext’ installed on your system and run +configure without an option for your new package, ‘configure’ will +probably detect the previously built and installed ‘libintl’ library and +will decide to use it. If not, you may have to to use the +‘--with-libintl-prefix’ option to tell ‘configure’ where to look for it. + + Internationalized packages usually have many ‘po/LL.po’ or +‘po/LL_CC.po’ files, where + + • LL gives an ISO 639 two-letter code identifying the language. For + some languages, a two-letter code does not exist, and a + three-letter code is used instead. + • The optional CC is an ISO 3166 two-letter code of a country or + territory. + +Unless translations have been forbidden at ‘configure’ time by using the +‘--disable-nls’ switch, all available translations are installed +together with the package. However, the environment variable ‘LINGUAS’ +may be set, prior to configuration, to limit the installed set. +‘LINGUAS’ should then contain a space separated list of locale names (of +the form ‘LL’ or ‘LL_CC’, stating which languages or language variants +are allowed. + + +File: gettext.info, Node: Using This Package, Next: Translating Teams, Prev: INSTALL Matters, Up: The original ABOUT-NLS + +17.2.2 Using This Package +------------------------- + + As a user, if your language has been installed for this package, you +only have to set the ‘LANG’ environment variable to the appropriate +‘LL_CC’ combination. If you happen to have the ‘LC_ALL’ or some other +‘LC_xxx’ environment variables set, you should unset them before setting +‘LANG’, otherwise the setting of ‘LANG’ will not have the desired +effect. Here + + • ‘LL’ is an ISO 639 two-letter language code. For some languages, a + two-letter code does not exist, and a three-letter code is used + instead. + • ‘CC’ is an ISO 3166 two-letter code of a country or territory. + +For example, let's suppose that you speak German and live in Germany. +At the shell prompt, merely execute ‘setenv LANG de_DE’ (in ‘csh’), +‘export LANG; LANG=de_DE’ (in ‘sh’) or ‘export LANG=de_DE’ (in ‘bash’). +This can be done from your ‘.login’ or ‘.profile’ file, once and for +all. + + You might think that the country code specification is redundant. +But in fact, some languages have dialects in different countries. For +example, ‘de_AT’ is used for Austria, and ‘pt_BR’ for Brazil. The +country code serves to distinguish the dialects. + + The locale naming convention of ‘LL_CC’, with ‘LL’ denoting the +language and ‘CC’ denoting the country, is the one use on systems based +on GNU libc. On other systems, some variations of this scheme are used, +such as ‘LL’ or ‘LL_CC.ENCODING’. You can get the list of locales +supported by your system for your language by running the command +‘locale -a | grep '^LL'’. + + Not all programs have translations for all languages. By default, an +English message is shown in place of a nonexistent translation. If you +understand other languages, you can set up a priority list of languages. +This is done through a different environment variable, called +‘LANGUAGE’. GNU ‘gettext’ gives preference to ‘LANGUAGE’ over ‘LANG’ +for the purpose of message handling, but you still need to have ‘LANG’ +set to the primary language; this is required by other parts of the +system libraries. For example, some Swedish users who would rather read +translations in German than English for when Swedish is not available, +set ‘LANGUAGE’ to ‘sv:de’ while leaving ‘LANG’ to ‘sv_SE’. + + Special advice for Norwegian users: The language code for Norwegian +bokmål changed from ‘no’ to ‘nb’ recently (in 2003). During the +transition period, while some message catalogs for this language are +installed under ‘nb’ and some older ones under ‘no’, it's recommended +for Norwegian users to set ‘LANGUAGE’ to ‘nb:no’ so that both newer and +older translations are used. + + In the ‘LANGUAGE’ environment variable, but not in the ‘LANG’ +environment variable, ‘LL_CC’ combinations can be abbreviated as ‘LL’ to +denote the language's main dialect. For example, ‘de’ is equivalent to +‘de_DE’ (German as spoken in Germany), and ‘pt’ to ‘pt_PT’ (Portuguese +as spoken in Portugal) in this context. + + +File: gettext.info, Node: Translating Teams, Next: Available Packages, Prev: Using This Package, Up: The original ABOUT-NLS + +17.2.3 Translating Teams +------------------------ + + For the Free Translation Project to be a success, we need interested +people who like their own language and write it well, and who are also +able to synergize with other translators speaking the same language. +Each translation team has its own mailing list. The up-to-date list of +teams can be found at the Free Translation Project's homepage, +‘https://translationproject.org/’, in the "Teams" area. + + If you'd like to volunteer to _work_ at translating messages, you +should become a member of the translating team for your own language. +The subscribing address is _not_ the same as the list itself, it has +‘-request’ appended. For example, speakers of Swedish can send a +message to ‘sv-request@li.org’, having this message body: + + subscribe + + Keep in mind that team members are expected to participate _actively_ +in translations, or at solving translational difficulties, rather than +merely lurking around. If your team does not exist yet and you want to +start one, or if you are unsure about what to do or how to get started, +please write to ‘coordinator@translationproject.org’ to reach the +coordinator for all translator teams. + + The English team is special. It works at improving and uniformizing +the terminology in use. Proven linguistic skills are praised more than +programming skills, here. + + +File: gettext.info, Node: Available Packages, Next: Using gettext in own code, Prev: Translating Teams, Up: The original ABOUT-NLS + +17.2.4 Available Packages +------------------------- + + Languages are not equally supported in all packages. The following +matrix shows the current state of internationalization, as of May 2025. +The matrix shows, in regard of each package, for which languages PO +files have been submitted to translation coordination, with a +translation percentage of at least 50%. + + Ready PO files ab af an ar ast be bg bn bn_IN ca ckb crh cs da + +-------------------------------------------------+ + a2ps | [] | + anubis | [] | + aspell | [] [] [] [] [] | + bash | [] [] [] | + beebase | | + bfd | | + binutils | [] | + bison | [] [] | + bison-runtime | [] [] [] [] | + buzztrax | [] [] | + ccd2cue | [] | + ccide | [] | + cflow | | + chambercourt | | + clisp | [] | + coreutils | [] [] [] [] | + cpio | [] [] | + cppi | [] | + cpplib | | + cryptsetup | [] [] | + datamash | [] | + denemo | [] [] [] | + dfarc | [] [] | + dialog | [] [] [] [] [] | + dico | [] | + diffutils | [] [] [] | + dink | [] [] | + direvent | [] | + doodle | [] [] | + dos2unix | [] [] | + dos2unix-man | | + e2fsprogs | [] [] [] | + enscript | [] [] | + exif | [] [] [] | + fetchmail | [] [] [] | + findutils | [] [] [] [] | + flex | [] [] [] | + freedink | [] [] [] | + fusionforge | | + gas | | + gawk | [] [] | + gcal | [] [] | + gcc | | + gdbm | | + gettext-examples | [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] | + gettext-tools | [] [] [] | + gnubik | [] [] | + gnuchess | [] | + gnucobol | | + gnulib | [] | + gnunet | | + gnunet-gtk | | + gnutls | [] | + gold | | + gphoto2 | [] [] | + gprof | [] [] | + grep | [] [] [] [] [] | + grip | [] [] [] [] | + grub | [] [] [] | + gsasl | [] | + gss | [] | + gst-plugins-bad | [] [] [] [] | + gst-plugins-base | [] [] [] [] | + gst-plugins-good | [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] | + gstreamer | [] [] [] [] [] | + gtick | [] [] | + gtkam | [] [] [] | + gtkspell | [] [] [] [] [] [] | + gutenprint | [] [] | + hello | [] | + help2man | [] | + help2man-texi | | + i18nparse | | + idutils | [] | + kbd | [] | + klavaro | [] [] [] [] [] [] | + ld | | + libc | [] [] [] [] [] | + libexif | [] | + libextractor | [] | + libgphoto2 | [] [] | + libgphoto2_port | [] [] | + libiconv | [] [] [] [] | + libidn | [] [] | + libidn2 | [] [] | + lilypond | [] [] [] | + lordsawar | [] [] | + lynx | [] [] [] | + m4 | [] | + mailfromd | [] | + mailutils | | + make | [] [] [] | + man-db | [] [] [] [] | + man-db-manpages | | + meritous | [] | + midi-instruments | [] [] [] [] | + minicom | [] [] | + mpop | | + msmtp | | + nano | [] [] [] | + opcodes | | + parted | [] [] | + pies | | + procps-ng | | + procps-ng-man | | + psmisc | [] [] [] | + psmisc-man | | + pspp | [] [] | + pyspread | [] | + radius | [] | + recode | [] [] [] [] | + recutils | | + rush | [] | + sarg | [] | + savane | | + sed | [] [] [] [] [] [] | + sharutils | [] | + shepherd | | + shishi | | + skribilo | [] | + solfege | [] [] [] | + solfege-manual | [] | + sudo | [] [] [] [] | + sudoers | [] [] | + sysstat | [] | + tar | [] [] [] [] | + texinfo | [] [] [] | + texinfo_document | [] | + tigervnc | [] [] | + tin | [] | + tin-man | | + trader | [] | + util-linux | [] [] | + util-linux-man | | + vmm | | + vorbis-tools | [] [] | + wastesedge | [] | + wcd | [] | + wcd-man | | + wdiff | [] [] [] | + wget | [] [] [] | + wget2 | | + wincoll | | + wyslij-po | [] | + xboard | [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] [] | + xz | [] | + xz-man | | + +-------------------------------------------------+ + ab af an ar ast be bg bn bn_IN ca ckb crh cs da + 1 3 2 6 15 14 31 1 1 52 1 1 62 95 + + de el en en_GB eo es et eu fa fi fr fur ga gd + +--------------------------------------------------+ + a2ps | [] [] [] [] [] | + anubis | [] [] [] [] | + aspell | [] [] [] [] [] [] [] [] | + bash | [] [] [] [] [] | + beebase | [] [] [] | + bfd | [] [] | + binutils | [] | + bison | [] [] [] [] [] [] [] | + bison-runtime | [] [] [] [] [] [] [] [] | + buzztrax | [] [] [] [] | + ccd2cue | [] [] [] [] | + ccide | [] [] [] [] [] [] | + cflow | [] [] [] | + chambercourt | [] [] | + clisp | [] [] [] [] | + coreutils | [] [] [] [] | + cpio | [] [] [] [] [] | + cppi | [] [] [] [] [] | + cpplib | [] [] | + cryptsetup | [] [] [] | + datamash | [] [] [] [] | + denemo | | + dfarc | [] [] [] [] [] [] | + dialog | [] [] [] [] [] [] [] [] [] [] [] | + dico | [] [] [] [] | + diffutils | [] [] [] [] [] [] | + dink | [] [] [] [] [] | + direvent | [] [] [] [] | + doodle | [] [] [] [] [] [] | + dos2unix | [] [] [] [] [] | + dos2unix-man | [] [] [] | + e2fsprogs | [] [] [] | + enscript | [] [] [] [] [] [] [] | + exif | [] [] [] [] [] [] | + fetchmail | () [] [] [] [] | + findutils | [] [] [] [] [] [] [] | + flex | [] [] [] [] [] [] | + freedink | [] [] [] [] [] [] [] [] | + fusionforge | [] [] [] | + gas | [] [] [] | + gawk | [] [] [] [] | + gcal | [] [] [] | + gcc | [] [] | + gdbm | [] [] [] [] | + gettext-examples | [] [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] | + gettext-tools | [] [] [] [] | + gnubik | [] [] [] [] [] [] | + gnuchess | [] [] [] [] | + gnucobol | [] [] | + gnulib | [] [] [] [] [] | + gnunet | [] | + gnunet-gtk | [] [] | + gnutls | [] [] [] [] [] | + gold | [] [] [] | + gphoto2 | () [] [] | + gprof | [] [] [] [] [] [] | + grep | [] [] [] [] [] [] [] | + grip | [] [] [] [] [] | + grub | [] [] [] [] [] | + gsasl | [] [] [] [] [] [] | + gss | [] [] [] [] [] [] | + gst-plugins-bad | [] [] [] [] [] | + gst-plugins-base | [] [] [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] [] [] [] | + gtick | () [] [] [] [] [] | + gtkam | () [] [] [] [] | + gtkspell | [] [] [] [] [] [] [] [] [] | + gutenprint | [] [] [] | + hello | [] [] [] [] [] | + help2man | [] [] [] [] [] [] | + help2man-texi | [] [] [] | + i18nparse | [] [] [] () | + idutils | [] [] [] [] [] [] | + kbd | [] [] [] [] [] | + klavaro | [] [] [] [] [] [] | + ld | [] [] | + libc | [] [] [] [] | + libexif | [] [] [] | + libextractor | [] [] [] | + libgphoto2 | () [] [] | + libgphoto2_port | () [] [] [] [] [] | + libiconv | [] [] [] [] [] [] [] | + libidn | [] [] [] [] [] | + libidn2 | [] [] [] [] [] | + lilypond | [] [] [] [] | + lordsawar | [] [] | + lynx | [] [] [] [] [] | + m4 | [] [] [] [] | + mailfromd | [] [] | + mailutils | [] [] [] [] | + make | [] [] [] [] [] | + man-db | [] [] [] [] | + man-db-manpages | [] [] [] | + meritous | [] | + midi-instruments | [] [] [] [] [] [] [] [] | + minicom | [] [] [] [] | + mpop | [] [] [] [] | + msmtp | [] [] [] [] | + nano | [] [] [] [] [] [] | + opcodes | [] [] | + parted | [] [] [] [] | + pies | [] [] [] | + procps-ng | [] [] [] | + procps-ng-man | | + psmisc | [] [] [] [] [] [] | + psmisc-man | [] [] | + pspp | [] [] [] [] | + pyspread | [] [] | + radius | [] [] | + recode | [] [] [] [] [] [] | + recutils | [] [] [] | + rush | [] [] [] [] | + sarg | [] [] [] | + savane | [] [] [] | + sed | [] [] [] [] [] [] [] [] | + sharutils | [] [] [] [] | + shepherd | [] | + shishi | [] [] [] | + skribilo | [] [] [] [] | + solfege | [] [] [] [] [] [] [] | + solfege-manual | [] [] [] [] [] | + sudo | [] [] [] [] [] [] | + sudoers | [] [] [] [] | + sysstat | [] [] [] [] [] | + tar | [] [] [] [] [] [] [] | + texinfo | [] [] [] [] | + texinfo_document | [] [] | + tigervnc | [] [] [] [] [] | + tin | [] [] [] | + tin-man | [] [] | + trader | [] [] [] [] [] | + util-linux | [] [] [] | + util-linux-man | [] [] | + vmm | | + vorbis-tools | [] [] [] [] | + wastesedge | [] | + wcd | [] [] [] [] [] [] | + wcd-man | [] [] | + wdiff | [] [] [] [] [] [] [] | + wget | [] [] [] [] [] [] [] | + wget2 | [] [] [] | + wincoll | [] [] [] [] | + wyslij-po | [] [] [] [] [] | + xboard | [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] [] [] | + xz | [] [] [] [] | + xz-man | [] [] | + +--------------------------------------------------+ + de el en en_GB eo es et eu fa fi fr fur ga gd + 131 23 1 5 81 121 19 8 5 74 142 25 26 2 + + gl gu he hi hr hu hy id is it ja ka kk kn ko ku + +-------------------------------------------------+ + a2ps | [] [] [] [] | + anubis | [] [] [] [] | + aspell | [] [] [] [] [] | + bash | [] [] [] | + beebase | () | + bfd | | + binutils | | + bison | [] | + bison-runtime | [] [] [] [] [] [] [] | + buzztrax | | + ccd2cue | [] | + ccide | [] [] [] | + cflow | | + chambercourt | | + clisp | | + coreutils | [] [] [] [] | + cpio | [] [] [] [] [] [] | + cppi | [] [] [] [] [] [] | + cpplib | | + cryptsetup | [] | + datamash | | + denemo | | + dfarc | [] [] [] | + dialog | [] [] [] [] [] [] [] [] [] | + dico | | + diffutils | [] [] [] [] [] [] [] | + dink | [] | + direvent | [] | + doodle | [] | + dos2unix | [] [] [] [] | + dos2unix-man | [] | + e2fsprogs | [] | + enscript | [] [] | + exif | [] [] [] [] [] [] [] [] [] | + fetchmail | [] [] [] | + findutils | [] [] [] [] [] [] | + flex | | + freedink | [] [] [] [] | + fusionforge | | + gas | [] | + gawk | [] () [] | + gcal | | + gcc | | + gdbm | [] | + gettext-examples | [] [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] | + gettext-tools | [] [] [] [] [] | + gnubik | [] [] [] [] | + gnuchess | [] | + gnucobol | | + gnulib | [] [] | + gnunet | | + gnunet-gtk | | + gnutls | [] [] | + gold | | + gphoto2 | [] [] [] [] [] [] | + gprof | [] [] [] [] | + grep | [] [] [] [] [] [] [] [] | + grip | [] [] [] [] | + grub | [] [] [] [] [] [] [] [] | + gsasl | [] [] [] [] | + gss | [] [] [] [] [] | + gst-plugins-bad | [] [] [] [] [] | + gst-plugins-base | [] [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] | + gtick | [] [] [] [] | + gtkam | [] [] [] [] [] [] | + gtkspell | [] [] [] [] [] [] [] [] [] [] | + gutenprint | [] [] [] [] [] | + hello | [] [] | + help2man | [] [] [] [] | + help2man-texi | | + i18nparse | [] | + idutils | [] [] [] | + kbd | [] | + klavaro | [] [] [] [] [] [] | + ld | | + libc | [] [] [] [] [] [] | + libexif | [] | + libextractor | | + libgphoto2 | | + libgphoto2_port | [] [] [] | + libiconv | [] [] [] [] [] [] [] [] | + libidn | [] [] [] [] [] | + libidn2 | [] [] [] [] | + lilypond | [] [] | + lordsawar | [] | + lynx | [] [] [] [] | + m4 | [] | + mailfromd | | + mailutils | | + make | [] [] [] [] [] | + man-db | [] [] [] [] | + man-db-manpages | [] [] | + meritous | | + midi-instruments | [] [] [] [] [] [] [] [] [] [] [] [] | + minicom | [] [] [] [] [] | + mpop | | + msmtp | | + nano | [] [] [] [] [] [] [] [] | + opcodes | | + parted | [] [] [] [] [] [] | + pies | | + procps-ng | [] | + procps-ng-man | | + psmisc | [] [] [] [] [] [] | + psmisc-man | [] [] | + pspp | [] [] | + pyspread | | + radius | [] | + recode | [] [] [] [] [] [] | + recutils | | + rush | | + sarg | [] | + savane | [] | + sed | [] [] [] [] [] [] [] [] | + sharutils | | + shepherd | | + shishi | | + skribilo | [] | + solfege | [] [] | + solfege-manual | | + sudo | [] [] [] [] [] [] [] [] | + sudoers | [] [] [] [] [] | + sysstat | [] [] [] [] [] | + tar | [] [] [] [] [] [] | + texinfo | [] [] | + texinfo_document | [] [] | + tigervnc | [] [] [] [] | + tin | | + tin-man | | + trader | [] [] | + util-linux | [] [] [] | + util-linux-man | | + vmm | | + vorbis-tools | [] [] [] | + wastesedge | [] | + wcd | | + wcd-man | | + wdiff | [] [] [] | + wget | [] [] [] [] [] [] | + wget2 | [] [] [] [] | + wincoll | | + wyslij-po | [] [] [] [] | + xboard | | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] [] [] [] [] | + xz | [] [] [] [] [] | + xz-man | [] [] | + +-------------------------------------------------+ + gl gu he hi hr hu hy id is it ja ka kk kn ko ku + 30 1 10 1 58 62 2 59 7 65 45 44 2 1 45 3 + + ky lg lt lv mk ml mn mr ms mt nb ne nl nn or pa + +-------------------------------------------------+ + a2ps | [] [] [] | + anubis | [] [] [] | + aspell | [] [] | + bash | [] [] | + beebase | [] | + bfd | | + binutils | | + bison | [] | + bison-runtime | [] [] [] [] [] [] | + buzztrax | | + ccd2cue | | + ccide | [] [] | + cflow | | + chambercourt | | + clisp | [] | + coreutils | [] [] | + cpio | [] | + cppi | | + cpplib | | + cryptsetup | | + datamash | [] [] | + denemo | [] | + dfarc | [] [] | + dialog | [] [] [] [] [] | + dico | | + diffutils | [] [] [] [] | + dink | [] | + direvent | [] | + doodle | [] | + dos2unix | [] [] | + dos2unix-man | [] | + e2fsprogs | [] | + enscript | [] | + exif | [] [] [] | + fetchmail | [] | + findutils | [] [] | + flex | [] | + freedink | [] [] [] | + fusionforge | | + gas | | + gawk | [] | + gcal | | + gcc | | + gdbm | | + gettext-examples | [] [] [] [] [] [] [] | + gettext-runtime | [] [] [] | + gettext-tools | | + gnubik | [] [] | + gnuchess | [] [] | + gnucobol | | + gnulib | [] | + gnunet | | + gnunet-gtk | | + gnutls | [] [] | + gold | | + gphoto2 | [] | + gprof | [] [] | + grep | [] [] | + grip | [] [] | + grub | [] [] [] | + gsasl | [] | + gss | | + gst-plugins-bad | [] [] [] | + gst-plugins-base | [] [] [] | + gst-plugins-good | [] [] [] | + gst-plugins-ugly | [] [] [] [] [] | + gstreamer | [] [] [] [] | + gtick | [] [] | + gtkam | [] [] [] | + gtkspell | [] [] [] [] [] [] [] | + gutenprint | [] | + hello | [] [] [] | + help2man | [] | + help2man-texi | | + i18nparse | [] | + idutils | [] [] | + kbd | | + klavaro | [] [] [] | + ld | | + libc | [] | + libexif | [] | + libextractor | [] | + libgphoto2 | [] | + libgphoto2_port | [] | + libiconv | [] [] | + libidn | [] | + libidn2 | [] [] | + lilypond | [] | + lordsawar | | + lynx | [] | + m4 | [] | + mailfromd | | + mailutils | | + make | [] | + man-db | [] | + man-db-manpages | | + meritous | | + midi-instruments | [] [] [] [] [] | + minicom | [] | + mpop | | + msmtp | | + nano | [] [] [] | + opcodes | | + parted | [] | + pies | | + procps-ng | | + procps-ng-man | | + psmisc | [] | + psmisc-man | | + pspp | [] [] | + pyspread | [] | + radius | [] | + recode | [] [] | + recutils | [] | + rush | [] | + sarg | | + savane | | + sed | [] [] | + sharutils | [] | + shepherd | | + shishi | | + skribilo | | + solfege | [] [] | + solfege-manual | [] | + sudo | [] [] | + sudoers | [] | + sysstat | [] [] [] | + tar | [] [] [] | + texinfo | [] [] | + texinfo_document | | + tigervnc | | + tin | | + tin-man | | + trader | [] | + util-linux | [] | + util-linux-man | | + vmm | | + vorbis-tools | [] | + wastesedge | [] | + wcd | [] | + wcd-man | [] | + wdiff | [] [] [] | + wget | [] [] | + wget2 | | + wincoll | | + wyslij-po | [] [] | + xboard | [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] | + xz | [] | + xz-man | | + +-------------------------------------------------+ + ky lg lt lv mk ml mn mr ms mt nb ne nl nn or pa + 5 1 10 17 2 1 3 1 15 2 44 1 95 5 1 3 + + pl pt pt_BR ro ru rw sk sl sq sr sv sw ta te + +-------------------------------------------------+ + a2ps | [] [] [] [] [] | + anubis | [] [] [] [] [] [] | + aspell | [] [] [] [] [] [] [] [] [] [] | + bash | [] [] [] [] [] [] | + beebase | [] [] [] | + bfd | [] [] [] [] [] | + binutils | [] [] [] [] [] | + bison | [] [] [] [] [] | + bison-runtime | [] [] [] [] [] [] [] [] [] [] | + buzztrax | [] [] [] [] | + ccd2cue | [] [] [] [] | + ccide | [] [] [] [] [] | + cflow | [] [] [] [] [] | + chambercourt | [] [] [] [] | + clisp | [] [] [] | + coreutils | [] [] [] [] [] [] [] [] | + cpio | [] [] [] [] [] [] [] | + cppi | [] [] [] [] [] | + cpplib | [] [] | + cryptsetup | [] [] [] [] [] | + datamash | [] [] [] [] | + denemo | | + dfarc | [] [] [] [] [] | + dialog | [] [] [] [] [] [] [] [] [] [] [] | + dico | [] [] [] [] [] | + diffutils | [] [] [] [] [] [] [] | + dink | [] | + direvent | [] [] [] [] [] | + doodle | [] [] [] [] [] | + dos2unix | [] [] [] [] [] [] | + dos2unix-man | [] [] [] [] [] | + e2fsprogs | [] [] [] [] [] | + enscript | [] [] [] [] [] [] [] | + exif | [] [] [] [] [] [] [] [] | + fetchmail | [] [] [] [] [] [] | + findutils | [] [] [] [] [] [] [] [] | + flex | [] [] [] [] [] [] [] | + freedink | [] [] [] [] [] [] [] | + fusionforge | | + gas | [] [] [] | + gawk | [] [] [] [] [] [] | + gcal | [] [] [] | + gcc | [] [] | + gdbm | [] [] [] [] [] [] | + gettext-examples | [] [] [] [] [] [] [] [] [] [] [] | + gettext-runtime | [] [] [] [] [] [] [] [] [] | + gettext-tools | [] [] [] [] [] [] [] [] [] | + gnubik | [] [] [] [] [] [] [] | + gnuchess | [] [] [] [] | + gnucobol | [] | + gnulib | [] [] [] [] [] [] [] | + gnunet | [] | + gnunet-gtk | [] | + gnutls | [] [] [] [] [] | + gold | [] [] | + gphoto2 | [] [] [] [] [] [] | + gprof | [] [] [] [] [] | + grep | [] [] [] [] [] [] [] [] [] [] | + grip | [] [] [] [] [] | + grub | [] [] [] [] [] [] [] [] | + gsasl | [] [] [] [] [] [] | + gss | [] [] [] [] [] [] | + gst-plugins-bad | [] [] [] [] [] [] [] [] | + gst-plugins-base | [] [] [] [] [] [] [] [] | + gst-plugins-good | [] [] [] [] [] [] [] [] | + gst-plugins-ugly | [] [] [] [] [] [] [] [] [] [] | + gstreamer | [] [] [] [] [] [] [] [] | + gtick | [] [] [] [] [] [] [] | + gtkam | [] [] [] [] [] [] [] [] | + gtkspell | [] [] [] [] [] [] [] [] [] [] [] | + gutenprint | [] [] [] [] [] | + hello | [] [] [] [] [] [] [] [] [] | + help2man | [] [] [] [] [] [] | + help2man-texi | [] [] [] [] [] | + i18nparse | [] [] [] [] | + idutils | [] [] [] [] [] [] | + kbd | [] [] [] [] [] [] [] | + klavaro | [] [] [] [] [] [] [] [] [] | + ld | [] [] [] [] | + libc | [] [] [] [] [] [] [] [] | + libexif | [] [] [] [] [] | + libextractor | [] [] [] [] | + libgphoto2 | [] [] [] | + libgphoto2_port | [] [] [] [] [] [] [] | + libiconv | [] [] [] [] [] [] [] [] | + libidn | [] [] [] [] [] | + libidn2 | [] [] [] [] [] [] | + lilypond | [] [] | + lordsawar | [] [] | + lynx | [] [] [] [] | + m4 | [] [] [] [] [] | + mailfromd | [] [] [] [] | + mailutils | [] [] [] [] | + make | [] [] [] [] [] [] [] | + man-db | [] [] [] [] [] [] [] | + man-db-manpages | [] [] [] [] [] [] [] | + meritous | [] [] [] [] | + midi-instruments | [] [] [] [] [] [] [] [] [] | + minicom | [] [] [] [] [] [] | + mpop | [] [] [] [] [] | + msmtp | [] [] [] [] [] | + nano | [] [] [] [] [] [] [] [] [] | + opcodes | [] [] [] [] | + parted | [] [] [] [] [] [] [] [] [] | + pies | [] [] [] [] | + procps-ng | [] [] [] [] | + procps-ng-man | [] [] | + psmisc | [] [] [] [] [] [] [] | + psmisc-man | [] [] [] [] [] | + pspp | [] [] [] | + pyspread | [] [] [] | + radius | [] [] [] | + recode | [] [] [] [] [] [] [] [] [] | + recutils | [] [] [] [] | + rush | [] [] [] [] [] | + sarg | [] [] [] [] | + savane | [] [] () | + sed | [] [] [] [] [] [] [] [] [] | + sharutils | [] [] [] [] [] | + shepherd | [] [] [] [] | + shishi | [] [] [] [] | + skribilo | [] [] [] [] | + solfege | [] [] [] [] [] [] | + solfege-manual | [] [] [] [] | + sudo | [] [] [] [] [] [] [] | + sudoers | [] [] [] [] [] [] [] | + sysstat | [] [] [] [] [] [] | + tar | [] [] [] [] [] [] [] [] | + texinfo | [] [] [] [] [] [] [] [] | + texinfo_document | [] [] [] [] [] [] [] | + tigervnc | [] [] [] [] [] | + tin | [] | + tin-man | | + trader | [] [] [] [] [] | + util-linux | [] [] [] [] [] [] | + util-linux-man | [] [] [] | + vmm | [] [] | + vorbis-tools | [] [] [] [] [] [] | + wastesedge | [] [] | + wcd | [] [] [] [] | + wcd-man | [] [] [] [] | + wdiff | [] [] [] [] [] [] [] | + wget | [] [] [] [] [] [] [] [] | + wget2 | [] [] [] [] [] | + wincoll | [] [] [] [] [] | + wyslij-po | [] [] [] [] [] | + xboard | [] [] [] [] [] | + xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] | + xkeyboard-config | [] [] [] [] [] [] [] [] [] | + xz | [] [] [] [] [] [] | + xz-man | [] [] [] | + +-------------------------------------------------+ + pl pt pt_BR ro ru rw sk sl sq sr sv sw ta te + 99 49 113 135 85 0 37 32 11 130 131 1 8 1 + + tg th tr uk ur vi wa wo zh_CN zh_HK zh_TW + +--------------------------------------------+ + a2ps | [] [] | 20 + anubis | [] [] [] | 21 + aspell | [] [] [] [] | 34 + bash | [] [] [] [] | 23 + beebase | [] | 8 + bfd | [] | 8 + binutils | [] | 8 + bison | [] [] | 18 + bison-runtime | [] [] [] [] [] [] | 41 + buzztrax | [] [] | 12 + ccd2cue | [] [] [] [] | 14 + ccide | [] [] [] | 20 + cflow | [] [] | 10 + chambercourt | [] | 7 + clisp | | 13 + coreutils | [] [] [] [] [] | 27 + cpio | [] [] [] [] | 25 + cppi | [] [] [] | 20 + cpplib | [] [] | 6 + cryptsetup | [] [] | 13 + datamash | [] | 12 + denemo | [] [] [] | 7 + dfarc | [] | 19 + dialog | [] [] [] [] [] [] [] | 48 + dico | [] | 11 + diffutils | [] [] [] [] [] | 32 + dink | [] | 11 + direvent | [] [] | 14 + doodle | [] [] [] | 18 + dos2unix | [] [] [] [] | 23 + dos2unix-man | [] [] | 12 + e2fsprogs | [] [] [] | 16 + enscript | [] [] [] | 22 + exif | [] [] [] [] | 33 + fetchmail | [] [] | 19 + findutils | [] [] [] [] [] | 32 + flex | [] [] [] [] [] | 22 + freedink | [] [] | 27 + fusionforge | | 3 + gas | [] | 8 + gawk | [] [] [] [] | 19 + gcal | [] [] | 10 + gcc | [] | 5 + gdbm | [] [] | 13 + gettext-examples | [] [] [] [] [] [] | 44 + gettext-runtime | [] [] [] [] [] | 34 + gettext-tools | [] [] [] [] [] | 26 + gnubik | [] [] [] | 24 + gnuchess | [] [] [] | 15 + gnucobol | | 3 + gnulib | [] [] [] | 19 + gnunet | | 2 + gnunet-gtk | | 3 + gnutls | [] [] [] | 18 + gold | [] | 6 + gphoto2 | [] [] [] [] | 21 + gprof | [] [] [] | 22 + grep | [] [] [] [] [] [] | 38 + grip | [] [] [] [] [] | 25 + grub | [] [] [] [] | 31 + gsasl | [] [] [] | 21 + gss | [] [] | 20 + gst-plugins-bad | [] [] [] [] [] | 30 + gst-plugins-base | [] [] [] [] | 32 + gst-plugins-good | [] [] [] [] [] | 34 + gst-plugins-ugly | [] [] [] [] [] | 40 + gstreamer | [] [] [] [] [] | 35 + gtick | [] [] [] | 23 + gtkam | [] [] [] | 27 + gtkspell | [] [] [] [] [] [] [] [] | 51 + gutenprint | [] [] [] | 19 + hello | [] [] [] | 23 + help2man | [] [] [] | 21 + help2man-texi | [] | 9 + i18nparse | [] | 10 + idutils | [] [] [] | 21 + kbd | [] | 15 + klavaro | [] [] [] [] [] [] | 36 + ld | [] | 7 + libc | [] [] [] [] [] | 29 + libexif | [] [] | 13 + libextractor | [] [] | 11 + libgphoto2 | [] [] | 10 + libgphoto2_port | [] [] [] [] | 22 + libiconv | [] [] [] [] [] | 34 + libidn | [] [] [] | 21 + libidn2 | [] [] | 21 + lilypond | [] | 13 + lordsawar | [] | 8 + lynx | [] [] [] | 20 + m4 | [] [] | 14 + mailfromd | [] [] | 9 + mailutils | [] [] | 10 + make | [] [] [] [] | 25 + man-db | [] [] [] [] [] | 25 + man-db-manpages | [] [] [] | 15 + meritous | | 6 + midi-instruments | [] [] [] [] [] [] | 44 + minicom | [] [] | 20 + mpop | [] | 10 + msmtp | [] | 10 + nano | [] [] [] [] [] | 34 + opcodes | [] | 7 + parted | [] [] [] [] [] | 27 + pies | [] [] | 9 + procps-ng | [] [] [] | 11 + procps-ng-man | [] [] | 4 + psmisc | [] [] [] [] | 27 + psmisc-man | [] | 10 + pspp | [] [] [] | 16 + pyspread | [] | 8 + radius | [] [] | 10 + recode | [] [] [] [] | 31 + recutils | [] [] | 10 + rush | [] [] [] | 14 + sarg | | 9 + savane | [] | 7 + sed | [] [] [] [] [] | 38 + sharutils | [] [] [] | 14 + shepherd | [] | 6 + shishi | [] [] | 9 + skribilo | [] | 11 + solfege | [] [] [] | 23 + solfege-manual | [] | 12 + sudo | [] [] [] [] [] | 32 + sudoers | [] [] [] | 22 + sysstat | [] [] [] [] | 24 + tar | [] [] [] [] [] | 33 + texinfo | [] [] [] | 22 + texinfo_document | [] | 13 + tigervnc | [] [] [] [] | 20 + tin | [] [] [] | 8 + tin-man | | 2 + trader | | 14 + util-linux | [] [] [] | 18 + util-linux-man | [] | 6 + vmm | [] | 3 + vorbis-tools | [] | 17 + wastesedge | [] | 7 + wcd | [] [] [] | 15 + wcd-man | [] | 8 + wdiff | [] [] [] [] | 27 + wget | [] [] [] [] [] | 31 + wget2 | [] [] | 14 + wincoll | [] | 10 + wyslij-po | [] [] [] | 20 + xboard | [] [] [] | 13 + xdg-user-dirs | [] [] [] [] [] [] [] [] | 72 + xkeyboard-config | [] [] [] | 33 + xz | [] [] [] [] [] | 22 + xz-man | [] | 8 + +--------------------------------------------+ + 85 teams tg th tr uk ur vi wa wo zh_CN zh_HK zh_TW + 151 domains 0 11 52 125 1 87 5 1 90 5 42 2840 + + Some counters in the preceding matrix are higher than the number of +visible blocks let us expect. This is because a few extra PO files are +used for implementing regional variants of languages, or language +dialects. + + For a PO file in the matrix above to be effective, the package to +which it applies should also have been internationalized and distributed +as such by its maintainer. There might be an observable lag between the +mere existence a PO file and its wide availability in a distribution. + + If May 2025 seems to be old, you may fetch a more recent copy of this +‘ABOUT-NLS’ file on most GNU archive sites. The most up-to-date matrix +with full percentage details can be found at +‘https://translationproject.org/extra/matrix.html’. + + +File: gettext.info, Node: Using gettext in own code, Prev: Available Packages, Up: The original ABOUT-NLS + +17.2.5 Using ‘gettext’ in new packages +-------------------------------------- + + If you are writing a freely available program and want to +internationalize it you are welcome to use GNU ‘gettext’ in your +package. Of course you have to respect the GNU Lesser General Public +License which covers the use of the GNU ‘gettext’ library. This means +in particular that even non-free programs can use ‘libintl’ as a shared +library, whereas only free software can use ‘libintl’ as a static +library or use modified versions of ‘libintl’. + + Once the sources are changed appropriately and the setup can handle +the use of ‘gettext’ the only thing missing are the translations. The +Free Translation Project is also available for packages which are not +developed inside the GNU project. Therefore the information given above +applies also for every other Free Software Project. Contact +‘coordinator@translationproject.org’ to make the ‘.pot’ files available +to the translation teams. + + +File: gettext.info, Node: References, Prev: The original ABOUT-NLS, Up: Conclusion + +17.3 Related Readings +===================== + + * NOTE: * This documentation section is outdated and needs to be +revised. + + Eugene H. Dorr (‘dorre@well.com’) maintains an interesting +bibliography on internationalization matters, called +‘Internationalization Reference List’, which is available as: + ftp://ftp.ora.com/pub/examples/nutshell/ujip/doc/i18n-books.txt + + Michael Gschwind (‘mike@vlsivie.tuwien.ac.at’) maintains a Frequently +Asked Questions (FAQ) list, entitled ‘Programming for +Internationalisation’. This FAQ discusses writing programs which can +handle different language conventions, character sets, etc.; and is +applicable to all character set encodings, with particular emphasis on +ISO 8859-1. It is regularly published in Usenet groups +‘comp.unix.questions’, ‘comp.std.internat’, +‘comp.software.international’, ‘comp.lang.c’, ‘comp.windows.x’, +‘comp.std.c’, ‘comp.answers’ and ‘news.answers’. The home location of +this document is: + ftp://ftp.vlsivie.tuwien.ac.at/pub/8bit/ISO-programming + + Patrick D'Cruze (‘pdcruze@li.org’) wrote a tutorial about NLS +matters, and Jochen Hein (‘Hein@student.tu-clausthal.de’) took over the +responsibility of maintaining it. It may be found as: + ftp://sunsite.unc.edu/pub/Linux/utils/nls/catalogs/Incoming/... + ...locale-tutorial-0.8.txt.gz +This site is mirrored in: + ftp://ftp.ibp.fr/pub/linux/sunsite/ + + A French version of the same tutorial should be findable at: + ftp://ftp.ibp.fr/pub/linux/french/docs/ +together with French translations of many Linux-related documents. + + +File: gettext.info, Node: Language Codes, Next: Country Codes, Prev: Conclusion, Up: Top + +Appendix A Language Codes +************************* + + The ISO 639 standard defines two-letter codes for many languages, and +three-letter codes for more rarely used languages. All abbreviations +for languages used in the Translation Project should come from this +standard. + +* Menu: + +* Usual Language Codes:: Two-letter ISO 639 language codes +* Rare Language Codes:: Three-letter ISO 639 language codes + + +File: gettext.info, Node: Usual Language Codes, Next: Rare Language Codes, Up: Language Codes + +A.1 Usual Language Codes +======================== + + For the commonly used languages, the ISO 639-1 standard defines +two-letter codes. + +‘aa’ + Afar. +‘ab’ + Abkhazian. +‘ae’ + Avestan. +‘af’ + Afrikaans. +‘ak’ + Akan. +‘am’ + Amharic. +‘an’ + Aragonese. +‘ar’ + Arabic. +‘as’ + Assamese. +‘av’ + Avaric. +‘ay’ + Aymara. +‘az’ + Azerbaijani. +‘ba’ + Bashkir. +‘be’ + Belarusian. +‘bg’ + Bulgarian. +‘bh’ + Bihari languages. +‘bi’ + Bislama. +‘bm’ + Bambara. +‘bn’ + Bengali. +‘bo’ + Tibetan. +‘br’ + Breton. +‘bs’ + Bosnian. +‘ca’ + Catalan; Valencian. +‘ce’ + Chechen. +‘ch’ + Chamorro. +‘co’ + Corsican. +‘cr’ + Cree. +‘cs’ + Czech. +‘cu’ + Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old + Church Slavonic. +‘cv’ + Chuvash. +‘cy’ + Welsh. +‘da’ + Danish. +‘de’ + German. +‘dv’ + Divehi; Dhivehi; Maldivian. +‘dz’ + Dzongkha. +‘ee’ + Ewe. +‘el’ + Greek, Modern (1453-). +‘en’ + English. +‘eo’ + Esperanto. +‘es’ + Spanish; Castilian. +‘et’ + Estonian. +‘eu’ + Basque. +‘fa’ + Persian. +‘ff’ + Fulah. +‘fi’ + Finnish. +‘fj’ + Fijian. +‘fo’ + Faroese. +‘fr’ + French. +‘fy’ + Western Frisian. +‘ga’ + Irish. +‘gd’ + Gaelic; Scottish Gaelic. +‘gl’ + Galician. +‘gn’ + Guarani. +‘gu’ + Gujarati. +‘gv’ + Manx. +‘ha’ + Hausa. +‘he’ + Hebrew. +‘hi’ + Hindi. +‘ho’ + Hiri Motu. +‘hr’ + Croatian. +‘ht’ + Haitian; Haitian Creole. +‘hu’ + Hungarian. +‘hy’ + Armenian. +‘hz’ + Herero. +‘ia’ + Interlingua (International Auxiliary Language Association). +‘id’ + Indonesian. +‘ie’ + Interlingue; Occidental. +‘ig’ + Igbo. +‘ii’ + Sichuan Yi; Nuosu. +‘ik’ + Inupiak. +‘io’ + Ido. +‘is’ + Icelandic. +‘it’ + Italian. +‘iu’ + Inuktitut. +‘ja’ + Japanese. +‘jv’ + Javanese. +‘ka’ + Georgian. +‘kg’ + Kongo. +‘ki’ + Kikuyu; Gikuyu. +‘kj’ + Kuanyama; Kwanyama. +‘kk’ + Kazakh. +‘kl’ + Kalaallisut; Greenlandic. +‘km’ + Central Khmer. +‘kn’ + Kannada. +‘ko’ + Korean. +‘kr’ + Kanuri. +‘ks’ + Kashmiri. +‘ku’ + Kurdish. +‘kv’ + Komi. +‘kw’ + Cornish. +‘ky’ + Kirghiz; Kyrgyz. +‘la’ + Latin. +‘lb’ + Luxembourgish; Letzeburgesch. +‘lg’ + Ganda. +‘li’ + Limburgan; Limburger; Limburgish. +‘ln’ + Lingala. +‘lo’ + Lao. +‘lt’ + Lithuanian. +‘lu’ + Luba-Katanga. +‘lv’ + Latvian. +‘mg’ + Malagasy. +‘mh’ + Marshallese. +‘mi’ + Maori. +‘mk’ + Macedonian. +‘ml’ + Malayalam. +‘mn’ + Mongolian. +‘mr’ + Marathi. +‘ms’ + Malay. +‘mt’ + Maltese. +‘my’ + Burmese. +‘na’ + Nauru. +‘nb’ + Bokmål, Norwegian; Norwegian Bokmål. +‘nd’ + Ndebele, North; North Ndebele. +‘ne’ + Nepali. +‘ng’ + Ndonga. +‘nl’ + Dutch; Flemish. +‘nn’ + Norwegian Nynorsk; Nynorsk, Norwegian. +‘no’ + Norwegian. +‘nr’ + Ndebele, South; South Ndebele. +‘nv’ + Navajo; Navaho. +‘ny’ + Chichewa; Nyanja. +‘oc’ + Occitan (post 1500); Provençal. +‘oj’ + Ojibwa. +‘om’ + Oromo. +‘or’ + Oriya. +‘os’ + Ossetian; Ossetic. +‘pa’ + Panjabi; Punjabi. +‘pi’ + Pali. +‘pl’ + Polish. +‘ps’ + Pushto; Pashto. +‘pt’ + Portuguese. +‘qu’ + Quechua. +‘rm’ + Romansh. +‘rn’ + Rundi. +‘ro’ + Romanian; Moldavian; Moldovan. +‘ru’ + Russian. +‘rw’ + Kinyarwanda. +‘sa’ + Sanskrit. +‘sc’ + Sardinian. +‘sd’ + Sindhi. +‘se’ + Northern Sami. +‘sg’ + Sango. +‘si’ + Sinhala; Sinhalese. +‘sk’ + Slovak. +‘sl’ + Slovenian. +‘sm’ + Samoan. +‘sn’ + Shona. +‘so’ + Somali. +‘sq’ + Albanian. +‘sr’ + Serbian. +‘ss’ + Swati. +‘st’ + Sotho, Southern. +‘su’ + Sundanese. +‘sv’ + Swedish. +‘sw’ + Swahili. +‘ta’ + Tamil. +‘te’ + Telugu. +‘tg’ + Tajik. +‘th’ + Thai. +‘ti’ + Tigrinya. +‘tk’ + Turkmen. +‘tl’ + Tagalog. +‘tn’ + Tswana. +‘to’ + Tonga (Tonga Islands). +‘tr’ + Turkish. +‘ts’ + Tsonga. +‘tt’ + Tatar. +‘tw’ + Twi. +‘ty’ + Tahitian. +‘ug’ + Uighur; Uyghur. +‘uk’ + Ukrainian. +‘ur’ + Urdu. +‘uz’ + Uzbek. +‘ve’ + Venda. +‘vi’ + Vietnamese. +‘vo’ + Volapük. +‘wa’ + Walloon. +‘wo’ + Wolof. +‘xh’ + Xhosa. +‘yi’ + Yiddish. +‘yo’ + Yoruba. +‘za’ + Zhuang; Chuang. +‘zh’ + Chinese. +‘zu’ + Zulu. + + +File: gettext.info, Node: Rare Language Codes, Prev: Usual Language Codes, Up: Language Codes + +A.2 Rare Language Codes +======================= + + For rarely used languages, the ISO 639-2 standard defines +three-letter codes. Here is the current list, reduced to only living +languages with at least one million of speakers. + +‘ace’ + Achinese. +‘awa’ + Awadhi. +‘bal’ + Baluchi. +‘ban’ + Balinese. +‘bej’ + Beja; Bedawiyet. +‘bem’ + Bemba. +‘bho’ + Bhojpuri. +‘bik’ + Bikol. +‘bin’ + Bini; Edo. +‘bug’ + Buginese. +‘ceb’ + Cebuano. +‘din’ + Dinka. +‘doi’ + Dogri. +‘fil’ + Filipino; Pilipino. +‘fon’ + Fon. +‘gon’ + Gondi. +‘gsw’ + Swiss German; Alemannic; Alsatian. +‘hil’ + Hiligaynon. +‘hmn’ + Hmong. +‘ilo’ + Iloko. +‘kab’ + Kabyle. +‘kam’ + Kamba. +‘kbd’ + Kabardian. +‘kmb’ + Kimbundu. +‘kok’ + Konkani. +‘kru’ + Kurukh. +‘lua’ + Luba-Lulua. +‘luo’ + Luo (Kenya and Tanzania). +‘mad’ + Madurese. +‘mag’ + Magahi. +‘mai’ + Maithili. +‘mak’ + Makasar. +‘man’ + Mandingo. +‘men’ + Mende. +‘min’ + Minangkabau. +‘mni’ + Manipuri. +‘mos’ + Mossi. +‘mwr’ + Marwari. +‘nap’ + Neapolitan. +‘nso’ + Pedi; Sepedi; Northern Sotho. +‘nym’ + Nyamwezi. +‘nyn’ + Nyankole. +‘pag’ + Pangasinan. +‘pam’ + Pampanga; Kapampangan. +‘raj’ + Rajasthani. +‘sas’ + Sasak. +‘sat’ + Santali. +‘scn’ + Sicilian. +‘shn’ + Shan. +‘sid’ + Sidamo. +‘srr’ + Serer. +‘suk’ + Sukuma. +‘sus’ + Susu. +‘tem’ + Timne. +‘tiv’ + Tiv. +‘tum’ + Tumbuka. +‘umb’ + Umbundu. +‘wal’ + Walamo. +‘war’ + Waray. +‘yao’ + Yao. + + +File: gettext.info, Node: Country Codes, Next: Licenses, Prev: Language Codes, Up: Top + +Appendix B Country Codes +************************ + + The ISO 3166 standard defines two character codes for many countries +and territories. All abbreviations for countries used in the +Translation Project should come from this standard. + +‘AD’ + Andorra. +‘AE’ + United Arab Emirates. +‘AF’ + Afghanistan. +‘AG’ + Antigua and Barbuda. +‘AI’ + Anguilla. +‘AL’ + Albania. +‘AM’ + Armenia. +‘AO’ + Angola. +‘AQ’ + Antarctica. +‘AR’ + Argentina. +‘AS’ + American Samoa. +‘AT’ + Austria. +‘AU’ + Australia. +‘AW’ + Aruba. +‘AX’ + Aaland Islands. +‘AZ’ + Azerbaijan. +‘BA’ + Bosnia and Herzegovina. +‘BB’ + Barbados. +‘BD’ + Bangladesh. +‘BE’ + Belgium. +‘BF’ + Burkina Faso. +‘BG’ + Bulgaria. +‘BH’ + Bahrain. +‘BI’ + Burundi. +‘BJ’ + Benin. +‘BL’ + Saint Barthelemy. +‘BM’ + Bermuda. +‘BN’ + Brunei Darussalam. +‘BO’ + Bolivia, Plurinational State of. +‘BQ’ + Bonaire, Sint Eustatius and Saba. +‘BR’ + Brazil. +‘BS’ + Bahamas. +‘BT’ + Bhutan. +‘BV’ + Bouvet Island. +‘BW’ + Botswana. +‘BY’ + Belarus. +‘BZ’ + Belize. +‘CA’ + Canada. +‘CC’ + Cocos (Keeling) Islands. +‘CD’ + Congo, The Democratic Republic of the. +‘CF’ + Central African Republic. +‘CG’ + Congo. +‘CH’ + Switzerland. +‘CI’ + Côte d'Ivoire. +‘CK’ + Cook Islands. +‘CL’ + Chile. +‘CM’ + Cameroon. +‘CN’ + China. +‘CO’ + Colombia. +‘CR’ + Costa Rica. +‘CU’ + Cuba. +‘CV’ + Cape Verde. +‘CW’ + Curaçao. +‘CX’ + Christmas Island. +‘CY’ + Cyprus. +‘CZ’ + Czech Republic. +‘DE’ + Germany. +‘DJ’ + Djibouti. +‘DK’ + Denmark. +‘DM’ + Dominica. +‘DO’ + Dominican Republic. +‘DZ’ + Algeria. +‘EC’ + Ecuador. +‘EE’ + Estonia. +‘EG’ + Egypt. +‘EH’ + Western Sahara. +‘ER’ + Eritrea. +‘ES’ + Spain. +‘ET’ + Ethiopia. +‘FI’ + Finland. +‘FJ’ + Fiji. +‘FK’ + Falkland Islands (Malvinas). +‘FM’ + Micronesia, Federated States of. +‘FO’ + Faroe Islands. +‘FR’ + France. +‘GA’ + Gabon. +‘GB’ + United Kingdom. +‘GD’ + Grenada. +‘GE’ + Georgia. +‘GF’ + French Guiana. +‘GG’ + Guernsey. +‘GH’ + Ghana. +‘GI’ + Gibraltar. +‘GL’ + Greenland. +‘GM’ + Gambia. +‘GN’ + Guinea. +‘GP’ + Guadeloupe. +‘GQ’ + Equatorial Guinea. +‘GR’ + Greece. +‘GS’ + South Georgia and the South Sandwich Islands. +‘GT’ + Guatemala. +‘GU’ + Guam. +‘GW’ + Guinea-Bissau. +‘GY’ + Guyana. +‘HK’ + Hong Kong. +‘HM’ + Heard Island and McDonald Islands. +‘HN’ + Honduras. +‘HR’ + Croatia. +‘HT’ + Haiti. +‘HU’ + Hungary. +‘ID’ + Indonesia. +‘IE’ + Ireland. +‘IL’ + Israel. +‘IM’ + Isle of Man. +‘IN’ + India. +‘IO’ + British Indian Ocean Territory. +‘IQ’ + Iraq. +‘IR’ + Iran, Islamic Republic of. +‘IS’ + Iceland. +‘IT’ + Italy. +‘JE’ + Jersey. +‘JM’ + Jamaica. +‘JO’ + Jordan. +‘JP’ + Japan. +‘KE’ + Kenya. +‘KG’ + Kyrgyzstan. +‘KH’ + Cambodia. +‘KI’ + Kiribati. +‘KM’ + Comoros. +‘KN’ + Saint Kitts and Nevis. +‘KP’ + Korea, Democratic People's Republic of. +‘KR’ + Korea, Republic of. +‘KW’ + Kuwait. +‘KY’ + Cayman Islands. +‘KZ’ + Kazakhstan. +‘LA’ + Lao People's Democratic Republic. +‘LB’ + Lebanon. +‘LC’ + Saint Lucia. +‘LI’ + Liechtenstein. +‘LK’ + Sri Lanka. +‘LR’ + Liberia. +‘LS’ + Lesotho. +‘LT’ + Lithuania. +‘LU’ + Luxembourg. +‘LV’ + Latvia. +‘LY’ + Libya. +‘MA’ + Morocco. +‘MC’ + Monaco. +‘MD’ + Moldova, Republic of. +‘ME’ + Montenegro. +‘MF’ + Saint Martin (French part). +‘MG’ + Madagascar. +‘MH’ + Marshall Islands. +‘MK’ + North Macedonia. +‘ML’ + Mali. +‘MM’ + Myanmar. +‘MN’ + Mongolia. +‘MO’ + Macao. +‘MP’ + Northern Mariana Islands. +‘MQ’ + Martinique. +‘MR’ + Mauritania. +‘MS’ + Montserrat. +‘MT’ + Malta. +‘MU’ + Mauritius. +‘MV’ + Maldives. +‘MW’ + Malawi. +‘MX’ + Mexico. +‘MY’ + Malaysia. +‘MZ’ + Mozambique. +‘NA’ + Namibia. +‘NC’ + New Caledonia. +‘NE’ + Niger. +‘NF’ + Norfolk Island. +‘NG’ + Nigeria. +‘NI’ + Nicaragua. +‘NL’ + Netherlands. +‘NO’ + Norway. +‘NP’ + Nepal. +‘NR’ + Nauru. +‘NU’ + Niue. +‘NZ’ + New Zealand. +‘OM’ + Oman. +‘PA’ + Panama. +‘PE’ + Peru. +‘PF’ + French Polynesia. +‘PG’ + Papua New Guinea. +‘PH’ + Philippines. +‘PK’ + Pakistan. +‘PL’ + Poland. +‘PM’ + Saint Pierre and Miquelon. +‘PN’ + Pitcairn. +‘PR’ + Puerto Rico. +‘PS’ + Palestine, State of. +‘PT’ + Portugal. +‘PW’ + Palau. +‘PY’ + Paraguay. +‘QA’ + Qatar. +‘RE’ + Reunion. +‘RO’ + Romania. +‘RS’ + Serbia. +‘RU’ + Russian Federation. +‘RW’ + Rwanda. +‘SA’ + Saudi Arabia. +‘SB’ + Solomon Islands. +‘SC’ + Seychelles. +‘SD’ + Sudan. +‘SE’ + Sweden. +‘SG’ + Singapore. +‘SH’ + Saint Helena, Ascension and Tristan da Cunha. +‘SI’ + Slovenia. +‘SJ’ + Svalbard and Jan Mayen. +‘SK’ + Slovakia. +‘SL’ + Sierra Leone. +‘SM’ + San Marino. +‘SN’ + Senegal. +‘SO’ + Somalia. +‘SR’ + Suriname. +‘SS’ + South Sudan. +‘ST’ + Sao Tome and Principe. +‘SV’ + El Salvador. +‘SX’ + Sint Maarten (Dutch part). +‘SY’ + Syrian Arab Republic. +‘SZ’ + Swaziland. +‘TC’ + Turks and Caicos Islands. +‘TD’ + Chad. +‘TF’ + French Southern Territories. +‘TG’ + Togo. +‘TH’ + Thailand. +‘TJ’ + Tajikistan. +‘TK’ + Tokelau. +‘TL’ + Timor-Leste. +‘TM’ + Turkmenistan. +‘TN’ + Tunisia. +‘TO’ + Tonga. +‘TR’ + Türkiye. +‘TT’ + Trinidad and Tobago. +‘TV’ + Tuvalu. +‘TW’ + Taiwan, Province of China. +‘TZ’ + Tanzania, United Republic of. +‘UA’ + Ukraine. +‘UG’ + Uganda. +‘UM’ + United States Minor Outlying Islands. +‘US’ + United States. +‘UY’ + Uruguay. +‘UZ’ + Uzbekistan. +‘VA’ + Holy See (Vatican City State). +‘VC’ + Saint Vincent and the Grenadines. +‘VE’ + Venezuela, Bolivarian Republic of. +‘VG’ + Virgin Islands, British. +‘VI’ + Virgin Islands, U.S.. +‘VN’ + Viet Nam. +‘VU’ + Vanuatu. +‘WF’ + Wallis and Futuna. +‘WS’ + Samoa. +‘YE’ + Yemen. +‘YT’ + Mayotte. +‘ZA’ + South Africa. +‘ZM’ + Zambia. +‘ZW’ + Zimbabwe. + + +File: gettext.info, Node: Licenses, Next: Program Index, Prev: Country Codes, Up: Top + +Appendix C Licenses +******************* + + The files of this package are covered by the licenses indicated in +each particular file or directory. Here is a summary: + + • The ‘libintl’ and ‘libasprintf’ libraries are covered by the GNU + Lesser General Public License (LGPL). A copy of the license is + included in *note GNU LGPL::. + + • The executable programs of this package and the ‘libgettextpo’ + library are covered by the GNU General Public License (GPL). A copy + of the license is included in *note GNU GPL::. + + • This manual is free documentation. It is dually licensed under the + GNU FDL and the GNU GPL. This means that you can redistribute this + manual under either of these two licenses, at your choice. + This manual is covered by the GNU FDL. Permission is granted to + copy, distribute and/or modify this document under the terms of the + GNU Free Documentation License (FDL), either version 1.2 of the + License, or (at your option) any later version published by the + Free Software Foundation (FSF); with no Invariant Sections, with no + Front-Cover Text, and with no Back-Cover Texts. A copy of the + license is included in *note GNU FDL::. + This manual is covered by the GNU GPL. You can redistribute it + and/or modify it under the terms of the GNU General Public License + (GPL), either version 2 of the License, or (at your option) any + later version published by the Free Software Foundation (FSF). A + copy of the license is included in *note GNU GPL::. + +* Menu: + +* GNU GPL:: GNU General Public License +* GNU LGPL:: GNU Lesser General Public License +* GNU FDL:: GNU Free Documentation License + + +File: gettext.info, Node: GNU GPL, Next: GNU LGPL, Up: Licenses + +C.1 GNU GENERAL PUBLIC LICENSE +============================== + + Version 2, June 1991 + + Copyright © 1989, 1991 Free Software Foundation, Inc. + + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +Preamble +======== + + The licenses for most software are designed to take away your freedom +to share and change it. By contrast, the GNU General Public License is +intended to guarantee your freedom to share and change free software--to +make sure the software is free for all its users. This General Public +License applies to most of the Free Software Foundation's software and +to any other program whose authors commit to using it. (Some other Free +Software Foundation software is covered by the GNU Lesser General Public +License instead.) You can apply it to your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it if +you want it, that you can change the software or use pieces of it in new +free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, +and (2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +=============================================================== + + 0. This License applies to any program or other work which contains a + notice placed by the copyright holder saying it may be distributed + under the terms of this General Public License. The "Program", + below, refers to any such program or work, and a "work based on the + Program" means either the Program or any derivative work under + copyright law: that is to say, a work containing the Program or a + portion of it, either verbatim or with modifications and/or + translated into another language. (Hereinafter, translation is + included without limitation in the term "modification".) Each + licensee is addressed as "you". + + Activities other than copying, distribution and modification are + not covered by this License; they are outside its scope. The act + of running the Program is not restricted, and the output from the + Program is covered only if its contents constitute a work based on + the Program (independent of having been made by running the + Program). Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's source + code as you receive it, in any medium, provided that you + conspicuously and appropriately publish on each copy an appropriate + copyright notice and disclaimer of warranty; keep intact all the + notices that refer to this License and to the absence of any + warranty; and give any other recipients of the Program a copy of + this License along with the Program. + + You may charge a fee for the physical act of transferring a copy, + and you may at your option offer warranty protection in exchange + for a fee. + + 2. You may modify your copy or copies of the Program or any portion of + it, thus forming a work based on the Program, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + a. You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b. You must cause any work that you distribute or publish, that + in whole or in part contains or is derived from the Program or + any part thereof, to be licensed as a whole at no charge to + all third parties under the terms of this License. + + c. If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display + an announcement including an appropriate copyright notice and + a notice that there is no warranty (or else, saying that you + provide a warranty) and that users may redistribute the + program under these conditions, and telling the user how to + view a copy of this License. (Exception: if the Program + itself is interactive but does not normally print such an + announcement, your work based on the Program is not required + to print an announcement.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the + Program, and can be reasonably considered independent and separate + works in themselves, then this License, and its terms, do not apply + to those sections when you distribute them as separate works. But + when you distribute the same sections as part of a whole which is a + work based on the Program, the distribution of the whole must be on + the terms of this License, whose permissions for other licensees + extend to the entire whole, and thus to each and every part + regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or + contest your rights to work written entirely by you; rather, the + intent is to exercise the right to control the distribution of + derivative or collective works based on the Program. + + In addition, mere aggregation of another work not based on the + Program with the Program (or with a work based on the Program) on a + volume of a storage or distribution medium does not bring the other + work under the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, + under Section 2) in object code or executable form under the terms + of Sections 1 and 2 above provided that you also do one of the + following: + + a. Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of + Sections 1 and 2 above on a medium customarily used for + software interchange; or, + + b. Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a + medium customarily used for software interchange; or, + + c. Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with + such an offer, in accord with Subsection b above.) + + The source code for a work means the preferred form of the work for + making modifications to it. For an executable work, complete + source code means all the source code for all modules it contains, + plus any associated interface definition files, plus the scripts + used to control compilation and installation of the executable. + However, as a special exception, the source code distributed need + not include anything that is normally distributed (in either source + or binary form) with the major components (compiler, kernel, and so + on) of the operating system on which the executable runs, unless + that component itself accompanies the executable. + + If distribution of executable or object code is made by offering + access to copy from a designated place, then offering equivalent + access to copy the source code from the same place counts as + distribution of the source code, even though third parties are not + compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense or distribute the Program is + void, and will automatically terminate your rights under this + License. However, parties who have received copies, or rights, + from you under this License will not have their licenses terminated + so long as such parties remain in full compliance. + + 5. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify + or distribute the Program or its derivative works. These actions + are prohibited by law if you do not accept this License. + Therefore, by modifying or distributing the Program (or any work + based on the Program), you indicate your acceptance of this License + to do so, and all its terms and conditions for copying, + distributing or modifying the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the + Program), the recipient automatically receives a license from the + original licensor to copy, distribute or modify the Program subject + to these terms and conditions. You may not impose any further + restrictions on the recipients' exercise of the rights granted + herein. You are not responsible for enforcing compliance by third + parties to this License. + + 7. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent + issues), conditions are imposed on you (whether by court order, + agreement or otherwise) that contradict the conditions of this + License, they do not excuse you from the conditions of this + License. If you cannot distribute so as to satisfy simultaneously + your obligations under this License and any other pertinent + obligations, then as a consequence you may not distribute the + Program at all. For example, if a patent license would not permit + royalty-free redistribution of the Program by all those who receive + copies directly or indirectly through you, then the only way you + could satisfy both it and this License would be to refrain entirely + from distribution of the Program. + + If any portion of this section is held invalid or unenforceable + under any particular circumstance, the balance of the section is + intended to apply and the section as a whole is intended to apply + in other circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of + any such claims; this section has the sole purpose of protecting + the integrity of the free software distribution system, which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is + willing to distribute software through any other system and a + licensee cannot impose that choice. + + This section is intended to make thoroughly clear what is believed + to be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, + the original copyright holder who places the Program under this + License may add an explicit geographical distribution limitation + excluding those countries, so that distribution is permitted only + in or among countries not thus excluded. In such case, this + License incorporates the limitation as if written in the body of + this License. + + 9. The Free Software Foundation may publish revised and/or new + versions of the General Public License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the + Program specifies a version number of this License which applies to + it and "any later version", you have the option of following the + terms and conditions either of that version or of any later version + published by the Free Software Foundation. If the Program does not + specify a version number of this License, you may choose any + version ever published by the Free Software Foundation. + + 10. If you wish to incorporate parts of the Program into other free + programs whose distribution conditions are different, write to the + author to ask for permission. For software which is copyrighted by + the Free Software Foundation, write to the Free Software + Foundation; we sometimes make exceptions for this. Our decision + will be guided by the two goals of preserving the free status of + all derivatives of our free software and of promoting the sharing + and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO + WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE + LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS + AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY + OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND + PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE + DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR + OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN + WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY + MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE + LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, + INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR + INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF + DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU + OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY + OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + +Appendix: How to Apply These Terms to Your New Programs +======================================================= + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. + Copyright (C) YYYY NAME OF AUTHOR + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . + + Also add information on how to contact you by electronic and paper +mail. + + If the program is interactive, make it output a short notice like +this when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) YEAR NAME OF AUTHOR + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + + The hypothetical commands ‘show w’ and ‘show c’ should show the +appropriate parts of the General Public License. Of course, the +commands you use may be called something other than ‘show w’ and ‘show +c’; they could even be mouse-clicks or menu items--whatever suits your +program. + + You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the program, +if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + SIGNATURE OF MOE GHOUL, 1 April 1989 + Moe Ghoul, President of Vice + + This General Public License does not permit incorporating your +program into proprietary programs. If your program is a subroutine +library, you may consider it more useful to permit linking proprietary +applications with the library. If this is what you want to do, use the +GNU Lesser General Public License instead of this License. + + +File: gettext.info, Node: GNU LGPL, Next: GNU FDL, Prev: GNU GPL, Up: Licenses + +C.2 GNU LESSER GENERAL PUBLIC LICENSE +===================================== + + Version 2.1, February 1999 + + Copyright © 1991, 1999 Free Software Foundation, Inc. + + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + [This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence the + version number 2.1.] + +Preamble +-------- + + The licenses for most software are designed to take away your freedom +to share and change it. By contrast, the GNU General Public Licenses +are intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software--typically libraries--of the Free Software +Foundation and other authors who decide to use it. You can use it too, +but we suggest you first think carefully about whether this license or +the ordinary General Public License is the better strategy to use in any +particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of it +in new free programs; and that you are informed that you can do these +things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling it. +And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that there +is no warranty for the free library. Also, if the library is modified +by someone else and passed on, the recipients should know that what they +have is not the original version, so that the original author's +reputation will not be affected by problems that might be introduced by +others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that any +patent license obtained for a version of the library must be consistent +with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and is +quite different from the ordinary General Public License. We use this +license for certain libraries in order to permit linking those libraries +into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the entire +combination fits its criteria of freedom. The Lesser General Public +License permits more lax criteria for linking other code with the +library. + + We call this license the “Lesser” General Public License because it +does _Less_ to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less of +an advantage over competing non-free programs. These disadvantages are +the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it +becomes a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free library +does the same job as widely used non-free libraries. In this case, +there is little to gain by limiting the free library to free software +only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of free +software. For example, permission to use the GNU C Library in non-free +programs enables many more people to use the whole GNU operating system, +as well as its variant, the GNU/Linux operating system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is linked +with the Library has the freedom and the wherewithal to run that program +using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION +--------------------------------------------------------------- + + 0. This License Agreement applies to any software library or other + program which contains a notice placed by the copyright holder or + other authorized party saying it may be distributed under the terms + of this Lesser General Public License (also called "this License"). + Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data + prepared so as to be conveniently linked with application programs + (which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work + which has been distributed under these terms. A "work based on the + Library" means either the Library or any derivative work under + copyright law: that is to say, a work containing the Library or a + portion of it, either verbatim or with modifications and/or + translated straightforwardly into another language. (Hereinafter, + translation is included without limitation in the term + "modification".) + + "Source code" for a work means the preferred form of the work for + making modifications to it. For a library, complete source code + means all the source code for all modules it contains, plus any + associated interface definition files, plus the scripts used to + control compilation and installation of the library. + + Activities other than copying, distribution and modification are + not covered by this License; they are outside its scope. The act + of running a program using the Library is not restricted, and + output from such a program is covered only if its contents + constitute a work based on the Library (independent of the use of + the Library in a tool for writing it). Whether that is true + depends on what the Library does and what the program that uses the + Library does. + + 1. You may copy and distribute verbatim copies of the Library's + complete source code as you receive it, in any medium, provided + that you conspicuously and appropriately publish on each copy an + appropriate copyright notice and disclaimer of warranty; keep + intact all the notices that refer to this License and to the + absence of any warranty; and distribute a copy of this License + along with the Library. + + You may charge a fee for the physical act of transferring a copy, + and you may at your option offer warranty protection in exchange + for a fee. + + 2. You may modify your copy or copies of the Library or any portion of + it, thus forming a work based on the Library, and copy and + distribute such modifications or work under the terms of Section 1 + above, provided that you also meet all of these conditions: + + a. The modified work must itself be a software library. + + b. You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c. You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d. If a facility in the modified Library refers to a function or + a table of data to be supplied by an application program that + uses the facility, other than as an argument passed when the + facility is invoked, then you must make a good faith effort to + ensure that, in the event an application does not supply such + function or table, the facility still operates, and performs + whatever part of its purpose remains meaningful. + + (For example, a function in a library to compute square roots + has a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function + must be optional: if the application does not supply it, the + square root function must still compute square roots.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the + Library, and can be reasonably considered independent and separate + works in themselves, then this License, and its terms, do not apply + to those sections when you distribute them as separate works. But + when you distribute the same sections as part of a whole which is a + work based on the Library, the distribution of the whole must be on + the terms of this License, whose permissions for other licensees + extend to the entire whole, and thus to each and every part + regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or + contest your rights to work written entirely by you; rather, the + intent is to exercise the right to control the distribution of + derivative or collective works based on the Library. + + In addition, mere aggregation of another work not based on the + Library with the Library (or with a work based on the Library) on a + volume of a storage or distribution medium does not bring the other + work under the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public + License instead of this License to a given copy of the Library. To + do this, you must alter all the notices that refer to this License, + so that they refer to the ordinary GNU General Public License, + version 2, instead of to this License. (If a newer version than + version 2 of the ordinary GNU General Public License has appeared, + then you can specify that version instead if you wish.) Do not + make any other change in these notices. + + Once this change is made in a given copy, it is irreversible for + that copy, so the ordinary GNU General Public License applies to + all subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of the + Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or derivative + of it, under Section 2) in object code or executable form under the + terms of Sections 1 and 2 above provided that you accompany it with + the complete corresponding machine-readable source code, which must + be distributed under the terms of Sections 1 and 2 above on a + medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy + from a designated place, then offering equivalent access to copy + the source code from the same place satisfies the requirement to + distribute the source code, even though third parties are not + compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the + Library, but is designed to work with the Library by being compiled + or linked with it, is called a "work that uses the Library". Such + a work, in isolation, is not a derivative work of the Library, and + therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library + creates an executable that is a derivative of the Library (because + it contains portions of the Library), rather than a "work that uses + the library". The executable is therefore covered by this License. + Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header + file that is part of the Library, the object code for the work may + be a derivative work of the Library even though the source code is + not. Whether this is true is especially significant if the work + can be linked without the Library, or if the work is itself a + library. The threshold for this to be true is not precisely + defined by law. + + If such an object file uses only numerical parameters, data + structure layouts and accessors, and small macros and small inline + functions (ten lines or less in length), then the use of the object + file is unrestricted, regardless of whether it is legally a + derivative work. (Executables containing this object code plus + portions of the Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may + distribute the object code for the work under the terms of Section + 6. Any executables containing that work also fall under Section 6, + whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or link + a "work that uses the Library" with the Library to produce a work + containing portions of the Library, and distribute that work under + terms of your choice, provided that the terms permit modification + of the work for the customer's own use and reverse engineering for + debugging such modifications. + + You must give prominent notice with each copy of the work that the + Library is used in it and that the Library and its use are covered + by this License. You must supply a copy of this License. If the + work during execution displays copyright notices, you must include + the copyright notice for the Library among them, as well as a + reference directing the user to the copy of this License. Also, + you must do one of these things: + + a. Accompany the work with the complete corresponding + machine-readable source code for the Library including + whatever changes were used in the work (which must be + distributed under Sections 1 and 2 above); and, if the work is + an executable linked with the Library, with the complete + machine-readable "work that uses the Library", as object code + and/or source code, so that the user can modify the Library + and then relink to produce a modified executable containing + the modified Library. (It is understood that the user who + changes the contents of definitions files in the Library will + not necessarily be able to recompile the application to use + the modified definitions.) + + b. Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run + time a copy of the library already present on the user's + computer system, rather than copying library functions into + the executable, and (2) will operate properly with a modified + version of the library, if the user installs one, as long as + the modified version is interface-compatible with the version + that the work was made with. + + c. Accompany the work with a written offer, valid for at least + three years, to give the same user the materials specified in + Subsection 6a, above, for a charge no more than the cost of + performing this distribution. + + d. If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the + above specified materials from the same place. + + e. Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the + Library" must include any data and utility programs needed for + reproducing the executable from it. However, as a special + exception, the materials to be distributed need not include + anything that is normally distributed (in either source or binary + form) with the major components (compiler, kernel, and so on) of + the operating system on which the executable runs, unless that + component itself accompanies the executable. + + It may happen that this requirement contradicts the license + restrictions of other proprietary libraries that do not normally + accompany the operating system. Such a contradiction means you + cannot use both them and the Library together in an executable that + you distribute. + + 7. You may place library facilities that are a work based on the + Library side-by-side in a single library together with other + library facilities not covered by this License, and distribute such + a combined library, provided that the separate distribution of the + work based on the Library and of the other library facilities is + otherwise permitted, and provided that you do these two things: + + a. Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b. Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same + work. + + 8. You may not copy, modify, sublicense, link with, or distribute the + Library except as expressly provided under this License. Any + attempt otherwise to copy, modify, sublicense, link with, or + distribute the Library is void, and will automatically terminate + your rights under this License. However, parties who have received + copies, or rights, from you under this License will not have their + licenses terminated so long as such parties remain in full + compliance. + + 9. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify + or distribute the Library or its derivative works. These actions + are prohibited by law if you do not accept this License. + Therefore, by modifying or distributing the Library (or any work + based on the Library), you indicate your acceptance of this License + to do so, and all its terms and conditions for copying, + distributing or modifying the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the + Library), the recipient automatically receives a license from the + original licensor to copy, distribute, link with or modify the + Library subject to these terms and conditions. You may not impose + any further restrictions on the recipients' exercise of the rights + granted herein. You are not responsible for enforcing compliance + by third parties with this License. + + 11. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent + issues), conditions are imposed on you (whether by court order, + agreement or otherwise) that contradict the conditions of this + License, they do not excuse you from the conditions of this + License. If you cannot distribute so as to satisfy simultaneously + your obligations under this License and any other pertinent + obligations, then as a consequence you may not distribute the + Library at all. For example, if a patent license would not permit + royalty-free redistribution of the Library by all those who receive + copies directly or indirectly through you, then the only way you + could satisfy both it and this License would be to refrain entirely + from distribution of the Library. + + If any portion of this section is held invalid or unenforceable + under any particular circumstance, the balance of the section is + intended to apply, and the section as a whole is intended to apply + in other circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of + any such claims; this section has the sole purpose of protecting + the integrity of the free software distribution system which is + implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is + willing to distribute software through any other system and a + licensee cannot impose that choice. + + This section is intended to make thoroughly clear what is believed + to be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in + certain countries either by patents or by copyrighted interfaces, + the original copyright holder who places the Library under this + License may add an explicit geographical distribution limitation + excluding those countries, so that distribution is permitted only + in or among countries not thus excluded. In such case, this + License incorporates the limitation as if written in the body of + this License. + + 13. The Free Software Foundation may publish revised and/or new + versions of the Lesser General Public License from time to time. + Such new versions will be similar in spirit to the present version, + but may differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the + Library specifies a version number of this License which applies to + it and "any later version", you have the option of following the + terms and conditions either of that version or of any later version + published by the Free Software Foundation. If the Library does not + specify a license version number, you may choose any version ever + published by the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free + programs whose distribution conditions are incompatible with these, + write to the author to ask for permission. For software which is + copyrighted by the Free Software Foundation, write to the Free + Software Foundation; we sometimes make exceptions for this. Our + decision will be guided by the two goals of preserving the free + status of all derivatives of our free software and of promoting the + sharing and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO + WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE + LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS + AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY + OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND + PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE + DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR + OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN + WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY + MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE + LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, + INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR + INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF + DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU + OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY + OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN + ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS +--------------------------- + +How to Apply These Terms to Your New Libraries +---------------------------------------------- + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of +the ordinary General Public License). + + To apply these terms, attach the following notices to the library. +It is safest to attach them to the start of each source file to most +effectively convey the exclusion of warranty; and each file should have +at least the "copyright" line and a pointer to where the full notice is +found. + + ONE LINE TO GIVE THE LIBRARY'S NAME AND AN IDEA OF WHAT IT DOES. + Copyright (C) YEAR NAME OF AUTHOR + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or (at + your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, see . + + Also add information on how to contact you by electronic and paper +mail. + + You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the library, +if necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the library + `Frob' (a library for tweaking knobs) written by James Random Hacker. + + SIGNATURE OF MOE GHOUL, 1 April 1990 + Moe Ghoul, President of Vice + + That's all there is to it! + + +File: gettext.info, Node: GNU FDL, Prev: GNU LGPL, Up: Licenses + +C.3 GNU Free Documentation License +================================== + + Version 1.3, 3 November 2008 + + Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + functional and useful document “free” in the sense of freedom: to + assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or + noncommercially. Secondarily, this License preserves for the + author and publisher a way to get credit for their work, while not + being considered responsible for modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. We + recommend this License principally for works whose purpose is + instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work, in any medium, + that contains a notice placed by the copyright holder saying it can + be distributed under the terms of this License. Such a notice + grants a world-wide, royalty-free license, unlimited in duration, + to use that work under the conditions stated herein. The + "Document", below, refers to any such manual or work. Any member + of the public is a licensee, and is addressed as "you". You accept + the license if you copy, modify or distribute the work in a way + requiring permission under copyright law. + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter section + of the Document that deals exclusively with the relationship of the + publishers or authors of the Document to the Document's overall + subject (or to related matters) and contains nothing that could + fall directly within that overall subject. (Thus, if the Document + is in part a textbook of mathematics, a Secondary Section may not + explain any mathematics.) The relationship could be a matter of + historical connection with the subject or with related matters, or + of legal, commercial, philosophical, ethical or political position + regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in the + notice that says that the Document is released under this License. + If a section does not fit the above definition of Secondary then it + is not allowed to be designated as Invariant. The Document may + contain zero Invariant Sections. If the Document does not identify + any Invariant Sections then there are none. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. A + Front-Cover Text may be at most 5 words, and a Back-Cover Text may + be at most 25 words. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, that is suitable for revising the document + straightforwardly with generic text editors or (for images composed + of pixels) generic paint programs or (for drawings) some widely + available drawing editor, and that is suitable for input to text + formatters or for automatic translation to a variety of formats + suitable for input to text formatters. A copy made in an otherwise + Transparent file format whose markup, or absence of markup, has + been arranged to thwart or discourage subsequent modification by + readers is not Transparent. An image format is not Transparent if + used for any substantial amount of text. A copy that is not + "Transparent" is called "Opaque". + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and standard-conforming + simple HTML, PostScript or PDF designed for human modification. + Examples of transparent image formats include PNG, XCF and JPG. + Opaque formats include proprietary formats that can be read and + edited only by proprietary word processors, SGML or XML for which + the DTD and/or processing tools are not generally available, and + the machine-generated HTML, PostScript or PDF produced by some word + processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + The "publisher" means any person or entity that distributes copies + of the Document to the public. + + A section "Entitled XYZ" means a named subunit of the Document + whose title either is precisely XYZ or contains XYZ in parentheses + following text that translates XYZ in another language. (Here XYZ + stands for a specific section name mentioned below, such as + "Acknowledgements", "Dedications", "Endorsements", or "History".) + To "Preserve the Title" of such a section when you modify the + Document means that it remains a section "Entitled XYZ" according + to this definition. + + The Document may include Warranty Disclaimers next to the notice + which states that this License applies to the Document. These + Warranty Disclaimers are considered to be included by reference in + this License, but only as regards disclaiming warranties: any other + implication that these Warranty Disclaimers may have is void and + has no effect on the meaning of this License. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow the + conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies (or copies in media that commonly + have printed covers) of the Document, numbering more than 100, and + the Document's license notice requires Cover Texts, you must + enclose the copies in covers that carry, clearly and legibly, all + these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the title + equally prominent and visible. You may add other material on the + covers in addition. Copying with changes limited to the covers, as + long as they preserve the title of the Document and satisfy these + conditions, can be treated as verbatim copying in other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a machine-readable + Transparent copy along with each Opaque copy, or state in or with + each Opaque copy a computer-network location from which the general + network-using public has access to download using public-standard + network protocols a complete Transparent copy of the Document, free + of added material. If you use the latter option, you must take + reasonably prudent steps, when you begin distribution of Opaque + copies in quantity, to ensure that this Transparent copy will + remain thus accessible at the stated location until at least one + year after the last time you distribute an Opaque copy (directly or + through your agents or retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of copies, + to give them a chance to provide you with an updated version of the + Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with the + Modified Version filling the role of the Document, thus licensing + distribution and modification of the Modified Version to whoever + possesses a copy of it. In addition, you must do these things in + the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of previous + versions (which should, if there were any, be listed in the + History section of the Document). You may use the same title + as a previous version if the original publisher of that + version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has fewer than five), unless they release you + from this requirement. + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section Entitled "History", Preserve its Title, + and add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on the + Title Page. If there is no section Entitled "History" in the + Document, create one stating the title, year, authors, and + publisher of the Document as given on its Title Page, then add + an item describing the Modified Version as stated in the + previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in the + "History" section. You may omit a network location for a work + that was published at least four years before the Document + itself, or if the original publisher of the version it refers + to gives permission. + + K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section + all the substance and tone of each of the contributor + acknowledgements and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, unaltered + in their text and in their titles. Section numbers or the + equivalent are not considered part of the section titles. + + M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section to be Entitled + "Endorsements" or to conflict in title with any Invariant + Section. + + O. Preserve any Warranty Disclaimers. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option designate + some or all of these sections as invariant. To do this, add their + titles to the list of Invariant Sections in the Modified Version's + license notice. These titles must be distinct from any other + section titles. + + You may add a section Entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties--for example, statements of peer review or that the text + has been approved by an organization as the authoritative + definition of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end of + the list of Cover Texts in the Modified Version. Only one passage + of Front-Cover Text and one of Back-Cover Text may be added by (or + through arrangements made by) any one entity. If the Document + already includes a cover text for the same cover, previously added + by you or by arrangement made by the same entity you are acting on + behalf of, you may not add another; but you may replace the old + one, on explicit permission from the previous publisher that added + the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination all + of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice, and that you preserve all + their Warranty Disclaimers. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections Entitled + "History" in the various original documents, forming one section + Entitled "History"; likewise combine any sections Entitled + "Acknowledgements", and any sections Entitled "Dedications". You + must delete all sections Entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the documents + in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow this + License in all other respects regarding verbatim copying of that + document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of a + storage or distribution medium, is called an "aggregate" if the + copyright resulting from the compilation is not used to limit the + legal rights of the compilation's users beyond what the individual + works permit. When the Document is included in an aggregate, this + License does not apply to the other works in the aggregate which + are not themselves derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one half + of the entire aggregate, the Document's Cover Texts may be placed + on covers that bracket the Document within the aggregate, or the + electronic equivalent of covers if the Document is in electronic + form. Otherwise they must appear on printed covers that bracket + the whole aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License, and all the license notices in the + Document, and any Warranty Disclaimers, provided that you also + include the original English version of this License and the + original versions of those notices and disclaimers. In case of a + disagreement between the translation and the original version of + this License or a notice or disclaimer, the original version will + prevail. + + If a section in the Document is Entitled "Acknowledgements", + "Dedications", or "History", the requirement (section 4) to + Preserve its Title (section 1) will typically require changing the + actual title. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense, or distribute it is void, + and will automatically terminate your rights under this License. + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly and + finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from + that copyright holder, and you cure the violation prior to 30 days + after your receipt of the notice. + + Termination of your rights under this section does not terminate + the licenses of parties who have received copies or rights from you + under this License. If your rights have been terminated and not + permanently reinstated, receipt of a copy of some or all of the + same material does not give you any rights to use it. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + . + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If the + Document does not specify a version number of this License, you may + choose any version ever published (not as a draft) by the Free + Software Foundation. If the Document specifies that a proxy can + decide which future versions of this License can be used, that + proxy's public statement of acceptance of a version permanently + authorizes you to choose that version for the Document. + + 11. RELICENSING + + "Massive Multiauthor Collaboration Site" (or "MMC Site") means any + World Wide Web server that publishes copyrightable works and also + provides prominent facilities for anybody to edit those works. A + public wiki that anybody can edit is an example of such a server. + A "Massive Multiauthor Collaboration" (or "MMC") contained in the + site means any set of copyrightable works thus published on the MMC + site. + + "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 + license published by Creative Commons Corporation, a not-for-profit + corporation with a principal place of business in San Francisco, + California, as well as future copyleft versions of that license + published by that same organization. + + "Incorporate" means to publish or republish a Document, in whole or + in part, as part of another Document. + + An MMC is "eligible for relicensing" if it is licensed under this + License, and if all works that were first published under this + License somewhere other than this MMC, and subsequently + incorporated in whole or in part into the MMC, (1) had no cover + texts or invariant sections, and (2) were thus incorporated prior + to November 1, 2008. + + The operator of an MMC Site may republish an MMC contained in the + site under CC-BY-SA on the same site at any time before August 1, + 2009, provided the MMC is eligible for relicensing. + +ADDENDUM: How to use this License for your documents +==================================================== + + To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + + If you have Invariant Sections, Front-Cover Texts and Back-Cover +Texts, replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with + the Front-Cover Texts being LIST, and with the Back-Cover Texts + being LIST. + + If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of free +software license, such as the GNU General Public License, to permit +their use in free software. + + +File: gettext.info, Node: Program Index, Next: Option Index, Prev: Licenses, Up: Top + +Program Index +************* + +[index] +* Menu: + +* autopoint: autopoint Invocation. + (line 6) +* boldquot: msgfilter Invocation. + (line 111) +* envsubst: envsubst Invocation. (line 6) +* gettext: sh. (line 22) +* gettext <1>: gettext Invocation. (line 6) +* gettextize: gettextize Invocation. + (line 34) +* msgattrib: msgattrib Invocation. + (line 6) +* msgcat: msgcat Invocation. (line 6) +* msgcmp: msgcmp Invocation. (line 6) +* msgcomm: msgcomm Invocation. (line 6) +* msgconv: msgconv Invocation. (line 6) +* msgen: msgen Invocation. (line 6) +* msgexec: msgexec Invocation. (line 6) +* msgfilter: msgfilter Invocation. + (line 6) +* msgfmt: msgfmt Invocation. (line 6) +* msggrep: msggrep Invocation. (line 6) +* msginit: msginit Invocation. (line 6) +* msgmerge: msgmerge Invocation. (line 6) +* msgunfmt: msgunfmt Invocation. (line 6) +* msguniq: msguniq Invocation. (line 6) +* ngettext: sh. (line 22) +* ngettext <1>: ngettext Invocation. (line 6) +* quot: msgfilter Invocation. + (line 107) +* recode-sr-latin: msgfilter Invocation. + (line 101) +* xgettext: xgettext Invocation. (line 6) + + +File: gettext.info, Node: Option Index, Next: Variable Index, Prev: Program Index, Up: Top + +Option Index +************ + +[index] +* Menu: + +* --add-comments, xgettext option: xgettext Invocation. (line 98) +* --add-location, msgattrib option: msgattrib Invocation. + (line 138) +* --add-location, msgcat option: msgcat Invocation. (line 118) +* --add-location, msgcomm option: msgcomm Invocation. (line 100) +* --add-location, msgconv option: msgconv Invocation. (line 80) +* --add-location, msgen option: msgen Invocation. (line 83) +* --add-location, msgfilter option: msgfilter Invocation. + (line 161) +* --add-location, msggrep option: msggrep Invocation. (line 152) +* --add-location, msgmerge option: msgmerge Invocation. (line 157) +* --add-location, msguniq option: msguniq Invocation. (line 97) +* --add-location, xgettext option: xgettext Invocation. (line 426) +* --alignment, msgfmt option: msgfmt Invocation. (line 319) +* --backup, msgmerge option: msgmerge Invocation. (line 62) +* --boost, xgettext option: xgettext Invocation. (line 361) +* --c++, xgettext option: xgettext Invocation. (line 67) +* --check-accelerators, msgfmt option: msgfmt Invocation. (line 281) +* --check-compatibility, msgfmt option: msgfmt Invocation. (line 277) +* --check-domain, msgfmt option: msgfmt Invocation. (line 272) +* --check-format, msgfmt option: msgfmt Invocation. (line 244) +* --check-header, msgfmt option: msgfmt Invocation. (line 267) +* --check, msgfmt option: msgfmt Invocation. (line 240) +* --check, xgettext option: xgettext Invocation. (line 128) +* --clear-fuzzy, msgattrib option: msgattrib Invocation. + (line 68) +* --clear-obsolete, msgattrib option: msgattrib Invocation. + (line 74) +* --clear-previous, msgattrib option: msgattrib Invocation. + (line 81) +* --color, msgattrib option: msgattrib Invocation. + (line 119) +* --color, msgcat option: msgcat Invocation. (line 99) +* --color, msgcat option <1>: The --color option. (line 6) +* --color, msgcomm option: msgcomm Invocation. (line 81) +* --color, msgconv option: msgconv Invocation. (line 61) +* --color, msgen option: msgen Invocation. (line 64) +* --color, msgfilter option: msgfilter Invocation. + (line 138) +* --color, msggrep option: msggrep Invocation. (line 134) +* --color, msginit option: msginit Invocation. (line 96) +* --color, msgmerge option: msgmerge Invocation. (line 138) +* --color, msgunfmt option: msgunfmt Invocation. (line 103) +* --color, msguniq option: msguniq Invocation. (line 78) +* --color, xgettext option: xgettext Invocation. (line 405) +* --comment, msggrep option: msggrep Invocation. (line 86) +* --compendium, msgmerge option: msgmerge Invocation. (line 36) +* --context, gettext option: gettext Invocation. (line 16) +* --context, ngettext option: ngettext Invocation. (line 15) +* --copyright-holder, xgettext option: xgettext Invocation. (line 506) +* --csharp-resources, msgfmt option: msgfmt Invocation. (line 40) +* --csharp-resources, msgunfmt option: msgunfmt Invocation. (line 23) +* --csharp, msgfmt option: msgfmt Invocation. (line 36) +* --csharp, msgunfmt option: msgunfmt Invocation. (line 19) +* --debug, xgettext option: xgettext Invocation. (line 365) +* --default-domain, xgettext option: xgettext Invocation. (line 38) +* --desktop, msgfmt option: msgfmt Invocation. (line 49) +* --directory, msgattrib option: msgattrib Invocation. + (line 19) +* --directory, msgcat option: msgcat Invocation. (line 35) +* --directory, msgcmp option: msgcmp Invocation. (line 27) +* --directory, msgcomm option: msgcomm Invocation. (line 30) +* --directory, msgconv option: msgconv Invocation. (line 19) +* --directory, msgen option: msgen Invocation. (line 25) +* --directory, msgexec option: msgexec Invocation. (line 54) +* --directory, msgfilter option: msgfilter Invocation. + (line 34) +* --directory, msgfmt option: msgfmt Invocation. (line 18) +* --directory, msggrep option: msggrep Invocation. (line 19) +* --directory, msgmerge option: msgmerge Invocation. (line 30) +* --directory, msguniq option: msguniq Invocation. (line 26) +* --directory, xgettext option: xgettext Invocation. (line 27) +* --domain, gettext option: gettext Invocation. (line 21) +* --domain, msggrep option: msggrep Invocation. (line 70) +* --domain, ngettext option: ngettext Invocation. (line 20) +* --dry-run, autopoint option: autopoint Invocation. + (line 31) +* --dry-run, gettextize option: gettextize Invocation. + (line 64) +* --empty, msgattrib option: msgattrib Invocation. + (line 84) +* --endianness, msgfmt option: msgfmt Invocation. (line 322) +* --exclude-file, xgettext option: xgettext Invocation. (line 93) +* --expression, msgfilter option: msgfilter Invocation. + (line 87) +* --extended-regexp, msggrep option: msggrep Invocation. (line 94) +* --extract-all, xgettext option: xgettext Invocation. (line 177) +* --extracted-comment, msggrep option: msggrep Invocation. (line 90) +* --file, msgfilter option: msgfilter Invocation. + (line 91) +* --file, msggrep option: msggrep Invocation. (line 106) +* --files-from, msgcat option: msgcat Invocation. (line 30) +* --files-from, msgcomm option: msgcomm Invocation. (line 25) +* --files-from, xgettext option: xgettext Invocation. (line 19) +* --fixed-strings, msggrep option: msggrep Invocation. (line 98) +* --flag, xgettext option: xgettext Invocation. (line 293) +* --for-msgfmt, msgmerge option: msgmerge Invocation. (line 99) +* --force-po, msgattrib option: msgattrib Invocation. + (line 127) +* --force-po, msgcat option: msgcat Invocation. (line 107) +* --force-po, msgcomm option: msgcomm Invocation. (line 89) +* --force-po, msgconv option: msgconv Invocation. (line 69) +* --force-po, msgen option: msgen Invocation. (line 72) +* --force-po, msgfilter option: msgfilter Invocation. + (line 146) +* --force-po, msggrep option: msggrep Invocation. (line 142) +* --force-po, msgmerge option: msgmerge Invocation. (line 146) +* --force-po, msgunfmt option: msgunfmt Invocation. (line 111) +* --force-po, msguniq option: msguniq Invocation. (line 86) +* --force-po, xgettext option: xgettext Invocation. (line 413) +* --force, autopoint option: autopoint Invocation. + (line 27) +* --force, gettextize option: gettextize Invocation. + (line 40) +* --foreign-user, xgettext option: xgettext Invocation. (line 521) +* --from-code, xgettext option: xgettext Invocation. (line 76) +* --fuzzy, msgattrib option: msgattrib Invocation. + (line 95) +* --generated, xgettext option: xgettext Invocation. (line 556) +* --help, autopoint option: autopoint Invocation. + (line 39) +* --help, envsubst option: envsubst Invocation. (line 21) +* --help, gettext option: gettext Invocation. (line 37) +* --help, gettextize option: gettextize Invocation. + (line 69) +* --help, msgattrib option: msgattrib Invocation. + (line 188) +* --help, msgcat option: msgcat Invocation. (line 168) +* --help, msgcmp option: msgcmp Invocation. (line 69) +* --help, msgcomm option: msgcomm Invocation. (line 155) +* --help, msgconv option: msgconv Invocation. (line 130) +* --help, msgen option: msgen Invocation. (line 133) +* --help, msgexec option: msgexec Invocation. (line 77) +* --help, msgfilter option: msgfilter Invocation. + (line 211) +* --help, msgfmt option: msgfmt Invocation. (line 342) +* --help, msggrep option: msggrep Invocation. (line 200) +* --help, msginit option: msginit Invocation. (line 131) +* --help, msgmerge option: msgmerge Invocation. (line 208) +* --help, msgunfmt option: msgunfmt Invocation. (line 155) +* --help, msguniq option: msguniq Invocation. (line 147) +* --help, ngettext option: ngettext Invocation. (line 36) +* --help, xgettext option: xgettext Invocation. (line 594) +* --ignore-case, msggrep option: msggrep Invocation. (line 110) +* --ignore-file, msgattrib option: msgattrib Invocation. + (line 91) +* --indent, msgattrib option: msgattrib Invocation. + (line 131) +* --indent, msgcat option: msgcat Invocation. (line 111) +* --indent, msgcomm option: msgcomm Invocation. (line 93) +* --indent, msgconv option: msgconv Invocation. (line 73) +* --indent, msgen option: msgen Invocation. (line 76) +* --indent, msgfilter option: msgfilter Invocation. + (line 149) +* --indent, msggrep option: msggrep Invocation. (line 145) +* --indent, msgmerge option: msgmerge Invocation. (line 150) +* --indent, msgunfmt option: msgunfmt Invocation. (line 115) +* --indent, msguniq option: msguniq Invocation. (line 90) +* --indent, xgettext option: xgettext Invocation. (line 417) +* --input, msgexec option: msgexec Invocation. (line 50) +* --input, msgfilter option: msgfilter Invocation. + (line 30) +* --input, msginit option: msginit Invocation. (line 51) +* --invert-match, msggrep option: msggrep Invocation. (line 114) +* --its, xgettext option: xgettext Invocation. (line 386) +* --itstool, xgettext option: xgettext Invocation. (line 449) +* --java, msgfmt option: msgfmt Invocation. (line 30) +* --java, msgunfmt option: msgunfmt Invocation. (line 16) +* --java2, msgfmt option: msgfmt Invocation. (line 33) +* --join-existing, xgettext option: xgettext Invocation. (line 89) +* --kde, xgettext option: xgettext Invocation. (line 357) +* --keep-header, msgfilter option: msgfilter Invocation. + (line 152) +* --keyword, msgfmt option: msgfmt Invocation. (line 140) +* --keyword, xgettext option: xgettext Invocation. (line 186) +* --lang, msgcat option: msgcat Invocation. (line 93) +* --lang, msgen option: msgen Invocation. (line 57) +* --lang, msgmerge option: msgmerge Invocation. (line 130) +* --language, msgfmt option: msgfmt Invocation. (line 180) +* --language, xgettext option: xgettext Invocation. (line 57) +* --less-than, msgcat option: msgcat Invocation. (line 56) +* --less-than, msgcomm option: msgcomm Invocation. (line 51) +* --locale, msgfmt option: msgfmt Invocation. (line 83) +* --locale, msgfmt option <1>: msgfmt Invocation. (line 106) +* --locale, msgfmt option <2>: msgfmt Invocation. (line 122) +* --locale, msgfmt option <3>: msgfmt Invocation. (line 146) +* --locale, msgfmt option <4>: msgfmt Invocation. (line 184) +* --locale, msginit option: msginit Invocation. (line 84) +* --locale, msgunfmt option: msgunfmt Invocation. (line 45) +* --locale, msgunfmt option <1>: msgunfmt Invocation. (line 62) +* --locale, msgunfmt option <2>: msgunfmt Invocation. (line 78) +* --location, msggrep option: msggrep Invocation. (line 65) +* --more-than, msgcat option: msgcat Invocation. (line 61) +* --more-than, msgcomm option: msgcomm Invocation. (line 56) +* --msgctxt, msggrep option: msggrep Invocation. (line 74) +* --msgid-bugs-address, xgettext option: xgettext Invocation. (line 534) +* --msgid, msggrep option: msggrep Invocation. (line 78) +* --msgstr-prefix, xgettext option: xgettext Invocation. (line 583) +* --msgstr-suffix, xgettext option: xgettext Invocation. (line 587) +* --msgstr, msggrep option: msggrep Invocation. (line 82) +* --multi-domain, msgcmp option: msgcmp Invocation. (line 35) +* --multi-domain, msgmerge option: msgmerge Invocation. (line 96) +* --newline, msgfilter option: msgfilter Invocation. + (line 59) +* --newline, msgfilter option <1>: msgexec Invocation. (line 19) +* --no-changelog, gettextize option: gettextize Invocation. + (line 50) +* --no-convert, msgfmt option: msgfmt Invocation. (line 301) +* --no-fuzzy-matching, msgcmp option: msgcmp Invocation. (line 39) +* --no-fuzzy-matching, msgmerge option: msgmerge Invocation. (line 107) +* --no-fuzzy, msgattrib option: msgattrib Invocation. + (line 45) +* --no-git, xgettext option: xgettext Invocation. (line 489) +* --no-hash, msgfmt option: msgfmt Invocation. (line 334) +* --no-location, msgattrib option: msgattrib Invocation. + (line 134) +* --no-location, msgcat option: msgcat Invocation. (line 114) +* --no-location, msgcomm option: msgcomm Invocation. (line 96) +* --no-location, msgconv option: msgconv Invocation. (line 76) +* --no-location, msgen option: msgen Invocation. (line 79) +* --no-location, msgfilter option: msgfilter Invocation. + (line 157) +* --no-location, msggrep option: msggrep Invocation. (line 148) +* --no-location, msgmerge option: msgmerge Invocation. (line 153) +* --no-location, msguniq option: msguniq Invocation. (line 93) +* --no-location, xgettext option: xgettext Invocation. (line 420) +* --no-obsolete, msgattrib option: msgattrib Invocation. + (line 51) +* --no-redundancy, msgfmt option: msgfmt Invocation. (line 307) +* --no-translator, msginit option: msginit Invocation. (line 91) +* --no-wrap, msgattrib option: msgattrib Invocation. + (line 169) +* --no-wrap, msgcat option: msgcat Invocation. (line 149) +* --no-wrap, msgcomm option: msgcomm Invocation. (line 131) +* --no-wrap, msgconv option: msgconv Invocation. (line 111) +* --no-wrap, msgen option: msgen Invocation. (line 114) +* --no-wrap, msgfilter option: msgfilter Invocation. + (line 192) +* --no-wrap, msggrep option: msggrep Invocation. (line 183) +* --no-wrap, msginit option: msginit Invocation. (line 121) +* --no-wrap, msgmerge option: msgmerge Invocation. (line 188) +* --no-wrap, msgunfmt option: msgunfmt Invocation. (line 140) +* --no-wrap, msguniq option: msguniq Invocation. (line 128) +* --no-wrap, xgettext option: xgettext Invocation. (line 460) +* --obsolete, msgattrib option: msgattrib Invocation. + (line 99) +* --omit-header, msgcomm option: msgcomm Invocation. (line 146) +* --omit-header, xgettext option: xgettext Invocation. (line 476) +* --only-file, msgattrib option: msgattrib Invocation. + (line 87) +* --only-fuzzy, msgattrib option: msgattrib Invocation. + (line 48) +* --only-obsolete, msgattrib option: msgattrib Invocation. + (line 54) +* --output-dir, xgettext option: xgettext Invocation. (line 47) +* --output-file, msgattrib option: msgattrib Invocation. + (line 30) +* --output-file, msgcat option: msgcat Invocation. (line 46) +* --output-file, msgcomm option: msgcomm Invocation. (line 41) +* --output-file, msgconv option: msgconv Invocation. (line 30) +* --output-file, msgen option: msgen Invocation. (line 36) +* --output-file, msgfilter option: msgfilter Invocation. + (line 45) +* --output-file, msgfmt option: msgfmt Invocation. (line 59) +* --output-file, msggrep option: msggrep Invocation. (line 30) +* --output-file, msginit option: msginit Invocation. (line 61) +* --output-file, msgmerge option: msgmerge Invocation. (line 51) +* --output-file, msgunfmt option: msgunfmt Invocation. (line 93) +* --output-file, msguniq option: msguniq Invocation. (line 37) +* --output, xgettext option: xgettext Invocation. (line 42) +* --package-name, xgettext option: xgettext Invocation. (line 527) +* --package-version, xgettext option: xgettext Invocation. (line 530) +* --po-dir, gettextize option: gettextize Invocation. + (line 43) +* --previous, msgattrib option: msgattrib Invocation. + (line 77) +* --previous, msgmerge option: msgmerge Invocation. (line 111) +* --properties-input, msgattrib option: msgattrib Invocation. + (line 107) +* --properties-input, msgcat option: msgcat Invocation. (line 74) +* --properties-input, msgcmp option: msgcmp Invocation. (line 57) +* --properties-input, msgcomm option: msgcomm Invocation. (line 69) +* --properties-input, msgconv option: msgconv Invocation. (line 49) +* --properties-input, msgen option: msgen Invocation. (line 46) +* --properties-input, msgexec option: msgexec Invocation. (line 65) +* --properties-input, msgfilter option: msgfilter Invocation. + (line 126) +* --properties-input, msgfmt option: msgfmt Invocation. (line 228) +* --properties-input, msggrep option: msggrep Invocation. (line 122) +* --properties-input, msginit option: msginit Invocation. (line 72) +* --properties-input, msgmerge option: msgmerge Invocation. (line 119) +* --properties-input, msguniq option: msguniq Invocation. (line 58) +* --properties-output, msgattrib option: msgattrib Invocation. + (line 153) +* --properties-output, msgcat option: msgcat Invocation. (line 133) +* --properties-output, msgcomm option: msgcomm Invocation. (line 115) +* --properties-output, msgconv option: msgconv Invocation. (line 95) +* --properties-output, msgen option: msgen Invocation. (line 98) +* --properties-output, msgfilter option: msgfilter Invocation. + (line 176) +* --properties-output, msggrep option: msggrep Invocation. (line 167) +* --properties-output, msginit option: msginit Invocation. (line 105) +* --properties-output, msgmerge option: msgmerge Invocation. (line 172) +* --properties-output, msgunfmt option: msgunfmt Invocation. (line 124) +* --properties-output, msguniq option: msguniq Invocation. (line 112) +* --properties-output, xgettext option: xgettext Invocation. (line 440) +* --qt, msgfmt option: msgfmt Invocation. (line 46) +* --qt, xgettext option: xgettext Invocation. (line 353) +* --quiet, msgfilter option: msgfilter Invocation. + (line 96) +* --quiet, msgmerge option: msgmerge Invocation. (line 221) +* --reference, xgettext option: xgettext Invocation. (line 565) +* --regexp=, msggrep option: msggrep Invocation. (line 102) +* --repeated, msguniq option: msguniq Invocation. (line 47) +* --replace-text, msgfmt option: msgfmt Invocation. (line 192) +* --resource, msgfmt option: msgfmt Invocation. (line 79) +* --resource, msgfmt option <1>: msgfmt Invocation. (line 102) +* --resource, msgunfmt option: msgunfmt Invocation. (line 41) +* --resource, msgunfmt option <1>: msgunfmt Invocation. (line 58) +* --sentence-end, xgettext option: xgettext Invocation. (line 164) +* --set-fuzzy, msgattrib option: msgattrib Invocation. + (line 65) +* --set-obsolete, msgattrib option: msgattrib Invocation. + (line 71) +* --silent, msgfilter option: msgfilter Invocation. + (line 96) +* --silent, msgmerge option: msgmerge Invocation. (line 221) +* --sort-by-file, msgattrib option: msgattrib Invocation. + (line 181) +* --sort-by-file, msgcat option: msgcat Invocation. (line 161) +* --sort-by-file, msgcomm option: msgcomm Invocation. (line 143) +* --sort-by-file, msgconv option: msgconv Invocation. (line 123) +* --sort-by-file, msgen option: msgen Invocation. (line 126) +* --sort-by-file, msgfilter option: msgfilter Invocation. + (line 204) +* --sort-by-file, msggrep option: msggrep Invocation. (line 193) +* --sort-by-file, msgmerge option: msgmerge Invocation. (line 201) +* --sort-by-file, msguniq option: msguniq Invocation. (line 140) +* --sort-by-file, xgettext option: xgettext Invocation. (line 473) +* --sort-output, msgattrib option: msgattrib Invocation. + (line 176) +* --sort-output, msgcat option: msgcat Invocation. (line 156) +* --sort-output, msgcomm option: msgcomm Invocation. (line 138) +* --sort-output, msgconv option: msgconv Invocation. (line 118) +* --sort-output, msgen option: msgen Invocation. (line 121) +* --sort-output, msgfilter option: msgfilter Invocation. + (line 199) +* --sort-output, msggrep option: msggrep Invocation. (line 189) +* --sort-output, msgmerge option: msgmerge Invocation. (line 195) +* --sort-output, msgunfmt option: msgunfmt Invocation. (line 147) +* --sort-output, msguniq option: msguniq Invocation. (line 135) +* --sort-output, xgettext option: xgettext Invocation. (line 467) +* --source, msgfmt option: msgfmt Invocation. (line 91) +* --statistics, msgfmt option: msgfmt Invocation. (line 349) +* --strict, msgattrib option: msgattrib Invocation. + (line 147) +* --strict, msgcat option: msgcat Invocation. (line 127) +* --strict, msgcomm option: msgcomm Invocation. (line 109) +* --strict, msgconv option: msgconv Invocation. (line 89) +* --strict, msgen option: msgen Invocation. (line 92) +* --strict, msgfilter option: msgfilter Invocation. + (line 170) +* --strict, msgfmt option: msgfmt Invocation. (line 62) +* --strict, msggrep option: msggrep Invocation. (line 161) +* --strict, msgmerge option: msgmerge Invocation. (line 166) +* --strict, msgunfmt option: msgunfmt Invocation. (line 118) +* --strict, msguniq option: msguniq Invocation. (line 106) +* --strict, xgettext option: xgettext Invocation. (line 435) +* --stringtable-input, msgattrib option: msgattrib Invocation. + (line 111) +* --stringtable-input, msgcat option: msgcat Invocation. (line 78) +* --stringtable-input, msgcmp option: msgcmp Invocation. (line 61) +* --stringtable-input, msgcomm option: msgcomm Invocation. (line 73) +* --stringtable-input, msgen option: msgen Invocation. (line 50) +* --stringtable-input, msgexec option: msgexec Invocation. (line 69) +* --stringtable-input, msgfilter option: msgfilter Invocation. + (line 130) +* --stringtable-input, msgfmt option: msgfmt Invocation. (line 232) +* --stringtable-input, msggrep option: msggrep Invocation. (line 126) +* --stringtable-input, msginit option: msginit Invocation. (line 76) +* --stringtable-input, msgmerge option: msgmerge Invocation. (line 123) +* --stringtable-input, msgonv option: msgconv Invocation. (line 53) +* --stringtable-input, msguniq option: msguniq Invocation. (line 62) +* --stringtable-output, msgattrib option: msgattrib Invocation. + (line 158) +* --stringtable-output, msgcat option: msgcat Invocation. (line 138) +* --stringtable-output, msgcomm option: msgcomm Invocation. (line 120) +* --stringtable-output, msgconv option: msgconv Invocation. (line 100) +* --stringtable-output, msgen option: msgen Invocation. (line 103) +* --stringtable-output, msgfilter option: msgfilter Invocation. + (line 181) +* --stringtable-output, msggrep option: msggrep Invocation. (line 172) +* --stringtable-output, msginit option: msginit Invocation. (line 110) +* --stringtable-output, msgmerge option: msgmerge Invocation. (line 177) +* --stringtable-output, msgunfmt option: msgunfmt Invocation. (line 129) +* --stringtable-output, msguniq option: msguniq Invocation. (line 117) +* --stringtable-output, xgettext option: xgettext Invocation. (line 445) +* --style, msgattrib option: msgattrib Invocation. + (line 123) +* --style, msgcat option: msgcat Invocation. (line 103) +* --style, msgcat option <1>: The --style option. (line 6) +* --style, msgcomm option: msgcomm Invocation. (line 85) +* --style, msgconv option: msgconv Invocation. (line 65) +* --style, msgen option: msgen Invocation. (line 68) +* --style, msgfilter option: msgfilter Invocation. + (line 142) +* --style, msggrep option: msggrep Invocation. (line 138) +* --style, msginit option: msginit Invocation. (line 100) +* --style, msgmerge option: msgmerge Invocation. (line 142) +* --style, msgunfmt option: msgunfmt Invocation. (line 107) +* --style, msguniq option: msguniq Invocation. (line 82) +* --style, xgettext option: xgettext Invocation. (line 409) +* --suffix, msgmerge option: msgmerge Invocation. (line 65) +* --symlink, gettextize option: gettextize Invocation. + (line 55) +* --tag, xgettext option: xgettext Invocation. (line 333) +* --tcl, msgfmt option: msgfmt Invocation. (line 43) +* --tcl, msgunfmt option: msgunfmt Invocation. (line 26) +* --template, msgfmt option: msgfmt Invocation. (line 136) +* --template, msgfmt option <1>: msgfmt Invocation. (line 176) +* --to-code, msgcat option: msgcat Invocation. (line 86) +* --to-code, msgconv option: msgconv Invocation. (line 40) +* --to-code, msguniq option: msguniq Invocation. (line 70) +* --translated, msgattrib option: msgattrib Invocation. + (line 39) +* --trigraphs, xgettext option: xgettext Invocation. (line 347) +* --unique, msgcat option: msgcat Invocation. (line 66) +* --unique, msgcomm option: msgcomm Invocation. (line 61) +* --unique, msguniq option: msguniq Invocation. (line 51) +* --untranslated, msgattrib option: msgattrib Invocation. + (line 42) +* --update, msgmerge option: msgmerge Invocation. (line 44) +* --use-first, msgcat option: msgcat Invocation. (line 89) +* --use-first, msguniq option: msguniq Invocation. (line 73) +* --use-fuzzy, msgcmp option: msgcmp Invocation. (line 43) +* --use-fuzzy, msgfmt option: msgfmt Invocation. (line 293) +* --use-untranslated, msgcmp option: msgcmp Invocation. (line 49) +* --variables, envsubst option: envsubst Invocation. (line 15) +* --verbose, msgfmt option: msgfmt Invocation. (line 355) +* --verbose, msgmerge option: msgmerge Invocation. (line 216) +* --verbose, msgunfmt option: msgunfmt Invocation. (line 163) +* --verbose, xgettext option: xgettext Invocation. (line 602) +* --version, autopoint option: autopoint Invocation. + (line 42) +* --version, envsubst option: envsubst Invocation. (line 25) +* --version, gettext option: gettext Invocation. (line 45) +* --version, gettextize option: gettextize Invocation. + (line 72) +* --version, msgattrib option: msgattrib Invocation. + (line 192) +* --version, msgcat option: msgcat Invocation. (line 172) +* --version, msgcmp option: msgcmp Invocation. (line 73) +* --version, msgcomm option: msgcomm Invocation. (line 159) +* --version, msgconv option: msgconv Invocation. (line 134) +* --version, msgen option: msgen Invocation. (line 137) +* --version, msgexec option: msgexec Invocation. (line 81) +* --version, msgfilter option: msgfilter Invocation. + (line 215) +* --version, msgfmt option: msgfmt Invocation. (line 346) +* --version, msggrep option: msggrep Invocation. (line 204) +* --version, msginit option: msginit Invocation. (line 135) +* --version, msgmerge option: msgmerge Invocation. (line 212) +* --version, msgunfmt option: msgunfmt Invocation. (line 159) +* --version, msguniq option: msguniq Invocation. (line 151) +* --version, ngettext option: ngettext Invocation. (line 40) +* --version, xgettext option: xgettext Invocation. (line 598) +* --width, msgattrib option: msgattrib Invocation. + (line 163) +* --width, msgcat option: msgcat Invocation. (line 143) +* --width, msgcomm option: msgcomm Invocation. (line 125) +* --width, msgconv option: msgconv Invocation. (line 105) +* --width, msgen option: msgen Invocation. (line 108) +* --width, msgfilter option: msgfilter Invocation. + (line 186) +* --width, msggrep option: msggrep Invocation. (line 177) +* --width, msginit option: msginit Invocation. (line 115) +* --width, msgmerge option: msgmerge Invocation. (line 182) +* --width, msgunfmt option: msgunfmt Invocation. (line 134) +* --width, msguniq option: msguniq Invocation. (line 122) +* --width, xgettext option: xgettext Invocation. (line 454) +* --xml, msgfmt option: msgfmt Invocation. (line 52) +* -<, msgcat option: msgcat Invocation. (line 56) +* -<, msgcomm option: msgcomm Invocation. (line 51) +* ->, msgcat option: msgcat Invocation. (line 61) +* ->, msgcomm option: msgcomm Invocation. (line 56) +* -a, msgfmt option: msgfmt Invocation. (line 319) +* -a, xgettext option: xgettext Invocation. (line 177) +* -c, gettext option: gettext Invocation. (line 16) +* -c, msgfmt option: msgfmt Invocation. (line 240) +* -C, msgfmt option: msgfmt Invocation. (line 277) +* -C, msggrep option: msggrep Invocation. (line 86) +* -C, msgmerge option: msgmerge Invocation. (line 36) +* -c, ngettext option: ngettext Invocation. (line 15) +* -C, xgettext option: xgettext Invocation. (line 67) +* -c, xgettext option: xgettext Invocation. (line 98) +* -d, autopoint option: autopoint Invocation. + (line 31) +* -d, gettext option: gettext Invocation. (line 21) +* -d, gettextize option: gettextize Invocation. + (line 64) +* -D, msgattrib option: msgattrib Invocation. + (line 19) +* -D, msgcat option: msgcat Invocation. (line 35) +* -D, msgcmp option: msgcmp Invocation. (line 27) +* -D, msgcomm option: msgcomm Invocation. (line 30) +* -D, msgconv option: msgconv Invocation. (line 19) +* -D, msgen option: msgen Invocation. (line 25) +* -D, msgexec option: msgexec Invocation. (line 54) +* -D, msgfilter option: msgfilter Invocation. + (line 34) +* -D, msgfmt option: msgfmt Invocation. (line 18) +* -d, msgfmt option: msgfmt Invocation. (line 88) +* -d, msgfmt option <1>: msgfmt Invocation. (line 111) +* -d, msgfmt option <2>: msgfmt Invocation. (line 127) +* -d, msgfmt option <3>: msgfmt Invocation. (line 151) +* -d, msgfmt option <4>: msgfmt Invocation. (line 189) +* -D, msggrep option: msggrep Invocation. (line 19) +* -D, msgmerge option: msgmerge Invocation. (line 30) +* -d, msgunfmt option: msgunfmt Invocation. (line 67) +* -d, msgunfmt option <1>: msgunfmt Invocation. (line 83) +* -D, msguniq option: msguniq Invocation. (line 26) +* -d, msguniq option: msguniq Invocation. (line 47) +* -d, ngettext option: ngettext Invocation. (line 20) +* -D, xgettext option: xgettext Invocation. (line 27) +* -d, xgettext option: xgettext Invocation. (line 38) +* -e, gettext option: gettext Invocation. (line 25) +* -E, gettext option: gettext Invocation. (line 32) +* -e, msgfilter option: msgfilter Invocation. + (line 87) +* -E, msggrep option: msggrep Invocation. (line 94) +* -e, msggrep option: msggrep Invocation. (line 102) +* -e, ngettext option: ngettext Invocation. (line 24) +* -E, ngettext option: ngettext Invocation. (line 31) +* -f, autopoint option: autopoint Invocation. + (line 27) +* -f, gettextize option: gettextize Invocation. + (line 40) +* -F, msgattrib option: msgattrib Invocation. + (line 181) +* -f, msgcat option: msgcat Invocation. (line 30) +* -F, msgcat option: msgcat Invocation. (line 161) +* -f, msgcomm option: msgcomm Invocation. (line 25) +* -F, msgcomm option: msgcomm Invocation. (line 143) +* -F, msgconv option: msgconv Invocation. (line 123) +* -F, msgen option: msgen Invocation. (line 126) +* -f, msgfilter option: msgfilter Invocation. + (line 91) +* -F, msgfilter option: msgfilter Invocation. + (line 204) +* -f, msgfmt option: msgfmt Invocation. (line 293) +* -F, msggrep option: msggrep Invocation. (line 98) +* -f, msggrep option: msggrep Invocation. (line 106) +* -F, msgmerge option: msgmerge Invocation. (line 201) +* -F, msguniq option: msguniq Invocation. (line 140) +* -f, xgettext option: xgettext Invocation. (line 19) +* -F, xgettext option: xgettext Invocation. (line 473) +* -h, envsubst option: envsubst Invocation. (line 21) +* -h, gettext option: gettext Invocation. (line 37) +* -h, msgattrib option: msgattrib Invocation. + (line 188) +* -h, msgcat option: msgcat Invocation. (line 168) +* -h, msgcmp option: msgcmp Invocation. (line 69) +* -h, msgcomm option: msgcomm Invocation. (line 155) +* -h, msgconv option: msgconv Invocation. (line 130) +* -h, msgen option: msgen Invocation. (line 133) +* -h, msgexec option: msgexec Invocation. (line 77) +* -h, msgfilter option: msgfilter Invocation. + (line 211) +* -h, msgfmt option: msgfmt Invocation. (line 342) +* -h, msggrep option: msggrep Invocation. (line 200) +* -h, msginit option: msginit Invocation. (line 131) +* -h, msgmerge option: msgmerge Invocation. (line 208) +* -h, msgunfmt option: msgunfmt Invocation. (line 155) +* -h, msguniq option: msguniq Invocation. (line 147) +* -h, ngettext option: ngettext Invocation. (line 36) +* -h, xgettext option: xgettext Invocation. (line 594) +* -i, msgattrib option: msgattrib Invocation. + (line 131) +* -i, msgcat option: msgcat Invocation. (line 111) +* -i, msgcomm option: msgcomm Invocation. (line 93) +* -i, msgconv option: msgconv Invocation. (line 73) +* -i, msgen option: msgen Invocation. (line 76) +* -i, msgexec option: msgexec Invocation. (line 50) +* -i, msgfilter option: msgfilter Invocation. + (line 30) +* -i, msggrep option: msggrep Invocation. (line 110) +* -i, msginit option: msginit Invocation. (line 51) +* -i, msgmerge option: msgmerge Invocation. (line 150) +* -i, msgunfmt option: msgunfmt Invocation. (line 115) +* -i, msguniq option: msguniq Invocation. (line 90) +* -i, xgettext option: xgettext Invocation. (line 417) +* -j, msgfmt option: msgfmt Invocation. (line 30) +* -J, msggrep option: msggrep Invocation. (line 74) +* -j, msgunfmt option: msgunfmt Invocation. (line 16) +* -j, xgettext option: xgettext Invocation. (line 89) +* -k, msgfmt option: msgfmt Invocation. (line 140) +* -K, msggrep option: msggrep Invocation. (line 78) +* -k, xgettext option: xgettext Invocation. (line 186) +* -l, msgfmt option: msgfmt Invocation. (line 83) +* -l, msgfmt option <1>: msgfmt Invocation. (line 106) +* -l, msgfmt option <2>: msgfmt Invocation. (line 122) +* -l, msgfmt option <3>: msgfmt Invocation. (line 146) +* -L, msgfmt option: msgfmt Invocation. (line 180) +* -l, msgfmt option <4>: msgfmt Invocation. (line 184) +* -l, msginit option: msginit Invocation. (line 84) +* -l, msgunfmt option: msgunfmt Invocation. (line 45) +* -l, msgunfmt option <1>: msgunfmt Invocation. (line 62) +* -l, msgunfmt option <2>: msgunfmt Invocation. (line 78) +* -L, xgettext option: xgettext Invocation. (line 57) +* -m, msgcmp option: msgcmp Invocation. (line 35) +* -M, msggrep option: msggrep Invocation. (line 70) +* -m, msgmerge option: msgmerge Invocation. (line 96) +* -m, xgettext option: xgettext Invocation. (line 583) +* -M, xgettext option: xgettext Invocation. (line 587) +* -n, gettext option: gettext Invocation. (line 40) +* -n, msgattrib option: msgattrib Invocation. + (line 138) +* -n, msgcat option: msgcat Invocation. (line 118) +* -N, msgcmp option: msgcmp Invocation. (line 39) +* -n, msgcomm option: msgcomm Invocation. (line 100) +* -n, msgfilter option: msgfilter Invocation. + (line 96) +* -N, msggrep option: msggrep Invocation. (line 65) +* -N, msgmerge option: msgmerge Invocation. (line 107) +* -n, msguniq option: msguniq Invocation. (line 97) +* -n, xgettext option: xgettext Invocation. (line 426) +* -o, msgattrib option: msgattrib Invocation. + (line 30) +* -o, msgcat option: msgcat Invocation. (line 46) +* -o, msgcomm option: msgcomm Invocation. (line 41) +* -o, msgconv option: msgconv Invocation. (line 30) +* -o, msgen option: msgen Invocation. (line 36) +* -o, msgfilter option: msgfilter Invocation. + (line 45) +* -o, msgfmt option: msgfmt Invocation. (line 59) +* -o, msggrep option: msggrep Invocation. (line 30) +* -o, msginit option: msginit Invocation. (line 61) +* -o, msgmerge option: msgmerge Invocation. (line 51) +* -o, msgunfmt option: msgunfmt Invocation. (line 93) +* -o, msguniq option: msguniq Invocation. (line 37) +* -o, xgettext option: xgettext Invocation. (line 42) +* -P, msgattrib option: msgattrib Invocation. + (line 107) +* -p, msgattrib option: msgattrib Invocation. + (line 153) +* -P, msgcat option: msgcat Invocation. (line 74) +* -p, msgcat option: msgcat Invocation. (line 133) +* -P, msgcmp option: msgcmp Invocation. (line 57) +* -P, msgcomm option: msgcomm Invocation. (line 69) +* -p, msgcomm option: msgcomm Invocation. (line 115) +* -P, msgconv option: msgconv Invocation. (line 49) +* -p, msgconv option: msgconv Invocation. (line 95) +* -P, msgen option: msgen Invocation. (line 46) +* -p, msgen option: msgen Invocation. (line 98) +* -P, msgexec option: msgexec Invocation. (line 65) +* -P, msgfilter option: msgfilter Invocation. + (line 126) +* -p, msgfilter option: msgfilter Invocation. + (line 176) +* -P, msgfmt option: msgfmt Invocation. (line 228) +* -P, msggrep option: msggrep Invocation. (line 122) +* -p, msggrep option: msggrep Invocation. (line 167) +* -P, msginit option: msginit Invocation. (line 72) +* -p, msginit option: msginit Invocation. (line 105) +* -P, msgmerge option: msgmerge Invocation. (line 119) +* -p, msgmerge option: msgmerge Invocation. (line 172) +* -p, msgunfmt option: msgunfmt Invocation. (line 124) +* -P, msguniq option: msguniq Invocation. (line 58) +* -p, msguniq option: msguniq Invocation. (line 112) +* -p, xgettext option: xgettext Invocation. (line 47) +* -q, msgmerge option: msgmerge Invocation. (line 221) +* -r, msgfmt option: msgfmt Invocation. (line 79) +* -r, msgfmt option <1>: msgfmt Invocation. (line 102) +* -r, msgunfmt option: msgunfmt Invocation. (line 41) +* -r, msgunfmt option <1>: msgunfmt Invocation. (line 58) +* -s, msgattrib option: msgattrib Invocation. + (line 176) +* -s, msgcat option: msgcat Invocation. (line 156) +* -s, msgcomm option: msgcomm Invocation. (line 138) +* -s, msgconv option: msgconv Invocation. (line 118) +* -s, msgen option: msgen Invocation. (line 121) +* -s, msgfilter option: msgfilter Invocation. + (line 199) +* -s, msgmerge option: msgmerge Invocation. (line 195) +* -s, msgunfmt option: msgunfmt Invocation. (line 147) +* -s, msguniq option: msguniq Invocation. (line 135) +* -s, xgettext option: xgettext Invocation. (line 467) +* -t, msgcat option: msgcat Invocation. (line 86) +* -t, msgconv option: msgconv Invocation. (line 40) +* -T, msggrep option: msggrep Invocation. (line 82) +* -t, msguniq option: msguniq Invocation. (line 70) +* -T, xgettext option: xgettext Invocation. (line 347) +* -u, msgcat option: msgcat Invocation. (line 66) +* -u, msgcomm option: msgcomm Invocation. (line 61) +* -U, msgmerge option: msgmerge Invocation. (line 44) +* -u, msguniq option: msguniq Invocation. (line 51) +* -v, envsubst option: envsubst Invocation. (line 15) +* -V, envsubst option: envsubst Invocation. (line 25) +* -V, gettext option: gettext Invocation. (line 45) +* -V, msgattrib option: msgattrib Invocation. + (line 192) +* -V, msgcat option: msgcat Invocation. (line 172) +* -V, msgcmp option: msgcmp Invocation. (line 73) +* -V, msgcomm option: msgcomm Invocation. (line 159) +* -V, msgconv option: msgconv Invocation. (line 134) +* -V, msgen option: msgen Invocation. (line 137) +* -V, msgexec option: msgexec Invocation. (line 81) +* -V, msgfilter option: msgfilter Invocation. + (line 215) +* -V, msgfmt option: msgfmt Invocation. (line 346) +* -v, msgfmt option: msgfmt Invocation. (line 355) +* -v, msggrep option: msggrep Invocation. (line 114) +* -V, msggrep option: msggrep Invocation. (line 204) +* -V, msginit option: msginit Invocation. (line 135) +* -V, msgmerge option: msgmerge Invocation. (line 212) +* -v, msgmerge option: msgmerge Invocation. (line 216) +* -V, msgunfmt option: msgunfmt Invocation. (line 159) +* -v, msgunfmt option: msgunfmt Invocation. (line 163) +* -V, msguniq option: msguniq Invocation. (line 151) +* -V, ngettext option: ngettext Invocation. (line 40) +* -V, xgettext option: xgettext Invocation. (line 598) +* -v, xgettext option: xgettext Invocation. (line 602) +* -w, msgattrib option: msgattrib Invocation. + (line 163) +* -w, msgcat option: msgcat Invocation. (line 143) +* -w, msgcomm option: msgcomm Invocation. (line 125) +* -w, msgconv option: msgconv Invocation. (line 105) +* -w, msgen option: msgen Invocation. (line 108) +* -w, msgfilter option: msgfilter Invocation. + (line 186) +* -w, msggrep option: msggrep Invocation. (line 177) +* -w, msginit option: msginit Invocation. (line 115) +* -w, msgmerge option: msgmerge Invocation. (line 182) +* -w, msgunfmt option: msgunfmt Invocation. (line 134) +* -w, msguniq option: msguniq Invocation. (line 122) +* -w, xgettext option: xgettext Invocation. (line 454) +* -X, msggrep option: msggrep Invocation. (line 90) +* -x, xgettext option: xgettext Invocation. (line 93) + + +File: gettext.info, Node: Variable Index, Next: PO Mode Index, Prev: Option Index, Up: Top + +Variable Index +************** + +[index] +* Menu: + +* GETTEXT_LOG_UNTRANSLATED, environment variable: Prioritizing messages. + (line 22) +* GETTEXTDATADIRS, environment variable: xgettext Invocation. (line 391) +* GETTEXTDATADIRS, environment variable <1>: msgfmt Invocation. + (line 218) +* LANG, environment variable: Locale Environment Variables. + (line 15) +* LANG, environment variable <1>: gettext grok. (line 30) +* LANGUAGE, environment variable: Locale Environment Variables. + (line 11) +* LANGUAGE, environment variable <1>: gettext grok. (line 28) +* LANGUAGE, environment variable <2>: po/Rules-*. (line 11) +* LC_ALL, environment variable: Locale Environment Variables. + (line 11) +* LC_ALL, environment variable <1>: gettext grok. (line 28) +* LC_COLLATE, environment variable: Locale Environment Variables. + (line 12) +* LC_COLLATE, environment variable <1>: gettext grok. (line 29) +* LC_CTYPE, environment variable: Locale Environment Variables. + (line 12) +* LC_CTYPE, environment variable <1>: gettext grok. (line 29) +* LC_MESSAGES, environment variable: Locale Environment Variables. + (line 12) +* LC_MESSAGES, environment variable <1>: gettext grok. (line 29) +* LC_MONETARY, environment variable: Locale Environment Variables. + (line 12) +* LC_MONETARY, environment variable <1>: gettext grok. (line 29) +* LC_NUMERIC, environment variable: Locale Environment Variables. + (line 12) +* LC_NUMERIC, environment variable <1>: gettext grok. (line 29) +* LC_TIME, environment variable: Locale Environment Variables. + (line 12) +* LC_TIME, environment variable <1>: gettext grok. (line 29) +* LINGUAS, environment variable: Installers. (line 17) +* MSGEXEC_LOCATION, environment variable: msgexec Invocation. (line 21) +* MSGEXEC_MSGCTXT, environment variable: msgexec Invocation. (line 21) +* MSGEXEC_MSGID_PLURAL, environment variable: msgexec Invocation. + (line 21) +* MSGEXEC_MSGID, environment variable: msgexec Invocation. (line 21) +* MSGEXEC_PLURAL_FORM, environment variable: msgexec Invocation. + (line 21) +* MSGEXEC_PREV_MSGCTXT, environment variable: msgexec Invocation. + (line 21) +* MSGEXEC_PREV_MSGID_PLURAL, environment variable: msgexec Invocation. + (line 21) +* MSGEXEC_PREV_MSGID, environment variable: msgexec Invocation. + (line 21) +* MSGFILTER_LOCATION, environment variable: msgfilter Invocation. + (line 11) +* MSGFILTER_MSGCTXT, environment variable: msgfilter Invocation. + (line 11) +* MSGFILTER_MSGID_PLURAL, environment variable: msgfilter Invocation. + (line 11) +* MSGFILTER_MSGID, environment variable: msgfilter Invocation. + (line 11) +* MSGFILTER_PLURAL_FORM, environment variable: msgfilter Invocation. + (line 11) +* MSGFILTER_PREV_MSGCTXT, environment variable: msgfilter Invocation. + (line 11) +* MSGFILTER_PREV_MSGID_PLURAL, environment variable: msgfilter Invocation. + (line 11) +* MSGFILTER_PREV_MSGID, environment variable: msgfilter Invocation. + (line 11) +* OUTPUT_CHARSET, environment variable: Working in a Windows console. + (line 6) +* PO_STYLE, environment variable: The --style option. (line 10) +* TERM, environment variable: The TERM variable. (line 6) +* TEXTDOMAIN, environment variable: sh. (line 27) +* TEXTDOMAINDIR, environment variable: sh. (line 30) + + +File: gettext.info, Node: PO Mode Index, Next: Autoconf Macro Index, Prev: Variable Index, Up: Top + +PO Mode Index +************* + +[index] +* Menu: + +* _, PO Mode command: Main PO Commands. (line 30) +* _, PO Mode command <1>: Main PO Commands. (line 52) +* ,, PO Mode command: Marking. (line 43) +* ?, PO Mode command: Main PO Commands. (line 44) +* ?, PO Mode command <1>: Main PO Commands. (line 82) +* ., PO Mode command: Entry Positioning. (line 20) +* ., PO Mode command <1>: Entry Positioning. (line 45) +* .emacs customizations: Installation. (line 13) +* #, PO Mode command: Modifying Comments. (line 24) +* #, PO Mode command <1>: Modifying Comments. (line 45) +* <, PO Mode command: Entry Positioning. (line 29) +* <, PO Mode command <1>: Entry Positioning. (line 73) +* =, PO Mode command: Main PO Commands. (line 47) +* =, PO Mode command <1>: Main PO Commands. (line 86) +* >, PO Mode command: Entry Positioning. (line 32) +* >, PO Mode command <1>: Entry Positioning. (line 73) +* 0, PO Mode command: Main PO Commands. (line 40) +* 0, PO Mode command <1>: Main PO Commands. (line 71) +* a, PO Mode command: Auxiliary. (line 21) +* A, PO Mode command: Auxiliary. (line 28) +* A, PO Mode command <1>: Auxiliary. (line 35) +* a, PO Mode command <1>: Auxiliary. (line 39) +* auxiliary PO file: Auxiliary. (line 13) +* C-c C-a, PO Mode command: Subedit. (line 17) +* C-c C-a, PO Mode command <1>: Subedit. (line 34) +* C-c C-a, PO Mode command <2>: Auxiliary. (line 25) +* C-c C-a, PO Mode command <3>: Auxiliary. (line 48) +* C-c C-c, PO Mode command: Subedit. (line 11) +* C-c C-c, PO Mode command <1>: Subedit. (line 19) +* C-c C-k, PO Mode command: Subedit. (line 14) +* C-c C-k, PO Mode command <1>: Subedit. (line 26) +* C-j, PO Mode command: Modifying Translations. + (line 26) +* C-j, PO Mode command <1>: Modifying Translations. + (line 51) +* commands: Main PO Commands. (line 6) +* comment out PO file entry: Obsolete Entries. (line 46) +* consulting program sources: C Sources Context. (line 6) +* consulting translations to other languages: Auxiliary. (line 6) +* current entry of a PO file: Entry Positioning. (line 6) +* cut and paste for translated strings: Modifying Translations. + (line 73) +* DEL, PO Mode command: Fuzzy Entries. (line 58) +* DEL, PO Mode command <1>: Obsolete Entries. (line 32) +* DEL, PO Mode command <2>: Obsolete Entries. (line 46) +* editing comments: Modifying Comments. (line 6) +* editing multiple entries: Subedit. (line 61) +* editing translations: Modifying Translations. + (line 6) +* etags, using for marking strings: Marking. (line 17) +* exiting PO subedit: Subedit. (line 19) +* f, PO Mode command: Fuzzy Entries. (line 29) +* F, PO Mode command: Fuzzy Entries. (line 32) +* f, PO Mode command <1>: Fuzzy Entries. (line 37) +* F, PO Mode command <1>: Fuzzy Entries. (line 37) +* find source fragment for a PO file entry: C Sources Context. + (line 33) +* h, PO Mode command: Main PO Commands. (line 44) +* h, PO Mode command <1>: Main PO Commands. (line 82) +* installing PO mode: Installation. (line 13) +* k, PO Mode command: Untranslated Entries. + (line 32) +* k, PO Mode command <1>: Untranslated Entries. + (line 39) +* k, PO Mode command <2>: Modifying Translations. + (line 30) +* k, PO Mode command <3>: Modifying Translations. + (line 73) +* K, PO Mode command: Modifying Comments. (line 27) +* K, PO Mode command <1>: Modifying Comments. (line 59) +* LFD, PO Mode command: Modifying Translations. + (line 26) +* LFD, PO Mode command <1>: Modifying Translations. + (line 51) +* looking at the source to aid translation: C Sources Context. + (line 6) +* M-,, PO Mode command: Marking. (line 47) +* M-., PO Mode command: Marking. (line 50) +* M-A, PO Mode command: Auxiliary. (line 32) +* M-A, PO Mode command <1>: Auxiliary. (line 35) +* M-s, PO Mode command: C Sources Context. (line 41) +* M-S, PO Mode command: C Sources Context. (line 49) +* M-s, PO Mode command <1>: C Sources Context. (line 52) +* M-S, PO Mode command <1>: C Sources Context. (line 88) +* m, PO Mode command: Entry Positioning. (line 35) +* m, PO Mode command <1>: Entry Positioning. (line 91) +* marking strings for translation: Marking. (line 6) +* moving by fuzzy entries: Fuzzy Entries. (line 23) +* moving by obsolete entries: Obsolete Entries. (line 22) +* moving by translated entries: Translated Entries. (line 12) +* moving by untranslated entries: Untranslated Entries. + (line 18) +* moving through a PO file: Entry Positioning. (line 14) +* n, PO Mode command: Entry Positioning. (line 23) +* n, PO Mode command <1>: Entry Positioning. (line 68) +* next-error, stepping through PO file validation results: Main PO Commands. + (line 98) +* normalize, PO Mode command: Auxiliary. (line 63) +* o, PO Mode command: Obsolete Entries. (line 26) +* O, PO Mode command: Obsolete Entries. (line 29) +* o, PO Mode command <1>: Obsolete Entries. (line 35) +* O, PO Mode command <1>: Obsolete Entries. (line 35) +* obsolete active entry: Obsolete Entries. (line 46) +* p, PO Mode command: Entry Positioning. (line 26) +* p, PO Mode command <1>: Entry Positioning. (line 68) +* pending subedits: Subedit. (line 72) +* po-auto-edit-with-msgid, PO Mode variable: Modifying Translations. + (line 56) +* po-auto-fuzzy-on-edit, PO Mode variable: Translated Entries. + (line 27) +* po-auto-select-on-unfuzzy, PO Mode variable: Fuzzy Entries. (line 42) +* po-confirm-and-quit, PO Mode command: Main PO Commands. (line 61) +* po-consider-as-auxiliary, PO Mode command: Auxiliary. (line 35) +* po-consider-source-path, PO Mode command: C Sources Context. + (line 88) +* po-current-entry, PO Mode command: Entry Positioning. (line 45) +* po-cycle-auxiliary, PO Mode command: Auxiliary. (line 39) +* po-cycle-source-reference, PO Mode command: C Sources Context. + (line 52) +* po-edit-comment, PO Mode command: Modifying Comments. (line 45) +* po-edit-msgstr, PO Mode command: Modifying Translations. + (line 41) +* po-exchange-location, PO Mode command: Entry Positioning. (line 105) +* po-fade-out-entry, PO Mode command: Fuzzy Entries. (line 58) +* po-fade-out-entry, PO Mode command <1>: Obsolete Entries. (line 46) +* po-first-entry, PO Mode command: Entry Positioning. (line 73) +* po-help, PO Mode command: Main PO Commands. (line 82) +* po-ignore-as-auxiliary, PO Mode command: Auxiliary. (line 35) +* po-ignore-source-path, PO Mode command: C Sources Context. (line 88) +* po-kill-comment, PO Mode command: Modifying Comments. (line 59) +* po-kill-msgstr, PO Mode command: Untranslated Entries. + (line 39) +* po-kill-msgstr, PO Mode command <1>: Modifying Translations. + (line 73) +* po-kill-ring-save-comment, PO Mode command: Modifying Comments. + (line 59) +* po-kill-ring-save-msgstr, PO Mode command: Modifying Translations. + (line 73) +* po-last-entry, PO Mode command: Entry Positioning. (line 73) +* po-mark-translatable, PO Mode command: Marking. (line 96) +* po-msgid-to-msgstr, PO Mode command: Modifying Translations. + (line 51) +* po-next-entry, PO Mode command: Entry Positioning. (line 68) +* po-next-fuzzy-entry, PO Mode command: Fuzzy Entries. (line 37) +* po-next-obsolete-entry, PO Mode command: Obsolete Entries. (line 35) +* po-next-translated-entry, PO Mode command: Translated Entries. + (line 22) +* po-next-untranslated-entry, PO Mode command: Untranslated Entries. + (line 34) +* po-normalize, PO Mode command: Normalizing. (line 31) +* po-other-window, PO Mode command: Main PO Commands. (line 71) +* po-pop-location, PO Mode command: Entry Positioning. (line 91) +* po-previous-entry, PO Mode command: Entry Positioning. (line 68) +* po-previous-fuzzy-entry, PO Mode command: Fuzzy Entries. (line 37) +* po-previous-obsolete-entry, PO Mode command: Obsolete Entries. + (line 35) +* po-previous-translated-entry, PO Mode command: Translated Entries. + (line 22) +* po-previous-untransted-entry, PO Mode command: Untranslated Entries. + (line 34) +* po-push-location, PO Mode command: Entry Positioning. (line 91) +* po-quit, PO Mode command: Main PO Commands. (line 61) +* po-select-auxiliary, PO Mode command: Auxiliary. (line 48) +* po-select-mark-and-mark, PO Mode command: Marking. (line 96) +* po-select-source-reference, PO Mode command: C Sources Context. + (line 52) +* po-statistics, PO Mode command: Main PO Commands. (line 86) +* po-subedit-abort, PO Mode command: Subedit. (line 26) +* po-subedit-cycle-auxiliary, PO Mode command: Subedit. (line 34) +* po-subedit-exit, PO Mode command: Subedit. (line 19) +* po-subedit-mode-hook, PO Mode variable: Modifying Comments. (line 56) +* po-tags-search, PO Mode command: Marking. (line 54) +* po-undo, PO Mode command: Main PO Commands. (line 52) +* po-unfuzzy, PO Mode command: Fuzzy Entries. (line 42) +* po-validate, PO Mode command: Main PO Commands. (line 91) +* po-yank-comment, PO Mode command: Modifying Comments. (line 59) +* po-yank-msgstr, PO Mode command: Modifying Translations. + (line 96) +* Q, PO Mode command: Main PO Commands. (line 33) +* q, PO Mode command: Main PO Commands. (line 36) +* Q, PO Mode command <1>: Main PO Commands. (line 61) +* q, PO Mode command <1>: Main PO Commands. (line 61) +* r, PO Mode command: Entry Positioning. (line 39) +* r, PO Mode command <1>: Entry Positioning. (line 91) +* RET, PO Mode command: Modifying Translations. + (line 22) +* RET, PO Mode command <1>: Modifying Translations. + (line 41) +* s, PO Mode command: C Sources Context. (line 37) +* S, PO Mode command: C Sources Context. (line 45) +* s, PO Mode command <1>: C Sources Context. (line 52) +* S, PO Mode command <1>: C Sources Context. (line 88) +* starting a string translation: Modifying Translations. + (line 62) +* string normalization in entries: Normalizing. (line 30) +* subedit minor mode: Subedit. (line 6) +* t, PO Mode command: Translated Entries. (line 16) +* T, PO Mode command: Translated Entries. (line 19) +* t, PO Mode command <1>: Translated Entries. (line 22) +* T, PO Mode command <1>: Translated Entries. (line 22) +* TAB, PO Mode command: Fuzzy Entries. (line 35) +* TAB, PO Mode command <1>: Fuzzy Entries. (line 42) +* TAGS, and marking translatable strings: Marking. (line 30) +* u, PO Mode command: Untranslated Entries. + (line 25) +* U, PO Mode command: Untranslated Entries. + (line 28) +* u, PO Mode command <1>: Untranslated Entries. + (line 34) +* U, PO Mode command <1>: Untranslated Entries. + (line 34) +* use the source, Luke: C Sources Context. (line 6) +* using obsolete translations to make new entries: Modifying Translations. + (line 122) +* using translation compendia: Compendium. (line 6) +* V, PO Mode command: Main PO Commands. (line 50) +* V, PO Mode command <1>: Main PO Commands. (line 91) +* w, PO Mode command: Modifying Translations. + (line 34) +* w, PO Mode command <1>: Modifying Translations. + (line 73) +* W, PO Mode command: Modifying Comments. (line 31) +* W, PO Mode command <1>: Modifying Comments. (line 59) +* x, PO Mode command: Entry Positioning. (line 42) +* x, PO Mode command <1>: Entry Positioning. (line 105) +* y, PO Mode command: Modifying Translations. + (line 38) +* y, PO Mode command <1>: Modifying Translations. + (line 96) +* Y, PO Mode command: Modifying Comments. (line 35) +* Y, PO Mode command <1>: Modifying Comments. (line 59) + + +File: gettext.info, Node: Autoconf Macro Index, Next: Index, Prev: PO Mode Index, Up: Top + +Autoconf Macro Index +******************** + +[index] +* Menu: + +* AM_GNU_GETTEXT: AM_GNU_GETTEXT. (line 6) +* AM_GNU_GETTEXT_NEED: AM_GNU_GETTEXT_NEED. (line 6) +* AM_GNU_GETTEXT_VERSION: AM_GNU_GETTEXT_VERSION. + (line 6) +* AM_ICONV: AM_ICONV. (line 6) +* AM_PO_SUBDIRS: AM_PO_SUBDIRS. (line 6) +* AM_XGETTEXT_OPTION: AM_XGETTEXT_OPTION. (line 6) + + +File: gettext.info, Node: Index, Prev: Autoconf Macro Index, Up: Top + +General Index +************* + +[index] +* Menu: + +* _, a macro to mark strings for translation: Mark Keywords. (line 45) +* _nl_msg_cat_cntr: gettext grok. (line 59) +* ABOUT-NLS file: Installing Localizations. + (line 13) +* ABOUT-NLS file <1>: The original ABOUT-NLS. + (line 6) +* accumulating translations: Creating Compendia. (line 14) +* aclocal.m4 file: aclocal. (line 6) +* adding keywords, xgettext: xgettext Invocation. (line 190) +* ambiguities: Decent English style. + (line 23) +* ANSI encoding: Working in a Windows console. + (line 6) +* apply a filter to translations: msgfilter Invocation. + (line 8) +* apply command to all translations in a catalog: msgexec Invocation. + (line 8) +* Arabic digits: c-format. (line 34) +* attribute manipulation: msgattrib Invocation. + (line 8) +* attribute, fuzzy: Fuzzy Entries. (line 6) +* attributes of a PO file entry: Fuzzy Entries. (line 6) +* attributes, manipulating: Manipulating. (line 56) +* autoconf macros for gettext: autoconf macros. (line 6) +* autopoint program, usage: autopoint Invocation. + (line 6) +* auxiliary PO file: Auxiliary. (line 13) +* available translations: Installing Localizations. + (line 6) +* awk: gawk. (line 6) +* awk-format flag: PO Files. (line 177) +* awk, string concatenation: No string concatenation. + (line 29) +* backup old file, and msgmerge program: msgmerge Invocation. (line 62) +* bash: bash. (line 6) +* bibliography: References. (line 6) +* big picture: Overview. (line 6) +* bind_textdomain_codeset: Charset conversion. (line 26) +* Boost format strings: xgettext Invocation. (line 361) +* boost-format flag: PO Files. (line 213) +* bug report address: Introduction. (line 24) +* C and C-like languages: C. (line 6) +* C trigraphs: xgettext Invocation. (line 347) +* c-format flag: PO Files. (line 93) +* c-format, and xgettext: c-format Flag. (line 47) +* C#: C#. (line 6) +* C# mode, and msgfmt program: msgfmt Invocation. (line 36) +* C# mode, and msgunfmt program: msgunfmt Invocation. (line 19) +* C# resources mode, and msgfmt program: msgfmt Invocation. (line 40) +* C# resources mode, and msgunfmt program: msgunfmt Invocation. + (line 23) +* C#, string concatenation: No string concatenation. + (line 29) +* C#, strings with embedded expressions: No string concatenation. + (line 78) +* c++-format flag: PO Files. (line 116) +* catalog encoding and msgexec output: msgexec Invocation. (line 35) +* catclose, a catgets function: Interface to catgets. + (line 44) +* catgets, a catgets function: Interface to catgets. + (line 25) +* catgets, X/Open specification: catgets. (line 6) +* catopen, a catgets function: Interface to catgets. + (line 13) +* character encoding: Aspects. (line 66) +* charset conversion at runtime: Charset conversion. (line 6) +* charset of PO files: Header Entry. (line 103) +* check format strings: msgfmt Invocation. (line 244) +* checking of translations: Manipulating. (line 41) +* clisp: Common Lisp. (line 6) +* clisp C sources: clisp C. (line 6) +* codeset: Aspects. (line 66) +* combining two PO files: Manipulating. (line 10) +* combining two POT files: Combining POTs. (line 12) +* comments in PO files: PO Files. (line 355) +* comments, automatic: PO Files. (line 36) +* comments, extracted: PO Files. (line 36) +* comments, translator: PO Files. (line 36) +* Common Lisp: Common Lisp. (line 6) +* compare PO files: msgcmp Invocation. (line 8) +* comparison of interfaces: Comparison. (line 6) +* compatibility with X/Open msgfmt: msgfmt Invocation. (line 277) +* compendium: Compendium. (line 6) +* compendium, creating: Creating Compendia. (line 6) +* concatenate PO files: msgcat Invocation. (line 8) +* concatenating PO files into a compendium: Creating Compendia. + (line 14) +* concatenation of strings: No string concatenation. + (line 6) +* config.h.in file: config.h.in. (line 6) +* context: Contexts. (line 6) +* context, argument specification in xgettext: xgettext Invocation. + (line 190) +* context, in MO files: MO Files. (line 71) +* context, in PO files: PO Files. (line 245) +* control characters: No unusual markup. (line 6) +* convert binary message catalog into PO file: msgunfmt Invocation. + (line 8) +* convert translations to a different encoding: msgconv Invocation. + (line 8) +* converting a package to use gettext: Prerequisites. (line 6) +* country codes: Country Codes. (line 6) +* create new PO file: msginit Invocation. (line 8) +* creating a new PO file: Creating. (line 6) +* creating compendia: Creating Compendia. (line 6) +* csharp-format flag: PO Files. (line 137) +* currency symbols: Aspects. (line 79) +* D: D. (line 6) +* d-format flag: PO Files. (line 193) +* D, string concatenation: No string concatenation. + (line 29) +* D, strings with embedded expressions: No string concatenation. + (line 78) +* date format: Aspects. (line 85) +* dcngettext: Plural forms. (line 169) +* dcpgettext: Contexts. (line 56) +* dcpgettext_expr: Contexts. (line 112) +* debugging messages marked as format strings: xgettext Invocation. + (line 365) +* Desktop Entry mode, and msgfmt program: msgfmt Invocation. (line 49) +* dialect: Manipulating. (line 28) +* disabling NLS: lib/gettext.h. (line 6) +* distribution tarball: Release Management. (line 6) +* dngettext: Plural forms. (line 162) +* dollar substitution: envsubst Invocation. (line 8) +* domain ambiguities: Ambiguities. (line 6) +* dpgettext: Contexts. (line 56) +* dpgettext_expr: Contexts. (line 112) +* duplicate elimination: Manipulating. (line 45) +* duplicate removal: msguniq Invocation. (line 8) +* editing comments in PO files: Modifying Comments. (line 6) +* Editing PO Files: Editing. (line 6) +* editing translations: Modifying Translations. + (line 6) +* elisp-format flag: PO Files. (line 153) +* Emacs Lisp: Emacs Lisp. (line 6) +* Emacs PO Mode: PO Mode. (line 6) +* encoding: Aspects. (line 66) +* encoding conversion: Manipulating. (line 17) +* encoding conversion at runtime: Charset conversion. (line 6) +* encoding for your language: Header Entry. (line 132) +* encoding in MO files: MO Files. (line 82) +* encoding list: Header Entry. (line 116) +* encoding of PO files: Header Entry. (line 103) +* environment variables: envsubst Invocation. (line 8) +* envsubst program, usage: envsubst Invocation. (line 6) +* eval_gettext function, usage: eval_gettext Invocation. + (line 6) +* eval_ngettext function, usage: eval_ngettext Invocation. + (line 6) +* eval_npgettext function, usage: eval_npgettext Invocation. + (line 6) +* eval_pgettext function, usage: eval_pgettext Invocation. + (line 6) +* evolution of packages: Overview. (line 127) +* extracting parts of a PO file into a compendium: Creating Compendia. + (line 64) +* FDL, GNU Free Documentation License: GNU FDL. (line 6) +* file format, .mo: MO Files. (line 6) +* file format, .po: PO Files. (line 6) +* files, .po and .mo: Files. (line 6) +* files, .pot: Overview. (line 67) +* filter messages according to attributes: msgattrib Invocation. + (line 8) +* find common messages: msgcomm Invocation. (line 8) +* force use of fuzzy entries: msgfmt Invocation. (line 293) +* format strings: c-format Flag. (line 6) +* Free Pascal: Pascal. (line 6) +* function attribute, __format__: xgettext Invocation. (line 297) +* function attribute, __format_arg__: xgettext Invocation. (line 311) +* fuzzy entries: Fuzzy Entries. (line 6) +* fuzzy flag: PO Files. (line 83) +* gawk: gawk. (line 6) +* gcc-internal-format flag: PO Files. (line 233) +* GCC-source: GCC-source. (line 6) +* generate binary message catalog from PO file: msgfmt Invocation. + (line 8) +* generate translation catalog in English: msgen Invocation. (line 8) +* gettext files: Adjusting Files. (line 6) +* gettext installation: Installation. (line 6) +* gettext interface: Interface to gettext. + (line 6) +* gettext program, usage: gettext Invocation. (line 6) +* gettext vs catgets: Comparison. (line 6) +* gettext, a programmer's view: gettext. (line 6) +* gettext.h file: lib/gettext.h. (line 6) +* gettextize program, usage: gettextize Invocation. + (line 34) +* gfc-internal-format flag: PO Files. (line 237) +* GNOME PO file editor: Gtranslator. (line 6) +* Go: Go. (line 6) +* go-format flag: PO Files. (line 165) +* Go, string concatenation: No string concatenation. + (line 29) +* GPL, GNU General Public License: GNU GPL. (line 6) +* GUI programs: Contexts. (line 6) +* Guile: Scheme. (line 6) +* guile: Scheme. (line 6) +* Guile <1>: Scheme. (line 42) +* hash table, inside MO files: MO Files. (line 55) +* he, she, and they: Introduction. (line 15) +* header entry of a PO file: Header Entry. (line 6) +* help option: Split at paragraphs. (line 14) +* history of GNU gettext: History. (line 6) +* i18n: Concepts. (line 6) +* importing PO files: Normalizing. (line 54) +* include file libintl.h: Overview. (line 57) +* include file libintl.h <1>: Importing. (line 11) +* include file libintl.h <2>: Comparison. (line 33) +* include file libintl.h <3>: lib/gettext.h. (line 28) +* initialization: Triggering. (line 6) +* initialize new PO file: msginit Invocation. (line 8) +* initialize translations from a compendium: Using Compendia. (line 12) +* installing gettext: Installation. (line 6) +* interface to catgets: Interface to catgets. + (line 6) +* internationalization: Concepts. (line 16) +* inttypes.h: No string concatenation. + (line 151) +* inttypes.h <1>: c-format. (line 26) +* inttypes.h <2>: objc-format. (line 10) +* ISO 3166: Country Codes. (line 6) +* ISO 639: Language Codes. (line 6) +* Java: Java. (line 6) +* Java mode, and msgfmt program: msgfmt Invocation. (line 30) +* Java mode, and msgunfmt program: msgunfmt Invocation. (line 16) +* java-format flag: PO Files. (line 128) +* java-printf-format flag: PO Files. (line 133) +* Java, string concatenation: No string concatenation. + (line 29) +* javascript-format flag: PO Files. (line 141) +* JavaScript, string concatenation: No string concatenation. + (line 29) +* JavaScript, strings with embedded expressions: No string concatenation. + (line 78) +* KDE format strings: xgettext Invocation. (line 357) +* KDE PO file editor: Lokalize. (line 6) +* kde-format flag: PO Files. (line 209) +* keyboard accelerator checking: msgfmt Invocation. (line 281) +* l10n: Concepts. (line 6) +* language codes: Language Codes. (line 6) +* language selection: Locale Environment Variables. + (line 6) +* language selection at runtime: gettext grok. (line 14) +* large package: Ambiguities. (line 6) +* LGPL, GNU Lesser General Public License: GNU LGPL. (line 6) +* libiconv library: AM_ICONV. (line 20) +* libintl for C#: C#. (line 180) +* libintl for Java: Java. (line 109) +* libintl library: AM_GNU_GETTEXT. (line 43) +* librep Lisp: librep. (line 6) +* librep-format flag: PO Files. (line 157) +* License, GNU FDL: GNU FDL. (line 6) +* License, GNU GPL: GNU GPL. (line 6) +* License, GNU LGPL: GNU LGPL. (line 6) +* Licenses: Licenses. (line 6) +* LINGUAS file: po/LINGUAS. (line 6) +* link with libintl: Overview. (line 62) +* Linux: Aspects. (line 128) +* Linux <1>: Overview. (line 62) +* Linux <2>: Header Entry. (line 129) +* Lisp: Common Lisp. (line 6) +* lisp-format flag: PO Files. (line 149) +* list of translation teams, where to find: Header Entry. (line 54) +* locale categories: Aspects. (line 60) +* locale categories <1>: Aspects. (line 117) +* locale category, LC_ALL: Triggering. (line 23) +* locale category, LC_COLLATE: Triggering. (line 52) +* locale category, LC_CTYPE: Aspects. (line 66) +* locale category, LC_CTYPE <1>: Triggering. (line 23) +* locale category, LC_CTYPE <2>: Triggering. (line 52) +* locale category, LC_MESSAGES: Aspects. (line 111) +* locale category, LC_MESSAGES <1>: Triggering. (line 52) +* locale category, LC_MONETARY: Aspects. (line 79) +* locale category, LC_MONETARY <1>: Triggering. (line 52) +* locale category, LC_NUMERIC: Aspects. (line 96) +* locale category, LC_NUMERIC <1>: Triggering. (line 52) +* locale category, LC_RESPONSES: Triggering. (line 52) +* locale category, LC_TIME: Aspects. (line 85) +* locale category, LC_TIME <1>: Triggering. (line 52) +* locale program: Header Entry. (line 109) +* localization: Concepts. (line 26) +* lookup message translation: gettext Invocation. (line 9) +* lookup message translation <1>: eval_gettext Invocation. + (line 8) +* lookup message translation with context: eval_pgettext Invocation. + (line 8) +* lookup plural message translation: ngettext Invocation. (line 8) +* lookup plural message translation <1>: eval_ngettext Invocation. + (line 8) +* lookup plural message translation with context: eval_npgettext Invocation. + (line 8) +* lua-format flag: PO Files. (line 181) +* Lua, string concatenation: No string concatenation. + (line 29) +* magic signature of MO files: MO Files. (line 9) +* Makefile.in.in extensions: po/Rules-*. (line 6) +* Makevars file: po/Makevars. (line 6) +* manipulating PO files: Manipulating. (line 6) +* marking Perl sources: Perl. (line 97) +* marking string initializers: Special cases. (line 6) +* marking strings that require translation: Mark Keywords. (line 6) +* marking strings, preparations: Preparing Strings. (line 6) +* marking translatable strings: Overview. (line 34) +* markup: No unusual markup. (line 6) +* menu entries: Contexts. (line 6) +* menu, keyboard accelerator support: msgfmt Invocation. (line 281) +* merge PO files: msgcat Invocation. (line 8) +* merging two PO files: Manipulating. (line 10) +* merging two POT files: Combining POTs. (line 12) +* message catalog files location: Locating Catalogs. (line 6) +* messages: Aspects. (line 111) +* migration from earlier versions of gettext: Prerequisites. (line 6) +* mkinstalldirs file: mkinstalldirs. (line 6) +* mnemonics of menu entries: msgfmt Invocation. (line 281) +* MO file's format: MO Files. (line 6) +* modify message attributes: msgattrib Invocation. + (line 59) +* Modula-2: Modula-2. (line 6) +* Modula-2, string concatenation: No string concatenation. + (line 29) +* modula2-format flag: PO Files. (line 189) +* msgattrib program, usage: msgattrib Invocation. + (line 6) +* msgcat program, usage: msgcat Invocation. (line 6) +* msgcmp program, usage: msgcmp Invocation. (line 6) +* msgcomm program, usage: msgcomm Invocation. (line 6) +* msgconv program, usage: msgconv Invocation. (line 6) +* msgctxt: PO Files. (line 245) +* msgen program, usage: msgen Invocation. (line 6) +* msgexec program, usage: msgexec Invocation. (line 6) +* msgfilter filter and catalog encoding: msgfilter Invocation. + (line 62) +* msgfilter program, usage: msgfilter Invocation. + (line 6) +* msgfmt program, usage: msgfmt Invocation. (line 6) +* msggrep program, usage: msggrep Invocation. (line 6) +* msgid: PO Files. (line 60) +* msgid_plural: PO Files. (line 265) +* msginit program, usage: msginit Invocation. (line 6) +* msgmerge program, usage: msgmerge Invocation. (line 6) +* msgstr: PO Files. (line 60) +* msgunfmt program, usage: msgunfmt Invocation. (line 6) +* msguniq program, usage: msguniq Invocation. (line 6) +* multi-line strings: Normalizing. (line 64) +* N_, a convenience macro: Comparison. (line 41) +* Native Language Support: Concepts. (line 51) +* Natural Language Support: Concepts. (line 51) +* newlines in PO files: PO Files. (line 350) +* ngettext: Plural forms. (line 82) +* ngettext program, usage: ngettext Invocation. (line 6) +* NLS: Concepts. (line 51) +* no-awk-format flag: PO Files. (line 178) +* no-boost-format flag: PO Files. (line 214) +* no-c-format flag: PO Files. (line 94) +* no-c-format, and xgettext: c-format Flag. (line 47) +* no-c++-format flag: PO Files. (line 117) +* no-csharp-format flag: PO Files. (line 138) +* no-d-format flag: PO Files. (line 194) +* no-elisp-format flag: PO Files. (line 154) +* no-gcc-internal-format flag: PO Files. (line 234) +* no-gfc-internal-format flag: PO Files. (line 238) +* no-go-format flag: PO Files. (line 166) +* no-java-format flag: PO Files. (line 129) +* no-java-printf-format flag: PO Files. (line 134) +* no-javascript-format flag: PO Files. (line 142) +* no-kde-format flag: PO Files. (line 210) +* no-librep-format flag: PO Files. (line 158) +* no-lisp-format flag: PO Files. (line 150) +* no-lua-format flag: PO Files. (line 182) +* no-modula2-format flag: PO Files. (line 190) +* no-objc-format flag: PO Files. (line 113) +* no-object-pascal-format flag: PO Files. (line 186) +* no-perl-brace-format flag: PO Files. (line 226) +* no-perl-format flag: PO Files. (line 222) +* no-php-format flag: PO Files. (line 230) +* no-python-brace-format flag: PO Files. (line 125) +* no-python-format flag: PO Files. (line 121) +* no-qt-format flag: PO Files. (line 202) +* no-qt-plural-format flag: PO Files. (line 206) +* no-ruby-format flag: PO Files. (line 170) +* no-rust-format flag: PO Files. (line 162) +* no-scheme-format flag: PO Files. (line 146) +* no-sh-format flag: PO Files. (line 174) +* no-smalltalk-format flag: PO Files. (line 198) +* no-tcl-format flag: PO Files. (line 218) +* no-ycp-format flag: PO Files. (line 243) +* nplurals, in a PO file header: Plural forms. (line 188) +* number format: Aspects. (line 96) +* objc-format flag: PO Files. (line 112) +* Object Pascal: Pascal. (line 6) +* object-pascal-format flag: PO Files. (line 185) +* obsolete entries: Obsolete Entries. (line 6) +* OEM encoding: Working in a Windows console. + (line 6) +* optimization of gettext functions: Optimized gettext. (line 6) +* orthography: Manipulating. (line 28) +* outdigits: c-format. (line 34) +* output to stdout, xgettext: xgettext Invocation. (line 49) +* overview of gettext: Overview. (line 6) +* package and version declaration in configure.ac: configure.ac. + (line 9) +* package build and installation options: Installers. (line 6) +* package distributor's view of gettext: Installers. (line 6) +* package installer's view of gettext: Installers. (line 6) +* package maintainer's view of gettext: Maintainers. (line 6) +* paragraphs: Split at paragraphs. (line 6) +* Pascal: Pascal. (line 6) +* Perl: Perl. (line 6) +* Perl default keywords: Default Keywords. (line 6) +* Perl long lines: Long Lines. (line 6) +* Perl parentheses: Parentheses. (line 6) +* Perl pitfalls: Perl Pitfalls. (line 6) +* Perl quote-like expressions: Quote-like Expressions. + (line 6) +* Perl special keywords for hash-lookups: Special Keywords. (line 6) +* Perl unsupported string interpolation: Interpolation I. (line 6) +* Perl valid string interpolation: Interpolation II. (line 6) +* perl-brace-format flag: PO Files. (line 225) +* perl-format flag: PO Files. (line 221) +* Perl, string concatenation: No string concatenation. + (line 29) +* Perl, strings with embedded expressions: No string concatenation. + (line 78) +* pgettext: Contexts. (line 33) +* pgettext_expr: Contexts. (line 112) +* PHP: PHP. (line 6) +* php-format flag: PO Files. (line 229) +* PHP, string concatenation: No string concatenation. + (line 29) +* PHP, strings with embedded expressions: No string concatenation. + (line 78) +* Pike: Pike. (line 6) +* plural form formulas: Plural forms. (line 208) +* plural forms: Plural forms. (line 6) +* plural forms, in MO files: MO Files. (line 74) +* plural forms, in PO files: PO Files. (line 265) +* plural forms, translating: Translating plural forms. + (line 6) +* plural, in a PO file header: Plural forms. (line 188) +* PO files' format: PO Files. (line 6) +* PO mode (Emacs) commands: Main PO Commands. (line 6) +* PO template file: Template. (line 6) +* po_file_check_all: Checking API. (line 6) +* po_file_create: po_file_t API. (line 10) +* po_file_domain_header: PO Header Entry API. (line 11) +* po_file_domains: po_file_t API. (line 41) +* po_file_free: po_file_t API. (line 36) +* po_file_read: po_file_t API. (line 14) +* po_file_write: po_file_t API. (line 25) +* po_format_list: Format Type API. (line 6) +* po_format_pretty_name: Format Type API. (line 9) +* po_header_field: PO Header Entry API. (line 17) +* po_header_set_field: PO Header Entry API. (line 23) +* po_message_add_filepos: po_filepos_t API. (line 23) +* po_message_check_all: Checking API. (line 11) +* po_message_check_format: Checking API. (line 18) +* po_message_comments: po_message_t API. (line 78) +* po_message_create: po_message_t API. (line 10) +* po_message_extracted_comments: po_message_t API. (line 89) +* po_message_filepos: po_filepos_t API. (line 13) +* po_message_is_format: po_message_t API. (line 159) +* po_message_is_fuzzy: po_message_t API. (line 150) +* po_message_is_obsolete: po_message_t API. (line 141) +* po_message_is_range: po_message_t API. (line 172) +* po_message_iterator: po_message_iterator_t API. + (line 10) +* po_message_iterator_free: po_message_iterator_t API. + (line 17) +* po_message_msgctxt: po_message_t API. (line 19) +* po_message_msgid: po_message_t API. (line 30) +* po_message_msgid_plural: po_message_t API. (line 40) +* po_message_msgstr: po_message_t API. (line 53) +* po_message_msgstr_plural: po_message_t API. (line 64) +* po_message_prev_msgctxt: po_message_t API. (line 101) +* po_message_prev_msgid: po_message_t API. (line 114) +* po_message_prev_msgid_plural: po_message_t API. (line 126) +* po_message_remove_filepos: po_filepos_t API. (line 18) +* po_message_set_comments: po_message_t API. (line 83) +* po_message_set_extracted_comments: po_message_t API. (line 95) +* po_message_set_format: po_message_t API. (line 164) +* po_message_set_fuzzy: po_message_t API. (line 154) +* po_message_set_msgctxt: po_message_t API. (line 24) +* po_message_set_msgid: po_message_t API. (line 34) +* po_message_set_msgid_plural: po_message_t API. (line 46) +* po_message_set_msgstr: po_message_t API. (line 58) +* po_message_set_msgstr_plural: po_message_t API. (line 70) +* po_message_set_obsolete: po_message_t API. (line 145) +* po_message_set_prev_msgctxt: po_message_t API. (line 107) +* po_message_set_prev_msgid: po_message_t API. (line 119) +* po_message_set_prev_msgid_plural: po_message_t API. (line 133) +* po_message_set_range: po_message_t API. (line 178) +* po_next_message: po_message_iterator_t API. + (line 22) +* Pology: Other tools. (line 9) +* portability problems with sed: msgfilter Invocation. + (line 73) +* POTFILES.in file: po/POTFILES.in. (line 6) +* preparing programs for translation: Sources. (line 6) +* preparing rules for XML translation: Preparing ITS Rules. (line 6) +* preparing shell scripts for translation: Preparing Shell Scripts. + (line 6) +* problems with catgets interface: Problems with catgets. + (line 6) +* programming languages: Language Implementors. + (line 6) +* Python: Python. (line 6) +* python-brace-format flag: PO Files. (line 124) +* python-format flag: PO Files. (line 120) +* Python, string concatenation: No string concatenation. + (line 29) +* Python, strings with embedded expressions: No string concatenation. + (line 78) +* Qt format strings: xgettext Invocation. (line 353) +* Qt mode, and msgfmt program: msgfmt Invocation. (line 46) +* qt-format flag: PO Files. (line 201) +* qt-plural-format flag: PO Files. (line 205) +* quotation marks: Header Entry. (line 162) +* quotation marks <1>: po/Rules-*. (line 11) +* quote characters, use in PO files: Header Entry. (line 162) +* range: flag: PO Files. (line 296) +* recode-sr-latin program: msgfilter Invocation. + (line 101) +* related reading: References. (line 6) +* release: Release Management. (line 6) +* RSJ: RST. (line 6) +* RST: RST. (line 6) +* Ruby: Ruby. (line 6) +* ruby-format flag: PO Files. (line 169) +* Ruby, string concatenation: No string concatenation. + (line 29) +* Ruby, strings with embedded expressions: No string concatenation. + (line 78) +* Rust: Rust. (line 6) +* rust-format flag: PO Files. (line 161) +* Scheme: Scheme. (line 6) +* Scheme <1>: Scheme. (line 42) +* scheme-format flag: PO Files. (line 145) +* scripting languages: Language Implementors. + (line 6) +* search messages in a catalog: msggrep Invocation. (line 8) +* selecting message language: Locale Environment Variables. + (line 6) +* sentence end markers, xgettext: xgettext Invocation. (line 164) +* sentences: Entire sentences. (line 6) +* setting up gettext at build time: Installers. (line 6) +* setting up gettext at run time: Locale Environment Variables. + (line 6) +* several domains: Ambiguities. (line 6) +* sex: Introduction. (line 15) +* sh-format flag: PO Files. (line 173) +* she, he, and they: Introduction. (line 15) +* shell format string: envsubst Invocation. (line 8) +* shell scripts: sh. (line 6) +* Shell, string concatenation: No string concatenation. + (line 29) +* Shell, strings with embedded expressions: No string concatenation. + (line 78) +* Smalltalk: Smalltalk. (line 6) +* smalltalk-format flag: PO Files. (line 197) +* Smalltalk, string concatenation: No string concatenation. + (line 29) +* sorting msgcat output: msgcat Invocation. (line 156) +* sorting msgmerge output: msgmerge Invocation. (line 195) +* sorting msgunfmt output: msgunfmt Invocation. (line 147) +* sorting output of xgettext: xgettext Invocation. (line 467) +* specifying plural form in a PO file: Plural forms. (line 188) +* standard output, and msgcat: msgcat Invocation. (line 48) +* standard output, and msgmerge program: msgmerge Invocation. (line 53) +* string concatenation: No string concatenation. + (line 6) +* string normalization in entries: Normalizing. (line 6) +* style: Decent English style. + (line 6) +* supported languages, msgfmt: msgfmt Invocation. (line 180) +* supported languages, xgettext: xgettext Invocation. (line 57) +* supported syntax checks, xgettext: xgettext Invocation. (line 128) +* Tcl: Tcl. (line 6) +* Tcl mode, and msgfmt program: msgfmt Invocation. (line 43) +* Tcl mode, and msgunfmt program: msgunfmt Invocation. (line 26) +* tcl-format flag: PO Files. (line 217) +* Tcl, strings with embedded expressions: No string concatenation. + (line 78) +* template PO file: Overview. (line 67) +* testing .po files for equivalence: xgettext Invocation. (line 480) +* Tk's scripting language: Tcl. (line 6) +* Translate Toolkit: Other tools. (line 24) +* translated entries: Translated Entries. (line 6) +* translating menu entries: Contexts. (line 6) +* translation aspects: Aspects. (line 6) +* Translation Matrix: Installing Localizations. + (line 6) +* Translation Project: Why. (line 17) +* turning off NLS support: lib/gettext.h. (line 6) +* tutorial of gettext usage: Overview. (line 6) +* TypeScript, string concatenation: No string concatenation. + (line 29) +* TypeScript, strings with embedded expressions: No string concatenation. + (line 78) +* unify duplicate translations: msguniq Invocation. (line 8) +* untranslated entries: Untranslated Entries. + (line 6) +* update translations from a compendium: Using Compendia. (line 20) +* upgrading to new versions of gettext: Prerequisites. (line 6) +* Vala, string concatenation: No string concatenation. + (line 29) +* version control for backup files, msgmerge: msgmerge Invocation. + (line 67) +* weblate: Web based localization. + (line 6) +* Windows: Working in a Windows console. + (line 6) +* wxWidgets library: wxWidgets. (line 6) +* xargs, and output from msgexec: msgexec Invocation. (line 14) +* xerror: Error Handling. (line 15) +* xerror2: Error Handling. (line 37) +* xgettext program, usage: xgettext Invocation. (line 6) +* XML mode, and msgfmt program: msgfmt Invocation. (line 52) +* xmodmap program, and typing quotation marks: Header Entry. (line 174) +* YaST2 scripting language: YCP. (line 6) +* YCP: YCP. (line 6) +* ycp-format flag: PO Files. (line 242) + + + +Tag Table: +Node: Top2954 +Node: Introduction20196 +Node: Why21911 +Ref: Why-Footnote-125144 +Node: Concepts25300 +Node: Aspects28749 +Node: Files35347 +Node: Overview37295 +Node: Users48319 +Node: System Installation49307 +Node: Setting the GUI Locale50983 +Node: Setting the POSIX Locale52371 +Node: Locale Names53355 +Node: Locale Environment Variables56223 +Node: The LANGUAGE variable58564 +Node: Working in a Windows console61162 +Node: Installing Localizations62797 +Node: PO Files64085 +Ref: PO Files-Footnote-178506 +Node: Sources78641 +Node: Importing79945 +Node: Triggering80633 +Node: Preparing Strings84036 +Node: Decent English style85118 +Node: Entire sentences85973 +Node: Split at paragraphs88859 +Node: No string concatenation89920 +Node: No embedded URLs97498 +Node: No custom format directives98328 +Node: No unusual markup100108 +Node: Mark Keywords101563 +Node: Marking106439 +Node: Translator advice114400 +Node: c-format Flag116312 +Node: Special cases120512 +Node: Bug Report Address123296 +Node: Names125265 +Node: Libraries129564 +Node: Template132949 +Node: xgettext Invocation133770 +Node: Combining POTs159187 +Node: Creating161196 +Node: msginit Invocation162105 +Node: Header Entry166696 +Node: Updating176093 +Node: msgmerge Invocation176312 +Node: Editing183154 +Node: Web based localization184119 +Node: Lokalize185824 +Node: Gtranslator186171 +Node: Poedit186523 +Node: OmegaT186846 +Node: Virtaal187545 +Node: PO Mode188066 +Node: Installation189713 +Node: Main PO Commands191713 +Node: Entry Positioning196985 +Node: Normalizing202630 +Node: Translated Entries207187 +Node: Fuzzy Entries208596 +Node: Untranslated Entries211907 +Node: Obsolete Entries213910 +Node: Modifying Translations217213 +Node: Modifying Comments225355 +Node: Subedit229902 +Node: C Sources Context233916 +Node: Auxiliary239147 +Node: Vim242471 +Node: Compendium243136 +Node: Creating Compendia243751 +Node: Using Compendia246280 +Node: Manipulating247234 +Node: msgcat Invocation251236 +Node: msgconv Invocation256687 +Node: msggrep Invocation260666 +Node: msgfilter Invocation267462 +Node: msguniq Invocation275786 +Node: msgcomm Invocation280514 +Node: msgcmp Invocation285529 +Node: msgattrib Invocation287770 +Node: msgen Invocation293493 +Node: msgexec Invocation297890 +Node: Colorizing301196 +Node: The --color option302376 +Node: The TERM variable304242 +Node: The --style option305794 +Node: Style rules307170 +Node: Customizing less314170 +Node: Other tools315625 +Node: libgettextpo316645 +Node: Error Handling319874 +Node: po_file_t API321857 +Node: po_message_iterator_t API324071 +Node: po_message_t API325292 +Node: PO Header Entry API334154 +Node: po_filepos_t API335385 +Node: Format Type API336539 +Node: Checking API337116 +Node: Binaries338337 +Node: msgfmt Invocation338689 +Node: msgunfmt Invocation350963 +Node: MO Files355637 +Node: Programmers364644 +Node: catgets365844 +Node: Interface to catgets367250 +Node: Problems with catgets369301 +Node: gettext370223 +Node: Interface to gettext371746 +Node: Ambiguities374096 +Node: Locating Catalogs377161 +Ref: Locating Catalogs-Footnote-1378425 +Ref: Locating Catalogs-Footnote-2378655 +Node: Charset conversion378808 +Node: Contexts381326 +Node: Plural forms386928 +Ref: Plural forms-Footnote-1404257 +Node: Optimized gettext404625 +Node: Comparison405976 +Node: Using libintl.a410341 +Node: gettext grok410796 +Node: Temp Programmers413499 +Node: Temp Implementations414031 +Node: Temp catgets415418 +Node: Temp WSI417139 +Node: Temp Notes419194 +Node: Translators419708 +Node: Organization420190 +Node: Responsibilities421295 +Node: Dialects423519 +Node: Translating plural forms425280 +Node: Prioritizing messages428705 +Node: Maintainers433082 +Node: Flat and Non-Flat435049 +Node: Prerequisites436563 +Node: gettextize Invocation440714 +Node: Adjusting Files447373 +Node: po/POTFILES.in449158 +Node: po/LINGUAS450431 +Node: po/Makevars452236 +Node: po/Rules-*453225 +Node: configure.ac454780 +Node: config.guess456593 +Node: mkinstalldirs457967 +Node: aclocal458314 +Node: config.h.in460512 +Node: Makefile461279 +Node: src/Makefile463570 +Node: lib/gettext.h467801 +Node: autoconf macros470066 +Node: AM_GNU_GETTEXT471146 +Node: AM_GNU_GETTEXT_VERSION475364 +Node: AM_GNU_GETTEXT_NEED475843 +Node: AM_PO_SUBDIRS476759 +Node: AM_XGETTEXT_OPTION477591 +Node: AM_ICONV478502 +Node: Version Control Issues480879 +Node: Distributed Development481634 +Node: Files under Version Control483636 +Node: Translations under Version Control487123 +Ref: Translations under Version Control-Footnote-1489195 +Node: autopoint Invocation489285 +Node: Release Management491663 +Node: Installers492204 +Node: Programming Languages494172 +Node: Language Implementors494947 +Node: Programmers for other Languages500913 +Node: Translators for other Languages501505 +Node: c-format503673 +Node: objc-format505786 +Node: c++-format506288 +Node: python-format506852 +Node: java-format507629 +Node: csharp-format508544 +Node: javascript-format508931 +Node: scheme-format509724 +Node: lisp-format510002 +Node: elisp-format510362 +Node: librep-format510858 +Node: rust-format511261 +Node: go-format512566 +Node: ruby-format512851 +Node: sh-format513623 +Node: awk-format514471 +Node: lua-format514786 +Node: object-pascal-format515127 +Node: modula2-format515518 +Node: d-format516580 +Node: smalltalk-format516894 +Node: qt-format517421 +Node: qt-plural-format517864 +Node: kde-format518223 +Node: kde-kuit-format518655 +Node: boost-format519297 +Node: tcl-format519890 +Node: perl-format520194 +Node: php-format520989 +Node: gcc-internal-format521365 +Node: gfc-internal-format522524 +Node: ycp-format523274 +Node: Maintainers for other Languages523672 +Node: List of Programming Languages524610 +Node: C526207 +Node: Python527856 +Node: Java531036 +Node: C#537187 +Node: JavaScript546728 +Node: TypeScript547910 +Node: Scheme548935 +Node: Common Lisp550486 +Node: clisp C551362 +Node: Emacs Lisp552145 +Node: librep552951 +Node: Rust553761 +Node: Go556067 +Node: Ruby561121 +Node: sh562058 +Node: Preparing Shell Scripts563659 +Node: gettext.sh567301 +Node: gettext Invocation567993 +Node: ngettext Invocation570409 +Node: envsubst Invocation572423 +Node: eval_gettext Invocation573904 +Node: eval_ngettext Invocation574371 +Node: eval_pgettext Invocation574924 +Node: eval_npgettext Invocation575461 +Node: bash576046 +Node: gawk578085 +Node: Lua579214 +Node: Pascal580549 +Node: Modula-2582003 +Node: D582945 +Node: Smalltalk584666 +Node: Vala585791 +Node: wxWidgets586754 +Node: Tcl587776 +Node: Perl589292 +Node: General Problems592705 +Node: Default Keywords598355 +Node: Special Keywords600226 +Node: Quote-like Expressions601784 +Node: Interpolation I604101 +Node: Interpolation II608061 +Node: Parentheses610454 +Node: Long Lines611979 +Node: Perl Pitfalls613846 +Node: PHP618144 +Node: Pike619166 +Node: GCC-source619904 +Node: YCP620749 +Node: Data Formats621538 +Node: Internationalizable Data621939 +Node: POT622639 +Node: RST622914 +Node: Glade623424 +Node: GSettings623893 +Node: AppData624245 +Node: Preparing ITS Rules624854 +Node: ITS Rules625190 +Node: Locating Rules630316 +Ref: Locating Rules-Footnote-1633415 +Node: Localized Data633747 +Node: Editable Message Catalogs634231 +Node: PO634835 +Node: Java .properties635016 +Node: GNUstep .strings635222 +Node: Compiled Message Catalogs635432 +Node: MO636062 +Node: Java ResourceBundle636290 +Node: C# Satellite Assembly636641 +Node: C# Resource636921 +Node: Tcl message catalog637187 +Node: Qt message catalog637514 +Node: Desktop Entry637797 +Node: Icons638464 +Node: XML640048 +Node: Conclusion640273 +Node: History640834 +Node: The original ABOUT-NLS645216 +Node: INSTALL Matters646638 +Node: Using This Package648608 +Node: Translating Teams651878 +Node: Available Packages653393 +Node: Using gettext in own code725596 +Node: References726721 +Node: Language Codes728433 +Node: Usual Language Codes728948 +Node: Rare Language Codes733988 +Node: Country Codes735838 +Node: Licenses742960 +Node: GNU GPL744816 +Node: GNU LGPL763960 +Node: GNU FDL791989 +Node: Program Index817094 +Node: Option Index819504 +Node: Variable Index872526 +Node: PO Mode Index877614 +Node: Autoconf Macro Index894312 +Node: Index894977 + +End Tag Table + + +Local Variables: +coding: utf-8 +End: diff --git a/miniconda3/share/info/history.info b/miniconda3/share/info/history.info new file mode 100644 index 0000000000000000000000000000000000000000..3663d06b53c9f4ad6a5b91d04c038198274acef4 --- /dev/null +++ b/miniconda3/share/info/history.info @@ -0,0 +1,1461 @@ +This is history.info, produced by makeinfo version 7.1 from +history.texi. + +This document describes the GNU History library (version 8.3, 30 +December 2024), a programming tool that provides a consistent user +interface for recalling lines of previously typed input. + + Copyright © 1988-2025 Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts, and + no Back-Cover Texts. A copy of the license is included in the + section entitled "GNU Free Documentation License". + +INFO-DIR-SECTION Libraries +START-INFO-DIR-ENTRY +* History: (history). The GNU history library API. +END-INFO-DIR-ENTRY + + +File: history.info, Node: Top, Next: Using History Interactively, Up: (dir) + +GNU History Library +******************* + +This document describes the GNU History library, a programming tool that +provides a consistent user interface for recalling lines of previously +typed input. + +* Menu: + +* Using History Interactively:: GNU History User's Manual. +* Programming with GNU History:: GNU History Programmer's Manual. +* GNU Free Documentation License:: License for copying this manual. +* Concept Index:: Index of concepts described in this manual. +* Function and Variable Index:: Index of externally visible functions + and variables. + + +File: history.info, Node: Using History Interactively, Next: Programming with GNU History, Prev: Top, Up: Top + +1 Using History Interactively +***************************** + +This chapter describes how to use the GNU History Library interactively, +from a user's standpoint. It should be considered a user's guide. For +information on using the GNU History Library in your own programs, *note +Programming with GNU History::. + +* Menu: + +* History Interaction:: What it feels like using History as a user. + + +File: history.info, Node: History Interaction, Up: Using History Interactively + +1.1 History Expansion +===================== + +The History library provides a history expansion feature that is similar +to the history expansion provided by ‘csh’ (also referred to as history +substitution where appropriate). This section describes the syntax used +to manipulate the history information. + + History expansions introduce words from the history list into the +input stream, making it easy to repeat commands, insert the arguments to +a previous command into the current input line, or fix errors in +previous commands quickly. + + History expansion takes place in two parts. The first is to +determine which entry from the history list should be used during +substitution. The second is to select portions of that entry to include +into the current one. + + The entry selected from the history is called the “event”, and the +portions of that entry that are acted upon are “words”. Various +“modifiers” are available to manipulate the selected words. The entry +is split into words in the same fashion that Bash does when reading +input, so that several words surrounded by quotes are considered one +word. The “event designator” selects the event, the optional “word +designator” selects words from the event, and various optional +“modifiers” are available to manipulate the selected words. + + History expansions are introduced by the appearance of the history +expansion character, which is ‘!’ by default. History expansions may +appear anywhere in the input, but do not nest. + + History expansion implements shell-like quoting conventions: a +backslash can be used to remove the special handling for the next +character; single quotes enclose verbatim sequences of characters, and +can be used to inhibit history expansion; and characters enclosed within +double quotes may be subject to history expansion, since backslash can +escape the history expansion character, but single quotes may not, since +they are not treated specially within double quotes. + + There is a special abbreviation for substitution, active when the +QUICK SUBSTITUTION character (default ‘^’) is the first character on the +line. It selects the previous history list entry, using an event +designator equivalent to ‘!!’, and substitutes one string for another in +that entry. It is described below (*note Event Designators::). This is +the only history expansion that does not begin with the history +expansion character. + +* Menu: + +* Event Designators:: How to specify which history line to use. +* Word Designators:: Specifying which words are of interest. +* Modifiers:: Modifying the results of substitution. + + +File: history.info, Node: Event Designators, Next: Word Designators, Up: History Interaction + +1.1.1 Event Designators +----------------------- + +An event designator is a reference to an entry in the history list. The +event designator consists of the portion of the word beginning with the +history expansion character, and ending with the word designator if one +is present, or the end of the word. Unless the reference is absolute, +events are relative to the current position in the history list. + +‘!’ + Start a history substitution, except when followed by a space, tab, + the end of the line, or ‘=’. + +‘!N’ + Refer to history list entry N. + +‘!-N’ + Refer to the history entry minus N. + +‘!!’ + Refer to the previous entry. This is a synonym for ‘!-1’. + +‘!STRING’ + Refer to the most recent command preceding the current position in + the history list starting with STRING. + +‘!?STRING[?]’ + Refer to the most recent command preceding the current position in + the history list containing STRING. The trailing ‘?’ may be + omitted if the STRING is followed immediately by a newline. If + STRING is missing, this uses the string from the most recent + search; it is an error if there is no previous search string. + +‘^STRING1^STRING2^’ + Quick Substitution. Repeat the last command, replacing STRING1 + with STRING2. Equivalent to ‘!!:s^STRING1^STRING2^’. + +‘!#’ + The entire command line typed so far. + + +File: history.info, Node: Word Designators, Next: Modifiers, Prev: Event Designators, Up: History Interaction + +1.1.2 Word Designators +---------------------- + +Word designators are used to select desired words from the event. They +are optional; if the word designator isn't supplied, the history +expansion uses the entire event. A ‘:’ separates the event +specification from the word designator. It may be omitted if the word +designator begins with a ‘^’, ‘$’, ‘*’, ‘-’, or ‘%’. Words are numbered +from the beginning of the line, with the first word being denoted by 0 +(zero). That first word is usually the command word, and the arguments +begin with the second word. Words are inserted into the current line +separated by single spaces. + + For example, + +‘!!’ + designates the preceding command. When you type this, the + preceding command is repeated in toto. + +‘!!:$’ + designates the last word of the preceding command. This may be + shortened to ‘!$’. + +‘!fi:2’ + designates the second argument of the most recent command starting + with the letters ‘fi’. + + Here are the word designators: + +‘0 (zero)’ + The ‘0’th word. For the shell, and many other, applications, this + is the command word. + +‘N’ + The Nth word. + +‘^’ + The first argument: word 1. + +‘$’ + The last word. This is usually the last argument, but expands to + the zeroth word if there is only one word in the line. + +‘%’ + The first word matched by the most recent ‘?STRING?’ search, if the + search string begins with a character that is part of a word. By + default, searches begin at the end of each line and proceed to the + beginning, so the first word matched is the one closest to the end + of the line. + +‘X-Y’ + A range of words; ‘-Y’ abbreviates ‘0-Y’. + +‘*’ + All of the words, except the ‘0’th. This is a synonym for ‘1-$’. + It is not an error to use ‘*’ if there is just one word in the + event; it expands to the empty string in that case. + +‘X*’ + Abbreviates ‘X-$’. + +‘X-’ + Abbreviates ‘X-$’ like ‘X*’, but omits the last word. If ‘x’ is + missing, it defaults to 0. + + If a word designator is supplied without an event specification, the +previous command is used as the event, equivalent to ‘!!’. + + +File: history.info, Node: Modifiers, Prev: Word Designators, Up: History Interaction + +1.1.3 Modifiers +--------------- + +After the optional word designator, you can add a sequence of one or +more of the following modifiers, each preceded by a ‘:’. These modify, +or edit, the word or words selected from the history event. + +‘h’ + Remove a trailing filename component, leaving only the head. + +‘t’ + Remove all leading filename components, leaving the tail. + +‘r’ + Remove a trailing suffix of the form ‘.SUFFIX’, leaving the + basename. + +‘e’ + Remove all but the trailing suffix. + +‘p’ + Print the new command but do not execute it. + +‘s/OLD/NEW/’ + Substitute NEW for the first occurrence of OLD in the event line. + Any character may be used as the delimiter in place of ‘/’. The + delimiter may be quoted in OLD and NEW with a single backslash. If + ‘&’ appears in NEW, it is replaced with OLD. A single backslash + quotes the ‘&’ in OLD and NEW. If OLD is null, it is set to the + last OLD substituted, or, if no previous history substitutions took + place, the last STRING in a !?STRING‘[?]’ search. If NEW is null, + each matching OLD is deleted. The final delimiter is optional if + it is the last character on the input line. + +‘&’ + Repeat the previous substitution. + +‘g’ +‘a’ + Cause changes to be applied over the entire event line. This is + used in conjunction with ‘s’, as in ‘gs/OLD/NEW/’, or with ‘&’. + +‘G’ + Apply the following ‘s’ or ‘&’ modifier once to each word in the + event. + + +File: history.info, Node: Programming with GNU History, Next: GNU Free Documentation License, Prev: Using History Interactively, Up: Top + +2 Programming with GNU History +****************************** + +This chapter describes how to interface programs that you write with the +GNU History Library. It should be considered a technical guide. For +information on the interactive use of GNU History, *note Using History +Interactively::. + +* Menu: + +* Introduction to History:: What is the GNU History library for? +* History Storage:: How information is stored. +* History Functions:: Functions that you can use. +* History Variables:: Variables that control behavior. +* History Programming Example:: Example of using the GNU History Library. + + +File: history.info, Node: Introduction to History, Next: History Storage, Up: Programming with GNU History + +2.1 Introduction to History +=========================== + +Many programs read input from the user a line at a time. The GNU +History library is able to keep track of those lines, associate +arbitrary data with each line, and utilize information from previous +lines when composing new ones. + + A programmer using the History library can use functions to save +commands on a history list, associate arbitrary data with history list +entries, remove entries from the list, search through the list for a +line containing an arbitrary text string, reference any entry in the +list directly, and read and write the history list from and to a file. +In addition, a history “expansion” function is available which provides +for a consistent user interface across different programs. + + Someone using programs written with the History library has the +benefit of a consistent user interface with a set of well-known commands +for manipulating the text of previous lines and using that text in new +commands. The basic history manipulation commands are similar to the +history substitution provided by ‘csh’. + + The programmer can also use the Readline library, which includes some +history manipulation by default, and has the added advantage of command +line editing. + + Before declaring any functions using any functionality the History +library provides in other code, an application writer should include the +file ‘’ in any file that uses the History library's +features. It supplies declarations for all of the library's public +functions and variables, and declares all of the public data structures. + + +File: history.info, Node: History Storage, Next: History Functions, Prev: Introduction to History, Up: Programming with GNU History + +2.2 History Storage +=================== + +The history list is an array of history entries. A history entry is +declared as follows: + + typedef void *histdata_t; + + typedef struct _hist_entry { + char *line; + char *timestamp; + histdata_t data; + } HIST_ENTRY; + + The history list itself might therefore be declared as + + HIST_ENTRY **the_history_list; + + The state of the History library is encapsulated into a single +structure: + + /* + * A structure used to pass around the current state of the history. + */ + typedef struct _hist_state { + HIST_ENTRY **entries; /* Pointer to the entries themselves. */ + int offset; /* The location pointer within this array. */ + int length; /* Number of elements within this array. */ + int size; /* Number of slots allocated to this array. */ + int flags; + } HISTORY_STATE; + + If the flags member includes ‘HS_STIFLED’, the history has been +stifled (limited to a maximum number of entries). + + +File: history.info, Node: History Functions, Next: History Variables, Prev: History Storage, Up: Programming with GNU History + +2.3 History Functions +===================== + +This section describes the calling sequence for the various functions +exported by the GNU History library. + +* Menu: + +* Initializing History and State Management:: Functions to call when you + want to use history in a + program. +* History List Management:: Functions used to manage the list + of history entries. +* Information About the History List:: Functions returning information about + the history list. +* Moving Around the History List:: Functions used to change the position + in the history list. +* Searching the History List:: Functions to search the history list + for entries containing a string. +* Managing the History File:: Functions that read and write a file + containing the history list. +* History Expansion:: Functions to perform csh-like history + expansion. + + +File: history.info, Node: Initializing History and State Management, Next: History List Management, Up: History Functions + +2.3.1 Initializing History and State Management +----------------------------------------------- + +This section describes functions used to initialize and manage the state +of the History library when you want to use the history functions in +your program. + + -- Function: void using_history (void) + Begin a session that will use the history functions. This + initializes the interactive variables. + + -- Function: HISTORY_STATE * history_get_history_state (void) + Return a structure describing the current state of the input + history. + + -- Function: void history_set_history_state (HISTORY_STATE *state) + Set the state of the history list according to STATE. + + +File: history.info, Node: History List Management, Next: Information About the History List, Prev: Initializing History and State Management, Up: History Functions + +2.3.2 History List Management +----------------------------- + +These functions manage individual entries on the history list, or set +parameters managing the list itself. + + -- Function: void add_history (const char *string) + Add STRING to the end of the history list, and set the associated + data field (if any) to ‘NULL’. If the maximum number of history + entries has been set using ‘stifle_history()’, and the new number + of history entries would exceed that maximum, this removes the + oldest history entry. + + -- Function: void add_history_time (const char *string) + Change the time stamp associated with the most recent history entry + to STRING. + + -- Function: HIST_ENTRY * remove_history (int which) + Remove the history entry at offset WHICH from the history list. + This returns the removed element so you can free the line, data, + and containing structure. Since the data is private to your + application, the History library doesn't know how to free it, if + necessary. + + -- Function: histdata_t free_history_entry (HIST_ENTRY *histent) + Free the history entry HISTENT and any history library private data + associated with it. Returns the application-specific data so the + caller can dispose of it. + + -- Function: HIST_ENTRY * replace_history_entry (int which, const char + *line, histdata_t data) + Make the history entry at offset WHICH have LINE and DATA. This + returns the old entry so the caller can dispose of any + application-specific data. In the case of an invalid WHICH, this + returns ‘NULL’. + + -- Function: void clear_history (void) + Clear the history list by deleting all the entries. + + -- Function: void stifle_history (int max) + Stifle the history list, remembering only the last MAX entries. + The history list will contain only MAX entries at a time. + + -- Function: int unstifle_history (void) + Stop stifling the history. This returns the previously-set maximum + number of history entries (as set by ‘stifle_history()’). The + value is positive if the history was stifled, negative if it + wasn't. + + -- Function: int history_is_stifled (void) + Returns non-zero if the history is stifled, zero if it is not. + + +File: history.info, Node: Information About the History List, Next: Moving Around the History List, Prev: History List Management, Up: History Functions + +2.3.3 Information About the History List +---------------------------------------- + +These functions return information about the entire history list or +individual list entries. + + -- Function: HIST_ENTRY ** history_list (void) + Return a ‘NULL’ terminated array of ‘HIST_ENTRY *’ which is the + current input history. Element 0 of this list is the beginning of + time. Return ‘NULL’ if there is no history. + + -- Function: int where_history (void) + Return the offset of the current history entry. + + -- Function: HIST_ENTRY * current_history (void) + Return the history entry at the current position, as determined by + ‘where_history()’. If there is no entry there, return ‘NULL’. + + -- Function: HIST_ENTRY * history_get (int offset) + Return the history entry at position OFFSET. The range of valid + values of OFFSET starts at ‘history_base’ and ends at + HISTORY_LENGTH - 1 (*note History Variables::). If there is no + entry there, or if OFFSET is outside the valid range, return + ‘NULL’. + + -- Function: time_t history_get_time (HIST_ENTRY *entry) + Return the time stamp associated with the history entry ENTRY. If + the timestamp is missing or invalid, return 0. + + -- Function: int history_total_bytes (void) + Return the number of bytes that the primary history entries are + using. This function returns the sum of the lengths of all the + lines in the history. + + +File: history.info, Node: Moving Around the History List, Next: Searching the History List, Prev: Information About the History List, Up: History Functions + +2.3.4 Moving Around the History List +------------------------------------ + +These functions allow the current index into the history list to be set +or changed. + + -- Function: int history_set_pos (int pos) + Set the current history offset to POS, an absolute index into the + list. Returns 1 on success, 0 if POS is less than zero or greater + than the number of history entries. + + -- Function: HIST_ENTRY * previous_history (void) + Back up the current history offset to the previous history entry, + and return a pointer to that entry. If there is no previous entry, + return ‘NULL’. + + -- Function: HIST_ENTRY * next_history (void) + If the current history offset refers to a valid history entry, + increment the current history offset. If the possibly-incremented + history offset refers to a valid history entry, return a pointer to + that entry; otherwise, return ‘NULL’. + + +File: history.info, Node: Searching the History List, Next: Managing the History File, Prev: Moving Around the History List, Up: History Functions + +2.3.5 Searching the History List +-------------------------------- + +These functions search the history list for entries containing a +specific string. Searching may be performed both forward and backward +from the current history position. The search may be “anchored”, +meaning that the string must match at the beginning of a history entry. + + -- Function: int history_search (const char *string, int direction) + Search the history for STRING, starting at the current history + offset. If DIRECTION is less than 0, then the search is through + previous entries, otherwise through subsequent entries. If STRING + is found, then the current history index is set to that history + entry, and ‘history_search’ returns the offset in the line of the + entry where STRING was found. Otherwise, nothing is changed, and + this returns -1. + + -- Function: int history_search_prefix (const char *string, int + direction) + Search the history for STRING, starting at the current history + offset. The search is anchored: matching history entries must + begin with STRING. If DIRECTION is less than 0, then the search is + through previous entries, otherwise through subsequent entries. If + STRING is found, then the current history index is set to that + entry, and the return value is 0. Otherwise, nothing is changed, + and this returns -1. + + -- Function: int history_search_pos (const char *string, int direction, + int pos) + Search for STRING in the history list, starting at POS, an absolute + index into the list. If DIRECTION is negative, the search proceeds + backward from POS, otherwise forward. Returns the index in the + history list of the history element where STRING was found, or -1 + otherwise. + + +File: history.info, Node: Managing the History File, Next: History Expansion, Prev: Searching the History List, Up: History Functions + +2.3.6 Managing the History File +------------------------------- + +The History library can read the history from and write it to a file. +This section documents the functions for managing a history file. + + -- Function: int read_history (const char *filename) + Add the contents of FILENAME to the history list, one entry at a + time. If FILENAME is ‘NULL’, this reads from ‘~/.history’, if it + exists. This attempts to determine whether the history file + includes timestamp information, and assigns timestamps to the + history entries it reads if so. Returns 0 if successful, or + ‘errno’ if not. + + -- Function: int read_history_range (const char *filename, int from, + int to) + Read a range of lines from FILENAME, adding them to the history + list. Start reading at line FROM and end at TO. If FROM is zero, + start at the beginning. If TO is less than FROM, this reads until + the end of the file. This attempts to determine whether the + history file includes timestamp information, and assigns timestamps + to the history entries it reads if so. If FILENAME is ‘NULL’, this + reads from ‘~/.history’, if it exists. Returns 0 if successful, or + ‘errno’ if not. + + -- Function: int write_history (const char *filename) + Write the current history to FILENAME, overwriting FILENAME if + necessary. This writes timestamp information if the + ‘history_write_timestamps’ variable is set to a non-zero value. If + FILENAME is ‘NULL’, then write the history list to ‘~/.history’. + Returns 0 on success, or ‘errno’ on a read or write error. + + -- Function: int append_history (int nelements, const char *filename) + Append the last NELEMENTS of the history list to FILENAME. This + writes timestamp information if the ‘history_write_timestamps’ + variable is set to a non-zero value. If FILENAME is ‘NULL’, then + append to ‘~/.history’. Returns 0 on success, or ‘errno’ on a read + or write error. + + -- Function: int history_truncate_file (const char *filename, int + nlines) + Truncate the history file FILENAME, leaving only the last NLINES + lines. If FILENAME is ‘NULL’, this truncates ‘~/.history’. + Returns 0 on success, or ‘errno’ on failure. + + +File: history.info, Node: History Expansion, Prev: Managing the History File, Up: History Functions + +2.3.7 History Expansion +----------------------- + +These functions implement history expansion. + + -- Function: int history_expand (const char *string, char **output) + Expand STRING, placing the result into OUTPUT, a pointer to a + string (*note History Interaction::). Returns: + ‘0’ + If no expansions took place (or, if the only change in the + text was the removal of escape characters preceding the + history expansion character); + ‘1’ + if expansions did take place; + ‘-1’ + if there was an error in expansion; + ‘2’ + if the returned line should be displayed, but not executed, as + with the ‘:p’ modifier (*note Modifiers::). + + If an error occurred during expansion, then OUTPUT contains a + descriptive error message. + + -- Function: char * get_history_event (const char *string, int *cindex, + int qchar) + Returns the text of the history event beginning at STRING + + *CINDEX. Modifies *CINDEX to point to after the event specifier. + At function entry, CINDEX points to the index into STRING where the + history event specification begins. QCHAR is a character that is + allowed to end the event specification in addition to the "normal" + terminating characters. + + -- Function: char ** history_tokenize (const char *string) + Return an array of tokens parsed out of STRING, much as the shell + might. The tokens are split on the characters in the + HISTORY_WORD_DELIMITERS variable, and shell quoting conventions are + obeyed as described below. + + -- Function: char * history_arg_extract (int first, int last, const + char *string) + Extract a string segment consisting of the FIRST through LAST + arguments present in STRING. This splits STRING into arguments + using ‘history_tokenize’. + + +File: history.info, Node: History Variables, Next: History Programming Example, Prev: History Functions, Up: Programming with GNU History + +2.4 History Variables +===================== + +This section describes the externally-visible variables exported by the +GNU History Library. + + -- Variable: int history_base + The logical offset of the first entry in the history list. + + -- Variable: int history_length + The number of entries currently stored in the history list. + + -- Variable: int history_max_entries + The maximum number of history entries. This must be changed using + ‘stifle_history()’. + + -- Variable: int history_write_timestamps + If non-zero, timestamps are written to the history file, so they + can be preserved between sessions. The default value is 0, meaning + that timestamps are not saved. + + The current timestamp format uses the value of HISTORY_COMMENT_CHAR + to delimit timestamp entries in the history file. If that variable + does not have a value (the default), the history library will not + write timestamps. + + -- Variable: char history_expansion_char + The character that introduces a history event. The default is ‘!’. + Setting this to 0 inhibits history expansion. + + -- Variable: char history_subst_char + The character that invokes word substitution if found at the start + of a line. The default is ‘^’. + + -- Variable: char history_comment_char + During tokenization, if this character appears as the first + character of a word, then it and all subsequent characters up to a + newline are ignored, suppressing history expansion for the + remainder of the line. This is disabled by default. + + -- Variable: char * history_word_delimiters + The characters that separate tokens for ‘history_tokenize()’. The + default value is ‘" \t\n()<>;&|"’. + + -- Variable: char * history_search_delimiter_chars + The list of additional characters which can delimit a history + search string, in addition to space, TAB, ‘:’ and ‘?’ in the case + of a substring search. The default is empty. + + -- Variable: char * history_no_expand_chars + The list of characters which inhibit history expansion if found + immediately following HISTORY_EXPANSION_CHAR. The default is + space, tab, newline, carriage return, and ‘=’. + + -- Variable: int history_quotes_inhibit_expansion + If non-zero, the history expansion code implements shell-like + quoting: single-quoted words are not scanned for the history + expansion character or the history comment character, and + double-quoted words may have history expansion performed, since + single quotes are not special within double quotes. The default + value is 0. + + -- Variable: int history_quoting_state + An application may set this variable to indicate that the current + line being expanded is subject to existing quoting. If set to ‘'’, + history expansion assumes that the line is single-quoted and + inhibit expansion until it reads an unquoted closing single quote; + if set to ‘"’, history expansion assumes the line is double quoted + until it reads an unquoted closing double quote. If set to 0, the + default, history expansion assumes the line is not quoted and + treats quote characters within the line as described above. This + is only effective if HISTORY_QUOTES_INHIBIT_EXPANSION is set. This + is intended for use by applications like Bash which allow quoted + strings to span multiple lines. + + -- Variable: rl_linebuf_func_t * history_inhibit_expansion_function + This should be set to the address of a function that takes two + arguments: a ‘char *’ (STRING) and an ‘int’ index into that string + (I). It should return a non-zero value if the history expansion + starting at STRING[I] should not be performed; zero if the + expansion should be done. It is intended for use by applications + like Bash that use the history expansion character for additional + purposes. By default, this variable is set to ‘NULL’. + + +File: history.info, Node: History Programming Example, Prev: History Variables, Up: Programming with GNU History + +2.5 History Programming Example +=============================== + +The following program demonstrates simple use of the GNU History +Library. + + #include + #include + + int + main (int argc, char **argv) + { + char line[1024], *t; + int len, done = 0; + + line[0] = 0; + + using_history (); + while (!done) + { + printf ("history$ "); + fflush (stdout); + t = fgets (line, sizeof (line) - 1, stdin); + if (t && *t) + { + len = strlen (t); + if (t[len - 1] == '\n') + t[len - 1] = '\0'; + } + + if (!t) + strcpy (line, "quit"); + + if (line[0]) + { + char *expansion; + int result; + + result = history_expand (line, &expansion); + if (result) + fprintf (stderr, "%s\n", expansion); + + if (result < 0 || result == 2) + { + free (expansion); + continue; + } + + add_history (expansion); + strncpy (line, expansion, sizeof (line) - 1); + free (expansion); + } + + if (strcmp (line, "quit") == 0) + done = 1; + else if (strcmp (line, "save") == 0) + write_history ("history_file"); + else if (strcmp (line, "read") == 0) + read_history ("history_file"); + else if (strcmp (line, "list") == 0) + { + register HIST_ENTRY **the_list; + register int i; + + the_list = history_list (); + if (the_list) + for (i = 0; the_list[i]; i++) + printf ("%d: %s\n", i + history_base, the_list[i]->line); + } + else if (strncmp (line, "delete", 6) == 0) + { + int which; + if ((sscanf (line + 6, "%d", &which)) == 1) + { + HIST_ENTRY *entry = remove_history (which); + if (!entry) + fprintf (stderr, "No such entry %d\n", which); + else + { + free (entry->line); + free (entry); + } + } + else + { + fprintf (stderr, "non-numeric arg given to `delete'\n"); + } + } + } + } + + +File: history.info, Node: GNU Free Documentation License, Next: Concept Index, Prev: Programming with GNU History, Up: Top + +Appendix A GNU Free Documentation License +***************************************** + + Version 1.3, 3 November 2008 + + Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + functional and useful document “free” in the sense of freedom: to + assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or + noncommercially. Secondarily, this License preserves for the + author and publisher a way to get credit for their work, while not + being considered responsible for modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. We + recommend this License principally for works whose purpose is + instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work, in any medium, + that contains a notice placed by the copyright holder saying it can + be distributed under the terms of this License. Such a notice + grants a world-wide, royalty-free license, unlimited in duration, + to use that work under the conditions stated herein. The + "Document", below, refers to any such manual or work. Any member + of the public is a licensee, and is addressed as "you". You accept + the license if you copy, modify or distribute the work in a way + requiring permission under copyright law. + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter section + of the Document that deals exclusively with the relationship of the + publishers or authors of the Document to the Document's overall + subject (or to related matters) and contains nothing that could + fall directly within that overall subject. (Thus, if the Document + is in part a textbook of mathematics, a Secondary Section may not + explain any mathematics.) The relationship could be a matter of + historical connection with the subject or with related matters, or + of legal, commercial, philosophical, ethical or political position + regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in the + notice that says that the Document is released under this License. + If a section does not fit the above definition of Secondary then it + is not allowed to be designated as Invariant. The Document may + contain zero Invariant Sections. If the Document does not identify + any Invariant Sections then there are none. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. A + Front-Cover Text may be at most 5 words, and a Back-Cover Text may + be at most 25 words. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, that is suitable for revising the document + straightforwardly with generic text editors or (for images composed + of pixels) generic paint programs or (for drawings) some widely + available drawing editor, and that is suitable for input to text + formatters or for automatic translation to a variety of formats + suitable for input to text formatters. A copy made in an otherwise + Transparent file format whose markup, or absence of markup, has + been arranged to thwart or discourage subsequent modification by + readers is not Transparent. An image format is not Transparent if + used for any substantial amount of text. A copy that is not + "Transparent" is called "Opaque". + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and standard-conforming + simple HTML, PostScript or PDF designed for human modification. + Examples of transparent image formats include PNG, XCF and JPG. + Opaque formats include proprietary formats that can be read and + edited only by proprietary word processors, SGML or XML for which + the DTD and/or processing tools are not generally available, and + the machine-generated HTML, PostScript or PDF produced by some word + processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + The "publisher" means any person or entity that distributes copies + of the Document to the public. + + A section "Entitled XYZ" means a named subunit of the Document + whose title either is precisely XYZ or contains XYZ in parentheses + following text that translates XYZ in another language. (Here XYZ + stands for a specific section name mentioned below, such as + "Acknowledgements", "Dedications", "Endorsements", or "History".) + To "Preserve the Title" of such a section when you modify the + Document means that it remains a section "Entitled XYZ" according + to this definition. + + The Document may include Warranty Disclaimers next to the notice + which states that this License applies to the Document. These + Warranty Disclaimers are considered to be included by reference in + this License, but only as regards disclaiming warranties: any other + implication that these Warranty Disclaimers may have is void and + has no effect on the meaning of this License. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow the + conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies (or copies in media that commonly + have printed covers) of the Document, numbering more than 100, and + the Document's license notice requires Cover Texts, you must + enclose the copies in covers that carry, clearly and legibly, all + these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the title + equally prominent and visible. You may add other material on the + covers in addition. Copying with changes limited to the covers, as + long as they preserve the title of the Document and satisfy these + conditions, can be treated as verbatim copying in other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a machine-readable + Transparent copy along with each Opaque copy, or state in or with + each Opaque copy a computer-network location from which the general + network-using public has access to download using public-standard + network protocols a complete Transparent copy of the Document, free + of added material. If you use the latter option, you must take + reasonably prudent steps, when you begin distribution of Opaque + copies in quantity, to ensure that this Transparent copy will + remain thus accessible at the stated location until at least one + year after the last time you distribute an Opaque copy (directly or + through your agents or retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of copies, + to give them a chance to provide you with an updated version of the + Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with the + Modified Version filling the role of the Document, thus licensing + distribution and modification of the Modified Version to whoever + possesses a copy of it. In addition, you must do these things in + the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of previous + versions (which should, if there were any, be listed in the + History section of the Document). You may use the same title + as a previous version if the original publisher of that + version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has fewer than five), unless they release you + from this requirement. + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section Entitled "History", Preserve its Title, + and add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on the + Title Page. If there is no section Entitled "History" in the + Document, create one stating the title, year, authors, and + publisher of the Document as given on its Title Page, then add + an item describing the Modified Version as stated in the + previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in the + "History" section. You may omit a network location for a work + that was published at least four years before the Document + itself, or if the original publisher of the version it refers + to gives permission. + + K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section + all the substance and tone of each of the contributor + acknowledgements and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, unaltered + in their text and in their titles. Section numbers or the + equivalent are not considered part of the section titles. + + M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section to be Entitled + "Endorsements" or to conflict in title with any Invariant + Section. + + O. Preserve any Warranty Disclaimers. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option designate + some or all of these sections as invariant. To do this, add their + titles to the list of Invariant Sections in the Modified Version's + license notice. These titles must be distinct from any other + section titles. + + You may add a section Entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties--for example, statements of peer review or that the text + has been approved by an organization as the authoritative + definition of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end of + the list of Cover Texts in the Modified Version. Only one passage + of Front-Cover Text and one of Back-Cover Text may be added by (or + through arrangements made by) any one entity. If the Document + already includes a cover text for the same cover, previously added + by you or by arrangement made by the same entity you are acting on + behalf of, you may not add another; but you may replace the old + one, on explicit permission from the previous publisher that added + the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination all + of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice, and that you preserve all + their Warranty Disclaimers. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections Entitled + "History" in the various original documents, forming one section + Entitled "History"; likewise combine any sections Entitled + "Acknowledgements", and any sections Entitled "Dedications". You + must delete all sections Entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the documents + in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow this + License in all other respects regarding verbatim copying of that + document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of a + storage or distribution medium, is called an "aggregate" if the + copyright resulting from the compilation is not used to limit the + legal rights of the compilation's users beyond what the individual + works permit. When the Document is included in an aggregate, this + License does not apply to the other works in the aggregate which + are not themselves derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one half + of the entire aggregate, the Document's Cover Texts may be placed + on covers that bracket the Document within the aggregate, or the + electronic equivalent of covers if the Document is in electronic + form. Otherwise they must appear on printed covers that bracket + the whole aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License, and all the license notices in the + Document, and any Warranty Disclaimers, provided that you also + include the original English version of this License and the + original versions of those notices and disclaimers. In case of a + disagreement between the translation and the original version of + this License or a notice or disclaimer, the original version will + prevail. + + If a section in the Document is Entitled "Acknowledgements", + "Dedications", or "History", the requirement (section 4) to + Preserve its Title (section 1) will typically require changing the + actual title. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense, or distribute it is void, + and will automatically terminate your rights under this License. + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly and + finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from + that copyright holder, and you cure the violation prior to 30 days + after your receipt of the notice. + + Termination of your rights under this section does not terminate + the licenses of parties who have received copies or rights from you + under this License. If your rights have been terminated and not + permanently reinstated, receipt of a copy of some or all of the + same material does not give you any rights to use it. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + . + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If the + Document does not specify a version number of this License, you may + choose any version ever published (not as a draft) by the Free + Software Foundation. If the Document specifies that a proxy can + decide which future versions of this License can be used, that + proxy's public statement of acceptance of a version permanently + authorizes you to choose that version for the Document. + + 11. RELICENSING + + "Massive Multiauthor Collaboration Site" (or "MMC Site") means any + World Wide Web server that publishes copyrightable works and also + provides prominent facilities for anybody to edit those works. A + public wiki that anybody can edit is an example of such a server. + A "Massive Multiauthor Collaboration" (or "MMC") contained in the + site means any set of copyrightable works thus published on the MMC + site. + + "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 + license published by Creative Commons Corporation, a not-for-profit + corporation with a principal place of business in San Francisco, + California, as well as future copyleft versions of that license + published by that same organization. + + "Incorporate" means to publish or republish a Document, in whole or + in part, as part of another Document. + + An MMC is "eligible for relicensing" if it is licensed under this + License, and if all works that were first published under this + License somewhere other than this MMC, and subsequently + incorporated in whole or in part into the MMC, (1) had no cover + texts or invariant sections, and (2) were thus incorporated prior + to November 1, 2008. + + The operator of an MMC Site may republish an MMC contained in the + site under CC-BY-SA on the same site at any time before August 1, + 2009, provided the MMC is eligible for relicensing. + +ADDENDUM: How to use this License for your documents +==================================================== + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + + If you have Invariant Sections, Front-Cover Texts and Back-Cover +Texts, replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with + the Front-Cover Texts being LIST, and with the Back-Cover Texts + being LIST. + + If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of free +software license, such as the GNU General Public License, to permit +their use in free software. + + +File: history.info, Node: Concept Index, Next: Function and Variable Index, Prev: GNU Free Documentation License, Up: Top + +Appendix B Concept Index +************************ + +[index] +* Menu: + +* anchored search: Searching the History List. + (line 10) +* event designators: Event Designators. (line 6) +* history events: Event Designators. (line 10) +* history expansion: History Interaction. (line 6) +* History Searching: Searching the History List. + (line 6) + + +File: history.info, Node: Function and Variable Index, Prev: Concept Index, Up: Top + +Appendix C Function and Variable Index +************************************** + +[index] +* Menu: + +* add_history: History List Management. + (line 9) +* add_history_time: History List Management. + (line 16) +* append_history: Managing the History File. + (line 35) +* clear_history: History List Management. + (line 39) +* current_history: Information About the History List. + (line 17) +* free_history_entry: History List Management. + (line 27) +* get_history_event: History Expansion. (line 26) +* history_arg_extract: History Expansion. (line 41) +* history_base: History Variables. (line 9) +* history_comment_char: History Variables. (line 37) +* history_expand: History Expansion. (line 8) +* history_expansion_char: History Variables. (line 29) +* history_get: Information About the History List. + (line 21) +* history_get_history_state: Initializing History and State Management. + (line 14) +* history_get_time: Information About the History List. + (line 28) +* history_inhibit_expansion_function: History Variables. (line 78) +* history_is_stifled: History List Management. + (line 52) +* history_length: History Variables. (line 12) +* history_list: Information About the History List. + (line 9) +* history_max_entries: History Variables. (line 15) +* history_no_expand_chars: History Variables. (line 52) +* history_quotes_inhibit_expansion: History Variables. (line 57) +* history_quoting_state: History Variables. (line 65) +* history_search: Searching the History List. + (line 11) +* history_search_delimiter_chars: History Variables. (line 47) +* history_search_pos: Searching the History List. + (line 30) +* history_search_prefix: Searching the History List. + (line 20) +* history_set_history_state: Initializing History and State Management. + (line 18) +* history_set_pos: Moving Around the History List. + (line 9) +* history_subst_char: History Variables. (line 33) +* history_tokenize: History Expansion. (line 35) +* history_total_bytes: Information About the History List. + (line 32) +* history_truncate_file: Managing the History File. + (line 42) +* history_word_delimiters: History Variables. (line 43) +* history_write_timestamps: History Variables. (line 19) +* next_history: Moving Around the History List. + (line 19) +* previous_history: Moving Around the History List. + (line 14) +* read_history: Managing the History File. + (line 9) +* read_history_range: Managing the History File. + (line 17) +* remove_history: History List Management. + (line 20) +* replace_history_entry: History List Management. + (line 32) +* stifle_history: History List Management. + (line 42) +* unstifle_history: History List Management. + (line 46) +* using_history: Initializing History and State Management. + (line 10) +* where_history: Information About the History List. + (line 14) +* write_history: Managing the History File. + (line 28) + + + +Tag Table: +Node: Top848 +Node: Using History Interactively1493 +Node: History Interaction2001 +Node: Event Designators4715 +Node: Word Designators6217 +Node: Modifiers8612 +Node: Programming with GNU History10259 +Node: Introduction to History11002 +Node: History Storage12734 +Node: History Functions13914 +Node: Initializing History and State Management14903 +Node: History List Management15706 +Node: Information About the History List18137 +Node: Moving Around the History List19750 +Node: Searching the History List20830 +Node: Managing the History File22776 +Node: History Expansion25246 +Node: History Variables27219 +Node: History Programming Example31334 +Node: GNU Free Documentation License33988 +Node: Concept Index59163 +Node: Function and Variable Index59868 + +End Tag Table + + +Local Variables: +coding: utf-8 +End: diff --git a/miniconda3/share/info/libffi.info b/miniconda3/share/info/libffi.info new file mode 100644 index 0000000000000000000000000000000000000000..6b9580ad68506e8d93928880cb01c372c3ad69ce --- /dev/null +++ b/miniconda3/share/info/libffi.info @@ -0,0 +1,1060 @@ +This is libffi.info, produced by makeinfo version 6.8 from libffi.texi. + +This manual is for libffi, a portable foreign function interface +library. + + Copyright (C) 2008-2019, 2021, 2022 Anthony Green and Red Hat, Inc. + + Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + + The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +INFO-DIR-SECTION Development +START-INFO-DIR-ENTRY +* libffi: (libffi). Portable foreign function interface library. +END-INFO-DIR-ENTRY + + +File: libffi.info, Node: Top, Next: Introduction, Up: (dir) + +libffi +****** + +This manual is for libffi, a portable foreign function interface +library. + + Copyright (C) 2008-2019, 2021, 2022 Anthony Green and Red Hat, Inc. + + Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + + The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +* Menu: + +* Introduction:: What is libffi? +* Using libffi:: How to use libffi. +* Memory Usage:: Where memory for closures comes from. +* Missing Features:: Things libffi can't do. +* Index:: Index. + + +File: libffi.info, Node: Introduction, Next: Using libffi, Prev: Top, Up: Top + +1 What is libffi? +***************** + +Compilers for high level languages generate code that follow certain +conventions. These conventions are necessary, in part, for separate +compilation to work. One such convention is the "calling convention". +The calling convention is a set of assumptions made by the compiler +about where function arguments will be found on entry to a function. A +calling convention also specifies where the return value for a function +is found. The calling convention is also sometimes called the "ABI" or +"Application Binary Interface". + + Some programs may not know at the time of compilation what arguments +are to be passed to a function. For instance, an interpreter may be +told at run-time about the number and types of arguments used to call a +given function. 'libffi' can be used in such programs to provide a +bridge from the interpreter program to compiled code. + + The 'libffi' library provides a portable, high level programming +interface to various calling conventions. This allows a programmer to +call any function specified by a call interface description at run time. + + FFI stands for Foreign Function Interface. A foreign function +interface is the popular name for the interface that allows code written +in one language to call code written in another language. The 'libffi' +library really only provides the lowest, machine dependent layer of a +fully featured foreign function interface. A layer must exist above +'libffi' that handles type conversions for values passed between the two +languages. + + +File: libffi.info, Node: Using libffi, Next: Memory Usage, Prev: Introduction, Up: Top + +2 Using libffi +************** + +* Menu: + +* The Basics:: The basic libffi API. +* Simple Example:: A simple example. +* Types:: libffi type descriptions. +* Multiple ABIs:: Different passing styles on one platform. +* The Closure API:: Writing a generic function. +* Closure Example:: A closure example. +* Thread Safety:: Thread safety. + + +File: libffi.info, Node: The Basics, Next: Simple Example, Up: Using libffi + +2.1 The Basics +============== + +'libffi' assumes that you have a pointer to the function you wish to +call and that you know the number and types of arguments to pass it, as +well as the return type of the function. + + The first thing you must do is create an 'ffi_cif' object that +matches the signature of the function you wish to call. This is a +separate step because it is common to make multiple calls using a single +'ffi_cif'. The "cif" in 'ffi_cif' stands for Call InterFace. To +prepare a call interface object, use the function 'ffi_prep_cif'. + + -- Function: ffi_status ffi_prep_cif (ffi_cif *CIF, ffi_abi ABI, + unsigned int NARGS, ffi_type *RTYPE, ffi_type **ARGTYPES) + This initializes CIF according to the given parameters. + + ABI is the ABI to use; normally 'FFI_DEFAULT_ABI' is what you want. + *note Multiple ABIs:: for more information. + + NARGS is the number of arguments that this function accepts. + + RTYPE is a pointer to an 'ffi_type' structure that describes the + return type of the function. *Note Types::. + + ARGTYPES is a vector of 'ffi_type' pointers. ARGTYPES must have + NARGS elements. If NARGS is 0, this argument is ignored. + + 'ffi_prep_cif' returns a 'libffi' status code, of type + 'ffi_status'. This will be either 'FFI_OK' if everything worked + properly; 'FFI_BAD_TYPEDEF' if one of the 'ffi_type' objects is + incorrect; or 'FFI_BAD_ABI' if the ABI parameter is invalid. + + If the function being called is variadic (varargs) then +'ffi_prep_cif_var' must be used instead of 'ffi_prep_cif'. + + -- Function: ffi_status ffi_prep_cif_var (ffi_cif *CIF, ffi_abi ABI, + unsigned int NFIXEDARGS, unsigned int NTOTALARGS, ffi_type + *RTYPE, ffi_type **ARGTYPES) + This initializes CIF according to the given parameters for a call + to a variadic function. In general its operation is the same as + for 'ffi_prep_cif' except that: + + NFIXEDARGS is the number of fixed arguments, prior to any variadic + arguments. It must be greater than zero. + + NTOTALARGS the total number of arguments, including variadic and + fixed arguments. ARGTYPES must have this many elements. + + 'ffi_prep_cif_var' will return 'FFI_BAD_ARGTYPE' if any of the + variable argument types are 'ffi_type_float' (promote to + 'ffi_type_double' first), or any integer type small than an int + (promote to an int-sized type first). + + Note that, different cif's must be prepped for calls to the same + function when different numbers of arguments are passed. + + Also note that a call to 'ffi_prep_cif_var' with + NFIXEDARGS=NOTOTALARGS is NOT equivalent to a call to + 'ffi_prep_cif'. + + Note that the resulting 'ffi_cif' holds pointers to all the +'ffi_type' objects that were used during initialization. You must +ensure that these type objects have a lifetime at least as long as that +of the 'ffi_cif'. + + To call a function using an initialized 'ffi_cif', use the 'ffi_call' +function: + + -- Function: void ffi_call (ffi_cif *CIF, void *FN, void *RVALUE, void + **AVALUES) + This calls the function FN according to the description given in + CIF. CIF must have already been prepared using 'ffi_prep_cif'. + + RVALUE is a pointer to a chunk of memory that will hold the result + of the function call. This must be large enough to hold the + result, no smaller than the system register size (generally 32 or + 64 bits), and must be suitably aligned; it is the caller's + responsibility to ensure this. If CIF declares that the function + returns 'void' (using 'ffi_type_void'), then RVALUE is ignored. + + In most situations, 'libffi' will handle promotion according to the + ABI. However, for historical reasons, there is a special case with + return values that must be handled by your code. In particular, + for integral (not 'struct') types that are narrower than the system + register size, the return value will be widened by 'libffi'. + 'libffi' provides a type, 'ffi_arg', that can be used as the return + type. For example, if the CIF was defined with a return type of + 'char', 'libffi' will try to store a full 'ffi_arg' into the return + value. + + AVALUES is a vector of 'void *' pointers that point to the memory + locations holding the argument values for a call. If CIF declares + that the function has no arguments (i.e., NARGS was 0), then + AVALUES is ignored. + + Note that while the return value must be register-sized, arguments + should exactly match their declared type. For example, if an + argument is a 'short', then the entry in AVALUES should point to an + object declared as 'short'; but if the return type is 'short', then + RVALUE should point to an object declared as a larger type - + usually 'ffi_arg'. + + +File: libffi.info, Node: Simple Example, Next: Types, Prev: The Basics, Up: Using libffi + +2.2 Simple Example +================== + +Here is a trivial example that calls 'puts' a few times. + + #include + #include + + int main() + { + ffi_cif cif; + ffi_type *args[1]; + void *values[1]; + char *s; + ffi_arg rc; + + /* Initialize the argument info vectors */ + args[0] = &ffi_type_pointer; + values[0] = &s; + + /* Initialize the cif */ + if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_sint, args) == FFI_OK) + { + s = "Hello World!"; + ffi_call(&cif, puts, &rc, values); + /* rc now holds the result of the call to puts */ + + /* values holds a pointer to the function's arg, so to + call puts() again all we need to do is change the + value of s */ + s = "This is cool!"; + ffi_call(&cif, puts, &rc, values); + } + + return 0; + } + + +File: libffi.info, Node: Types, Next: Multiple ABIs, Prev: Simple Example, Up: Using libffi + +2.3 Types +========= + +* Menu: + +* Primitive Types:: Built-in types. +* Structures:: Structure types. +* Size and Alignment:: Size and alignment of types. +* Arrays Unions Enums:: Arrays, unions, and enumerations. +* Type Example:: Structure type example. +* Complex:: Complex types. +* Complex Type Example:: Complex type example. + + +File: libffi.info, Node: Primitive Types, Next: Structures, Up: Types + +2.3.1 Primitive Types +--------------------- + +'Libffi' provides a number of built-in type descriptors that can be used +to describe argument and return types: + +'ffi_type_void' + The type 'void'. This cannot be used for argument types, only for + return values. + +'ffi_type_uint8' + An unsigned, 8-bit integer type. + +'ffi_type_sint8' + A signed, 8-bit integer type. + +'ffi_type_uint16' + An unsigned, 16-bit integer type. + +'ffi_type_sint16' + A signed, 16-bit integer type. + +'ffi_type_uint32' + An unsigned, 32-bit integer type. + +'ffi_type_sint32' + A signed, 32-bit integer type. + +'ffi_type_uint64' + An unsigned, 64-bit integer type. + +'ffi_type_sint64' + A signed, 64-bit integer type. + +'ffi_type_float' + The C 'float' type. + +'ffi_type_double' + The C 'double' type. + +'ffi_type_uchar' + The C 'unsigned char' type. + +'ffi_type_schar' + The C 'signed char' type. (Note that there is not an exact + equivalent to the C 'char' type in 'libffi'; ordinarily you should + either use 'ffi_type_schar' or 'ffi_type_uchar' depending on + whether 'char' is signed.) + +'ffi_type_ushort' + The C 'unsigned short' type. + +'ffi_type_sshort' + The C 'short' type. + +'ffi_type_uint' + The C 'unsigned int' type. + +'ffi_type_sint' + The C 'int' type. + +'ffi_type_ulong' + The C 'unsigned long' type. + +'ffi_type_slong' + The C 'long' type. + +'ffi_type_longdouble' + On platforms that have a C 'long double' type, this is defined. On + other platforms, it is not. + +'ffi_type_pointer' + A generic 'void *' pointer. You should use this for all pointers, + regardless of their real type. + +'ffi_type_complex_float' + The C '_Complex float' type. + +'ffi_type_complex_double' + The C '_Complex double' type. + +'ffi_type_complex_longdouble' + The C '_Complex long double' type. On platforms that have a C + 'long double' type, this is defined. On other platforms, it is + not. + + Each of these is of type 'ffi_type', so you must take the address +when passing to 'ffi_prep_cif'. + + +File: libffi.info, Node: Structures, Next: Size and Alignment, Prev: Primitive Types, Up: Types + +2.3.2 Structures +---------------- + +'libffi' is perfectly happy passing structures back and forth. You must +first describe the structure to 'libffi' by creating a new 'ffi_type' +object for it. + + -- Data type: ffi_type + The 'ffi_type' has the following members: + 'size_t size' + This is set by 'libffi'; you should initialize it to zero. + + 'unsigned short alignment' + This is set by 'libffi'; you should initialize it to zero. + + 'unsigned short type' + For a structure, this should be set to 'FFI_TYPE_STRUCT'. + + 'ffi_type **elements' + This is a 'NULL'-terminated array of pointers to 'ffi_type' + objects. There is one element per field of the struct. + + Note that 'libffi' has no special support for bit-fields. You + must manage these manually. + + The 'size' and 'alignment' fields will be filled in by 'ffi_prep_cif' +or 'ffi_prep_cif_var', as needed. + + +File: libffi.info, Node: Size and Alignment, Next: Arrays Unions Enums, Prev: Structures, Up: Types + +2.3.3 Size and Alignment +------------------------ + +'libffi' will set the 'size' and 'alignment' fields of an 'ffi_type' +object for you. It does so using its knowledge of the ABI. + + You might expect that you can simply read these fields for a type +that has been laid out by 'libffi'. However, there are some caveats. + + * The size or alignment of some of the built-in types may vary + depending on the chosen ABI. + + * The size and alignment of a new structure type will not be set by + 'libffi' until it has been passed to 'ffi_prep_cif' or + 'ffi_get_struct_offsets'. + + * A structure type cannot be shared across ABIs. Instead each ABI + needs its own copy of the structure type. + + So, before examining these fields, it is safest to pass the +'ffi_type' object to 'ffi_prep_cif' or 'ffi_get_struct_offsets' first. +This function will do all the needed setup. + + ffi_type *desired_type; + ffi_abi desired_abi; + ... + ffi_cif cif; + if (ffi_prep_cif (&cif, desired_abi, 0, desired_type, NULL) == FFI_OK) + { + size_t size = desired_type->size; + unsigned short alignment = desired_type->alignment; + } + + 'libffi' also provides a way to get the offsets of the members of a +structure. + + -- Function: ffi_status ffi_get_struct_offsets (ffi_abi abi, ffi_type + *struct_type, size_t *offsets) + Compute the offset of each element of the given structure type. + ABI is the ABI to use; this is needed because in some cases the + layout depends on the ABI. + + OFFSETS is an out parameter. The caller is responsible for + providing enough space for all the results to be written - one + element per element type in STRUCT_TYPE. If OFFSETS is 'NULL', + then the type will be laid out but not otherwise modified. This + can be useful for accessing the type's size or layout, as mentioned + above. + + This function returns 'FFI_OK' on success; 'FFI_BAD_ABI' if ABI is + invalid; or 'FFI_BAD_TYPEDEF' if STRUCT_TYPE is invalid in some + way. Note that only 'FFI_STRUCT' types are valid here. + + +File: libffi.info, Node: Arrays Unions Enums, Next: Type Example, Prev: Size and Alignment, Up: Types + +2.3.4 Arrays, Unions, and Enumerations +-------------------------------------- + +2.3.4.1 Arrays +.............. + +'libffi' does not have direct support for arrays or unions. However, +they can be emulated using structures. + + To emulate an array, simply create an 'ffi_type' using +'FFI_TYPE_STRUCT' with as many members as there are elements in the +array. + + ffi_type array_type; + ffi_type **elements + int i; + + elements = malloc ((n + 1) * sizeof (ffi_type *)); + for (i = 0; i < n; ++i) + elements[i] = array_element_type; + elements[n] = NULL; + + array_type.size = array_type.alignment = 0; + array_type.type = FFI_TYPE_STRUCT; + array_type.elements = elements; + + Note that arrays cannot be passed or returned by value in C - +structure types created like this should only be used to refer to +members of real 'FFI_TYPE_STRUCT' objects. + + However, a phony array type like this will not cause any errors from +'libffi' if you use it as an argument or return type. This may be +confusing. + +2.3.4.2 Unions +.............. + +A union can also be emulated using 'FFI_TYPE_STRUCT'. In this case, +however, you must make sure that the size and alignment match the real +requirements of the union. + + One simple way to do this is to ensue that each element type is laid +out. Then, give the new structure type a single element; the size of +the largest element; and the largest alignment seen as well. + + This example uses the 'ffi_prep_cif' trick to ensure that each +element type is laid out. + + ffi_abi desired_abi; + ffi_type union_type; + ffi_type **union_elements; + + int i; + ffi_type element_types[2]; + + element_types[1] = NULL; + + union_type.size = union_type.alignment = 0; + union_type.type = FFI_TYPE_STRUCT; + union_type.elements = element_types; + + for (i = 0; union_elements[i]; ++i) + { + ffi_cif cif; + if (ffi_prep_cif (&cif, desired_abi, 0, union_elements[i], NULL) == FFI_OK) + { + if (union_elements[i]->size > union_type.size) + { + union_type.size = union_elements[i]; + size = union_elements[i]->size; + } + if (union_elements[i]->alignment > union_type.alignment) + union_type.alignment = union_elements[i]->alignment; + } + } + +2.3.4.3 Enumerations +.................... + +'libffi' does not have any special support for C 'enum's. Although any +given 'enum' is implemented using a specific underlying integral type, +exactly which type will be used cannot be determined by 'libffi' - it +may depend on the values in the enumeration or on compiler flags such as +'-fshort-enums'. *Note (gcc)Structures unions enumerations and +bit-fields implementation::, for more information about how GCC handles +enumerations. + + +File: libffi.info, Node: Type Example, Next: Complex, Prev: Arrays Unions Enums, Up: Types + +2.3.5 Type Example +------------------ + +The following example initializes a 'ffi_type' object representing the +'tm' struct from Linux's 'time.h'. + + Here is how the struct is defined: + + struct tm { + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; + int tm_yday; + int tm_isdst; + /* Those are for future use. */ + long int __tm_gmtoff__; + __const char *__tm_zone__; + }; + + Here is the corresponding code to describe this struct to 'libffi': + + { + ffi_type tm_type; + ffi_type *tm_type_elements[12]; + int i; + + tm_type.size = tm_type.alignment = 0; + tm_type.type = FFI_TYPE_STRUCT; + tm_type.elements = &tm_type_elements; + + for (i = 0; i < 9; i++) + tm_type_elements[i] = &ffi_type_sint; + + tm_type_elements[9] = &ffi_type_slong; + tm_type_elements[10] = &ffi_type_pointer; + tm_type_elements[11] = NULL; + + /* tm_type can now be used to represent tm argument types and + return types for ffi_prep_cif() */ + } + + +File: libffi.info, Node: Complex, Next: Complex Type Example, Prev: Type Example, Up: Types + +2.3.6 Complex Types +------------------- + +'libffi' supports the complex types defined by the C99 standard +('_Complex float', '_Complex double' and '_Complex long double' with the +built-in type descriptors 'ffi_type_complex_float', +'ffi_type_complex_double' and 'ffi_type_complex_longdouble'. + + Custom complex types like '_Complex int' can also be used. An +'ffi_type' object has to be defined to describe the complex type to +'libffi'. + + -- Data type: ffi_type + 'size_t size' + This must be manually set to the size of the complex type. + + 'unsigned short alignment' + This must be manually set to the alignment of the complex + type. + + 'unsigned short type' + For a complex type, this must be set to 'FFI_TYPE_COMPLEX'. + + 'ffi_type **elements' + + This is a 'NULL'-terminated array of pointers to 'ffi_type' + objects. The first element is set to the 'ffi_type' of the + complex's base type. The second element must be set to + 'NULL'. + + The section *note Complex Type Example:: shows a way to determine the +'size' and 'alignment' members in a platform independent way. + + For platforms that have no complex support in 'libffi' yet, the +functions 'ffi_prep_cif' and 'ffi_prep_args' abort the program if they +encounter a complex type. + + +File: libffi.info, Node: Complex Type Example, Prev: Complex, Up: Types + +2.3.7 Complex Type Example +-------------------------- + +This example demonstrates how to use complex types: + + #include + #include + #include + + void complex_fn(_Complex float cf, + _Complex double cd, + _Complex long double cld) + { + printf("cf=%f+%fi\ncd=%f+%fi\ncld=%f+%fi\n", + (float)creal (cf), (float)cimag (cf), + (float)creal (cd), (float)cimag (cd), + (float)creal (cld), (float)cimag (cld)); + } + + int main() + { + ffi_cif cif; + ffi_type *args[3]; + void *values[3]; + _Complex float cf; + _Complex double cd; + _Complex long double cld; + + /* Initialize the argument info vectors */ + args[0] = &ffi_type_complex_float; + args[1] = &ffi_type_complex_double; + args[2] = &ffi_type_complex_longdouble; + values[0] = &cf; + values[1] = &cd; + values[2] = &cld; + + /* Initialize the cif */ + if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 3, + &ffi_type_void, args) == FFI_OK) + { + cf = 1.0 + 20.0 * I; + cd = 300.0 + 4000.0 * I; + cld = 50000.0 + 600000.0 * I; + /* Call the function */ + ffi_call(&cif, (void (*)(void))complex_fn, 0, values); + } + + return 0; + } + + This is an example for defining a custom complex type descriptor for +compilers that support them: + + /* + * This macro can be used to define new complex type descriptors + * in a platform independent way. + * + * name: Name of the new descriptor is ffi_type_complex_. + * type: The C base type of the complex type. + */ + #define FFI_COMPLEX_TYPEDEF(name, type, ffitype) \ + static ffi_type *ffi_elements_complex_##name [2] = { \ + (ffi_type *)(&ffitype), NULL \ + }; \ + struct struct_align_complex_##name { \ + char c; \ + _Complex type x; \ + }; \ + ffi_type ffi_type_complex_##name = { \ + sizeof(_Complex type), \ + offsetof(struct struct_align_complex_##name, x), \ + FFI_TYPE_COMPLEX, \ + (ffi_type **)ffi_elements_complex_##name \ + } + + /* Define new complex type descriptors using the macro: */ + /* ffi_type_complex_sint */ + FFI_COMPLEX_TYPEDEF(sint, int, ffi_type_sint); + /* ffi_type_complex_uchar */ + FFI_COMPLEX_TYPEDEF(uchar, unsigned char, ffi_type_uint8); + + The new type descriptors can then be used like one of the built-in +type descriptors in the previous example. + + +File: libffi.info, Node: Multiple ABIs, Next: The Closure API, Prev: Types, Up: Using libffi + +2.4 Multiple ABIs +================= + +A given platform may provide multiple different ABIs at once. For +instance, the x86 platform has both 'stdcall' and 'fastcall' functions. + + 'libffi' provides some support for this. However, this is +necessarily platform-specific. + + +File: libffi.info, Node: The Closure API, Next: Closure Example, Prev: Multiple ABIs, Up: Using libffi + +2.5 The Closure API +=================== + +'libffi' also provides a way to write a generic function - a function +that can accept and decode any combination of arguments. This can be +useful when writing an interpreter, or to provide wrappers for arbitrary +functions. + + This facility is called the "closure API". Closures are not supported +on all platforms; you can check the 'FFI_CLOSURES' define to determine +whether they are supported on the current platform. + + Because closures work by assembling a tiny function at runtime, they +require special allocation on platforms that have a non-executable heap. +Memory management for closures is handled by a pair of functions: + + -- Function: void *ffi_closure_alloc (size_t SIZE, void **CODE) + Allocate a chunk of memory holding SIZE bytes. This returns a + pointer to the writable address, and sets *CODE to the + corresponding executable address. + + SIZE should be sufficient to hold a 'ffi_closure' object. + + -- Function: void ffi_closure_free (void *WRITABLE) + Free memory allocated using 'ffi_closure_alloc'. The argument is + the writable address that was returned. + + Once you have allocated the memory for a closure, you must construct +a 'ffi_cif' describing the function call. Finally you can prepare the +closure function: + + -- Function: ffi_status ffi_prep_closure_loc (ffi_closure *CLOSURE, + ffi_cif *CIF, void (*FUN) (ffi_cif *CIF, void *RET, void + **ARGS, void *USER_DATA), void *USER_DATA, void *CODELOC) + Prepare a closure function. The arguments to + 'ffi_prep_closure_loc' are: + + CLOSURE + The address of a 'ffi_closure' object; this is the writable + address returned by 'ffi_closure_alloc'. + + CIF + The 'ffi_cif' describing the function parameters. Note that + this object, and the types to which it refers, must be kept + alive until the closure itself is freed. + + USER_DATA + An arbitrary datum that is passed, uninterpreted, to your + closure function. + + CODELOC + The executable address returned by 'ffi_closure_alloc'. + + FUN + The function which will be called when the closure is invoked. + It is called with the arguments: + + CIF + The 'ffi_cif' passed to 'ffi_prep_closure_loc'. + + RET + A pointer to the memory used for the function's return + value. + + If the function is declared as returning 'void', then + this value is garbage and should not be used. + + Otherwise, FUN must fill the object to which this points, + following the same special promotion behavior as + 'ffi_call'. That is, in most cases, RET points to an + object of exactly the size of the type specified when CIF + was constructed. However, integral types narrower than + the system register size are widened. In these cases + your program may assume that RET points to an 'ffi_arg' + object. + + ARGS + A vector of pointers to memory holding the arguments to + the function. + + USER_DATA + The same USER_DATA that was passed to + 'ffi_prep_closure_loc'. + + 'ffi_prep_closure_loc' will return 'FFI_OK' if everything went ok, + and one of the other 'ffi_status' values on error. + + After calling 'ffi_prep_closure_loc', you can cast CODELOC to the + appropriate pointer-to-function type. + + You may see old code referring to 'ffi_prep_closure'. This function +is deprecated, as it cannot handle the need for separate writable and +executable addresses. + + +File: libffi.info, Node: Closure Example, Next: Thread Safety, Prev: The Closure API, Up: Using libffi + +2.6 Closure Example +=================== + +A trivial example that creates a new 'puts' by binding 'fputs' with +'stdout'. + + #include + #include + + /* Acts like puts with the file given at time of enclosure. */ + void puts_binding(ffi_cif *cif, void *ret, void* args[], + void *stream) + { + *(ffi_arg *)ret = fputs(*(char **)args[0], (FILE *)stream); + } + + typedef int (*puts_t)(char *); + + int main() + { + ffi_cif cif; + ffi_type *args[1]; + ffi_closure *closure; + + void *bound_puts; + int rc; + + /* Allocate closure and bound_puts */ + closure = ffi_closure_alloc(sizeof(ffi_closure), &bound_puts); + + if (closure) + { + /* Initialize the argument info vectors */ + args[0] = &ffi_type_pointer; + + /* Initialize the cif */ + if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_sint, args) == FFI_OK) + { + /* Initialize the closure, setting stream to stdout */ + if (ffi_prep_closure_loc(closure, &cif, puts_binding, + stdout, bound_puts) == FFI_OK) + { + rc = ((puts_t)bound_puts)("Hello World!"); + /* rc now holds the result of the call to fputs */ + } + } + } + + /* Deallocate both closure, and bound_puts */ + ffi_closure_free(closure); + + return 0; + } + + + +File: libffi.info, Node: Thread Safety, Prev: Closure Example, Up: Using libffi + +2.7 Thread Safety +================= + +'libffi' is not completely thread-safe. However, many parts are, and if +you follow some simple rules, you can use it safely in a multi-threaded +program. + + * 'ffi_prep_cif' may modify the 'ffi_type' objects passed to it. It + is best to ensure that only a single thread prepares a given + 'ffi_cif' at a time. + + * On some platforms, 'ffi_prep_cif' may modify the size and alignment + of some types, depending on the chosen ABI. On these platforms, if + you switch between ABIs, you must ensure that there is only one + call to 'ffi_prep_cif' at a time. + + Currently the only affected platform is PowerPC and the only + affected type is 'long double'. + + +File: libffi.info, Node: Memory Usage, Next: Missing Features, Prev: Using libffi, Up: Top + +3 Memory Usage +************** + +Note that memory allocated by 'ffi_closure_alloc' and freed by +'ffi_closure_free' does not come from the same general pool of memory +that 'malloc' and 'free' use. To accomodate security settings, 'libffi' +may aquire memory, for example, by mapping temporary files into multiple +places in the address space (once to write out the closure, a second to +execute it). The search follows this list, using the first that works: + + * A anonymous mapping (i.e. not file-backed) + + * 'memfd_create()', if the kernel supports it. + + * A file created in the directory referenced by the environment + variable 'LIBFFI_TMPDIR'. + + * Likewise for the environment variable 'TMPDIR'. + + * A file created in '/tmp'. + + * A file created in '/var/tmp'. + + * A file created in '/dev/shm'. + + * A file created in the user's home directory ('$HOME'). + + * A file created in any directory listed in '/etc/mtab'. + + * A file created in any directory listed in '/proc/mounts'. + + If security settings prohibit using any of these for closures, +'ffi_closure_alloc' will fail. + + +File: libffi.info, Node: Missing Features, Next: Index, Prev: Memory Usage, Up: Top + +4 Missing Features +****************** + +'libffi' is missing a few features. We welcome patches to add support +for these. + + * Variadic closures. + + * There is no support for bit fields in structures. + + * The "raw" API is undocumented. + + * The Go API is undocumented. + + +File: libffi.info, Node: Index, Prev: Missing Features, Up: Top + +Index +***** + +[index] +* Menu: + +* ABI: Introduction. (line 13) +* Application Binary Interface: Introduction. (line 13) +* calling convention: Introduction. (line 13) +* cif: The Basics. (line 14) +* closure API: The Closure API. (line 13) +* closures: The Closure API. (line 13) +* FFI: Introduction. (line 31) +* ffi_call: The Basics. (line 72) +* FFI_CLOSURES: The Closure API. (line 13) +* ffi_closure_alloc: The Closure API. (line 19) +* ffi_closure_free: The Closure API. (line 26) +* ffi_get_struct_offsets: Size and Alignment. (line 39) +* ffi_prep_cif: The Basics. (line 16) +* ffi_prep_cif_var: The Basics. (line 39) +* ffi_prep_closure_loc: The Closure API. (line 34) +* ffi_status: The Basics. (line 16) +* ffi_status <1>: The Basics. (line 39) +* ffi_status <2>: Size and Alignment. (line 39) +* ffi_status <3>: The Closure API. (line 34) +* ffi_type: Structures. (line 10) +* ffi_type <1>: Structures. (line 10) +* ffi_type <2>: Complex. (line 15) +* ffi_type <3>: Complex. (line 15) +* ffi_type_complex_double: Primitive Types. (line 82) +* ffi_type_complex_float: Primitive Types. (line 79) +* ffi_type_complex_longdouble: Primitive Types. (line 85) +* ffi_type_double: Primitive Types. (line 41) +* ffi_type_float: Primitive Types. (line 38) +* ffi_type_longdouble: Primitive Types. (line 71) +* ffi_type_pointer: Primitive Types. (line 75) +* ffi_type_schar: Primitive Types. (line 47) +* ffi_type_sint: Primitive Types. (line 62) +* ffi_type_sint16: Primitive Types. (line 23) +* ffi_type_sint32: Primitive Types. (line 29) +* ffi_type_sint64: Primitive Types. (line 35) +* ffi_type_sint8: Primitive Types. (line 17) +* ffi_type_slong: Primitive Types. (line 68) +* ffi_type_sshort: Primitive Types. (line 56) +* ffi_type_uchar: Primitive Types. (line 44) +* ffi_type_uint: Primitive Types. (line 59) +* ffi_type_uint16: Primitive Types. (line 20) +* ffi_type_uint32: Primitive Types. (line 26) +* ffi_type_uint64: Primitive Types. (line 32) +* ffi_type_uint8: Primitive Types. (line 14) +* ffi_type_ulong: Primitive Types. (line 65) +* ffi_type_ushort: Primitive Types. (line 53) +* ffi_type_void: Primitive Types. (line 10) +* Foreign Function Interface: Introduction. (line 31) +* void: The Basics. (line 72) +* void <1>: The Closure API. (line 19) +* void <2>: The Closure API. (line 26) + + + +Tag Table: +Node: Top1400 +Node: Introduction2935 +Node: Using libffi4567 +Node: The Basics5096 +Node: Simple Example10024 +Node: Types11055 +Node: Primitive Types11566 +Node: Structures13687 +Node: Size and Alignment14726 +Node: Arrays Unions Enums16923 +Node: Type Example19852 +Node: Complex21143 +Node: Complex Type Example22561 +Node: Multiple ABIs25613 +Node: The Closure API25984 +Node: Closure Example29810 +Node: Thread Safety31442 +Node: Memory Usage32243 +Node: Missing Features33438 +Node: Index33803 + +End Tag Table + + +Local Variables: +coding: utf-8 +End: diff --git a/miniconda3/share/info/libgomp.info b/miniconda3/share/info/libgomp.info new file mode 100644 index 0000000000000000000000000000000000000000..52357ea6f6a97cedb7a214be13468bc67483af61 --- /dev/null +++ b/miniconda3/share/info/libgomp.info @@ -0,0 +1,8676 @@ +This is libgomp.info, produced by makeinfo version 6.5 from +libgomp.texi. + +Copyright (C) 2006-2025 Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 or +any later version published by the Free Software Foundation; with the +Invariant Sections being "Funding Free Software", the Front-Cover texts +being (a) (see below), and with the Back-Cover Texts being (b) (see +below). A copy of the license is included in the section entitled "GNU +Free Documentation License". + + (a) The FSF's Front-Cover Text is: + + A GNU Manual + + (b) The FSF's Back-Cover Text is: + + You have freedom to copy and modify this GNU Manual, like GNU +software. Copies published by the Free Software Foundation raise funds +for GNU development. +INFO-DIR-SECTION GNU Libraries +START-INFO-DIR-ENTRY +* libgomp: (libgomp). GNU Offloading and Multi Processing Runtime Library. +END-INFO-DIR-ENTRY + + This manual documents libgomp, the GNU Offloading and Multi +Processing Runtime library. This is the GNU implementation of the +OpenMP and OpenACC APIs for parallel and accelerator programming in +C/C++ and Fortran. + + Published by the Free Software Foundation 51 Franklin Street, Fifth +Floor Boston, MA 02110-1301 USA + + Copyright (C) 2006-2025 Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 or +any later version published by the Free Software Foundation; with the +Invariant Sections being "Funding Free Software", the Front-Cover texts +being (a) (see below), and with the Back-Cover Texts being (b) (see +below). A copy of the license is included in the section entitled "GNU +Free Documentation License". + + (a) The FSF's Front-Cover Text is: + + A GNU Manual + + (b) The FSF's Back-Cover Text is: + + You have freedom to copy and modify this GNU Manual, like GNU +software. Copies published by the Free Software Foundation raise funds +for GNU development. + + +File: libgomp.info, Node: Top, Next: Enabling OpenMP + +Introduction +************ + +This manual documents the usage of libgomp, the GNU Offloading and Multi +Processing Runtime Library. This includes the GNU implementation of the +OpenMP (https://www.openmp.org) Application Programming Interface (API) +for multi-platform shared-memory parallel programming in C/C++ and +Fortran, and the GNU implementation of the OpenACC +(https://www.openacc.org) Application Programming Interface (API) for +offloading of code to accelerator devices in C/C++ and Fortran. + + Originally, libgomp implemented the GNU OpenMP Runtime Library. +Based on this, support for OpenACC and offloading (both OpenACC and +OpenMP 4's target construct) has been added later on, and the library's +name changed to GNU Offloading and Multi Processing Runtime Library. + +* Menu: + +* Enabling OpenMP:: How to enable OpenMP for your applications. +* OpenMP Implementation Status:: List of implemented features by OpenMP version +* OpenMP Runtime Library Routines: Runtime Library Routines. + The OpenMP runtime application programming + interface. +* OpenMP Environment Variables: Environment Variables. + Influencing OpenMP runtime behavior with + environment variables. +* Enabling OpenACC:: How to enable OpenACC for your + applications. +* OpenACC Runtime Library Routines:: The OpenACC runtime application + programming interface. +* OpenACC Environment Variables:: Influencing OpenACC runtime behavior with + environment variables. +* CUDA Streams Usage:: Notes on the implementation of + asynchronous operations. +* OpenACC Library Interoperability:: OpenACC library interoperability with the + NVIDIA CUBLAS library. +* OpenACC Profiling Interface:: +* OpenMP-Implementation Specifics:: Notes specifics of this OpenMP + implementation +* Offload-Target Specifics:: Notes on offload-target specific internals +* The libgomp ABI:: Notes on the external ABI presented by libgomp. +* Reporting Bugs:: How to report bugs in the GNU Offloading and + Multi Processing Runtime Library. +* Copying:: GNU general public license says + how you can copy and share libgomp. +* GNU Free Documentation License:: + How you can copy and share this manual. +* Funding:: How to help assure continued work for free + software. +* Library Index:: Index of this documentation. + + +File: libgomp.info, Node: Enabling OpenMP, Next: OpenMP Implementation Status, Up: Top + +1 Enabling OpenMP +***************** + +To activate the OpenMP extensions for C/C++ and Fortran, the +compile-time flag '-fopenmp' must be specified. For C and C++, this +enables the handling of the OpenMP directives using '#pragma omp' and +the '[[omp::directive(...)]]', '[[omp::sequence(...)]]' and +'[[omp::decl(...)]]' attributes. For Fortran, it enables for free +source form the '!$omp' sentinel for directives and the '!$' conditional +compilation sentinel and for fixed source form the 'c$omp', '*$omp' and +'!$omp' sentinels for directives and the 'c$', '*$' and '!$' conditional +compilation sentinels. The flag also arranges for automatic linking of +the OpenMP runtime library (*note Runtime Library Routines::). + + The '-fopenmp-simd' flag can be used to enable a subset of OpenMP +directives that do not require the linking of either the OpenMP runtime +library or the POSIX threads library. + + A complete description of all OpenMP directives may be found in the +OpenMP Application Program Interface (https://www.openmp.org) manuals. +See also *note OpenMP Implementation Status::. + + +File: libgomp.info, Node: OpenMP Implementation Status, Next: Runtime Library Routines, Prev: Enabling OpenMP, Up: Top + +2 OpenMP Implementation Status +****************************** + +* Menu: + +* OpenMP 4.5:: Feature completion status to 4.5 specification +* OpenMP 5.0:: Feature completion status to 5.0 specification +* OpenMP 5.1:: Feature completion status to 5.1 specification +* OpenMP 5.2:: Feature completion status to 5.2 specification +* OpenMP 6.0:: Feature completion status to 6.0 specification + +The '_OPENMP' preprocessor macro and Fortran's 'openmp_version' +parameter, provided by 'omp_lib.h' and the 'omp_lib' module, have the +value '201511' (i.e. OpenMP 4.5). + + +File: libgomp.info, Node: OpenMP 4.5, Next: OpenMP 5.0, Up: OpenMP Implementation Status + +2.1 OpenMP 4.5 +============== + +The OpenMP 4.5 specification is fully supported. + + +File: libgomp.info, Node: OpenMP 5.0, Next: OpenMP 5.1, Prev: OpenMP 4.5, Up: OpenMP Implementation Status + +2.2 OpenMP 5.0 +============== + +New features listed in Appendix B of the OpenMP specification +------------------------------------------------------------- + +Description Status Comments +----------------------------------------------------------------------- +Array shaping N +Array sections with non-unit strides in C N +and C++ +Iterators Y +'metadirective' directive Y +'declare variant' directive Y +TARGET-OFFLOAD-VAR ICV and Y +'OMP_TARGET_OFFLOAD' env variable +Nested-parallel changes to Y +MAX-ACTIVE-LEVELS-VAR ICV +'requires' directive Y See also + *note Offload-Target Specifics:: +'teams' construct outside an enclosing Y +target region +Non-rectangular loop nests P Full support for + C/C++, partial + for Fortran + (PR110735 + (https://gcc.gnu.org/PR110735)) +'!=' as relational-op in canonical loop Y +form for C/C++ +'nonmonotonic' as default loop schedule Y +modifier for worksharing-loop constructs +Collapse of associated loops that are Y +imperfectly nested loops +Clauses 'if', 'nontemporal' and Y +'order(concurrent)' in 'simd' construct +'atomic' constructs in 'simd' Y +'loop' construct Y +'order(concurrent)' clause Y +'scan' directive and 'in_scan' modifier Y +for the 'reduction' clause +'in_reduction' clause on 'task' Y +constructs +'in_reduction' clause on 'target' P 'nowait' only +constructs stub +'task_reduction' clause with 'taskgroup' Y +'task' modifier to 'reduction' clause Y +'affinity' clause to 'task' construct Y Stub only +'detach' clause to 'task' construct Y +'omp_fulfill_event' runtime routine Y +'reduction' and 'in_reduction' clauses on Y +'taskloop' and 'taskloop simd' constructs +'taskloop' construct cancelable by Y +'cancel' construct +'mutexinoutset' _dependence-type_ for Y +'depend' clause +Predefined memory spaces, memory Y See also +allocators, allocator traits *note Memory allocation:: +Memory management routines Y +'allocate' directive P C++ unsupported; + see also + *note Memory allocation:: +'allocate' clause P Clause has no + effect on + 'target' + (PR113436 + (https://gcc.gnu.org/PR113436)) +'use_device_addr' clause on 'target data' Y +'ancestor' modifier on 'device' clause Y +Implicit declare target directive Y +Discontiguous array section with 'target N +update' construct +C/C++'s lvalue expressions in 'to', Y +'from' and 'map' clauses +C/C++'s lvalue expressions in 'depend' Y +clauses +Nested 'declare target' directive Y +Combined 'master' constructs Y +'depend' clause on 'taskwait' Y +Weak memory ordering clauses on 'atomic' Y +and 'flush' construct +'hint' clause on the 'atomic' construct Y Stub only +'depobj' construct and depend objects Y +Lock hints were renamed to Y +synchronization hints +'conditional' modifier to 'lastprivate' Y +clause +Map-order clarifications P +'close' _map-type-modifier_ Y +Mapping C/C++ pointer variables and to P +assign the address of device memory +mapped by an array section +Mapping of Fortran pointer and Y +allocatable variables, including pointer +and allocatable components of variables +'defaultmap' extensions Y +'declare mapper' directive N +'omp_get_supported_active_levels' routine Y +Runtime routines and environment Y +variables to display runtime thread +affinity information +'omp_pause_resource' and Y +'omp_pause_resource_all' runtime routines +'omp_get_device_num' runtime routine Y +OMPT interface N +OMPD interface N + +Other new OpenMP 5.0 features +----------------------------- + +Description Status Comments +----------------------------------------------------------------------- +Supporting C++'s range-based for loop Y + + +File: libgomp.info, Node: OpenMP 5.1, Next: OpenMP 5.2, Prev: OpenMP 5.0, Up: OpenMP Implementation Status + +2.3 OpenMP 5.1 +============== + +New features listed in Appendix B of the OpenMP specification +------------------------------------------------------------- + +Description Status Comments +----------------------------------------------------------------------- +OpenMP directive as C++ attribute Y +specifiers +'omp_all_memory' reserved locator Y +_target_device trait_ in OpenMP Context Y +'target_device' selector set in context Y +selectors +C/C++'s 'declare variant' directive: N +elision support of preprocessed code +'declare variant': new clauses Y +'adjust_args' and 'append_args' +'dispatch' construct Y +device-specific ICV settings with Y +environment variables +'assume' and 'assumes' directives Y +'nothing' directive Y +'error' directive Y +'masked' construct Y +'scope' directive Y +Loop transformation constructs Y +'strict' modifier in the 'grainsize' and Y +'num_tasks' clauses of the 'taskloop' +construct +'align' clause in 'allocate' directive P Only C and + Fortran +'align' modifier in 'allocate' clause Y +'thread_limit' clause to 'target' Y +construct +'has_device_addr' clause to 'target' Y +construct +Iterators in 'target update' motion N +clauses and 'map' clauses +Indirect calls to the device version of a Y +procedure or function in 'target' regions +'interop' directive Y Cf. + *note Offload-Target Specifics:: +'omp_interop_t' object support in runtime Y +routines +'nowait' clause in 'taskwait' directive Y +Extensions to the 'atomic' directive Y +'seq_cst' clause on a 'flush' construct Y +'inoutset' argument to the 'depend' Y +clause +'private' and 'firstprivate' argument to Y +'default' clause in C and C++ +'present' argument to 'defaultmap' clause Y +'omp_set_num_teams', Y +'omp_set_teams_thread_limit', +'omp_get_max_teams', +'omp_get_teams_thread_limit' runtime +routines +'omp_target_is_accessible' runtime Y +routine +'omp_target_memcpy_async' and Y +'omp_target_memcpy_rect_async' runtime +routines +'omp_get_mapped_ptr' runtime routine Y +'omp_calloc', 'omp_realloc', Y +'omp_aligned_alloc' and +'omp_aligned_calloc' runtime routines +'omp_alloctrait_key_t' enum: Y +'omp_atv_serialized' added, +'omp_atv_default' changed +'omp_display_env' runtime routine Y +'ompt_scope_endpoint_t' enum: N +'ompt_scope_beginend' +'ompt_sync_region_t' enum additions N +'ompt_state_t' enum: N +'ompt_state_wait_barrier_implementation' +and 'ompt_state_wait_barrier_teams' +'ompt_callback_target_data_op_emi_t', N +'ompt_callback_target_emi_t', +'ompt_callback_target_map_emi_t' and +'ompt_callback_target_submit_emi_t' +'ompt_callback_error_t' type N +'OMP_PLACES' syntax extensions Y +'OMP_NUM_TEAMS' and Y +'OMP_TEAMS_THREAD_LIMIT' environment +variables + +Other new OpenMP 5.1 features +----------------------------- + +Description Status Comments +----------------------------------------------------------------------- +Support of strictly structured blocks in Y +Fortran +Support of structured block sequences in Y +C/C++ +'unconstrained' and 'reproducible' Y +modifiers on 'order' clause +Support 'begin/end declare target' syntax Y +in C/C++ +Pointer predetermined firstprivate N +getting initialized to address of +matching mapped list item per 5.1, Sect. +2.21.7.2 +For Fortran, diagnose placing declarative N +before/between 'USE', 'IMPORT', and +'IMPLICIT' as invalid +Optional comma between directive and Y +clause in the '#pragma' form +'indirect' clause in 'declare target' Y +'device_type(nohost)'/'device_type(host)' N +for variables +'present' modifier to the 'map', 'to' and Y +'from' clauses +Changed interaction between 'declare Y +target' and OpenMP context +Dynamic selector support in Y +'metadirective' +Dynamic selector support in 'declare P Fortran rejects +variant' non-constant + expressions in + dynamic + selectors; C/C++ + reject + expressions + using argument + variables. + (PR113904 + (https://gcc.gnu.org/PR113904)) + + +File: libgomp.info, Node: OpenMP 5.2, Next: OpenMP 6.0, Prev: OpenMP 5.1, Up: OpenMP Implementation Status + +2.4 OpenMP 5.2 +============== + +New features listed in Appendix B of the OpenMP specification +------------------------------------------------------------- + +Description Status Comments +----------------------------------------------------------------------- +'omp_in_explicit_task' routine and Y +EXPLICIT-TASK-VAR ICV +'omp'/'ompx'/'omx' sentinels and N/A warning for +'omp_'/'ompx_' namespaces 'ompx/omx' + sentinels(1) +Clauses on 'end' directive can be on Y +directive +'destroy' clause with destroy-var Y +argument on 'depobj' +Deprecation of no-argument 'destroy' N/A undeprecated in +clause on 'depobj' OpenMP 6 +'linear' clause syntax changes and 'step' Y +modifier +Deprecation of minus operator for N +reductions +Deprecation of separating 'map' modifiers N +without comma +'declare mapper' with iterator and N +'present' modifiers +If a matching mapped list item is not Y +found in the data environment, the +pointer retains its original value +New 'enter' clause as alias for 'to' on Y +declare target directive +Deprecation of 'to' clause on declare N +target directive +Extended list of directives permitted in Y +Fortran pure procedures +New 'allocators' directive for Fortran Y +Deprecation of 'allocate' directive for N +Fortran allocatables/pointers +Optional paired 'end' directive with Y +'dispatch' +New 'memspace' and 'traits' modifiers for N +'uses_allocators' +Deprecation of traits array following the N +allocator_handle expression in +'uses_allocators' +New 'otherwise' clause as alias for Y +'default' on metadirectives +Deprecation of 'default' clause on N Both 'otherwise' +metadirectives and 'default' + are accepted + without + diagnostics. +Deprecation of delimited form of 'declare N +target' +Reproducible semantics changed for N +'order(concurrent)' +'allocate' and 'firstprivate' clauses on Y +'scope' +'ompt_callback_work' N +Default map-type for the 'map' clause in Y +'target enter/exit data' +New 'doacross' clause as alias for Y +'depend' with 'source'/'sink' modifier +Deprecation of 'depend' with N +'source'/'sink' modifier +'omp_cur_iteration' keyword Y + +Other new OpenMP 5.2 features +----------------------------- + +Description Status Comments +----------------------------------------------------------------------- +For Fortran, optional comma between N +directive and clause +Conforming device numbers and Y +'omp_initial_device' and +'omp_invalid_device' enum/PARAMETER +Initial value of DEFAULT-DEVICE-VAR ICV Y +with 'OMP_TARGET_OFFLOAD=mandatory' +'all' as _implicit-behavior_ for Y +'defaultmap' +_interop_types_ in any position of the Y +modifier list for the 'init' clause of +the 'interop' construct +Invoke virtual member functions of C++ N +objects created on the host device on +other devices +'mapper' as map-type modifier in 'declare N +mapper' + + ---------- Footnotes ---------- + + (1) The 'ompx' sentinel as C/C++ pragma and C++ attributes are warned +for with '-Wunknown-pragmas' (implied by '-Wall') and '-Wattributes' +(enabled by default), respectively; for Fortran free-source code, there +is a warning enabled by default and, for fixed-source code, the 'omx' +sentinel is warned for with '-Wsurprising' (enabled by '-Wall'). +Unknown clauses are always rejected with an error. + + +File: libgomp.info, Node: OpenMP 6.0, Prev: OpenMP 5.2, Up: OpenMP Implementation Status + +2.5 OpenMP 6.0 +============== + +New features listed in Appendix B of the OpenMP specification +------------------------------------------------------------- + +Features deprecated in versions 5.0, 5.1 N/A Backward +and 5.2 were removed compatibility +Full support for C23 was added P +Full support for C++23 was added P +Full support for Fortran 2023 was added P +'_ALL' suffix to the device-scope P Host device +environment variables number wrongly + accepted +'num_threads' clause now accepts a list N +Abstract names added for N +'OMP_NUM_THREADS', 'OMP_THREAD_LIMIT' and +'OMP_TEAMS_THREAD_LIMIT' +Supporting increments with abstract names N +in 'OMP_PLACES' +Extension of 'OMP_DEFAULT_DEVICE' and new N +'OMP_AVAILABLE_DEVICES' environment vars +New 'uid' trait for target devices and N +for 'OMP_AVAILABLE_DEVICES' and +'OMP_DEFAULT_DEVICE' +New 'OMP_THREADS_RESERVE' environment N +variable +The 'decl' attribute was added to the C++ Y +attribute syntax +The OpenMP directive syntax was extended Y +to include C23 attribute specifiers +Support for pure directives in Fortran's N +'do concurrent' +All inarguable clauses take now an N +optional Boolean argument +The 'adjust_args' clause was extended to N +specify the argument by position and +supports variadic arguments +For Fortran, _locator list_ can be also N +function reference with data pointer +result +Concept of _assumed-size arrays_ in C and N +C++ +_directive-name-modifier_ accepted in all N +clauses +Extension of 'interop' operation of Y +'append_args', allowing all modifiers of +the 'init' clause +New argument-free version of 'depobj' N +with repeatable clauses and the 'init' +clause +Undeprecate omitting the argument to the Y +'depend' clause of the argument version +of the 'depend' construct +For Fortran, atomic with BLOCK construct N +and, for C/C++, with unlimited curly +braces supported +For Fortran, atomic with pointer N +comparison +For Fortran, atomic with enum and N +enumeration types +For Fortran, atomic compare with storing N +the comparison result +Canonical loop sequences and new N +'looprange' clause +For Fortran, handling polymorphic types P 'private' not +in data-sharing-attribute clauses supported +For Fortran, rejecting polymorphic types N not diagnosed +in data-mapping clauses (and mostly + unsupported) +New 'taskgraph' construct including N +'saved' modifier and 'replayable' clause +'default' clause on the 'target' N +directive and accepting variable +categories +Semantic change regarding the reference N +count update with 'use_device_ptr' and +'use_device_addr' +Support for inductions N +Reduction over private variables with N +'reduction' clause +Implicit reduction identifiers of C++ N +classes +New 'init_complete' clause to the 'scan' N +directive +'ref' modifier to the 'map' clause N +New 'storage' map-type modifier; N +context-dependent 'alloc' and 'release' +are aliases +Change of the _map-type_ property from N +_ultimate_ to _default_ +'self' modifier to 'map' and 'self' as N +'defaultmap' argument +Mapping of _assumed-size arrays_ in C, N +C++ and Fortran +'delete' as delete-modifier not as map N +type +For Fortran, the 'automap' modifier to N +the 'enter' clause of 'declare_target' +'groupprivate' directive N +'local' clause to 'declare_target' N +directive +'part_size' allocator trait for N +'interleaved' allocator partitions +'pin_device', 'preferred_device' and N +'target_access' allocator traits +'access' allocator trait changes N +New 'partitioner' value to 'partition' N +allocator trait +Semicolon-separated list to N +'uses_allocators' +New 'need_device_addr' modifier to N +'adjust_args' clause +'interop' clause to 'dispatch' Y +Scope requirement changes for N +'declare_target' +'message' and 'severity' clauses to N +'parallel' directive +'self_maps' clause to 'requires' Y +directive +'no_openmp_constructs' assumptions clause N +Restriction for 'ordered' regarding N +loop-transforming directives +'apply' clause to loop-transforming N +constructs +Non-constant values in the 'sizes' clause N +'fuse' loop-transformation construct N +'interchange' loop-transformation N +construct +'reverse' loop-transformation construct N +'split' loop-transformation construct N +'stripe' loop-transformation construct N +'tile' permitting association of grid and N +inter-tile loops +'strict' modifier keyword to N +'num_threads' +'safesync' clause to the 'parallel' N +construct +'omp_curr_progress_width' identifier N +'omp_get_max_progress_width' runtime N +routine +Lifted restrictions on N +'order(concurrent)' and, hence, the +'loop' construct +'atomic' permitted in a construct with N +'order(concurrent)' +Lifted restrictions on N +not-strictly-nested regions with +'order(concurrent)' +'workdistribute' directive for Fortran N +Fortran 'DO CONCURRENT' as associated N +loop in a 'loop' construct +New 'task_iteration' directive inside N +'taskloop' +'threadset' clause in task-generating N +constructs +New 'priority' clause to 'target', N +'target_enter_data', 'target_data', +'target_exit_data' and 'target_update' +New 'device_type' clause to the 'target' N +directive +'target_data' as composite construct N +'nowait' clause with reverse-offload N +'target' directives +Extended _prefer-type_ modifier to 'init' Y +clause +Boolean argument to 'nowait' and N +'nogroup' may be non constant +'memscope' clause to 'atomic' and 'flush' N +New 'transparent' clause for N +multi-generational task-dependence graphs +The 'cancel' construct now completes N +tasks with unfulfilled events +'omp_fulfill_event' routine was N +restricted regarding fulfillment of event +variables +Added rule for compound-directive names, N +permitting many more combinations +'omp_is_free_agent' and N +'omp_ancestor_is_free_agent' routines +'omp_get_device_from_uid' and Y +'omp_get_uid_from_device' routines +'omp_get_device_num_teams', N +'omp_set_device_num_teams', +'omp_get_device_teams_thread_limit', and +'omp_set_device_teams_thread_limit' +routines +'omp_target_memset' and N +'omp_target_memset_async' routines +Fortran version of the interop runtime Y +routines +Routines for obtaining memory N +spaces/allocators for shared/device +memory +'omp_get_memspace_num_resources' routine N +'omp_get_memspace_pagesize' routine N +'omp_get_submemspace' routine N +'omp_init_mempartitioner', N +'omp_destroy_mempartitioner', +'omp_init_mempartition', +'omp_destroy_mempartition', +'omp_mempartition_set_part', +'omp_mempartition_get_user_data' routines +Deprecation of the 'target_data_op', N +'target', 'target_map' and +'target_submit' callbacks and as values +that 'set_callback' must return +'ompt_target_data_transfer' and N +'ompt_target_data_transfer_async' values +in 'ompt_target_data_op_t' enum +The values N +'ompt_target_data_transfer_to_device', +'ompt_target_data_transfer_from_device', +'ompt_target_data_transfer_to_device_async' +and +'ompt_target_data_transfer_from_device_async' +of the 'target_data_op' OMPT type were +deprecated +'ompt_get_buffer_limits' OMPT routine N + +Deprecated features, unless listed above +---------------------------------------- + +Deprecation of omitting the optional N +white space to separate adjacent keywords +in the directive-name in Fortran (fixed +and free source form) +Deprecation of the combiner expression in N +the 'declare_reduction' argument +Deprecation of the Fortran include file N +'omp_lib.h' + +Other new OpenMP 6.0 features +----------------------------- + +Multi-word directives now use underscore N +by default +Relaxed Fortran restrictions to the N +'aligned' clause +Mapping lambda captures N +New 'omp_pause_stop_tool' constant for N +omp_pause_resource +In Fortran (fixed and free source form), N +spaces between directive names are +mandatory +Update of the map-type decay for mapping N +and 'declare_mapper' + + +File: libgomp.info, Node: Runtime Library Routines, Next: Environment Variables, Prev: OpenMP Implementation Status, Up: Top + +3 OpenMP Runtime Library Routines +********************************* + +The runtime routines described here are defined by Section 18 of the +OpenMP specification in version 5.2. + +* Menu: + +* Thread Team Routines:: +* Thread Affinity Routines:: +* Teams Region Routines:: +* Tasking Routines:: +* Resource Relinquishing Routines:: +* Device Information Routines:: +* Device Memory Routines:: +* Lock Routines:: +* Timing Routines:: +* Event Routine:: +* Interoperability Routines:: +* Memory Management Routines:: +* Environment Display Routine:: + + +File: libgomp.info, Node: Thread Team Routines, Next: Thread Affinity Routines, Up: Runtime Library Routines + +3.1 Thread Team Routines +======================== + +Routines controlling threads in the current contention group. They have +C linkage and do not throw exceptions. + +* Menu: + +* omp_set_num_threads:: Set upper team size limit +* omp_get_num_threads:: Size of the active team +* omp_get_max_threads:: Maximum number of threads of parallel region +* omp_get_thread_num:: Current thread ID +* omp_in_parallel:: Whether a parallel region is active +* omp_set_dynamic:: Enable/disable dynamic teams +* omp_get_dynamic:: Dynamic teams setting +* omp_get_cancellation:: Whether cancellation support is enabled +* omp_set_nested:: Enable/disable nested parallel regions +* omp_get_nested:: Nested parallel regions +* omp_set_schedule:: Set the runtime scheduling method +* omp_get_schedule:: Obtain the runtime scheduling method +* omp_get_teams_thread_limit:: Maximum number of threads imposed by teams +* omp_get_supported_active_levels:: Maximum number of active regions supported +* omp_set_max_active_levels:: Limits the number of active parallel regions +* omp_get_max_active_levels:: Current maximum number of active regions +* omp_get_level:: Number of parallel regions +* omp_get_ancestor_thread_num:: Ancestor thread ID +* omp_get_team_size:: Number of threads in a team +* omp_get_active_level:: Number of active parallel regions + + +File: libgomp.info, Node: omp_set_num_threads, Next: omp_get_num_threads, Up: Thread Team Routines + +3.1.1 'omp_set_num_threads' - Set upper team size limit +------------------------------------------------------- + +_Description_: + Specifies the number of threads used by default in subsequent + parallel sections, if those do not specify a 'num_threads' clause. + The argument of 'omp_set_num_threads' shall be a positive integer. + +_C/C++_: + _Prototype_: 'void omp_set_num_threads(int num_threads);' + +_Fortran_: + _Interface_: 'subroutine omp_set_num_threads(num_threads)' + 'integer, intent(in) :: num_threads' + +_See also_: + *note OMP_NUM_THREADS::, *note omp_get_num_threads::, *note + omp_get_max_threads:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.1. + + +File: libgomp.info, Node: omp_get_num_threads, Next: omp_get_max_threads, Prev: omp_set_num_threads, Up: Thread Team Routines + +3.1.2 'omp_get_num_threads' - Size of the active team +----------------------------------------------------- + +_Description_: + Returns the number of threads in the current team. In a sequential + section of the program 'omp_get_num_threads' returns 1. + + The default team size may be initialized at startup by the + 'OMP_NUM_THREADS' environment variable. At runtime, the size of + the current team may be set either by the 'NUM_THREADS' clause or + by 'omp_set_num_threads'. If none of the above were used to define + a specific value and 'OMP_DYNAMIC' is disabled, one thread per CPU + online is used. + +_C/C++_: + _Prototype_: 'int omp_get_num_threads(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_num_threads()' + +_See also_: + *note omp_get_max_threads::, *note omp_set_num_threads::, *note + OMP_NUM_THREADS:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.2. + + +File: libgomp.info, Node: omp_get_max_threads, Next: omp_get_thread_num, Prev: omp_get_num_threads, Up: Thread Team Routines + +3.1.3 'omp_get_max_threads' - Maximum number of threads of parallel region +-------------------------------------------------------------------------- + +_Description_: + Return the maximum number of threads used for the current parallel + region that does not use the clause 'num_threads'. + +_C/C++_: + _Prototype_: 'int omp_get_max_threads(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_max_threads()' + +_See also_: + *note omp_set_num_threads::, *note omp_set_dynamic::, *note + omp_get_thread_limit:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.3. + + +File: libgomp.info, Node: omp_get_thread_num, Next: omp_in_parallel, Prev: omp_get_max_threads, Up: Thread Team Routines + +3.1.4 'omp_get_thread_num' - Current thread ID +---------------------------------------------- + +_Description_: + Returns a unique thread identification number within the current + team. In a sequential parts of the program, 'omp_get_thread_num' + always returns 0. In parallel regions the return value varies from + 0 to 'omp_get_num_threads'-1 inclusive. The return value of the + primary thread of a team is always 0. + +_C/C++_: + _Prototype_: 'int omp_get_thread_num(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_thread_num()' + +_See also_: + *note omp_get_num_threads::, *note omp_get_ancestor_thread_num:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.4. + + +File: libgomp.info, Node: omp_in_parallel, Next: omp_set_dynamic, Prev: omp_get_thread_num, Up: Thread Team Routines + +3.1.5 'omp_in_parallel' - Whether a parallel region is active +------------------------------------------------------------- + +_Description_: + This function returns 'true' if currently running in parallel, + 'false' otherwise. Here, 'true' and 'false' represent their + language-specific counterparts. + +_C/C++_: + _Prototype_: 'int omp_in_parallel(void);' + +_Fortran_: + _Interface_: 'logical function omp_in_parallel()' + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.6. + + +File: libgomp.info, Node: omp_set_dynamic, Next: omp_get_dynamic, Prev: omp_in_parallel, Up: Thread Team Routines + +3.1.6 'omp_set_dynamic' - Enable/disable dynamic teams +------------------------------------------------------ + +_Description_: + Enable or disable the dynamic adjustment of the number of threads + within a team. The function takes the language-specific equivalent + of 'true' and 'false', where 'true' enables dynamic adjustment of + team sizes and 'false' disables it. + +_C/C++_: + _Prototype_: 'void omp_set_dynamic(int dynamic_threads);' + +_Fortran_: + _Interface_: 'subroutine omp_set_dynamic(dynamic_threads)' + 'logical, intent(in) :: dynamic_threads' + +_See also_: + *note OMP_DYNAMIC::, *note omp_get_dynamic:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.7. + + +File: libgomp.info, Node: omp_get_dynamic, Next: omp_get_cancellation, Prev: omp_set_dynamic, Up: Thread Team Routines + +3.1.7 'omp_get_dynamic' - Dynamic teams setting +----------------------------------------------- + +_Description_: + This function returns 'true' if enabled, 'false' otherwise. Here, + 'true' and 'false' represent their language-specific counterparts. + + The dynamic team setting may be initialized at startup by the + 'OMP_DYNAMIC' environment variable or at runtime using + 'omp_set_dynamic'. If undefined, dynamic adjustment is disabled by + default. + +_C/C++_: + _Prototype_: 'int omp_get_dynamic(void);' + +_Fortran_: + _Interface_: 'logical function omp_get_dynamic()' + +_See also_: + *note omp_set_dynamic::, *note OMP_DYNAMIC:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.8. + + +File: libgomp.info, Node: omp_get_cancellation, Next: omp_set_nested, Prev: omp_get_dynamic, Up: Thread Team Routines + +3.1.8 'omp_get_cancellation' - Whether cancellation support is enabled +---------------------------------------------------------------------- + +_Description_: + This function returns 'true' if cancellation is activated, 'false' + otherwise. Here, 'true' and 'false' represent their + language-specific counterparts. Unless 'OMP_CANCELLATION' is set + true, cancellations are deactivated. + +_C/C++_: + _Prototype_: 'int omp_get_cancellation(void);' + +_Fortran_: + _Interface_: 'logical function omp_get_cancellation()' + +_See also_: + *note OMP_CANCELLATION:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.9. + + +File: libgomp.info, Node: omp_set_nested, Next: omp_get_nested, Prev: omp_get_cancellation, Up: Thread Team Routines + +3.1.9 'omp_set_nested' - Enable/disable nested parallel regions +--------------------------------------------------------------- + +_Description_: + Enable or disable nested parallel regions, i.e., whether team + members are allowed to create new teams. The function takes the + language-specific equivalent of 'true' and 'false', where 'true' + enables dynamic adjustment of team sizes and 'false' disables it. + + Enabling nested parallel regions also sets the maximum number of + active nested regions to the maximum supported. Disabling nested + parallel regions sets the maximum number of active nested regions + to one. + + Note that the 'omp_set_nested' API routine was deprecated in the + OpenMP specification 5.0 in favor of 'omp_set_max_active_levels'. + +_C/C++_: + _Prototype_: 'void omp_set_nested(int nested);' + +_Fortran_: + _Interface_: 'subroutine omp_set_nested(nested)' + 'logical, intent(in) :: nested' + +_See also_: + *note omp_get_nested::, *note omp_set_max_active_levels::, *note + OMP_MAX_ACTIVE_LEVELS::, *note OMP_NESTED:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.10. + + +File: libgomp.info, Node: omp_get_nested, Next: omp_set_schedule, Prev: omp_set_nested, Up: Thread Team Routines + +3.1.10 'omp_get_nested' - Nested parallel regions +------------------------------------------------- + +_Description_: + This function returns 'true' if nested parallel regions are + enabled, 'false' otherwise. Here, 'true' and 'false' represent + their language-specific counterparts. + + The state of nested parallel regions at startup depends on several + environment variables. If 'OMP_MAX_ACTIVE_LEVELS' is defined and + is set to greater than one, then nested parallel regions will be + enabled. If not defined, then the value of the 'OMP_NESTED' + environment variable will be followed if defined. If neither are + defined, then if either 'OMP_NUM_THREADS' or 'OMP_PROC_BIND' are + defined with a list of more than one value, then nested parallel + regions are enabled. If none of these are defined, then nested + parallel regions are disabled by default. + + Nested parallel regions can be enabled or disabled at runtime using + 'omp_set_nested', or by setting the maximum number of nested + regions with 'omp_set_max_active_levels' to one to disable, or + above one to enable. + + Note that the 'omp_get_nested' API routine was deprecated in the + OpenMP specification 5.0 in favor of 'omp_get_max_active_levels'. + +_C/C++_: + _Prototype_: 'int omp_get_nested(void);' + +_Fortran_: + _Interface_: 'logical function omp_get_nested()' + +_See also_: + *note omp_get_max_active_levels::, *note omp_set_nested::, *note + OMP_MAX_ACTIVE_LEVELS::, *note OMP_NESTED:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.11. + + +File: libgomp.info, Node: omp_set_schedule, Next: omp_get_schedule, Prev: omp_get_nested, Up: Thread Team Routines + +3.1.11 'omp_set_schedule' - Set the runtime scheduling method +------------------------------------------------------------- + +_Description_: + Sets the runtime scheduling method. The KIND argument can have the + value 'omp_sched_static', 'omp_sched_dynamic', 'omp_sched_guided' + or 'omp_sched_auto'. Except for 'omp_sched_auto', the chunk size + is set to the value of CHUNK_SIZE if positive, or to the default + value if zero or negative. For 'omp_sched_auto' the CHUNK_SIZE + argument is ignored. + +_C/C++_ + _Prototype_: 'void omp_set_schedule(omp_sched_t kind, int + chunk_size);' + +_Fortran_: + _Interface_: 'subroutine omp_set_schedule(kind, chunk_size)' + 'integer(kind=omp_sched_kind) kind' + 'integer chunk_size' + +_See also_: + *note omp_get_schedule:: *note OMP_SCHEDULE:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.12. + + +File: libgomp.info, Node: omp_get_schedule, Next: omp_get_teams_thread_limit, Prev: omp_set_schedule, Up: Thread Team Routines + +3.1.12 'omp_get_schedule' - Obtain the runtime scheduling method +---------------------------------------------------------------- + +_Description_: + Obtain the runtime scheduling method. The KIND argument is set to + 'omp_sched_static', 'omp_sched_dynamic', 'omp_sched_guided' or + 'omp_sched_auto'. The second argument, CHUNK_SIZE, is set to the + chunk size. + +_C/C++_ + _Prototype_: 'void omp_get_schedule(omp_sched_t *kind, int + *chunk_size);' + +_Fortran_: + _Interface_: 'subroutine omp_get_schedule(kind, chunk_size)' + 'integer(kind=omp_sched_kind) kind' + 'integer chunk_size' + +_See also_: + *note omp_set_schedule::, *note OMP_SCHEDULE:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.13. + + +File: libgomp.info, Node: omp_get_teams_thread_limit, Next: omp_get_supported_active_levels, Prev: omp_get_schedule, Up: Thread Team Routines + +3.1.13 'omp_get_teams_thread_limit' - Maximum number of threads imposed by teams +-------------------------------------------------------------------------------- + +_Description_: + Return the maximum number of threads that are able to participate + in each team created by a teams construct. + +_C/C++_: + _Prototype_: 'int omp_get_teams_thread_limit(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_teams_thread_limit()' + +_See also_: + *note omp_set_teams_thread_limit::, *note OMP_TEAMS_THREAD_LIMIT:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.4.6. + + +File: libgomp.info, Node: omp_get_supported_active_levels, Next: omp_set_max_active_levels, Prev: omp_get_teams_thread_limit, Up: Thread Team Routines + +3.1.14 'omp_get_supported_active_levels' - Maximum number of active regions supported +------------------------------------------------------------------------------------- + +_Description_: + This function returns the maximum number of nested, active parallel + regions supported by this implementation. + +_C/C++_ + _Prototype_: 'int omp_get_supported_active_levels(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_supported_active_levels()' + +_See also_: + *note omp_get_max_active_levels::, *note + omp_set_max_active_levels:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.2.15. + + +File: libgomp.info, Node: omp_set_max_active_levels, Next: omp_get_max_active_levels, Prev: omp_get_supported_active_levels, Up: Thread Team Routines + +3.1.15 'omp_set_max_active_levels' - Limits the number of active parallel regions +--------------------------------------------------------------------------------- + +_Description_: + This function limits the maximum allowed number of nested, active + parallel regions. MAX_LEVELS must be less or equal to the value + returned by 'omp_get_supported_active_levels'. + +_C/C++_ + _Prototype_: 'void omp_set_max_active_levels(int max_levels);' + +_Fortran_: + _Interface_: 'subroutine omp_set_max_active_levels(max_levels)' + 'integer max_levels' + +_See also_: + *note omp_get_max_active_levels::, *note omp_get_active_level::, + *note omp_get_supported_active_levels:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.15. + + +File: libgomp.info, Node: omp_get_max_active_levels, Next: omp_get_level, Prev: omp_set_max_active_levels, Up: Thread Team Routines + +3.1.16 'omp_get_max_active_levels' - Current maximum number of active regions +----------------------------------------------------------------------------- + +_Description_: + This function obtains the maximum allowed number of nested, active + parallel regions. + +_C/C++_ + _Prototype_: 'int omp_get_max_active_levels(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_max_active_levels()' + +_See also_: + *note omp_set_max_active_levels::, *note omp_get_active_level:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.16. + + +File: libgomp.info, Node: omp_get_level, Next: omp_get_ancestor_thread_num, Prev: omp_get_max_active_levels, Up: Thread Team Routines + +3.1.17 'omp_get_level' - Obtain the current nesting level +--------------------------------------------------------- + +_Description_: + This function returns the nesting level for the parallel blocks, + which enclose the calling call. + +_C/C++_ + _Prototype_: 'int omp_get_level(void);' + +_Fortran_: + _Interface_: 'integer function omp_level()' + +_See also_: + *note omp_get_active_level:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.17. + + +File: libgomp.info, Node: omp_get_ancestor_thread_num, Next: omp_get_team_size, Prev: omp_get_level, Up: Thread Team Routines + +3.1.18 'omp_get_ancestor_thread_num' - Ancestor thread ID +--------------------------------------------------------- + +_Description_: + This function returns the thread identification number for the + given nesting level of the current thread. For values of LEVEL + outside zero to 'omp_get_level' -1 is returned; if LEVEL is + 'omp_get_level' the result is identical to 'omp_get_thread_num'. + +_C/C++_ + _Prototype_: 'int omp_get_ancestor_thread_num(int level);' + +_Fortran_: + _Interface_: 'integer function omp_get_ancestor_thread_num(level)' + 'integer level' + +_See also_: + *note omp_get_level::, *note omp_get_thread_num::, *note + omp_get_team_size:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.18. + + +File: libgomp.info, Node: omp_get_team_size, Next: omp_get_active_level, Prev: omp_get_ancestor_thread_num, Up: Thread Team Routines + +3.1.19 'omp_get_team_size' - Number of threads in a team +-------------------------------------------------------- + +_Description_: + This function returns the number of threads in a thread team to + which either the current thread or its ancestor belongs. For + values of LEVEL outside zero to 'omp_get_level', -1 is returned; if + LEVEL is zero, 1 is returned, and for 'omp_get_level', the result + is identical to 'omp_get_num_threads'. + +_C/C++_: + _Prototype_: 'int omp_get_team_size(int level);' + +_Fortran_: + _Interface_: 'integer function omp_get_team_size(level)' + 'integer level' + +_See also_: + *note omp_get_num_threads::, *note omp_get_level::, *note + omp_get_ancestor_thread_num:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.19. + + +File: libgomp.info, Node: omp_get_active_level, Prev: omp_get_team_size, Up: Thread Team Routines + +3.1.20 'omp_get_active_level' - Number of parallel regions +---------------------------------------------------------- + +_Description_: + This function returns the nesting level for the active parallel + blocks, which enclose the calling call. + +_C/C++_ + _Prototype_: 'int omp_get_active_level(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_active_level()' + +_See also_: + *note omp_get_level::, *note omp_get_max_active_levels::, *note + omp_set_max_active_levels:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.20. + + +File: libgomp.info, Node: Thread Affinity Routines, Next: Teams Region Routines, Prev: Thread Team Routines, Up: Runtime Library Routines + +3.2 Thread Affinity Routines +============================ + +Routines controlling and accessing thread-affinity policies. They have +C linkage and do not throw exceptions. + +* Menu: + +* omp_get_proc_bind:: Whether threads may be moved between CPUs + + +File: libgomp.info, Node: omp_get_proc_bind, Up: Thread Affinity Routines + +3.2.1 'omp_get_proc_bind' - Whether threads may be moved between CPUs +--------------------------------------------------------------------- + +_Description_: + This functions returns the currently active thread affinity policy, + which is set via 'OMP_PROC_BIND'. Possible values are + 'omp_proc_bind_false', 'omp_proc_bind_true', + 'omp_proc_bind_primary', 'omp_proc_bind_master', + 'omp_proc_bind_close' and 'omp_proc_bind_spread', where + 'omp_proc_bind_master' is an alias for 'omp_proc_bind_primary'. + +_C/C++_: + _Prototype_: 'omp_proc_bind_t omp_get_proc_bind(void);' + +_Fortran_: + _Interface_: 'integer(kind=omp_proc_bind_kind) function + omp_get_proc_bind()' + +_See also_: + *note OMP_PROC_BIND::, *note OMP_PLACES::, *note + GOMP_CPU_AFFINITY::, + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.22. + + +File: libgomp.info, Node: Teams Region Routines, Next: Tasking Routines, Prev: Thread Affinity Routines, Up: Runtime Library Routines + +3.3 Teams Region Routines +========================= + +Routines controlling the league of teams that are executed in a 'teams' +region. They have C linkage and do not throw exceptions. + +* Menu: + +* omp_get_num_teams:: Number of teams +* omp_get_team_num:: Get team number +* omp_set_num_teams:: Set upper teams limit for teams region +* omp_get_max_teams:: Maximum number of teams for teams region +* omp_set_teams_thread_limit:: Set upper thread limit for teams construct +* omp_get_thread_limit:: Maximum number of threads + + +File: libgomp.info, Node: omp_get_num_teams, Next: omp_get_team_num, Up: Teams Region Routines + +3.3.1 'omp_get_num_teams' - Number of teams +------------------------------------------- + +_Description_: + Returns the number of teams in the current team region. + +_C/C++_: + _Prototype_: 'int omp_get_num_teams(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_num_teams()' + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.32. + + +File: libgomp.info, Node: omp_get_team_num, Next: omp_set_num_teams, Prev: omp_get_num_teams, Up: Teams Region Routines + +3.3.2 'omp_get_team_num' - Get team number +------------------------------------------ + +_Description_: + Returns the team number of the calling thread. + +_C/C++_: + _Prototype_: 'int omp_get_team_num(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_team_num()' + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.33. + + +File: libgomp.info, Node: omp_set_num_teams, Next: omp_get_max_teams, Prev: omp_get_team_num, Up: Teams Region Routines + +3.3.3 'omp_set_num_teams' - Set upper teams limit for teams construct +--------------------------------------------------------------------- + +_Description_: + Specifies the upper bound for number of teams created by the teams + construct which does not specify a 'num_teams' clause. The + argument of 'omp_set_num_teams' shall be a positive integer. + +_C/C++_: + _Prototype_: 'void omp_set_num_teams(int num_teams);' + +_Fortran_: + _Interface_: 'subroutine omp_set_num_teams(num_teams)' + 'integer, intent(in) :: num_teams' + +_See also_: + *note OMP_NUM_TEAMS::, *note omp_get_num_teams::, *note + omp_get_max_teams:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.4.3. + + +File: libgomp.info, Node: omp_get_max_teams, Next: omp_set_teams_thread_limit, Prev: omp_set_num_teams, Up: Teams Region Routines + +3.3.4 'omp_get_max_teams' - Maximum number of teams of teams region +------------------------------------------------------------------- + +_Description_: + Return the maximum number of teams used for the teams region that + does not use the clause 'num_teams'. + +_C/C++_: + _Prototype_: 'int omp_get_max_teams(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_max_teams()' + +_See also_: + *note omp_set_num_teams::, *note omp_get_num_teams:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.4.4. + + +File: libgomp.info, Node: omp_set_teams_thread_limit, Next: omp_get_thread_limit, Prev: omp_get_max_teams, Up: Teams Region Routines + +3.3.5 'omp_set_teams_thread_limit' - Set upper thread limit for teams construct +------------------------------------------------------------------------------- + +_Description_: + Specifies the upper bound for number of threads that are available + for each team created by the teams construct which does not specify + a 'thread_limit' clause. The argument of + 'omp_set_teams_thread_limit' shall be a positive integer. + +_C/C++_: + _Prototype_: 'void omp_set_teams_thread_limit(int thread_limit);' + +_Fortran_: + _Interface_: 'subroutine omp_set_teams_thread_limit(thread_limit)' + 'integer, intent(in) :: thread_limit' + +_See also_: + *note OMP_TEAMS_THREAD_LIMIT::, *note omp_get_teams_thread_limit::, + *note omp_get_thread_limit:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.4.5. + + +File: libgomp.info, Node: omp_get_thread_limit, Prev: omp_set_teams_thread_limit, Up: Teams Region Routines + +3.3.6 'omp_get_thread_limit' - Maximum number of threads +-------------------------------------------------------- + +_Description_: + Return the maximum number of threads of the program. + +_C/C++_: + _Prototype_: 'int omp_get_thread_limit(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_thread_limit()' + +_See also_: + *note omp_get_max_threads::, *note OMP_THREAD_LIMIT:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.14. + + +File: libgomp.info, Node: Tasking Routines, Next: Resource Relinquishing Routines, Prev: Teams Region Routines, Up: Runtime Library Routines + +3.4 Tasking Routines +==================== + +Routines relating to explicit tasks. They have C linkage and do not +throw exceptions. + +* Menu: + +* omp_get_max_task_priority:: Maximum task priority value that can be set +* omp_in_explicit_task:: Whether a given task is an explicit task +* omp_in_final:: Whether in final or included task region + + +File: libgomp.info, Node: omp_get_max_task_priority, Next: omp_in_explicit_task, Up: Tasking Routines + +3.4.1 'omp_get_max_task_priority' - Maximum priority value +---------------------------------------------------------- + +that can be set for tasks. +_Description_: + This function obtains the maximum allowed priority number for + tasks. + +_C/C++_ + _Prototype_: 'int omp_get_max_task_priority(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_max_task_priority()' + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.29. + + +File: libgomp.info, Node: omp_in_explicit_task, Next: omp_in_final, Prev: omp_get_max_task_priority, Up: Tasking Routines + +3.4.2 'omp_in_explicit_task' - Whether a given task is an explicit task +----------------------------------------------------------------------- + +_Description_: + The function returns the EXPLICIT-TASK-VAR ICV; it returns true + when the encountering task was generated by a task-generating + construct such as 'target', 'task' or 'taskloop'. Otherwise, the + encountering task is in an implicit task region such as generated + by the implicit or explicit 'parallel' region and + 'omp_in_explicit_task' returns false. + +_C/C++_ + _Prototype_: 'int omp_in_explicit_task(void);' + +_Fortran_: + _Interface_: 'logical function omp_in_explicit_task()' + +_Reference_: + OpenMP specification v5.2 (https://www.openmp.org), Section 18.5.2. + + +File: libgomp.info, Node: omp_in_final, Prev: omp_in_explicit_task, Up: Tasking Routines + +3.4.3 'omp_in_final' - Whether in final or included task region +--------------------------------------------------------------- + +_Description_: + This function returns 'true' if currently running in a final or + included task region, 'false' otherwise. Here, 'true' and 'false' + represent their language-specific counterparts. + +_C/C++_: + _Prototype_: 'int omp_in_final(void);' + +_Fortran_: + _Interface_: 'logical function omp_in_final()' + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.21. + + +File: libgomp.info, Node: Resource Relinquishing Routines, Next: Device Information Routines, Prev: Tasking Routines, Up: Runtime Library Routines + +3.5 Resource Relinquishing Routines +=================================== + +Routines releasing resources used by the OpenMP runtime. They have C +linkage and do not throw exceptions. + +* Menu: + +* omp_pause_resource:: Release OpenMP resources on a device +* omp_pause_resource_all:: Release OpenMP resources on all devices + + +File: libgomp.info, Node: omp_pause_resource, Next: omp_pause_resource_all, Up: Resource Relinquishing Routines + +3.5.1 'omp_pause_resource' - Release OpenMP resources on a device +----------------------------------------------------------------- + +_Description_: + Free resources used by the OpenMP program and the runtime library + on and for the device specified by DEVICE_NUM; on success, zero is + returned and non-zero otherwise. + + The value of DEVICE_NUM must be a conforming device number. The + routine may not be called from within any explicit region and all + explicit threads that do not bind to the implicit parallel region + have finalized execution. + +_C/C++_: + _Prototype_: 'int omp_pause_resource(omp_pause_resource_t kind, int + device_num);' + +_Fortran_: + _Interface_: 'integer function omp_pause_resource(kind, device_num)' + 'integer (kind=omp_pause_resource_kind) kind' + 'integer device_num' + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.2.43. + + +File: libgomp.info, Node: omp_pause_resource_all, Prev: omp_pause_resource, Up: Resource Relinquishing Routines + +3.5.2 'omp_pause_resource_all' - Release OpenMP resources on all devices +------------------------------------------------------------------------ + +_Description_: + Free resources used by the OpenMP program and the runtime library + on all devices, including the host. On success, zero is returned + and non-zero otherwise. + + The routine may not be called from within any explicit region and + all explicit threads that do not bind to the implicit parallel + region have finalized execution. + +_C/C++_: + _Prototype_: 'int omp_pause_resource(omp_pause_resource_t kind);' + +_Fortran_: + _Interface_: 'integer function omp_pause_resource(kind)' + 'integer (kind=omp_pause_resource_kind) kind' + +_See also_: + *note omp_pause_resource:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.2.44. + + +File: libgomp.info, Node: Device Information Routines, Next: Device Memory Routines, Prev: Resource Relinquishing Routines, Up: Runtime Library Routines + +3.6 Device Information Routines +=============================== + +Routines related to devices available to an OpenMP program. They have C +linkage and do not throw exceptions. + +* Menu: + +* omp_get_num_procs:: Number of processors online +* omp_set_default_device:: Set the default device for target regions +* omp_get_default_device:: Get the default device for target regions +* omp_get_num_devices:: Number of target devices +* omp_get_device_num:: Get device that current thread is running on +* omp_get_device_from_uid:: Obtain the device number to a unique id +* omp_get_uid_from_device:: Obtain the unique id of a device +* omp_is_initial_device:: Whether executing on the host device +* omp_get_initial_device:: Device number of host device + + +File: libgomp.info, Node: omp_get_num_procs, Next: omp_set_default_device, Up: Device Information Routines + +3.6.1 'omp_get_num_procs' - Number of processors online +------------------------------------------------------- + +_Description_: + Returns the number of processors online on that device. + +_C/C++_: + _Prototype_: 'int omp_get_num_procs(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_num_procs()' + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.5. + + +File: libgomp.info, Node: omp_set_default_device, Next: omp_get_default_device, Prev: omp_get_num_procs, Up: Device Information Routines + +3.6.2 'omp_set_default_device' - Set the default device for target regions +-------------------------------------------------------------------------- + +_Description_: + Get the value of the _default-device-var_ ICV, which is used for + target regions without a device clause. The argument shall be a + nonnegative device number, 'omp_initial_device', or + 'omp_invalid_device'. + + The effect of running this routine in a 'target' region is + unspecified. + +_C/C++_: + _Prototype_: 'void omp_set_default_device(int device_num);' + +_Fortran_: + _Interface_: 'subroutine omp_set_default_device(device_num)' + 'integer device_num' + +_See also_: + *note OMP_DEFAULT_DEVICE::, *note omp_get_default_device:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.29. + + +File: libgomp.info, Node: omp_get_default_device, Next: omp_get_num_devices, Prev: omp_set_default_device, Up: Device Information Routines + +3.6.3 'omp_get_default_device' - Get the default device for target regions +-------------------------------------------------------------------------- + +_Description_: + Get the value of the _default-device-var_ ICV, which is used for + target regions without a device clause. The value is either a + nonnegative device number, 'omp_initial_device' or + 'omp_invalid_device'. Note that for the host, the ICV can have two + values: either the value of the named constant 'omp_initial_device' + or the value returned by the 'omp_get_num_devices' routine. + + The effect of running this routine in a 'target' region is + unspecified. + +_C/C++_: + _Prototype_: 'int omp_get_default_device(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_default_device()' + +_See also_: + *note OMP_DEFAULT_DEVICE::, *note omp_set_default_device::, *note + omp_get_initial_device:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.30. + + +File: libgomp.info, Node: omp_get_num_devices, Next: omp_get_device_num, Prev: omp_get_default_device, Up: Device Information Routines + +3.6.4 'omp_get_num_devices' - Number of target devices +------------------------------------------------------ + +_Description_: + Returns the number of available non-host devices. + + The effect of running this routine in a 'target' region is + unspecified. + +_C/C++_: + _Prototype_: 'int omp_get_num_devices(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_num_devices()' + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.31. + + +File: libgomp.info, Node: omp_get_device_num, Next: omp_get_device_from_uid, Prev: omp_get_num_devices, Up: Device Information Routines + +3.6.5 'omp_get_device_num' - Return device number of current device +------------------------------------------------------------------- + +_Description_: + This function returns a device number that represents the device + that the current thread is executing on. When called on the host, + it returns the same value as returned by the + 'omp_get_initial_device' function as required since OpenMP 5.0. + +_C/C++_ + _Prototype_: 'int omp_get_device_num(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_device_num()' + +_See also_: + *note omp_get_initial_device:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.2.37. + + +File: libgomp.info, Node: omp_get_device_from_uid, Next: omp_get_uid_from_device, Prev: omp_get_device_num, Up: Device Information Routines + +3.6.6 'omp_get_device_from_uid' - Obtain the device number to a unique id +------------------------------------------------------------------------- + +_Description_: + This function returns the device number associated with the passed + unique-identifier (UID) string. If no device with this UID is + available, the value 'omp_invalid_device' is returned. The effect + of running this routine in a 'target' region is unspecified. + + GCC treats the UID string case sensitive; for the initial device, + GCC currently only accepts the value 'OMP_INITIAL_DEVICE' and + returns for it the value of 'omp_initial_device'. + +_C/C++_: + _Prototype_: 'int omp_get_device_from_uid(const char *uid);' + +_Fortran_: + _Interface_: 'integer function omp_get_device_from_uid(uid)' + 'character(len=*), intent(in) :: uid' + +_See also_: + *note omp_get_uid_from_device::, *note Offload-Target Specifics:: + +_Reference_: + OpenMP specification v6.0 (https://www.openmp.org), Section 24.7 + + +File: libgomp.info, Node: omp_get_uid_from_device, Next: omp_is_initial_device, Prev: omp_get_device_from_uid, Up: Device Information Routines + +3.6.7 'omp_get_uid_from_device' - Obtain the unique id of a device +------------------------------------------------------------------ + +_Description_: + This function returns a pointer to a string that represents a + unique identifier (UID) for the device specified by DEVICE_NUM. It + returns a 'NULL' (C/C++) or a disassociated pointer (Fortran) for + 'omp_invalid_device'. The effect of running this routine in a + 'target' region is unspecified. + + GCC currently returns for initial device the value + 'OMP_INITIAL_DEVICE'. + +_C/C++_: + _Prototype_: 'const char *omp_get_uid_from_device(int device_num);' + +_Fortran_: + _Interface_: 'character(:) function + omp_get_uid_from_device(device_num)' + _Interface_: 'pointer :: omp_get_uid_from_device' + 'integer, intent(in) :: device_num' + +_See also_: + *note omp_get_uid_from_device::, *note Offload-Target Specifics:: + +_Reference_: + OpenMP specification v6.0 (https://www.openmp.org), Section 24.8 + + +File: libgomp.info, Node: omp_is_initial_device, Next: omp_get_initial_device, Prev: omp_get_uid_from_device, Up: Device Information Routines + +3.6.8 'omp_is_initial_device' - Whether executing on the host device +-------------------------------------------------------------------- + +_Description_: + This function returns 'true' if currently running on the host + device, 'false' otherwise. Here, 'true' and 'false' represent + their language-specific counterparts. + + Note that in GCC this function call is already folded to a constant + in the compiler; compile with '-fno-builtin-omp_is_initial_device' + if a run-time function is desired. + +_C/C++_: + _Prototype_: 'int omp_is_initial_device(void);' + +_Fortran_: + _Interface_: 'logical function omp_is_initial_device()' + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.34. + + +File: libgomp.info, Node: omp_get_initial_device, Prev: omp_is_initial_device, Up: Device Information Routines + +3.6.9 'omp_get_initial_device' - Return device number of initial device +----------------------------------------------------------------------- + +_Description_: + This function returns a device number that represents the host + device. Since OpenMP 5.1, this is equal to the value returned by + the 'omp_get_num_devices' function; since OpenMP 6.0 it may also + return the value of 'omp_initial_device'. + + The effect of running this routine in a 'target' region is + unspecified. + +_C/C++_ + _Prototype_: 'int omp_get_initial_device(void);' + +_Fortran_: + _Interface_: 'integer function omp_get_initial_device()' + +_See also_: + *note omp_get_num_devices:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.2.35. + + +File: libgomp.info, Node: Device Memory Routines, Next: Lock Routines, Prev: Device Information Routines, Up: Runtime Library Routines + +3.7 Device Memory Routines +========================== + +Routines related to memory allocation and managing corresponding +pointers on devices. They have C linkage and do not throw exceptions. + +* Menu: + +* omp_target_alloc:: Allocate device memory +* omp_target_free:: Free device memory +* omp_target_is_present:: Check whether storage is mapped +* omp_target_is_accessible:: Check whether memory is device accessible +* omp_target_memcpy:: Copy data between devices +* omp_target_memcpy_async:: Copy data between devices asynchronously +* omp_target_memcpy_rect:: Copy a subvolume of data between devices +* omp_target_memcpy_rect_async:: Copy a subvolume of data between devices asynchronously +* omp_target_associate_ptr:: Associate a device pointer with a host pointer +* omp_target_disassociate_ptr:: Remove device-host pointer association +* omp_get_mapped_ptr:: Return device pointer to a host pointer + + +File: libgomp.info, Node: omp_target_alloc, Next: omp_target_free, Up: Device Memory Routines + +3.7.1 'omp_target_alloc' - Allocate device memory +------------------------------------------------- + +_Description_: + This routine allocates SIZE bytes of memory in the device + environment associated with the device number DEVICE_NUM. If + successful, a device pointer is returned, otherwise a null pointer. + + In GCC, when the device is the host or the device shares memory + with the host, the memory is allocated on the host; in that case, + when SIZE is zero, either NULL or a unique pointer value that can + later be successfully passed to 'omp_target_free' is returned. + When the allocation is not performed on the host, a null pointer is + returned when SIZE is zero; in that case, additionally a diagnostic + might be printed to standard error (stderr). + + Running this routine in a 'target' region except on the initial + device is not supported. + +_C/C++_ + _Prototype_: 'void *omp_target_alloc(size_t size, int device_num)' + +_Fortran_: + _Interface_: 'type(c_ptr) function omp_target_alloc(size, device_num) + bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_int, + c_size_t' + 'integer(c_size_t), value :: size' + 'integer(c_int), value :: device_num' + +_See also_: + *note omp_target_free::, *note omp_target_associate_ptr:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.1 + + +File: libgomp.info, Node: omp_target_free, Next: omp_target_is_present, Prev: omp_target_alloc, Up: Device Memory Routines + +3.7.2 'omp_target_free' - Free device memory +-------------------------------------------- + +_Description_: + This routine frees memory allocated by the 'omp_target_alloc' + routine. The DEVICE_PTR argument must be either a null pointer or + a device pointer returned by 'omp_target_alloc' for the specified + 'device_num'. The device number DEVICE_NUM must be a conforming + device number. + + Running this routine in a 'target' region except on the initial + device is not supported. + +_C/C++_ + _Prototype_: 'void omp_target_free(void *device_ptr, int device_num)' + +_Fortran_: + _Interface_: 'subroutine omp_target_free(device_ptr, device_num) + bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_int' + 'type(c_ptr), value :: device_ptr' + 'integer(c_int), value :: device_num' + +_See also_: + *note omp_target_alloc::, *note omp_target_disassociate_ptr:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.2 + + +File: libgomp.info, Node: omp_target_is_present, Next: omp_target_is_accessible, Prev: omp_target_free, Up: Device Memory Routines + +3.7.3 'omp_target_is_present' - Check whether storage is mapped +--------------------------------------------------------------- + +_Description_: + This routine tests whether storage, identified by the host pointer + PTR is mapped to the device specified by DEVICE_NUM. If so, it + returns a nonzero value and otherwise zero. + + In GCC, this includes self mapping such that + 'omp_target_is_present' returns _true_ when DEVICE_NUM specifies + the host or when the host and the device share memory. If PTR is a + null pointer, TRUE is returned and if DEVICE_NUM is an invalid + device number, FALSE is returned. + + If those conditions do not apply, _true_ is returned if the + association has been established by an explicit or implicit 'map' + clause, the 'declare target' directive or a call to the + 'omp_target_associate_ptr' routine. + + Running this routine in a 'target' region except on the initial + device is not supported. + +_C/C++_ + _Prototype_: 'int omp_target_is_present(const void *ptr,' + ' int device_num)' + +_Fortran_: + _Interface_: 'integer(c_int) function omp_target_is_present(ptr, &' + ' device_num) bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_int' + 'type(c_ptr), value :: ptr' + 'integer(c_int), value :: device_num' + +_See also_: + *note omp_target_associate_ptr:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.3 + + +File: libgomp.info, Node: omp_target_is_accessible, Next: omp_target_memcpy, Prev: omp_target_is_present, Up: Device Memory Routines + +3.7.4 'omp_target_is_accessible' - Check whether memory is device accessible +---------------------------------------------------------------------------- + +_Description_: + This routine tests whether memory, starting at the address given by + PTR and extending SIZE bytes, is accessibly on the device specified + by DEVICE_NUM. If so, it returns a nonzero value and otherwise + zero. + + The address given by PTR is interpreted to be in the address space + of the device and SIZE must be positive. + + Note that GCC's current implementation assumes that PTR is a valid + host pointer. Therefore, all addresses given by PTR are assumed to + be accessible on the initial device. And, to err on the safe side, + this memory is only available on a non-host device that can access + all host memory ([uniform] shared memory access). + + Running this routine in a 'target' region except on the initial + device is not supported. + +_C/C++_ + _Prototype_: 'int omp_target_is_accessible(const void *ptr,' + ' size_t size,' + ' int device_num)' + +_Fortran_: + _Interface_: 'integer(c_int) function omp_target_is_accessible(ptr, + &' + ' size, device_num) bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, + c_int' + 'type(c_ptr), value :: ptr' + 'integer(c_size_t), value :: size' + 'integer(c_int), value :: device_num' + +_See also_: + *note omp_target_associate_ptr:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.4 + + +File: libgomp.info, Node: omp_target_memcpy, Next: omp_target_memcpy_async, Prev: omp_target_is_accessible, Up: Device Memory Routines + +3.7.5 'omp_target_memcpy' - Copy data between devices +----------------------------------------------------- + +_Description_: + This routine copies LENGTH of bytes of data from the device + identified by device number SRC_DEVICE_NUM to device + DST_DEVICE_NUM. The data is copied from the source device from the + address provided by SRC, shifted by the offset of SRC_OFFSET bytes, + to the destination device's DST address shifted by DST_OFFSET. The + routine returns zero on success and non-zero otherwise. + + Running this routine in a 'target' region except on the initial + device is not supported. + +_C/C++_ + _Prototype_: 'int omp_target_memcpy(void *dst,' + ' const void *src,' + ' size_t length,' + ' size_t dst_offset,' + ' size_t src_offset,' + ' int dst_device_num,' + ' int src_device_num)' + +_Fortran_: + _Interface_: 'integer(c_int) function omp_target_memcpy( &' + ' dst, src, length, dst_offset, src_offset, &' + ' dst_device_num, src_device_num) bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, + c_int' + 'type(c_ptr), value :: dst, src' + 'integer(c_size_t), value :: length, dst_offset, + src_offset' + 'integer(c_int), value :: dst_device_num, + src_device_num' + +_See also_: + *note omp_target_memcpy_async::, *note omp_target_memcpy_rect:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.5 + + +File: libgomp.info, Node: omp_target_memcpy_async, Next: omp_target_memcpy_rect, Prev: omp_target_memcpy, Up: Device Memory Routines + +3.7.6 'omp_target_memcpy_async' - Copy data between devices asynchronously +-------------------------------------------------------------------------- + +_Description_: + This routine copies asynchronously LENGTH of bytes of data from the + device identified by device number SRC_DEVICE_NUM to device + DST_DEVICE_NUM. The data is copied from the source device from the + address provided by SRC, shifted by the offset of SRC_OFFSET bytes, + to the destination device's DST address shifted by DST_OFFSET. + Task dependence is expressed by passing an array of depend objects + to DEPOBJ_LIST, where the number of array elements is passed as + DEPOBJ_COUNT; if the count is zero, the DEPOBJ_LIST argument is + ignored. In C++ and Fortran, the DEPOBJ_LIST argument can also be + omitted in that case. The routine returns zero if the copying + process has successfully been started and non-zero otherwise. + + Running this routine in a 'target' region except on the initial + device is not supported. + +_C/C++_ + _Prototype_: 'int omp_target_memcpy_async(void *dst,' + ' const void *src,' + ' size_t length,' + ' size_t dst_offset,' + ' size_t src_offset,' + ' int dst_device_num,' + ' int src_device_num,' + ' int depobj_count,' + ' omp_depend_t *depobj_list)' + +_Fortran_: + _Interface_: 'integer(c_int) function omp_target_memcpy_async( &' + ' dst, src, length, dst_offset, src_offset, &' + ' dst_device_num, src_device_num, &' + ' depobj_count, depobj_list) bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, + c_int' + 'type(c_ptr), value :: dst, src' + 'integer(c_size_t), value :: length, dst_offset, + src_offset' + 'integer(c_int), value :: dst_device_num, + src_device_num, depobj_count' + 'integer(omp_depend_kind), optional :: depobj_list(*)' + +_See also_: + *note omp_target_memcpy::, *note omp_target_memcpy_rect_async:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.7 + + +File: libgomp.info, Node: omp_target_memcpy_rect, Next: omp_target_memcpy_rect_async, Prev: omp_target_memcpy_async, Up: Device Memory Routines + +3.7.7 'omp_target_memcpy_rect' - Copy a subvolume of data between devices +------------------------------------------------------------------------- + +_Description_: + This routine copies a subvolume of data from the device identified + by device number SRC_DEVICE_NUM to device DST_DEVICE_NUM. The + array has NUM_DIMS dimensions and each array element has a size of + ELEMENT_SIZE bytes. The VOLUME array specifies how many elements + per dimension are copied. The full sizes of the destination and + source arrays are given by the DST_DIMENSIONS and SRC_DIMENSIONS + arguments, respectively. The offset per dimension to the first + element to be copied is given by the DST_OFFSET and SRC_OFFSET + arguments. The routine returns zero on success and non-zero + otherwise. + + The OpenMP specification only requires that NUM_DIMS up to three is + supported. In order to find implementation-specific maximally + supported number of dimensions, the routine returns this value when + invoked with a null pointer to both the DST and SRC arguments. As + GCC supports arbitrary dimensions, it returns 'INT_MAX'. + + The device-number arguments must be conforming device numbers, the + SRC and DST must be either both null pointers or all of the + following must be fulfilled: ELEMENT_SIZE and NUM_DIMS must be + positive and the VOLUME, offset and dimension arrays must have at + least NUM_DIMS dimensions. + + Running this routine in a 'target' region is not supported except + on the initial device. + +_C/C++_ + _Prototype_: 'int omp_target_memcpy_rect(void *dst,' + ' const void *src,' + ' size_t element_size,' + ' int num_dims,' + ' const size_t *volume,' + ' const size_t *dst_offset,' + ' const size_t *src_offset,' + ' const size_t *dst_dimensions,' + ' const size_t *src_dimensions,' + ' int dst_device_num,' + ' int src_device_num)' + +_Fortran_: + _Interface_: 'integer(c_int) function omp_target_memcpy_rect( &' + ' dst, src, element_size, num_dims, volume, &' + ' dst_offset, src_offset, dst_dimensions, &' + ' src_dimensions, dst_device_num, src_device_num) + bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, + c_int' + 'type(c_ptr), value :: dst, src' + 'integer(c_size_t), value :: element_size, dst_offset, + src_offset' + 'integer(c_size_t), value :: volume, dst_dimensions, + src_dimensions' + 'integer(c_int), value :: num_dims, dst_device_num, + src_device_num' + +_See also_: + *note omp_target_memcpy_rect_async::, *note omp_target_memcpy::, + *note Offload-Target Specifics:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.6 + + +File: libgomp.info, Node: omp_target_memcpy_rect_async, Next: omp_target_associate_ptr, Prev: omp_target_memcpy_rect, Up: Device Memory Routines + +3.7.8 'omp_target_memcpy_rect_async' - Copy a subvolume of data between devices asynchronously +---------------------------------------------------------------------------------------------- + +_Description_: + This routine copies asynchronously a subvolume of data from the + device identified by device number SRC_DEVICE_NUM to device + DST_DEVICE_NUM. The array has NUM_DIMS dimensions and each array + element has a size of ELEMENT_SIZE bytes. The VOLUME array + specifies how many elements per dimension are copied. The full + sizes of the destination and source arrays are given by the + DST_DIMENSIONS and SRC_DIMENSIONS arguments, respectively. The + offset per dimension to the first element to be copied is given by + the DST_OFFSET and SRC_OFFSET arguments. Task dependence is + expressed by passing an array of depend objects to DEPOBJ_LIST, + where the number of array elements is passed as DEPOBJ_COUNT; if + the count is zero, the DEPOBJ_LIST argument is ignored. In C++ and + Fortran, the DEPOBJ_LIST argument can also be omitted in that case. + The routine returns zero on success and non-zero otherwise. + + The OpenMP specification only requires that NUM_DIMS up to three is + supported. In order to find implementation-specific maximally + supported number of dimensions, the routine returns this value when + invoked with a null pointer to both the DST and SRC arguments. As + GCC supports arbitrary dimensions, it returns 'INT_MAX'. + + The device-number arguments must be conforming device numbers, the + SRC and DST must be either both null pointers or all of the + following must be fulfilled: ELEMENT_SIZE and NUM_DIMS must be + positive and the VOLUME, offset and dimension arrays must have at + least NUM_DIMS dimensions. + + Running this routine in a 'target' region is not supported except + on the initial device. + +_C/C++_ + _Prototype_: 'int omp_target_memcpy_rect_async(void *dst,' + ' const void *src,' + ' size_t element_size,' + ' int num_dims,' + ' const size_t *volume,' + ' const size_t *dst_offset,' + ' const size_t *src_offset,' + ' const size_t *dst_dimensions,' + ' const size_t *src_dimensions,' + ' int dst_device_num,' + ' int src_device_num,' + ' int depobj_count,' + ' omp_depend_t *depobj_list)' + +_Fortran_: + _Interface_: 'integer(c_int) function omp_target_memcpy_rect_async( + &' + ' dst, src, element_size, num_dims, volume, &' + ' dst_offset, src_offset, dst_dimensions, &' + ' src_dimensions, dst_device_num, src_device_num, &' + ' depobj_count, depobj_list) bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_size_t, + c_int' + 'type(c_ptr), value :: dst, src' + 'integer(c_size_t), value :: element_size, dst_offset, + src_offset' + 'integer(c_size_t), value :: volume, dst_dimensions, + src_dimensions' + 'integer(c_int), value :: num_dims, dst_device_num, + src_device_num' + 'integer(c_int), value :: depobj_count' + 'integer(omp_depend_kind), optional :: depobj_list(*)' + +_See also_: + *note omp_target_memcpy_rect::, *note omp_target_memcpy_async::, + *note Offload-Target Specifics:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.8 + + +File: libgomp.info, Node: omp_target_associate_ptr, Next: omp_target_disassociate_ptr, Prev: omp_target_memcpy_rect_async, Up: Device Memory Routines + +3.7.9 'omp_target_associate_ptr' - Associate a device pointer with a host pointer +--------------------------------------------------------------------------------- + +_Description_: + This routine associates storage on the host with storage on a + device identified by DEVICE_NUM. The device pointer is usually + obtained by calling 'omp_target_alloc' or by other means (but not + by using the 'map' clauses or the 'declare target' directive). The + host pointer should point to memory that has a storage size of at + least SIZE. + + The DEVICE_OFFSET parameter specifies the offset into DEVICE_PTR + that is used as the base address for the device side of the + mapping; the storage size should be at least DEVICE_OFFSET plus + SIZE. + + After the association, the host pointer can be used in a 'map' + clause and in the 'to' and 'from' clauses of the 'target update' + directive to transfer data between the associated pointers. The + reference count of such associated storage is infinite. The + association can be removed by calling 'omp_target_disassociate_ptr' + which should be done before the lifetime of either storage ends. + + The routine returns nonzero ('EINVAL') when the DEVICE_NUM invalid, + for when the initial device or the associated device shares memory + with the host. 'omp_target_associate_ptr' returns zero if HOST_PTR + points into already associated storage that is fully inside of a + previously associated memory. Otherwise, if the association was + successful zero is returned; if none of the cases above apply, + nonzero ('EINVAL') is returned. + + The 'omp_target_is_present' routine can be used to test whether + associated storage for a device pointer exists. + + Running this routine in a 'target' region except on the initial + device is not supported. + +_C/C++_ + _Prototype_: 'int omp_target_associate_ptr(const void *host_ptr,' + ' const void *device_ptr,' + ' size_t size,' + ' size_t device_offset,' + ' int device_num)' + +_Fortran_: + _Interface_: 'integer(c_int) function + omp_target_associate_ptr(host_ptr, &' + ' device_ptr, size, device_offset, device_num) bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_int, + c_size_t' + 'type(c_ptr), value :: host_ptr, device_ptr' + 'integer(c_size_t), value :: size, device_offset' + 'integer(c_int), value :: device_num' + +_See also_: + *note omp_target_disassociate_ptr::, *note omp_target_is_present::, + *note omp_target_alloc:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.9 + + +File: libgomp.info, Node: omp_target_disassociate_ptr, Next: omp_get_mapped_ptr, Prev: omp_target_associate_ptr, Up: Device Memory Routines + +3.7.10 'omp_target_disassociate_ptr' - Remove device-host pointer association +----------------------------------------------------------------------------- + +_Description_: + This routine removes the storage association established by calling + 'omp_target_associate_ptr' and sets the reference count to zero, + even if 'omp_target_associate_ptr' was invoked multiple times for + for host pointer 'ptr'. If applicable, the device memory needs to + be freed by the user. + + If an associated device storage location for the DEVICE_NUM was + found and has infinite reference count, the association is removed + and zero is returned. In all other cases, nonzero ('EINVAL') is + returned and no other action is taken. + + Note that passing a host pointer where the association to the + device pointer was established with the 'declare target' directive + yields undefined behavior. + + Running this routine in a 'target' region except on the initial + device is not supported. + +_C/C++_ + _Prototype_: 'int omp_target_disassociate_ptr(const void *ptr,' + ' int device_num)' + +_Fortran_: + _Interface_: 'integer(c_int) function + omp_target_disassociate_ptr(ptr, &' + ' device_num) bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_int' + 'type(c_ptr), value :: ptr' + 'integer(c_int), value :: device_num' + +_See also_: + *note omp_target_associate_ptr:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.10 + + +File: libgomp.info, Node: omp_get_mapped_ptr, Prev: omp_target_disassociate_ptr, Up: Device Memory Routines + +3.7.11 'omp_get_mapped_ptr' - Return device pointer to a host pointer +--------------------------------------------------------------------- + +_Description_: + If the device number is refers to the initial device or to a device + with memory accessible from the host (shared memory), the + 'omp_get_mapped_ptr' routines returns the value of the passed PTR. + Otherwise, if associated storage to the passed host pointer PTR + exists on device associated with DEVICE_NUM, it returns that + pointer. In all other cases and in cases of an error, a null + pointer is returned. + + The association of storage location is established either via an + explicit or implicit 'map' clause, the 'declare target' directive + or the 'omp_target_associate_ptr' routine. + + Running this routine in a 'target' region except on the initial + device is not supported. + +_C/C++_ + _Prototype_: 'void *omp_get_mapped_ptr(const void *ptr, int + device_num);' + +_Fortran_: + _Interface_: 'type(c_ptr) function omp_get_mapped_ptr(ptr, + device_num) bind(C)' + 'use, intrinsic :: iso_c_binding, only: c_ptr, c_int' + 'type(c_ptr), value :: ptr' + 'integer(c_int), value :: device_num' + +_See also_: + *note omp_target_associate_ptr:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.8.11 + + +File: libgomp.info, Node: Lock Routines, Next: Timing Routines, Prev: Device Memory Routines, Up: Runtime Library Routines + +3.8 Lock Routines +================= + +Initialize, set, test, unset and destroy simple and nested locks. The +routines have C linkage and do not throw exceptions. + +* Menu: + +* omp_init_lock:: Initialize simple lock +* omp_init_nest_lock:: Initialize nested lock +* omp_destroy_lock:: Destroy simple lock +* omp_destroy_nest_lock:: Destroy nested lock +* omp_set_lock:: Wait for and set simple lock +* omp_set_nest_lock:: Wait for and set simple lock +* omp_unset_lock:: Unset simple lock +* omp_unset_nest_lock:: Unset nested lock +* omp_test_lock:: Test and set simple lock if available +* omp_test_nest_lock:: Test and set nested lock if available + + +File: libgomp.info, Node: omp_init_lock, Next: omp_init_nest_lock, Up: Lock Routines + +3.8.1 'omp_init_lock' - Initialize simple lock +---------------------------------------------- + +_Description_: + Initialize a simple lock. After initialization, the lock is in an + unlocked state. + +_C/C++_: + _Prototype_: 'void omp_init_lock(omp_lock_t *lock);' + +_Fortran_: + _Interface_: 'subroutine omp_init_lock(svar)' + 'integer(omp_lock_kind), intent(out) :: svar' + +_See also_: + *note omp_destroy_lock:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.1. + + +File: libgomp.info, Node: omp_init_nest_lock, Next: omp_destroy_lock, Prev: omp_init_lock, Up: Lock Routines + +3.8.2 'omp_init_nest_lock' - Initialize nested lock +--------------------------------------------------- + +_Description_: + Initialize a nested lock. After initialization, the lock is in an + unlocked state and the nesting count is set to zero. + +_C/C++_: + _Prototype_: 'void omp_init_nest_lock(omp_nest_lock_t *lock);' + +_Fortran_: + _Interface_: 'subroutine omp_init_nest_lock(nvar)' + 'integer(omp_nest_lock_kind), intent(out) :: nvar' + +_See also_: + *note omp_destroy_nest_lock:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.1. + + +File: libgomp.info, Node: omp_destroy_lock, Next: omp_destroy_nest_lock, Prev: omp_init_nest_lock, Up: Lock Routines + +3.8.3 'omp_destroy_lock' - Destroy simple lock +---------------------------------------------- + +_Description_: + Destroy a simple lock. In order to be destroyed, a simple lock + must be in the unlocked state. + +_C/C++_: + _Prototype_: 'void omp_destroy_lock(omp_lock_t *lock);' + +_Fortran_: + _Interface_: 'subroutine omp_destroy_lock(svar)' + 'integer(omp_lock_kind), intent(inout) :: svar' + +_See also_: + *note omp_init_lock:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.3. + + +File: libgomp.info, Node: omp_destroy_nest_lock, Next: omp_set_lock, Prev: omp_destroy_lock, Up: Lock Routines + +3.8.4 'omp_destroy_nest_lock' - Destroy nested lock +--------------------------------------------------- + +_Description_: + Destroy a nested lock. In order to be destroyed, a nested lock + must be in the unlocked state and its nesting count must equal + zero. + +_C/C++_: + _Prototype_: 'void omp_destroy_nest_lock(omp_nest_lock_t *);' + +_Fortran_: + _Interface_: 'subroutine omp_destroy_nest_lock(nvar)' + 'integer(omp_nest_lock_kind), intent(inout) :: nvar' + +_See also_: + *note omp_init_lock:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.3. + + +File: libgomp.info, Node: omp_set_lock, Next: omp_set_nest_lock, Prev: omp_destroy_nest_lock, Up: Lock Routines + +3.8.5 'omp_set_lock' - Wait for and set simple lock +--------------------------------------------------- + +_Description_: + Before setting a simple lock, the lock variable must be initialized + by 'omp_init_lock'. The calling thread is blocked until the lock + is available. If the lock is already held by the current thread, a + deadlock occurs. + +_C/C++_: + _Prototype_: 'void omp_set_lock(omp_lock_t *lock);' + +_Fortran_: + _Interface_: 'subroutine omp_set_lock(svar)' + 'integer(omp_lock_kind), intent(inout) :: svar' + +_See also_: + *note omp_init_lock::, *note omp_test_lock::, *note + omp_unset_lock:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.4. + + +File: libgomp.info, Node: omp_set_nest_lock, Next: omp_unset_lock, Prev: omp_set_lock, Up: Lock Routines + +3.8.6 'omp_set_nest_lock' - Wait for and set nested lock +-------------------------------------------------------- + +_Description_: + Before setting a nested lock, the lock variable must be initialized + by 'omp_init_nest_lock'. The calling thread is blocked until the + lock is available. If the lock is already held by the current + thread, the nesting count for the lock is incremented. + +_C/C++_: + _Prototype_: 'void omp_set_nest_lock(omp_nest_lock_t *lock);' + +_Fortran_: + _Interface_: 'subroutine omp_set_nest_lock(nvar)' + 'integer(omp_nest_lock_kind), intent(inout) :: nvar' + +_See also_: + *note omp_init_nest_lock::, *note omp_unset_nest_lock:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.4. + + +File: libgomp.info, Node: omp_unset_lock, Next: omp_unset_nest_lock, Prev: omp_set_nest_lock, Up: Lock Routines + +3.8.7 'omp_unset_lock' - Unset simple lock +------------------------------------------ + +_Description_: + A simple lock about to be unset must have been locked by + 'omp_set_lock' or 'omp_test_lock' before. In addition, the lock + must be held by the thread calling 'omp_unset_lock'. Then, the + lock becomes unlocked. If one or more threads attempted to set the + lock before, one of them is chosen to, again, set the lock to + itself. + +_C/C++_: + _Prototype_: 'void omp_unset_lock(omp_lock_t *lock);' + +_Fortran_: + _Interface_: 'subroutine omp_unset_lock(svar)' + 'integer(omp_lock_kind), intent(inout) :: svar' + +_See also_: + *note omp_set_lock::, *note omp_test_lock:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.5. + + +File: libgomp.info, Node: omp_unset_nest_lock, Next: omp_test_lock, Prev: omp_unset_lock, Up: Lock Routines + +3.8.8 'omp_unset_nest_lock' - Unset nested lock +----------------------------------------------- + +_Description_: + A nested lock about to be unset must have been locked by + 'omp_set_nested_lock' or 'omp_test_nested_lock' before. In + addition, the lock must be held by the thread calling + 'omp_unset_nested_lock'. If the nesting count drops to zero, the + lock becomes unlocked. If one ore more threads attempted to set + the lock before, one of them is chosen to, again, set the lock to + itself. + +_C/C++_: + _Prototype_: 'void omp_unset_nest_lock(omp_nest_lock_t *lock);' + +_Fortran_: + _Interface_: 'subroutine omp_unset_nest_lock(nvar)' + 'integer(omp_nest_lock_kind), intent(inout) :: nvar' + +_See also_: + *note omp_set_nest_lock:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.5. + + +File: libgomp.info, Node: omp_test_lock, Next: omp_test_nest_lock, Prev: omp_unset_nest_lock, Up: Lock Routines + +3.8.9 'omp_test_lock' - Test and set simple lock if available +------------------------------------------------------------- + +_Description_: + Before setting a simple lock, the lock variable must be initialized + by 'omp_init_lock'. Contrary to 'omp_set_lock', 'omp_test_lock' + does not block if the lock is not available. This function returns + 'true' upon success, 'false' otherwise. Here, 'true' and 'false' + represent their language-specific counterparts. + +_C/C++_: + _Prototype_: 'int omp_test_lock(omp_lock_t *lock);' + +_Fortran_: + _Interface_: 'logical function omp_test_lock(svar)' + 'integer(omp_lock_kind), intent(inout) :: svar' + +_See also_: + *note omp_init_lock::, *note omp_set_lock::, *note omp_set_lock:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.6. + + +File: libgomp.info, Node: omp_test_nest_lock, Prev: omp_test_lock, Up: Lock Routines + +3.8.10 'omp_test_nest_lock' - Test and set nested lock if available +------------------------------------------------------------------- + +_Description_: + Before setting a nested lock, the lock variable must be initialized + by 'omp_init_nest_lock'. Contrary to 'omp_set_nest_lock', + 'omp_test_nest_lock' does not block if the lock is not available. + If the lock is already held by the current thread, the new nesting + count is returned. Otherwise, the return value equals zero. + +_C/C++_: + _Prototype_: 'int omp_test_nest_lock(omp_nest_lock_t *lock);' + +_Fortran_: + _Interface_: 'logical function omp_test_nest_lock(nvar)' + 'integer(omp_nest_lock_kind), intent(inout) :: nvar' + +_See also_: + *note omp_init_lock::, *note omp_set_lock::, *note omp_set_lock:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.3.6. + + +File: libgomp.info, Node: Timing Routines, Next: Event Routine, Prev: Lock Routines, Up: Runtime Library Routines + +3.9 Timing Routines +=================== + +Portable, thread-based, wall clock timer. The routines have C linkage +and do not throw exceptions. + +* Menu: + +* omp_get_wtick:: Get timer precision. +* omp_get_wtime:: Elapsed wall clock time. + + +File: libgomp.info, Node: omp_get_wtick, Next: omp_get_wtime, Up: Timing Routines + +3.9.1 'omp_get_wtick' - Get timer precision +------------------------------------------- + +_Description_: + Gets the timer precision, i.e., the number of seconds between two + successive clock ticks. + +_C/C++_: + _Prototype_: 'double omp_get_wtick(void);' + +_Fortran_: + _Interface_: 'double precision function omp_get_wtick()' + +_See also_: + *note omp_get_wtime:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.4.2. + + +File: libgomp.info, Node: omp_get_wtime, Prev: omp_get_wtick, Up: Timing Routines + +3.9.2 'omp_get_wtime' - Elapsed wall clock time +----------------------------------------------- + +_Description_: + Elapsed wall clock time in seconds. The time is measured per + thread, no guarantee can be made that two distinct threads measure + the same time. Time is measured from some "time in the past", + which is an arbitrary time guaranteed not to change during the + execution of the program. + +_C/C++_: + _Prototype_: 'double omp_get_wtime(void);' + +_Fortran_: + _Interface_: 'double precision function omp_get_wtime()' + +_See also_: + *note omp_get_wtick:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 3.4.1. + + +File: libgomp.info, Node: Event Routine, Next: Interoperability Routines, Prev: Timing Routines, Up: Runtime Library Routines + +3.10 Event Routine +================== + +Support for event objects. The routine has C linkage and do not throw +exceptions. + +* Menu: + +* omp_fulfill_event:: Fulfill and destroy an OpenMP event. + + +File: libgomp.info, Node: omp_fulfill_event, Up: Event Routine + +3.10.1 'omp_fulfill_event' - Fulfill and destroy an OpenMP event +---------------------------------------------------------------- + +_Description_: + Fulfill the event associated with the event handle argument. + Currently, it is only used to fulfill events generated by detach + clauses on task constructs - the effect of fulfilling the event is + to allow the task to complete. + + The result of calling 'omp_fulfill_event' with an event handle + other than that generated by a detach clause is undefined. Calling + it with an event handle that has already been fulfilled is also + undefined. + +_C/C++_: + _Prototype_: 'void omp_fulfill_event(omp_event_handle_t event);' + +_Fortran_: + _Interface_: 'subroutine omp_fulfill_event(event)' + 'integer (kind=omp_event_handle_kind) :: event' + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.5.1. + + +File: libgomp.info, Node: Interoperability Routines, Next: Memory Management Routines, Prev: Event Routine, Up: Runtime Library Routines + +3.11 Interoperability Routines +============================== + +Routines to obtain properties from an object of OpenMP interop type. +They have C linkage and do not throw exceptions. + +* Menu: + +* omp_get_num_interop_properties:: Get the number of implementation-specific properties +* omp_get_interop_int:: Obtain integer-valued interoperability property +* omp_get_interop_ptr:: Obtain pointer-valued interoperability property +* omp_get_interop_str:: Obtain string-valued interoperability property +* omp_get_interop_name:: Obtain the name of an interop_property value as string +* omp_get_interop_type_desc:: Obtain type and description to an interop_property +* omp_get_interop_rc_desc:: Obtain error string to an interop_rc error code + + +File: libgomp.info, Node: omp_get_num_interop_properties, Next: omp_get_interop_int, Up: Interoperability Routines + +3.11.1 'omp_get_num_interop_properties' - Get the number of implementation-specific properties +---------------------------------------------------------------------------------------------- + +_Description_: + The 'omp_get_num_interop_properties' function returns the number of + implementation-defined interoperability properties available for + the passed INTEROP, extending the OpenMP-defined properties. The + available OpenMP interop_property-type values range from + 'omp_ipr_first' to the value returned by + 'omp_get_num_interop_properties' minus one. + + No implementation-defined properties are currently defined in GCC. + +_C/C++_: + _Prototype_: 'int omp_get_num_interop_properties(const omp_interop_t + interop)' + +_Fortran_: + _Interface_: 'integer function + omp_get_num_interop_properties(interop)' + 'integer(omp_interop_kind), intent(in) :: interop' + +_See also_: + *note omp_get_interop_name::, *note omp_get_interop_type_desc:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.12.1, + OpenMP specification v6.0 (https://www.openmp.org), Section 26.1 + + +File: libgomp.info, Node: omp_get_interop_int, Next: omp_get_interop_ptr, Prev: omp_get_num_interop_properties, Up: Interoperability Routines + +3.11.2 'omp_get_interop_int' - Obtain integer-valued interoperability property +------------------------------------------------------------------------------ + +_Description_: + The 'omp_get_interop_int' function returns the integer value + associated with the PROPERTY_ID interoperability property of the + passed INTEROP object. The RET_CODE argument is optional, i.e. it + can be omitted in C++ and Fortran or used with 'NULL' as argument + in C and C++. If successful, RET_CODE (if present) is set to + 'omp_irc_success'. + + In GCC, the effect of running this routine in a 'target' region + that is not the initial device is unspecified. + +_C/C++_: + _Prototype_: 'omp_intptr_t omp_get_interop_int(const omp_interop_t + interop, omp_interop_property_t property_id, + omp_interop_rc_t *ret_code)' + +_Fortran_: + _Interface_: 'integer(c_intptr_t) function + omp_get_interop_int(interop, property_id, ret_code)' + 'use, intrinsic :: iso_c_binding, only : c_intptr_t' + 'integer(omp_interop_kind), intent(in) :: interop' + 'integer(omp_interop_property_kind) property_id' + 'integer(omp_interop_rc_kind), optional, intent(out) :: + ret_code' + +_See also_: + *note omp_get_interop_ptr::, *note omp_get_interop_str::, *note + omp_get_interop_rc_desc::, *note Offload-Target Specifics:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.12.2, + OpenMP specification v6.0 (https://www.openmp.org), Section 26.2 + + +File: libgomp.info, Node: omp_get_interop_ptr, Next: omp_get_interop_str, Prev: omp_get_interop_int, Up: Interoperability Routines + +3.11.3 'omp_get_interop_ptr' - Obtain pointer-valued interoperability property +------------------------------------------------------------------------------ + +_Description_: + The 'omp_get_interop_int' function returns the pointer value + associated with the PROPERTY_ID interoperability property of the + passed INTEROP object. The RET_CODE argument is optional, i.e. it + can be omitted in C++ and Fortran or used with 'NULL' as argument + in C and C++. If successful, RET_CODE (if present) is set to + 'omp_irc_success'. + + In GCC, the effect of running this routine in a 'target' region + that is not the initial device is unspecified. + +_C/C++_: + _Prototype_: 'void *omp_get_interop_ptr(const omp_interop_t interop, + omp_interop_property_t property_id, omp_interop_rc_t + *ret_code)' + +_Fortran_: + _Interface_: 'type(c_ptr) function omp_get_interop_int(interop, + property_id, ret_code)' + 'use, intrinsic :: iso_c_binding, only : c_ptr' + 'integer(omp_interop_kind), intent(in) :: interop' + 'integer(omp_interop_property_kind) property_id' + 'integer(omp_interop_rc_kind), optional, intent(out) :: + ret_code' + +_See also_: + *note omp_get_interop_int::, *note omp_get_interop_str::, *note + omp_get_interop_rc_desc::, *note Offload-Target Specifics:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.12.3, + OpenMP specification v6.0 (https://www.openmp.org), Section 26.3 + + +File: libgomp.info, Node: omp_get_interop_str, Next: omp_get_interop_name, Prev: omp_get_interop_ptr, Up: Interoperability Routines + +3.11.4 'omp_get_interop_str' - Obtain string-valued interoperability property +----------------------------------------------------------------------------- + +_Description_: + The 'omp_get_interop_str' function returns the string value + associated with the PROPERTY_ID interoperability property of the + passed INTEROP object. The RET_CODE argument is optional, i.e. it + can be omitted in C++ and Fortran or used with 'NULL' as argument + in C and C++. If successful, RET_CODE (if present) is set to + 'omp_irc_success'. + + In GCC, the effect of running this routine in a 'target' region + that is not the initial device is unspecified. + +_C/C++_: + _Prototype_: 'const char *omp_get_interop_str(const omp_interop_t + interop, omp_interop_property_t property_id, + omp_interop_rc_t *ret_code)' + +_Fortran_: + _Interface_: 'character(:) function omp_get_interop_str(interop, + property_id, ret_code)' + 'pointer :: omp_get_interop_str' + 'integer(omp_interop_kind), intent(in) :: interop' + 'integer(omp_interop_property_kind) property_id' + 'integer(omp_interop_rc_kind), optional, intent(out) :: + ret_code' + +_See also_: + *note omp_get_interop_int::, *note omp_get_interop_ptr::, *note + omp_get_interop_rc_desc::, *note Offload-Target Specifics:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.12.4, + OpenMP specification v6.0 (https://www.openmp.org), Section 26.4 + + +File: libgomp.info, Node: omp_get_interop_name, Next: omp_get_interop_type_desc, Prev: omp_get_interop_str, Up: Interoperability Routines + +3.11.5 'omp_get_interop_name' - Obtain the name of an 'interop_property' value as string +---------------------------------------------------------------------------------------- + +_Description_: + The 'omp_get_interop_name' function returns the name of the + property itself as string; for the properties specified by the + OpenMP specification, the name matches the name of the named + constant with the 'omp_ipr_' prefix removed. + +_C/C++_: + _Prototype_: 'const char *omp_get_interop_name(const omp_interop_t + interop, omp_interop_property_t property_id)' + +_Fortran_: + _Interface_: 'character(:) function omp_get_interop_name(interop, + property_id)' + 'pointer :: omp_get_interop_name' + 'integer(omp_interop_kind), intent(in) :: interop' + 'integer(omp_interop_property_kind) property_id' + +_See also_: + *note omp_get_num_interop_properties::, *note + omp_get_interop_type_desc:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.12.5, + OpenMP specification v6.0 (https://www.openmp.org), Section 26.5 + + +File: libgomp.info, Node: omp_get_interop_type_desc, Next: omp_get_interop_rc_desc, Prev: omp_get_interop_name, Up: Interoperability Routines + +3.11.6 'omp_get_interop_type_desc' - Obtain type and description to an 'interop_property' +----------------------------------------------------------------------------------------- + +_Description_: + The 'omp_get_interop_type_desc' function returns a string that + describes in human-readable form the data type associated with the + PROPERTY_ID interoperability property of the passed INTEROP object. + + In GCC, this function returns the name of the C/C++ data type for + this property or 'N/A' if this property is not available for the + given foreign runtime. If INTEROP is 'omp_interop_none' or for + invalid property values, a null pointer is returned. The effect of + running this routine in a 'target' region that is not the initial + device is unspecified. + +_C/C++_: + _Prototype_: 'const char *omp_get_interop_type_desc(const + omp_interop_t interop, omp_interop_property_t + property_id)' + +_Fortran_: + _Interface_: 'character(:) function + omp_get_interop_type_desc(interop, property_id)' + 'pointer :: omp_get_interop_type_desc' + 'integer(omp_interop_kind), intent(in) :: interop' + 'integer(omp_interop_property_kind) property_id' + +_See also_: + *note omp_get_num_interop_properties::, *note + omp_get_interop_name::, *note Offload-Target Specifics:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.12.6, + OpenMP specification v6.0 (https://www.openmp.org), Section 26.6 + + +File: libgomp.info, Node: omp_get_interop_rc_desc, Prev: omp_get_interop_type_desc, Up: Interoperability Routines + +3.11.7 'omp_get_interop_rc_desc' - Obtain error string to an 'interop_rc' error code +------------------------------------------------------------------------------------ + +_Description_: + The 'omp_get_interop_rc_desc' function returns a string value + describing the RET_CODE in human-readable form. + + The behavior is unspecified if value of RET_CODE was not set by an + interoperability routine invoked for INTEROP. + +_C/C++_: + _Prototype_: 'const char *omp_get_interop_rc_desc(const omp_interop_t + interop, omp_interop_rc_t ret_code)' + +_Fortran_: + _Interface_: 'character(:) function omp_get_interop_rc_desc(interop, + property_id, ret_code)' + 'pointer :: omp_get_interop_rc_desc' + 'integer(omp_interop_kind), intent(in) :: interop' + 'integer (omp_interop_rc_kind) ret_code' + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.12.7, + OpenMP specification v6.0 (https://www.openmp.org), Section 26.7 + + +File: libgomp.info, Node: Memory Management Routines, Next: Environment Display Routine, Prev: Interoperability Routines, Up: Runtime Library Routines + +3.12 Memory Management Routines +=============================== + +Routines to manage and allocate memory on the current device. They have +C linkage and do not throw exceptions. + +* Menu: + +* omp_init_allocator:: Create an allocator +* omp_destroy_allocator:: Destroy an allocator +* omp_set_default_allocator:: Set the default allocator +* omp_get_default_allocator:: Get the default allocator +* omp_alloc:: Memory allocation with an allocator +* omp_aligned_alloc:: Memory allocation with an allocator and alignment +* omp_free:: Freeing memory allocated with OpenMP routines +* omp_calloc:: Allocate nullified memory with an allocator +* omp_aligned_calloc:: Allocate nullified aligned memory with an allocator +* omp_realloc:: Reallocate memory allocated with OpenMP routines + + +File: libgomp.info, Node: omp_init_allocator, Next: omp_destroy_allocator, Up: Memory Management Routines + +3.12.1 'omp_init_allocator' - Create an allocator +------------------------------------------------- + +_Description_: + Create an allocator that uses the specified memory space and has + the specified traits; if an allocator that fulfills the + requirements cannot be created, 'omp_null_allocator' is returned. + + The predefined memory spaces and available traits can be found at + *note Memory allocation::, where the trait names have to be + prefixed by 'omp_atk_' (e.g. 'omp_atk_pinned') and the named trait + values by 'omp_atv_' (e.g. 'omp_atv_true'); additionally, + 'omp_atv_default' may be used as trait value to specify that the + default value should be used. + +_C/C++_: + _Prototype_: 'omp_allocator_handle_t omp_init_allocator(' + ' omp_memspace_handle_t memspace,' + ' int ntraits,' + ' const omp_alloctrait_t traits[]);' + +_Fortran_: + _Interface_: 'function omp_init_allocator(memspace, ntraits, traits)' + 'integer (omp_allocator_handle_kind) :: + omp_init_allocator' + 'integer (omp_memspace_handle_kind), intent(in) :: + memspace' + 'integer, intent(in) :: ntraits' + 'type (omp_alloctrait), intent(in) :: traits(*)' + +_See also_: + *note Memory allocation::, *note OMP_ALLOCATOR::, *note + omp_destroy_allocator:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.2 + + +File: libgomp.info, Node: omp_destroy_allocator, Next: omp_set_default_allocator, Prev: omp_init_allocator, Up: Memory Management Routines + +3.12.2 'omp_destroy_allocator' - Destroy an allocator +----------------------------------------------------- + +_Description_: + Releases all resources used by a memory allocator, which must not + represent a predefined memory allocator. Accessing memory after + its allocator has been destroyed has unspecified behavior. Passing + 'omp_null_allocator' to the routine is permitted but has no effect. + +_C/C++_: + _Prototype_: 'void omp_destroy_allocator (omp_allocator_handle_t + allocator);' + +_Fortran_: + _Interface_: 'subroutine omp_destroy_allocator(allocator)' + 'integer (omp_allocator_handle_kind), intent(in) :: + allocator' + +_See also_: + *note omp_init_allocator:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.3 + + +File: libgomp.info, Node: omp_set_default_allocator, Next: omp_get_default_allocator, Prev: omp_destroy_allocator, Up: Memory Management Routines + +3.12.3 'omp_set_default_allocator' - Set the default allocator +-------------------------------------------------------------- + +_Description_: + Sets the default allocator that is used when no allocator has been + specified in the 'allocate' or 'allocator' clause or if an OpenMP + memory routine is invoked with the 'omp_null_allocator' allocator. + +_C/C++_: + _Prototype_: 'void omp_set_default_allocator(omp_allocator_handle_t + allocator);' + +_Fortran_: + _Interface_: 'subroutine omp_set_default_allocator(allocator)' + 'integer (omp_allocator_handle_kind), intent(in) :: + allocator' + +_See also_: + *note omp_get_default_allocator::, *note omp_init_allocator::, + *note OMP_ALLOCATOR::, *note Memory allocation:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.4 + + +File: libgomp.info, Node: omp_get_default_allocator, Next: omp_alloc, Prev: omp_set_default_allocator, Up: Memory Management Routines + +3.12.4 'omp_get_default_allocator' - Get the default allocator +-------------------------------------------------------------- + +_Description_: + The routine returns the default allocator that is used when no + allocator has been specified in the 'allocate' or 'allocator' + clause or if an OpenMP memory routine is invoked with the + 'omp_null_allocator' allocator. + +_C/C++_: + _Prototype_: 'omp_allocator_handle_t omp_get_default_allocator();' + +_Fortran_: + _Interface_: 'function omp_get_default_allocator()' + 'integer (omp_allocator_handle_kind) :: + omp_get_default_allocator' + +_See also_: + *note omp_set_default_allocator::, *note OMP_ALLOCATOR:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.5 + + +File: libgomp.info, Node: omp_alloc, Next: omp_aligned_alloc, Prev: omp_get_default_allocator, Up: Memory Management Routines + +3.12.5 'omp_alloc' - Memory allocation with an allocator +-------------------------------------------------------- + +_Description_: + Allocate memory with the specified allocator, which can either be a + predefined allocator, an allocator handle or 'omp_null_allocator'. + If the allocators is 'omp_null_allocator', the allocator specified + by the DEF-ALLOCATOR-VAR ICV is used. SIZE must be a nonnegative + number denoting the number of bytes to be allocated; if SIZE is + zero, 'omp_alloc' will return a null pointer. If successful, a + pointer to the allocated memory is returned, otherwise the + 'fallback' trait of the allocator determines the behavior. The + content of the allocated memory is unspecified. + + In 'target' regions, either the 'dynamic_allocators' clause must + appear on a 'requires' directive in the same compilation unit - or + the ALLOCATOR argument may only be a constant expression with the + value of one of the predefined allocators and may not be + 'omp_null_allocator'. + + Memory allocated by 'omp_alloc' must be freed using 'omp_free'. + +_C_: + _Prototype_: 'void* omp_alloc(size_t size,' + ' omp_allocator_handle_t allocator)' + +_C++_: + _Prototype_: 'void* omp_alloc(size_t size,' + ' omp_allocator_handle_t allocator=omp_null_allocator)' + +_Fortran_: + _Interface_: 'type(c_ptr) function omp_alloc(size, allocator) + bind(C)' + 'use, intrinsic :: iso_c_binding, only : c_ptr, + c_size_t' + 'integer (c_size_t), value :: size' + 'integer (omp_allocator_handle_kind), value :: + allocator' + +_See also_: + *note OMP_ALLOCATOR::, *note Memory allocation::, *note + omp_set_default_allocator::, *note omp_free::, *note + omp_init_allocator:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.6 + + +File: libgomp.info, Node: omp_aligned_alloc, Next: omp_free, Prev: omp_alloc, Up: Memory Management Routines + +3.12.6 'omp_aligned_alloc' - Memory allocation with an allocator and alignment +------------------------------------------------------------------------------ + +_Description_: + Allocate memory with the specified allocator, which can either be a + predefined allocator, an allocator handle or 'omp_null_allocator'. + If the allocators is 'omp_null_allocator', the allocator specified + by the DEF-ALLOCATOR-VAR ICV is used. ALIGNMENT must be a positive + power of two and SIZE must be a nonnegative number that is a + multiple of the alignment and denotes the number of bytes to be + allocated; if SIZE is zero, 'omp_aligned_alloc' will return a null + pointer. The alignment will be at least the maximal value required + by 'alignment' trait of the allocator and the value of the passed + ALIGNMENT argument. If successful, a pointer to the allocated + memory is returned, otherwise the 'fallback' trait of the allocator + determines the behavior. The content of the allocated memory is + unspecified. + + In 'target' regions, either the 'dynamic_allocators' clause must + appear on a 'requires' directive in the same compilation unit - or + the ALLOCATOR argument may only be a constant expression with the + value of one of the predefined allocators and may not be + 'omp_null_allocator'. + + Memory allocated by 'omp_aligned_alloc' must be freed using + 'omp_free'. + +_C_: + _Prototype_: 'void* omp_aligned_alloc(size_t alignment,' + ' size_t size,' + ' omp_allocator_handle_t allocator)' + +_C++_: + _Prototype_: 'void* omp_aligned_alloc(size_t alignment,' + ' size_t size,' + ' omp_allocator_handle_t allocator=omp_null_allocator)' + +_Fortran_: + _Interface_: 'type(c_ptr) function omp_aligned_alloc(alignment, size, + allocator) bind(C)' + 'use, intrinsic :: iso_c_binding, only : c_ptr, + c_size_t' + 'integer (c_size_t), value :: alignment, size' + 'integer (omp_allocator_handle_kind), value :: + allocator' + +_See also_: + *note OMP_ALLOCATOR::, *note Memory allocation::, *note + omp_set_default_allocator::, *note omp_free::, *note + omp_init_allocator:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.13.6 + + +File: libgomp.info, Node: omp_free, Next: omp_calloc, Prev: omp_aligned_alloc, Up: Memory Management Routines + +3.12.7 'omp_free' - Freeing memory allocated with OpenMP routines +----------------------------------------------------------------- + +_Description_: + The 'omp_free' routine deallocates memory previously allocated by + an OpenMP memory-management routine. The PTR argument must point + to such memory or be a null pointer; if it is a null pointer, no + operation is performed. If specified, the ALLOCATOR argument must + be either the memory allocator that was used for the allocation or + 'omp_null_allocator'; if it is 'omp_null_allocator', the + implementation will determine the value automatically. + + Calling 'omp_free' invokes undefined behavior if the memory was + already deallocated or when the used allocator has already been + destroyed. + +_C_: + _Prototype_: 'void omp_free(void *ptr,' + ' omp_allocator_handle_t allocator)' + +_C++_: + _Prototype_: 'void omp_free(void *ptr,' + ' omp_allocator_handle_t allocator=omp_null_allocator)' + +_Fortran_: + _Interface_: 'subroutine omp_free(ptr, allocator) bind(C)' + 'use, intrinsic :: iso_c_binding, only : c_ptr' + 'type (c_ptr), value :: ptr' + 'integer (omp_allocator_handle_kind), value :: + allocator' + +_See also_: + *note omp_alloc::, *note omp_aligned_alloc::, *note omp_calloc::, + *note omp_aligned_calloc::, *note omp_realloc:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.7 + + +File: libgomp.info, Node: omp_calloc, Next: omp_aligned_calloc, Prev: omp_free, Up: Memory Management Routines + +3.12.8 'omp_calloc' - Allocate nullified memory with an allocator +----------------------------------------------------------------- + +_Description_: + Allocate zero-initialized memory with the specified allocator, + which can either be a predefined allocator, an allocator handle or + 'omp_null_allocator'. If the allocators is 'omp_null_allocator', + the allocator specified by the DEF-ALLOCATOR-VAR ICV is used. The + to-be allocated memory is for an array with NMEMB elements, each + having a size of SIZE bytes. Both NMEMB and SIZE must be + nonnegative numbers; if either of them is zero, 'omp_calloc' will + return a null pointer. If successful, a pointer to the + zero-initialized allocated memory is returned, otherwise the + 'fallback' trait of the allocator determines the behavior. + + In 'target' regions, either the 'dynamic_allocators' clause must + appear on a 'requires' directive in the same compilation unit - or + the ALLOCATOR argument may only be a constant expression with the + value of one of the predefined allocators and may not be + 'omp_null_allocator'. + + Memory allocated by 'omp_calloc' must be freed using 'omp_free'. + +_C_: + _Prototype_: 'void* omp_calloc(size_t nmemb, size_t size,' + ' omp_allocator_handle_t allocator)' + +_C++_: + _Prototype_: 'void* omp_calloc(size_t nmemb, size_t size,' + ' omp_allocator_handle_t allocator=omp_null_allocator)' + +_Fortran_: + _Interface_: 'type(c_ptr) function omp_calloc(nmemb, size, allocator) + bind(C)' + 'use, intrinsic :: iso_c_binding, only : c_ptr, + c_size_t' + 'integer (c_size_t), value :: nmemb, size' + 'integer (omp_allocator_handle_kind), value :: + allocator' + +_See also_: + *note OMP_ALLOCATOR::, *note Memory allocation::, *note + omp_set_default_allocator::, *note omp_free::, *note + omp_init_allocator:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.13.8 + + +File: libgomp.info, Node: omp_aligned_calloc, Next: omp_realloc, Prev: omp_calloc, Up: Memory Management Routines + +3.12.9 'omp_aligned_calloc' - Allocate aligned nullified memory with an allocator +--------------------------------------------------------------------------------- + +_Description_: + Allocate zero-initialized memory with the specified allocator, + which can either be a predefined allocator, an allocator handle or + 'omp_null_allocator'. If the allocators is 'omp_null_allocator', + the allocator specified by the DEF-ALLOCATOR-VAR ICV is used. The + to-be allocated memory is for an array with NMEMB elements, each + having a size of SIZE bytes. Both NMEMB and SIZE must be + nonnegative numbers; if either of them is zero, + 'omp_aligned_calloc' will return a null pointer. ALIGNMENT must be + a positive power of two and SIZE must be a multiple of the + alignment; the alignment will be at least the maximal value + required by 'alignment' trait of the allocator and the value of the + passed ALIGNMENT argument. If successful, a pointer to the + zero-initialized allocated memory is returned, otherwise the + 'fallback' trait of the allocator determines the behavior. + + In 'target' regions, either the 'dynamic_allocators' clause must + appear on a 'requires' directive in the same compilation unit - or + the ALLOCATOR argument may only be a constant expression with the + value of one of the predefined allocators and may not be + 'omp_null_allocator'. + + Memory allocated by 'omp_aligned_calloc' must be freed using + 'omp_free'. + +_C_: + _Prototype_: 'void* omp_aligned_calloc(size_t nmemb, size_t size,' + ' omp_allocator_handle_t allocator)' + +_C++_: + _Prototype_: 'void* omp_aligned_calloc(size_t nmemb, size_t size,' + ' omp_allocator_handle_t allocator=omp_null_allocator)' + +_Fortran_: + _Interface_: 'type(c_ptr) function omp_aligned_calloc(nmemb, size, + allocator) bind(C)' + 'use, intrinsic :: iso_c_binding, only : c_ptr, + c_size_t' + 'integer (c_size_t), value :: nmemb, size' + 'integer (omp_allocator_handle_kind), value :: + allocator' + +_See also_: + *note OMP_ALLOCATOR::, *note Memory allocation::, *note + omp_set_default_allocator::, *note omp_free::, *note + omp_init_allocator:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.13.8 + + +File: libgomp.info, Node: omp_realloc, Prev: omp_aligned_calloc, Up: Memory Management Routines + +3.12.10 'omp_realloc' - Reallocate memory allocated with OpenMP routines +------------------------------------------------------------------------ + +_Description_: + The 'omp_realloc' routine deallocates memory to which PTR points to + and allocates new memory with the specified ALLOCATOR argument; the + new memory will have the content of the old memory up to the + minimum of the old size and the new SIZE, otherwise the content of + the returned memory is unspecified. If the new allocator is the + same as the old one, the routine tries to resize the existing + memory allocation, returning the same address as PTR if successful. + PTR must point to memory allocated by an OpenMP memory-management + routine. + + The ALLOCATOR and FREE_ALLOCATOR arguments must be a predefined + allocator, an allocator handle or 'omp_null_allocator'. If + FREE_ALLOCATOR is 'omp_null_allocator', the implementation + automatically determines the allocator used for the allocation of + PTR. If ALLOCATOR is 'omp_null_allocator' and PTR is not a null + pointer, the same allocator as 'free_allocator' is used and when + PTR is a null pointer the allocator specified by the + DEF-ALLOCATOR-VAR ICV is used. + + The SIZE must be a nonnegative number denoting the number of bytes + to be allocated; if SIZE is zero, 'omp_realloc' will return free + the memory and return a null pointer. When SIZE is nonzero: if + successful, a pointer to the allocated memory is returned, + otherwise the 'fallback' trait of the allocator determines the + behavior. + + In 'target' regions, either the 'dynamic_allocators' clause must + appear on a 'requires' directive in the same compilation unit - or + the FREE_ALLOCATOR and ALLOCATOR arguments may only be a constant + expression with the value of one of the predefined allocators and + may not be 'omp_null_allocator'. + + Memory allocated by 'omp_realloc' must be freed using 'omp_free'. + Calling 'omp_free' invokes undefined behavior if the memory was + already deallocated or when the used allocator has already been + destroyed. + +_C_: + _Prototype_: 'void* omp_realloc(void *ptr, size_t size,' + ' omp_allocator_handle_t allocator,' + ' omp_allocator_handle_t free_allocator)' + +_C++_: + _Prototype_: 'void* omp_realloc(void *ptr, size_t size,' + ' omp_allocator_handle_t allocator=omp_null_allocator,' + ' omp_allocator_handle_t + free_allocator=omp_null_allocator)' + +_Fortran_: + _Interface_: 'type(c_ptr) function omp_realloc(ptr, size, allocator, + free_allocator) bind(C)' + 'use, intrinsic :: iso_c_binding, only : c_ptr, + c_size_t' + 'type(C_ptr), value :: ptr' + 'integer (c_size_t), value :: size' + 'integer (omp_allocator_handle_kind), value :: + allocator, free_allocator' + +_See also_: + *note OMP_ALLOCATOR::, *note Memory allocation::, *note + omp_set_default_allocator::, *note omp_free::, *note + omp_init_allocator:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 3.7.9 + + +File: libgomp.info, Node: Environment Display Routine, Prev: Memory Management Routines, Up: Runtime Library Routines + +3.13 Environment Display Routine +================================ + +Routine to display the OpenMP version number and the initial value of +ICVs. It has C linkage and does not throw exceptions. + +* Menu: + +* omp_display_env:: print the initial ICV values + + +File: libgomp.info, Node: omp_display_env, Up: Environment Display Routine + +3.13.1 'omp_display_env' - print the initial ICV values +------------------------------------------------------- + +_Description_: + Each time this routine is invoked, the OpenMP version number and + initial value of internal control variables (ICVs) is printed on + 'stderr'. The displayed values are those at startup after + evaluating the environment variables; later calls to API routines + or clauses used in enclosing constructs do not affect the output. + + If the VERBOSE argument is 'false', only the OpenMP version and + standard OpenMP ICVs are shown; if it is 'true', additionally, the + GCC-specific ICVs are shown. + + The output consists of multiple lines and starts with 'OPENMP + DISPLAY ENVIRONMENT BEGIN' followed by the name-value lines and + ends with 'OPENMP DISPLAY ENVIRONMENT END'. The NAME is followed + by an equal sign and the VALUE is enclosed in single quotes. + + The first line has as NAME either '_OPENMP' or 'openmp_version' and + shows as value the supported OpenMP version number (4-digit year, + 2-digit month) of the implementation, matching the value of the + '_OPENMP' macro and, in Fortran, the named constant + 'openmp_version'. + + In each of the succeeding lines, the NAME matches the + environment-variable name of an ICV and shows its value. Those + line are might be prefixed by pair of brackets and a space, where + the brackets enclose a comma-separated list of devices to which the + ICV-value combination applies to; the value can either be a numeric + device number or an abstract name denoting all devices ('all'), the + initial host device ('host') or all devices but the host + ('device'). Note that the same ICV might be printed multiple times + for multiple devices, even if all have the same value. + + The effect when invoked from within a 'target' region is + unspecified. + +_C/C++_: + _Prototype_: 'void omp_display_env(int verbose)' + +_Fortran_: + _Interface_: 'subroutine omp_display_env(verbose)' + 'logical, intent(in) :: verbose' + +_Example_: + Note that the GCC-specific ICVs, such as the shown + 'GOMP_SPINCOUNT', are only printed when VERBOSE set to 'true'. + + OPENMP DISPLAY ENVIRONMENT BEGIN + _OPENMP = '201511' + [host] OMP_DYNAMIC = 'FALSE' + [host] OMP_NESTED = 'FALSE' + [all] OMP_CANCELLATION = 'FALSE' + ... + [host] GOMP_SPINCOUNT = '300000' + OPENMP DISPLAY ENVIRONMENT END + +_See also_: + *note OMP_DISPLAY_ENV::, *note Environment Variables::, *note + Implementation-defined ICV Initialization:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 3.15 + + +File: libgomp.info, Node: Environment Variables, Next: Enabling OpenACC, Prev: Runtime Library Routines, Up: Top + +4 OpenMP Environment Variables +****************************** + +The environment variables which beginning with 'OMP_' are defined by +section 4 of the OpenMP specification in version 4.5 or in a later +version of the specification, while those beginning with 'GOMP_' are GNU +extensions. Most 'OMP_' environment variables have an associated +internal control variable (ICV). + + For any OpenMP environment variable that sets an ICV and is neither +'OMP_DEFAULT_DEVICE' nor has global ICV scope, associated +device-specific environment variables exist. For them, the environment +variable without suffix affects the host. The suffix '_DEV_' followed +by a non-negative device number less that the number of available +devices sets the ICV for the corresponding device. The suffix '_DEV' +sets the ICV of all non-host devices for which a device-specific +corresponding environment variable has not been set while the '_ALL' +suffix sets the ICV of all host and non-host devices for which a more +specific corresponding environment variable is not set. + +* Menu: + +* OMP_ALLOCATOR:: Set the default allocator +* OMP_AFFINITY_FORMAT:: Set the format string used for affinity display +* OMP_CANCELLATION:: Set whether cancellation is activated +* OMP_DISPLAY_AFFINITY:: Display thread affinity information +* OMP_DISPLAY_ENV:: Show OpenMP version and environment variables +* OMP_DEFAULT_DEVICE:: Set the device used in target regions +* OMP_DYNAMIC:: Dynamic adjustment of threads +* OMP_MAX_ACTIVE_LEVELS:: Set the maximum number of nested parallel regions +* OMP_MAX_TASK_PRIORITY:: Set the maximum task priority value +* OMP_NESTED:: Nested parallel regions +* OMP_NUM_TEAMS:: Specifies the number of teams to use by teams region +* OMP_NUM_THREADS:: Specifies the number of threads to use +* OMP_PROC_BIND:: Whether threads may be moved between CPUs +* OMP_PLACES:: Specifies on which CPUs the threads should be placed +* OMP_STACKSIZE:: Set default thread stack size +* OMP_SCHEDULE:: How threads are scheduled +* OMP_TARGET_OFFLOAD:: Controls offloading behavior +* OMP_TEAMS_THREAD_LIMIT:: Set the maximum number of threads imposed by teams +* OMP_THREAD_LIMIT:: Set the maximum number of threads +* OMP_WAIT_POLICY:: How waiting threads are handled +* GOMP_CPU_AFFINITY:: Bind threads to specific CPUs +* GOMP_DEBUG:: Enable debugging output +* GOMP_STACKSIZE:: Set default thread stack size +* GOMP_SPINCOUNT:: Set the busy-wait spin count +* GOMP_RTEMS_THREAD_POOLS:: Set the RTEMS specific thread pools + + +File: libgomp.info, Node: OMP_ALLOCATOR, Next: OMP_AFFINITY_FORMAT, Up: Environment Variables + +4.1 'OMP_ALLOCATOR' - Set the default allocator +=============================================== + +_ICV:_ DEF-ALLOCATOR-VAR +_Scope:_ data environment +_Description_: + Sets the default allocator that is used when no allocator has been + specified in the 'allocate' or 'allocator' clause or if an OpenMP + memory routine is invoked with the 'omp_null_allocator' allocator. + If unset, 'omp_default_mem_alloc' is used. + + The value can either be a predefined allocator or a predefined + memory space or a predefined memory space followed by a colon and a + comma-separated list of memory trait and value pairs, separated by + '='. + + See *note Memory allocation:: for a list of supported prefedined + allocators, memory spaces, and traits. + + Note: The corresponding device environment variables are currently + not supported. Therefore, the non-host DEF-ALLOCATOR-VAR ICVs are + always initialized to 'omp_default_mem_alloc'. However, on all + devices, the 'omp_set_default_allocator' API routine can be used to + change value. + + Examples: + OMP_ALLOCATOR=omp_high_bw_mem_alloc + OMP_ALLOCATOR=omp_large_cap_mem_space + OMP_ALLOCATOR=omp_low_lat_mem_space:pinned=true,partition=nearest + +_See also_: + *note Memory allocation::, *note omp_get_default_allocator::, *note + omp_set_default_allocator::, *note Offload-Target Specifics:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 6.21 + + +File: libgomp.info, Node: OMP_AFFINITY_FORMAT, Next: OMP_CANCELLATION, Prev: OMP_ALLOCATOR, Up: Environment Variables + +4.2 'OMP_AFFINITY_FORMAT' - Set the format string used for affinity display +=========================================================================== + +_ICV:_ AFFINITY-FORMAT-VAR +_Scope:_ device +_Description_: + Sets the format string used when displaying OpenMP thread affinity + information. Special values are output using '%' followed by an + optional size specification and then either the single-character + field type or its long name enclosed in curly braces; using '%%' + displays a literal percent. The size specification consists of an + optional '0.' or '.' followed by a positive integer, specifying the + minimal width of the output. With '0.' and numerical values, the + output is padded with zeros on the left; with '.', the output is + padded by spaces on the left; otherwise, the output is padded by + spaces on the right. If unset, the value is "'level %L thread %i + affinity %A'". + + Supported field types are: + + t team_num value returned by 'omp_get_team_num' + T num_teams value returned by 'omp_get_num_teams' + L nesting_level value returned by 'omp_get_level' + n thread_num value returned by 'omp_get_thread_num' + N num_threads value returned by 'omp_get_num_threads' + a ancestor_tnum value returned by + 'omp_get_ancestor_thread_num(omp_get_level()-1)' + H host name of the host that executes the thread + P process_id process identifier + i native_thread_id native thread identifier + A thread_affinity comma separated list of integer values or + ranges, representing the processors on + which a process might execute, subject to + affinity mechanisms + + For instance, after setting + + OMP_AFFINITY_FORMAT="%0.2a!%n!%.4L!%N;%.2t;%0.2T;%{team_num};%{num_teams};%A" + + with either 'OMP_DISPLAY_AFFINITY' being set or when calling + 'omp_display_affinity' with 'NULL' or an empty string, the program + might display the following: + + 00!0! 1!4; 0;01;0;1;0-11 + 00!3! 1!4; 0;01;0;1;0-11 + 00!2! 1!4; 0;01;0;1;0-11 + 00!1! 1!4; 0;01;0;1;0-11 + +_See also_: + *note OMP_DISPLAY_AFFINITY:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 6.14 + + +File: libgomp.info, Node: OMP_CANCELLATION, Next: OMP_DISPLAY_AFFINITY, Prev: OMP_AFFINITY_FORMAT, Up: Environment Variables + +4.3 'OMP_CANCELLATION' - Set whether cancellation is activated +============================================================== + +_ICV:_ CANCEL-VAR +_Scope:_ global +_Description_: + If set to 'TRUE', the cancellation is activated. If set to 'FALSE' + or if unset, cancellation is disabled and the 'cancel' construct is + ignored. + +_See also_: + *note omp_get_cancellation:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.11 + + +File: libgomp.info, Node: OMP_DISPLAY_AFFINITY, Next: OMP_DISPLAY_ENV, Prev: OMP_CANCELLATION, Up: Environment Variables + +4.4 'OMP_DISPLAY_AFFINITY' - Display thread affinity information +================================================================ + +_ICV:_ DISPLAY-AFFINITY-VAR +_Scope:_ global +_Description_: + If set to 'FALSE' or if unset, affinity displaying is disabled. If + set to 'TRUE', the runtime displays affinity information about + OpenMP threads in a parallel region upon entering the region and + every time any change occurs. + +_See also_: + *note OMP_AFFINITY_FORMAT:: + +_Reference_: + OpenMP specification v5.0 (https://www.openmp.org), Section 6.13 + + +File: libgomp.info, Node: OMP_DISPLAY_ENV, Next: OMP_DEFAULT_DEVICE, Prev: OMP_DISPLAY_AFFINITY, Up: Environment Variables + +4.5 'OMP_DISPLAY_ENV' - Show OpenMP version and environment variables +===================================================================== + +_ICV:_ none +_Scope:_ not applicable +_Description_: + If set to 'TRUE', the runtime displays the same information to + 'stderr' as shown by the 'omp_display_env' routine invoked with + VERBOSE argument set to 'false'. If set to 'VERBOSE', the same + information is shown as invoking the routine with VERBOSE set to + 'true'. If unset or set to 'FALSE', this information is not shown. + The result for any other value is unspecified. + +_See also_: + *note omp_display_env:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.12 + + +File: libgomp.info, Node: OMP_DEFAULT_DEVICE, Next: OMP_DYNAMIC, Prev: OMP_DISPLAY_ENV, Up: Environment Variables + +4.6 'OMP_DEFAULT_DEVICE' - Set the device used in target regions +================================================================ + +_ICV:_ DEFAULT-DEVICE-VAR +_Scope:_ data environment +_Description_: + Set to choose the device which is used in a 'target' region, unless + the value is overridden by 'omp_set_default_device' or by a + 'device' clause. The value shall be the nonnegative device number. + If no device with the given device number exists, the code is + executed on the host. If unset, 'OMP_TARGET_OFFLOAD' is + 'mandatory' and no non-host devices are available, it is set to + 'omp_invalid_device'. Otherwise, if unset, device number 0 is + used. + +_See also_: + *note omp_get_default_device::, *note omp_set_default_device::, + *note OMP_TARGET_OFFLOAD:: + +_Reference_: + OpenMP specification v5.2 (https://www.openmp.org), Section 21.2.7 + + +File: libgomp.info, Node: OMP_DYNAMIC, Next: OMP_MAX_ACTIVE_LEVELS, Prev: OMP_DEFAULT_DEVICE, Up: Environment Variables + +4.7 'OMP_DYNAMIC' - Dynamic adjustment of threads +================================================= + +_ICV:_ DYN-VAR +_Scope:_ global +_Description_: + Enable or disable the dynamic adjustment of the number of threads + within a team. The value of this environment variable shall be + 'TRUE' or 'FALSE'. If undefined, dynamic adjustment is disabled by + default. + +_See also_: + *note omp_set_dynamic:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.3 + + +File: libgomp.info, Node: OMP_MAX_ACTIVE_LEVELS, Next: OMP_MAX_TASK_PRIORITY, Prev: OMP_DYNAMIC, Up: Environment Variables + +4.8 'OMP_MAX_ACTIVE_LEVELS' - Set the maximum number of nested parallel regions +=============================================================================== + +_ICV:_ MAX-ACTIVE-LEVELS-VAR +_Scope:_ data environment +_Description_: + Specifies the initial value for the maximum number of nested + parallel regions. The value of this variable shall be a positive + integer. If undefined, then if 'OMP_NESTED' is defined and set to + true, or if 'OMP_NUM_THREADS' or 'OMP_PROC_BIND' are defined and + set to a list with more than one item, the maximum number of nested + parallel regions is initialized to the largest number supported, + otherwise it is set to one. + +_See also_: + *note omp_set_max_active_levels::, *note OMP_NESTED::, *note + OMP_PROC_BIND::, *note OMP_NUM_THREADS:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.9 + + +File: libgomp.info, Node: OMP_MAX_TASK_PRIORITY, Next: OMP_NESTED, Prev: OMP_MAX_ACTIVE_LEVELS, Up: Environment Variables + +4.9 'OMP_MAX_TASK_PRIORITY' - Set the maximum priority +====================================================== + +number that can be set for a task. +_ICV:_ MAX-TASK-PRIORITY-VAR +_Scope:_ global +_Description_: + Specifies the initial value for the maximum priority value that can + be set for a task. The value of this variable shall be a + non-negative integer, and zero is allowed. If undefined, the + default priority is 0. + +_See also_: + *note omp_get_max_task_priority:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.14 + + +File: libgomp.info, Node: OMP_NESTED, Next: OMP_NUM_TEAMS, Prev: OMP_MAX_TASK_PRIORITY, Up: Environment Variables + +4.10 'OMP_NESTED' - Nested parallel regions +=========================================== + +_ICV:_ MAX-ACTIVE-LEVELS-VAR +_Scope:_ data environment +_Description_: + Enable or disable nested parallel regions, i.e., whether team + members are allowed to create new teams. The value of this + environment variable shall be 'TRUE' or 'FALSE'. If set to 'TRUE', + the number of maximum active nested regions supported is by default + set to the maximum supported, otherwise it is set to one. If + 'OMP_MAX_ACTIVE_LEVELS' is defined, its setting overrides this + setting. If both are undefined, nested parallel regions are + enabled if 'OMP_NUM_THREADS' or 'OMP_PROC_BINDS' are defined to a + list with more than one item, otherwise they are disabled by + default. + + Note that the 'OMP_NESTED' environment variable was deprecated in + the OpenMP specification 5.0 in favor of 'OMP_MAX_ACTIVE_LEVELS'. + +_See also_: + *note omp_set_max_active_levels::, *note omp_set_nested::, *note + OMP_MAX_ACTIVE_LEVELS:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.6 + + +File: libgomp.info, Node: OMP_NUM_TEAMS, Next: OMP_NUM_THREADS, Prev: OMP_NESTED, Up: Environment Variables + +4.11 'OMP_NUM_TEAMS' - Specifies the number of teams to use by teams region +=========================================================================== + +_ICV:_ NTEAMS-VAR +_Scope:_ device +_Description_: + Specifies the upper bound for number of teams to use in teams + regions without explicit 'num_teams' clause. The value of this + variable shall be a positive integer. If undefined it defaults to + 0 which means implementation defined upper bound. + +_See also_: + *note omp_set_num_teams:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 6.23 + + +File: libgomp.info, Node: OMP_NUM_THREADS, Next: OMP_PROC_BIND, Prev: OMP_NUM_TEAMS, Up: Environment Variables + +4.12 'OMP_NUM_THREADS' - Specifies the number of threads to use +=============================================================== + +_ICV:_ NTHREADS-VAR +_Scope:_ data environment +_Description_: + Specifies the default number of threads to use in parallel regions. + The value of this variable shall be a comma-separated list of + positive integers; the value specifies the number of threads to use + for the corresponding nested level. Specifying more than one item + in the list automatically enables nesting by default. If undefined + one thread per CPU is used. + + When a list with more than value is specified, it also affects the + MAX-ACTIVE-LEVELS-VAR ICV as described in *note + OMP_MAX_ACTIVE_LEVELS::. + +_See also_: + *note omp_set_num_threads::, *note OMP_MAX_ACTIVE_LEVELS:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.2 + + +File: libgomp.info, Node: OMP_PROC_BIND, Next: OMP_PLACES, Prev: OMP_NUM_THREADS, Up: Environment Variables + +4.13 'OMP_PROC_BIND' - Whether threads may be moved between CPUs +================================================================ + +_ICV:_ BIND-VAR +_Scope:_ data environment +_Description_: + Specifies whether threads may be moved between processors. If set + to 'TRUE', OpenMP threads should not be moved; if set to 'FALSE' + they may be moved. Alternatively, a comma separated list with the + values 'PRIMARY', 'MASTER', 'CLOSE' and 'SPREAD' can be used to + specify the thread affinity policy for the corresponding nesting + level. With 'PRIMARY' and 'MASTER' the worker threads are in the + same place partition as the primary thread. With 'CLOSE' those are + kept close to the primary thread in contiguous place partitions. + And with 'SPREAD' a sparse distribution across the place partitions + is used. Specifying more than one item in the list automatically + enables nesting by default. + + When a list is specified, it also affects the MAX-ACTIVE-LEVELS-VAR + ICV as described in *note OMP_MAX_ACTIVE_LEVELS::. + + When undefined, 'OMP_PROC_BIND' defaults to 'TRUE' when + 'OMP_PLACES' or 'GOMP_CPU_AFFINITY' is set and 'FALSE' otherwise. + +_See also_: + *note omp_get_proc_bind::, *note GOMP_CPU_AFFINITY::, *note + OMP_PLACES::, *note OMP_MAX_ACTIVE_LEVELS:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.4 + + +File: libgomp.info, Node: OMP_PLACES, Next: OMP_STACKSIZE, Prev: OMP_PROC_BIND, Up: Environment Variables + +4.14 'OMP_PLACES' - Specifies on which CPUs the threads should be placed +======================================================================== + +_ICV:_ PLACE-PARTITION-VAR +_Scope:_ implicit tasks +_Description_: + The thread placement can be either specified using an abstract name + or by an explicit list of the places. The abstract names + 'threads', 'cores', 'sockets', 'll_caches' and 'numa_domains' can + be optionally followed by a positive number in parentheses, which + denotes the how many places shall be created. With 'threads' each + place corresponds to a single hardware thread; 'cores' to a single + core with the corresponding number of hardware threads; with + 'sockets' the place corresponds to a single socket; with + 'll_caches' to a set of cores that shares the last level cache on + the device; and 'numa_domains' to a set of cores for which their + closest memory on the device is the same memory and at a similar + distance from the cores. The resulting placement can be shown by + setting the 'OMP_DISPLAY_ENV' environment variable. + + Alternatively, the placement can be specified explicitly as + comma-separated list of places. A place is specified by set of + nonnegative numbers in curly braces, denoting the hardware threads. + The curly braces can be omitted when only a single number has been + specified. The hardware threads belonging to a place can either be + specified as comma-separated list of nonnegative thread numbers or + using an interval. Multiple places can also be either specified by + a comma-separated list of places or by an interval. To specify an + interval, a colon followed by the count is placed after the + hardware thread number or the place. Optionally, the length can be + followed by a colon and the stride number - otherwise a unit stride + is assumed. Placing an exclamation mark ('!') directly before a + curly brace or numbers inside the curly braces (excluding + intervals) excludes those hardware threads. + + For instance, the following specifies the same places list: + '"{0,1,2}, {3,4,6}, {7,8,9}, {10,11,12}"'; '"{0:3}, {3:3}, {7:3}, + {10:3}"'; and '"{0:2}:4:3"'. + + If 'OMP_PLACES' and 'GOMP_CPU_AFFINITY' are unset and + 'OMP_PROC_BIND' is either unset or 'false', threads may be moved + between CPUs following no placement policy. + +_See also_: + *note OMP_PROC_BIND::, *note GOMP_CPU_AFFINITY::, *note + omp_get_proc_bind::, *note OMP_DISPLAY_ENV:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.5 + + +File: libgomp.info, Node: OMP_STACKSIZE, Next: OMP_SCHEDULE, Prev: OMP_PLACES, Up: Environment Variables + +4.15 'OMP_STACKSIZE' - Set default thread stack size +==================================================== + +_ICV:_ STACKSIZE-VAR +_Scope:_ device +_Description_: + Set the default thread stack size in kilobytes, unless the number + is suffixed by 'B', 'K', 'M' or 'G', in which case the size is, + respectively, in bytes, kilobytes, megabytes or gigabytes. This is + different from 'pthread_attr_setstacksize' which gets the number of + bytes as an argument. If the stack size cannot be set due to + system constraints, an error is reported and the initial stack size + is left unchanged. If undefined, the stack size is system + dependent. + +_See also_: + *note GOMP_STACKSIZE:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.7 + + +File: libgomp.info, Node: OMP_SCHEDULE, Next: OMP_TARGET_OFFLOAD, Prev: OMP_STACKSIZE, Up: Environment Variables + +4.16 'OMP_SCHEDULE' - How threads are scheduled +=============================================== + +_ICV:_ RUN-SCHED-VAR +_Scope:_ data environment +_Description_: + Allows to specify 'schedule type' and 'chunk size'. The value of + the variable shall have the form: 'type[,chunk]' where 'type' is + one of 'static', 'dynamic', 'guided' or 'auto' The optional 'chunk' + size shall be a positive integer. If undefined, dynamic scheduling + and a chunk size of 1 is used. + +_See also_: + *note omp_set_schedule:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Sections + 2.7.1.1 and 4.1 + + +File: libgomp.info, Node: OMP_TARGET_OFFLOAD, Next: OMP_TEAMS_THREAD_LIMIT, Prev: OMP_SCHEDULE, Up: Environment Variables + +4.17 'OMP_TARGET_OFFLOAD' - Controls offloading behavior +======================================================== + +_ICV:_ TARGET-OFFLOAD-VAR +_Scope:_ global +_Description_: + Specifies the behavior with regard to offloading code to a device. + This variable can be set to one of three values - 'MANDATORY', + 'DISABLED' or 'DEFAULT'. + + If set to 'MANDATORY', the program terminates with an error if any + device construct or device memory routine uses a device that is + unavailable or not supported by the implementation, or uses a + non-conforming device number. If set to 'DISABLED', then + offloading is disabled and all code runs on the host. If set to + 'DEFAULT', the program tries offloading to the device first, then + falls back to running code on the host if it cannot. + + If undefined, then the program behaves as if 'DEFAULT' was set. + + Note: Even with 'MANDATORY', no run-time termination is performed + when the device number in a 'device' clause or argument to a device + memory routine is for host, which includes using the device number + in the DEFAULT-DEVICE-VAR ICV. However, the initial value of the + DEFAULT-DEVICE-VAR ICV is affected by 'MANDATORY'. + +_See also_: + *note OMP_DEFAULT_DEVICE:: + +_Reference_: + OpenMP specification v5.2 (https://www.openmp.org), Section 21.2.8 + + +File: libgomp.info, Node: OMP_TEAMS_THREAD_LIMIT, Next: OMP_THREAD_LIMIT, Prev: OMP_TARGET_OFFLOAD, Up: Environment Variables + +4.18 'OMP_TEAMS_THREAD_LIMIT' - Set the maximum number of threads imposed by teams +================================================================================== + +_ICV:_ TEAMS-THREAD-LIMIT-VAR +_Scope:_ device +_Description_: + Specifies an upper bound for the number of threads to use by each + contention group created by a teams construct without explicit + 'thread_limit' clause. The value of this variable shall be a + positive integer. If undefined, the value of 0 is used which + stands for an implementation defined upper limit. + +_See also_: + *note OMP_THREAD_LIMIT::, *note omp_set_teams_thread_limit:: + +_Reference_: + OpenMP specification v5.1 (https://www.openmp.org), Section 6.24 + + +File: libgomp.info, Node: OMP_THREAD_LIMIT, Next: OMP_WAIT_POLICY, Prev: OMP_TEAMS_THREAD_LIMIT, Up: Environment Variables + +4.19 'OMP_THREAD_LIMIT' - Set the maximum number of threads +=========================================================== + +_ICV:_ THREAD-LIMIT-VAR +_Scope:_ data environment +_Description_: + Specifies the number of threads to use for the whole program. The + value of this variable shall be a positive integer. If undefined, + the number of threads is not limited. + +_See also_: + *note OMP_NUM_THREADS::, *note omp_get_thread_limit:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.10 + + +File: libgomp.info, Node: OMP_WAIT_POLICY, Next: GOMP_CPU_AFFINITY, Prev: OMP_THREAD_LIMIT, Up: Environment Variables + +4.20 'OMP_WAIT_POLICY' - How waiting threads are handled +======================================================== + +_Description_: + Specifies whether waiting threads should be active or passive. If + the value is 'PASSIVE', waiting threads should not consume CPU + power while waiting; while the value is 'ACTIVE' specifies that + they should. If undefined, threads wait actively for a short time + before waiting passively. + +_See also_: + *note GOMP_SPINCOUNT:: + +_Reference_: + OpenMP specification v4.5 (https://www.openmp.org), Section 4.8 + + +File: libgomp.info, Node: GOMP_CPU_AFFINITY, Next: GOMP_DEBUG, Prev: OMP_WAIT_POLICY, Up: Environment Variables + +4.21 'GOMP_CPU_AFFINITY' - Bind threads to specific CPUs +======================================================== + +_Description_: + Binds threads to specific CPUs. The variable should contain a + space-separated or comma-separated list of CPUs. This list may + contain different kinds of entries: either single CPU numbers in + any order, a range of CPUs (M-N) or a range with some stride + (M-N:S). CPU numbers are zero based. For example, + 'GOMP_CPU_AFFINITY="0 3 1-2 4-15:2"' binds the initial thread to + CPU 0, the second to CPU 3, the third to CPU 1, the fourth to CPU + 2, the fifth to CPU 4, the sixth through tenth to CPUs 6, 8, 10, + 12, and 14 respectively and then starts assigning back from the + beginning of the list. 'GOMP_CPU_AFFINITY=0' binds all threads to + CPU 0. + + There is no libgomp library routine to determine whether a CPU + affinity specification is in effect. As a workaround, + language-specific library functions, e.g., 'getenv' in C or + 'GET_ENVIRONMENT_VARIABLE' in Fortran, may be used to query the + setting of the 'GOMP_CPU_AFFINITY' environment variable. A defined + CPU affinity on startup cannot be changed or disabled during the + runtime of the application. + + If both 'GOMP_CPU_AFFINITY' and 'OMP_PROC_BIND' are set, + 'OMP_PROC_BIND' has a higher precedence. If neither has been set + and 'OMP_PROC_BIND' is unset, or when 'OMP_PROC_BIND' is set to + 'FALSE', the host system handles the assignment of threads to CPUs. + +_See also_: + *note OMP_PLACES::, *note OMP_PROC_BIND:: + + +File: libgomp.info, Node: GOMP_DEBUG, Next: GOMP_STACKSIZE, Prev: GOMP_CPU_AFFINITY, Up: Environment Variables + +4.22 'GOMP_DEBUG' - Enable debugging output +=========================================== + +_Description_: + Enable debugging output. The variable should be set to '0' + (disabled, also the default if not set), or '1' (enabled). + + If enabled, some debugging output is printed during execution. + This is currently not specified in more detail, and subject to + change. + + +File: libgomp.info, Node: GOMP_STACKSIZE, Next: GOMP_SPINCOUNT, Prev: GOMP_DEBUG, Up: Environment Variables + +4.23 'GOMP_STACKSIZE' - Set default thread stack size +===================================================== + +_Description_: + Set the default thread stack size in kilobytes. This is different + from 'pthread_attr_setstacksize' which gets the number of bytes as + an argument. If the stack size cannot be set due to system + constraints, an error is reported and the initial stack size is + left unchanged. If undefined, the stack size is system dependent. + +_See also_: + *note OMP_STACKSIZE:: + +_Reference_: + GCC Patches Mailinglist + (https://gcc.gnu.org/ml/gcc-patches/2006-06/msg00493.html), GCC + Patches Mailinglist + (https://gcc.gnu.org/ml/gcc-patches/2006-06/msg00496.html) + + +File: libgomp.info, Node: GOMP_SPINCOUNT, Next: GOMP_RTEMS_THREAD_POOLS, Prev: GOMP_STACKSIZE, Up: Environment Variables + +4.24 'GOMP_SPINCOUNT' - Set the busy-wait spin count +==================================================== + +_Description_: + Determines how long a threads waits actively with consuming CPU + power before waiting passively without consuming CPU power. The + value may be either 'INFINITE', 'INFINITY' to always wait actively + or an integer which gives the number of spins of the busy-wait + loop. The integer may optionally be followed by the following + suffixes acting as multiplication factors: 'k' (kilo, thousand), + 'M' (mega, million), 'G' (giga, billion), or 'T' (tera, trillion). + If undefined, 0 is used when 'OMP_WAIT_POLICY' is 'PASSIVE', + 300,000 is used when 'OMP_WAIT_POLICY' is undefined and 30 billion + is used when 'OMP_WAIT_POLICY' is 'ACTIVE'. If there are more + OpenMP threads than available CPUs, 1000 and 100 spins are used for + 'OMP_WAIT_POLICY' being 'ACTIVE' or undefined, respectively; unless + the 'GOMP_SPINCOUNT' is lower or 'OMP_WAIT_POLICY' is 'PASSIVE'. + +_See also_: + *note OMP_WAIT_POLICY:: + + +File: libgomp.info, Node: GOMP_RTEMS_THREAD_POOLS, Prev: GOMP_SPINCOUNT, Up: Environment Variables + +4.25 'GOMP_RTEMS_THREAD_POOLS' - Set the RTEMS specific thread pools +==================================================================== + +_Description_: + This environment variable is only used on the RTEMS real-time + operating system. It determines the scheduler instance specific + thread pools. The format for 'GOMP_RTEMS_THREAD_POOLS' is a list + of optional '[$]@' + configurations separated by ':' where: + * '' is the thread pool count for this + scheduler instance. + * '$' is an optional priority for the worker threads + of a thread pool according to 'pthread_setschedparam'. In + case a priority value is omitted, then a worker thread + inherits the priority of the OpenMP primary thread that + created it. The priority of the worker thread is not changed + after creation, even if a new OpenMP primary thread using the + worker has a different priority. + * '@' is the scheduler instance name according + to the RTEMS application configuration. + In case no thread pool configuration is specified for a scheduler + instance, then each OpenMP primary thread of this scheduler + instance uses its own dynamically allocated thread pool. To limit + the worker thread count of the thread pools, each OpenMP primary + thread must call 'omp_set_num_threads'. +_Example_: + Lets suppose we have three scheduler instances 'IO', 'WRK0', and + 'WRK1' with 'GOMP_RTEMS_THREAD_POOLS' set to '"1@WRK0:3$4@WRK1"'. + Then there are no thread pool restrictions for scheduler instance + 'IO'. In the scheduler instance 'WRK0' there is one thread pool + available. Since no priority is specified for this scheduler + instance, the worker thread inherits the priority of the OpenMP + primary thread that created it. In the scheduler instance 'WRK1' + there are three thread pools available and their worker threads run + at priority four. + + +File: libgomp.info, Node: Enabling OpenACC, Next: OpenACC Runtime Library Routines, Prev: Environment Variables, Up: Top + +5 Enabling OpenACC +****************** + +To activate the OpenACC extensions for C/C++ and Fortran, the +compile-time flag '-fopenacc' must be specified. This enables the +OpenACC directive '#pragma acc' in C/C++ and, in Fortran, the '!$acc' +sentinel in free source form and the 'c$acc', '*$acc' and '!$acc' +sentinels in fixed source form. The flag also arranges for automatic +linking of the OpenACC runtime library (*note OpenACC Runtime Library +Routines::). + + See for more information. + + A complete description of all OpenACC directives accepted may be +found in the OpenACC (https://www.openacc.org) Application Programming +Interface manual, version 2.6. + + +File: libgomp.info, Node: OpenACC Runtime Library Routines, Next: OpenACC Environment Variables, Prev: Enabling OpenACC, Up: Top + +6 OpenACC Runtime Library Routines +********************************** + +The runtime routines described here are defined by section 3 of the +OpenACC specifications in version 2.6. They have C linkage, and do not +throw exceptions. Generally, they are available only for the host, with +the exception of 'acc_on_device', which is available for both the host +and the acceleration device. + +* Menu: + +* acc_get_num_devices:: Get number of devices for the given device + type. +* acc_set_device_type:: Set type of device accelerator to use. +* acc_get_device_type:: Get type of device accelerator to be used. +* acc_set_device_num:: Set device number to use. +* acc_get_device_num:: Get device number to be used. +* acc_get_property:: Get device property. +* acc_async_test:: Tests for completion of a specific asynchronous + operation. +* acc_async_test_all:: Tests for completion of all asynchronous + operations. +* acc_wait:: Wait for completion of a specific asynchronous + operation. +* acc_wait_all:: Waits for completion of all asynchronous + operations. +* acc_wait_all_async:: Wait for completion of all asynchronous + operations. +* acc_wait_async:: Wait for completion of asynchronous operations. +* acc_init:: Initialize runtime for a specific device type. +* acc_shutdown:: Shuts down the runtime for a specific device + type. +* acc_on_device:: Whether executing on a particular device +* acc_malloc:: Allocate device memory. +* acc_free:: Free device memory. +* acc_copyin:: Allocate device memory and copy host memory to + it. +* acc_present_or_copyin:: If the data is not present on the device, + allocate device memory and copy from host + memory. +* acc_create:: Allocate device memory and map it to host + memory. +* acc_present_or_create:: If the data is not present on the device, + allocate device memory and map it to host + memory. +* acc_copyout:: Copy device memory to host memory. +* acc_delete:: Free device memory. +* acc_update_device:: Update device memory from mapped host memory. +* acc_update_self:: Update host memory from mapped device memory. +* acc_map_data:: Map previously allocated device memory to host + memory. +* acc_unmap_data:: Unmap device memory from host memory. +* acc_deviceptr:: Get device pointer associated with specific + host address. +* acc_hostptr:: Get host pointer associated with specific + device address. +* acc_is_present:: Indicate whether host variable / array is + present on device. +* acc_memcpy_to_device:: Copy host memory to device memory. +* acc_memcpy_from_device:: Copy device memory to host memory. +* acc_attach:: Let device pointer point to device-pointer target. +* acc_detach:: Let device pointer point to host-pointer target. + +API routines for target platforms. + +* acc_get_current_cuda_device:: Get CUDA device handle. +* acc_get_current_cuda_context::Get CUDA context handle. +* acc_get_cuda_stream:: Get CUDA stream handle. +* acc_set_cuda_stream:: Set CUDA stream handle. + +API routines for the OpenACC Profiling Interface. + +* acc_prof_register:: Register callbacks. +* acc_prof_unregister:: Unregister callbacks. +* acc_prof_lookup:: Obtain inquiry functions. +* acc_register_library:: Library registration. + + +File: libgomp.info, Node: acc_get_num_devices, Next: acc_set_device_type, Up: OpenACC Runtime Library Routines + +6.1 'acc_get_num_devices' - Get number of devices for given device type +======================================================================= + +_Description_ + This function returns a value indicating the number of devices + available for the device type specified in DEVICETYPE. + +_C/C++_: + _Prototype_: 'int acc_get_num_devices(acc_device_t devicetype);' + +_Fortran_: + _Interface_: 'integer function acc_get_num_devices(devicetype)' + 'integer(kind=acc_device_kind) devicetype' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.1. + + +File: libgomp.info, Node: acc_set_device_type, Next: acc_get_device_type, Prev: acc_get_num_devices, Up: OpenACC Runtime Library Routines + +6.2 'acc_set_device_type' - Set type of device accelerator to use. +================================================================== + +_Description_ + This function indicates to the runtime library which device type, + specified in DEVICETYPE, to use when executing a parallel or + kernels region. + +_C/C++_: + _Prototype_: 'acc_set_device_type(acc_device_t devicetype);' + +_Fortran_: + _Interface_: 'subroutine acc_set_device_type(devicetype)' + 'integer(kind=acc_device_kind) devicetype' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.2. + + +File: libgomp.info, Node: acc_get_device_type, Next: acc_set_device_num, Prev: acc_set_device_type, Up: OpenACC Runtime Library Routines + +6.3 'acc_get_device_type' - Get type of device accelerator to be used. +====================================================================== + +_Description_ + This function returns what device type will be used when executing + a parallel or kernels region. + + This function returns 'acc_device_none' if 'acc_get_device_type' is + called from 'acc_ev_device_init_start', 'acc_ev_device_init_end' + callbacks of the OpenACC Profiling Interface (*note OpenACC + Profiling Interface::), that is, if the device is currently being + initialized. + +_C/C++_: + _Prototype_: 'acc_device_t acc_get_device_type(void);' + +_Fortran_: + _Interface_: 'function acc_get_device_type(void)' + 'integer(kind=acc_device_kind) acc_get_device_type' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.3. + + +File: libgomp.info, Node: acc_set_device_num, Next: acc_get_device_num, Prev: acc_get_device_type, Up: OpenACC Runtime Library Routines + +6.4 'acc_set_device_num' - Set device number to use. +==================================================== + +_Description_ + This function will indicate to the runtime which device number, + specified by DEVICENUM, associated with the specified device type + DEVICETYPE. + +_C/C++_: + _Prototype_: 'acc_set_device_num(int devicenum, acc_device_t + devicetype);' + +_Fortran_: + _Interface_: 'subroutine acc_set_device_num(devicenum, devicetype)' + 'integer devicenum' + 'integer(kind=acc_device_kind) devicetype' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.4. + + +File: libgomp.info, Node: acc_get_device_num, Next: acc_get_property, Prev: acc_set_device_num, Up: OpenACC Runtime Library Routines + +6.5 'acc_get_device_num' - Get device number to be used. +======================================================== + +_Description_ + This function returns which device number associated with the + specified device type DEVICETYPE, will be used when executing a + parallel or kernels region. + +_C/C++_: + _Prototype_: 'int acc_get_device_num(acc_device_t devicetype);' + +_Fortran_: + _Interface_: 'function acc_get_device_num(devicetype)' + 'integer(kind=acc_device_kind) devicetype' + 'integer acc_get_device_num' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.5. + + +File: libgomp.info, Node: acc_get_property, Next: acc_async_test, Prev: acc_get_device_num, Up: OpenACC Runtime Library Routines + +6.6 'acc_get_property' - Get device property. +============================================= + +_Description_ + These routines return the value of the specified PROPERTY for the + device being queried according to DEVICENUM and DEVICETYPE. + Integer-valued and string-valued properties are returned by + 'acc_get_property' and 'acc_get_property_string' respectively. The + Fortran 'acc_get_property_string' subroutine returns the string + retrieved in its fourth argument while the remaining entry points + are functions, which pass the return value as their result. + + Note for Fortran, only: the OpenACC technical committee corrected + and, hence, modified the interface introduced in OpenACC 2.6. The + kind-value parameter 'acc_device_property' has been renamed to + 'acc_device_property_kind' for consistency and the return type of + the 'acc_get_property' function is now a 'c_size_t' integer instead + of a 'acc_device_property' integer. The parameter + 'acc_device_property' is still provided, but might be removed in a + future version of GCC. + +_C/C++_: + _Prototype_: 'size_t acc_get_property(int devicenum, acc_device_t + devicetype, acc_device_property_t property);' + _Prototype_: 'const char *acc_get_property_string(int devicenum, + acc_device_t devicetype, acc_device_property_t + property);' + +_Fortran_: + _Interface_: 'function acc_get_property(devicenum, devicetype, + property)' + _Interface_: 'subroutine acc_get_property_string(devicenum, + devicetype, property, string)' + 'use ISO_C_Binding, only: c_size_t' + 'integer devicenum' + 'integer(kind=acc_device_kind) devicetype' + 'integer(kind=acc_device_property_kind) property' + 'integer(kind=c_size_t) acc_get_property' + 'character(*) string' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.6. + + +File: libgomp.info, Node: acc_async_test, Next: acc_async_test_all, Prev: acc_get_property, Up: OpenACC Runtime Library Routines + +6.7 'acc_async_test' - Test for completion of a specific asynchronous operation. +================================================================================ + +_Description_ + This function tests for completion of the asynchronous operation + specified in ARG. In C/C++, a non-zero value is returned to + indicate the specified asynchronous operation has completed while + Fortran returns 'true'. If the asynchronous operation has not + completed, C/C++ returns zero and Fortran returns 'false'. + +_C/C++_: + _Prototype_: 'int acc_async_test(int arg);' + +_Fortran_: + _Interface_: 'function acc_async_test(arg)' + 'integer(kind=acc_handle_kind) arg' + 'logical acc_async_test' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.9. + + +File: libgomp.info, Node: acc_async_test_all, Next: acc_wait, Prev: acc_async_test, Up: OpenACC Runtime Library Routines + +6.8 'acc_async_test_all' - Tests for completion of all asynchronous operations. +=============================================================================== + +_Description_ + This function tests for completion of all asynchronous operations. + In C/C++, a non-zero value is returned to indicate all asynchronous + operations have completed while Fortran returns 'true'. If any + asynchronous operation has not completed, C/C++ returns zero and + Fortran returns 'false'. + +_C/C++_: + _Prototype_: 'int acc_async_test_all(void);' + +_Fortran_: + _Interface_: 'function acc_async_test()' + 'logical acc_get_device_num' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.10. + + +File: libgomp.info, Node: acc_wait, Next: acc_wait_all, Prev: acc_async_test_all, Up: OpenACC Runtime Library Routines + +6.9 'acc_wait' - Wait for completion of a specific asynchronous operation. +========================================================================== + +_Description_ + This function waits for completion of the asynchronous operation + specified in ARG. + +_C/C++_: + _Prototype_: 'acc_wait(arg);' + _Prototype 'acc_async_wait(arg);' + (OpenACC 1.0 + compatibility)_: + +_Fortran_: + _Interface_: 'subroutine acc_wait(arg)' + 'integer(acc_handle_kind) arg' + _Interface 'subroutine acc_async_wait(arg)' + (OpenACC 1.0 + compatibility)_: + 'integer(acc_handle_kind) arg' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.11. + + +File: libgomp.info, Node: acc_wait_all, Next: acc_wait_all_async, Prev: acc_wait, Up: OpenACC Runtime Library Routines + +6.10 'acc_wait_all' - Waits for completion of all asynchronous operations. +========================================================================== + +_Description_ + This function waits for the completion of all asynchronous + operations. + +_C/C++_: + _Prototype_: 'acc_wait_all(void);' + _Prototype 'acc_async_wait_all(void);' + (OpenACC 1.0 + compatibility)_: + +_Fortran_: + _Interface_: 'subroutine acc_wait_all()' + _Interface 'subroutine acc_async_wait_all()' + (OpenACC 1.0 + compatibility)_: + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.13. + + +File: libgomp.info, Node: acc_wait_all_async, Next: acc_wait_async, Prev: acc_wait_all, Up: OpenACC Runtime Library Routines + +6.11 'acc_wait_all_async' - Wait for completion of all asynchronous operations. +=============================================================================== + +_Description_ + This function enqueues a wait operation on the queue ASYNC for any + and all asynchronous operations that have been previously enqueued + on any queue. + +_C/C++_: + _Prototype_: 'acc_wait_all_async(int async);' + +_Fortran_: + _Interface_: 'subroutine acc_wait_all_async(async)' + 'integer(acc_handle_kind) async' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.14. + + +File: libgomp.info, Node: acc_wait_async, Next: acc_init, Prev: acc_wait_all_async, Up: OpenACC Runtime Library Routines + +6.12 'acc_wait_async' - Wait for completion of asynchronous operations. +======================================================================= + +_Description_ + This function enqueues a wait operation on queue ASYNC for any and + all asynchronous operations enqueued on queue ARG. + +_C/C++_: + _Prototype_: 'acc_wait_async(int arg, int async);' + +_Fortran_: + _Interface_: 'subroutine acc_wait_async(arg, async)' + 'integer(acc_handle_kind) arg, async' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.12. + + +File: libgomp.info, Node: acc_init, Next: acc_shutdown, Prev: acc_wait_async, Up: OpenACC Runtime Library Routines + +6.13 'acc_init' - Initialize runtime for a specific device type. +================================================================ + +_Description_ + This function initializes the runtime for the device type specified + in DEVICETYPE. + +_C/C++_: + _Prototype_: 'acc_init(acc_device_t devicetype);' + +_Fortran_: + _Interface_: 'subroutine acc_init(devicetype)' + 'integer(acc_device_kind) devicetype' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.7. + + +File: libgomp.info, Node: acc_shutdown, Next: acc_on_device, Prev: acc_init, Up: OpenACC Runtime Library Routines + +6.14 'acc_shutdown' - Shuts down the runtime for a specific device type. +======================================================================== + +_Description_ + This function shuts down the runtime for the device type specified + in DEVICETYPE. + +_C/C++_: + _Prototype_: 'acc_shutdown(acc_device_t devicetype);' + +_Fortran_: + _Interface_: 'subroutine acc_shutdown(devicetype)' + 'integer(acc_device_kind) devicetype' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.8. + + +File: libgomp.info, Node: acc_on_device, Next: acc_malloc, Prev: acc_shutdown, Up: OpenACC Runtime Library Routines + +6.15 'acc_on_device' - Whether executing on a particular device +=============================================================== + +_Description_: + This function returns whether the program is executing on a + particular device specified in DEVICETYPE. In C/C++ a non-zero + value is returned to indicate the device is executing on the + specified device type. In Fortran, 'true' is returned. If the + program is not executing on the specified device type C/C++ returns + zero, while Fortran returns 'false'. + + Note that in GCC, depending on DEVICETYPE, the function call might + be folded to a constant in the compiler; compile with + '-fno-builtin-acc_on_device' if a run-time function is desired. + +_C/C++_: + _Prototype_: 'acc_on_device(acc_device_t devicetype);' + +_Fortran_: + _Interface_: 'function acc_on_device(devicetype)' + 'integer(acc_device_kind) devicetype' + 'logical acc_on_device' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.17. + + +File: libgomp.info, Node: acc_malloc, Next: acc_free, Prev: acc_on_device, Up: OpenACC Runtime Library Routines + +6.16 'acc_malloc' - Allocate device memory. +=========================================== + +_Description_ + This function allocates BYTES bytes of device memory. It returns + the device address of the allocated memory. + +_C/C++_: + _Prototype_: 'd_void* acc_malloc(size_t bytes);' + +_Fortran_: + _Interface_: 'type(c_ptr) function acc_malloc(bytes)' + 'integer(c_size_t), value :: bytes' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.18. openacc specification v3.3 (https://www.openacc.org), + section 3.2.16. + + +File: libgomp.info, Node: acc_free, Next: acc_copyin, Prev: acc_malloc, Up: OpenACC Runtime Library Routines + +6.17 'acc_free' - Free device memory. +===================================== + +_Description_ + Free previously allocated device memory at the device address + 'data_dev'. + +_C/C++_: + _Prototype_: 'void acc_free(d_void *data_dev);' + +_Fortran_: + _Interface_: 'subroutine acc_free(data_dev)' + 'type(c_ptr), value :: data_dev' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.19. openacc specification v3.3 (https://www.openacc.org), + section 3.2.17. + + +File: libgomp.info, Node: acc_copyin, Next: acc_present_or_copyin, Prev: acc_free, Up: OpenACC Runtime Library Routines + +6.18 'acc_copyin' - Allocate device memory and copy host memory to it. +====================================================================== + +_Description_ + In C/C++, this function allocates LEN bytes of device memory and + maps it to the specified host address in A. The device address of + the newly allocated device memory is returned. + + In Fortran, two (2) forms are supported. In the first form, A + specifies a contiguous array section. The second form A specifies + a variable or array element and LEN specifies the length in bytes. + +_C/C++_: + _Prototype_: 'void *acc_copyin(h_void *a, size_t len);' + _Prototype_: 'void *acc_copyin_async(h_void *a, size_t len, int + async);' + +_Fortran_: + _Interface_: 'subroutine acc_copyin(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_copyin(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + _Interface_: 'subroutine acc_copyin_async(a, async)' + 'type, dimension(:[,:]...) :: a' + 'integer(acc_handle_kind) :: async' + _Interface_: 'subroutine acc_copyin_async(a, len, async)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + 'integer(acc_handle_kind) :: async' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.20. + + +File: libgomp.info, Node: acc_present_or_copyin, Next: acc_create, Prev: acc_copyin, Up: OpenACC Runtime Library Routines + +6.19 'acc_present_or_copyin' - If the data is not present on the device, allocate device memory and copy from host memory. +========================================================================================================================== + +_Description_ + This function tests if the host data specified by A and of length + LEN is present or not. If it is not present, device memory is + allocated and the host memory copied. The device address of the + newly allocated device memory is returned. + + In Fortran, two (2) forms are supported. In the first form, A + specifies a contiguous array section. The second form A specifies + a variable or array element and LEN specifies the length in bytes. + + Note that 'acc_present_or_copyin' and 'acc_pcopyin' exist for + backward compatibility with OpenACC 2.0; use *note acc_copyin:: + instead. + +_C/C++_: + _Prototype_: 'void *acc_present_or_copyin(h_void *a, size_t len);' + _Prototype_: 'void *acc_pcopyin(h_void *a, size_t len);' + +_Fortran_: + _Interface_: 'subroutine acc_present_or_copyin(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_present_or_copyin(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + _Interface_: 'subroutine acc_pcopyin(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_pcopyin(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.20. + + +File: libgomp.info, Node: acc_create, Next: acc_present_or_create, Prev: acc_present_or_copyin, Up: OpenACC Runtime Library Routines + +6.20 'acc_create' - Allocate device memory and map it to host memory. +===================================================================== + +_Description_ + This function allocates device memory and maps it to host memory + specified by the host address A with a length of LEN bytes. In + C/C++, the function returns the device address of the allocated + device memory. + + In Fortran, two (2) forms are supported. In the first form, A + specifies a contiguous array section. The second form A specifies + a variable or array element and LEN specifies the length in bytes. + +_C/C++_: + _Prototype_: 'void *acc_create(h_void *a, size_t len);' + _Prototype_: 'void *acc_create_async(h_void *a, size_t len, int + async);' + +_Fortran_: + _Interface_: 'subroutine acc_create(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_create(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + _Interface_: 'subroutine acc_create_async(a, async)' + 'type, dimension(:[,:]...) :: a' + 'integer(acc_handle_kind) :: async' + _Interface_: 'subroutine acc_create_async(a, len, async)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + 'integer(acc_handle_kind) :: async' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.21. + + +File: libgomp.info, Node: acc_present_or_create, Next: acc_copyout, Prev: acc_create, Up: OpenACC Runtime Library Routines + +6.21 'acc_present_or_create' - If the data is not present on the device, allocate device memory and map it to host memory. +========================================================================================================================== + +_Description_ + This function tests if the host data specified by A and of length + LEN is present or not. If it is not present, device memory is + allocated and mapped to host memory. In C/C++, the device address + of the newly allocated device memory is returned. + + In Fortran, two (2) forms are supported. In the first form, A + specifies a contiguous array section. The second form A specifies + a variable or array element and LEN specifies the length in bytes. + + Note that 'acc_present_or_create' and 'acc_pcreate' exist for + backward compatibility with OpenACC 2.0; use *note acc_create:: + instead. + +_C/C++_: + _Prototype_: 'void *acc_present_or_create(h_void *a, size_t len)' + _Prototype_: 'void *acc_pcreate(h_void *a, size_t len)' + +_Fortran_: + _Interface_: 'subroutine acc_present_or_create(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_present_or_create(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + _Interface_: 'subroutine acc_pcreate(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_pcreate(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.21. + + +File: libgomp.info, Node: acc_copyout, Next: acc_delete, Prev: acc_present_or_create, Up: OpenACC Runtime Library Routines + +6.22 'acc_copyout' - Copy device memory to host memory. +======================================================= + +_Description_ + This function copies mapped device memory to host memory which is + specified by host address A for a length LEN bytes in C/C++. + + In Fortran, two (2) forms are supported. In the first form, A + specifies a contiguous array section. The second form A specifies + a variable or array element and LEN specifies the length in bytes. + +_C/C++_: + _Prototype_: 'acc_copyout(h_void *a, size_t len);' + _Prototype_: 'acc_copyout_async(h_void *a, size_t len, int async);' + _Prototype_: 'acc_copyout_finalize(h_void *a, size_t len);' + _Prototype_: 'acc_copyout_finalize_async(h_void *a, size_t len, int + async);' + +_Fortran_: + _Interface_: 'subroutine acc_copyout(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_copyout(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + _Interface_: 'subroutine acc_copyout_async(a, async)' + 'type, dimension(:[,:]...) :: a' + 'integer(acc_handle_kind) :: async' + _Interface_: 'subroutine acc_copyout_async(a, len, async)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + 'integer(acc_handle_kind) :: async' + _Interface_: 'subroutine acc_copyout_finalize(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_copyout_finalize(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + _Interface_: 'subroutine acc_copyout_finalize_async(a, async)' + 'type, dimension(:[,:]...) :: a' + 'integer(acc_handle_kind) :: async' + _Interface_: 'subroutine acc_copyout_finalize_async(a, len, async)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + 'integer(acc_handle_kind) :: async' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.22. + + +File: libgomp.info, Node: acc_delete, Next: acc_update_device, Prev: acc_copyout, Up: OpenACC Runtime Library Routines + +6.23 'acc_delete' - Free device memory. +======================================= + +_Description_ + This function frees previously allocated device memory specified by + the device address A and the length of LEN bytes. + + In Fortran, two (2) forms are supported. In the first form, A + specifies a contiguous array section. The second form A specifies + a variable or array element and LEN specifies the length in bytes. + +_C/C++_: + _Prototype_: 'acc_delete(h_void *a, size_t len);' + _Prototype_: 'acc_delete_async(h_void *a, size_t len, int async);' + _Prototype_: 'acc_delete_finalize(h_void *a, size_t len);' + _Prototype_: 'acc_delete_finalize_async(h_void *a, size_t len, int + async);' + +_Fortran_: + _Interface_: 'subroutine acc_delete(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_delete(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + _Interface_: 'subroutine acc_delete_async(a, async)' + 'type, dimension(:[,:]...) :: a' + 'integer(acc_handle_kind) :: async' + _Interface_: 'subroutine acc_delete_async(a, len, async)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + 'integer(acc_handle_kind) :: async' + _Interface_: 'subroutine acc_delete_finalize(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_delete_finalize(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + _Interface_: 'subroutine acc_delete_async_finalize(a, async)' + 'type, dimension(:[,:]...) :: a' + 'integer(acc_handle_kind) :: async' + _Interface_: 'subroutine acc_delete_async_finalize(a, len, async)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + 'integer(acc_handle_kind) :: async' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.23. + + +File: libgomp.info, Node: acc_update_device, Next: acc_update_self, Prev: acc_delete, Up: OpenACC Runtime Library Routines + +6.24 'acc_update_device' - Update device memory from mapped host memory. +======================================================================== + +_Description_ + This function updates the device copy from the previously mapped + host memory. The host memory is specified with the host address A + and a length of LEN bytes. + + In Fortran, two (2) forms are supported. In the first form, A + specifies a contiguous array section. The second form A specifies + a variable or array element and LEN specifies the length in bytes. + +_C/C++_: + _Prototype_: 'acc_update_device(h_void *a, size_t len);' + _Prototype_: 'acc_update_device(h_void *a, size_t len, async);' + +_Fortran_: + _Interface_: 'subroutine acc_update_device(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_update_device(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + _Interface_: 'subroutine acc_update_device_async(a, async)' + 'type, dimension(:[,:]...) :: a' + 'integer(acc_handle_kind) :: async' + _Interface_: 'subroutine acc_update_device_async(a, len, async)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + 'integer(acc_handle_kind) :: async' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.24. + + +File: libgomp.info, Node: acc_update_self, Next: acc_map_data, Prev: acc_update_device, Up: OpenACC Runtime Library Routines + +6.25 'acc_update_self' - Update host memory from mapped device memory. +====================================================================== + +_Description_ + This function updates the host copy from the previously mapped + device memory. The host memory is specified with the host address + A and a length of LEN bytes. + + In Fortran, two (2) forms are supported. In the first form, A + specifies a contiguous array section. The second form A specifies + a variable or array element and LEN specifies the length in bytes. + +_C/C++_: + _Prototype_: 'acc_update_self(h_void *a, size_t len);' + _Prototype_: 'acc_update_self_async(h_void *a, size_t len, int + async);' + +_Fortran_: + _Interface_: 'subroutine acc_update_self(a)' + 'type, dimension(:[,:]...) :: a' + _Interface_: 'subroutine acc_update_self(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + _Interface_: 'subroutine acc_update_self_async(a, async)' + 'type, dimension(:[,:]...) :: a' + 'integer(acc_handle_kind) :: async' + _Interface_: 'subroutine acc_update_self_async(a, len, async)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + 'integer(acc_handle_kind) :: async' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.25. + + +File: libgomp.info, Node: acc_map_data, Next: acc_unmap_data, Prev: acc_update_self, Up: OpenACC Runtime Library Routines + +6.26 'acc_map_data' - Map previously allocated device memory to host memory. +============================================================================ + +_Description_ + This function maps previously allocated device and host memory. + The device memory is specified with the device address DATA_DEV. + The host memory is specified with the host address DATA_ARG and a + length of BYTES. + +_C/C++_: + _Prototype_: 'void acc_map_data(h_void *data_arg, d_void *data_dev, + size_t bytes);' + +_Fortran_: + _Interface_: 'subroutine acc_map_data(data_arg, data_dev, bytes)' + 'type(*), dimension(*) :: data_arg' + 'type(c_ptr), value :: data_dev' + 'integer(c_size_t), value :: bytes' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.26. OpenACC specification v3.3 (https://www.openacc.org), + section 3.2.21. + + +File: libgomp.info, Node: acc_unmap_data, Next: acc_deviceptr, Prev: acc_map_data, Up: OpenACC Runtime Library Routines + +6.27 'acc_unmap_data' - Unmap device memory from host memory. +============================================================= + +_Description_ + This function unmaps previously mapped device and host memory. The + latter specified by DATA_ARG. + +_C/C++_: + _Prototype_: 'void acc_unmap_data(h_void *data_arg);' + +_Fortran_: + _Interface_: 'subroutine acc_unmap_data(data_arg)' + 'type(*), dimension(*) :: data_arg' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.27. OpenACC specification v3.3 (https://www.openacc.org), + section 3.2.22. + + +File: libgomp.info, Node: acc_deviceptr, Next: acc_hostptr, Prev: acc_unmap_data, Up: OpenACC Runtime Library Routines + +6.28 'acc_deviceptr' - Get device pointer associated with specific host address. +================================================================================ + +_Description_ + This function returns the device address that has been mapped to + the host address specified by DATA_ARG. + +_C/C++_: + _Prototype_: 'void *acc_deviceptr(h_void *data_arg);' + +_Fortran_: + _Interface_: 'type(c_ptr) function acc_deviceptr(data_arg)' + 'type(*), dimension(*) :: data_arg' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.28. OpenACC specification v3.3 (https://www.openacc.org), + section 3.2.23. + + +File: libgomp.info, Node: acc_hostptr, Next: acc_is_present, Prev: acc_deviceptr, Up: OpenACC Runtime Library Routines + +6.29 'acc_hostptr' - Get host pointer associated with specific device address. +============================================================================== + +_Description_ + This function returns the host address that has been mapped to the + device address specified by DATA_DEV. + +_C/C++_: + _Prototype_: 'void *acc_hostptr(d_void *data_dev);' + +_Fortran_: + _Interface_: 'type(c_ptr) function acc_hostptr(data_dev)' + 'type(c_ptr), value :: data_dev' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.29. OpenACC specification v3.3 (https://www.openacc.org), + section 3.2.24. + + +File: libgomp.info, Node: acc_is_present, Next: acc_memcpy_to_device, Prev: acc_hostptr, Up: OpenACC Runtime Library Routines + +6.30 'acc_is_present' - Indicate whether host variable / array is present on device. +==================================================================================== + +_Description_ + This function indicates whether the specified host address in A and + a length of LEN bytes is present on the device. In C/C++, a + non-zero value is returned to indicate the presence of the mapped + memory on the device. A zero is returned to indicate the memory is + not mapped on the device. + + In Fortran, two (2) forms are supported. In the first form, A + specifies a contiguous array section. The second form A specifies + a variable or array element and LEN specifies the length in bytes. + If the host memory is mapped to device memory, then a 'true' is + returned. Otherwise, a 'false' is return to indicate the mapped + memory is not present. + +_C/C++_: + _Prototype_: 'int acc_is_present(h_void *a, size_t len);' + +_Fortran_: + _Interface_: 'function acc_is_present(a)' + 'type, dimension(:[,:]...) :: a' + 'logical acc_is_present' + _Interface_: 'function acc_is_present(a, len)' + 'type, dimension(:[,:]...) :: a' + 'integer len' + 'logical acc_is_present' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.30. + + +File: libgomp.info, Node: acc_memcpy_to_device, Next: acc_memcpy_from_device, Prev: acc_is_present, Up: OpenACC Runtime Library Routines + +6.31 'acc_memcpy_to_device' - Copy host memory to device memory. +================================================================ + +_Description_ + This function copies host memory specified by host address of + DATA_HOST_SRC to device memory specified by the device address + DATA_DEV_DEST for a length of BYTES bytes. + +_C/C++_: + _Prototype_: 'void acc_memcpy_to_device(d_void* data_dev_dest,' + 'h_void* data_host_src, size_t bytes);' + _Prototype_: 'void acc_memcpy_to_device_async(d_void* data_dev_dest,' + 'h_void* data_host_src, size_t bytes, int async_arg);' + +_Fortran_: + _Interface_: 'subroutine acc_memcpy_to_device(data_dev_dest, &' + 'data_host_src, bytes)' + _Interface_: 'subroutine acc_memcpy_to_device_async(data_dev_dest, &' + 'data_host_src, bytes, async_arg)' + 'type(c_ptr), value :: data_dev_dest' + 'type(*), dimension(*) :: data_host_src' + 'integer(c_size_t), value :: bytes' + 'integer(acc_handle_kind), value :: async_arg' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.31 OpenACC specification v3.3 (https://www.openacc.org), + section 3.2.26. + + +File: libgomp.info, Node: acc_memcpy_from_device, Next: acc_attach, Prev: acc_memcpy_to_device, Up: OpenACC Runtime Library Routines + +6.32 'acc_memcpy_from_device' - Copy device memory to host memory. +================================================================== + +_Description_ + This function copies device memory specified by device address of + DATA_DEV_SRC to host memory specified by the host address + DATA_HOST_DEST for a length of BYTES bytes. + +_C/C++_: + _Prototype_: 'void acc_memcpy_from_device(h_void* data_host_dest,' + 'd_void* data_dev_src, size_t bytes);' + _Prototype_: 'void acc_memcpy_from_device_async(h_void* + data_host_dest,' + 'd_void* data_dev_src, size_t bytes, int async_arg);' + +_Fortran_: + _Interface_: 'subroutine acc_memcpy_from_device(data_host_dest, &' + 'data_dev_src, bytes)' + _Interface_: 'subroutine acc_memcpy_from_device_async(data_host_dest, + &' + 'data_dev_src, bytes, async_arg)' + 'type(*), dimension(*) :: data_host_dest' + 'type(c_ptr), value :: data_dev_src' + 'integer(c_size_t), value :: bytes' + 'integer(acc_handle_kind), value :: async_arg' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.32. OpenACC specification v3.3 (https://www.openacc.org), + section 3.2.27. + + +File: libgomp.info, Node: acc_attach, Next: acc_detach, Prev: acc_memcpy_from_device, Up: OpenACC Runtime Library Routines + +6.33 'acc_attach' - Let device pointer point to device-pointer target. +====================================================================== + +_Description_ + This function updates a pointer on the device from pointing to a + host-pointer address to pointing to the corresponding device data. + +_C/C++_: + _Prototype_: 'void acc_attach(h_void **ptr_addr);' + _Prototype_: 'void acc_attach_async(h_void **ptr_addr, int async);' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.34. + + +File: libgomp.info, Node: acc_detach, Next: acc_get_current_cuda_device, Prev: acc_attach, Up: OpenACC Runtime Library Routines + +6.34 'acc_detach' - Let device pointer point to host-pointer target. +==================================================================== + +_Description_ + This function updates a pointer on the device from pointing to a + device-pointer address to pointing to the corresponding host data. + +_C/C++_: + _Prototype_: 'void acc_detach(h_void **ptr_addr);' + _Prototype_: 'void acc_detach_async(h_void **ptr_addr, int async);' + _Prototype_: 'void acc_detach_finalize(h_void **ptr_addr);' + _Prototype_: 'void acc_detach_finalize_async(h_void **ptr_addr, int + async);' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + 3.2.35. + + +File: libgomp.info, Node: acc_get_current_cuda_device, Next: acc_get_current_cuda_context, Prev: acc_detach, Up: OpenACC Runtime Library Routines + +6.35 'acc_get_current_cuda_device' - Get CUDA device handle. +============================================================ + +_Description_ + This function returns the CUDA device handle. This handle is the + same as used by the CUDA Runtime or Driver API's. + +_C/C++_: + _Prototype_: 'void *acc_get_current_cuda_device(void);' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + A.2.1.1. + + +File: libgomp.info, Node: acc_get_current_cuda_context, Next: acc_get_cuda_stream, Prev: acc_get_current_cuda_device, Up: OpenACC Runtime Library Routines + +6.36 'acc_get_current_cuda_context' - Get CUDA context handle. +============================================================== + +_Description_ + This function returns the CUDA context handle. This handle is the + same as used by the CUDA Runtime or Driver API's. + +_C/C++_: + _Prototype_: 'void *acc_get_current_cuda_context(void);' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + A.2.1.2. + + +File: libgomp.info, Node: acc_get_cuda_stream, Next: acc_set_cuda_stream, Prev: acc_get_current_cuda_context, Up: OpenACC Runtime Library Routines + +6.37 'acc_get_cuda_stream' - Get CUDA stream handle. +==================================================== + +_Description_ + This function returns the CUDA stream handle for the queue ASYNC. + This handle is the same as used by the CUDA Runtime or Driver + API's. + +_C/C++_: + _Prototype_: 'void *acc_get_cuda_stream(int async);' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + A.2.1.3. + + +File: libgomp.info, Node: acc_set_cuda_stream, Next: acc_prof_register, Prev: acc_get_cuda_stream, Up: OpenACC Runtime Library Routines + +6.38 'acc_set_cuda_stream' - Set CUDA stream handle. +==================================================== + +_Description_ + This function associates the stream handle specified by STREAM with + the queue ASYNC. + + This cannot be used to change the stream handle associated with + 'acc_async_sync'. + + The return value is not specified. + +_C/C++_: + _Prototype_: 'int acc_set_cuda_stream(int async, void *stream);' + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section + A.2.1.4. + + +File: libgomp.info, Node: acc_prof_register, Next: acc_prof_unregister, Prev: acc_set_cuda_stream, Up: OpenACC Runtime Library Routines + +6.39 'acc_prof_register' - Register callbacks. +============================================== + +_Description_: + This function registers callbacks. + +_C/C++_: + _Prototype_: 'void acc_prof_register (acc_event_t, acc_prof_callback, + acc_register_t);' + +_See also_: + *note OpenACC Profiling Interface:: + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section 5.3. + + +File: libgomp.info, Node: acc_prof_unregister, Next: acc_prof_lookup, Prev: acc_prof_register, Up: OpenACC Runtime Library Routines + +6.40 'acc_prof_unregister' - Unregister callbacks. +================================================== + +_Description_: + This function unregisters callbacks. + +_C/C++_: + _Prototype_: 'void acc_prof_unregister (acc_event_t, + acc_prof_callback, acc_register_t);' + +_See also_: + *note OpenACC Profiling Interface:: + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section 5.3. + + +File: libgomp.info, Node: acc_prof_lookup, Next: acc_register_library, Prev: acc_prof_unregister, Up: OpenACC Runtime Library Routines + +6.41 'acc_prof_lookup' - Obtain inquiry functions. +================================================== + +_Description_: + Function to obtain inquiry functions. + +_C/C++_: + _Prototype_: 'acc_query_fn acc_prof_lookup (const char *);' + +_See also_: + *note OpenACC Profiling Interface:: + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section 5.3. + + +File: libgomp.info, Node: acc_register_library, Prev: acc_prof_lookup, Up: OpenACC Runtime Library Routines + +6.42 'acc_register_library' - Library registration. +=================================================== + +_Description_: + Function for library registration. + +_C/C++_: + _Prototype_: 'void acc_register_library (acc_prof_reg, acc_prof_reg, + acc_prof_lookup_func);' + +_See also_: + *note OpenACC Profiling Interface::, *note ACC_PROFLIB:: + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section 5.3. + + +File: libgomp.info, Node: OpenACC Environment Variables, Next: CUDA Streams Usage, Prev: OpenACC Runtime Library Routines, Up: Top + +7 OpenACC Environment Variables +******************************* + +The variables 'ACC_DEVICE_TYPE' and 'ACC_DEVICE_NUM' are defined by +section 4 of the OpenACC specification in version 2.0. The variable +'ACC_PROFLIB' is defined by section 4 of the OpenACC specification in +version 2.6. + +* Menu: + +* ACC_DEVICE_TYPE:: +* ACC_DEVICE_NUM:: +* ACC_PROFLIB:: + + +File: libgomp.info, Node: ACC_DEVICE_TYPE, Next: ACC_DEVICE_NUM, Up: OpenACC Environment Variables + +7.1 'ACC_DEVICE_TYPE' +===================== + +_Description_: + Control the default device type to use when executing compute + regions. If unset, the code can be run on any device type, + favoring a non-host device type. + + Supported values in GCC (if compiled in) are + * 'host' + * 'nvidia' + * 'radeon' +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section 4.1. + + +File: libgomp.info, Node: ACC_DEVICE_NUM, Next: ACC_PROFLIB, Prev: ACC_DEVICE_TYPE, Up: OpenACC Environment Variables + +7.2 'ACC_DEVICE_NUM' +==================== + +_Description_: + Control which device, identified by device number, is the default + device. The value must be a nonnegative integer less than the + number of devices. If unset, device number zero is used. +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section 4.2. + + +File: libgomp.info, Node: ACC_PROFLIB, Prev: ACC_DEVICE_NUM, Up: OpenACC Environment Variables + +7.3 'ACC_PROFLIB' +================= + +_Description_: + Semicolon-separated list of dynamic libraries that are loaded as + profiling libraries. Each library must provide at least the + 'acc_register_library' routine. Each library file is found as + described by the documentation of 'dlopen' of your operating + system. +_See also_: + *note acc_register_library::, *note OpenACC Profiling Interface:: + +_Reference_: + OpenACC specification v2.6 (https://www.openacc.org), section 4.3. + + +File: libgomp.info, Node: CUDA Streams Usage, Next: OpenACC Library Interoperability, Prev: OpenACC Environment Variables, Up: Top + +8 CUDA Streams Usage +******************** + +This applies to the 'nvptx' plugin only. + + The library provides elements that perform asynchronous movement of +data and asynchronous operation of computing constructs. This +asynchronous functionality is implemented by making use of CUDA +streams(1). + + The primary means by that the asynchronous functionality is accessed +is through the use of those OpenACC directives which make use of the +'async' and 'wait' clauses. When the 'async' clause is first used with +a directive, it creates a CUDA stream. If an 'async-argument' is used +with the 'async' clause, then the stream is associated with the +specified 'async-argument'. + + Following the creation of an association between a CUDA stream and +the 'async-argument' of an 'async' clause, both the 'wait' clause and +the 'wait' directive can be used. When either the clause or directive +is used after stream creation, it creates a rendezvous point whereby +execution waits until all operations associated with the +'async-argument', that is, stream, have completed. + + Normally, the management of the streams that are created as a result +of using the 'async' clause, is done without any intervention by the +caller. This implies the association between the 'async-argument' and +the CUDA stream is maintained for the lifetime of the program. However, +this association can be changed through the use of the library function +'acc_set_cuda_stream'. When the function 'acc_set_cuda_stream' is +called, the CUDA stream that was originally associated with the 'async' +clause is destroyed. Caution should be taken when changing the +association as subsequent references to the 'async-argument' refer to a +different CUDA stream. + + ---------- Footnotes ---------- + + (1) See "Stream Management" in "CUDA Driver API", TRM-06703-001, +Version 5.5, for additional information + + +File: libgomp.info, Node: OpenACC Library Interoperability, Next: OpenACC Profiling Interface, Prev: CUDA Streams Usage, Up: Top + +9 OpenACC Library Interoperability +********************************** + +9.1 Introduction +================ + +The OpenACC library uses the CUDA Driver API, and may interact with +programs that use the Runtime library directly, or another library based +on the Runtime library, e.g., CUBLAS(1). This chapter describes the use +cases and what changes are required in order to use both the OpenACC +library and the CUBLAS and Runtime libraries within a program. + +9.2 First invocation: NVIDIA CUBLAS library API +=============================================== + +In this first use case (see below), a function in the CUBLAS library is +called prior to any of the functions in the OpenACC library. More +specifically, the function 'cublasCreate()'. + + When invoked, the function initializes the library and allocates the +hardware resources on the host and the device on behalf of the caller. +Once the initialization and allocation has completed, a handle is +returned to the caller. The OpenACC library also requires +initialization and allocation of hardware resources. Since the CUBLAS +library has already allocated the hardware resources for the device, all +that is left to do is to initialize the OpenACC library and acquire the +hardware resources on the host. + + Prior to calling the OpenACC function that initializes the library +and allocate the host hardware resources, you need to acquire the device +number that was allocated during the call to 'cublasCreate()'. The +invoking of the runtime library function 'cudaGetDevice()' accomplishes +this. Once acquired, the device number is passed along with the device +type as parameters to the OpenACC library function +'acc_set_device_num()'. + + Once the call to 'acc_set_device_num()' has completed, the OpenACC +library uses the context that was created during the call to +'cublasCreate()'. In other words, both libraries share the same +context. + + /* Create the handle */ + s = cublasCreate(&h); + if (s != CUBLAS_STATUS_SUCCESS) + { + fprintf(stderr, "cublasCreate failed %d\n", s); + exit(EXIT_FAILURE); + } + + /* Get the device number */ + e = cudaGetDevice(&dev); + if (e != cudaSuccess) + { + fprintf(stderr, "cudaGetDevice failed %d\n", e); + exit(EXIT_FAILURE); + } + + /* Initialize OpenACC library and use device 'dev' */ + acc_set_device_num(dev, acc_device_nvidia); + + Use Case 1 + +9.3 First invocation: OpenACC library API +========================================= + +In this second use case (see below), a function in the OpenACC library +is called prior to any of the functions in the CUBLAS library. More +specifically, the function 'acc_set_device_num()'. + + In the use case presented here, the function 'acc_set_device_num()' +is used to both initialize the OpenACC library and allocate the hardware +resources on the host and the device. In the call to the function, the +call parameters specify which device to use and what device type to use, +i.e., 'acc_device_nvidia'. It should be noted that this is but one +method to initialize the OpenACC library and allocate the appropriate +hardware resources. Other methods are available through the use of +environment variables and these is discussed in the next section. + + Once the call to 'acc_set_device_num()' has completed, other OpenACC +functions can be called as seen with multiple calls being made to +'acc_copyin()'. In addition, calls can be made to functions in the +CUBLAS library. In the use case a call to 'cublasCreate()' is made +subsequent to the calls to 'acc_copyin()'. As seen in the previous use +case, a call to 'cublasCreate()' initializes the CUBLAS library and +allocates the hardware resources on the host and the device. However, +since the device has already been allocated, 'cublasCreate()' only +initializes the CUBLAS library and allocates the appropriate hardware +resources on the host. The context that was created as part of the +OpenACC initialization is shared with the CUBLAS library, similarly to +the first use case. + + dev = 0; + + acc_set_device_num(dev, acc_device_nvidia); + + /* Copy the first set to the device */ + d_X = acc_copyin(&h_X[0], N * sizeof (float)); + if (d_X == NULL) + { + fprintf(stderr, "copyin error h_X\n"); + exit(EXIT_FAILURE); + } + + /* Copy the second set to the device */ + d_Y = acc_copyin(&h_Y1[0], N * sizeof (float)); + if (d_Y == NULL) + { + fprintf(stderr, "copyin error h_Y1\n"); + exit(EXIT_FAILURE); + } + + /* Create the handle */ + s = cublasCreate(&h); + if (s != CUBLAS_STATUS_SUCCESS) + { + fprintf(stderr, "cublasCreate failed %d\n", s); + exit(EXIT_FAILURE); + } + + /* Perform saxpy using CUBLAS library function */ + s = cublasSaxpy(h, N, &alpha, d_X, 1, d_Y, 1); + if (s != CUBLAS_STATUS_SUCCESS) + { + fprintf(stderr, "cublasSaxpy failed %d\n", s); + exit(EXIT_FAILURE); + } + + /* Copy the results from the device */ + acc_memcpy_from_device(&h_Y1[0], d_Y, N * sizeof (float)); + + Use Case 2 + +9.4 OpenACC library and environment variables +============================================= + +There are two environment variables associated with the OpenACC library +that may be used to control the device type and device number: +'ACC_DEVICE_TYPE' and 'ACC_DEVICE_NUM', respectively. These two +environment variables can be used as an alternative to calling +'acc_set_device_num()'. As seen in the second use case, the device type +and device number were specified using 'acc_set_device_num()'. If +however, the aforementioned environment variables were set, then the +call to 'acc_set_device_num()' would not be required. + + The use of the environment variables is only relevant when an OpenACC +function is called prior to a call to 'cudaCreate()'. If 'cudaCreate()' +is called prior to a call to an OpenACC function, then you must call +'acc_set_device_num()'(2) + + ---------- Footnotes ---------- + + (1) See section 2.26, "Interactions with the CUDA Driver API" in +"CUDA Runtime API", Version 5.5, and section 2.27, "VDPAU +Interoperability", in "CUDA Driver API", TRM-06703-001, Version 5.5, for +additional information on library interoperability. + + (2) More complete information about 'ACC_DEVICE_TYPE' and +'ACC_DEVICE_NUM' can be found in sections 4.1 and 4.2 of the OpenACC +(https://www.openacc.org) Application Programming Interface”, Version +2.6. + + +File: libgomp.info, Node: OpenACC Profiling Interface, Next: OpenMP-Implementation Specifics, Prev: OpenACC Library Interoperability, Up: Top + +10 OpenACC Profiling Interface +****************************** + +10.1 Implementation Status and Implementation-Defined Behavior +============================================================== + +We're implementing the OpenACC Profiling Interface as defined by the +OpenACC 2.6 specification. We're clarifying some aspects here as +_implementation-defined behavior_, while they're still under discussion +within the OpenACC Technical Committee. + + This implementation is tuned to keep the performance impact as low as +possible for the (very common) case that the Profiling Interface is not +enabled. This is relevant, as the Profiling Interface affects all the +_hot_ code paths (in the target code, not in the offloaded code). Users +of the OpenACC Profiling Interface can be expected to understand that +performance is impacted to some degree once the Profiling Interface is +enabled: for example, because of the _runtime_ (libgomp) calling into a +third-party _library_ for every event that has been registered. + + We're not yet accounting for the fact that 'OpenACC events may occur +during event processing'. We just handle one case specially, as +required by CUDA 9.0 'nvprof', that 'acc_get_device_type' (*note +acc_get_device_type::)) may be called from 'acc_ev_device_init_start', +'acc_ev_device_init_end' callbacks. + + We're not yet implementing initialization via a +'acc_register_library' function that is either statically linked in, or +dynamically via 'LD_PRELOAD'. Initialization via 'acc_register_library' +functions dynamically loaded via the 'ACC_PROFLIB' environment variable +does work, as does directly calling 'acc_prof_register', +'acc_prof_unregister', 'acc_prof_lookup'. + + As currently there are no inquiry functions defined, calls to +'acc_prof_lookup' always returns 'NULL'. + + There aren't separate _start_, _stop_ events defined for the event +types 'acc_ev_create', 'acc_ev_delete', 'acc_ev_alloc', 'acc_ev_free'. +It's not clear if these should be triggered before or after the actual +device-specific call is made. We trigger them after. + + Remarks about data provided to callbacks: + +'acc_prof_info.event_type' + It's not clear if for _nested_ event callbacks (for example, + 'acc_ev_enqueue_launch_start' as part of a parent compute + construct), this should be set for the nested event + ('acc_ev_enqueue_launch_start'), or if the value of the parent + construct should remain ('acc_ev_compute_construct_start'). In + this implementation, the value generally corresponds to the + innermost nested event type. + +'acc_prof_info.device_type' + + * For 'acc_ev_compute_construct_start', and in presence of an + 'if' clause with _false_ argument, this still refers to the + offloading device type. It's not clear if that's the expected + behavior. + + * Complementary to the item before, for + 'acc_ev_compute_construct_end', this is set to + 'acc_device_host' in presence of an 'if' clause with _false_ + argument. It's not clear if that's the expected behavior. + +'acc_prof_info.thread_id' + Always '-1'; not yet implemented. + +'acc_prof_info.async' + + * Not yet implemented correctly for + 'acc_ev_compute_construct_start'. + + * In a compute construct, for host-fallback + execution/'acc_device_host' it always is 'acc_async_sync'. It + is unclear if that is the expected behavior. + + * For 'acc_ev_device_init_start' and 'acc_ev_device_init_end', + it will always be 'acc_async_sync'. It is unclear if that is + the expected behavior. + +'acc_prof_info.async_queue' + There is no 'limited number of asynchronous queues' in libgomp. + This always has the same value as 'acc_prof_info.async'. + +'acc_prof_info.src_file' + Always 'NULL'; not yet implemented. + +'acc_prof_info.func_name' + Always 'NULL'; not yet implemented. + +'acc_prof_info.line_no' + Always '-1'; not yet implemented. + +'acc_prof_info.end_line_no' + Always '-1'; not yet implemented. + +'acc_prof_info.func_line_no' + Always '-1'; not yet implemented. + +'acc_prof_info.func_end_line_no' + Always '-1'; not yet implemented. + +'acc_event_info.event_type', 'acc_event_info.*.event_type' + Relating to 'acc_prof_info.event_type' discussed above, in this + implementation, this will always be the same value as + 'acc_prof_info.event_type'. + +'acc_event_info.*.parent_construct' + + * Will be 'acc_construct_parallel' for all OpenACC compute + constructs as well as many OpenACC Runtime API calls; should + be the one matching the actual construct, or + 'acc_construct_runtime_api', respectively. + + * Will be 'acc_construct_enter_data' or + 'acc_construct_exit_data' when processing variable mappings + specified in OpenACC _declare_ directives; should be + 'acc_construct_declare'. + + * For implicit 'acc_ev_device_init_start', + 'acc_ev_device_init_end', and explicit as well as implicit + 'acc_ev_alloc', 'acc_ev_free', 'acc_ev_enqueue_upload_start', + 'acc_ev_enqueue_upload_end', 'acc_ev_enqueue_download_start', + and 'acc_ev_enqueue_download_end', will be + 'acc_construct_parallel'; should reflect the real parent + construct. + +'acc_event_info.*.implicit' + For 'acc_ev_alloc', 'acc_ev_free', 'acc_ev_enqueue_upload_start', + 'acc_ev_enqueue_upload_end', 'acc_ev_enqueue_download_start', and + 'acc_ev_enqueue_download_end', this currently will be '1' also for + explicit usage. + +'acc_event_info.data_event.var_name' + Always 'NULL'; not yet implemented. + +'acc_event_info.data_event.host_ptr' + For 'acc_ev_alloc', and 'acc_ev_free', this is always 'NULL'. + +'typedef union acc_api_info' + ... as printed in '5.2.3. Third Argument: API-Specific + Information'. This should obviously be 'typedef _struct_ + acc_api_info'. + +'acc_api_info.device_api' + Possibly not yet implemented correctly for + 'acc_ev_compute_construct_start', 'acc_ev_device_init_start', + 'acc_ev_device_init_end': will always be 'acc_device_api_none' for + these event types. For 'acc_ev_enter_data_start', it will be + 'acc_device_api_none' in some cases. + +'acc_api_info.device_type' + Always the same as 'acc_prof_info.device_type'. + +'acc_api_info.vendor' + Always '-1'; not yet implemented. + +'acc_api_info.device_handle' + Always 'NULL'; not yet implemented. + +'acc_api_info.context_handle' + Always 'NULL'; not yet implemented. + +'acc_api_info.async_handle' + Always 'NULL'; not yet implemented. + + Remarks about certain event types: + +'acc_ev_device_init_start', 'acc_ev_device_init_end' + + * When a compute construct triggers implicit + 'acc_ev_device_init_start' and 'acc_ev_device_init_end' + events, they currently aren't _nested within_ the + corresponding 'acc_ev_compute_construct_start' and + 'acc_ev_compute_construct_end', but they're currently observed + _before_ 'acc_ev_compute_construct_start'. It's not clear + what to do: the standard asks us provide a lot of details to + the 'acc_ev_compute_construct_start' callback, without + (implicitly) initializing a device before? + + * Callbacks for these event types will not be invoked for calls + to the 'acc_set_device_type' and 'acc_set_device_num' + functions. It's not clear if they should be. + +'acc_ev_enter_data_start', 'acc_ev_enter_data_end', 'acc_ev_exit_data_start', 'acc_ev_exit_data_end' + + * Callbacks for these event types will also be invoked for + OpenACC _host_data_ constructs. It's not clear if they should + be. + + * Callbacks for these event types will also be invoked when + processing variable mappings specified in OpenACC _declare_ + directives. It's not clear if they should be. + + Callbacks for the following event types will be invoked, but dispatch +and information provided therein has not yet been thoroughly reviewed: + + * 'acc_ev_alloc' + * 'acc_ev_free' + * 'acc_ev_update_start', 'acc_ev_update_end' + * 'acc_ev_enqueue_upload_start', 'acc_ev_enqueue_upload_end' + * 'acc_ev_enqueue_download_start', 'acc_ev_enqueue_download_end' + + During device initialization, and finalization, respectively, +callbacks for the following event types will not yet be invoked: + + * 'acc_ev_alloc' + * 'acc_ev_free' + + Callbacks for the following event types have not yet been +implemented, so currently won't be invoked: + + * 'acc_ev_device_shutdown_start', 'acc_ev_device_shutdown_end' + * 'acc_ev_runtime_shutdown' + * 'acc_ev_create', 'acc_ev_delete' + * 'acc_ev_wait_start', 'acc_ev_wait_end' + + For the following runtime library functions, not all expected +callbacks will be invoked (mostly concerning implicit device +initialization): + + * 'acc_get_num_devices' + * 'acc_set_device_type' + * 'acc_get_device_type' + * 'acc_set_device_num' + * 'acc_get_device_num' + * 'acc_init' + * 'acc_shutdown' + + Aside from implicit device initialization, for the following runtime +library functions, no callbacks will be invoked for shared-memory +offloading devices (it's not clear if they should be): + + * 'acc_malloc' + * 'acc_free' + * 'acc_copyin', 'acc_present_or_copyin', 'acc_copyin_async' + * 'acc_create', 'acc_present_or_create', 'acc_create_async' + * 'acc_copyout', 'acc_copyout_async', 'acc_copyout_finalize', + 'acc_copyout_finalize_async' + * 'acc_delete', 'acc_delete_async', 'acc_delete_finalize', + 'acc_delete_finalize_async' + * 'acc_update_device', 'acc_update_device_async' + * 'acc_update_self', 'acc_update_self_async' + * 'acc_map_data', 'acc_unmap_data' + * 'acc_memcpy_to_device', 'acc_memcpy_to_device_async' + * 'acc_memcpy_from_device', 'acc_memcpy_from_device_async' + + +File: libgomp.info, Node: OpenMP-Implementation Specifics, Next: Offload-Target Specifics, Prev: OpenACC Profiling Interface, Up: Top + +11 OpenMP-Implementation Specifics +********************************** + +* Menu: + +* Implementation-defined ICV Initialization:: +* OpenMP Context Selectors:: +* Memory allocation:: + + +File: libgomp.info, Node: Implementation-defined ICV Initialization, Next: OpenMP Context Selectors, Up: OpenMP-Implementation Specifics + +11.1 Implementation-defined ICV Initialization +============================================== + +AFFINITY-FORMAT-VAR See *note OMP_AFFINITY_FORMAT::. +DEF-ALLOCATOR-VAR See *note OMP_ALLOCATOR::. +MAX-ACTIVE-LEVELS-VAR See *note OMP_MAX_ACTIVE_LEVELS::. +DYN-VAR See *note OMP_DYNAMIC::. +NTHREADS-VAR See *note OMP_NUM_THREADS::. +NUM-DEVICES-VAR Number of non-host devices found by GCC's + run-time library +NUM-PROCS-VAR The number of CPU cores on the initial device, + except that affinity settings might lead to a + smaller number. On non-host devices, the value + of the NTHREADS-VAR ICV. +PLACE-PARTITION-VAR See *note OMP_PLACES::. +RUN-SCHED-VAR See *note OMP_SCHEDULE::. +STACKSIZE-VAR See *note OMP_STACKSIZE::. +THREAD-LIMIT-VAR See *note OMP_TEAMS_THREAD_LIMIT:: +WAIT-POLICY-VAR See *note OMP_WAIT_POLICY:: and + *note GOMP_SPINCOUNT:: + + +File: libgomp.info, Node: OpenMP Context Selectors, Next: Memory allocation, Prev: Implementation-defined ICV Initialization, Up: OpenMP-Implementation Specifics + +11.2 OpenMP Context Selectors +============================= + +'vendor' is always 'gnu'. References are to the GCC manual. + + For the host compiler, 'kind' always matches 'host', 'cpu' and 'any'; +for the offloading architectures AMD GCN and Nvidia PTX, 'kind' always +matches 'nohost', 'gpu' and 'any'. For the x86 family of computers, AMD +GCN and Nvidia PTX the following traits are supported in addition; while +OpenMP is supported on more architectures, GCC currently does not match +any 'arch' or 'isa' traits for those. + +'arch' 'isa' +----------------------------------------------------------------------- +'x86', 'x86_64', 'i386', 'i486', 'i586', See '-m...' flags in +'i686', 'ia32' "x86 Options" + (without '-m') +'amdgcn', 'gcn' See '-march=' in + "AMD GCN Options" +'nvptx', 'nvptx64' See '-march=' in + "Nvidia PTX Options" + + +File: libgomp.info, Node: Memory allocation, Prev: OpenMP Context Selectors, Up: OpenMP-Implementation Specifics + +11.3 Memory allocation +====================== + +The description below applies to: + + * Explicit use of the OpenMP API routines, see *note Memory + Management Routines::. + * The 'allocate' clause, except when the 'allocator' modifier is a + constant expression with value 'omp_default_mem_alloc' and no + 'align' modifier has been specified. (In that case, the normal + 'malloc' allocation is used.) + * The 'allocate' directive for variables in static memory; while the + alignment is honored, the normal static memory is used. + * Using the 'allocate' directive for automatic/stack variables, + except when the 'allocator' clause is a constant expression with + value 'omp_default_mem_alloc' and no 'align' clause has been + specified. (In that case, the normal allocation is used: stack + allocation and, sometimes for Fortran, also 'malloc' [depending on + flags such as '-fstack-arrays'].) + * In Fortran, the 'allocators' directive and the executable + 'allocate' directive for Fortran pointers and allocatables is + supported, but requires that files containing those directives has + to be compiled with '-fopenmp-allocators'. Additionally, all files + that might explicitly or implicitly deallocate memory allocated + that way must also be compiled with that option. + * The used alignment is the maximum of the value the 'align' clause + and the alignment of the type after honoring, if present, the + 'aligned' ('GNU::aligned') attribute and C's '_Alignas' and C++'s + 'alignas'. However, the 'align' clause of the 'allocate' directive + has no effect on the value of C's '_Alignof' and C++'s 'alignof'. + + GCC supports the following predefined allocators and predefined +memory spaces: + +Predefined allocators Associated predefined memory + spaces +------------------------------------------------------------------ +omp_default_mem_alloc omp_default_mem_space +omp_large_cap_mem_alloc omp_large_cap_mem_space +omp_const_mem_alloc omp_const_mem_space +omp_high_bw_mem_alloc omp_high_bw_mem_space +omp_low_lat_mem_alloc omp_low_lat_mem_space +omp_cgroup_mem_alloc omp_low_lat_mem_space + (implementation defined) +omp_pteam_mem_alloc omp_low_lat_mem_space + (implementation defined) +omp_thread_mem_alloc omp_low_lat_mem_space + (implementation defined) +ompx_gnu_pinned_mem_alloc omp_default_mem_space (GNU + extension) + + Each predefined allocator, including 'omp_null_allocator', has a +corresponding allocator class template that meet the C++ allocator +completeness requirements. These are located in the 'omp::allocator' +namespace, and the 'ompx::allocator' namespace for gnu extensions. This +allows the allocator-aware C++ standard library containers to use OpenMP +allocation routines; for instance: + + std::vector> vec; + + The following allocator templates are supported: + +Predefined allocators Associated allocator template +------------------------------------------------------------------ +omp_null_allocator omp::allocator::null_allocator +omp_default_mem_alloc omp::allocator::default_mem +omp_large_cap_mem_alloc omp::allocator::large_cap_mem +omp_const_mem_alloc omp::allocator::const_mem +omp_high_bw_mem_alloc omp::allocator::high_bw_mem +omp_low_lat_mem_alloc omp::allocator::low_lat_mem +omp_cgroup_mem_alloc omp::allocator::cgroup_mem +omp_pteam_mem_alloc omp::allocator::pteam_mem +omp_thread_mem_alloc omp::allocator::thread_mem +ompx_gnu_pinned_mem_alloc ompx::allocator::gnu_pinned_mem + + The following traits are available when constructing a new allocator; +if a trait is not specified or with the value 'default', the specified +default value is used for that trait. The predefined allocators use the +default values of each trait, except that the 'omp_cgroup_mem_alloc', +'omp_pteam_mem_alloc', and 'omp_thread_mem_alloc' allocators have the +'access' trait set to 'cgroup', 'pteam', and 'thread', respectively. +For each trait, a named constant prefixed by 'omp_atk_' exists; for each +non-numeric value, a named constant prefixed by 'omp_atv_' exists. + +Trait Allowed values Default value +-------------------------------------------------------------------- +'sync_hint' 'contended', 'uncontended', 'contended' + 'serialized', 'private' +'alignment' Positive integer being a 1 byte + power of two +'access' 'all', 'cgroup', 'pteam', 'all' + 'thread' +'pool_size' Positive integer (bytes) See below. +'fallback' 'default_mem_fb', See below + 'null_fb', 'abort_fb', + 'allocator_fb' +'fb_data' _allocator handle_ (none) +'pinned' 'true', 'false' See below +'partition' 'environment', 'nearest', 'environment' + 'blocked', 'interleaved' + + For the 'fallback' trait, the default value is 'null_fb' for the +'omp_default_mem_alloc' allocator and any allocator that is associated +with device memory; for all other allocators, it is 'default_mem_fb' by +default. + + For the 'pinned' trait, the default value is 'true' for predefined +allocator 'ompx_gnu_pinned_mem_alloc' (a GNU extension), and 'false' for +all others. + + The following description applies to the initial device (the host) +and largely also to non-host devices; for the latter, also see *note +Offload-Target Specifics::. + + For the memory spaces, the following applies: + * 'omp_default_mem_space' is supported + * 'omp_const_mem_space' maps to 'omp_default_mem_space' + * 'omp_low_lat_mem_space' is only available on supported devices, and + maps to 'omp_default_mem_space' otherwise. + * 'omp_large_cap_mem_space' maps to 'omp_default_mem_space', unless + the memkind library is available + * 'omp_high_bw_mem_space' maps to 'omp_default_mem_space', unless the + memkind library is available + + On Linux systems, where the memkind library +(https://github.com/memkind/memkind) ('libmemkind.so.0') is available at +runtime and the respective memkind kind is supported, it is used when +creating memory allocators requesting + + * the 'partition' trait 'interleaved' except when the memory space is + 'omp_large_cap_mem_space' (uses 'MEMKIND_HBW_INTERLEAVE') + * the memory space is 'omp_high_bw_mem_space' (uses + 'MEMKIND_HBW_PREFERRED') + * the memory space is 'omp_large_cap_mem_space' (uses + 'MEMKIND_DAX_KMEM_ALL' or, if not available, 'MEMKIND_DAX_KMEM') + + On Linux systems, where the numa library +(https://github.com/numactl/numactl) ('libnuma.so.1') is available at +runtime, it used when creating memory allocators requesting + + * the 'partition' trait 'nearest', except when both the libmemkind + library is available and the memory space is either + 'omp_large_cap_mem_space' or 'omp_high_bw_mem_space' + + Note that the numa library will round up the allocation size to a +multiple of the system page size; therefore, consider using it only with +large data or by sharing allocations via the 'pool_size' trait. +Furthermore, the Linux kernel does not guarantee that an allocation will +always be on the nearest NUMA node nor that after reallocation the same +node will be used. Note additionally that, on Linux, the default +setting of the memory placement policy is to use the current node; +therefore, unless the memory placement policy has been overridden, the +'partition' trait 'environment' (the default) will be effectively a +'nearest' allocation. + + Additional notes regarding the traits: + * The 'pinned' trait is supported on Linux hosts, but is subject to + the OS 'ulimit'/'rlimit' locked memory settings. It currently uses + 'mmap' and is therefore optimized for few allocations, including + large data. If the conditions for numa or memkind allocations are + fulfilled, those allocators are used instead. + * The default for the 'pool_size' trait is no pool and for every + (re)allocation the associated library routine is called, which + might internally use a memory pool. Currently, the same applies + when a 'pool_size' has been specified, except that once allocations + exceed the the pool size, the action of the 'fallback' trait + applies. + * For the 'partition' trait, the partition part size will be the same + as the requested size (i.e. 'interleaved' or 'blocked' has no + effect), except for 'interleaved' when the memkind library is + available. Furthermore, for 'nearest' and unless the numa library + is available, the memory might not be on the same NUMA node as + thread that allocated the memory; on Linux, this is in particular + the case when the memory placement policy is set to preferred. + * The 'access' trait has no effect such that memory is always + accessible by all threads. (Except on supported no-host devices.) + * The 'sync_hint' trait has no effect. + + See also: *note Offload-Target Specifics:: + + +File: libgomp.info, Node: Offload-Target Specifics, Next: The libgomp ABI, Prev: OpenMP-Implementation Specifics, Up: Top + +12 Offload-Target Specifics +*************************** + +The following sections present notes on the offload-target specifics + +* Menu: + +* AMD Radeon:: +* nvptx:: + + +File: libgomp.info, Node: AMD Radeon, Next: nvptx, Up: Offload-Target Specifics + +12.1 AMD Radeon (GCN) +===================== + +* Menu: + +* Foreign-runtime support for AMD GPUs:: + +On the hardware side, there is the hierarchy (fine to coarse): + * work item (thread) + * wavefront + * work group + * compute unit (CU) + + All OpenMP and OpenACC levels are used, i.e. + * OpenMP's simd and OpenACC's vector map to work items (thread) + * OpenMP's threads ("parallel") and OpenACC's workers map to + wavefronts + * OpenMP's teams and OpenACC's gang use a threadpool with the size of + the number of teams or gangs, respectively. + + The used sizes are + * Number of teams is the specified 'num_teams' (OpenMP) or + 'num_gangs' (OpenACC) or otherwise the number of CU. It is limited + by two times the number of CU. + * Number of wavefronts is 4 for gfx900 and 16 otherwise; + 'num_threads' (OpenMP) and 'num_workers' (OpenACC) overrides this + if smaller. + * The wavefront has 102 scalars and 64 vectors + * Number of workitems is always 64 + * The hardware permits maximally 40 workgroups/CU and 16 + wavefronts/workgroup up to a limit of 40 wavefronts in total per + CU. + * 80 scalars registers and 24 vector registers in non-kernel + functions (the chosen procedure-calling API). + * For the kernel itself: as many as register pressure demands (number + of teams and number of threads, scaled down if registers are + exhausted) + + The implementation remark: + * I/O within OpenMP target regions and OpenACC compute regions is + supported using the C library 'printf' functions and the Fortran + 'print'/'write' statements. + * Reverse offload regions (i.e. 'target' regions with + 'device(ancestor:1)') are processed serially per 'target' region + such that the next reverse offload region is only executed after + the previous one returned. + * OpenMP code that has a 'requires' directive with 'self_maps' or + 'unified_shared_memory' is only supported if all AMD GPUs have the + 'HSA_AMD_SYSTEM_INFO_SVM_ACCESSIBLE_BY_DEFAULT' property; for + discrete GPUs, this may require setting the 'HSA_XNACK' environment + variable to '1'; for systems with both an APU and a discrete GPU + that does not support XNACK, consider using 'ROCR_VISIBLE_DEVICES' + to enable only the APU. If not supported, all AMD GPU devices are + removed from the list of available devices ("host fallback"). + * The available stack size can be changed using the 'GCN_STACK_SIZE' + environment variable; the default is 32 kiB per thread. + * Low-latency memory ('omp_low_lat_mem_space') is supported when the + the 'access' trait is set to 'cgroup'. The default pool size is + automatically scaled to share the 64 kiB LDS memory between the + number of teams configured to run on each compute-unit, but may be + adjusted at runtime by setting environment variable + 'GOMP_GCN_LOWLAT_POOL=BYTES'. + * 'omp_low_lat_mem_alloc' cannot be used with true low-latency memory + because the definition implies the 'omp_atv_all' trait; main + graphics memory is used instead. + * 'omp_cgroup_mem_alloc', 'omp_pteam_mem_alloc', and + 'omp_thread_mem_alloc', all use low-latency memory as first + preference, and fall back to main graphics memory when the + low-latency pool is exhausted. + * The OpenMP routines 'omp_target_memcpy_rect' and + 'omp_target_memcpy_rect_async' and the 'target update' directive + for non-contiguous list items use the 3D memory-copy function of + the HSA library. Higher dimensions call this functions in a loop + and are therefore supported. + * The unique identifier (UID), used with OpenMP's API UID routines, + is the value returned by the HSA runtime library for + 'HSA_AMD_AGENT_INFO_UUID'. For GPUs, it is currently 'GPU-' + followed by 16 lower-case hex digits, yielding a string like + 'GPU-f914a2142fc3413a'. The output matches the one used by + 'rocminfo'. + + +File: libgomp.info, Node: Foreign-runtime support for AMD GPUs, Up: AMD Radeon + +12.1.1 OpenMP 'interop' - Foreign-Runtime Support for AMD GPUs +-------------------------------------------------------------- + +On AMD GPUs, the foreign runtimes are HIP (C++ Heterogeneous-Compute +Interface for Portability) and HSA (Heterogeneous System Architecture), +where HIP is the default. The interop object is created using OpenMP's +'interop' directive or, implicitly, when invoking a 'declare variant' +procedure that has the 'append_args' clause. In either case, the +'prefer_type' modifier determines whether HIP or HSA is used. + + When specifying the 'targetsync' modifier: For HIP, a stream is +created using 'hipStreamCreate'. For HSA, a queue is created of type +'HSA_QUEUE_TYPE_MULTI' with a queue size of 64. + + Invoke the *note Interoperability Routines:: on an interop object to +obtain the following properties. For properties with integral (int), +pointer (ptr), or string (str) data type, call 'omp_get_interop_int', +'omp_get_interop_ptr', or 'omp_get_interop_str', respectively. Note +that 'device_num' is the OpenMP device number while 'device' is the HIP +device number or HSA device handle. + + When using HIP with C and C++, the '__HIP_PLATFORM_AMD__' +preprocessor macro must be defined before including the HIP header +files. + + For the API routine call, add the prefix 'omp_ipr_' to the property +name; for instance: + omp_interop_rc_t ret; + int device_num = omp_get_interop_int (my_interop_obj, omp_ipr_device_num, &ret); + +Available properties for an HIP interop object: + +Property C data type API routine value (if + constant) +----------------------------------------------------------------------- +'fr_id' 'omp_interop_fr_t' int 'omp_fr_hip' +'fr_name' 'const char *' str '"hip"' +'vendor' 'int' int '1' +'vendor_name' 'const char *' str '"amd"' +'device_num' 'int' int +'platform' N/A +'device' 'hipDevice_t' int +'device_context''hipCtx_t' ptr +'targetsync' 'hipStream_t' ptr + +Available properties for an HSA interop object: + +Property C data type API routine value (if + constant) +----------------------------------------------------------------------- +'fr_id' 'omp_interop_fr_t' int 'omp_fr_hsa' +'fr_name' 'const char *' str '"hsa"' +'vendor' 'int' int '1' +'vendor_name' 'const char *' str '"amd"' +'device_num' 'int' int +'platform' N/A +'device' 'hsa_agent *' ptr +'device_context'N/A +'targetsync' 'hsa_queue *' ptr + + +File: libgomp.info, Node: nvptx, Prev: AMD Radeon, Up: Offload-Target Specifics + +12.2 nvptx +========== + +* Menu: + +* Foreign-runtime support for Nvidia GPUs:: + +On the hardware side, there is the hierarchy (fine to coarse): + * thread + * warp + * thread block + * streaming multiprocessor + + All OpenMP and OpenACC levels are used, i.e. + * OpenMP's simd and OpenACC's vector map to threads + * OpenMP's threads ("parallel") and OpenACC's workers map to warps + * OpenMP's teams and OpenACC's gang use a threadpool with the size of + the number of teams or gangs, respectively. + + The used sizes are + * The 'warp_size' is always 32 + * CUDA kernel launched: 'dim={#teams,1,1}, + blocks={#threads,warp_size,1}'. + * The number of teams is limited by the number of blocks the device + can host simultaneously. + + Additional information can be obtained by setting the environment +variable to 'GOMP_DEBUG=1' (very verbose; grep for 'kernel.*launch' for +launch parameters). + + GCC generates generic PTX ISA code, which is just-in-time compiled by +CUDA, which caches the JIT in the user's directory (see CUDA +documentation; can be tuned by the environment variables +'CUDA_CACHE_{DISABLE,MAXSIZE,PATH}'. + + Note: While PTX ISA is generic, the '-mptx=' and '-march=' +commandline options still affect the used PTX ISA code and, thus, the +requirements on CUDA version and hardware. + + The implementation remark: + * I/O within OpenMP target regions and OpenACC compute regions is + supported using the C library 'printf' functions. Additionally, + the Fortran 'print'/'write' statements are supported within OpenMP + target regions, but not yet within OpenACC compute regions. + * Compilation OpenMP code that contains 'requires reverse_offload' + requires at least '-march=sm_35', compiling for '-march=sm_30' is + not supported. + * For code containing reverse offload (i.e. 'target' regions with + 'device(ancestor:1)'), there is a slight performance penalty for + _all_ target regions, consisting mostly of shutdown delay Per + device, reverse offload regions are processed serially such that + the next reverse offload region is only executed after the previous + one returned. + * OpenMP code that has a 'requires' directive with 'self_maps' or + 'unified_shared_memory' runs on nvptx devices if and only if all of + those support the 'pageableMemoryAccess' property;(1) otherwise, + all nvptx device are removed from the list of available devices + ("host fallback"). + * The default per-warp stack size is 128 kiB; see also '-msoft-stack' + in the GCC manual. + * Low-latency memory ('omp_low_lat_mem_space') is supported when the + the 'access' trait is set to 'cgroup', and libgomp has been built + for PTX ISA version 4.1 or higher (such as in GCC's default + configuration). The default pool size is 8 kiB per team, but may + be adjusted at runtime by setting environment variable + 'GOMP_NVPTX_LOWLAT_POOL=BYTES'. The maximum value is limited by + the available hardware, and care should be taken that the selected + pool size does not unduly limit the number of teams that can run + simultaneously. + * 'omp_low_lat_mem_alloc' cannot be used with true low-latency memory + because the definition implies the 'omp_atv_all' trait; main + graphics memory is used instead. + * 'omp_cgroup_mem_alloc', 'omp_pteam_mem_alloc', and + 'omp_thread_mem_alloc', all use low-latency memory as first + preference, and fall back to main graphics memory when the + low-latency pool is exhausted. + * The OpenMP routines 'omp_target_memcpy_rect' and + 'omp_target_memcpy_rect_async' and the 'target update' directive + for non-contiguous list items use the 2D and 3D memory-copy + functions of the CUDA library. Higher dimensions call those + functions in a loop and are therefore supported. + * The unique identifier (UID), used with OpenMP's API UID routines, + consists of the 'GPU-' prefix followed by the 16-bytes UUID as + returned by the CUDA runtime library. This UUID is output in + grouped lower-case hex digits; the grouping of those 32 digits is: + 8 digits, hyphen, 4 digits, hyphen, 4 digits, hyphen, 16 digits. + This leads to a string like + 'GPU-a8081c9e-f03e-18eb-1827-bf5ba95afa5d'. The output matches the + format used by 'nvidia-smi'. + + ---------- Footnotes ---------- + + (1) + + + +File: libgomp.info, Node: Foreign-runtime support for Nvidia GPUs, Up: nvptx + +12.2.1 OpenMP 'interop' - Foreign-Runtime Support for Nvidia GPUs +----------------------------------------------------------------- + +On Nvidia GPUs, the foreign runtimes APIs are the CUDA runtime API, the +CUDA driver API, and HIP, the C++ Heterogeneous-Compute Interface for +Portability that is--on CUDA-based systems--a very thin layer on top of +the CUDA API. By default, CUDA is used. The interop object is created +using OpenMP's 'interop' directive or, implicitly, when invoking a +'declare variant' procedure that has the 'append_args' clause. In +either case, the 'prefer_type' modifier determines whether CUDA, CUDA +driver, or HSA is used. + + When specifying the 'targetsync' modifier, a CUDA stream is created +using the 'CU_STREAM_DEFAULT' flag. + + Invoke the *note Interoperability Routines:: on an interop object to +obtain the following properties. For properties with integral (int), +pointer (ptr), or string (str) data type, call 'omp_get_interop_int', +'omp_get_interop_ptr', or 'omp_get_interop_str', respectively. Note +that 'device_num' is the OpenMP device number while 'device' is the +CUDA, CUDA Driver, or HIP device number. + + When using HIP with C and C++, the '__HIP_PLATFORM_NVIDIA__' +preprocessor macro must be defined before including the HIP header +files. + + For the API routine call, add the prefix 'omp_ipr_' to the property +name; for instance: + omp_interop_rc_t ret; + int device_num = omp_get_interop_int (my_interop_obj, omp_ipr_device_num, &ret); + +Available properties for a CUDA runtime API interop object: + +Property C data type API routine value (if + constant) +----------------------------------------------------------------------- +'fr_id' 'omp_interop_fr_t' int 'omp_fr_cuda' +'fr_name' 'const char *' str '"cuda"' +'vendor' 'int' int '11' +'vendor_name' 'const char *' str '"nvidia"' +'device_num' 'int' int +'platform' N/A +'device' 'int' int +'device_context'N/A +'targetsync' 'cudaStream_t' ptr + +Available properties for a CUDA driver API interop object: + +Property C data type API routine value (if + constant) +----------------------------------------------------------------------- +'fr_id' 'omp_interop_fr_t' int 'omp_fr_cuda_driver' +'fr_name' 'const char *' str '"cuda_driver"' +'vendor' 'int' int '11' +'vendor_name' 'const char *' str '"nvidia"' +'device_num' 'int' int +'platform' N/A +'device' 'CUdevice' int +'device_context''CUcontext' ptr +'targetsync' 'CUstream' ptr + +Available properties for an HIP interop object: + +Property C data type API routine value (if + constant) +----------------------------------------------------------------------- +'fr_id' 'omp_interop_fr_t' int 'omp_fr_hip' +'fr_name' 'const char *' str '"hip"' +'vendor' 'int' int '11' +'vendor_name' 'const char *' str '"nvidia"' +'device_num' 'int' int +'platform' N/A +'device' 'hipDevice_t' int +'device_context''hipCtx_t' ptr +'targetsync' 'hipStream_t' ptr + + +File: libgomp.info, Node: The libgomp ABI, Next: Reporting Bugs, Prev: Offload-Target Specifics, Up: Top + +13 The libgomp ABI +****************** + +The following sections present notes on the external ABI as presented by +libgomp. Only maintainers should need them. + +* Menu: + +* Implementing MASTER construct:: +* Implementing CRITICAL construct:: +* Implementing ATOMIC construct:: +* Implementing FLUSH construct:: +* Implementing BARRIER construct:: +* Implementing THREADPRIVATE construct:: +* Implementing PRIVATE clause:: +* Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses:: +* Implementing REDUCTION clause:: +* Implementing PARALLEL construct:: +* Implementing FOR construct:: +* Implementing ORDERED construct:: +* Implementing SECTIONS construct:: +* Implementing SINGLE construct:: +* Implementing OpenACC's PARALLEL construct:: + + +File: libgomp.info, Node: Implementing MASTER construct, Next: Implementing CRITICAL construct, Up: The libgomp ABI + +13.1 Implementing MASTER construct +================================== + + if (omp_get_thread_num () == 0) + block + + Alternately, we generate two copies of the parallel subfunction and +only include this in the version run by the primary thread. Surely this +is not worthwhile though... + + +File: libgomp.info, Node: Implementing CRITICAL construct, Next: Implementing ATOMIC construct, Prev: Implementing MASTER construct, Up: The libgomp ABI + +13.2 Implementing CRITICAL construct +==================================== + +Without a specified name, + + void GOMP_critical_start (void); + void GOMP_critical_end (void); + + so that we don't get COPY relocations from libgomp to the main +application. + + With a specified name, use omp_set_lock and omp_unset_lock with name +being transformed into a variable declared like + + omp_lock_t gomp_critical_user_ __attribute__((common)) + + Ideally the ABI would specify that all zero is a valid unlocked +state, and so we wouldn't need to initialize this at startup. + + +File: libgomp.info, Node: Implementing ATOMIC construct, Next: Implementing FLUSH construct, Prev: Implementing CRITICAL construct, Up: The libgomp ABI + +13.3 Implementing ATOMIC construct +================================== + +The target should implement the '__sync' builtins. + + Failing that we could add + + void GOMP_atomic_enter (void) + void GOMP_atomic_exit (void) + + which reuses the regular lock code, but with yet another lock object +private to the library. + + +File: libgomp.info, Node: Implementing FLUSH construct, Next: Implementing BARRIER construct, Prev: Implementing ATOMIC construct, Up: The libgomp ABI + +13.4 Implementing FLUSH construct +================================= + +Expands to the '__sync_synchronize' builtin. + + +File: libgomp.info, Node: Implementing BARRIER construct, Next: Implementing THREADPRIVATE construct, Prev: Implementing FLUSH construct, Up: The libgomp ABI + +13.5 Implementing BARRIER construct +=================================== + + void GOMP_barrier (void) + + +File: libgomp.info, Node: Implementing THREADPRIVATE construct, Next: Implementing PRIVATE clause, Prev: Implementing BARRIER construct, Up: The libgomp ABI + +13.6 Implementing THREADPRIVATE construct +========================================= + +In _most_ cases we can map this directly to '__thread'. Except that OMP +allows constructors for C++ objects. We can either refuse to support +this (how often is it used?) or we can implement something akin to +.ctors. + + Even more ideally, this ctor feature is handled by extensions to the +main pthreads library. Failing that, we can have a set of entry points +to register ctor functions to be called. + + +File: libgomp.info, Node: Implementing PRIVATE clause, Next: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses, Prev: Implementing THREADPRIVATE construct, Up: The libgomp ABI + +13.7 Implementing PRIVATE clause +================================ + +In association with a PARALLEL, or within the lexical extent of a +PARALLEL block, the variable becomes a local variable in the parallel +subfunction. + + In association with FOR or SECTIONS blocks, create a new automatic +variable within the current function. This preserves the semantic of +new variable creation. + + +File: libgomp.info, Node: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses, Next: Implementing REDUCTION clause, Prev: Implementing PRIVATE clause, Up: The libgomp ABI + +13.8 Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses +========================================================================= + +This seems simple enough for PARALLEL blocks. Create a private struct +for communicating between the parent and subfunction. In the parent, +copy in values for scalar and "small" structs; copy in addresses for +others TREE_ADDRESSABLE types. In the subfunction, copy the value into +the local variable. + + It is not clear what to do with bare FOR or SECTION blocks. The only +thing I can figure is that we do something like: + + #pragma omp for firstprivate(x) lastprivate(y) + for (int i = 0; i < n; ++i) + body; + + which becomes + + { + int x = x, y; + + // for stuff + + if (i == n) + y = y; + } + + where the "x=x" and "y=y" assignments actually have different uids +for the two variables, i.e. not something you could write directly in +C. Presumably this only makes sense if the "outer" x and y are global +variables. + + COPYPRIVATE would work the same way, except the structure broadcast +would have to happen via SINGLE machinery instead. + + +File: libgomp.info, Node: Implementing REDUCTION clause, Next: Implementing PARALLEL construct, Prev: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses, Up: The libgomp ABI + +13.9 Implementing REDUCTION clause +================================== + +The private struct mentioned in the previous section should have a +pointer to an array of the type of the variable, indexed by the thread's +TEAM_ID. The thread stores its final value into the array, and after +the barrier, the primary thread iterates over the array to collect the +values. + + +File: libgomp.info, Node: Implementing PARALLEL construct, Next: Implementing FOR construct, Prev: Implementing REDUCTION clause, Up: The libgomp ABI + +13.10 Implementing PARALLEL construct +===================================== + + #pragma omp parallel + { + body; + } + + becomes + + void subfunction (void *data) + { + use data; + body; + } + + setup data; + GOMP_parallel_start (subfunction, &data, num_threads); + subfunction (&data); + GOMP_parallel_end (); + + void GOMP_parallel_start (void (*fn)(void *), void *data, unsigned num_threads) + + The FN argument is the subfunction to be run in parallel. + + The DATA argument is a pointer to a structure used to communicate +data in and out of the subfunction, as discussed above with respect to +FIRSTPRIVATE et al. + + The NUM_THREADS argument is 1 if an IF clause is present and false, +or the value of the NUM_THREADS clause, if present, or 0. + + The function needs to create the appropriate number of threads and/or +launch them from the dock. It needs to create the team structure and +assign team ids. + + void GOMP_parallel_end (void) + + Tears down the team and returns us to the previous +'omp_in_parallel()' state. + + +File: libgomp.info, Node: Implementing FOR construct, Next: Implementing ORDERED construct, Prev: Implementing PARALLEL construct, Up: The libgomp ABI + +13.11 Implementing FOR construct +================================ + + #pragma omp parallel for + for (i = lb; i <= ub; i++) + body; + + becomes + + void subfunction (void *data) + { + long _s0, _e0; + while (GOMP_loop_static_next (&_s0, &_e0)) + { + long _e1 = _e0, i; + for (i = _s0; i < _e1; i++) + body; + } + GOMP_loop_end_nowait (); + } + + GOMP_parallel_loop_static (subfunction, NULL, 0, lb, ub+1, 1, 0); + subfunction (NULL); + GOMP_parallel_end (); + + #pragma omp for schedule(runtime) + for (i = 0; i < n; i++) + body; + + becomes + + { + long i, _s0, _e0; + if (GOMP_loop_runtime_start (0, n, 1, &_s0, &_e0)) + do { + long _e1 = _e0; + for (i = _s0, i < _e0; i++) + body; + } while (GOMP_loop_runtime_next (&_s0, _&e0)); + GOMP_loop_end (); + } + + Note that while it looks like there is trickiness to propagating a +non-constant STEP, there isn't really. We're explicitly allowed to +evaluate it as many times as we want, and any variables involved should +automatically be handled as PRIVATE or SHARED like any other variables. +So the expression should remain evaluable in the subfunction. We can +also pull it into a local variable if we like, but since its supposed to +remain unchanged, we can also not if we like. + + If we have SCHEDULE(STATIC), and no ORDERED, then we ought to be able +to get away with no work-sharing context at all, since we can simply +perform the arithmetic directly in each thread to divide up the +iterations. Which would mean that we wouldn't need to call any of these +routines. + + There are separate routines for handling loops with an ORDERED +clause. Bookkeeping for that is non-trivial... + + +File: libgomp.info, Node: Implementing ORDERED construct, Next: Implementing SECTIONS construct, Prev: Implementing FOR construct, Up: The libgomp ABI + +13.12 Implementing ORDERED construct +==================================== + + void GOMP_ordered_start (void) + void GOMP_ordered_end (void) + + +File: libgomp.info, Node: Implementing SECTIONS construct, Next: Implementing SINGLE construct, Prev: Implementing ORDERED construct, Up: The libgomp ABI + +13.13 Implementing SECTIONS construct +===================================== + +A block as + + #pragma omp sections + { + #pragma omp section + stmt1; + #pragma omp section + stmt2; + #pragma omp section + stmt3; + } + + becomes + + for (i = GOMP_sections_start (3); i != 0; i = GOMP_sections_next ()) + switch (i) + { + case 1: + stmt1; + break; + case 2: + stmt2; + break; + case 3: + stmt3; + break; + } + GOMP_barrier (); + + +File: libgomp.info, Node: Implementing SINGLE construct, Next: Implementing OpenACC's PARALLEL construct, Prev: Implementing SECTIONS construct, Up: The libgomp ABI + +13.14 Implementing SINGLE construct +=================================== + +A block like + + #pragma omp single + { + body; + } + + becomes + + if (GOMP_single_start ()) + body; + GOMP_barrier (); + + while + + #pragma omp single copyprivate(x) + body; + + becomes + + datap = GOMP_single_copy_start (); + if (datap == NULL) + { + body; + data.x = x; + GOMP_single_copy_end (&data); + } + else + x = datap->x; + GOMP_barrier (); + + +File: libgomp.info, Node: Implementing OpenACC's PARALLEL construct, Prev: Implementing SINGLE construct, Up: The libgomp ABI + +13.15 Implementing OpenACC's PARALLEL construct +=============================================== + + void GOACC_parallel () + + +File: libgomp.info, Node: Reporting Bugs, Next: Copying, Prev: The libgomp ABI, Up: Top + +14 Reporting Bugs +***************** + +Bugs in the GNU Offloading and Multi Processing Runtime Library should +be reported via Bugzilla (https://gcc.gnu.org/bugzilla/). Please add +"openacc", or "openmp", or both to the keywords field in the bug report, +as appropriate. + + +File: libgomp.info, Node: Copying, Next: GNU Free Documentation License, Prev: Reporting Bugs, Up: Top + +GNU General Public License +************************** + + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + + Everyone is permitted to copy and distribute verbatim copies of this + license document, but changing it is not allowed. + +Preamble +======== + +The GNU General Public License is a free, copyleft license for software +and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program-to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + +TERMS AND CONDITIONS +==================== + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public + License. + + "Copyright" also means copyright-like laws that apply to other + kinds of works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this + License. Each licensee is addressed as "you". "Licensees" and + "recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the + work in a fashion requiring copyright permission, other than the + making of an exact copy. The resulting work is called a "modified + version" of the earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work + based on the Program. + + To "propagate" a work means to do anything with it that, without + permission, would make you directly or secondarily liable for + infringement under applicable copyright law, except executing it on + a computer or modifying a private copy. Propagation includes + copying, distribution (with or without modification), making + available to the public, and in some countries other activities as + well. + + To "convey" a work means any kind of propagation that enables other + parties to make or receive copies. Mere interaction with a user + through a computer network, with no transfer of a copy, is not + conveying. + + An interactive user interface displays "Appropriate Legal Notices" + to the extent that it includes a convenient and prominently visible + feature that (1) displays an appropriate copyright notice, and (2) + tells the user that there is no warranty for the work (except to + the extent that warranties are provided), that licensees may convey + the work under this License, and how to view a copy of this + License. If the interface presents a list of user commands or + options, such as a menu, a prominent item in the list meets this + criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work + for making modifications to it. "Object code" means any non-source + form of a work. + + A "Standard Interface" means an interface that either is an + official standard defined by a recognized standards body, or, in + the case of interfaces specified for a particular programming + language, one that is widely used among developers working in that + language. + + The "System Libraries" of an executable work include anything, + other than the work as a whole, that (a) is included in the normal + form of packaging a Major Component, but which is not part of that + Major Component, and (b) serves only to enable use of the work with + that Major Component, or to implement a Standard Interface for + which an implementation is available to the public in source code + form. A "Major Component", in this context, means a major + essential component (kernel, window system, and so on) of the + specific operating system (if any) on which the executable work + runs, or a compiler used to produce the work, or an object code + interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all + the source code needed to generate, install, and (for an executable + work) run the object code and to modify the work, including scripts + to control those activities. However, it does not include the + work's System Libraries, or general-purpose tools or generally + available free programs which are used unmodified in performing + those activities but which are not part of the work. For example, + Corresponding Source includes interface definition files associated + with source files for the work, and the source code for shared + libraries and dynamically linked subprograms that the work is + specifically designed to require, such as by intimate data + communication or control flow between those subprograms and other + parts of the work. + + The Corresponding Source need not include anything that users can + regenerate automatically from other parts of the Corresponding + Source. + + The Corresponding Source for a work in source code form is that + same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of + copyright on the Program, and are irrevocable provided the stated + conditions are met. This License explicitly affirms your unlimited + permission to run the unmodified Program. The output from running + a covered work is covered by this License only if the output, given + its content, constitutes a covered work. This License acknowledges + your rights of fair use or other equivalent, as provided by + copyright law. + + You may make, run and propagate covered works that you do not + convey, without conditions so long as your license otherwise + remains in force. You may convey covered works to others for the + sole purpose of having them make modifications exclusively for you, + or provide you with facilities for running those works, provided + that you comply with the terms of this License in conveying all + material for which you do not control copyright. Those thus making + or running the covered works for you must do so exclusively on your + behalf, under your direction and control, on terms that prohibit + them from making any copies of your copyrighted material outside + their relationship with you. + + Conveying under any other circumstances is permitted solely under + the conditions stated below. Sublicensing is not allowed; section + 10 makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological + measure under any applicable law fulfilling obligations under + article 11 of the WIPO copyright treaty adopted on 20 December + 1996, or similar laws prohibiting or restricting circumvention of + such measures. + + When you convey a covered work, you waive any legal power to forbid + circumvention of technological measures to the extent such + circumvention is effected by exercising rights under this License + with respect to the covered work, and you disclaim any intention to + limit operation or modification of the work as a means of + enforcing, against the work's users, your or third parties' legal + rights to forbid circumvention of technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you + receive it, in any medium, provided that you conspicuously and + appropriately publish on each copy an appropriate copyright notice; + keep intact all notices stating that this License and any + non-permissive terms added in accord with section 7 apply to the + code; keep intact all notices of the absence of any warranty; and + give all recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, + and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to + produce it from the Program, in the form of source code under the + terms of section 4, provided that you also meet all of these + conditions: + + a. The work must carry prominent notices stating that you + modified it, and giving a relevant date. + + b. The work must carry prominent notices stating that it is + released under this License and any conditions added under + section 7. This requirement modifies the requirement in + section 4 to "keep intact all notices". + + c. You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable + section 7 additional terms, to the whole of the work, and all + its parts, regardless of how they are packaged. This License + gives no permission to license the work in any other way, but + it does not invalidate such permission if you have separately + received it. + + d. If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has + interactive interfaces that do not display Appropriate Legal + Notices, your work need not make them do so. + + A compilation of a covered work with other separate and independent + works, which are not by their nature extensions of the covered + work, and which are not combined with it such as to form a larger + program, in or on a volume of a storage or distribution medium, is + called an "aggregate" if the compilation and its resulting + copyright are not used to limit the access or legal rights of the + compilation's users beyond what the individual works permit. + Inclusion of a covered work in an aggregate does not cause this + License to apply to the other parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms + of sections 4 and 5, provided that you also convey the + machine-readable Corresponding Source under the terms of this + License, in one of these ways: + + a. Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b. Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that + product model, to give anyone who possesses the object code + either (1) a copy of the Corresponding Source for all the + software in the product that is covered by this License, on a + durable physical medium customarily used for software + interchange, for a price no more than your reasonable cost of + physically performing this conveying of source, or (2) access + to copy the Corresponding Source from a network server at no + charge. + + c. Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, + and only if you received the object code with such an offer, + in accord with subsection 6b. + + d. Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to + the Corresponding Source in the same way through the same + place at no further charge. You need not require recipients + to copy the Corresponding Source along with the object code. + If the place to copy the object code is a network server, the + Corresponding Source may be on a different server (operated by + you or a third party) that supports equivalent copying + facilities, provided you maintain clear directions next to the + object code saying where to find the Corresponding Source. + Regardless of what server hosts the Corresponding Source, you + remain obligated to ensure that it is available for as long as + needed to satisfy these requirements. + + e. Convey the object code using peer-to-peer transmission, + provided you inform other peers where the object code and + Corresponding Source of the work are being offered to the + general public at no charge under subsection 6d. + + A separable portion of the object code, whose source code is + excluded from the Corresponding Source as a System Library, need + not be included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means + any tangible personal property which is normally used for personal, + family, or household purposes, or (2) anything designed or sold for + incorporation into a dwelling. In determining whether a product is + a consumer product, doubtful cases shall be resolved in favor of + coverage. For a particular product received by a particular user, + "normally used" refers to a typical or common use of that class of + product, regardless of the status of the particular user or of the + way in which the particular user actually uses, or expects or is + expected to use, the product. A product is a consumer product + regardless of whether the product has substantial commercial, + industrial or non-consumer uses, unless such uses represent the + only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, + procedures, authorization keys, or other information required to + install and execute modified versions of a covered work in that + User Product from a modified version of its Corresponding Source. + The information must suffice to ensure that the continued + functioning of the modified object code is in no case prevented or + interfered with solely because modification has been made. + + If you convey an object code work under this section in, or with, + or specifically for use in, a User Product, and the conveying + occurs as part of a transaction in which the right of possession + and use of the User Product is transferred to the recipient in + perpetuity or for a fixed term (regardless of how the transaction + is characterized), the Corresponding Source conveyed under this + section must be accompanied by the Installation Information. But + this requirement does not apply if neither you nor any third party + retains the ability to install modified object code on the User + Product (for example, the work has been installed in ROM). + + The requirement to provide Installation Information does not + include a requirement to continue to provide support service, + warranty, or updates for a work that has been modified or installed + by the recipient, or for the User Product in which it has been + modified or installed. Access to a network may be denied when the + modification itself materially and adversely affects the operation + of the network or violates the rules and protocols for + communication across the network. + + Corresponding Source conveyed, and Installation Information + provided, in accord with this section must be in a format that is + publicly documented (and with an implementation available to the + public in source code form), and must require no special password + or key for unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of + this License by making exceptions from one or more of its + conditions. Additional permissions that are applicable to the + entire Program shall be treated as though they were included in + this License, to the extent that they are valid under applicable + law. If additional permissions apply only to part of the Program, + that part may be used separately under those permissions, but the + entire Program remains governed by this License without regard to + the additional permissions. + + When you convey a copy of a covered work, you may at your option + remove any additional permissions from that copy, or from any part + of it. (Additional permissions may be written to require their own + removal in certain cases when you modify the work.) You may place + additional permissions on material, added by you to a covered work, + for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material + you add to a covered work, you may (if authorized by the copyright + holders of that material) supplement the terms of this License with + terms: + + a. Disclaiming warranty or limiting liability differently from + the terms of sections 15 and 16 of this License; or + + b. Requiring preservation of specified reasonable legal notices + or author attributions in that material or in the Appropriate + Legal Notices displayed by works containing it; or + + c. Prohibiting misrepresentation of the origin of that material, + or requiring that modified versions of such material be marked + in reasonable ways as different from the original version; or + + d. Limiting the use for publicity purposes of names of licensors + or authors of the material; or + + e. Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f. Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified + versions of it) with contractual assumptions of liability to + the recipient, for any liability that these contractual + assumptions directly impose on those licensors and authors. + + All other non-permissive additional terms are considered "further + restrictions" within the meaning of section 10. If the Program as + you received it, or any part of it, contains a notice stating that + it is governed by this License along with a term that is a further + restriction, you may remove that term. If a license document + contains a further restriction but permits relicensing or conveying + under this License, you may add to a covered work material governed + by the terms of that license document, provided that the further + restriction does not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you + must place, in the relevant source files, a statement of the + additional terms that apply to those files, or a notice indicating + where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in + the form of a separately written license, or stated as exceptions; + the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly + provided under this License. Any attempt otherwise to propagate or + modify it is void, and will automatically terminate your rights + under this License (including any patent licenses granted under the + third paragraph of section 11). + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly and + finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from + that copyright holder, and you cure the violation prior to 30 days + after your receipt of the notice. + + Termination of your rights under this section does not terminate + the licenses of parties who have received copies or rights from you + under this License. If your rights have been terminated and not + permanently reinstated, you do not qualify to receive new licenses + for the same material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or + run a copy of the Program. Ancillary propagation of a covered work + occurring solely as a consequence of using peer-to-peer + transmission to receive a copy likewise does not require + acceptance. However, nothing other than this License grants you + permission to propagate or modify any covered work. These actions + infringe copyright if you do not accept this License. Therefore, + by modifying or propagating a covered work, you indicate your + acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically + receives a license from the original licensors, to run, modify and + propagate that work, subject to this License. You are not + responsible for enforcing compliance by third parties with this + License. + + An "entity transaction" is a transaction transferring control of an + organization, or substantially all assets of one, or subdividing an + organization, or merging organizations. If propagation of a + covered work results from an entity transaction, each party to that + transaction who receives a copy of the work also receives whatever + licenses to the work the party's predecessor in interest had or + could give under the previous paragraph, plus a right to possession + of the Corresponding Source of the work from the predecessor in + interest, if the predecessor has it or can get it with reasonable + efforts. + + You may not impose any further restrictions on the exercise of the + rights granted or affirmed under this License. For example, you + may not impose a license fee, royalty, or other charge for exercise + of rights granted under this License, and you may not initiate + litigation (including a cross-claim or counterclaim in a lawsuit) + alleging that any patent claim is infringed by making, using, + selling, offering for sale, or importing the Program or any portion + of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this + License of the Program or a work on which the Program is based. + The work thus licensed is called the contributor's "contributor + version". + + A contributor's "essential patent claims" are all patent claims + owned or controlled by the contributor, whether already acquired or + hereafter acquired, that would be infringed by some manner, + permitted by this License, of making, using, or selling its + contributor version, but do not include claims that would be + infringed only as a consequence of further modification of the + contributor version. For purposes of this definition, "control" + includes the right to grant patent sublicenses in a manner + consistent with the requirements of this License. + + Each contributor grants you a non-exclusive, worldwide, + royalty-free patent license under the contributor's essential + patent claims, to make, use, sell, offer for sale, import and + otherwise run, modify and propagate the contents of its contributor + version. + + In the following three paragraphs, a "patent license" is any + express agreement or commitment, however denominated, not to + enforce a patent (such as an express permission to practice a + patent or covenant not to sue for patent infringement). To "grant" + such a patent license to a party means to make such an agreement or + commitment not to enforce a patent against the party. + + If you convey a covered work, knowingly relying on a patent + license, and the Corresponding Source of the work is not available + for anyone to copy, free of charge and under the terms of this + License, through a publicly available network server or other + readily accessible means, then you must either (1) cause the + Corresponding Source to be so available, or (2) arrange to deprive + yourself of the benefit of the patent license for this particular + work, or (3) arrange, in a manner consistent with the requirements + of this License, to extend the patent license to downstream + recipients. "Knowingly relying" means you have actual knowledge + that, but for the patent license, your conveying the covered work + in a country, or your recipient's use of the covered work in a + country, would infringe one or more identifiable patents in that + country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or + arrangement, you convey, or propagate by procuring conveyance of, a + covered work, and grant a patent license to some of the parties + receiving the covered work authorizing them to use, propagate, + modify or convey a specific copy of the covered work, then the + patent license you grant is automatically extended to all + recipients of the covered work and works based on it. + + A patent license is "discriminatory" if it does not include within + the scope of its coverage, prohibits the exercise of, or is + conditioned on the non-exercise of one or more of the rights that + are specifically granted under this License. You may not convey a + covered work if you are a party to an arrangement with a third + party that is in the business of distributing software, under which + you make payment to the third party based on the extent of your + activity of conveying the work, and under which the third party + grants, to any of the parties who would receive the covered work + from you, a discriminatory patent license (a) in connection with + copies of the covered work conveyed by you (or copies made from + those copies), or (b) primarily for and in connection with specific + products or compilations that contain the covered work, unless you + entered into that arrangement, or that patent license was granted, + prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting + any implied license or other defenses to infringement that may + otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement + or otherwise) that contradict the conditions of this License, they + do not excuse you from the conditions of this License. If you + cannot convey a covered work so as to satisfy simultaneously your + obligations under this License and any other pertinent obligations, + then as a consequence you may not convey it at all. For example, + if you agree to terms that obligate you to collect a royalty for + further conveying from those to whom you convey the Program, the + only way you could satisfy both those terms and this License would + be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have + permission to link or combine any covered work with a work licensed + under version 3 of the GNU Affero General Public License into a + single combined work, and to convey the resulting work. The terms + of this License will continue to apply to the part which is the + covered work, but the special requirements of the GNU Affero + General Public License, section 13, concerning interaction through + a network will apply to the combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new + versions of the GNU General Public License from time to time. Such + new versions will be similar in spirit to the present version, but + may differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the + Program specifies that a certain numbered version of the GNU + General Public License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that numbered version or of any later version published by the Free + Software Foundation. If the Program does not specify a version + number of the GNU General Public License, you may choose any + version ever published by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future + versions of the GNU General Public License can be used, that + proxy's public statement of acceptance of a version permanently + authorizes you to choose that version for the Program. + + Later license versions may give you additional or different + permissions. However, no additional obligations are imposed on any + author or copyright holder as a result of your choosing to follow a + later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY + APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE + COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE + RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. + SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL + NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN + WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES + AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR + DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR + CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE + THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA + BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD + PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF + THE POSSIBILITY OF SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided + above cannot be given local legal effect according to their terms, + reviewing courts shall apply local law that most closely + approximates an absolute waiver of all civil liability in + connection with the Program, unless a warranty or assumption of + liability accompanies a copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS +=========================== + +How to Apply These Terms to Your New Programs +============================================= + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. + Copyright (C) YEAR NAME OF AUTHOR + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or (at + your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + Also add information on how to contact you by electronic and paper +mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + PROGRAM Copyright (C) YEAR NAME OF AUTHOR + This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type 'show c' for details. + + The hypothetical commands 'show w' and 'show c' should show the +appropriate parts of the General Public License. Of course, your +program's commands might be different; for a GUI interface, you would +use an "about box". + + You should also get your employer (if you work as a programmer) or +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. For more information on this, and how to apply and follow +the GNU GPL, see . + + The GNU General Public License does not permit incorporating your +program into proprietary programs. If your program is a subroutine +library, you may consider it more useful to permit linking proprietary +applications with the library. If this is what you want to do, use the +GNU Lesser General Public License instead of this License. But first, +please read . + + +File: libgomp.info, Node: GNU Free Documentation License, Next: Funding, Prev: Copying, Up: Top + +GNU Free Documentation License +****************************** + + Version 1.3, 3 November 2008 + + Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + functional and useful document "free" in the sense of freedom: to + assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or + noncommercially. Secondarily, this License preserves for the + author and publisher a way to get credit for their work, while not + being considered responsible for modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. We + recommend this License principally for works whose purpose is + instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work, in any medium, + that contains a notice placed by the copyright holder saying it can + be distributed under the terms of this License. Such a notice + grants a world-wide, royalty-free license, unlimited in duration, + to use that work under the conditions stated herein. The + "Document", below, refers to any such manual or work. Any member + of the public is a licensee, and is addressed as "you". You accept + the license if you copy, modify or distribute the work in a way + requiring permission under copyright law. + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter section + of the Document that deals exclusively with the relationship of the + publishers or authors of the Document to the Document's overall + subject (or to related matters) and contains nothing that could + fall directly within that overall subject. (Thus, if the Document + is in part a textbook of mathematics, a Secondary Section may not + explain any mathematics.) The relationship could be a matter of + historical connection with the subject or with related matters, or + of legal, commercial, philosophical, ethical or political position + regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in the + notice that says that the Document is released under this License. + If a section does not fit the above definition of Secondary then it + is not allowed to be designated as Invariant. The Document may + contain zero Invariant Sections. If the Document does not identify + any Invariant Sections then there are none. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. A + Front-Cover Text may be at most 5 words, and a Back-Cover Text may + be at most 25 words. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, that is suitable for revising the document + straightforwardly with generic text editors or (for images composed + of pixels) generic paint programs or (for drawings) some widely + available drawing editor, and that is suitable for input to text + formatters or for automatic translation to a variety of formats + suitable for input to text formatters. A copy made in an otherwise + Transparent file format whose markup, or absence of markup, has + been arranged to thwart or discourage subsequent modification by + readers is not Transparent. An image format is not Transparent if + used for any substantial amount of text. A copy that is not + "Transparent" is called "Opaque". + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and standard-conforming + simple HTML, PostScript or PDF designed for human modification. + Examples of transparent image formats include PNG, XCF and JPG. + Opaque formats include proprietary formats that can be read and + edited only by proprietary word processors, SGML or XML for which + the DTD and/or processing tools are not generally available, and + the machine-generated HTML, PostScript or PDF produced by some word + processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + The "publisher" means any person or entity that distributes copies + of the Document to the public. + + A section "Entitled XYZ" means a named subunit of the Document + whose title either is precisely XYZ or contains XYZ in parentheses + following text that translates XYZ in another language. (Here XYZ + stands for a specific section name mentioned below, such as + "Acknowledgements", "Dedications", "Endorsements", or "History".) + To "Preserve the Title" of such a section when you modify the + Document means that it remains a section "Entitled XYZ" according + to this definition. + + The Document may include Warranty Disclaimers next to the notice + which states that this License applies to the Document. These + Warranty Disclaimers are considered to be included by reference in + this License, but only as regards disclaiming warranties: any other + implication that these Warranty Disclaimers may have is void and + has no effect on the meaning of this License. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow the + conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies (or copies in media that commonly + have printed covers) of the Document, numbering more than 100, and + the Document's license notice requires Cover Texts, you must + enclose the copies in covers that carry, clearly and legibly, all + these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the title + equally prominent and visible. You may add other material on the + covers in addition. Copying with changes limited to the covers, as + long as they preserve the title of the Document and satisfy these + conditions, can be treated as verbatim copying in other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a machine-readable + Transparent copy along with each Opaque copy, or state in or with + each Opaque copy a computer-network location from which the general + network-using public has access to download using public-standard + network protocols a complete Transparent copy of the Document, free + of added material. If you use the latter option, you must take + reasonably prudent steps, when you begin distribution of Opaque + copies in quantity, to ensure that this Transparent copy will + remain thus accessible at the stated location until at least one + year after the last time you distribute an Opaque copy (directly or + through your agents or retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of copies, + to give them a chance to provide you with an updated version of the + Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with the + Modified Version filling the role of the Document, thus licensing + distribution and modification of the Modified Version to whoever + possesses a copy of it. In addition, you must do these things in + the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of previous + versions (which should, if there were any, be listed in the + History section of the Document). You may use the same title + as a previous version if the original publisher of that + version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has fewer than five), unless they release you + from this requirement. + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section Entitled "History", Preserve its Title, + and add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on the + Title Page. If there is no section Entitled "History" in the + Document, create one stating the title, year, authors, and + publisher of the Document as given on its Title Page, then add + an item describing the Modified Version as stated in the + previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in the + "History" section. You may omit a network location for a work + that was published at least four years before the Document + itself, or if the original publisher of the version it refers + to gives permission. + + K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section + all the substance and tone of each of the contributor + acknowledgements and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, unaltered + in their text and in their titles. Section numbers or the + equivalent are not considered part of the section titles. + + M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section to be Entitled + "Endorsements" or to conflict in title with any Invariant + Section. + + O. Preserve any Warranty Disclaimers. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option designate + some or all of these sections as invariant. To do this, add their + titles to the list of Invariant Sections in the Modified Version's + license notice. These titles must be distinct from any other + section titles. + + You may add a section Entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties--for example, statements of peer review or that the text + has been approved by an organization as the authoritative + definition of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end of + the list of Cover Texts in the Modified Version. Only one passage + of Front-Cover Text and one of Back-Cover Text may be added by (or + through arrangements made by) any one entity. If the Document + already includes a cover text for the same cover, previously added + by you or by arrangement made by the same entity you are acting on + behalf of, you may not add another; but you may replace the old + one, on explicit permission from the previous publisher that added + the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination all + of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice, and that you preserve all + their Warranty Disclaimers. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections Entitled + "History" in the various original documents, forming one section + Entitled "History"; likewise combine any sections Entitled + "Acknowledgements", and any sections Entitled "Dedications". You + must delete all sections Entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the documents + in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow this + License in all other respects regarding verbatim copying of that + document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of a + storage or distribution medium, is called an "aggregate" if the + copyright resulting from the compilation is not used to limit the + legal rights of the compilation's users beyond what the individual + works permit. When the Document is included in an aggregate, this + License does not apply to the other works in the aggregate which + are not themselves derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one half + of the entire aggregate, the Document's Cover Texts may be placed + on covers that bracket the Document within the aggregate, or the + electronic equivalent of covers if the Document is in electronic + form. Otherwise they must appear on printed covers that bracket + the whole aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License, and all the license notices in the + Document, and any Warranty Disclaimers, provided that you also + include the original English version of this License and the + original versions of those notices and disclaimers. In case of a + disagreement between the translation and the original version of + this License or a notice or disclaimer, the original version will + prevail. + + If a section in the Document is Entitled "Acknowledgements", + "Dedications", or "History", the requirement (section 4) to + Preserve its Title (section 1) will typically require changing the + actual title. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense, or distribute it is void, + and will automatically terminate your rights under this License. + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly and + finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from + that copyright holder, and you cure the violation prior to 30 days + after your receipt of the notice. + + Termination of your rights under this section does not terminate + the licenses of parties who have received copies or rights from you + under this License. If your rights have been terminated and not + permanently reinstated, receipt of a copy of some or all of the + same material does not give you any rights to use it. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + . + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If the + Document does not specify a version number of this License, you may + choose any version ever published (not as a draft) by the Free + Software Foundation. If the Document specifies that a proxy can + decide which future versions of this License can be used, that + proxy's public statement of acceptance of a version permanently + authorizes you to choose that version for the Document. + + 11. RELICENSING + + "Massive Multiauthor Collaboration Site" (or "MMC Site") means any + World Wide Web server that publishes copyrightable works and also + provides prominent facilities for anybody to edit those works. A + public wiki that anybody can edit is an example of such a server. + A "Massive Multiauthor Collaboration" (or "MMC") contained in the + site means any set of copyrightable works thus published on the MMC + site. + + "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 + license published by Creative Commons Corporation, a not-for-profit + corporation with a principal place of business in San Francisco, + California, as well as future copyleft versions of that license + published by that same organization. + + "Incorporate" means to publish or republish a Document, in whole or + in part, as part of another Document. + + An MMC is "eligible for relicensing" if it is licensed under this + License, and if all works that were first published under this + License somewhere other than this MMC, and subsequently + incorporated in whole or in part into the MMC, (1) had no cover + texts or invariant sections, and (2) were thus incorporated prior + to November 1, 2008. + + The operator of an MMC Site may republish an MMC contained in the + site under CC-BY-SA on the same site at any time before August 1, + 2009, provided the MMC is eligible for relicensing. + +ADDENDUM: How to use this License for your documents +==================================================== + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + + If you have Invariant Sections, Front-Cover Texts and Back-Cover +Texts, replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with + the Front-Cover Texts being LIST, and with the Back-Cover Texts + being LIST. + + If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of free +software license, such as the GNU General Public License, to permit +their use in free software. + + +File: libgomp.info, Node: Funding, Next: Library Index, Prev: GNU Free Documentation License, Up: Top + +Funding Free Software +********************* + +If you want to have more free software a few years from now, it makes +sense for you to help encourage people to contribute funds for its +development. The most effective approach known is to encourage +commercial redistributors to donate. + + Users of free software systems can boost the pace of development by +encouraging for-a-fee distributors to donate part of their selling price +to free software developers--the Free Software Foundation, and others. + + The way to convince distributors to do this is to demand it and +expect it from them. So when you compare distributors, judge them +partly by how much they give to free software development. Show +distributors they must compete to be the one who gives the most. + + To make this approach work, you must insist on numbers that you can +compare, such as, "We will donate ten dollars to the Frobnitz project +for each disk sold." Don't be satisfied with a vague promise, such as +"A portion of the profits are donated," since it doesn't give a basis +for comparison. + + Even a precise fraction "of the profits from this disk" is not very +meaningful, since creative accounting and unrelated business decisions +can greatly alter what fraction of the sales price counts as profit. If +the price you pay is $50, ten percent of the profit is probably less +than a dollar; it might be a few cents, or nothing at all. + + Some redistributors do development work themselves. This is useful +too; but to keep everyone honest, you need to inquire how much they do, +and what kind. Some kinds of development make much more long-term +difference than others. For example, maintaining a separate version of +a program contributes very little; maintaining the standard version of a +program for the whole community contributes much. Easy new ports +contribute little, since someone else would surely do them; difficult +ports such as adding a new CPU to the GNU Compiler Collection contribute +more; major new features or packages contribute the most. + + By establishing the idea that supporting further development is "the +proper thing to do" when distributing free software for a fee, we can +assure a steady flow of resources into making more free software. + + Copyright (C) 1994 Free Software Foundation, Inc. + Verbatim copying and redistribution of this section is permitted + without royalty; alteration is not permitted. + + +File: libgomp.info, Node: Library Index, Prev: Funding, Up: Top + +Library Index +************* + +[index] +* Menu: + +* acc_get_property: acc_get_property. (line 6) +* acc_get_property_string: acc_get_property. (line 6) +* Environment Variable: OMP_ALLOCATOR. (line 6) +* Environment Variable <1>: OMP_AFFINITY_FORMAT. (line 6) +* Environment Variable <2>: OMP_CANCELLATION. (line 6) +* Environment Variable <3>: OMP_DISPLAY_AFFINITY. (line 6) +* Environment Variable <4>: OMP_DISPLAY_ENV. (line 6) +* Environment Variable <5>: OMP_DEFAULT_DEVICE. (line 6) +* Environment Variable <6>: OMP_DYNAMIC. (line 6) +* Environment Variable <7>: OMP_MAX_ACTIVE_LEVELS. (line 6) +* Environment Variable <8>: OMP_MAX_TASK_PRIORITY. (line 6) +* Environment Variable <9>: OMP_NESTED. (line 6) +* Environment Variable <10>: OMP_NUM_TEAMS. (line 6) +* Environment Variable <11>: OMP_NUM_THREADS. (line 6) +* Environment Variable <12>: OMP_PROC_BIND. (line 6) +* Environment Variable <13>: OMP_PLACES. (line 6) +* Environment Variable <14>: OMP_STACKSIZE. (line 6) +* Environment Variable <15>: OMP_SCHEDULE. (line 6) +* Environment Variable <16>: OMP_TARGET_OFFLOAD. (line 6) +* Environment Variable <17>: OMP_TEAMS_THREAD_LIMIT. + (line 6) +* Environment Variable <18>: OMP_THREAD_LIMIT. (line 6) +* Environment Variable <19>: OMP_WAIT_POLICY. (line 6) +* Environment Variable <20>: GOMP_CPU_AFFINITY. (line 6) +* Environment Variable <21>: GOMP_DEBUG. (line 6) +* Environment Variable <22>: GOMP_STACKSIZE. (line 6) +* Environment Variable <23>: GOMP_SPINCOUNT. (line 6) +* Environment Variable <24>: GOMP_RTEMS_THREAD_POOLS. + (line 6) +* FDL, GNU Free Documentation License: GNU Free Documentation License. + (line 6) +* Implementation specific setting: OMP_NESTED. (line 6) +* Implementation specific setting <1>: OMP_NUM_THREADS. (line 6) +* Implementation specific setting <2>: OMP_SCHEDULE. (line 6) +* Implementation specific setting <3>: OMP_TARGET_OFFLOAD. (line 6) +* Implementation specific setting <4>: GOMP_STACKSIZE. (line 6) +* Implementation specific setting <5>: GOMP_SPINCOUNT. (line 6) +* Implementation specific setting <6>: GOMP_RTEMS_THREAD_POOLS. + (line 6) +* Implementation specific setting <7>: Implementation-defined ICV Initialization. + (line 6) +* Introduction: Top. (line 6) + + + +Tag Table: +Node: Top2083 +Node: Enabling OpenMP4900 +Node: OpenMP Implementation Status6081 +Node: OpenMP 4.56760 +Node: OpenMP 5.06936 +Node: OpenMP 5.111965 +Node: OpenMP 5.217100 +Ref: OpenMP 5.2-Footnote-120611 +Node: OpenMP 6.021012 +Node: Runtime Library Routines29803 +Node: Thread Team Routines30466 +Node: omp_set_num_threads32053 +Node: omp_get_num_threads32899 +Node: omp_get_max_threads33990 +Node: omp_get_thread_num34745 +Node: omp_in_parallel35614 +Node: omp_set_dynamic36264 +Node: omp_get_dynamic37131 +Node: omp_get_cancellation38006 +Node: omp_set_nested38800 +Node: omp_get_nested40119 +Node: omp_set_schedule41861 +Node: omp_get_schedule42940 +Node: omp_get_teams_thread_limit43888 +Node: omp_get_supported_active_levels44656 +Node: omp_set_max_active_levels45461 +Node: omp_get_max_active_levels46410 +Node: omp_get_level47133 +Node: omp_get_ancestor_thread_num47767 +Node: omp_get_team_size48689 +Node: omp_get_active_level49660 +Node: Thread Affinity Routines50352 +Node: omp_get_proc_bind50752 +Node: Teams Region Routines51724 +Node: omp_get_num_teams52432 +Node: omp_get_team_num52918 +Node: omp_set_num_teams53417 +Node: omp_get_max_teams54289 +Node: omp_set_teams_thread_limit54981 +Node: omp_get_thread_limit55986 +Node: Tasking Routines56586 +Node: omp_get_max_task_priority57097 +Node: omp_in_explicit_task57680 +Node: omp_in_final58570 +Node: Resource Relinquishing Routines59213 +Node: omp_pause_resource59685 +Node: omp_pause_resource_all60778 +Node: Device Information Routines61765 +Node: omp_get_num_procs62720 +Node: omp_set_default_device63241 +Node: omp_get_default_device64221 +Node: omp_get_num_devices65365 +Node: omp_get_device_num65995 +Node: omp_get_device_from_uid66821 +Node: omp_get_uid_from_device67989 +Node: omp_is_initial_device69168 +Node: omp_get_initial_device70063 +Node: Device Memory Routines70954 +Node: omp_target_alloc71994 +Node: omp_target_free73569 +Node: omp_target_is_present74757 +Node: omp_target_is_accessible76429 +Node: omp_target_memcpy78243 +Node: omp_target_memcpy_async80057 +Node: omp_target_memcpy_rect82521 +Node: omp_target_memcpy_rect_async85764 +Node: omp_target_associate_ptr89659 +Node: omp_target_disassociate_ptr92624 +Node: omp_get_mapped_ptr94377 +Node: Lock Routines95920 +Node: omp_init_lock96768 +Node: omp_init_nest_lock97393 +Node: omp_destroy_lock98115 +Node: omp_destroy_nest_lock98790 +Node: omp_set_lock99528 +Node: omp_set_nest_lock100386 +Node: omp_unset_lock101282 +Node: omp_unset_nest_lock102211 +Node: omp_test_lock103205 +Node: omp_test_nest_lock104183 +Node: Timing Routines105171 +Node: omp_get_wtick105548 +Node: omp_get_wtime106103 +Node: Event Routine106872 +Node: omp_fulfill_event107204 +Node: Interoperability Routines108196 +Node: omp_get_num_interop_properties109072 +Node: omp_get_interop_int110381 +Node: omp_get_interop_ptr112154 +Node: omp_get_interop_str113896 +Node: omp_get_interop_name115628 +Node: omp_get_interop_type_desc116934 +Node: omp_get_interop_rc_desc118657 +Node: Memory Management Routines119830 +Node: omp_init_allocator120758 +Node: omp_destroy_allocator122391 +Node: omp_set_default_allocator123375 +Node: omp_get_default_allocator124409 +Node: omp_alloc125350 +Node: omp_aligned_alloc127453 +Node: omp_free129983 +Node: omp_calloc131638 +Node: omp_aligned_calloc133857 +Node: omp_realloc136409 +Node: Environment Display Routine139795 +Node: omp_display_env140171 +Node: Environment Variables143006 +Node: OMP_ALLOCATOR145787 +Node: OMP_AFFINITY_FORMAT147382 +Node: OMP_CANCELLATION149990 +Node: OMP_DISPLAY_AFFINITY150590 +Node: OMP_DISPLAY_ENV151285 +Node: OMP_DEFAULT_DEVICE152135 +Node: OMP_DYNAMIC153143 +Node: OMP_MAX_ACTIVE_LEVELS153770 +Node: OMP_MAX_TASK_PRIORITY154795 +Node: OMP_NESTED155498 +Node: OMP_NUM_TEAMS156747 +Node: OMP_NUM_THREADS157456 +Node: OMP_PROC_BIND158472 +Node: OMP_PLACES159993 +Node: OMP_STACKSIZE162729 +Node: OMP_SCHEDULE163631 +Node: OMP_TARGET_OFFLOAD164378 +Node: OMP_TEAMS_THREAD_LIMIT165865 +Node: OMP_THREAD_LIMIT166718 +Node: OMP_WAIT_POLICY167378 +Node: GOMP_CPU_AFFINITY168070 +Node: GOMP_DEBUG169788 +Node: GOMP_STACKSIZE170290 +Node: GOMP_SPINCOUNT171121 +Node: GOMP_RTEMS_THREAD_POOLS172325 +Node: Enabling OpenACC174500 +Node: OpenACC Runtime Library Routines175322 +Node: acc_get_num_devices179603 +Node: acc_set_device_type180329 +Node: acc_get_device_type181093 +Node: acc_set_device_num182106 +Node: acc_get_device_num182923 +Node: acc_get_property183722 +Node: acc_async_test185934 +Node: acc_async_test_all186905 +Node: acc_wait187788 +Node: acc_wait_all188651 +Node: acc_wait_all_async189412 +Node: acc_wait_async190164 +Node: acc_init190872 +Node: acc_shutdown191517 +Node: acc_on_device192184 +Node: acc_malloc193374 +Node: acc_free194082 +Node: acc_copyin194726 +Node: acc_present_or_copyin196313 +Node: acc_create198081 +Node: acc_present_or_create199713 +Node: acc_copyout201489 +Node: acc_delete203793 +Node: acc_update_device206040 +Node: acc_update_self207614 +Node: acc_map_data209204 +Node: acc_unmap_data210276 +Node: acc_deviceptr211018 +Node: acc_hostptr211813 +Node: acc_is_present212597 +Node: acc_memcpy_to_device214124 +Node: acc_memcpy_from_device215559 +Node: acc_attach217044 +Node: acc_detach217711 +Node: acc_get_current_cuda_device218550 +Node: acc_get_current_cuda_context219135 +Node: acc_get_cuda_stream219735 +Node: acc_set_cuda_stream220326 +Node: acc_prof_register220997 +Node: acc_prof_unregister221556 +Node: acc_prof_lookup222123 +Node: acc_register_library222644 +Node: OpenACC Environment Variables223210 +Node: ACC_DEVICE_TYPE223699 +Node: ACC_DEVICE_NUM224226 +Node: ACC_PROFLIB224697 +Node: CUDA Streams Usage225303 +Ref: CUDA Streams Usage-Footnote-1227195 +Node: OpenACC Library Interoperability227304 +Ref: OpenACC Library Interoperability-Footnote-1233653 +Ref: OpenACC Library Interoperability-Footnote-2233905 +Node: OpenACC Profiling Interface234113 +Node: OpenMP-Implementation Specifics244111 +Node: Implementation-defined ICV Initialization244430 +Node: OpenMP Context Selectors245601 +Node: Memory allocation246880 +Node: Offload-Target Specifics256359 +Node: AMD Radeon256650 +Node: Foreign-runtime support for AMD GPUs260672 +Node: nvptx263607 +Ref: nvptx-Footnote-1268050 +Node: Foreign-runtime support for Nvidia GPUs268142 +Node: The libgomp ABI271872 +Node: Implementing MASTER construct272722 +Node: Implementing CRITICAL construct273139 +Node: Implementing ATOMIC construct273880 +Node: Implementing FLUSH construct274363 +Node: Implementing BARRIER construct274636 +Node: Implementing THREADPRIVATE construct274907 +Node: Implementing PRIVATE clause275562 +Node: Implementing FIRSTPRIVATE LASTPRIVATE COPYIN and COPYPRIVATE clauses276145 +Node: Implementing REDUCTION clause277471 +Node: Implementing PARALLEL construct278031 +Node: Implementing FOR construct279290 +Node: Implementing ORDERED construct281290 +Node: Implementing SECTIONS construct281598 +Node: Implementing SINGLE construct282366 +Node: Implementing OpenACC's PARALLEL construct283080 +Node: Reporting Bugs283340 +Node: Copying283703 +Node: GNU Free Documentation License321255 +Node: Funding346383 +Node: Library Index348909 + +End Tag Table diff --git a/miniconda3/share/info/libquadmath.info b/miniconda3/share/info/libquadmath.info new file mode 100644 index 0000000000000000000000000000000000000000..f2ca06db6d3d776de9ad0c968f896ec77ff87cc8 --- /dev/null +++ b/miniconda3/share/info/libquadmath.info @@ -0,0 +1,811 @@ +This is libquadmath.info, produced by makeinfo version 6.5 from +libquadmath.texi. + +Copyright (C) 2010-2025 Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.2 or any later version published by the Free Software + Foundation; with no Invariant Sections, with the Front-Cover Texts + being "A GNU Manual," and with the Back-Cover Texts as in (a) + below. A copy of the license is included in the section entitled + "GNU Free Documentation License." + + (a) The FSF's Back-Cover Text is: "You have the freedom to copy and + modify this GNU manual. +INFO-DIR-SECTION GNU Libraries +START-INFO-DIR-ENTRY +* libquadmath: (libquadmath). GCC Quad-Precision Math Library +END-INFO-DIR-ENTRY + + This manual documents the GCC Quad-Precision Math Library API. + + Published by the Free Software Foundation 51 Franklin Street, Fifth +Floor Boston, MA 02110-1301 USA + + Copyright (C) 2010-2025 Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.2 or any later version published by the Free Software + Foundation; with no Invariant Sections, with the Front-Cover Texts + being "A GNU Manual," and with the Back-Cover Texts as in (a) + below. A copy of the license is included in the section entitled + "GNU Free Documentation License." + + (a) The FSF's Back-Cover Text is: "You have the freedom to copy and + modify this GNU manual. + + +File: libquadmath.info, Node: Top, Next: Typedef and constants, Up: (dir) + +Introduction +************ + +This manual documents the usage of libquadmath, the GCC Quad-Precision +Math Library Application Programming Interface (API). + +* Menu: + +* Typedef and constants:: Defined data types and constants +* Math Library Routines:: The Libquadmath math runtime application + programming interface. +* I/O Library Routines:: The Libquadmath I/O runtime application + programming interface. +* GNU Free Documentation License:: + How you can copy and share this manual. +* Reporting Bugs:: How to report bugs in GCC Libquadmath. + + +File: libquadmath.info, Node: Typedef and constants, Next: Math Library Routines, Prev: Top, Up: Top + +1 Typedef and constants +*********************** + +The following data type has been defined via 'typedef'. + +'__complex128': '__float128'-based complex number + + The following macros are defined, which give the numeric limits of +the '__float128' data type. + +'FLT128_MAX': largest finite number +'FLT128_MIN': smallest positive number with full precision +'FLT128_EPSILON': difference between 1 and the next larger + representable number +'FLT128_DENORM_MIN': smallest positive denormalized number +'FLT128_MANT_DIG': number of digits in the mantissa (bit precision) +'FLT128_MIN_EXP': maximal negative exponent +'FLT128_MAX_EXP': maximal positive exponent +'FLT128_DIG': number of decimal digits in the mantissa +'FLT128_MIN_10_EXP': maximal negative decimal exponent +'FLT128_MAX_10_EXP': maximal positive decimal exponent + + The following mathematical constants of type '__float128' are +defined. + +'M_Eq': the constant e (Euler's number) +'M_LOG2Eq': base 2 logarithm of e +'M_LOG10Eq': decimal (base 10) logarithm of e +'M_LN2q': natural logarithm of 2 +'M_LN10q': natural logarithm of 10 +'M_PIq': pi +'M_PI_2q': pi divided by two +'M_PI_4q': pi divided by four +'M_1_PIq': one divided by pi +'M_2_PIq': two divided by pi +'M_2_SQRTPIq': two divided by square root of pi +'M_SQRT2q': square root of 2 +'M_SQRT1_2q': one divided by square root of 2 + + +File: libquadmath.info, Node: Math Library Routines, Next: I/O Library Routines, Prev: Typedef and constants, Up: Top + +2 Math Library Routines +*********************** + +The following mathematical functions are available: + +'acosq': arc cosine function +'acoshq': inverse hyperbolic cosine function +'asinq': arc sine function +'asinhq': inverse hyperbolic sine function +'atanq': arc tangent function +'atanhq': inverse hyperbolic tangent function +'atan2q': arc tangent function +'cbrtq': cube root function +'ceilq': ceiling value function +'copysignq': copy sign of a number +'coshq': hyperbolic cosine function +'cosq': cosine function +'erfq': error function +'erfcq': complementary error function +'exp2q': base 2 exponential function +'expq': exponential function +'expm1q': exponential minus 1 function +'fabsq': absolute value function +'fdimq': positive difference function +'finiteq': check finiteness of value +'floorq': floor value function +'fmaq': fused multiply and add +'fmaxq': determine maximum of two values +'fminq': determine minimum of two values +'fmodq': remainder value function +'frexpq': extract mantissa and exponent +'hypotq': Eucledian distance function +'ilogbq': get exponent of the value +'isinfq': check for infinity +'isnanq': check for not a number +'issignalingq': check for signaling not a number +'j0q': Bessel function of the first kind, first order +'j1q': Bessel function of the first kind, second order +'jnq': Bessel function of the first kind, N-th order +'ldexpq': load exponent of the value +'lgammaq': logarithmic gamma function +'llrintq': round to nearest integer value +'llroundq': round to nearest integer value away from zero +'logbq': get exponent of the value +'logq': natural logarithm function +'log10q': base 10 logarithm function +'log1pq': compute natural logarithm of the value plus one +'log2q': base 2 logarithm function +'lrintq': round to nearest integer value +'lroundq': round to nearest integer value away from zero +'modfq': decompose the floating-point number +'nanq': return quiet NaN +'nearbyintq': round to nearest integer +'nextafterq': next representable floating-point number +'powq': power function +'remainderq': remainder function +'remquoq': remainder and part of quotient +'rintq': round-to-nearest integral value +'roundq': round-to-nearest integral value, return '__float128' +'scalblnq': compute exponent using 'FLT_RADIX' +'scalbnq': compute exponent using 'FLT_RADIX' +'signbitq': return sign bit +'sincosq': calculate sine and cosine simultaneously +'sinhq': hyperbolic sine function +'sinq': sine function +'sqrtq': square root function +'tanq': tangent function +'tanhq': hyperbolic tangent function +'tgammaq': true gamma function +'truncq': round to integer, towards zero +'y0q': Bessel function of the second kind, first order +'y1q': Bessel function of the second kind, second order +'ynq': Bessel function of the second kind, N-th order +'cabsq' complex absolute value function +'cargq': calculate the argument +'cimagq' imaginary part of complex number +'crealq': real part of complex number +'cacoshq': complex arc hyperbolic cosine function +'cacosq': complex arc cosine function +'casinhq': complex arc hyperbolic sine function +'casinq': complex arc sine function +'catanhq': complex arc hyperbolic tangent function +'catanq': complex arc tangent function +'ccosq' complex cosine function: +'ccoshq': complex hyperbolic cosine function +'cexpq': complex exponential function +'cexpiq': computes the exponential function of "i" times a + real value +'clogq': complex natural logarithm +'clog10q': complex base 10 logarithm +'conjq': complex conjugate function +'cpowq': complex power function +'cprojq': project into Riemann Sphere +'csinq': complex sine function +'csinhq': complex hyperbolic sine function +'csqrtq': complex square root +'ctanq': complex tangent function +'ctanhq': complex hyperbolic tangent function + + +File: libquadmath.info, Node: I/O Library Routines, Next: GNU Free Documentation License, Prev: Math Library Routines, Up: Top + +3 I/O Library Routines +********************** + +* Menu: + +* 'strtoflt128': strtoflt128, Convert from string +* 'quadmath_snprintf': quadmath_snprintf, Convert to string + + +File: libquadmath.info, Node: strtoflt128, Next: quadmath_snprintf, Up: I/O Library Routines + +3.1 'strtoflt128' -- Convert from string +======================================== + +The function 'strtoflt128' converts a string into a '__float128' number. + +Syntax + '__float128 strtoflt128 (const char *s, char **sp)' + +_Arguments_: + S input string + SP the address of the next character in the string + + The argument SP contains, if not 'NULL', the address of the next + character following the parts of the string, which have been read. + +Example + #include + + int main () + { + __float128 r; + + r = strtoflt128 ("1.2345678", NULL); + + return 0; + } + + +File: libquadmath.info, Node: quadmath_snprintf, Prev: strtoflt128, Up: I/O Library Routines + +3.2 'quadmath_snprintf' -- Convert to string +============================================ + +The function 'quadmath_snprintf' converts a '__float128' floating-point +number into a string. It is a specialized alternative to 'snprintf', +where the format string is restricted to a single conversion specifier +with 'Q' modifier and conversion specifier 'e', 'E', 'f', 'F', 'g', 'G', +'a' or 'A', with no extra characters before or after the conversion +specifier. The '%m$' or '*m$' style must not be used in the format. + +Syntax + 'int quadmath_snprintf (char *s, size_t size, const char *format, + ...)' + +_Arguments_: + S output string + SIZE byte size of the string, including trailing NUL + FORMAT conversion specifier string + +Note + On some targets when supported by the C library hooks are installed + for 'printf' family of functions, so that 'printf ("%Qe", 1.2Q);' + etc. works too. + +Example + #include + #include + #include + + int main () + { + __float128 r; + int prec = 20; + int width = 46; + char buf[128]; + + r = 2.0q; + r = sqrtq (r); + int n = quadmath_snprintf (buf, sizeof buf, "%+-#*.20Qe", width, r); + if ((size_t) n < sizeof buf) + printf ("%s\n", buf); + /* Prints: +1.41421356237309504880e+00 */ + quadmath_snprintf (buf, sizeof buf, "%Qa", r); + if ((size_t) n < sizeof buf) + printf ("%s\n", buf); + /* Prints: 0x1.6a09e667f3bcc908b2fb1366ea96p+0 */ + n = quadmath_snprintf (NULL, 0, "%+-#46.*Qe", prec, r); + if (n > -1) + { + char *str = malloc (n + 1); + if (str) + { + quadmath_snprintf (str, n + 1, "%+-#46.*Qe", prec, r); + printf ("%s\n", str); + /* Prints: +1.41421356237309504880e+00 */ + } + free (str); + } + return 0; + } + + +File: libquadmath.info, Node: GNU Free Documentation License, Next: Reporting Bugs, Prev: I/O Library Routines, Up: Top + +GNU Free Documentation License +****************************** + + Version 1.3, 3 November 2008 + + Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + functional and useful document "free" in the sense of freedom: to + assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or + noncommercially. Secondarily, this License preserves for the + author and publisher a way to get credit for their work, while not + being considered responsible for modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. We + recommend this License principally for works whose purpose is + instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work, in any medium, + that contains a notice placed by the copyright holder saying it can + be distributed under the terms of this License. Such a notice + grants a world-wide, royalty-free license, unlimited in duration, + to use that work under the conditions stated herein. The + "Document", below, refers to any such manual or work. Any member + of the public is a licensee, and is addressed as "you". You accept + the license if you copy, modify or distribute the work in a way + requiring permission under copyright law. + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter section + of the Document that deals exclusively with the relationship of the + publishers or authors of the Document to the Document's overall + subject (or to related matters) and contains nothing that could + fall directly within that overall subject. (Thus, if the Document + is in part a textbook of mathematics, a Secondary Section may not + explain any mathematics.) The relationship could be a matter of + historical connection with the subject or with related matters, or + of legal, commercial, philosophical, ethical or political position + regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in the + notice that says that the Document is released under this License. + If a section does not fit the above definition of Secondary then it + is not allowed to be designated as Invariant. The Document may + contain zero Invariant Sections. If the Document does not identify + any Invariant Sections then there are none. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. A + Front-Cover Text may be at most 5 words, and a Back-Cover Text may + be at most 25 words. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, that is suitable for revising the document + straightforwardly with generic text editors or (for images composed + of pixels) generic paint programs or (for drawings) some widely + available drawing editor, and that is suitable for input to text + formatters or for automatic translation to a variety of formats + suitable for input to text formatters. A copy made in an otherwise + Transparent file format whose markup, or absence of markup, has + been arranged to thwart or discourage subsequent modification by + readers is not Transparent. An image format is not Transparent if + used for any substantial amount of text. A copy that is not + "Transparent" is called "Opaque". + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and standard-conforming + simple HTML, PostScript or PDF designed for human modification. + Examples of transparent image formats include PNG, XCF and JPG. + Opaque formats include proprietary formats that can be read and + edited only by proprietary word processors, SGML or XML for which + the DTD and/or processing tools are not generally available, and + the machine-generated HTML, PostScript or PDF produced by some word + processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + The "publisher" means any person or entity that distributes copies + of the Document to the public. + + A section "Entitled XYZ" means a named subunit of the Document + whose title either is precisely XYZ or contains XYZ in parentheses + following text that translates XYZ in another language. (Here XYZ + stands for a specific section name mentioned below, such as + "Acknowledgements", "Dedications", "Endorsements", or "History".) + To "Preserve the Title" of such a section when you modify the + Document means that it remains a section "Entitled XYZ" according + to this definition. + + The Document may include Warranty Disclaimers next to the notice + which states that this License applies to the Document. These + Warranty Disclaimers are considered to be included by reference in + this License, but only as regards disclaiming warranties: any other + implication that these Warranty Disclaimers may have is void and + has no effect on the meaning of this License. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow the + conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies (or copies in media that commonly + have printed covers) of the Document, numbering more than 100, and + the Document's license notice requires Cover Texts, you must + enclose the copies in covers that carry, clearly and legibly, all + these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the title + equally prominent and visible. You may add other material on the + covers in addition. Copying with changes limited to the covers, as + long as they preserve the title of the Document and satisfy these + conditions, can be treated as verbatim copying in other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a machine-readable + Transparent copy along with each Opaque copy, or state in or with + each Opaque copy a computer-network location from which the general + network-using public has access to download using public-standard + network protocols a complete Transparent copy of the Document, free + of added material. If you use the latter option, you must take + reasonably prudent steps, when you begin distribution of Opaque + copies in quantity, to ensure that this Transparent copy will + remain thus accessible at the stated location until at least one + year after the last time you distribute an Opaque copy (directly or + through your agents or retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of copies, + to give them a chance to provide you with an updated version of the + Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with the + Modified Version filling the role of the Document, thus licensing + distribution and modification of the Modified Version to whoever + possesses a copy of it. In addition, you must do these things in + the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of previous + versions (which should, if there were any, be listed in the + History section of the Document). You may use the same title + as a previous version if the original publisher of that + version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has fewer than five), unless they release you + from this requirement. + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section Entitled "History", Preserve its Title, + and add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on the + Title Page. If there is no section Entitled "History" in the + Document, create one stating the title, year, authors, and + publisher of the Document as given on its Title Page, then add + an item describing the Modified Version as stated in the + previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in the + "History" section. You may omit a network location for a work + that was published at least four years before the Document + itself, or if the original publisher of the version it refers + to gives permission. + + K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section + all the substance and tone of each of the contributor + acknowledgements and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, unaltered + in their text and in their titles. Section numbers or the + equivalent are not considered part of the section titles. + + M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section to be Entitled + "Endorsements" or to conflict in title with any Invariant + Section. + + O. Preserve any Warranty Disclaimers. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option designate + some or all of these sections as invariant. To do this, add their + titles to the list of Invariant Sections in the Modified Version's + license notice. These titles must be distinct from any other + section titles. + + You may add a section Entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties--for example, statements of peer review or that the text + has been approved by an organization as the authoritative + definition of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end of + the list of Cover Texts in the Modified Version. Only one passage + of Front-Cover Text and one of Back-Cover Text may be added by (or + through arrangements made by) any one entity. If the Document + already includes a cover text for the same cover, previously added + by you or by arrangement made by the same entity you are acting on + behalf of, you may not add another; but you may replace the old + one, on explicit permission from the previous publisher that added + the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination all + of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice, and that you preserve all + their Warranty Disclaimers. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections Entitled + "History" in the various original documents, forming one section + Entitled "History"; likewise combine any sections Entitled + "Acknowledgements", and any sections Entitled "Dedications". You + must delete all sections Entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the documents + in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow this + License in all other respects regarding verbatim copying of that + document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of a + storage or distribution medium, is called an "aggregate" if the + copyright resulting from the compilation is not used to limit the + legal rights of the compilation's users beyond what the individual + works permit. When the Document is included in an aggregate, this + License does not apply to the other works in the aggregate which + are not themselves derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one half + of the entire aggregate, the Document's Cover Texts may be placed + on covers that bracket the Document within the aggregate, or the + electronic equivalent of covers if the Document is in electronic + form. Otherwise they must appear on printed covers that bracket + the whole aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License, and all the license notices in the + Document, and any Warranty Disclaimers, provided that you also + include the original English version of this License and the + original versions of those notices and disclaimers. In case of a + disagreement between the translation and the original version of + this License or a notice or disclaimer, the original version will + prevail. + + If a section in the Document is Entitled "Acknowledgements", + "Dedications", or "History", the requirement (section 4) to + Preserve its Title (section 1) will typically require changing the + actual title. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense, or distribute it is void, + and will automatically terminate your rights under this License. + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly and + finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from + that copyright holder, and you cure the violation prior to 30 days + after your receipt of the notice. + + Termination of your rights under this section does not terminate + the licenses of parties who have received copies or rights from you + under this License. If your rights have been terminated and not + permanently reinstated, receipt of a copy of some or all of the + same material does not give you any rights to use it. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + . + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If the + Document does not specify a version number of this License, you may + choose any version ever published (not as a draft) by the Free + Software Foundation. If the Document specifies that a proxy can + decide which future versions of this License can be used, that + proxy's public statement of acceptance of a version permanently + authorizes you to choose that version for the Document. + + 11. RELICENSING + + "Massive Multiauthor Collaboration Site" (or "MMC Site") means any + World Wide Web server that publishes copyrightable works and also + provides prominent facilities for anybody to edit those works. A + public wiki that anybody can edit is an example of such a server. + A "Massive Multiauthor Collaboration" (or "MMC") contained in the + site means any set of copyrightable works thus published on the MMC + site. + + "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 + license published by Creative Commons Corporation, a not-for-profit + corporation with a principal place of business in San Francisco, + California, as well as future copyleft versions of that license + published by that same organization. + + "Incorporate" means to publish or republish a Document, in whole or + in part, as part of another Document. + + An MMC is "eligible for relicensing" if it is licensed under this + License, and if all works that were first published under this + License somewhere other than this MMC, and subsequently + incorporated in whole or in part into the MMC, (1) had no cover + texts or invariant sections, and (2) were thus incorporated prior + to November 1, 2008. + + The operator of an MMC Site may republish an MMC contained in the + site under CC-BY-SA on the same site at any time before August 1, + 2009, provided the MMC is eligible for relicensing. + +ADDENDUM: How to use this License for your documents +==================================================== + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + + If you have Invariant Sections, Front-Cover Texts and Back-Cover +Texts, replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with + the Front-Cover Texts being LIST, and with the Back-Cover Texts + being LIST. + + If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of free +software license, such as the GNU General Public License, to permit +their use in free software. + + +File: libquadmath.info, Node: Reporting Bugs, Prev: GNU Free Documentation License, Up: Top + +4 Reporting Bugs +**************** + +Bugs in the GCC Quad-Precision Math Library implementation should be +reported via . + + + +Tag Table: +Node: Top1633 +Node: Typedef and constants2367 +Node: Math Library Routines3808 +Node: I/O Library Routines7645 +Node: strtoflt1287970 +Node: quadmath_snprintf8730 +Node: GNU Free Documentation License10941 +Node: Reporting Bugs36093 + +End Tag Table diff --git a/miniconda3/share/info/libtextstyle.info b/miniconda3/share/info/libtextstyle.info new file mode 100644 index 0000000000000000000000000000000000000000..c37fe1ac9442e4bbd4018c3cc73daf39c410dd64 --- /dev/null +++ b/miniconda3/share/info/libtextstyle.info @@ -0,0 +1,2789 @@ +This is libtextstyle.info, produced by makeinfo version 7.1 from +libtextstyle.texi. + + Copyright (C) 2018-2024 Free Software Foundation, Inc. + + This manual is free documentation. It is dually licensed under the +GNU FDL and the GNU GPL. This means that you can redistribute this +manual under either of these two licenses, at your choice. + + This manual is covered by the GNU FDL. Permission is granted to copy, +distribute and/or modify this document under the terms of the GNU Free +Documentation License (FDL), either version 1.2 of the License, or (at +your option) any later version published by the Free Software Foundation +(FSF); with no Invariant Sections, with no Front-Cover Text, and with no +Back-Cover Texts. A copy of the license is at +. + + This manual is covered by the GNU GPL. You can redistribute it and/or +modify it under the terms of the GNU General Public License (GPL), +either version 2 of the License, or (at your option) any later version +published by the Free Software Foundation (FSF). A copy of the license +is at . +INFO-DIR-SECTION Software development +START-INFO-DIR-ENTRY +* GNU libtextstyle: (libtextstyle). Output of styled text. +END-INFO-DIR-ENTRY + + This manual provides documentation for the GNU ‘libtextstyle’ +library. + + +File: libtextstyle.info, Node: Top, Next: Introduction, Up: (dir) + +GNU libtextstyle +**************** + + This manual documents the GNU libtextstyle library, version 0.25. + +* Menu: + +* Introduction:: Introduction +* The user's view:: The user's perspective +* The programmer's view:: The programmer's perspective +* Licenses:: +* Function Index:: +* Variable Index:: +* Index:: + + +File: libtextstyle.info, Node: Introduction, Next: The user's view, Prev: Top, Up: Top + +1 Introduction +************** + + Text is easier to read when it is accompanied with styling +information, such as color, font attributes (weight, posture), or +underlining, and this styling is customized appropriately for the output +device. + + GNU libtextstyle provides an easy way to add styling to programs that +produce output to a console or terminal emulator window. It does this +in a way that allows the end user to customize the styling using the +industry standard, namely Cascading Style Sheets (CSS). + +* Menu: + +* Style definitions:: +* Built-in versus separate styling:: + + +File: libtextstyle.info, Node: Style definitions, Next: Built-in versus separate styling, Up: Introduction + +1.1 Style definitions +===================== + + Let's look at the traditional way styling is done for specific +programs. + + Browsers, when they render HTML, use CSS styling. + + The older approach to user-customizable text styling is that the user +associates patterns with escape sequences in an environment variable or +a command-line argument. This is the approach used, for example, by the +GNU ‘ls’ program in combination with the ‘dircolors’ program. The +processing is distributed across several steps: + 1. There is default style definition that is hard-coded in the + ‘dircolors’ program. The user can also define their own + definitions in a file such as ‘~/.dir_colors’. This style + definition contains explicit terminal escape sequences; thus, it + can only be used with consoles and terminal emulators, and each + style definition applies only to a certain class of + mostly-compatible terminal emulators. + 2. The ‘dircolors’ program, when invoked, translates such a style + definition to a sequence of shell statements that sets an + environment variable ‘LS_COLORS’. + 3. The shell executes these statements, and thus sets the environment + variable ‘LS_COLORS’. + 4. The program looks at the environment variable and emits the listed + escape sequences. + + In contrast, this library implements styling as follows: + 1. There is a default style definition in a CSS file that is part of + the same package as the stylable program. The user can also define + their own definitions in a CSS file, and set an environment + environment variable to point to it. + 2. The program looks at the environment variable, parses the CSS file, + translates the styling specifications to the form that is + appropriate for the output device (escape sequences for terminal + emulators, inline CSS and ‘’ elements for HTML output), and + emits it. + + Thus, with GNU libtextstyle, the styling has the following +properties: + • It is easier for the user to define their own styling, because the + file format is standardized and supported by numerous syntax aware + editors. + • A styling file does not depend on the particular output device. An + HTML output and a black-on-white terminal emulator can use the same + styling file. A white-on-black (or even green-on-black) terminal + emulator will need different styling, though. + • It is simpler: There is no need for a program that converts the + style specification from one format to another. + + +File: libtextstyle.info, Node: Built-in versus separate styling, Prev: Style definitions, Up: Introduction + +1.2 Built-in versus separate styling +==================================== + + There are generally two approaches for adding styling to text: + • The program that generates the text adds the styling. It does so + through interleaved statements that turn on or off specific + attributes. + • The styling gets added by a separate program, that postprocesses + the output. This separate program usually uses regular expressions + to determine which text regions to style with a certain set of text + attributes. + + The first approach produces a styling that is 100% correct, +regardless of the complexity of the text that is being output. This is +the preferred approach for example for JSON, XML, or programming +language text. + + The second approach works well if the output has a simple, +easy-to-parse format. It may produce wrong styling in some cases when +the text format is more complex. This approach is often used for +viewing log files. + + GNU libtextstyle supports both approaches; it includes an example +program for each of the two approaches. + + +File: libtextstyle.info, Node: The user's view, Next: The programmer's view, Prev: Introduction, Up: Top + +2 The end user's perspective +**************************** + + Styled output can viewed fine in a console or terminal emulator +window. + + The stylable program will typically have the following options: +‘--color’ + Use colors and other text attributes always. +‘--color=WHEN’ + Use colors and other text attributes if WHEN. WHEN may be + ‘always’, ‘never’, ‘auto’, or ‘html’. +‘--style=STYLE-FILE’ + Specify the CSS style rule file for ‘--color’. + + For more details, see the sections *note The --color option:: and +*note The --style option:: below. + + If the output does not fit on a screen, you can use ‘less -R’ to +scroll around in the styled output. For example: + PROGRAM --color ARGUMENTS | less -R + +* Menu: + +* The TERM variable:: +* The NO_COLOR variable:: +* The NO_TERM_HYPERLINKS variable:: +* Emacs:: +* The --color option:: +* The --style option:: + + +File: libtextstyle.info, Node: The TERM variable, Next: The NO_COLOR variable, Up: The user's view + +2.1 The environment variable ‘TERM’ +=================================== + + The environment variable ‘TERM’ contains a identifier for the text +window's capabilities. You can get a detailed list of these +cababilities by using the ‘infocmp’ command (for example: ‘infocmp -L1 +xterm’), using ‘man 5 terminfo’ as a reference. + + When producing text with embedded color directives, a +‘libtextstyle’-enabled program looks at the ‘TERM’ variable. Text +windows today typically support at least 8 colors. Often, however, the +text window supports 16 or more colors, even though the ‘TERM’ variable +is set to a identifier denoting only 8 supported colors. It can be +worth setting the ‘TERM’ variable to a different value in these cases. + + After setting ‘TERM’, you can verify how well it works by invoking +‘PROGRAM --color=test’, where ‘PROGRAM’ is any ‘libtextstyle’-enabled +program, and seeing whether the output looks like a reasonable color +map. + +* Menu: + +* Terminal emulators:: +* Consoles:: + + +File: libtextstyle.info, Node: Terminal emulators, Next: Consoles, Up: The TERM variable + +2.1.1 Terminal emulator programs +-------------------------------- + + The following terminal emulator programs support 256 colors and set +‘TERM=xterm-256color’ accordingly: + + • In GNOME: ‘gnome-terminal’, ‘tilda’. + • ‘rxvt-unicode’ (sets ‘TERM=rxvt-unicode-256color’). + • ‘st’ (sets ‘TERM=st-256color’). + • ‘QTerminal’. + • On macOS: ‘Terminal’, ‘iTerm2’. + + The following terminal emulator programs support 256 colors. You +only need to set ‘TERM=xterm-256color’ or similar; the programs by +default set ‘TERM’ to a value that supports only 8 colors. + + • ‘xterm’ is in many cases built with support for 256 colors. But it + sets ‘TERM=xterm’. You need to set ‘TERM=xterm-256color’. + • In GNOME: ‘guake’ (sets ‘TERM=xterm’). You need to set + ‘TERM=xterm-256color’. + • In KDE: ‘konsole’ (sets ‘TERM=xterm’). You need to set + ‘TERM=xterm-256color’ or ‘TERM=konsole-256color’. + • In KDE: ‘yakuake’ (sets ‘TERM=xterm’). You need to set + ‘TERM=xterm-256color’. + • In Enlightenment: ‘Eterm’ (sets ‘TERM=Eterm’). You need to set + ‘TERM=Eterm-256color’. + • ‘mlterm’ (sets ‘TERM=mlterm’). You need to set + ‘TERM=mlterm-256color’. + • On Windows: ‘PuTTY’ (sets ‘TERM=xterm’). You need to set + ‘TERM=xterm-256color’ or ‘TERM=putty-256color’. + • On Windows: ‘TeraTerm’ (sets ‘TERM=xterm’). You need to set + ‘TERM=xterm-256color’. + + A couple of terminal emulator programs support even the entire RGB +color space (16 million colors). To get this to work, at this date +(2019), you need three things: + • The ‘ncurses’ library version 6.1 or newer must be installed. + • You need a recent version of the respective terminal emulator + program. See for the most + recent developments in this area. + • You need to set the ‘TERM’ environment variable to the + corresponding value: ‘TERM=xterm-direct’ instead of ‘TERM=xterm’ or + ‘TERM=xterm-256color’, ‘TERM=konsole-direct’ in ‘konsole’, + ‘TERM=st-direct’ in ‘st’, ‘TERM=mlterm-direct’ in ‘mlterm’, or + ‘TERM=iterm2-direct’ in ‘iTerm2’ on macOS. + + +File: libtextstyle.info, Node: Consoles, Prev: Terminal emulators, Up: The TERM variable + +2.1.2 Consoles +-------------- + + On OpenBSD 6 consoles, ‘TERM=xterm’ produces better results than the +default ‘TERM=vt220’. + + On NetBSD 8 consoles, ‘TERM=netbsd6’ produces better results than the +default ‘TERM=vt100’. + + On Windows consoles, no ‘TERM’ setting is needed. + + +File: libtextstyle.info, Node: The NO_COLOR variable, Next: The NO_TERM_HYPERLINKS variable, Prev: The TERM variable, Up: The user's view + +2.2 The environment variable ‘NO_COLOR’ +======================================= + + The environment variable ‘NO_COLOR’ can be used to suppress styling +in the textual output. When this environment variable is set (to any +value), ‘libtextstyle’-enabled programs will not emit colors and other +text styling. + + This environment variable can be overridden by passing the +command-line option ‘--color=always’ (see *note The --color option::). + + +File: libtextstyle.info, Node: The NO_TERM_HYPERLINKS variable, Next: Emacs, Prev: The NO_COLOR variable, Up: The user's view + +2.3 The environment variable ‘NO_TERM_HYPERLINKS’ +================================================= + + The environment variable ‘NO_TERM_HYPERLINKS’ can be used to suppress +hyperlinks in the textual output. When this environment variable is set +(to any value), ‘libtextstyle’-enabled programs will not emit +hyperlinks. This may be useful for terminal emulators which produce +garbage output when they receive the escape sequence for a hyperlink. +Currently (as of 2019), this affects some versions of ‘konsole’, +‘emacs’, ‘lxterminal’, ‘guake’, ‘yakuake’, ‘rxvt’. + + +File: libtextstyle.info, Node: Emacs, Next: The --color option, Prev: The NO_TERM_HYPERLINKS variable, Up: The user's view + +2.4 Emacs as a terminal emulator +================================ + + Emacs has several terminal emulators: ‘M-x shell’ and ‘M-x term’. +‘M-x term’ has good support for styling, whereas in ‘M-x shell’ most of +the styling gets lost. + + +File: libtextstyle.info, Node: The --color option, Next: The --style option, Prev: Emacs, Up: The user's view + +2.5 The ‘--color’ option +======================== + + The ‘--color=WHEN’ option specifies under which conditions styled +(colorized) output should be generated. The WHEN part can be one of the +following: + +‘always’ +‘yes’ + The output will be colorized. + +‘never’ +‘no’ + The output will not be colorized. + +‘auto’ +‘tty’ + The output will be colorized if the output device is a tty, i.e. + when the output goes directly to a text screen or terminal emulator + window. + +‘html’ + The output will be colorized and be in HTML format. This value is + only supported by some programs. + +‘test’ + This is a special value, understood only by some programs. It is + explained in the section (*note The TERM variable::) above. + +‘--color’ is equivalent to ‘--color=yes’. The default is +‘--color=auto’. + + Thus, a command that invokes a ‘libtextstyle’-enabled program will +produce colorized output when called by itself in a command window. +Whereas in a pipe, such as ‘PROGRAM ARGUMENTS | less -R’, it will not +produce colorized output. To get colorized output in this situation +nevertheless, use the command ‘PROGRAM --color ARGUMENTS | less -R’. + + The ‘--color=html’ option will produce output that can be viewed in a +browser. This can be useful, for example, for Indic languages, because +the renderic of Indic scripts in browsers is usually better than in +terminal emulators. + + Note that the output produced with the ‘--color’ option is _not_ +consumable by programs that expect the raw text. It contains additional +terminal-specific escape sequences or HTML tags. For example, an XML +parser will give a syntax error when confronted with a colored XML +output. Except for the ‘--color=html’ case, you therefore normally +don't need to save output produced with the ‘--color’ option in a file. + + +File: libtextstyle.info, Node: The --style option, Prev: The --color option, Up: The user's view + +2.6 The ‘--style’ option +======================== + + The ‘--style=STYLE_FILE’ option specifies the style file to use when +colorizing. It has an effect only when the ‘--color’ option is +effective. + + If the ‘--style’ option is not specified, the program may consider +the value of an environment variable. It is meant to point to the +user's preferred style for such output. The name of such an environment +variable, if supported, is documented in the documentation of the +‘libtextstyle’-enabled program. + + You can also design your own styles. This is described in the next +section. + +* Menu: + +* Style rules:: How to create a style file +* Debugging style files:: How to debug a style file + + +File: libtextstyle.info, Node: Style rules, Next: Debugging style files, Up: The --style option + +2.6.1 Creating your own style files +----------------------------------- + + The same style file can be used for styling a certain type of output, +for terminal output and for HTML output. It is written in CSS +(Cascading Style Sheet) syntax. See for a +formal definition of CSS. Many HTML authoring tutorials also contain +explanations of CSS. + + In the case of HTML output, the style file is embedded in the HTML +output. In the case of text output, the style file is interpreted by +the ‘libtextstyle’-enabled program. + + You should avoid ‘@import’ statements, because + − In the case of HTML output, the files referenced by the ‘@import’ + statements would not be embedded in the HTML output. In fact, + relative file names would be interpreted relative to the resulting + HTML file. + − In the case of text output, ‘@import’s are not supported, due to a + limitation in ‘libcroco’. + + CSS rules are built up from selectors and declarations. The +declarations specify graphical properties; the selectors specify when +they apply. + + GNU libtextstyle supports simple selectors based on "CSS classes", +see the CSS2 spec, section 5.8.3. The set of CSS classes that are +supported by a ‘libtextstyle’-enabled program are documented in the +documentation of that program. + + These selectors can be combined to hierarchical selectors. For +example, assume a program supports the CSS classes ‘string’ (that +matches a string) and ‘non-ascii’ (that matches a word with non-ASCII +characters), you could write + + .string .non-ascii { color: red; } + +to highlight only the non-ASCII words inside strings. + + In text mode, pseudo-classes (CSS2 spec, section 5.11) and +pseudo-elements (CSS2 spec, section 5.12) are not supported. + + The declarations in HTML mode are not limited; any graphical +attribute supported by the browsers can be used. + + The declarations in text mode are limited to the following +properties. Other properties will be silently ignored. + +‘color’ (CSS2 spec, section 14.1) +‘background-color’ (CSS2 spec, section 14.2.1) + These properties are supported. Colors will be adjusted to match + the terminal's capabilities. Note that many terminals support only + 8 colors. + +‘font-weight’ (CSS2 spec, section 15.2.3) + This property is supported, but most terminals can only render two + different weights: ‘normal’ and ‘bold’. Values >= 600 are rendered + as ‘bold’. + +‘font-style’ (CSS2 spec, section 15.2.3) + This property is supported. The values ‘italic’ and ‘oblique’ are + rendered the same way. + +‘text-decoration’ (CSS2 spec, section 16.3.1) + This property is supported, limited to the values ‘none’ and + ‘underline’. + + +File: libtextstyle.info, Node: Debugging style files, Prev: Style rules, Up: The --style option + +2.6.2 Debugging style files +--------------------------- + + If you want to understand why the style rules in a style file produce +the output that you see, you can do so in three steps: + + 1. Run the program with the command-line option ‘--color=html’, + redirecting the output to a file. + 2. Open the resulting HTML file in a browser. + 3. Use the browser's built-in CSS debugging tool. + • In Firefox: From the pop-up menu, select "Inspect Element". + Click somewhere in the DOM tree ("Inspector" tab) and look at + the CSS declarations in the "Rules" tab. + • In Chromium: From the pop-up menu, select "Inspect". Click + somewhere in the DOM tree ("Elements" tab) and look at the CSS + declarations in the "Styles" tab. + + This technique allows you, in particular, to see which CSS +declarations override which other CSS declarations from other CSS rules. + + +File: libtextstyle.info, Node: The programmer's view, Next: Licenses, Prev: The user's view, Up: Top + +3 The programmer's perspective +****************************** + + As a programmer, enabling styling consists of the following tasks: + 1. Define the command-line options and environment variable that the + user can use to control the styling. + 2. Define the CSS classes that the user can use in the CSS file. Each + CSS class corresponds to a text role; each CSS class can be given a + different styling by the user. + 3. Change the output routines so that they take an ‘ostream_t’ object + as argument instead of a ‘FILE *’. + 4. Insert paired invocations to ‘styled_ostream_begin_css_class’, + ‘styled_ostream_end_css_class’ around each run of text with a + specific text role. + 5. Link with ‘libtextstyle’. If your package is using GNU autoconf, + you can use the ‘libtextstyle.m4’ macro from Gnulib. + 6. Prepare a default style file. + 7. Update the documentation of your package. + + The following sections go into more detail. + +* Menu: + +* Basic use:: +* Include files:: +* Link options:: +* Command-line options:: +* The output stream hierarchy:: +* Debugging the styling code:: +* What to document:: + + +File: libtextstyle.info, Node: Basic use, Next: Include files, Up: The programmer's view + +3.1 Basic use of libtextstyle +============================= + + Source code that makes use of GNU libtextstyle needs an include +statement: + + #include + + Basic use of GNU libtextstyle consists of statements like these: + + styled_ostream_t stream = + styled_ostream_create (STDOUT_FILENO, "(stdout)", TTYCTL_AUTO, + style_file_name); + ... + styled_ostream_begin_use_class (stream, css_class); + ... + ostream_write_str (stream, string); + ... + styled_ostream_end_use_class (stream, css_class); + ... + styled_ostream_free (stream); + + Before this snippet, your code needs to determine the name of the +style file to use (‘style_file_name’). If no styling is desired - the +precise condition depends on the value of ‘color_mode’ but also on your +application logic -, you should set ‘style_file_name’ to ‘NULL’. + + An object of type ‘styled_ostream_t’ is allocated. The function +‘styled_ostream_create’ allocates it; the function ‘styled_ostream_free’ +deallocates it. + + Such ‘styled_ostream_t’ supports output operations +(‘ostream_write_str’), interleaved with adding and removing CSS classes. +The CSS class in effect when an output operation is performed +determines, through the style file, the text attributes associated with +that piece of text. + +* Menu: + +* Hyperlinks:: + + +File: libtextstyle.info, Node: Hyperlinks, Up: Basic use + +3.1.1 Hyperlinks +---------------- + + Text output may contain hyperlinks. These hyperlinks are encoded +through an escape sequence, specified at Hyperlinks in terminal +emulators +(https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda). +Currently (as of 2024), they are displayed in many modern terminals, see +OSC8-Adoption (https://github.com/Alhadis/OSC8-Adoption). More terminal +emulators will support hyperlinks in the future. Terminal emulators +which don't support hyperlinks ignore it, except for a few terminal +emulators, for which users may need to disable the hyperlinks (see *note +The NO_TERM_HYPERLINKS variable::) if the heuristic built into +‘libtextstyle’ does not already disable them. + + To emit a hyperlink, use code like this: + + styled_ostream_t stream = ... + ... + /* Start a hyperlink. */ + styled_ostream_set_hyperlink (stream, url, NULL); + ... + /* Emit the anchor text. This can be styled text. */ + ostream_write_str (stream, "Click here!"); + ... + /* End the current hyperlink. */ + styled_ostream_set_hyperlink (stream, NULL, NULL); + + The anchor text can be styled. But the hyperlinks themselves cannot +be styled; they behave as implemented by the terminal emulator. + + +File: libtextstyle.info, Node: Include files, Next: Link options, Prev: Basic use, Up: The programmer's view + +3.2 Include files +================= + + The include file ‘’ declares all facilities defined by +the library. + + +File: libtextstyle.info, Node: Link options, Next: Command-line options, Prev: Include files, Up: The programmer's view + +3.3 Link options +================ + + The library to link with is called ‘libtextstyle’, with a +system-dependent suffix. You link with it though link options of the +form ‘-ltextstyle’ for a library installed in system locations, or +‘-LLIBDIR -ltextstyle’ for a static library installed in other +locations, or ‘-LLIBDIR -ltextstyle -Wl,-rpath,LIBDIR’ for a shared +library installed in other locations (assuming a GCC compatible compiler +and linker and no ‘libtool’), or ‘-LLIBDIR -ltextstyle -RLIBDIR’ for a +shared library installed in other locations (with ‘libtool’). +Additionally, the link options may need to include the dependencies: +‘-lm’, and ‘-lncurses’ or (on NetBSD) ‘-ltermcap’ or (on AIX) +‘-lxcurses’ or (on HP-UX) ‘-lcurses’, and on some systems also +‘-liconv’. + + It is a bit complicated to determine the right link options in a +portable way. Therefore an Autoconf macro is provided in the file +‘libtextstyle.m4’ in Gnulib, that makes this task easier. Assuming the +build system of your package is based on GNU Autoconf, you invoke it +through ‘gl_LIBTEXTSTYLE’. It searches for an installed ‘libtextstyle’. +If found, it sets and AC_SUBSTs ‘HAVE_LIBTEXTSTYLE=yes’ and the +‘LIBTEXTSTYLE’ and ‘LTLIBTEXTSTYLE’ variables, and augments the +‘CPPFLAGS’ variable, and #defines ‘HAVE_LIBTEXTSTYLE’ to 1. Otherwise, +it sets and AC_SUBSTs ‘HAVE_LIBTEXTSTYLE=no’ and ‘LIBTEXTSTYLE’ and +‘LTLIBTEXTSTYLE’ to empty. In link commands that use ‘libtool’, use +‘LTLIBTEXTSTYLE’; in link commands that don't use ‘libtool’, use +‘LIBTEXTSTYLE’. + + If you use GNU Automake, the proper place to use the link options is +‘PROGRAM_LDADD’ for programs and ‘LIBRARY_LIBADD’ for libraries. + + +File: libtextstyle.info, Node: Command-line options, Next: The output stream hierarchy, Prev: Link options, Up: The programmer's view + +3.4 Command-line options +======================== + + While you are free to provide any command-line option to enable the +styling of the output, it is good if different GNU programs use the same +command-line options for this purpose. These options are described in +the sections *note The --color option:: and *note The --style option::. +To achieve this, use the following API (declared in ‘’): + + -- Variable: bool color_test_mode + True if a ‘--color’ option with value ‘test’ has been seen. + + -- Variable: enum color_option color_mode + Stores the value of the ‘--color’ option. + + -- Variable: const char * style_file_name + Stores the value of the ‘--style’ option. + + Note: These variables, like any variables exported from shared +libraries, can only be used in executable code. You _cannot_ portably +use their address in initializers of global or static variables. This +is a restriction that is imposed by the Windows, Cygwin, and Android +platforms. + + -- Function: bool handle_color_option (const char *OPTION) + You invoke this function when, during argument parsing, you have + encountered a ‘--color’ or ‘--color=...’ option. The return value + is an error indicator: ‘true’ means an invalid option. + + -- Function: void handle_style_option (const char *OPTION) + You invoke this function when, during argument parsing, you have + encountered a ‘--style’ or ‘--style=...’ option. + + -- Function: void print_color_test (void) + Prints a color test page. You invoke this function after argument + parsing, when the ‘color_test_mode’ variable is true. + + -- Function: void style_file_prepare (const char *STYLE_FILE_ENVVAR, + const char *STYLESDIR_ENVVAR, + const char *STYLESDIR_AFTER_INSTALL, + const char *DEFAULT_STYLE_FILE) + Assigns a default value to ‘style_file_name’ if necessary. You + invoke this function after argument parsing, when ‘color_test_mode’ + is false. + + ‘STYLE_FILE_ENVVAR’ is an environment variable that, when set to a + non-empty value, specifies the style file to use. This environment + variable is meant to be set by the user. + + ‘STYLESDIR_ENVVAR’ is an environment variable that, when set to a + non-empty value, specifies the directory with the style files, or + ‘NULL’. This is necessary for running the testsuite before ‘make + install’. + + ‘STYLESDIR_AFTER_INSTALL’ is the directory with the style files + after ‘make install’. + + ‘DEFAULT_STYLE_FILE’ is the file name of the default style file, + relative to STYLESDIR. + + +File: libtextstyle.info, Node: The output stream hierarchy, Next: Debugging the styling code, Prev: Command-line options, Up: The programmer's view + +3.5 The output stream hierarchy +=============================== + + There are various classes of output streams, some of them with +styling support. These "classes" are defined in an object-oriented +programming style that resembles C++ or Java, but are actually +implemented in C with a little bit of object orientation syntax. These +definitions are preprocessed down to C. As a consequence, GNU +libtextstyle is a C library and does not need to link with the C++ +standard library. + + All these classes are declared in ‘’. + + The base output stream type is ‘ostream_t’. It is a pointer type to +a (hidden) implementation type. Similarly for the subclasses. + + When we say that ‘some_ostream_t’ is a subclass of ‘ostream_t’, what +we mean is: + • Every ‘some_ostream_t’ object can be converted to an ‘ostream_t’, + by virtue of a simple assignment. No cast is needed. + • The opposite conversion, from ‘ostream_t’ to ‘some_ostream_t’, can + also be performed, provided that the object is actually an instance + of ‘some_ostream_t’. You can test whether an object is an instance + of ‘some_ostream_t’ by invoking the method ‘bool + is_instance_of_some_ostream (ostream_t stream)’. + • Every method ‘ostream_FOOBAR’ exists also as a method + ‘some_ostream_FOOBAR’ with compatible argument types and a + compatible return type. + +* Menu: + +* The ostream class:: +* The styled_ostream class:: +* ostream subclasses without styling:: +* styled_ostream subclasses:: +* Accessors:: + + +File: libtextstyle.info, Node: The ostream class, Next: The styled_ostream class, Up: The output stream hierarchy + +3.5.1 The abstract ‘ostream’ class +---------------------------------- + + The base output stream type is ‘ostream_t’. + + It has the following methods: + + -- Function: void ostream_write_mem (ostream_t STREAM, + const void *DATA, size_t LEN) + Writes a sequence of bytes to a stream. + + -- Function: void ostream_write_str (ostream_t STREAM, + const char *STRING) + Writes a string's contents to a stream. + + -- Function: ptrdiff_t ostream_printf (ostream_t STREAM, + const char *FORMAT, ...) + -- Function: ptrdiff_t ostream_vprintf (ostream_t STREAM, + const char *FORMAT, va_list args) + Writes formatted output to a stream. + + These functions return the size of formatted output, or a negative + value in case of an error. + + -- Function: void ostream_flush (ostream_t STREAM, + ostream_flush_scope_t SCOPE) + Brings buffered data to its destination. + + -- Function: void ostream_free (ostream_t STREAM) + Closes and frees a stream. + + +File: libtextstyle.info, Node: The styled_ostream class, Next: ostream subclasses without styling, Prev: The ostream class, Up: The output stream hierarchy + +3.5.2 The abstract ‘styled_ostream’ class +----------------------------------------- + + The type for a styled output stream is ‘styled_ostream_t’. It is a +subclass of ‘ostream_t’ that adds the following methods: + + -- Function: void styled_ostream_begin_use_class + (styled_ostream_t STREAM, const char *CLASSNAME) + Starts a run of text belonging to ‘CLASSNAME’. The ‘CLASSNAME’ is + the name of a CSS class. It can be chosen arbitrarily and + customized through the CSS file. + + -- Function: void styled_ostream_end_use_class + (styled_ostream_t STREAM, const char *CLASSNAME) + Ends a run of text belonging to ‘CLASSNAME’. The + ‘styled_ostream_begin_use_class’ / ‘styled_ostream_end_use_class’ + calls must match properly. + + -- Function: const char * styled_ostream_get_hyperlink_ref + (styled_ostream_t STREAM) + Returns the referred URL of the currently set hyperlink, or ‘NULL’ + if no hyperlink attribute is currently set. + + Note: The returned string is only valid up to the next invocation + of ‘styled_ostream_set_hyperlink’. + + -- Function: const char * styled_ostream_get_hyperlink_id + (styled_ostream_t STREAM) + Returns the id of the currently set hyperlink, or ‘NULL’ if no + hyperlink attribute is currently set. + + Note: The returned string is only valid up to the next invocation + of ‘styled_ostream_set_hyperlink’. + + -- Function: void styled_ostream_set_hyperlink + (styled_ostream_t STREAM, const char *REF, const char *ID) + Sets or removes a hyperlink attribute. + + To set a hyperlink attribute, pass a non-‘NULL’ REF. REF is an + URL; it should be at most 2083 bytes long. Non-ASCII characters + should be URI-escaped (using the %nn syntax). ID is an optional + identifier. On terminal output, multiple hyperlinks with the same + ID will be highlighted together. If specified, ID should be at + most 250 bytes long. + + To remove a hyperlink attribute, pass ‘NULL’ for REF and ID. + + Hyperlinks don't nest. That is, a hyperlink attribute is enabled + only up to the next invocation of ‘styled_ostream_set_hyperlink’. + + -- Function: void styled_ostream_flush_to_current_style + (styled_ostream_t STREAM) + This function acts like ‘ostream_flush (STREAM, + FLUSH_THIS_STREAM)’, except that it leaves the destination with the + current text style enabled, instead of with the default text style. + + After calling this function, you can output strings without + newlines(!) to the underlying stream, and they will be rendered + like strings passed to ‘ostream_write_mem’, ‘ostream_write_str’, or + ‘ostream_printf’. + + +File: libtextstyle.info, Node: ostream subclasses without styling, Next: styled_ostream subclasses, Prev: The styled_ostream class, Up: The output stream hierarchy + +3.5.3 Concrete ostream subclasses without styling +------------------------------------------------- + +* Menu: + +* The file_ostream class:: Output to a FILE stream. +* The fd_ostream class:: Output to a file descriptor. +* The term_ostream class:: Output to a terminal. +* The html_ostream class:: Output to an HTML file. +* The memory_ostream class:: Output to a memory buffer, +* The iconv_ostream class:: Output with character encoding conversion. + + +File: libtextstyle.info, Node: The file_ostream class, Next: The fd_ostream class, Up: ostream subclasses without styling + +3.5.3.1 The ‘file_ostream’ class +................................ + + The ‘file_ostream’ class supports output to an ‘’ ‘FILE’ +stream. Its type is ‘file_ostream_t’. It is a subclass of ‘ostream_t’ +that adds no methods. + + It can be instantiated through this function: + + -- Function: file_ostream_t file_ostream_create (FILE *FP) + Creates an output stream referring to ‘FP’. + + Note: The resulting stream must be closed before ‘FP’ can be + closed. + + +File: libtextstyle.info, Node: The fd_ostream class, Next: The term_ostream class, Prev: The file_ostream class, Up: ostream subclasses without styling + +3.5.3.2 The ‘fd_ostream’ class +.............................. + + The ‘file_ostream’ class supports output to a file descriptor. Its +type is ‘fd_ostream_t’. It is a subclass of ‘ostream_t’ that adds no +methods. + + It can be instantiated through this function: + + -- Function: fd_ostream_t fd_ostream_create (int FD, + const char *FILENAME, bool BUFFERED) + Creates an output stream referring to the file descriptor ‘FD’. + + ‘FILENAME’ is used only for error messages. + + Note: The resulting stream must be closed before ‘FD’ can be + closed. + + +File: libtextstyle.info, Node: The term_ostream class, Next: The html_ostream class, Prev: The fd_ostream class, Up: ostream subclasses without styling + +3.5.3.3 The ‘term_ostream’ class +................................ + + The ‘term_ostream’ class supports output to a file descriptor that is +connected to a terminal emulator or console. Its type is +‘term_ostream_t’. It is a subclass of ‘ostream_t’. + + It can be instantiated through this function: + + -- Function: term_ostream_t term_ostream_create (int FD, + const char *FILENAME, ttyctl_t TTY_CONTROL) + Creates an output stream referring to the file descriptor ‘FD’. + + ‘FILENAME’ is used only for error messages. + + ‘TTY_CONTROL’ specifies the amount of control to take over the + underlying tty. + + The resulting stream will be line-buffered. + + Note: The resulting stream must be closed before ‘FD’ can be + closed. + + The class adds the following methods: + + -- Function: term_color_t term_ostream_rgb_to_color + (term_ostream_t STREAM, int RED, int GREEN, int BLUE) + Converts an RGB value (‘RED’, ‘GREEN’, ‘BLUE’ in [0..255]) to a + color, valid for this stream only. + + -- Function: term_color_t term_ostream_get_color + (term_ostream_t STREAM) + -- Function: void term_ostream_set_color (term_ostream_t STREAM, + term_color_t COLOR) + Gets/sets the text color. + + -- Function: term_color_t term_ostream_get_bgcolor + (term_ostream_t STREAM) + -- Function: void term_ostream_set_bgcolor (term_ostream_t STREAM, + term_color_t COLOR) + Gets/sets the background color. + + -- Function: term_weight_t term_ostream_get_weight + (term_ostream_t STREAM) + -- Function: void term_ostream_set_weight (term_ostream_t STREAM, + term_weight_t WEIGHT) + Gets/sets the font weight. + + -- Function: term_posture_t term_ostream_get_posture + (term_ostream_t STREAM) + -- Function: void term_ostream_set_posture (term_ostream_t STREAM, + term_posture_t POSTURE) + Gets/sets the font posture. + + -- Function: term_underline_t term_ostream_get_underline + (term_ostream_t STREAM) + -- Function: void term_ostream_set_underline (term_ostream_t STREAM, + term_underline_t UNDERLINE) + Gets/sets the text underline decoration. + + -- Function: const char * term_ostream_get_hyperlink_ref + (term_ostream_t STREAM) + Returns the referred URL of the currently set hyperlink, or ‘NULL’ + if no hyperlink attribute is currently set. + + Note: The returned string is only valid up to the next invocation + of ‘term_ostream_set_hyperlink’. + + -- Function: const char * term_ostream_get_hyperlink_id + (term_ostream_t STREAM) + Returns the id of the currently set hyperlink, or ‘NULL’ if no + hyperlink attribute is currently set. + + Note: The returned string is only valid up to the next invocation + of ‘term_ostream_set_hyperlink’. + + -- Function: void term_ostream_set_hyperlink (term_ostream_t STREAM, + const char *REF, const char *ID) + Sets or removes a hyperlink attribute. + + To set a hyperlink attribute, pass a non-‘NULL’ REF. REF is an + URL; it should be at most 2083 bytes long. Non-ASCII characters + should be URI-escaped (using the %nn syntax). ID is an optional + identifier. Multiple hyperlinks with the same ID will be + highlighted together. If specified, ID should be at most 250 bytes + long. + + To remove a hyperlink attribute, pass ‘NULL’ for REF and ID. + + Hyperlinks don't nest. That is, a hyperlink attribute is enabled + only up to the next invocation of ‘styled_ostream_set_hyperlink’. + + -- Function: void term_ostream_flush_to_current_style + (term_ostream_t STREAM) + This function acts like ‘ostream_flush (STREAM, + FLUSH_THIS_STREAM)’, except that it leaves the terminal with the + current text attributes enabled, instead of with the default text + attributes. + + After calling this function, you can output strings without + newlines(!) to the underlying file descriptor, and they will be + rendered like strings passed to ‘ostream_write_mem’, + ‘ostream_write_str’, or ‘ostream_printf’. + + +File: libtextstyle.info, Node: The html_ostream class, Next: The memory_ostream class, Prev: The term_ostream class, Up: ostream subclasses without styling + +3.5.3.4 The ‘html_ostream’ class +................................ + + The ‘html_ostream’ class supports output to any destination, in HTML +syntax. Its type is ‘html_ostream_t’. It is a subclass of ‘ostream_t’. + + It can be instantiated through this function: + + -- Function: html_ostream_t html_ostream_create (ostream_t DESTINATION) + Creates an output stream that takes input in the UTF-8 encoding and + writes it in HTML form on ‘DESTINATION’. + + This stream produces a sequence of lines. The caller is + responsible for opening the ‘’ elements before and for + closing them after the use of this stream. + + Note: The resulting stream must be closed before ‘DESTINATION’ can + be closed. + + The class adds the following methods: + + -- Function: void html_ostream_begin_span (html_ostream_t STREAM, + const char *CLASSNAME) + Starts a ‘’ element. The ‘CLASSNAME’ is + the name of a CSS class. It can be chosen arbitrarily and + customized through the CSS file. + + -- Function: void html_ostream_end_span (html_ostream_t STREAM, + const char *CLASSNAME) + Ends a ‘’ element. + + The ‘html_ostream_begin_span’ / ‘html_ostream_end_span’ calls must + match properly. + + -- Function: const char * html_ostream_get_hyperlink_ref + (html_ostream_t STREAM) + Returns the referred URL of the currently set hyperlink, or ‘NULL’ + if no hyperlink attribute is currently set. + + Note: The returned string is only valid up to the next invocation + of ‘html_ostream_set_hyperlink_ref’. + + -- Function: void html_ostream_set_hyperlink_ref + (html_ostream_t STREAM, const char *REF) + Sets or removes a hyperlink attribute. + + To set a hyperlink attribute, pass a non-‘NULL’ REF. REF is an + URL; it should be at most 2083 bytes long. Non-ASCII characters + should be URI-escaped (using the %nn syntax). + + To remove a hyperlink attribute, pass ‘NULL’ for REF. + + Hyperlinks don't nest. That is, a hyperlink attribute is enabled + only up to the next invocation of ‘html_ostream_set_hyperlink_ref’. + + -- Function: void html_ostream_flush_to_current_style + (html_ostream_t STREAM) + This function acts like ‘ostream_flush (STREAM, + FLUSH_THIS_STREAM)’, except that it leaves the destination with the + current text style enabled, instead of with the default text style. + + After calling this function, you can output strings without + newlines(!) to the underlying stream, and they will be rendered + like strings passed to ‘ostream_write_mem’, ‘ostream_write_str’, or + ‘ostream_printf’. + + +File: libtextstyle.info, Node: The memory_ostream class, Next: The iconv_ostream class, Prev: The html_ostream class, Up: ostream subclasses without styling + +3.5.3.5 The ‘memory_ostream’ class +.................................. + + The ‘memory_ostream’ class supports output to an in-memory buffer. +Its type is ‘memory_ostream_t’. It is a subclass of ‘ostream_t’. + + It can be instantiated through this function: + + -- Function: memory_ostream_t memory_ostream_create (void) + Creates an output stream that accumulates the output in a memory + buffer. + + The class adds the following method: + + -- Function: void memory_ostream_contents (memory_ostream_t STREAM, + const void **BUFP, size_t *BUFLENP) + Returns a pointer to the output accumulated so far and its size. + It stores them in ‘*BUFP’ and ‘*BUFLENP’, respectively. + + Note: These two return values become invalid when more output is + done to the stream or when the stream is freed. + + +File: libtextstyle.info, Node: The iconv_ostream class, Prev: The memory_ostream class, Up: ostream subclasses without styling + +3.5.3.6 The ‘iconv_ostream’ class +................................. + + The ‘iconv_ostream’ class supports output to any destination. Its +type is ‘iconv_ostream_t’. It is a subclass of ‘ostream_t’ that adds no +methods. + + It can be instantiated through this function: + + -- Function: iconv_ostream_t iconv_ostream_create + (const char *FROM_ENCODING, const char *TO_ENCODING, + ostream_t DESTINATION) + Creates an output stream that converts from ‘FROM_ENCODING’ to + ‘TO_ENCODING’, writing the result to ‘DESTINATION’. + + Note: The resulting stream must be closed before ‘DESTINATION’ can + be closed. + + +File: libtextstyle.info, Node: styled_ostream subclasses, Next: Accessors, Prev: ostream subclasses without styling, Up: The output stream hierarchy + +3.5.4 Concrete ‘styled_ostream’ subclasses +------------------------------------------ + +* Menu: + +* The term_styled_ostream class:: Styled output to a terminal. +* The html_styled_ostream class:: Styled output to an HTML file. +* The noop_styled_ostream class:: No-op styling. + + +File: libtextstyle.info, Node: The term_styled_ostream class, Next: The html_styled_ostream class, Up: styled_ostream subclasses + +3.5.4.1 The ‘term_styled_ostream’ class +....................................... + + The ‘term_styled_ostream’ class supports styled output to a file +descriptor that is connected to a terminal emulator or console. Its +type is ‘term_styled_ostream_t’. It is a subclass of +‘styled_ostream_t’. + + It can be instantiated through this function: + + -- Function: term_styled_ostream_t term_styled_ostream_create (int FD, + const char *FILENAME, ttyctl_t TTY_CONTROL, + const char *CSS_FILENAME) + Creates an output stream referring to the file descriptor ‘FD’, + styled with the file ‘CSS_FILENAME’. + + ‘FILENAME’ is used only for error messages. + + ‘TTY_CONTROL’ specifies the amount of control to take over the + underlying tty. + + Note: The resulting stream must be closed before ‘FD’ can be + closed. + + Returns ‘NULL’ upon failure. + + The following is a variant of this function. Upon failure, it does +not return ‘NULL’; instead, it returns a styled ‘fd_stream’ on which the +styling operations exist but are no-ops. + + -- Function: styled_ostream_t styled_ostream_create (int FD, + const char *FILENAME, ttyctl_t TTY_CONTROL, + const char *CSS_FILENAME) + Creates an output stream referring to the file descriptor ‘FD’, + styled with the file ‘CSS_FILENAME’ if possible. + + ‘FILENAME’ is used only for error messages. + + ‘TTY_CONTROL’ specifies the amount of control to take over the + underlying tty. + + Note: The resulting stream must be closed before ‘FD’ can be + closed. + + +File: libtextstyle.info, Node: The html_styled_ostream class, Next: The noop_styled_ostream class, Prev: The term_styled_ostream class, Up: styled_ostream subclasses + +3.5.4.2 The ‘html_styled_ostream’ class +....................................... + + The ‘html_styled_ostream’ class supports styled output to any +destination, in HTML syntax. Its type is ‘html_styled_ostream_t’. It +is a subclass of ‘styled_ostream_t’. + + It can be instantiated through this function: + + -- Function: html_styled_ostream_t html_styled_ostream_create + (ostream_t DESTINATION, const char *CSS_FILENAME) + Creates an output stream that takes input in the UTF-8 encoding and + writes it in HTML form on ‘DESTINATION’, styled with the file + ‘CSS_FILENAME’. + + Note: The resulting stream must be closed before ‘DESTINATION’ can + be closed. + + +File: libtextstyle.info, Node: The noop_styled_ostream class, Prev: The html_styled_ostream class, Up: styled_ostream subclasses + +3.5.4.3 The ‘noop_styled_ostream’ class +....................................... + + The ‘noop_styled_ostream’ class supports the styled output operations +to any destination. The text is output to the given destination; the +styling operations, however, do nothing. Its type is +‘noop_styled_ostream_t’. It is a subclass of ‘styled_ostream_t’. + + It can be instantiated through this function: + + -- Function: noop_styled_ostream_t noop_styled_ostream_create + (ostream_t DESTINATION, bool PASS_OWNERSHIP) + Creates an output stream that delegates to ‘DESTINATION’ and that + supports the styling operations as no-ops. + + If ‘PASS_OWNERSHIP’ is ‘true’, closing the resulting stream will + automatically close the ‘DESTINATION’. + + Note: If ‘PASS_OWNERSHIP’ is ‘false’, the resulting stream must be + closed before ‘DESTINATION’ can be closed. + + +File: libtextstyle.info, Node: Accessors, Prev: styled_ostream subclasses, Up: The output stream hierarchy + +3.5.5 Accessor functions +------------------------ + + The various concrete stream classes have methods that allow you to +retrieve the arguments passed to the respective constructor function. + + Note: While these methods allow you to retrieve the underlying +destination stream of various kinds of stream, it is not recommended to +operate on both the stream and its underlying destination stream at the +same time. Doing so can lead to undesired interactions between the two +streams. + + The ‘file_ostream’ class has this accessor method: + + -- Function: FILE * file_ostream_get_stdio_stream + (file_ostream_t STREAM) + + The ‘fd_ostream’ class has these accessor methods: + + -- Function: int fd_ostream_get_descriptor (fd_ostream_t STREAM) + -- Function: const char * fd_ostream_get_filename (fd_ostream_t STREAM) + -- Function: bool fd_ostream_is_buffered (fd_ostream_t STREAM) + + The ‘term_ostream’ class has these accessor methods: + + -- Function: int term_ostream_get_descriptor (term_ostream_t STREAM) + -- Function: const char * term_ostream_get_filename + (term_ostream_t STREAM) + -- Function: ttyctl_t term_ostream_get_tty_control + (term_ostream_t STREAM) + -- Function: ttyctl_t term_ostream_get_effective_tty_control + (term_ostream_t STREAM) + Returns the effective tty control of the stream (not + ‘TTYCTL_AUTO’). + + The ‘iconv_ostream’ class has these accessor methods: + + -- Function: const char * iconv_ostream_get_from_encoding + (iconv_ostream_t STREAM) + -- Function: const char * iconv_ostream_get_to_encoding + (iconv_ostream_t STREAM) + -- Function: ostream_t iconv_ostream_get_destination + (iconv_ostream_t STREAM) + + The ‘html_ostream’ class has this accessor method: + + -- Function: ostream_t html_ostream_get_destination + (html_ostream_t STREAM) + + The ‘term_styled_ostream’ class has these accessor methods: + + -- Function: term_ostream_t term_styled_ostream_get_destination + (term_styled_ostream_t STREAM) + -- Function: const char * term_styled_ostream_get_css_filename + (term_styled_ostream_t STREAM) + + The ‘html_styled_ostream’ class has these accessor methods: + + -- Function: ostream_t html_styled_ostream_get_destination + (html_styled_ostream_t STREAM) + -- Function: html_ostream_t html_styled_ostream_get_html_destination + (html_styled_ostream_t STREAM) + -- Function: const char * html_styled_ostream_get_css_filename + (html_styled_ostream_t STREAM) + + The ‘noop_styled_ostream’ class has these accessor methods: + + -- Function: ostream_t noop_styled_ostream_get_destination + (noop_styled_ostream_t STREAM) + -- Function: bool noop_styled_ostream_is_owning_destination + (noop_styled_ostream_t STREAM) + + +File: libtextstyle.info, Node: Debugging the styling code, Next: What to document, Prev: The output stream hierarchy, Up: The programmer's view + +3.6 Debugging the text styling support +====================================== + + If you want to understand which output of your program is associated +with which CSS classes, the simplest way is as follows: + + 1. Run the program with the command-line option ‘--color=html’, + redirecting the output to a file. + 2. Then inspect this output. Text regions associated with a CSS class + are surrounded by ‘’...‘’. + + +File: libtextstyle.info, Node: What to document, Prev: Debugging the styling code, Up: The programmer's view + +3.7 Documenting the text styling support +======================================== + + To make the text styling support available to the end user of your +package, the following need to be documented: + • The command-line options. This typically needs to be done in + several places: in the ‘--help’ output, in the ‘man’ pages (if + present), and in the documentation. + • Which programs support ‘--color=test’? + • The list of CSS classes and their meaning. This is necessary, so + that the user can create their own style file; the CSS classes are + part of the selectors in the CSS rules. + • The location of the default style file. This is a convenience, so + that the user, when creating their own style file, can start from + the default one. + • The environment variable, called ‘STYLE_FILE_ENVVAR’ above, that, + when set to a non-empty value, specifies the style file to use. + + +File: libtextstyle.info, Node: Licenses, Next: Function Index, Prev: The programmer's view, Up: Top + +Appendix A Licenses +******************* + + The files of this package are covered by the licenses indicated in +each particular file or directory. Here is a summary: + + • The ‘libtextstyle’ library and the example programs are covered by + the GNU General Public License (GPL). A copy of the license is + included in *note GNU GPL::. + + • This manual is free documentation. It is dually licensed under the + GNU FDL and the GNU GPL. This means that you can redistribute this + manual under either of these two licenses, at your choice. + This manual is covered by the GNU FDL. Permission is granted to + copy, distribute and/or modify this document under the terms of the + GNU Free Documentation License (FDL), either version 1.2 of the + License, or (at your option) any later version published by the + Free Software Foundation (FSF); with no Invariant Sections, with no + Front-Cover Text, and with no Back-Cover Texts. A copy of the + license is included in *note GNU FDL::. + This manual is covered by the GNU GPL. You can redistribute it + and/or modify it under the terms of the GNU General Public License + (GPL), either version 3 of the License, or (at your option) any + later version published by the Free Software Foundation (FSF). A + copy of the license is included in *note GNU GPL::. + +* Menu: + +* GNU GPL:: GNU General Public License +* GNU FDL:: GNU Free Documentation License + + +File: libtextstyle.info, Node: GNU GPL, Next: GNU FDL, Up: Licenses + +A.1 GNU GENERAL PUBLIC LICENSE +============================== + + Version 3, 29 June 2007 + + Copyright © 2007 Free Software Foundation, Inc. + + Everyone is permitted to copy and distribute verbatim copies of this + license document, but changing it is not allowed. + +Preamble +======== + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + +TERMS AND CONDITIONS +==================== + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public + License. + + "Copyright" also means copyright-like laws that apply to other + kinds of works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this + License. Each licensee is addressed as "you". "Licensees" and + "recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the + work in a fashion requiring copyright permission, other than the + making of an exact copy. The resulting work is called a "modified + version" of the earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work + based on the Program. + + To "propagate" a work means to do anything with it that, without + permission, would make you directly or secondarily liable for + infringement under applicable copyright law, except executing it on + a computer or modifying a private copy. Propagation includes + copying, distribution (with or without modification), making + available to the public, and in some countries other activities as + well. + + To "convey" a work means any kind of propagation that enables other + parties to make or receive copies. Mere interaction with a user + through a computer network, with no transfer of a copy, is not + conveying. + + An interactive user interface displays "Appropriate Legal Notices" + to the extent that it includes a convenient and prominently visible + feature that (1) displays an appropriate copyright notice, and (2) + tells the user that there is no warranty for the work (except to + the extent that warranties are provided), that licensees may convey + the work under this License, and how to view a copy of this + License. If the interface presents a list of user commands or + options, such as a menu, a prominent item in the list meets this + criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work + for making modifications to it. "Object code" means any non-source + form of a work. + + A "Standard Interface" means an interface that either is an + official standard defined by a recognized standards body, or, in + the case of interfaces specified for a particular programming + language, one that is widely used among developers working in that + language. + + The "System Libraries" of an executable work include anything, + other than the work as a whole, that (a) is included in the normal + form of packaging a Major Component, but which is not part of that + Major Component, and (b) serves only to enable use of the work with + that Major Component, or to implement a Standard Interface for + which an implementation is available to the public in source code + form. A "Major Component", in this context, means a major + essential component (kernel, window system, and so on) of the + specific operating system (if any) on which the executable work + runs, or a compiler used to produce the work, or an object code + interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all + the source code needed to generate, install, and (for an executable + work) run the object code and to modify the work, including scripts + to control those activities. However, it does not include the + work's System Libraries, or general-purpose tools or generally + available free programs which are used unmodified in performing + those activities but which are not part of the work. For example, + Corresponding Source includes interface definition files associated + with source files for the work, and the source code for shared + libraries and dynamically linked subprograms that the work is + specifically designed to require, such as by intimate data + communication or control flow between those subprograms and other + parts of the work. + + The Corresponding Source need not include anything that users can + regenerate automatically from other parts of the Corresponding + Source. + + The Corresponding Source for a work in source code form is that + same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of + copyright on the Program, and are irrevocable provided the stated + conditions are met. This License explicitly affirms your unlimited + permission to run the unmodified Program. The output from running + a covered work is covered by this License only if the output, given + its content, constitutes a covered work. This License acknowledges + your rights of fair use or other equivalent, as provided by + copyright law. + + You may make, run and propagate covered works that you do not + convey, without conditions so long as your license otherwise + remains in force. You may convey covered works to others for the + sole purpose of having them make modifications exclusively for you, + or provide you with facilities for running those works, provided + that you comply with the terms of this License in conveying all + material for which you do not control copyright. Those thus making + or running the covered works for you must do so exclusively on your + behalf, under your direction and control, on terms that prohibit + them from making any copies of your copyrighted material outside + their relationship with you. + + Conveying under any other circumstances is permitted solely under + the conditions stated below. Sublicensing is not allowed; section + 10 makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological + measure under any applicable law fulfilling obligations under + article 11 of the WIPO copyright treaty adopted on 20 December + 1996, or similar laws prohibiting or restricting circumvention of + such measures. + + When you convey a covered work, you waive any legal power to forbid + circumvention of technological measures to the extent such + circumvention is effected by exercising rights under this License + with respect to the covered work, and you disclaim any intention to + limit operation or modification of the work as a means of + enforcing, against the work's users, your or third parties' legal + rights to forbid circumvention of technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you + receive it, in any medium, provided that you conspicuously and + appropriately publish on each copy an appropriate copyright notice; + keep intact all notices stating that this License and any + non-permissive terms added in accord with section 7 apply to the + code; keep intact all notices of the absence of any warranty; and + give all recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, + and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to + produce it from the Program, in the form of source code under the + terms of section 4, provided that you also meet all of these + conditions: + + a. The work must carry prominent notices stating that you + modified it, and giving a relevant date. + + b. The work must carry prominent notices stating that it is + released under this License and any conditions added under + section 7. This requirement modifies the requirement in + section 4 to "keep intact all notices". + + c. You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable + section 7 additional terms, to the whole of the work, and all + its parts, regardless of how they are packaged. This License + gives no permission to license the work in any other way, but + it does not invalidate such permission if you have separately + received it. + + d. If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has + interactive interfaces that do not display Appropriate Legal + Notices, your work need not make them do so. + + A compilation of a covered work with other separate and independent + works, which are not by their nature extensions of the covered + work, and which are not combined with it such as to form a larger + program, in or on a volume of a storage or distribution medium, is + called an "aggregate" if the compilation and its resulting + copyright are not used to limit the access or legal rights of the + compilation's users beyond what the individual works permit. + Inclusion of a covered work in an aggregate does not cause this + License to apply to the other parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms + of sections 4 and 5, provided that you also convey the + machine-readable Corresponding Source under the terms of this + License, in one of these ways: + + a. Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b. Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that + product model, to give anyone who possesses the object code + either (1) a copy of the Corresponding Source for all the + software in the product that is covered by this License, on a + durable physical medium customarily used for software + interchange, for a price no more than your reasonable cost of + physically performing this conveying of source, or (2) access + to copy the Corresponding Source from a network server at no + charge. + + c. Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, + and only if you received the object code with such an offer, + in accord with subsection 6b. + + d. Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to + the Corresponding Source in the same way through the same + place at no further charge. You need not require recipients + to copy the Corresponding Source along with the object code. + If the place to copy the object code is a network server, the + Corresponding Source may be on a different server (operated by + you or a third party) that supports equivalent copying + facilities, provided you maintain clear directions next to the + object code saying where to find the Corresponding Source. + Regardless of what server hosts the Corresponding Source, you + remain obligated to ensure that it is available for as long as + needed to satisfy these requirements. + + e. Convey the object code using peer-to-peer transmission, + provided you inform other peers where the object code and + Corresponding Source of the work are being offered to the + general public at no charge under subsection 6d. + + A separable portion of the object code, whose source code is + excluded from the Corresponding Source as a System Library, need + not be included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means + any tangible personal property which is normally used for personal, + family, or household purposes, or (2) anything designed or sold for + incorporation into a dwelling. In determining whether a product is + a consumer product, doubtful cases shall be resolved in favor of + coverage. For a particular product received by a particular user, + "normally used" refers to a typical or common use of that class of + product, regardless of the status of the particular user or of the + way in which the particular user actually uses, or expects or is + expected to use, the product. A product is a consumer product + regardless of whether the product has substantial commercial, + industrial or non-consumer uses, unless such uses represent the + only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, + procedures, authorization keys, or other information required to + install and execute modified versions of a covered work in that + User Product from a modified version of its Corresponding Source. + The information must suffice to ensure that the continued + functioning of the modified object code is in no case prevented or + interfered with solely because modification has been made. + + If you convey an object code work under this section in, or with, + or specifically for use in, a User Product, and the conveying + occurs as part of a transaction in which the right of possession + and use of the User Product is transferred to the recipient in + perpetuity or for a fixed term (regardless of how the transaction + is characterized), the Corresponding Source conveyed under this + section must be accompanied by the Installation Information. But + this requirement does not apply if neither you nor any third party + retains the ability to install modified object code on the User + Product (for example, the work has been installed in ROM). + + The requirement to provide Installation Information does not + include a requirement to continue to provide support service, + warranty, or updates for a work that has been modified or installed + by the recipient, or for the User Product in which it has been + modified or installed. Access to a network may be denied when the + modification itself materially and adversely affects the operation + of the network or violates the rules and protocols for + communication across the network. + + Corresponding Source conveyed, and Installation Information + provided, in accord with this section must be in a format that is + publicly documented (and with an implementation available to the + public in source code form), and must require no special password + or key for unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of + this License by making exceptions from one or more of its + conditions. Additional permissions that are applicable to the + entire Program shall be treated as though they were included in + this License, to the extent that they are valid under applicable + law. If additional permissions apply only to part of the Program, + that part may be used separately under those permissions, but the + entire Program remains governed by this License without regard to + the additional permissions. + + When you convey a copy of a covered work, you may at your option + remove any additional permissions from that copy, or from any part + of it. (Additional permissions may be written to require their own + removal in certain cases when you modify the work.) You may place + additional permissions on material, added by you to a covered work, + for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material + you add to a covered work, you may (if authorized by the copyright + holders of that material) supplement the terms of this License with + terms: + + a. Disclaiming warranty or limiting liability differently from + the terms of sections 15 and 16 of this License; or + + b. Requiring preservation of specified reasonable legal notices + or author attributions in that material or in the Appropriate + Legal Notices displayed by works containing it; or + + c. Prohibiting misrepresentation of the origin of that material, + or requiring that modified versions of such material be marked + in reasonable ways as different from the original version; or + + d. Limiting the use for publicity purposes of names of licensors + or authors of the material; or + + e. Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f. Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified + versions of it) with contractual assumptions of liability to + the recipient, for any liability that these contractual + assumptions directly impose on those licensors and authors. + + All other non-permissive additional terms are considered "further + restrictions" within the meaning of section 10. If the Program as + you received it, or any part of it, contains a notice stating that + it is governed by this License along with a term that is a further + restriction, you may remove that term. If a license document + contains a further restriction but permits relicensing or conveying + under this License, you may add to a covered work material governed + by the terms of that license document, provided that the further + restriction does not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you + must place, in the relevant source files, a statement of the + additional terms that apply to those files, or a notice indicating + where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in + the form of a separately written license, or stated as exceptions; + the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly + provided under this License. Any attempt otherwise to propagate or + modify it is void, and will automatically terminate your rights + under this License (including any patent licenses granted under the + third paragraph of section 11). + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly and + finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from + that copyright holder, and you cure the violation prior to 30 days + after your receipt of the notice. + + Termination of your rights under this section does not terminate + the licenses of parties who have received copies or rights from you + under this License. If your rights have been terminated and not + permanently reinstated, you do not qualify to receive new licenses + for the same material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or + run a copy of the Program. Ancillary propagation of a covered work + occurring solely as a consequence of using peer-to-peer + transmission to receive a copy likewise does not require + acceptance. However, nothing other than this License grants you + permission to propagate or modify any covered work. These actions + infringe copyright if you do not accept this License. Therefore, + by modifying or propagating a covered work, you indicate your + acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically + receives a license from the original licensors, to run, modify and + propagate that work, subject to this License. You are not + responsible for enforcing compliance by third parties with this + License. + + An "entity transaction" is a transaction transferring control of an + organization, or substantially all assets of one, or subdividing an + organization, or merging organizations. If propagation of a + covered work results from an entity transaction, each party to that + transaction who receives a copy of the work also receives whatever + licenses to the work the party's predecessor in interest had or + could give under the previous paragraph, plus a right to possession + of the Corresponding Source of the work from the predecessor in + interest, if the predecessor has it or can get it with reasonable + efforts. + + You may not impose any further restrictions on the exercise of the + rights granted or affirmed under this License. For example, you + may not impose a license fee, royalty, or other charge for exercise + of rights granted under this License, and you may not initiate + litigation (including a cross-claim or counterclaim in a lawsuit) + alleging that any patent claim is infringed by making, using, + selling, offering for sale, or importing the Program or any portion + of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this + License of the Program or a work on which the Program is based. + The work thus licensed is called the contributor's "contributor + version". + + A contributor's "essential patent claims" are all patent claims + owned or controlled by the contributor, whether already acquired or + hereafter acquired, that would be infringed by some manner, + permitted by this License, of making, using, or selling its + contributor version, but do not include claims that would be + infringed only as a consequence of further modification of the + contributor version. For purposes of this definition, "control" + includes the right to grant patent sublicenses in a manner + consistent with the requirements of this License. + + Each contributor grants you a non-exclusive, worldwide, + royalty-free patent license under the contributor's essential + patent claims, to make, use, sell, offer for sale, import and + otherwise run, modify and propagate the contents of its contributor + version. + + In the following three paragraphs, a "patent license" is any + express agreement or commitment, however denominated, not to + enforce a patent (such as an express permission to practice a + patent or covenant not to sue for patent infringement). To "grant" + such a patent license to a party means to make such an agreement or + commitment not to enforce a patent against the party. + + If you convey a covered work, knowingly relying on a patent + license, and the Corresponding Source of the work is not available + for anyone to copy, free of charge and under the terms of this + License, through a publicly available network server or other + readily accessible means, then you must either (1) cause the + Corresponding Source to be so available, or (2) arrange to deprive + yourself of the benefit of the patent license for this particular + work, or (3) arrange, in a manner consistent with the requirements + of this License, to extend the patent license to downstream + recipients. "Knowingly relying" means you have actual knowledge + that, but for the patent license, your conveying the covered work + in a country, or your recipient's use of the covered work in a + country, would infringe one or more identifiable patents in that + country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or + arrangement, you convey, or propagate by procuring conveyance of, a + covered work, and grant a patent license to some of the parties + receiving the covered work authorizing them to use, propagate, + modify or convey a specific copy of the covered work, then the + patent license you grant is automatically extended to all + recipients of the covered work and works based on it. + + A patent license is "discriminatory" if it does not include within + the scope of its coverage, prohibits the exercise of, or is + conditioned on the non-exercise of one or more of the rights that + are specifically granted under this License. You may not convey a + covered work if you are a party to an arrangement with a third + party that is in the business of distributing software, under which + you make payment to the third party based on the extent of your + activity of conveying the work, and under which the third party + grants, to any of the parties who would receive the covered work + from you, a discriminatory patent license (a) in connection with + copies of the covered work conveyed by you (or copies made from + those copies), or (b) primarily for and in connection with specific + products or compilations that contain the covered work, unless you + entered into that arrangement, or that patent license was granted, + prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting + any implied license or other defenses to infringement that may + otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement + or otherwise) that contradict the conditions of this License, they + do not excuse you from the conditions of this License. If you + cannot convey a covered work so as to satisfy simultaneously your + obligations under this License and any other pertinent obligations, + then as a consequence you may not convey it at all. For example, + if you agree to terms that obligate you to collect a royalty for + further conveying from those to whom you convey the Program, the + only way you could satisfy both those terms and this License would + be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have + permission to link or combine any covered work with a work licensed + under version 3 of the GNU Affero General Public License into a + single combined work, and to convey the resulting work. The terms + of this License will continue to apply to the part which is the + covered work, but the special requirements of the GNU Affero + General Public License, section 13, concerning interaction through + a network will apply to the combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new + versions of the GNU General Public License from time to time. Such + new versions will be similar in spirit to the present version, but + may differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the + Program specifies that a certain numbered version of the GNU + General Public License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that numbered version or of any later version published by the Free + Software Foundation. If the Program does not specify a version + number of the GNU General Public License, you may choose any + version ever published by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future + versions of the GNU General Public License can be used, that + proxy's public statement of acceptance of a version permanently + authorizes you to choose that version for the Program. + + Later license versions may give you additional or different + permissions. However, no additional obligations are imposed on any + author or copyright holder as a result of your choosing to follow a + later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY + APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE + COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" + WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE + RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. + SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL + NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN + WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES + AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR + DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR + CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE + THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA + BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD + PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER + PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF + THE POSSIBILITY OF SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided + above cannot be given local legal effect according to their terms, + reviewing courts shall apply local law that most closely + approximates an absolute waiver of all civil liability in + connection with the Program, unless a warranty or assumption of + liability accompanies a copy of the Program in return for a fee. + +END OF TERMS AND CONDITIONS +=========================== + +How to Apply These Terms to Your New Programs +============================================= + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES. + Copyright (C) YEAR NAME OF AUTHOR + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or (at + your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + Also add information on how to contact you by electronic and paper +mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + PROGRAM Copyright (C) YEAR NAME OF AUTHOR + This program comes with ABSOLUTELY NO WARRANTY; for details type ‘show w’. + This is free software, and you are welcome to redistribute it + under certain conditions; type ‘show c’ for details. + + The hypothetical commands ‘show w’ and ‘show c’ should show the +appropriate parts of the General Public License. Of course, your +program's commands might be different; for a GUI interface, you would +use an "about box". + + You should also get your employer (if you work as a programmer) or +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. For more information on this, and how to apply and follow +the GNU GPL, see . + + The GNU General Public License does not permit incorporating your +program into proprietary programs. If your program is a subroutine +library, you may consider it more useful to permit linking proprietary +applications with the library. If this is what you want to do, use the +GNU Lesser General Public License instead of this License. But first, +please read . + + +File: libtextstyle.info, Node: GNU FDL, Prev: GNU GPL, Up: Licenses + +A.2 GNU Free Documentation License +================================== + + Version 1.3, 3 November 2008 + + Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. + + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + functional and useful document “free” in the sense of freedom: to + assure everyone the effective freedom to copy and redistribute it, + with or without modifying it, either commercially or + noncommercially. Secondarily, this License preserves for the + author and publisher a way to get credit for their work, while not + being considered responsible for modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. We + recommend this License principally for works whose purpose is + instruction or reference. + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work, in any medium, + that contains a notice placed by the copyright holder saying it can + be distributed under the terms of this License. Such a notice + grants a world-wide, royalty-free license, unlimited in duration, + to use that work under the conditions stated herein. The + "Document", below, refers to any such manual or work. Any member + of the public is a licensee, and is addressed as "you". You accept + the license if you copy, modify or distribute the work in a way + requiring permission under copyright law. + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter section + of the Document that deals exclusively with the relationship of the + publishers or authors of the Document to the Document's overall + subject (or to related matters) and contains nothing that could + fall directly within that overall subject. (Thus, if the Document + is in part a textbook of mathematics, a Secondary Section may not + explain any mathematics.) The relationship could be a matter of + historical connection with the subject or with related matters, or + of legal, commercial, philosophical, ethical or political position + regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in the + notice that says that the Document is released under this License. + If a section does not fit the above definition of Secondary then it + is not allowed to be designated as Invariant. The Document may + contain zero Invariant Sections. If the Document does not identify + any Invariant Sections then there are none. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. A + Front-Cover Text may be at most 5 words, and a Back-Cover Text may + be at most 25 words. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, that is suitable for revising the document + straightforwardly with generic text editors or (for images composed + of pixels) generic paint programs or (for drawings) some widely + available drawing editor, and that is suitable for input to text + formatters or for automatic translation to a variety of formats + suitable for input to text formatters. A copy made in an otherwise + Transparent file format whose markup, or absence of markup, has + been arranged to thwart or discourage subsequent modification by + readers is not Transparent. An image format is not Transparent if + used for any substantial amount of text. A copy that is not + "Transparent" is called "Opaque". + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and standard-conforming + simple HTML, PostScript or PDF designed for human modification. + Examples of transparent image formats include PNG, XCF and JPG. + Opaque formats include proprietary formats that can be read and + edited only by proprietary word processors, SGML or XML for which + the DTD and/or processing tools are not generally available, and + the machine-generated HTML, PostScript or PDF produced by some word + processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + The "publisher" means any person or entity that distributes copies + of the Document to the public. + + A section "Entitled XYZ" means a named subunit of the Document + whose title either is precisely XYZ or contains XYZ in parentheses + following text that translates XYZ in another language. (Here XYZ + stands for a specific section name mentioned below, such as + "Acknowledgements", "Dedications", "Endorsements", or "History".) + To "Preserve the Title" of such a section when you modify the + Document means that it remains a section "Entitled XYZ" according + to this definition. + + The Document may include Warranty Disclaimers next to the notice + which states that this License applies to the Document. These + Warranty Disclaimers are considered to be included by reference in + this License, but only as regards disclaiming warranties: any other + implication that these Warranty Disclaimers may have is void and + has no effect on the meaning of this License. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow the + conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies (or copies in media that commonly + have printed covers) of the Document, numbering more than 100, and + the Document's license notice requires Cover Texts, you must + enclose the copies in covers that carry, clearly and legibly, all + these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the title + equally prominent and visible. You may add other material on the + covers in addition. Copying with changes limited to the covers, as + long as they preserve the title of the Document and satisfy these + conditions, can be treated as verbatim copying in other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a machine-readable + Transparent copy along with each Opaque copy, or state in or with + each Opaque copy a computer-network location from which the general + network-using public has access to download using public-standard + network protocols a complete Transparent copy of the Document, free + of added material. If you use the latter option, you must take + reasonably prudent steps, when you begin distribution of Opaque + copies in quantity, to ensure that this Transparent copy will + remain thus accessible at the stated location until at least one + year after the last time you distribute an Opaque copy (directly or + through your agents or retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of copies, + to give them a chance to provide you with an updated version of the + Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with the + Modified Version filling the role of the Document, thus licensing + distribution and modification of the Modified Version to whoever + possesses a copy of it. In addition, you must do these things in + the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of previous + versions (which should, if there were any, be listed in the + History section of the Document). You may use the same title + as a previous version if the original publisher of that + version gives permission. + + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in + the Modified Version, together with at least five of the + principal authors of the Document (all of its principal + authors, if it has fewer than five), unless they release you + from this requirement. + + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + + D. Preserve all the copyright notices of the Document. + + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified + Version under the terms of this License, in the form shown in + the Addendum below. + + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + + H. Include an unaltered copy of this License. + + I. Preserve the section Entitled "History", Preserve its Title, + and add to it an item stating at least the title, year, new + authors, and publisher of the Modified Version as given on the + Title Page. If there is no section Entitled "History" in the + Document, create one stating the title, year, authors, and + publisher of the Document as given on its Title Page, then add + an item describing the Modified Version as stated in the + previous sentence. + + J. Preserve the network location, if any, given in the Document + for public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in the + "History" section. You may omit a network location for a work + that was published at least four years before the Document + itself, or if the original publisher of the version it refers + to gives permission. + + K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section + all the substance and tone of each of the contributor + acknowledgements and/or dedications given therein. + + L. Preserve all the Invariant Sections of the Document, unaltered + in their text and in their titles. Section numbers or the + equivalent are not considered part of the section titles. + + M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. + + N. Do not retitle any existing section to be Entitled + "Endorsements" or to conflict in title with any Invariant + Section. + + O. Preserve any Warranty Disclaimers. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option designate + some or all of these sections as invariant. To do this, add their + titles to the list of Invariant Sections in the Modified Version's + license notice. These titles must be distinct from any other + section titles. + + You may add a section Entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties--for example, statements of peer review or that the text + has been approved by an organization as the authoritative + definition of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end of + the list of Cover Texts in the Modified Version. Only one passage + of Front-Cover Text and one of Back-Cover Text may be added by (or + through arrangements made by) any one entity. If the Document + already includes a cover text for the same cover, previously added + by you or by arrangement made by the same entity you are acting on + behalf of, you may not add another; but you may replace the old + one, on explicit permission from the previous publisher that added + the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination all + of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice, and that you preserve all + their Warranty Disclaimers. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections Entitled + "History" in the various original documents, forming one section + Entitled "History"; likewise combine any sections Entitled + "Acknowledgements", and any sections Entitled "Dedications". You + must delete all sections Entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the documents + in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow this + License in all other respects regarding verbatim copying of that + document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of a + storage or distribution medium, is called an "aggregate" if the + copyright resulting from the compilation is not used to limit the + legal rights of the compilation's users beyond what the individual + works permit. When the Document is included in an aggregate, this + License does not apply to the other works in the aggregate which + are not themselves derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one half + of the entire aggregate, the Document's Cover Texts may be placed + on covers that bracket the Document within the aggregate, or the + electronic equivalent of covers if the Document is in electronic + form. Otherwise they must appear on printed covers that bracket + the whole aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License, and all the license notices in the + Document, and any Warranty Disclaimers, provided that you also + include the original English version of this License and the + original versions of those notices and disclaimers. In case of a + disagreement between the translation and the original version of + this License or a notice or disclaimer, the original version will + prevail. + + If a section in the Document is Entitled "Acknowledgements", + "Dedications", or "History", the requirement (section 4) to + Preserve its Title (section 1) will typically require changing the + actual title. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense, or distribute it is void, + and will automatically terminate your rights under this License. + + However, if you cease all violation of this License, then your + license from a particular copyright holder is reinstated (a) + provisionally, unless and until the copyright holder explicitly and + finally terminates your license, and (b) permanently, if the + copyright holder fails to notify you of the violation by some + reasonable means prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is + reinstated permanently if the copyright holder notifies you of the + violation by some reasonable means, this is the first time you have + received notice of violation of this License (for any work) from + that copyright holder, and you cure the violation prior to 30 days + after your receipt of the notice. + + Termination of your rights under this section does not terminate + the licenses of parties who have received copies or rights from you + under this License. If your rights have been terminated and not + permanently reinstated, receipt of a copy of some or all of the + same material does not give you any rights to use it. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + . + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If the + Document does not specify a version number of this License, you may + choose any version ever published (not as a draft) by the Free + Software Foundation. If the Document specifies that a proxy can + decide which future versions of this License can be used, that + proxy's public statement of acceptance of a version permanently + authorizes you to choose that version for the Document. + + 11. RELICENSING + + "Massive Multiauthor Collaboration Site" (or "MMC Site") means any + World Wide Web server that publishes copyrightable works and also + provides prominent facilities for anybody to edit those works. A + public wiki that anybody can edit is an example of such a server. + A "Massive Multiauthor Collaboration" (or "MMC") contained in the + site means any set of copyrightable works thus published on the MMC + site. + + "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 + license published by Creative Commons Corporation, a not-for-profit + corporation with a principal place of business in San Francisco, + California, as well as future copyleft versions of that license + published by that same organization. + + "Incorporate" means to publish or republish a Document, in whole or + in part, as part of another Document. + + An MMC is "eligible for relicensing" if it is licensed under this + License, and if all works that were first published under this + License somewhere other than this MMC, and subsequently + incorporated in whole or in part into the MMC, (1) had no cover + texts or invariant sections, and (2) were thus incorporated prior + to November 1, 2008. + + The operator of an MMC Site may republish an MMC contained in the + site under CC-BY-SA on the same site at any time before August 1, + 2009, provided the MMC is eligible for relicensing. + +ADDENDUM: How to use this License for your documents +==================================================== + + To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.3 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. + + If you have Invariant Sections, Front-Cover Texts and Back-Cover +Texts, replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with + the Front-Cover Texts being LIST, and with the Back-Cover Texts + being LIST. + + If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of free +software license, such as the GNU General Public License, to permit +their use in free software. + + +File: libtextstyle.info, Node: Function Index, Next: Variable Index, Prev: Licenses, Up: Top + +Function Index +************** + +[index] +* Menu: + +* fd_ostream_create: The fd_ostream class. (line 12) +* fd_ostream_get_descriptor: Accessors. (line 22) +* fd_ostream_get_filename: Accessors. (line 23) +* fd_ostream_is_buffered: Accessors. (line 24) +* file_ostream_create: The file_ostream class. + (line 12) +* file_ostream_get_stdio_stream: Accessors. (line 17) +* handle_color_option: Command-line options. (line 27) +* handle_style_option: Command-line options. (line 32) +* html_ostream_begin_span: The html_ostream class. + (line 24) +* html_ostream_create: The html_ostream class. + (line 11) +* html_ostream_end_span: The html_ostream class. + (line 30) +* html_ostream_flush_to_current_style: The html_ostream class. + (line 58) +* html_ostream_get_destination: Accessors. (line 49) +* html_ostream_get_hyperlink_ref: The html_ostream class. + (line 37) +* html_ostream_set_hyperlink_ref: The html_ostream class. + (line 45) +* html_styled_ostream_create: The html_styled_ostream class. + (line 12) +* html_styled_ostream_get_css_filename: Accessors. (line 65) +* html_styled_ostream_get_destination: Accessors. (line 61) +* html_styled_ostream_get_html_destination: Accessors. (line 63) +* iconv_ostream_create: The iconv_ostream class. + (line 12) +* iconv_ostream_get_destination: Accessors. (line 44) +* iconv_ostream_get_from_encoding: Accessors. (line 40) +* iconv_ostream_get_to_encoding: Accessors. (line 42) +* is_instance_of_fd_ostream: The output stream hierarchy. + (line 27) +* is_instance_of_file_ostream: The output stream hierarchy. + (line 27) +* is_instance_of_html_ostream: The output stream hierarchy. + (line 27) +* is_instance_of_html_styled_ostream: The output stream hierarchy. + (line 27) +* is_instance_of_iconv_ostream: The output stream hierarchy. + (line 27) +* is_instance_of_memory_ostream: The output stream hierarchy. + (line 27) +* is_instance_of_noop_styled_ostream: The output stream hierarchy. + (line 27) +* is_instance_of_styled_ostream: The output stream hierarchy. + (line 27) +* is_instance_of_term_ostream: The output stream hierarchy. + (line 27) +* is_instance_of_term_styled_ostream: The output stream hierarchy. + (line 27) +* memory_ostream_contents: The memory_ostream class. + (line 17) +* memory_ostream_create: The memory_ostream class. + (line 11) +* noop_styled_ostream_create: The noop_styled_ostream class. + (line 13) +* noop_styled_ostream_get_destination: Accessors. (line 70) +* noop_styled_ostream_is_owning_destination: Accessors. (line 72) +* ostream_flush: The ostream class. (line 27) +* ostream_free: The ostream class. (line 31) +* ostream_printf: The ostream class. (line 18) +* ostream_vprintf: The ostream class. (line 20) +* ostream_write_mem: The ostream class. (line 10) +* ostream_write_str: The ostream class. (line 14) +* print_color_test: Command-line options. (line 36) +* style_file_prepare: Command-line options. (line 40) +* styled_ostream_begin_use_class: The styled_ostream class. + (line 9) +* styled_ostream_create: The term_styled_ostream class. + (line 33) +* styled_ostream_end_use_class: The styled_ostream class. + (line 15) +* styled_ostream_flush_to_current_style: The styled_ostream class. + (line 53) +* styled_ostream_get_hyperlink_id: The styled_ostream class. + (line 29) +* styled_ostream_get_hyperlink_ref: The styled_ostream class. + (line 21) +* styled_ostream_set_hyperlink: The styled_ostream class. + (line 37) +* term_ostream_create: The term_ostream class. + (line 12) +* term_ostream_flush_to_current_style: The term_ostream class. + (line 95) +* term_ostream_get_bgcolor: The term_ostream class. + (line 39) +* term_ostream_get_color: The term_ostream class. + (line 33) +* term_ostream_get_descriptor: Accessors. (line 28) +* term_ostream_get_effective_tty_control: Accessors. (line 33) +* term_ostream_get_filename: Accessors. (line 29) +* term_ostream_get_hyperlink_id: The term_ostream class. + (line 71) +* term_ostream_get_hyperlink_ref: The term_ostream class. + (line 63) +* term_ostream_get_posture: The term_ostream class. + (line 51) +* term_ostream_get_tty_control: Accessors. (line 31) +* term_ostream_get_underline: The term_ostream class. + (line 57) +* term_ostream_get_weight: The term_ostream class. + (line 45) +* term_ostream_rgb_to_color: The term_ostream class. + (line 28) +* term_ostream_set_bgcolor: The term_ostream class. + (line 41) +* term_ostream_set_color: The term_ostream class. + (line 35) +* term_ostream_set_hyperlink: The term_ostream class. + (line 79) +* term_ostream_set_posture: The term_ostream class. + (line 53) +* term_ostream_set_underline: The term_ostream class. + (line 59) +* term_ostream_set_weight: The term_ostream class. + (line 47) +* term_styled_ostream_create: The term_styled_ostream class. + (line 13) +* term_styled_ostream_get_css_filename: Accessors. (line 56) +* term_styled_ostream_get_destination: Accessors. (line 54) + + +File: libtextstyle.info, Node: Variable Index, Next: Index, Prev: Function Index, Up: Top + +Variable Index +************** + +[index] +* Menu: + +* color_mode: Command-line options. (line 15) +* color_test_mode: Command-line options. (line 12) +* NO_COLOR, environment variable: The NO_COLOR variable. + (line 6) +* NO_TERM_HYPERLINKS, environment variable: The NO_TERM_HYPERLINKS variable. + (line 6) +* style_file_name: Command-line options. (line 18) +* TERM, environment variable: The TERM variable. (line 6) + + +File: libtextstyle.info, Node: Index, Prev: Variable Index, Up: Top + +General Index +************* + +[index] +* Menu: + +* --color option: The --color option. (line 6) +* --style option: The --style option. (line 6) +* : Include files. (line 6) +* Debugging: Debugging style files. (line 6) +* Debugging <1>: Debugging the styling code. + (line 6) +* FDL, GNU Free Documentation License: GNU FDL. (line 6) +* GPL, GNU General Public License: GNU GPL. (line 6) +* Include file: Include files. (line 6) +* License, GNU FDL: GNU FDL. (line 6) +* License, GNU GPL: GNU GPL. (line 6) +* Licenses: Licenses. (line 6) + + + +Tag Table: +Node: Top1342 +Node: Introduction1751 +Node: Style definitions2425 +Node: Built-in versus separate styling5107 +Node: The user's view6297 +Node: The TERM variable7317 +Node: Terminal emulators8467 +Node: Consoles10910 +Node: The NO_COLOR variable11301 +Node: The NO_TERM_HYPERLINKS variable11904 +Node: Emacs12638 +Node: The --color option13016 +Node: The --style option15029 +Node: Style rules15868 +Node: Debugging style files18773 +Node: The programmer's view19791 +Node: Basic use21051 +Node: Hyperlinks22559 +Node: Include files23893 +Node: Link options24135 +Node: Command-line options26064 +Node: The output stream hierarchy28863 +Node: The ostream class30586 +Node: The styled_ostream class31707 +Node: ostream subclasses without styling34633 +Node: The file_ostream class35277 +Node: The fd_ostream class35908 +Node: The term_ostream class36660 +Node: The html_ostream class40956 +Node: The memory_ostream class43878 +Node: The iconv_ostream class44880 +Node: styled_ostream subclasses45679 +Node: The term_styled_ostream class46116 +Node: The html_styled_ostream class47873 +Node: The noop_styled_ostream class48753 +Node: Accessors49801 +Node: Debugging the styling code52713 +Node: What to document53326 +Node: Licenses54380 +Node: GNU GPL55981 +Node: GNU FDL93526 +Node: Function Index118635 +Node: Variable Index127421 +Node: Index128150 + +End Tag Table + + +Local Variables: +coding: utf-8 +End: diff --git a/miniconda3/share/info/readline.info b/miniconda3/share/info/readline.info new file mode 100644 index 0000000000000000000000000000000000000000..33b4b45ea6ee6bb08b0b90e0e640aed166150c06 --- /dev/null +++ b/miniconda3/share/info/readline.info @@ -0,0 +1,5506 @@ +This is readline.info, produced by makeinfo version 7.1 from rlman.texi. + +This manual describes the GNU Readline Library (version 8.3, 30 December +2024), a library which aids in the consistency of user interface across +discrete programs which provide a command line interface. + + Copyright © 1988-2025 Free Software Foundation, Inc. + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts, and + no Back-Cover Texts. A copy of the license is included in the + section entitled "GNU Free Documentation License". + +INFO-DIR-SECTION Libraries +START-INFO-DIR-ENTRY +* Readline: (readline). The GNU readline library API. +END-INFO-DIR-ENTRY + + +File: readline.info, Node: Top, Next: Command Line Editing, Up: (dir) + +GNU Readline Library +******************** + +This document describes the GNU Readline Library, a utility which aids +in the consistency of user interface across discrete programs which +provide a command line interface. The Readline home page is +. + +* Menu: + +* Command Line Editing:: GNU Readline User's Manual. +* Programming with GNU Readline:: GNU Readline Programmer's Manual. +* GNU Free Documentation License:: License for copying this manual. +* Concept Index:: Index of concepts described in this manual. +* Function and Variable Index:: Index of externally visible functions + and variables. + + +File: readline.info, Node: Command Line Editing, Next: Programming with GNU Readline, Prev: Top, Up: Top + +1 Command Line Editing +********************** + +This chapter describes the basic features of the GNU command line +editing interface. + +* Menu: + +* Introduction and Notation:: Notation used in this text. +* Readline Interaction:: The minimum set of commands for editing a line. +* Readline Init File:: Customizing Readline from a user's view. +* Bindable Readline Commands:: A description of most of the Readline commands + available for binding +* Readline vi Mode:: A short description of how to make Readline + behave like the vi editor. + + +File: readline.info, Node: Introduction and Notation, Next: Readline Interaction, Up: Command Line Editing + +1.1 Introduction to Line Editing +================================ + +The following paragraphs use Emacs style to describe the notation used +to represent keystrokes. + + The text ‘C-k’ is read as 'Control-K' and describes the character +produced when the key is pressed while the Control key is depressed. + + The text ‘M-k’ is read as 'Meta-K' and describes the character +produced when the Meta key (if you have one) is depressed, and the +key is pressed (a “meta character”), then both are released. The Meta +key is labeled or
+ +

GNU History Library

+ +

This document describes the GNU History library, a programming tool that +provides a consistent user interface for recalling lines of previously +typed input. +

+ + + + +
+
+ +

1 Using History Interactively

+ + +

This chapter describes how to use the GNU History Library +interactively, from a user’s standpoint. +It should be considered a user’s guide. +For information on using the GNU History Library in your own programs, +see Programming with GNU History. +

+ + + +
+
+ +

1.1 History Expansion

+ + +

The History library +provides a history expansion feature that is similar +to the history expansion provided by csh +(also referred to as history substitution where appropriate). +This section describes the syntax used to manipulate the +history information. +

+ +

History expansions introduce words from the history list into +the input stream, making it easy to repeat commands, insert the +arguments to a previous command into the current input line, or +fix errors in previous commands quickly. +

+ +

History expansion takes place in two parts. +The first is to determine +which entry from the history list should be used during substitution. +The second is to select portions of that entry to include into the +current one. +

+

The entry selected from the history is called the event, +and the portions of that entry that are acted upon are words. +Various modifiers are available to manipulate the selected words. +The entry is split into words in the same fashion that Bash +does when reading input, +so that several words surrounded by quotes are considered one word. +The event designator selects the event, the optional +word designator selects words from the event, and +various optional modifiers are available to manipulate the +selected words. +

+

History expansions are introduced by the appearance of the +history expansion character, which is ‘!’ by default. +History expansions may appear anywhere in the input, but do not nest. +

+

History expansion implements shell-like quoting conventions: +a backslash can be used to remove the special handling for the next character; +single quotes enclose verbatim sequences of characters, and can be used to +inhibit history expansion; +and characters enclosed within double quotes may be subject to history +expansion, since backslash can escape the history expansion character, +but single quotes may not, since they are not treated specially within +double quotes. +

+ +

There is a special abbreviation for substitution, active when the +quick substitution character +(default ‘^’) +is the first character on the line. +It selects the previous history list entry, using an event designator +equivalent to !!, +and substitutes one string for another in that entry. +It is described below (see Event Designators). +This is the only history expansion that does not begin with the history +expansion character. +

+ + + +
+
+ +

1.1.1 Event Designators

+ + +

An event designator is a reference to an entry in the history list. +The event designator consists of the portion of the word beginning +with the history expansion character, and ending with the word designator +if one is present, or the end of the word. +Unless the reference is absolute, events are relative to the current +position in the history list. + +

+
+
!
+

Start a history substitution, except when followed by a space, tab, +the end of the line, or ‘=’. +

+
+
!n
+

Refer to history list entry n. +

+
+
!-n
+

Refer to the history entry minus n. +

+
+
!!
+

Refer to the previous entry. +This is a synonym for ‘!-1’. +

+
+
!string
+

Refer to the most recent command +preceding the current position in the history list +starting with string. +

+
+
!?string[?]
+

Refer to the most recent command +preceding the current position in the history list +containing string. +The trailing +‘?’ may be omitted if the string is followed immediately by +a newline. +If string is missing, this uses +the string from the most recent search; +it is an error if there is no previous search string. +

+
+
^string1^string2^
+

Quick Substitution. +Repeat the last command, replacing string1 with string2. +Equivalent to !!:s^string1^string2^. +

+
+
!#
+

The entire command line typed so far. +

+
+
+ +
+
+
+ +

1.1.2 Word Designators

+ +

Word designators are used to select desired words from the event. +They are optional; if the word designator isn’t supplied, the history +expansion uses the entire event. +A ‘:’ separates the event specification from the word designator. +It may be omitted if the word designator begins with a ‘^’, ‘$’, +‘*’, ‘-’, or ‘%’. +Words are numbered from the beginning of the line, +with the first word being denoted by 0 (zero). +That first word is usually the command word, and the arguments begin +with the second word. +Words are inserted into the current line separated by single spaces. +

+

For example, +

+
+
!!
+

designates the preceding command. +When you type this, the preceding command is repeated in toto. +

+
+
!!:$
+

designates the last word of the preceding command. +This may be shortened to !$. +

+
+
!fi:2
+

designates the second argument of the most recent command starting with +the letters fi. +

+
+ +

Here are the word designators: +

+
+
0 (zero)
+

The 0th word. +For the shell, and many other, applications, this is the command word. +

+
+
n
+

The nth word. +

+
+
^
+

The first argument: word 1. +

+
+
$
+

The last word. +This is usually the last argument, but expands to the +zeroth word if there is only one word in the line. +

+
+
%
+

The first word matched by the most recent ‘?string?’ search, +if the search string begins with a character that is part of a word. +By default, searches begin at the end of each line and proceed to the +beginning, so the first word matched is the one closest to the end of +the line. +

+
+
x-y
+

A range of words; ‘-y’ abbreviates ‘0-y’. +

+
+
*
+

All of the words, except the 0th. +This is a synonym for ‘1-$’. +It is not an error to use ‘*’ if there is just one word in the event; +it expands to the empty string in that case. +

+
+
x*
+

Abbreviates ‘x-$’. +

+
+
x-
+

Abbreviates ‘x-$’ like ‘x*’, but omits the last word. +If ‘x’ is missing, it defaults to 0. +

+
+
+ +

If a word designator is supplied without an event specification, the +previous command is used as the event, equivalent to !!. +

+
+
+
+ +

1.1.3 Modifiers

+ +

After the optional word designator, you can add a sequence of one or more +of the following modifiers, each preceded by a ‘:’. +These modify, or edit, the word or words selected from the history event. +

+
+
h
+

Remove a trailing filename component, leaving only the head. +

+
+
t
+

Remove all leading filename components, leaving the tail. +

+
+
r
+

Remove a trailing suffix of the form ‘.suffix’, leaving +the basename. +

+
+
e
+

Remove all but the trailing suffix. +

+
+
p
+

Print the new command but do not execute it. +

+ +
+
s/old/new/
+

Substitute new for the first occurrence of old in the +event line. +Any character may be used as the delimiter in place of ‘/’. +The delimiter may be quoted in old and new +with a single backslash. +If ‘&’ appears in new, it is replaced with old. +A single backslash quotes the ‘&’ in old and new. +If old is null, it is set to the last old +substituted, or, if no previous history substitutions took place, +the last string +in a !?string[?] +search. +If new is null, each matching old is deleted. +The final delimiter is optional if it is the last +character on the input line. +

+
+
&
+

Repeat the previous substitution. +

+
+
g
+
a
+

Cause changes to be applied over the entire event line. +This is used in conjunction with +‘s’, as in gs/old/new/, +or with ‘&’. +

+
+
G
+

Apply the following ‘s’ or ‘&’ modifier once to each word +in the event. +

+
+
+ +
+
+
+
+
+ +

2 Programming with GNU History

+ +

This chapter describes how to interface programs that you write +with the GNU History Library. +It should be considered a technical guide. +For information on the interactive use of GNU History, +see Using History Interactively. +

+ + +
+
+ +

2.1 Introduction to History

+ +

Many programs read input from the user a line at a time. +The GNU History library is able to keep track of those lines, +associate arbitrary data with each line, and utilize information from +previous lines when composing new ones. +

+

A programmer using the History library can use functions +to save commands on a history list, +associate arbitrary data with history list entries, +remove entries from the list, +search through the list for a line containing an arbitrary text string, +reference any entry in the list directly, +and read and write the history list from and to a file. +In addition, a history expansion function +is available which provides for a consistent user interface across +different programs. +

+

Someone using programs written with the History library has the +benefit of a consistent user interface with a set of well-known +commands for manipulating the text of previous lines and using that text +in new commands. +The basic history manipulation commands are similar to +the history substitution provided by csh. +

+

The programmer can also use the Readline library, which +includes some history manipulation by default, and has the added +advantage of command line editing. +

+

Before declaring any functions using any functionality the History +library provides in other code, an application writer should include +the file <readline/history.h> in any file that uses the +History library’s features. +It supplies declarations for all of the library’s +public functions and variables, +and declares all of the public data structures. +

+
+
+
+ +

2.2 History Storage

+ +

The history list is an array of history entries. +A history entry is declared as follows: +

+
+
typedef void *histdata_t;
+
+typedef struct _hist_entry {
+  char *line;
+  char *timestamp;
+  histdata_t data;
+} HIST_ENTRY;
+
+ +

The history list itself might therefore be declared as +

+
+
HIST_ENTRY **the_history_list;
+
+ +

The state of the History library is encapsulated into a single structure: +

+
+
/*
+ * A structure used to pass around the current state of the history.
+ */
+typedef struct _hist_state {
+  HIST_ENTRY **entries; /* Pointer to the entries themselves. */
+  int offset;           /* The location pointer within this array. */
+  int length;           /* Number of elements within this array. */
+  int size;             /* Number of slots allocated to this array. */
+  int flags;
+} HISTORY_STATE;
+
+ +

If the flags member includes HS_STIFLED, the history has been +stifled (limited to a maximum number of entries). +

+
+
+
+ +

2.3 History Functions

+ +

This section describes the calling sequence for the various functions +exported by the GNU History library. +

+ + +
+
+ +

2.3.1 Initializing History and State Management

+ +

This section describes functions used to initialize and manage +the state of the History library when you want to use the history +functions in your program. +

+
+
Function: void using_history (void)
+

Begin a session that will use the history functions. +This initializes the interactive variables. +

+ +
+
Function: HISTORY_STATE * history_get_history_state (void)
+

Return a structure describing the current state of the input history. +

+ +
+
Function: void history_set_history_state (HISTORY_STATE *state)
+

Set the state of the history list according to state. +

+ +
+
+
+ +

2.3.2 History List Management

+ +

These functions manage individual entries on the history list, or set +parameters managing the list itself. +

+
+
Function: void add_history (const char *string)
+

Add string to the end of the history list, and +set the associated data field (if any) to NULL. +If the maximum number of history entries has been set using +stifle_history(), and the new number of history entries +would exceed that maximum, this removes the oldest history entry. +

+ +
+
Function: void add_history_time (const char *string)
+

Change the time stamp associated with the most recent history entry to +string. +

+ +
+
Function: HIST_ENTRY * remove_history (int which)
+

Remove the history entry at offset which from the history list. +This returns the removed element so you can free the line, data, +and containing structure. +Since the data is private to your application, the History library +doesn’t know how to free it, if necessary. +

+ +
+
Function: histdata_t free_history_entry (HIST_ENTRY *histent)
+

Free the history entry histent and any history library private +data associated with it. +Returns the application-specific data +so the caller can dispose of it. +

+ +
+
Function: HIST_ENTRY * replace_history_entry (int which, const char *line, histdata_t data)
+

Make the history entry at offset which have line and data. +This returns the old entry so the caller can dispose of any +application-specific data. +In the case of an invalid which, this returns NULL. +

+ +
+
Function: void clear_history (void)
+

Clear the history list by deleting all the entries. +

+ +
+
Function: void stifle_history (int max)
+

Stifle the history list, remembering only the last max entries. +The history list will contain only max entries at a time. +

+ +
+
Function: int unstifle_history (void)
+

Stop stifling the history. +This returns the previously-set maximum number of history +entries (as set by stifle_history()). +The value is positive if the history was stifled, negative if it wasn’t. +

+ +
+
Function: int history_is_stifled (void)
+

Returns non-zero if the history is stifled, zero if it is not. +

+ +
+
+
+ +

2.3.3 Information About the History List

+ +

These functions return information about the entire history list or +individual list entries. +

+
+
Function: HIST_ENTRY ** history_list (void)
+

Return a NULL terminated array of HIST_ENTRY * which is the +current input history. +Element 0 of this list is the beginning of time. +Return NULL if there is no history. +

+ +
+
Function: int where_history (void)
+

Return the offset of the current history entry. +

+ +
+
Function: HIST_ENTRY * current_history (void)
+

Return the history entry at the current position, as determined by +where_history(). +If there is no entry there, return NULL. +

+ +
+
Function: HIST_ENTRY * history_get (int offset)
+

Return the history entry at position offset. +The range of valid +values of offset starts at history_base and ends at +history_length - 1 (see History Variables). +If there is no entry there, or if offset is outside the valid +range, return NULL. +

+ +
+
Function: time_t history_get_time (HIST_ENTRY *entry)
+

Return the time stamp associated with the history entry entry. +If the timestamp is missing or invalid, return 0. +

+ +
+
Function: int history_total_bytes (void)
+

Return the number of bytes that the primary history entries are using. +This function returns the sum of the lengths of all the lines in the +history. +

+ +
+
+
+ +

2.3.4 Moving Around the History List

+ +

These functions allow the current index into the history list to be +set or changed. +

+
+
Function: int history_set_pos (int pos)
+

Set the current history offset to pos, an absolute index +into the list. +Returns 1 on success, 0 if pos is less than zero or greater +than the number of history entries. +

+ +
+
Function: HIST_ENTRY * previous_history (void)
+

Back up the current history offset to the previous history entry, and +return a pointer to that entry. +If there is no previous entry, return NULL. +

+ +
+
Function: HIST_ENTRY * next_history (void)
+

If the current history offset refers to a valid history entry, +increment the current history offset. +If the possibly-incremented history offset refers to a valid history +entry, return a pointer to that entry; +otherwise, return NULL. +

+ +
+
+
+ +

2.3.5 Searching the History List

+ + +

These functions search the history list for entries containing +a specific string. +Searching may be performed both forward and backward +from the current history position. +The search may be anchored, +meaning that the string must match at the beginning of a history entry. + +

+
+
Function: int history_search (const char *string, int direction)
+

Search the history for string, starting at the current history offset. +If direction is less than 0, then the search is through +previous entries, otherwise through subsequent entries. +If string is found, then the current history index is set to +that history entry, and history_search +returns the offset in the line of the entry where +string was found. +Otherwise, nothing is changed, and this returns -1. +

+ +
+
Function: int history_search_prefix (const char *string, int direction)
+

Search the history for string, starting at the current history +offset. +The search is anchored: matching history entries must begin with string. +If direction is less than 0, then the search is +through previous entries, otherwise through subsequent entries. +If string is found, then the current history index is set to +that entry, and the return value is 0. +Otherwise, nothing is changed, and this returns -1. +

+ +
+
Function: int history_search_pos (const char *string, int direction, int pos)
+

Search for string in the history list, starting at pos, an +absolute index into the list. +If direction is negative, the search +proceeds backward from pos, otherwise forward. +Returns the index in the history list +of the history element where string was +found, or -1 otherwise. +

+ +
+
+
+ +

2.3.6 Managing the History File

+ +

The History library can read the history from and write it to a file. +This section documents the functions for managing a history file. +

+
+
Function: int read_history (const char *filename)
+

Add the contents of filename to the history list, one entry +at a time. +If filename is NULL, this reads from ~/.history, +if it exists. +This attempts to determine whether the history file includes timestamp +information, and assigns timestamps to the history entries it reads +if so. +Returns 0 if successful, or errno if not. +

+ +
+
Function: int read_history_range (const char *filename, int from, int to)
+

Read a range of lines from filename, adding them to the history list. +Start reading at line from and end at to. +If from is zero, start at the beginning. +If to is less than from, this reads until the end of the file. +This attempts to determine whether the history file includes timestamp +information, and assigns timestamps to the history entries it reads +if so. +If filename is NULL, this reads from ~/.history, +if it exists. +Returns 0 if successful, or errno if not. +

+ +
+
Function: int write_history (const char *filename)
+

Write the current history to filename, overwriting filename +if necessary. +This writes timestamp information if the +history_write_timestamps variable is set to a non-zero value. +If filename is NULL, then write the history list to +~/.history. +Returns 0 on success, or errno on a read or write error. +

+ +
+
Function: int append_history (int nelements, const char *filename)
+

Append the last nelements of the history list to filename. +This writes timestamp information if the +history_write_timestamps variable is set to a non-zero value. +If filename is NULL, then append to ~/.history. +Returns 0 on success, or errno on a read or write error. +

+ +
+
Function: int history_truncate_file (const char *filename, int nlines)
+

Truncate the history file filename, leaving only the last +nlines lines. +If filename is NULL, this truncates ~/.history. +Returns 0 on success, or errno on failure. +

+ +
+
+
+ +

2.3.7 History Expansion

+ +

These functions implement history expansion. +

+
+
Function: int history_expand (const char *string, char **output)
+

Expand string, placing the result into output, a pointer +to a string (see History Expansion). +Returns: +

+
0
+

If no expansions took place (or, if the only change in +the text was the removal of escape characters preceding the history expansion +character); +

+
1
+

if expansions did take place; +

+
-1
+

if there was an error in expansion; +

+
2
+

if the returned line should be displayed, but not executed, +as with the :p modifier (see Modifiers). +

+
+ +

If an error occurred during expansion, +then output contains a descriptive error message. +

+ +
+
Function: char * get_history_event (const char *string, int *cindex, int qchar)
+

Returns the text of the history event beginning at string + +*cindex. +Modifies *cindex to point to after the event specifier. +At function entry, cindex points to the index into string +where the history event specification begins. +qchar +is a character that is allowed to end the event specification in addition +to the “normal” terminating characters. +

+ +
+
Function: char ** history_tokenize (const char *string)
+

Return an array of tokens parsed out of string, much as the +shell might. +The tokens are split on the characters in the +history_word_delimiters variable, +and shell quoting conventions are obeyed as described below. +

+ +
+
Function: char * history_arg_extract (int first, int last, const char *string)
+

Extract a string segment consisting of the first through last +arguments present in string. +This splits string into arguments using history_tokenize. +

+ +
+
+
+
+ +

2.4 History Variables

+ +

This section describes the externally-visible variables exported by +the GNU History Library. +

+
+
Variable: int history_base
+

The logical offset of the first entry in the history list. +

+ +
+
Variable: int history_length
+

The number of entries currently stored in the history list. +

+ +
+
Variable: int history_max_entries
+

The maximum number of history entries. +This must be changed using stifle_history(). +

+ +
+
Variable: int history_write_timestamps
+

If non-zero, timestamps are written to the history file, so they can be +preserved between sessions. +The default value is 0, meaning that timestamps are not saved. +

+

The current timestamp format uses the value of history_comment_char +to delimit timestamp entries in the history file. +If that variable does not have a value (the default), +the history library will not write timestamps. +

+ +
+
Variable: char history_expansion_char
+

The character that introduces a history event. +The default is ‘!’. +Setting this to 0 inhibits history expansion. +

+ +
+
Variable: char history_subst_char
+

The character that invokes word substitution if found at the start of +a line. +The default is ‘^’. +

+ +
+
Variable: char history_comment_char
+

During tokenization, if this character appears as the first character +of a word, then it and all subsequent characters up to a newline are +ignored, suppressing history expansion for the remainder of the line. +This is disabled by default. +

+ +
+
Variable: char * history_word_delimiters
+

The characters that separate tokens for history_tokenize(). +The default value is " \t\n()<>;&|". +

+ +
+
Variable: char * history_search_delimiter_chars
+

The list of additional characters which can delimit a history search +string, in addition to space, TAB, ‘:’ and ‘?’ in the case of +a substring search. +The default is empty. +

+ +
+
Variable: char * history_no_expand_chars
+

The list of characters which inhibit history expansion if found immediately +following history_expansion_char. +The default is space, tab, newline, carriage return, and ‘=’. +

+ +
+
Variable: int history_quotes_inhibit_expansion
+

If non-zero, the history expansion code implements shell-like quoting: +single-quoted words are not scanned for the history expansion +character or the history comment character, and double-quoted words may +have history expansion performed, since single quotes are not special +within double quotes. +The default value is 0. +

+ +
+
Variable: int history_quoting_state
+

An application may set this variable to indicate that the current line +being expanded is subject to existing quoting. +If set to ‘'’, +history expansion assumes that the line is single-quoted and +inhibit expansion until it reads an unquoted closing single quote; +if set to ‘"’, +history expansion assumes the line is double quoted +until it reads an unquoted closing double quote. +If set to 0, the default, +history expansion assumes the line is not quoted and +treats quote characters within the line as described above. +This is only effective if history_quotes_inhibit_expansion is set. +This is intended for use by applications like Bash which allow +quoted strings to span multiple lines. +

+ +
+
Variable: rl_linebuf_func_t * history_inhibit_expansion_function
+

This should be set to the address of a function that takes two arguments: +a char * (string) +and an int index into that string (i). +It should return a non-zero value if the history expansion starting at +string[i] should not be performed; zero if the expansion should +be done. +It is intended for use by applications like Bash that use the history +expansion character for additional purposes. +By default, this variable is set to NULL. +

+ +
+
+
+ +

2.5 History Programming Example

+ +

The following program demonstrates simple use of the GNU History Library. +

+
+
#include <stdio.h>
+#include <readline/history.h>
+
+int
+main (int argc, char **argv)
+{
+  char line[1024], *t;
+  int len, done = 0;
+
+  line[0] = 0;
+
+  using_history ();
+  while (!done)
+    {
+      printf ("history$ ");
+      fflush (stdout);
+      t = fgets (line, sizeof (line) - 1, stdin);
+      if (t && *t)
+        {
+          len = strlen (t);
+          if (t[len - 1] == '\n')
+            t[len - 1] = '\0';
+        }
+
+      if (!t)
+        strcpy (line, "quit");
+
+      if (line[0])
+        {
+          char *expansion;
+          int result;
+
+          result = history_expand (line, &expansion);
+          if (result)
+            fprintf (stderr, "%s\n", expansion);
+
+          if (result < 0 || result == 2)
+            {
+              free (expansion);
+              continue;
+            }
+
+          add_history (expansion);
+          strncpy (line, expansion, sizeof (line) - 1);
+          free (expansion);
+        }
+
+      if (strcmp (line, "quit") == 0)
+        done = 1;
+      else if (strcmp (line, "save") == 0)
+        write_history ("history_file");
+      else if (strcmp (line, "read") == 0)
+        read_history ("history_file");
+      else if (strcmp (line, "list") == 0)
+        {
+          register HIST_ENTRY **the_list;
+          register int i;
+
+          the_list = history_list ();
+          if (the_list)
+            for (i = 0; the_list[i]; i++)
+              printf ("%d: %s\n", i + history_base, the_list[i]->line);
+        }
+      else if (strncmp (line, "delete", 6) == 0)
+        {
+          int which;
+          if ((sscanf (line + 6, "%d", &which)) == 1)
+            {
+              HIST_ENTRY *entry = remove_history (which);
+              if (!entry)
+                fprintf (stderr, "No such entry %d\n", which);
+              else
+                {
+                  free (entry->line);
+                  free (entry);
+                }
+            }
+          else
+            {
+              fprintf (stderr, "non-numeric arg given to `delete'\n");
+            }
+        }
+    }
+}
+
+ +
+
+
+
+ +

Appendix A GNU Free Documentation License

+ +
Version 1.3, 3 November 2008 +
+ +
+
Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+http://fsf.org/
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+ +
    +
  1. PREAMBLE + +

    The purpose of this License is to make a manual, textbook, or other +functional and useful document free in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. +

    +

    This License is a kind of “copyleft”, which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. +

    +

    We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. +

    +
  2. APPLICABILITY AND DEFINITIONS + +

    This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The “Document”, below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as “you”. You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. +

    +

    A “Modified Version” of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. +

    +

    A “Secondary Section” is a named appendix or a front-matter section +of the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document’s overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. +

    +

    The “Invariant Sections” are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. +

    +

    The “Cover Texts” are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. +

    +

    A “Transparent” copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not “Transparent” is called “Opaque”. +

    +

    Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input +format, SGML or XML using a publicly available +DTD, and standard-conforming simple HTML, +PostScript or PDF designed for human modification. Examples +of transparent image formats include PNG, XCF and +JPG. Opaque formats include proprietary formats that can be +read and edited only by proprietary word processors, SGML or +XML for which the DTD and/or processing tools are +not generally available, and the machine-generated HTML, +PostScript or PDF produced by some word processors for +output purposes only. +

    +

    The “Title Page” means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, “Title Page” means +the text near the most prominent appearance of the work’s title, +preceding the beginning of the body of the text. +

    +

    The “publisher” means any person or entity that distributes copies +of the Document to the public. +

    +

    A section “Entitled XYZ” means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as “Acknowledgements”, +“Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” +of such a section when you modify the Document means that it remains a +section “Entitled XYZ” according to this definition. +

    +

    The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. +

    +
  3. VERBATIM COPYING + +

    You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. +

    +

    You may also lend copies, under the same conditions stated above, and +you may publicly display copies. +

    +
  4. COPYING IN QUANTITY + +

    If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document’s license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. +

    +

    If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. +

    +

    If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. +

    +

    It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. +

    +
  5. MODIFICATIONS + +

    You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: +

    +
      +
    1. Use in the Title Page (and on the covers, if any) a title distinct +from that of the Document, and from those of previous versions +(which should, if there were any, be listed in the History section +of the Document). You may use the same title as a previous version +if the original publisher of that version gives permission. + +
    2. List on the Title Page, as authors, one or more persons or entities +responsible for authorship of the modifications in the Modified +Version, together with at least five of the principal authors of the +Document (all of its principal authors, if it has fewer than five), +unless they release you from this requirement. + +
    3. State on the Title page the name of the publisher of the +Modified Version, as the publisher. + +
    4. Preserve all the copyright notices of the Document. + +
    5. Add an appropriate copyright notice for your modifications +adjacent to the other copyright notices. + +
    6. Include, immediately after the copyright notices, a license notice +giving the public permission to use the Modified Version under the +terms of this License, in the form shown in the Addendum below. + +
    7. Preserve in that license notice the full lists of Invariant Sections +and required Cover Texts given in the Document’s license notice. + +
    8. Include an unaltered copy of this License. + +
    9. Preserve the section Entitled “History”, Preserve its Title, and add +to it an item stating at least the title, year, new authors, and +publisher of the Modified Version as given on the Title Page. If +there is no section Entitled “History” in the Document, create one +stating the title, year, authors, and publisher of the Document as +given on its Title Page, then add an item describing the Modified +Version as stated in the previous sentence. + +
    10. Preserve the network location, if any, given in the Document for +public access to a Transparent copy of the Document, and likewise +the network locations given in the Document for previous versions +it was based on. These may be placed in the “History” section. +You may omit a network location for a work that was published at +least four years before the Document itself, or if the original +publisher of the version it refers to gives permission. + +
    11. For any section Entitled “Acknowledgements” or “Dedications”, Preserve +the Title of the section, and preserve in the section all the +substance and tone of each of the contributor acknowledgements and/or +dedications given therein. + +
    12. Preserve all the Invariant Sections of the Document, +unaltered in their text and in their titles. Section numbers +or the equivalent are not considered part of the section titles. + +
    13. Delete any section Entitled “Endorsements”. Such a section +may not be included in the Modified Version. + +
    14. Do not retitle any existing section to be Entitled “Endorsements” or +to conflict in title with any Invariant Section. + +
    15. Preserve any Warranty Disclaimers. +
    + +

    If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version’s license notice. +These titles must be distinct from any other section titles. +

    +

    You may add a section Entitled “Endorsements”, provided it contains +nothing but endorsements of your Modified Version by various +parties—for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. +

    +

    You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. +

    +

    The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. +

    +
  6. COMBINING DOCUMENTS + +

    You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. +

    +

    The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. +

    +

    In the combination, you must combine any sections Entitled “History” +in the various original documents, forming one section Entitled +“History”; likewise combine any sections Entitled “Acknowledgements”, +and any sections Entitled “Dedications”. You must delete all +sections Entitled “Endorsements.” +

    +
  7. COLLECTIONS OF DOCUMENTS + +

    You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. +

    +

    You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. +

    +
  8. AGGREGATION WITH INDEPENDENT WORKS + +

    A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an “aggregate” if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation’s users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. +

    +

    If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document’s Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. +

    +
  9. TRANSLATION + +

    Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. +

    +

    If a section in the Document is Entitled “Acknowledgements”, +“Dedications”, or “History”, the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. +

    +
  10. TERMINATION + +

    You may not copy, modify, sublicense, or distribute the Document +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense, or distribute it is void, and +will automatically terminate your rights under this License. +

    +

    However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. +

    +

    Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. +

    +

    Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, receipt of a copy of some or all of the same material does +not give you any rights to use it. +

    +
  11. FUTURE REVISIONS OF THIS LICENSE + +

    The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +http://www.gnu.org/copyleft/. +

    +

    Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License “or any later version” applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. If the Document +specifies that a proxy can decide which future versions of this +License can be used, that proxy’s public statement of acceptance of a +version permanently authorizes you to choose that version for the +Document. +

    +
  12. RELICENSING + +

    “Massive Multiauthor Collaboration Site” (or “MMC Site”) means any +World Wide Web server that publishes copyrightable works and also +provides prominent facilities for anybody to edit those works. A +public wiki that anybody can edit is an example of such a server. A +“Massive Multiauthor Collaboration” (or “MMC”) contained in the +site means any set of copyrightable works thus published on the MMC +site. +

    +

    “CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0 +license published by Creative Commons Corporation, a not-for-profit +corporation with a principal place of business in San Francisco, +California, as well as future copyleft versions of that license +published by that same organization. +

    +

    “Incorporate” means to publish or republish a Document, in whole or +in part, as part of another Document. +

    +

    An MMC is “eligible for relicensing” if it is licensed under this +License, and if all works that were first published under this License +somewhere other than this MMC, and subsequently incorporated in whole +or in part into the MMC, (1) had no cover texts or invariant sections, +and (2) were thus incorporated prior to November 1, 2008. +

    +

    The operator of an MMC Site may republish an MMC contained in the site +under CC-BY-SA on the same site at any time before August 1, 2009, +provided the MMC is eligible for relicensing. +

    +
+ +

ADDENDUM: How to use this License for your documents

+ +

To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: +

+
+
  Copyright (C)  year  your name.
+  Permission is granted to copy, distribute and/or modify this document
+  under the terms of the GNU Free Documentation License, Version 1.3
+  or any later version published by the Free Software Foundation;
+  with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+  Texts.  A copy of the license is included in the section entitled ``GNU
+  Free Documentation License''.
+
+ +

If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the “with…Texts.” line with this: +

+
+
    with the Invariant Sections being list their titles, with
+    the Front-Cover Texts being list, and with the Back-Cover Texts
+    being list.
+
+ +

If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. +

+

If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. +

+ + +
+
+
+ +

Appendix B Concept Index

+ + +
+
+
+ +

Appendix C Function and Variable Index

+
+
Jump to:   A +   +C +   +F +   +G +   +H +   +N +   +P +   +R +   +S +   +U +   +W +   +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Index EntrySection

A
add_historyHistory List Management
add_history_timeHistory List Management
append_historyManaging the History File

C
clear_historyHistory List Management
current_historyInformation About the History List

F
free_history_entryHistory List Management

G
get_history_eventHistory Expansion

H
history_arg_extractHistory Expansion
history_baseHistory Variables
history_comment_charHistory Variables
history_expandHistory Expansion
history_expansion_charHistory Variables
history_getInformation About the History List
history_get_history_stateInitializing History and State Management
history_get_timeInformation About the History List
history_inhibit_expansion_functionHistory Variables
history_is_stifledHistory List Management
history_lengthHistory Variables
history_listInformation About the History List
history_max_entriesHistory Variables
history_no_expand_charsHistory Variables
history_quotes_inhibit_expansionHistory Variables
history_quoting_stateHistory Variables
history_searchSearching the History List
history_search_delimiter_charsHistory Variables
history_search_posSearching the History List
history_search_prefixSearching the History List
history_set_history_stateInitializing History and State Management
history_set_posMoving Around the History List
history_subst_charHistory Variables
history_tokenizeHistory Expansion
history_total_bytesInformation About the History List
history_truncate_fileManaging the History File
history_word_delimitersHistory Variables
history_write_timestampsHistory Variables

N
next_historyMoving Around the History List

P
previous_historyMoving Around the History List

R
read_historyManaging the History File
read_history_rangeManaging the History File
remove_historyHistory List Management
replace_history_entryHistory List Management

S
stifle_historyHistory List Management

U
unstifle_historyHistory List Management
using_historyInitializing History and State Management

W
where_historyInformation About the History List
write_historyManaging the History File

+ +
+ +
+