diff options
author | Devtools Arcadia <arcadia-devtools@yandex-team.ru> | 2022-02-07 18:08:42 +0300 |
---|---|---|
committer | Devtools Arcadia <arcadia-devtools@mous.vla.yp-c.yandex.net> | 2022-02-07 18:08:42 +0300 |
commit | 1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch) | |
tree | e26c9fed0de5d9873cce7e00bc214573dc2195b7 /contrib/libs/re2/.yandex_meta | |
download | ydb-1110808a9d39d4b808aef724c861a2e1a38d2a69.tar.gz |
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'contrib/libs/re2/.yandex_meta')
-rw-r--r-- | contrib/libs/re2/.yandex_meta/devtools.copyrights.report | 290 | ||||
-rw-r--r-- | contrib/libs/re2/.yandex_meta/devtools.licenses.report | 195 | ||||
-rw-r--r-- | contrib/libs/re2/.yandex_meta/licenses.list.txt | 482 |
3 files changed, 967 insertions, 0 deletions
diff --git a/contrib/libs/re2/.yandex_meta/devtools.copyrights.report b/contrib/libs/re2/.yandex_meta/devtools.copyrights.report new file mode 100644 index 0000000000..fcfbbf58a5 --- /dev/null +++ b/contrib/libs/re2/.yandex_meta/devtools.copyrights.report @@ -0,0 +1,290 @@ +# File format ($ symbol means the beginning of a line): +# +# $ # this message +# $ # ======================= +# $ # comments (all commentaries should starts with some number of spaces and # symbol) +# ${action} {license id} {license text hash} +# $BELONGS ./ya/make/file/relative/path/1/ya.make ./ya/make/2/ya.make +# ${all_file_action} filename +# $ # user commentaries (many lines) +# $ generated description - files with this license, license text... (some number of lines that starts with some number of spaces, do not modify) +# ${action} {license spdx} {license text hash} +# $BELONGS ./ya/make/file/relative/path/3/ya.make +# ${all_file_action} filename +# $ # user commentaries +# $ generated description +# $ ... +# +# You can modify action, all_file_action and add commentaries +# Available actions: +# keep - keep license in contrib and use in credits +# skip - skip license +# remove - remove all files with this license +# rename - save license text/links into licenses texts file, but not store SPDX into LINCENSE macro. You should store correct license id into devtools.license.spdx.txt file +# +# {all file action} records will be generated when license text contains filename that exists on filesystem (in contrib directory) +# We suppose that that files can contain some license info +# Available all file actions: +# FILE_IGNORE - ignore file (do nothing) +# FILE_INCLUDE - include all file data into licenses text file +# ======================= + +KEEP COPYRIGHT_SERVICE_LABEL 1562f9fc10f07a8091b58eb7feeaf463 +BELONGS re2/testing/ya.make + License text: + // Copyright 2002-2009 The RE2 Authors. All Rights Reserved. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + re2/testing/re2_test.cc [2:2] + +KEEP COPYRIGHT_SERVICE_LABEL 15b1af953b23d6d5a49bf79fb79b2017 +BELONGS re2/testing/ya.make ya.make + License text: + // Copyright 2007 The RE2 Authors. All Rights Reserved. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + re2/compile.cc [1:1] + re2/prog.cc [1:1] + re2/prog.h [1:1] + re2/testing/compile_test.cc [1:1] + util/mutex.h [1:1] + +KEEP COPYRIGHT_SERVICE_LABEL 351febcb30e76a5b6779c64e59e794f9 +BELONGS ya.make + License text: + // Copyright 2018 The RE2 Authors. All Rights Reserved. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + re2/pod_array.h [1:1] + +KEEP COPYRIGHT_SERVICE_LABEL 50f9c058308948c8237df668fefa9f91 +BELONGS re2/testing/ya.make + License text: + // Copyright 2006-2008 The RE2 Authors. All Rights Reserved. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + re2/testing/possible_match_test.cc [1:1] + +KEEP COPYRIGHT_SERVICE_LABEL 51de4dadf8ddb3e24ef7e5c9c5db75f3 +BELONGS ya.make + License text: + // Copyright 2003-2009 The RE2 Authors. All Rights Reserved. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + re2/re2.cc [1:1] + re2/re2.h [1:1] + +KEEP COPYRIGHT_SERVICE_LABEL 69abe630ff56f0d38f9b6964427759bd +BELONGS ya.make + License text: + // Copyright (c) 2009 The RE2 Authors. All rights reserved. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + LICENSE [1:1] + +KEEP COPYRIGHT_SERVICE_LABEL 80cd7203a122d873ea5f8390ee4e7268 +BELONGS re2/testing/ya.make + License text: + // Copyright 2005 The RE2 Authors. All Rights Reserved. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + re2/testing/re2_arg_test.cc [1:1] + +KEEP COPYRIGHT_SERVICE_LABEL 828ff93a2c8a710751f569104ad7c308 +BELONGS re2/testing/ya.make ya.make + License text: + // Copyright 2008 The RE2 Authors. All Rights Reserved. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + re2/bitstate.cc [1:1] + re2/dfa.cc [1:1] + re2/mimics_pcre.cc [1:1] + re2/onepass.cc [1:1] + re2/testing/backtrack.cc [1:1] + re2/testing/exhaustive_tester.cc [1:1] + re2/testing/mimics_pcre_test.cc [1:1] + re2/testing/regexp_generator.cc [1:1] + re2/testing/regexp_generator.h [1:1] + re2/testing/string_generator.cc [1:1] + re2/testing/string_generator.h [1:1] + re2/testing/string_generator_test.cc [1:1] + re2/testing/tester.cc [1:1] + re2/testing/tester.h [1:1] + re2/unicode_casefold.h [1:1] + re2/unicode_groups.h [1:1] + +KEEP COPYRIGHT_SERVICE_LABEL 93b4819d1521cb7da7a97bcbcfa5dead +BELONGS re2/testing/ya.make ya.make + License text: + // Copyright 2010 The RE2 Authors. All Rights Reserved. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + re2/set.cc [1:1] + re2/set.h [1:1] + re2/testing/set_test.cc [1:1] + +KEEP COPYRIGHT_SERVICE_LABEL b458789a3d0d3925b560d74f7c9b69b5 +BELONGS ya.make + License text: + // Copyright 2016 The RE2 Authors. All Rights Reserved. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + re2/bitmap256.h [1:1] + util/mix.h [1:1] + util/strutil.h [1:1] + +KEEP COPYRIGHT_SERVICE_LABEL ba70303a8088968ba06e01f684a8c2bd +BELONGS re2/testing/ya.make ya.make + License text: + // Copyright 2006-2007 The RE2 Authors. All Rights Reserved. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + re2/nfa.cc [1:1] + re2/testing/search_test.cc [1:1] + +KEEP COPYRIGHT_SERVICE_LABEL bc65447f501c333ced533a3743bb75e2 +BELONGS ya.make + License text: + // Copyright 2003-2010 Google Inc. All Rights Reserved. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + util/pcre.h [1:1] + +KEEP COPYRIGHT_SERVICE_LABEL cefe64e6ef8436a4c91df69cd39c82b5 +BELONGS ya.make + License text: + // Copyright 2004 The RE2 Authors. All Rights Reserved. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + re2/stringpiece.cc [1:1] + +KEEP COPYRIGHT_SERVICE_LABEL d91867789f9f394d1d13f17477b9032c +BELONGS ya.make + License text: + // Copyright 1999-2005 The RE2 Authors. All Rights Reserved. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + util/strutil.cc [1:1] + +KEEP COPYRIGHT_SERVICE_LABEL dcc5eb5a5cb8943a6751d54e49098f08 +BELONGS re2/testing/ya.make ya.make + License text: + // Copyright 2006 The RE2 Authors. All Rights Reserved. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + re2/parse.cc [1:1] + re2/regexp.cc [1:1] + re2/regexp.h [1:1] + re2/simplify.cc [1:1] + re2/sparse_array.h [1:1] + re2/sparse_set.h [1:1] + re2/testing/charclass_test.cc [1:1] + re2/testing/dump.cc [1:1] + re2/testing/parse_test.cc [1:1] + re2/testing/regexp_test.cc [1:1] + re2/testing/simplify_test.cc [1:1] + re2/tostring.cc [1:1] + re2/walker-inl.h [1:1] + +KEEP COPYRIGHT_SERVICE_LABEL dd5282342e69b23e1beac28388c7eada +BELONGS re2/testing/ya.make ya.make + License text: + // Copyright 2009 The RE2 Authors. All Rights Reserved. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + re2/filtered_re2.cc [1:1] + re2/filtered_re2.h [1:1] + re2/prefilter.cc [1:1] + re2/prefilter.h [1:1] + re2/prefilter_tree.cc [1:1] + re2/prefilter_tree.h [1:1] + re2/testing/exhaustive_tester.h [1:1] + re2/testing/filtered_re2_test.cc [1:1] + re2/testing/null_walker.cc [1:1] + re2/testing/required_prefix_test.cc [1:1] + util/flags.h [1:1] + util/logging.h [1:1] + util/test.cc [1:1] + util/test.h [1:1] + util/util.h [1:1] + +KEEP COPYRIGHT_SERVICE_LABEL e83feca84ce335a1318a198f5177c4cc +BELONGS ya.make + License text: + // Copyright 2003-2009 Google Inc. All rights reserved. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + util/pcre.cc [1:1] + +KEEP COPYRIGHT_SERVICE_LABEL ea0547b2330fd015b14b7464abf7125f +BELONGS ya.make + Note: matched license text is too long. Read it in the source files. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + util/rune.cc [2:7] + util/utf.h [2:7] + +KEEP COPYRIGHT_SERVICE_LABEL f1da661c6a4ae536f800e7c83c6390d5 +BELONGS ya.make + License text: + // Copyright 2001-2010 The RE2 Authors. All Rights Reserved. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + re2/stringpiece.h [1:1] diff --git a/contrib/libs/re2/.yandex_meta/devtools.licenses.report b/contrib/libs/re2/.yandex_meta/devtools.licenses.report new file mode 100644 index 0000000000..33c440620b --- /dev/null +++ b/contrib/libs/re2/.yandex_meta/devtools.licenses.report @@ -0,0 +1,195 @@ +# File format ($ symbol means the beginning of a line): +# +# $ # this message +# $ # ======================= +# $ # comments (all commentaries should starts with some number of spaces and # symbol) +# ${action} {license id} {license text hash} +# $BELONGS ./ya/make/file/relative/path/1/ya.make ./ya/make/2/ya.make +# ${all_file_action} filename +# $ # user commentaries (many lines) +# $ generated description - files with this license, license text... (some number of lines that starts with some number of spaces, do not modify) +# ${action} {license spdx} {license text hash} +# $BELONGS ./ya/make/file/relative/path/3/ya.make +# ${all_file_action} filename +# $ # user commentaries +# $ generated description +# $ ... +# +# You can modify action, all_file_action and add commentaries +# Available actions: +# keep - keep license in contrib and use in credits +# skip - skip license +# remove - remove all files with this license +# rename - save license text/links into licenses texts file, but not store SPDX into LINCENSE macro. You should store correct license id into devtools.license.spdx.txt file +# +# {all file action} records will be generated when license text contains filename that exists on filesystem (in contrib directory) +# We suppose that that files can contain some license info +# Available all file actions: +# FILE_IGNORE - ignore file (do nothing) +# FILE_INCLUDE - include all file data into licenses text file +# ======================= + +KEEP BSD-3-Clause 42a5737a61dde3441b283fd1db553e3b +BELONGS re2/testing/ya.make ya.make +FILE_INCLUDE LICENSE found in files: re2/bitmap256.h at line 3, re2/bitstate.cc at line 3, re2/compile.cc at line 3, re2/dfa.cc at line 3, re2/filtered_re2.cc at line 3, re2/filtered_re2.h at line 3, re2/mimics_pcre.cc at line 3, re2/nfa.cc at line 3, re2/onepass.cc at line 3, re2/parse.cc at line 3, re2/pod_array.h at line 3, re2/prefilter.cc at line 3, re2/prefilter.h at line 3, re2/prefilter_tree.cc at line 3, re2/prefilter_tree.h at line 3, re2/prog.cc at line 3, re2/prog.h at line 3, re2/re2.cc at line 3, re2/re2.h at line 3, re2/regexp.cc at line 3, re2/regexp.h at line 3, re2/set.cc at line 3, re2/set.h at line 3, re2/simplify.cc at line 3, re2/sparse_array.h at line 3, re2/sparse_set.h at line 3, re2/stringpiece.cc at line 3, re2/stringpiece.h at line 3, re2/testing/backtrack.cc at line 3, re2/testing/charclass_test.cc at line 3, re2/testing/compile_test.cc at line 3, re2/testing/dump.cc at line 3, re2/testing/exhaustive_tester.cc at line 3, re2/testing/exhaustive_tester.h at line 3, re2/testing/filtered_re2_test.cc at line 3, re2/testing/mimics_pcre_test.cc at line 3, re2/testing/null_walker.cc at line 3, re2/testing/parse_test.cc at line 3, re2/testing/possible_match_test.cc at line 3, re2/testing/re2_arg_test.cc at line 3, re2/testing/re2_test.cc at line 4, re2/testing/regexp_generator.cc at line 3, re2/testing/regexp_generator.h at line 3, re2/testing/regexp_test.cc at line 3, re2/testing/required_prefix_test.cc at line 3, re2/testing/search_test.cc at line 3, re2/testing/set_test.cc at line 3, re2/testing/simplify_test.cc at line 3, re2/testing/string_generator.cc at line 3, re2/testing/string_generator.h at line 3, re2/testing/string_generator_test.cc at line 3, re2/testing/tester.cc at line 3, re2/testing/tester.h at line 3, re2/tostring.cc at line 3, re2/unicode_casefold.h at line 3, re2/unicode_groups.h at line 3, re2/walker-inl.h at line 3, util/flags.h at line 3, util/logging.h at line 3, util/mix.h at line 3, util/mutex.h at line 3, util/pcre.cc at line 3, util/pcre.h at line 3, util/strutil.cc at line 3, util/strutil.h at line 3, util/test.cc at line 3, util/test.h at line 3, util/util.h at line 3 + License text: + // Use of this source code is governed by a BSD-style + // license that can be found in the LICENSE file. + Scancode info: + Original SPDX id: BSD-3-Clause + Score : 90.00 + Match type : NOTICE + Links : http://www.opensource.org/licenses/BSD-3-Clause, https://spdx.org/licenses/BSD-3-Clause + Files with this license: + re2/bitmap256.h [2:3] + re2/bitstate.cc [2:3] + re2/compile.cc [2:3] + re2/dfa.cc [2:3] + re2/filtered_re2.cc [2:3] + re2/filtered_re2.h [2:3] + re2/mimics_pcre.cc [2:3] + re2/nfa.cc [2:3] + re2/onepass.cc [2:3] + re2/parse.cc [2:3] + re2/pod_array.h [2:3] + re2/prefilter.cc [2:3] + re2/prefilter.h [2:3] + re2/prefilter_tree.cc [2:3] + re2/prefilter_tree.h [2:3] + re2/prog.cc [2:3] + re2/prog.h [2:3] + re2/re2.cc [2:3] + re2/re2.h [2:3] + re2/regexp.cc [2:3] + re2/regexp.h [2:3] + re2/set.cc [2:3] + re2/set.h [2:3] + re2/simplify.cc [2:3] + re2/sparse_array.h [2:3] + re2/sparse_set.h [2:3] + re2/stringpiece.cc [2:3] + re2/stringpiece.h [2:3] + re2/testing/backtrack.cc [2:3] + re2/testing/charclass_test.cc [2:3] + re2/testing/compile_test.cc [2:3] + re2/testing/dump.cc [2:3] + re2/testing/exhaustive_tester.cc [2:3] + re2/testing/exhaustive_tester.h [2:3] + re2/testing/filtered_re2_test.cc [2:3] + re2/testing/mimics_pcre_test.cc [2:3] + re2/testing/null_walker.cc [2:3] + re2/testing/parse_test.cc [2:3] + re2/testing/possible_match_test.cc [2:3] + re2/testing/re2_arg_test.cc [2:3] + re2/testing/re2_test.cc [3:4] + re2/testing/regexp_generator.cc [2:3] + re2/testing/regexp_generator.h [2:3] + re2/testing/regexp_test.cc [2:3] + re2/testing/required_prefix_test.cc [2:3] + re2/testing/search_test.cc [2:3] + re2/testing/set_test.cc [2:3] + re2/testing/simplify_test.cc [2:3] + re2/testing/string_generator.cc [2:3] + re2/testing/string_generator.h [2:3] + re2/testing/string_generator_test.cc [2:3] + re2/testing/tester.cc [2:3] + re2/testing/tester.h [2:3] + re2/tostring.cc [2:3] + re2/unicode_casefold.h [2:3] + re2/unicode_groups.h [2:3] + re2/walker-inl.h [2:3] + util/flags.h [2:3] + util/logging.h [2:3] + util/mix.h [2:3] + util/mutex.h [2:3] + util/pcre.cc [2:3] + util/pcre.h [2:3] + util/strutil.cc [2:3] + util/strutil.h [2:3] + util/test.cc [2:3] + util/test.h [2:3] + util/util.h [2:3] + +SKIP Apache-2.0 4f259c3df2e0ec98e3ba6ca286e690cc +BELONGS ya.make +FILE_INCLUDE LICENSE found in files: README at line 26 + License text: + Unless otherwise noted, the RE2 source files are distributed + under the BSD-style license found in the LICENSE file. + Scancode info: + Original SPDX id: Apache-2.0 + Score : 80.00 + Match type : NOTICE + Links : http://www.apache.org/licenses/, http://www.apache.org/licenses/LICENSE-2.0, https://spdx.org/licenses/Apache-2.0 + Files with this license: + README [25:26] + +KEEP X11-Lucent 71c654f01a03bded10ee9ebcb4aad7ac +BELONGS ya.make +FILE_INCLUDE AUTHORS found in files: util/rune.cc at line 10 + Note: matched license text is too long. Read it in the source files. + Scancode info: + Original SPDX id: LicenseRef-scancode-x11-lucent + Score : 100.00 + Match type : TEXT + Links : https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/x11-lucent.LICENSE + Files with this license: + util/rune.cc [4:12] + +KEEP X11-Lucent b5677fabdf76935718fbac4c7effead7 +BELONGS ya.make +FILE_INCLUDE AUTHORS found in files: util/utf.h at line 10 +FILE_INCLUDE util/rune.cc found in files: util/utf.h at line 14 + # copy of x11-lucent.LICENSE + Note: matched license text is too long. Read it in the source files. + Scancode info: + Original SPDX id: LicenseRef-scancode-x11-lucent + Score : 67.14 + Match type : NOTICE + Links : https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/x11-lucent.LICENSE + Files with this license: + util/utf.h [4:14] + Scancode info: + Original SPDX id: LPL-1.02 + Score : 67.14 + Match type : NOTICE + Links : http://plan9.bell-labs.com/plan9/license.html, https://spdx.org/licenses/LPL-1.02 + Files with this license: + util/utf.h [4:14] + +KEEP BSD-3-Clause cfdf581c1aced09db4a64f39adeb5675 +BELONGS ya.make +FILE_INCLUDE LICENSE found in files: README at line 26 + License text: + under the BSD-style license found in the LICENSE file. + Scancode info: + Original SPDX id: BSD-3-Clause + Score : 90.00 + Match type : REFERENCE + Links : http://www.opensource.org/licenses/BSD-3-Clause, https://spdx.org/licenses/BSD-3-Clause + Files with this license: + README [26:26] + +KEEP BSD-3-Clause dc296f6ff032e932bf091ed8f47e321c +BELONGS ya.make +FILE_INCLUDE CONTRIBUTORS found in files: LICENSE at line 17, LICENSE at line 21 + Note: matched license text is too long. Read it in the source files. + Scancode info: + Original SPDX id: BSD-3-Clause + Score : 100.00 + Match type : TEXT + Links : http://www.opensource.org/licenses/BSD-3-Clause, https://spdx.org/licenses/BSD-3-Clause + Files with this license: + LICENSE [3:27] + +SKIP LicenseRef-scancode-generic-cla fb537447ba01fe4179d5e9df725ec41b +BELONGS ya.make + License text: + \# the appropriate Contributor License Agreement, found here: + Scancode info: + Original SPDX id: LicenseRef-scancode-generic-cla + Score : 16.00 + Match type : NOTICE + Links : https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/generic-cla.LICENSE + Files with this license: + CONTRIBUTORS [12:12] diff --git a/contrib/libs/re2/.yandex_meta/licenses.list.txt b/contrib/libs/re2/.yandex_meta/licenses.list.txt new file mode 100644 index 0000000000..454d3663c9 --- /dev/null +++ b/contrib/libs/re2/.yandex_meta/licenses.list.txt @@ -0,0 +1,482 @@ +====================BSD-3-Clause==================== +// 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. + +====================BSD-3-Clause==================== +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + + +====================BSD-3-Clause==================== +under the BSD-style license found in the LICENSE file. + + +====================COPYRIGHT==================== + * The authors of this software are Rob Pike and Ken Thompson. + * Copyright (c) 2002 by Lucent Technologies. + * Permission to use, copy, modify, and distribute this software for any + * purpose without fee is hereby granted, provided that this entire notice + * is included in all copies of any software which is or includes a copy + * or modification of this software and in all copies of the supporting + + +====================COPYRIGHT==================== +// Copyright (c) 2009 The RE2 Authors. All rights reserved. + + +====================COPYRIGHT==================== +// Copyright 1999-2005 The RE2 Authors. All Rights Reserved. + + +====================COPYRIGHT==================== +// Copyright 2001-2010 The RE2 Authors. All Rights Reserved. + + +====================COPYRIGHT==================== +// Copyright 2003-2009 Google Inc. All rights reserved. + + +====================COPYRIGHT==================== +// Copyright 2003-2009 The RE2 Authors. All Rights Reserved. + + +====================COPYRIGHT==================== +// Copyright 2003-2010 Google Inc. All Rights Reserved. + + +====================COPYRIGHT==================== +// Copyright 2004 The RE2 Authors. All Rights Reserved. + + +====================COPYRIGHT==================== +// Copyright 2006 The RE2 Authors. All Rights Reserved. + + +====================COPYRIGHT==================== +// Copyright 2006-2007 The RE2 Authors. All Rights Reserved. + + +====================COPYRIGHT==================== +// Copyright 2007 The RE2 Authors. All Rights Reserved. + + +====================COPYRIGHT==================== +// Copyright 2008 The RE2 Authors. All Rights Reserved. + + +====================COPYRIGHT==================== +// Copyright 2009 The RE2 Authors. All Rights Reserved. + + +====================COPYRIGHT==================== +// Copyright 2010 The RE2 Authors. All Rights Reserved. + + +====================COPYRIGHT==================== +// Copyright 2016 The RE2 Authors. All Rights Reserved. + + +====================COPYRIGHT==================== +// Copyright 2018 The RE2 Authors. All Rights Reserved. + + +====================File: AUTHORS==================== +# This is the official list of RE2 authors for copyright purposes. +# This file is distinct from the CONTRIBUTORS files. +# See the latter for an explanation. + +# Names should be added to this file as +# Name or Organization <email address> +# The email address is not required for organizations. + +# Please keep the list sorted. + +Google Inc. +Samsung Electronics +Stefano Rivera <stefano.rivera@gmail.com> + + +====================File: CONTRIBUTORS==================== +# This is the official list of people who can contribute +# (and typically have contributed) code to the RE2 repository. +# The AUTHORS file lists the copyright holders; this file +# lists people. For example, Google employees are listed here +# but not in AUTHORS, because Google holds the copyright. +# +# The submission process automatically checks to make sure +# that people submitting code are listed in this file (by email address). +# +# Names should be added to this file only after verifying that +# the individual or the individual's organization has agreed to +# the appropriate Contributor License Agreement, found here: +# +# http://code.google.com/legal/individual-cla-v1.0.html +# http://code.google.com/legal/corporate-cla-v1.0.html +# +# The agreement for individuals can be filled out on the web. +# +# When adding J Random Contributor's name to this file, +# either J's name or J's organization's name should be +# added to the AUTHORS file, depending on whether the +# individual or corporate CLA was used. + +# Names should be added to this file like so: +# Name <email address> + +# Please keep the list sorted. + +Dominic Battré <battre@chromium.org> +Doug Kwan <dougkwan@google.com> +Dmitriy Vyukov <dvyukov@google.com> +John Millikin <jmillikin@gmail.com> +Mike Nazarewicz <mpn@google.com> +Nico Weber <thakis@chromium.org> +Pawel Hajdan <phajdan.jr@gmail.com> +Rob Pike <r@google.com> +Russ Cox <rsc@swtch.com> +Sanjay Ghemawat <sanjay@google.com> +Stefano Rivera <stefano.rivera@gmail.com> +Srinivasan Venkatachary <vsri@google.com> +Viatcheslav Ostapenko <sl.ostapenko@samsung.com> + + +====================File: LICENSE==================== +// Copyright (c) 2009 The RE2 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: util/rune.cc==================== +/* + * The authors of this software are Rob Pike and Ken Thompson. + * Copyright (c) 2002 by Lucent Technologies. + * Permission to use, copy, modify, and distribute this software for any + * purpose without fee is hereby granted, provided that this entire notice + * is included in all copies of any software which is or includes a copy + * or modification of this software and in all copies of the supporting + * documentation for such software. + * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY + * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + */ + +#include <stdarg.h> +#include <string.h> + +#include "util/utf.h" + +namespace re2 { + +enum +{ + Bit1 = 7, + Bitx = 6, + Bit2 = 5, + Bit3 = 4, + Bit4 = 3, + Bit5 = 2, + + T1 = ((1<<(Bit1+1))-1) ^ 0xFF, /* 0000 0000 */ + Tx = ((1<<(Bitx+1))-1) ^ 0xFF, /* 1000 0000 */ + T2 = ((1<<(Bit2+1))-1) ^ 0xFF, /* 1100 0000 */ + T3 = ((1<<(Bit3+1))-1) ^ 0xFF, /* 1110 0000 */ + T4 = ((1<<(Bit4+1))-1) ^ 0xFF, /* 1111 0000 */ + T5 = ((1<<(Bit5+1))-1) ^ 0xFF, /* 1111 1000 */ + + Rune1 = (1<<(Bit1+0*Bitx))-1, /* 0000 0000 0111 1111 */ + Rune2 = (1<<(Bit2+1*Bitx))-1, /* 0000 0111 1111 1111 */ + Rune3 = (1<<(Bit3+2*Bitx))-1, /* 1111 1111 1111 1111 */ + Rune4 = (1<<(Bit4+3*Bitx))-1, + /* 0001 1111 1111 1111 1111 1111 */ + + Maskx = (1<<Bitx)-1, /* 0011 1111 */ + Testx = Maskx ^ 0xFF, /* 1100 0000 */ + + Bad = Runeerror, +}; + +int +chartorune(Rune *rune, const char *str) +{ + int c, c1, c2, c3; + long l; + + /* + * one character sequence + * 00000-0007F => T1 + */ + c = *(unsigned char*)str; + if(c < Tx) { + *rune = c; + return 1; + } + + /* + * two character sequence + * 0080-07FF => T2 Tx + */ + c1 = *(unsigned char*)(str+1) ^ Tx; + if(c1 & Testx) + goto bad; + if(c < T3) { + if(c < T2) + goto bad; + l = ((c << Bitx) | c1) & Rune2; + if(l <= Rune1) + goto bad; + *rune = l; + return 2; + } + + /* + * three character sequence + * 0800-FFFF => T3 Tx Tx + */ + c2 = *(unsigned char*)(str+2) ^ Tx; + if(c2 & Testx) + goto bad; + if(c < T4) { + l = ((((c << Bitx) | c1) << Bitx) | c2) & Rune3; + if(l <= Rune2) + goto bad; + *rune = l; + return 3; + } + + /* + * four character sequence (21-bit value) + * 10000-1FFFFF => T4 Tx Tx Tx + */ + c3 = *(unsigned char*)(str+3) ^ Tx; + if (c3 & Testx) + goto bad; + if (c < T5) { + l = ((((((c << Bitx) | c1) << Bitx) | c2) << Bitx) | c3) & Rune4; + if (l <= Rune3) + goto bad; + *rune = l; + return 4; + } + + /* + * Support for 5-byte or longer UTF-8 would go here, but + * since we don't have that, we'll just fall through to bad. + */ + + /* + * bad decoding + */ +bad: + *rune = Bad; + return 1; +} + +int +runetochar(char *str, const Rune *rune) +{ + /* Runes are signed, so convert to unsigned for range check. */ + unsigned long c; + + /* + * one character sequence + * 00000-0007F => 00-7F + */ + c = *rune; + if(c <= Rune1) { + str[0] = static_cast<char>(c); + return 1; + } + + /* + * two character sequence + * 0080-07FF => T2 Tx + */ + if(c <= Rune2) { + str[0] = T2 | static_cast<char>(c >> 1*Bitx); + str[1] = Tx | (c & Maskx); + return 2; + } + + /* + * If the Rune is out of range, convert it to the error rune. + * Do this test here because the error rune encodes to three bytes. + * Doing it earlier would duplicate work, since an out of range + * Rune wouldn't have fit in one or two bytes. + */ + if (c > Runemax) + c = Runeerror; + + /* + * three character sequence + * 0800-FFFF => T3 Tx Tx + */ + if (c <= Rune3) { + str[0] = T3 | static_cast<char>(c >> 2*Bitx); + str[1] = Tx | ((c >> 1*Bitx) & Maskx); + str[2] = Tx | (c & Maskx); + return 3; + } + + /* + * four character sequence (21-bit value) + * 10000-1FFFFF => T4 Tx Tx Tx + */ + str[0] = T4 | static_cast<char>(c >> 3*Bitx); + str[1] = Tx | ((c >> 2*Bitx) & Maskx); + str[2] = Tx | ((c >> 1*Bitx) & Maskx); + str[3] = Tx | (c & Maskx); + return 4; +} + +int +runelen(Rune rune) +{ + char str[10]; + + return runetochar(str, &rune); +} + +int +fullrune(const char *str, int n) +{ + if (n > 0) { + int c = *(unsigned char*)str; + if (c < Tx) + return 1; + if (n > 1) { + if (c < T3) + return 1; + if (n > 2) { + if (c < T4 || n > 3) + return 1; + } + } + } + return 0; +} + + +int +utflen(const char *s) +{ + int c; + long n; + Rune rune; + + n = 0; + for(;;) { + c = *(unsigned char*)s; + if(c < Runeself) { + if(c == 0) + return n; + s++; + } else + s += chartorune(&rune, s); + n++; + } + return 0; +} + +char* +utfrune(const char *s, Rune c) +{ + long c1; + Rune r; + int n; + + if(c < Runesync) /* not part of utf sequence */ + return strchr((char*)s, c); + + for(;;) { + c1 = *(unsigned char*)s; + if(c1 < Runeself) { /* one byte rune */ + if(c1 == 0) + return 0; + if(c1 == c) + return (char*)s; + s++; + continue; + } + n = chartorune(&r, s); + if(r == c) + return (char*)s; + s += n; + } + return 0; +} + +} // namespace re2 + + +====================X11-Lucent==================== + * Permission to use, copy, modify, and distribute this software for any + * purpose without fee is hereby granted, provided that this entire notice + * is included in all copies of any software which is or includes a copy + * or modification of this software and in all copies of the supporting + * documentation for such software. + * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY + * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + + +====================X11-Lucent==================== + * Permission to use, copy, modify, and distribute this software for any + * purpose without fee is hereby granted, provided that this entire notice + * is included in all copies of any software which is or includes a copy + * or modification of this software and in all copies of the supporting + * documentation for such software. + * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY + * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + * + * This file and rune.cc have been converted to compile as C++ code |