diff --git a/license/third_party/harmony_LICENSE.txt b/license/third_party/harmony_LICENSE.txt new file mode 100644 index 00000000000..aa07fc96d34 --- /dev/null +++ b/license/third_party/harmony_LICENSE.txt @@ -0,0 +1,1419 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + +================================================================================ +================================================================================ + + + +APACHE HARMONY SUBCOMPONENTS: + +Apache Harmony includes a number of subcomponents with separate +copyright notices and license terms. Your use of the source code +for the these subcomponents is subject to the terms and conditions +of the following licenses. + + + +License Notice for ICU4C version 3.4 +==================================== + +ICU License - ICU 1.8.1 and later + +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1995-2005 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. + + + +================================================================================ +================================================================================ + + + +License Notice for ICU4J version 4.2.1 +====================================== + +ICU4J license - ICU4J 1.8.1 and later + +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1995-2009 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. + + + +================================================================================ +================================================================================ + + + +License Notice for FDLIBM version 5.2 +===================================== + +Copyright (C) 2004 by Sun Microsystems, Inc. All rights reserved. + +Developed at SunSoft, a Sun Microsystems, Inc. business. +Permission to use, copy, modify, and distribute this software is freely +granted, provided that this notice is preserved. + + + +================================================================================ +================================================================================ + + + +License Notice for ZLIB version 1.2.3 +===================================== + + (C) 1995-2004 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + + +================================================================================ +================================================================================ + + + +Visual C++ Runtime Files +======================== + +The file msvcr71.dll is the Microsoft(R) C Runtime Library. +The file msvcp71.dll is the Microsoft Multithreaded Standard C++ Library. + +These files are redistributed from Microsoft(R) Visual Studio 7.1 as described in +the file "redist.txt" available with that product. + + + +================================================================================ +================================================================================ + + + +License Notice for Bouncy Castle version 1.45 +============================================= + +Copyright (c) 2000 - 2009 The Legion Of The Bouncy Castle (http://www.bouncycastle.org) + +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. + + + +=============================================================================== +=============================================================================== + + + +License Notice for MX4J 3.0.2. +============================== + +The MX4J License, Version 1.0 + +Copyright (c) 2001-2004 by the MX4J contributors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. 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. + + 3. The end-user documentation included with the redistribution, + if any, must include the following acknowledgment: + "This product includes software developed by the + MX4J project (http://mx4j.sourceforge.net)." + Alternately, this acknowledgment may appear in the software itself, + if and wherever such third-party acknowledgments normally appear. + + 4. The name "MX4J" must not be used to endorse or promote + products derived from this software without prior written + permission. + For written permission, please contact + biorn_steedom [at] users [dot] sourceforge [dot] net + + 5. Products derived from this software may not be called "MX4J", + nor may "MX4J" appear in their name, without prior written + permission of Simone Bordet. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 MX4J 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. + ==================================================================== + + This software consists of voluntary contributions made by many + individuals on behalf of the MX4J project. For more information on + MX4J, please see the MX4J website (http://mx4j.sourceforge.net/). + + + +=============================================================================== +=============================================================================== + + + +Notice for The Independent JPEG Group's JPEG software +===================================================== + +This distribution may contain software that is based in part on the work of +the Independent JPEG Group for which the following notice applies: + +The authors make NO WARRANTY or representation, either express or implied, +with respect to this software, its quality, accuracy, merchantability, or +fitness for a particular purpose. This software is provided "AS IS", and you, +its user, assume the entire risk as to its quality and accuracy. + +This software is copyright (C) 1991-1998, Thomas G. Lane. +All Rights Reserved except as specified below. + +Permission is hereby granted to use, copy, modify, and distribute this +software (or portions thereof) for any purpose, without fee, subject to these +conditions: +(1) If any part of the source code for this software is distributed, then this +README file must be included, with this copyright and no-warranty notice +unaltered; and any additions, deletions, or changes to the original files +must be clearly indicated in accompanying documentation. +(2) If only executable code is distributed, then the accompanying +documentation must state that "this software is based in part on the work of +the Independent JPEG Group". +(3) Permission for use of this software is granted only if the user accepts +full responsibility for any undesirable consequences; the authors accept +NO LIABILITY for damages of any kind. + +These conditions apply to any software derived from or based on the IJG code, +not just to the unmodified library. If you use our work, you ought to +acknowledge us. + +Permission is NOT granted for the use of any IJG author's name or company name +in advertising or publicity relating to this software or products derived from +it. This software may be referred to only as "the Independent JPEG Group's +software". + +We specifically permit and encourage the use of this software as the basis of +commercial products, provided that all warranty or liability claims are +assumed by the product vendor. + + + +=============================================================================== +=============================================================================== + + + +Notice for Little CMS +===================== + +This distribution may contain software that is based in part on Little cms +for which the following notice applies: + +Copyright (c) 1998-2007 Marti Maria Saguer + +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. + + + +=============================================================================== +=============================================================================== + + + +Notice for libpng +================= + +This distribution may contain software that is based in part on libpng +v1.2.38 for which the following notice applies: + +libpng versions 1.2.6, August 15, 2004, through 1.2.38, July 16, 2009, are +Copyright (c) 2004, 2006-2009 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-1.2.5 +with the following individual added to the list of Contributing Authors: + + Cosmin Truta + +libpng versions 1.0.7, July 1, 2000, through 1.2.5, October 3, 2002, are +Copyright (c) 2000-2002 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-1.0.6 +with the following individuals added to the list of Contributing Authors: + + Simon-Pierre Cadieux + Eric S. Raymond + Gilles Vollant + +and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of the + library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes + or needs. This library is provided with all faults, and the entire + risk of satisfactory quality, performance, accuracy, and effort is with + the user. + +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are +Copyright (c) 1998, 1999, 2000 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-0.96, +with the following individuals added to the list of Contributing Authors: + + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + +libpng versions 0.89, June 1996, through 0.96, May 1997, are +Copyright (c) 1996, 1997 Andreas Dilger +Distributed according to the same disclaimer and license as libpng-0.88, +with the following individuals added to the list of Contributing Authors: + + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + +libpng versions 0.5, May 1995, through 0.88, January 1996, are +Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. + +For the purposes of this copyright and license, "Contributing Authors" +is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing Authors +and Group 42, Inc. disclaim all warranties, expressed or implied, +including, without limitation, the warranties of merchantability and of +fitness for any purpose. The Contributing Authors and Group 42, Inc. +assume no liability for direct, indirect, incidental, special, exemplary, +or consequential damages, which may result from the use of the PNG +Reference Library, even if advised of the possibility of such damage. + +Permission is hereby granted to use, copy, modify, and distribute this +source code, or portions hereof, for any purpose, without fee, subject +to the following restrictions: + +1. The origin of this source code must not be misrepresented. + +2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. + +3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + +The Contributing Authors and Group 42, Inc. specifically permit, without +fee, and encourage the use of this source code as a component to +supporting the PNG file format in commercial products. If you use this +source code in a product, acknowledgment is not required but would be +appreciated. + + + +=============================================================================== +=============================================================================== + + + +Notice for Unicode Character Database +===================================== + +Copyright (c) 1991-2005 Unicode, Inc. All rights reserved. Distributed under the +Terms of Use in http://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 (a) the above copyright +notice(s) and this permission notice appear with all copies of the Data Files +or Software, (b) both the above copyright notice(s) and this permission notice +appear in associated documentation, and (c) there is clear notice in each +modified Data File or in the Software as well as in the documentation +associated with the Data File(s) or Software that the data or software has been +modified. + +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. + + + +=============================================================================== +=============================================================================== + + + +Notice for IETF RFCs prior to 2005 +================================== + +This distribution may contain software that is based in part on the work of +the following IETF RFCs. Portions of the IETF RFC specifications may be +included in source code comments for reference, and in accordance with +the licensing terms, the licenses are reproduced here: + +RFC 1779 - A String Representation of Distinguished Names + +RFC 2045 - Multipurpose Internet Mail Extensions (MIME) Part One: Format of + Internet Message Bodies + +RFC 2251 - Lightweight Directory Access Protocol (v3) + Copyright (C) The Internet Society (1997). All Rights Reserved. + +RFC 2253 - Lightweight Directory Access Protocol (v3): UTF-8 String + Representation of Distinguished Names + Copyright (C) The Internet Society (1997). All Rights Reserved. + +RFC 2313 - PKCS #1: RSA Encryption + Copyright (C) The Internet Society (1998). All Rights Reserved. + +RFC 2315 - PKCS #7: Cryptographic Message Syntax + Copyright (C) The Internet Society (1998). All Rights Reserved. + +RFC 2459 - Internet X.509 Public Key Infrastructure Certificate and CRL Profile + Copyright (C) The Internet Society (1999). All Rights Reserved. + +RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1 + Copyright (C) The Internet Society (1999). All Rights Reserved. + +RFC 2781 - UTF-16, an encoding of ISO 10646 + Copyright (C) The Internet Society (2000). All Rights Reserved. + +RFC 2891 - LDAP Control Extension for Server Side Sorting of Search Results + Copyright (C) The Internet Society (2000). All Rights Reserved. + +RFC 2985 - PKCS #9: Selected Object Classes and Attribute Types + Copyright (C) The Internet Society (2000). All Rights Reserved. + +RFC 3161 - Internet X.509 Public Key Infrastructure Time-Stamp Protocol (TSP) + Copyright (C) The Internet Society (2001). All Rights Reserved. + +RFC 3280 - Internet X.509 Public Key Infrastructure, Certificate and + Certificate Revocation List (CRL) Profile + Copyright (C) The Internet Society (2002). All Rights Reserved. + +INTERNET-DRAFT - Persistent Search: A Simple LDAP Change Notification Mechanism + + Copyright (C) The Internet Society (1997-2000). All Rights Reserved. + +The following statement applies to each RFC: + + This document and translations of it may be copied and furnished to + others, and derivative works that comment on or otherwise explain it + or assist in its implementation may be prepared, copied, published + and distributed, in whole or in part, without restriction of any + kind, provided that the above copyright notice and this paragraph are + included on all such copies and derivative works. However, this + document itself may not be modified in any way, such as by removing + the copyright notice or references to the Internet Society or other + Internet organizations, except as needed for the purpose of + developing Internet standards in which case the procedures for + copyrights defined in the Internet Standards process must be + followed, or as required to translate it into languages other than + English. + + The limited permissions granted above are perpetual and will not be + revoked by the Internet Society or its successors or assigns. + + This document and the information contained herein is provided on an + "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING + TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION + HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF + MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + + +Notice for IETF RFCs from 2005 onwards +====================================== + +This distribution may contain software that is based in part on the work of +the following IETF RFCs. Portions of the IETF RFC specifications may be +included in source code comments for reference, and in accordance with +the licensing terms, the licenses are reproduced here: + +RFC 4122 - A Universally Unique Identifier (UUID) URN Namespace + Copyright (C) The Internet Society (2005). + + +The following statement applies to this RFC: + + Copyright (C) The Internet Society (2005). + + This document is subject to the rights, licenses and restrictions + contained in BCP 78, and except as set forth therein, the authors + retain all their rights. + + This document and the information contained herein are provided + on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE + REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND + THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT + THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR + ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A + PARTICULAR PURPOSE. + + + +=============================================================================== +=============================================================================== + + + +Notice for RSA Public-Key Cryptography Standards +================================================ + +Portions of Apache Harmony reference RSA Public-Key Cryptography Standards: +PKCS#7, PKCS#8 and PKSC#10. Portions of these standards are included +in Harmony Javadoc for reference, and in accordance with the licensing terms +for PKCS#7, PKCS#8 and PKSC#10, the full copyright statement is here: + +Copyright © 1991-1993 RSA Laboratories, a division of RSA Data Security, Inc. +License to copy this document is granted provided that it is identified as +"RSA Data Security, Inc. Public-Key Cryptography Standards (PKCS)" in all +material mentioning or referencing this document. + + + +=============================================================================== +=============================================================================== + + + +Notice for Apache Yoko +====================== + +This distribution may contain software that is based in part on Apache Yoko +for which the following notice applies: + +Apache Yoko is an effort undergoing incubation at the Apache Software +Foundation (ASF). Incubation is required of all newly accepted projects until +a further review indicates that the infrastructure, communications, and decision +making process have stabilized in a manner consistent with other successful +ASF projects. While incubation status is not necessarily a reflection of the +completeness or stability of the code, it does indicate that the project has +yet to be fully endorsed by the ASF. + +http://incubator.apache.org/yoko/ + + + +=============================================================================== +=============================================================================== + + + +Notice for the Eclipse JDT Core Batch Compiler +============================================== + +The license terms for the Eclipse JDT Core Batch Compiler are available at + http://www.eclipse.org/legal/epl-v10.html + + +Source code for the Eclipse JDT Core Batch Compiler can be found at: + http://download.eclipse.org/eclipse/downloads/ + +Navigate to the version of ECJ used in this distribution, and the source is +provided in a ZIP file in the section titled "JDT Core Batch Compiler". + + + +=============================================================================== +=============================================================================== + + + +License notice for the DejaVu fonts package +============================================== + +Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. +Glyphs imported from Arev fonts are (c) Tavmjung Bah (see below) + +Bitstream Vera Fonts Copyright +------------------------------ + +Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is +a trademark of Bitstream, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of the fonts accompanying this license ("Fonts") and associated +documentation files (the "Font Software"), to reproduce and distribute the +Font Software, including without limitation the rights to use, copy, merge, +publish, distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to the +following conditions: + +The above copyright and trademark notices and this permission notice shall +be included in all copies of one or more of the Font Software typefaces. + +The Font Software may be modified, altered, or added to, and in particular +the designs of glyphs or characters in the Fonts may be modified and +additional glyphs or characters may be added to the Fonts, only if the fonts +are renamed to names not containing either the words "Bitstream" or the word +"Vera". + +This License becomes null and void to the extent applicable to Fonts or Font +Software that has been modified and is distributed under the "Bitstream +Vera" names. + +The Font Software may be sold as part of a larger software package but no +copy of one or more of the Font Software typefaces may be sold by itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME +FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING +ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE +FONT SOFTWARE. + +Except as contained in this notice, the names of Gnome, the Gnome +Foundation, and Bitstream Inc., shall not be used in advertising or +otherwise to promote the sale, use or other dealings in this Font Software +without prior written authorization from the Gnome Foundation or Bitstream +Inc., respectively. For further information, contact: fonts at gnome dot +org. + +Arev Fonts Copyright +------------------------------ + +Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the fonts accompanying this license ("Fonts") and +associated documentation files (the "Font Software"), to reproduce +and distribute the modifications to the Bitstream Vera Font Software, +including without limitation the rights to use, copy, merge, publish, +distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to +the following conditions: + +The above copyright and trademark notices and this permission notice +shall be included in all copies of one or more of the Font Software +typefaces. + +The Font Software may be modified, altered, or added to, and in +particular the designs of glyphs or characters in the Fonts may be +modified and additional glyphs or characters may be added to the +Fonts, only if the fonts are renamed to names not containing either +the words "Tavmjong Bah" or the word "Arev". + +This License becomes null and void to the extent applicable to Fonts +or Font Software that has been modified and is distributed under the +"Tavmjong Bah Arev" names. + +The Font Software may be sold as part of a larger software package but +no copy of one or more of the Font Software typefaces may be sold by +itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL +TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +Except as contained in this notice, the name of Tavmjong Bah shall not +be used in advertising or otherwise to promote the sale, use or other +dealings in this Font Software without prior written authorization +from Tavmjong Bah. For further information, contact: tavmjong @ free +. fr. + + + +=============================================================================== +=============================================================================== + + + +License notice for ASM +======================= + + ASM: a very small and fast Java bytecode manipulation framework + Copyright (c) 2000-2005 INRIA, France Telecom + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. 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. + 3. Neither the name of the copyright holders 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. + + + +=============================================================================== +=============================================================================== + + + +License notice for Junit +======================== + +This distribution may contain a jar file based on Junit 4.2.1 for +which the following notice applies: + +Copyright 2001-2009 Kent Beck +Copyright 2000-2009 Erich Gamma +Copyright 2006-2009 David Saff + + Common Public License - v 1.0 + +THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC +LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM +CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + +1. DEFINITIONS + +"Contribution" means: + + a) in the case of the initial Contributor, the initial code and + documentation distributed under this Agreement, and + b) in the case of each subsequent Contributor: + + i) changes to the Program, and + + ii) additions to the Program; + + where such changes and/or additions to the Program originate from and are + distributed by that particular Contributor. A Contribution 'originates' + from a Contributor if it was added to the Program by such Contributor + itself or anyone acting on such Contributor's behalf. Contributions do not + include additions to the Program which: (i) are separate modules of + software distributed in conjunction with the Program under their own + license agreement, and (ii) are not derivative works of the Program. + +"Contributor" means any person or entity that distributes the Program. + +"Licensed Patents " mean patent claims licensable by a Contributor which are +necessarily infringed by the use or sale of its Contribution alone or when +combined with the Program. + +"Program" means the Contributions distributed in accordance with this +Agreement. + +"Recipient" means anyone who receives the Program under this Agreement, +including all Contributors. + +2. GRANT OF RIGHTS + + a) Subject to the terms of this Agreement, each Contributor hereby grants + Recipient a non-exclusive, worldwide, royalty-free copyright license to + reproduce, prepare derivative works of, publicly display, publicly perform, + distribute and sublicense the Contribution of such Contributor, if any, and + such derivative works, in source code and object code form. + + b) Subject to the terms of this Agreement, each Contributor hereby grants + Recipient a non-exclusive, worldwide, royalty-free patent license under + Licensed Patents to make, use, sell, offer to sell, import and otherwise + transfer the Contribution of such Contributor, if any, in source code and + object code form. This patent license shall apply to the combination of the + Contribution and the Program if, at the time the Contribution is added by + the Contributor, such addition of the Contribution causes such combination + to be covered by the Licensed Patents. The patent license shall not apply + to any other combinations which include the Contribution. No hardware per + se is licensed hereunder. + + c) Recipient understands that although each Contributor grants the licenses + to its Contributions set forth herein, no assurances are provided by any + Contributor that the Program does not infringe the patent or other + intellectual property rights of any other entity. Each Contributor + disclaims any liability to Recipient for claims brought by any other entity + based on infringement of intellectual property rights or otherwise. As a + condition to exercising the rights and licenses granted hereunder, each + Recipient hereby assumes sole responsibility to secure any other + intellectual property rights needed, if any. For example, if a third party + patent license is required to allow Recipient to distribute the Program, it + is Recipient's responsibility to acquire that license before distributing + the Program. + + d) Each Contributor represents that to its knowledge it has sufficient + copyright rights in its Contribution, if any, to grant the copyright + license set forth in this Agreement. + +3. REQUIREMENTS + +A Contributor may choose to distribute the Program in object code form under +its own license agreement, provided that: + + a) it complies with the terms and conditions of this Agreement; and + + b) its license agreement: + + i) effectively disclaims on behalf of all Contributors all warranties and + conditions, express and implied, including warranties or conditions of + title and non-infringement, and implied warranties or conditions of + merchantability and fitness for a particular purpose; + + ii) effectively excludes on behalf of all Contributors all liability for + damages, including direct, indirect, special, incidental and consequential + damages, such as lost profits; + + iii) states that any provisions which differ from this Agreement are + offered by that Contributor alone and not by any other party; and + + iv) states that source code for the Program is available from such + Contributor, and informs licensees how to obtain it in a reasonable manner + on or through a medium customarily used for software exchange. + +When the Program is made available in source code form: + + a) it must be made available under this Agreement; and + + b) a copy of this Agreement must be included with each copy of the Program. + + +Contributors may not remove or alter any copyright notices contained +within the Program. + +Each Contributor must identify itself as the originator of its Contribution, if +any, in a manner that reasonably allows subsequent Recipients to identify the +originator of the Contribution. + +4. COMMERCIAL DISTRIBUTION + +Commercial distributors of software may accept certain responsibilities with +respect to end users, business partners and the like. While this license is +intended to facilitate the commercial use of the Program, the Contributor who +includes the Program in a commercial product offering should do so in a manner +which does not create potential liability for other Contributors. Therefore, if +a Contributor includes the Program in a commercial product offering, such +Contributor ("Commercial Contributor") hereby agrees to defend and indemnify +every other Contributor ("Indemnified Contributor") against any losses, damages +and costs (collectively "Losses") arising from claims, lawsuits and other legal +actions brought by a third party against the Indemnified Contributor to the +extent caused by the acts or omissions of such Commercial Contributor in +connection with its distribution of the Program in a commercial product +offering. The obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In order +to qualify, an Indemnified Contributor must: a) promptly notify the Commercial +Contributor in writing of such claim, and b) allow the Commercial Contributor +to control, and cooperate with the Commercial Contributor in, the defense and +any related settlement negotiations. The Indemnified Contributor may +participate in any such claim at its own expense. + +For example, a Contributor might include the Program in a commercial product +offering, Product X. That Contributor is then a Commercial Contributor. If that +Commercial Contributor then makes performance claims, or offers warranties +related to Product X, those performance claims and warranties are such +Commercial Contributor's responsibility alone. Under this section, the +Commercial Contributor would have to defend claims against the other +Contributors related to those performance claims and warranties, and if a court +requires any other Contributor to pay any damages as a result, the Commercial +Contributor must pay those damages. + +5. NO WARRANTY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR +IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, +NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each +Recipient is solely responsible for determining the appropriateness of using +and distributing the Program and assumes all risks associated with its exercise +of rights under this Agreement, including but not limited to the risks and +costs of program errors, compliance with applicable laws, damage to or loss of +data, programs or equipment, and unavailability or interruption of operations. + +6. DISCLAIMER OF LIABILITY + +EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY +CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST +PROFITS), 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 OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS +GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. GENERAL + +If any provision of this Agreement is invalid or unenforceable under applicable +law, it shall not affect the validity or enforceability of the remainder of the +terms of this Agreement, and without further action by the parties hereto, such +provision shall be reformed to the minimum extent necessary to make such +provision valid and enforceable. + +If Recipient institutes patent litigation against a Contributor with respect to +a patent applicable to software (including a cross-claim or counterclaim in a +lawsuit), then any patent licenses granted by that Contributor to such +Recipient under this Agreement shall terminate as of the date such litigation +is filed. In addition, if Recipient institutes patent litigation against any +entity (including a cross-claim or counterclaim in a lawsuit) alleging that the +Program itself (excluding combinations of the Program with other software or +hardware) infringes such Recipient's patent(s), then such Recipient's rights +granted under Section 2(b) shall terminate as of the date such litigation is +filed. + +All Recipient's rights under this Agreement shall terminate if it fails to +comply with any of the material terms or conditions of this Agreement and does +not cure such failure in a reasonable period of time after becoming aware of +such noncompliance. If all Recipient's rights under this Agreement terminate, +Recipient agrees to cease use and distribution of the Program as soon as +reasonably practicable. However, Recipient's obligations under this Agreement +and any licenses granted by Recipient relating to the Program shall continue +and survive. + +Everyone is permitted to copy and distribute copies of this Agreement, but in +order to avoid inconsistency the Agreement is copyrighted and may only be +modified in the following manner. The Agreement Steward reserves the right to +publish new versions (including revisions) of this Agreement from time to time. +No one other than the Agreement Steward has the right to modify this Agreement. +IBM is the initial Agreement Steward. IBM may assign the responsibility to +serve as the Agreement Steward to a suitable separate entity. Each new version +of the Agreement will be given a distinguishing version number. The Program +(including Contributions) may always be distributed subject to the version of +the Agreement under which it was received. In addition, after a new version of +the Agreement is published, Contributor may elect to distribute the Program +(including its Contributions) under the new version. Except as expressly stated +in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to +the intellectual property of any Contributor under this Agreement, whether +expressly, by implication, estoppel or otherwise. All rights in the Program not +expressly granted under this Agreement are reserved. + +This Agreement is governed by the laws of the State of New York and the +intellectual property laws of the United States of America. No party to this +Agreement will bring a legal action under this Agreement more than one year +after the cause of action arose. Each party waives its rights to a jury trial +in any resulting litigation. + + + +=============================================================================== +=============================================================================== + + + +The Apache Harmony DRLVM uses the Apache Portable Runtime which +includes a number of subcomponents with separate copyright notices and +license terms. Your use of the source code for the these subcomponents +is subject to the terms and conditions of the following licenses. + +From strings/apr_fnmatch.c, include/apr_fnmatch.h, misc/unix/getopt.c, +file_io/unix/mktemp.c, strings/apr_strings.c: + +/* + * Copyright (c) 1987, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. 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. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University 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 REGENTS 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. + +From network_io/unix/inet_ntop.c, network_io/unix/inet_pton.c: + +/* Copyright (c) 1996 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE + * CONSORTIUM 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. + +From dso/aix/dso.c: + + * Based on libdl (dlfcn.c/dlfcn.h) which is + * Copyright (c) 1992,1993,1995,1996,1997,1988 + * Jens-Uwe Mager, Helios Software GmbH, Hannover, Germany. + * + * Not derived from licensed software. + * + * Permission is granted to freely use, copy, modify, and redistribute + * this software, provided that the author is not construed to be liable + * for any results of using the software, alterations are clearly marked + * as such, and this notice is not modified. + +From strings/apr_strnatcmp.c, include/apr_strings.h: + + strnatcmp.c -- Perform 'natural order' comparisons of strings in C. + Copyright (C) 2000 by Martin Pool + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + +From strings/apr_snprintf.c: + + * + * cvt - IEEE floating point formatting routines. + * Derived from UNIX V7, Copyright(C) Caldera International Inc. + * + + Copyright(C) Caldera International Inc. 2001-2002. 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 and documentation 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. + + All advertising materials mentioning features or use of this software + must display the following acknowledgement: + + This product includes software developed or owned by Caldera + International, Inc. + + Neither the name of Caldera International, Inc. nor the names of other + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA + INTERNATIONAL, INC. 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 CALDERA INTERNATIONAL, INC. 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. + + + +=============================================================================== +=============================================================================== + + + +License notice for Hamcrest +=========================== + +BSD License + +Copyright (c) 2000-2006, www.hamcrest.org +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 Hamcrest 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. + + + +=============================================================================== +=============================================================================== diff --git a/runtime/src/main/cpp/KString.cpp b/runtime/src/main/cpp/KString.cpp index 715618039a6..c1411e1b93e 100644 --- a/runtime/src/main/cpp/KString.cpp +++ b/runtime/src/main/cpp/KString.cpp @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -37,37 +36,20 @@ namespace { -// Container with STL-like iterator over raw data. -template -class Raw { - public: - Raw(T* start, uint32_t count) : start_(start), end_(start + count) {} - - T* begin() { return start_; } - T* end() { return end_; } - - private: - T* start_; - T* end_; -}; - - -OBJ_GETTER(utf8ToUtf16, Raw rawString) { - uint32_t charCount = utf8::distance(rawString.begin(), rawString.end()); +OBJ_GETTER(utf8ToUtf16, const char* rawString, size_t rawStringLength) { + uint32_t charCount = utf8::distance(rawString, rawString + rawStringLength); ArrayHeader* result = AllocArrayInstance( theStringTypeInfo, charCount, OBJ_RESULT)->array(); - Raw rawResult(CharArrayAddressOfElementAt(result, 0), charCount); + KChar* rawResult = CharArrayAddressOfElementAt(result, 0); auto convertResult = - utf8::utf8to16(rawString.begin(), rawString.end(), rawResult.begin()); - RuntimeAssert(rawResult.end() == convertResult, "Must properly fit"); + utf8::utf8to16(rawString, rawString + rawStringLength, rawResult); RETURN_OBJ(result->obj()); } template T parseInt(KString value, KInt radix) { - Raw utf16( - CharArrayAddressOfElementAt(value, 0), value->count_); + const KChar* utf16 = CharArrayAddressOfElementAt(value, 0); std::string utf8; - utf8::utf16to8(utf16.begin(), utf16.end(), back_inserter(utf8)); + utf8::utf16to8(utf16, utf16 + value->count_, back_inserter(utf8)); char* end = nullptr; long result = strtol(utf8.c_str(), &end, radix); if (end != utf8.c_str() + utf8.size()) { @@ -77,10 +59,9 @@ template T parseInt(KString value, KInt radix) { } KLong parseLong(KString value, KInt radix) { - Raw utf16( - CharArrayAddressOfElementAt(value, 0), value->count_); + const KChar* utf16 = CharArrayAddressOfElementAt(value, 0); std::string utf8; - utf8::utf16to8(utf16.begin(), utf16.end(), back_inserter(utf8)); + utf8::utf16to8(utf16, utf16 + value->count_, back_inserter(utf8)); char* end = nullptr; KLong result = strtoll(utf8.c_str(), &end, radix); if (end != utf8.c_str() + utf8.size()) { @@ -90,10 +71,9 @@ KLong parseLong(KString value, KInt radix) { } KFloat parseFloat(KString value) { - Raw utf16( - CharArrayAddressOfElementAt(value, 0), value->count_); + const KChar* utf16 = CharArrayAddressOfElementAt(value, 0); std::string utf8; - utf8::utf16to8(utf16.begin(), utf16.end(), back_inserter(utf8)); + utf8::utf16to8(utf16, utf16 + value->count_, back_inserter(utf8)); char* end = nullptr; KFloat result = strtof(utf8.c_str(), &end); if (end != utf8.c_str() + utf8.size()) { @@ -103,10 +83,10 @@ KFloat parseFloat(KString value) { } KDouble parseDouble(KString value) { - Raw utf16( - CharArrayAddressOfElementAt(value, 0), value->count_); + const KChar* utf16 = + CharArrayAddressOfElementAt(value, 0); std::string utf8; - utf8::utf16to8(utf16.begin(), utf16.end(), back_inserter(utf8)); + utf8::utf16to8(utf16, utf16 + value->count_, back_inserter(utf8)); char* end = nullptr; KDouble result = strtod(utf8.c_str(), &end); if (end != utf8.c_str() + utf8.size()) { @@ -115,16 +95,660 @@ KDouble parseDouble(KString value) { return result; } +// Case conversion is derived work from Apache Harmony. +// Unicode 3.0.1 (same as Unicode 3.0.0) +enum CharacterClass { + /** + * Unicode category constant Cn. + */ + UNASSIGNED = 0, + /** + * Unicode category constant Lu. + */ + UPPERCASE_LETTER = 1, + /** + * Unicode category constant Ll. + */ + LOWERCASE_LETTER = 2, + /** + * Unicode category constant Lt. + */ + TITLECASE_LETTER = 3, + /** + * Unicode category constant Lm. + */ + MODIFIER_LETTER = 4, + /** + * Unicode category constant Lo. + */ + OTHER_LETTER = 5, + /** + * Unicode category constant Mn. + */ + NON_SPACING_MARK = 6, + /** + * Unicode category constant Me. + */ + ENCLOSING_MARK = 7, + /** + * Unicode category constant Mc. + */ + COMBINING_SPACING_MARK = 8, + /** + * Unicode category constant Nd. + */ + DECIMAL_DIGIT_NUMBER = 9, + /** + * Unicode category constant Nl. + */ + LETTER_NUMBER = 10, + /** + * Unicode category constant No. + */ + OTHER_NUMBER = 11, + /** + * Unicode category constant Zs. + */ + SPACE_SEPARATOR = 12, + /** + * Unicode category constant Zl. + */ + LINE_SEPARATOR = 13, + /** + * Unicode category constant Zp. + */ + PARAGRAPH_SEPARATOR = 14, + /** + * Unicode category constant Cc. + */ + CONTROL = 15, + /** + * Unicode category constant Cf. + */ + FORMAT = 16, + /** + * Unicode category constant Co. + */ + PRIVATE_USE = 18, + /** + * Unicode category constant Cs. + */ + SURROGATE = 19, + /** + * Unicode category constant Pd. + */ + DASH_PUNCTUATION = 20, + /** + * Unicode category constant Ps. + */ + START_PUNCTUATION = 21, + /** + * Unicode category constant Pe. + */ + END_PUNCTUATION = 22, + /** + * Unicode category constant Pc. + */ + CONNECTOR_PUNCTUATION = 23, + /** + * Unicode category constant Po. + */ + OTHER_PUNCTUATION = 24, + /** + * Unicode category constant Sm. + */ + MATH_SYMBOL = 25, + /** + * Unicode category constant Sc. + */ + CURRENCY_SYMBOL = 26, + /** + * Unicode category constant Sk. + */ + MODIFIER_SYMBOL = 27, + /** + * Unicode category constant So. + */ + OTHER_SYMBOL = 28, + /** + * Unicode category constant Pi. + * + */ + INITIAL_QUOTE_PUNCTUATION = 29, + /** + * Unicode category constant Pf. + */ + FINAL_QUOTE_PUNCTUATION = 30 +}; + +constexpr KByte typeValuesCache[] = { + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 12, 24, 24, 24, 26, 24, 24, 24, 21, 22, 24, 25, 24, 20, 24, 24, + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 24, 24, 25, 25, 25, 24, + 24, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 21, 24, 22, 27, 23, + 27, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21, 25, 22, 25, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 12, 24, 26, 26, 26, 26, 28, 28, 27, 28, 2, 29, 25, 16, 28, 27, + 28, 25, 11, 11, 27, 2, 28, 24, 27, 11, 2, 30, 11, 11, 11, 24, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 25, 1, 1, 1, 1, 1, 1, 1, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 25, 2, 2, 2, 2, 2, 2, 2, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, + 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 2, 2, + 2, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 2, 2, 1, 1, + 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 2, 2, 1, 1, 2, 1, + 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 2, 1, 1, + 2, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 5, 1, 2, 2, 2, + 5, 5, 5, 5, 1, 3, 2, 1, 3, 2, 1, 3, 2, 1, 2, 1, + 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 2, 1, 3, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 27, 27, 27, 27, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 4, 4, 4, 4, 4, 27, 27, 27, 27, 27, 27, 27, 27, 27, 4, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 0, 0, 0, 0, 27, 27, 0, 0, 0, 0, 4, 0, 0, 0, 24, 0, + 0, 0, 0, 0, 27, 27, 1, 24, 1, 1, 1, 0, 1, 0, 1, 1, + 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, + 2, 2, 1, 1, 1, 2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2 +}; + +constexpr KShort uppercaseValuesCache[] = { + 924, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 247, 216, 217, 218, 219, 220, 221, 222, 376, 256, 256, 258, 258, 260, + 260, 262, 262, 264, 264, 266, 266, 268, 268, 270, 270, 272, 272, 274, 274, 276, + 276, 278, 278, 280, 280, 282, 282, 284, 284, 286, 286, 288, 288, 290, 290, 292, + 292, 294, 294, 296, 296, 298, 298, 300, 300, 302, 302, 304, 73, 306, 306, 308, + 308, 310, 310, 312, 313, 313, 315, 315, 317, 317, 319, 319, 321, 321, 323, 323, + 325, 325, 327, 327, 329, 330, 330, 332, 332, 334, 334, 336, 336, 338, 338, 340, + 340, 342, 342, 344, 344, 346, 346, 348, 348, 350, 350, 352, 352, 354, 354, 356, + 356, 358, 358, 360, 360, 362, 362, 364, 364, 366, 366, 368, 368, 370, 370, 372, + 372, 374, 374, 376, 377, 377, 379, 379, 381, 381, 83, 384, 385, 386, 386, 388, + 388, 390, 391, 391, 393, 394, 395, 395, 397, 398, 399, 400, 401, 401, 403, 404, + 502, 406, 407, 408, 408, 410, 411, 412, 413, 544, 415, 416, 416, 418, 418, 420, + 420, 422, 423, 423, 425, 426, 427, 428, 428, 430, 431, 431, 433, 434, 435, 435, + 437, 437, 439, 440, 440, 442, 443, 444, 444, 446, 503, 448, 449, 450, 451, 452, + 452, 452, 455, 455, 455, 458, 458, 458, 461, 461, 463, 463, 465, 465, 467, 467, + 469, 469, 471, 471, 473, 473, 475, 475, 398, 478, 478, 480, 480, 482, 482, 484, + 484, 486, 486, 488, 488, 490, 490, 492, 492, 494, 494, 496, 497, 497, 497, 500, + 500, 502, 503, 504, 504, 506, 506, 508, 508, 510, 510, 512, 512, 514, 514, 516, + 516, 518, 518, 520, 520, 522, 522, 524, 524, 526, 526, 528, 528, 530, 530, 532, + 532, 534, 534, 536, 536, 538, 538, 540, 540, 542, 542, 544, 545, 546, 546, 548, + 548, 550, 550, 552, 552, 554, 554, 556, 556, 558, 558, 560, 560, 562, 562, 564, + 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, + 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 385, 390, + 597, 393, 394, 600, 399, 602, 400, 604, 605, 606, 607, 403, 609, 610, 404, 612, + 613, 614, 615, 407, 406, 618, 619, 620, 621, 622, 412, 624, 625, 413, 627, 628, + 415, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 422, 641, 642, 425, 644, + 645, 646, 647, 430, 649, 433, 434, 652, 653, 654, 655, 656, 657, 439, 659, 660, + 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, + 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, + 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, + 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, + 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, + 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, + 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, + 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, + 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, + 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, + 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, + 921, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, + 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, + 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, + 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, + 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, + 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, + 933, 934, 935, 936, 937, 938, 939, 902, 904, 905, 906, 944, 913, 914, 915, 916, + 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 931, 932, + 933, 934, 935, 936, 937, 938, 939, 908, 910, 911, 975, 914, 920, 978, 979, 980, + 934, 928, 983, 984, 984, 986, 986, 988, 988, 990, 990, 992, 992, 994, 994, 996, + 996, 998, 998 +}; + +constexpr KShort lowercaseValuesCache[] = { + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 215, 248, 249, 250, 251, 252, 253, 254, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 257, 257, 259, 259, 261, 261, 263, 263, 265, 265, 267, 267, 269, 269, 271, 271, + 273, 273, 275, 275, 277, 277, 279, 279, 281, 281, 283, 283, 285, 285, 287, 287, + 289, 289, 291, 291, 293, 293, 295, 295, 297, 297, 299, 299, 301, 301, 303, 303, + 105, 305, 307, 307, 309, 309, 311, 311, 312, 314, 314, 316, 316, 318, 318, 320, + 320, 322, 322, 324, 324, 326, 326, 328, 328, 329, 331, 331, 333, 333, 335, 335, + 337, 337, 339, 339, 341, 341, 343, 343, 345, 345, 347, 347, 349, 349, 351, 351, + 353, 353, 355, 355, 357, 357, 359, 359, 361, 361, 363, 363, 365, 365, 367, 367, + 369, 369, 371, 371, 373, 373, 375, 375, 255, 378, 378, 380, 380, 382, 382, 383, + 384, 595, 387, 387, 389, 389, 596, 392, 392, 598, 599, 396, 396, 397, 477, 601, + 603, 402, 402, 608, 611, 405, 617, 616, 409, 409, 410, 411, 623, 626, 414, 629, + 417, 417, 419, 419, 421, 421, 640, 424, 424, 643, 426, 427, 429, 429, 648, 432, + 432, 650, 651, 436, 436, 438, 438, 658, 441, 441, 442, 443, 445, 445, 446, 447, + 448, 449, 450, 451, 454, 454, 454, 457, 457, 457, 460, 460, 460, 462, 462, 464, + 464, 466, 466, 468, 468, 470, 470, 472, 472, 474, 474, 476, 476, 477, 479, 479, + 481, 481, 483, 483, 485, 485, 487, 487, 489, 489, 491, 491, 493, 493, 495, 495, + 496, 499, 499, 499, 501, 501, 405, 447, 505, 505, 507, 507, 509, 509, 511, 511, + 513, 513, 515, 515, 517, 517, 519, 519, 521, 521, 523, 523, 525, 525, 527, 527, + 529, 529, 531, 531, 533, 533, 535, 535, 537, 537, 539, 539, 541, 541, 543, 543, + 414, 545, 547, 547, 549, 549, 551, 551, 553, 553, 555, 555, 557, 557, 559, 559, + 561, 561, 563, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, + 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, + 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, + 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, + 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, + 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, + 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, + 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, + 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, + 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, + 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, + 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, + 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, + 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, + 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, + 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, + 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, + 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, + 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, + 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, + 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, + 896, 897, 898, 899, 900, 901, 940, 903, 941, 942, 943, 907, 972, 909, 973, 974, + 912, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, + 960, 961, 930, 963, 964, 965, 966, 967, 968, 969, 970, 971, 940, 941, 942, 943, + 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, + 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, + 976, 977, 978, 979, 980, 981, 982, 983, 985, 985, 987, 987, 989, 989, 991, 991, + 993, 993, 995, 995, 997, 997, 999, 999 +}; + +constexpr KChar uppercaseKeys[] = { + 0x61, 0xb5, 0xe0, 0xf8, 0xff, 0x101, 0x131, 0x133, 0x13a, 0x14b, 0x17a, 0x17f, 0x183, 0x188, 0x18c, 0x192, 0x195, 0x199, 0x1a1, 0x1a8, + 0x1ad, 0x1b0, 0x1b4, 0x1b9, 0x1bd, 0x1bf, 0x1c5, 0x1c6, 0x1c8, 0x1c9, 0x1cb, 0x1cc, 0x1ce, 0x1dd, 0x1df, 0x1f2, 0x1f3, 0x1f5, 0x1f9, 0x223, + 0x253, 0x254, 0x256, 0x259, 0x25b, 0x260, 0x263, 0x268, 0x269, 0x26f, 0x272, 0x275, 0x280, 0x283, 0x288, 0x28a, 0x292, 0x345, 0x3ac, 0x3ad, + 0x3b1, 0x3c2, 0x3c3, 0x3cc, 0x3cd, 0x3d0, 0x3d1, 0x3d5, 0x3d6, 0x3db, 0x3f0, 0x3f1, 0x3f2, 0x430, 0x450, 0x461, 0x48d, 0x4c2, 0x4c8, 0x4cc, + 0x4d1, 0x4f9, 0x561, 0x1e01, 0x1e9b, 0x1ea1, 0x1f00, 0x1f10, 0x1f20, 0x1f30, 0x1f40, 0x1f51, 0x1f60, 0x1f70, 0x1f72, 0x1f76, 0x1f78, 0x1f7a, 0x1f7c, 0x1f80, + 0x1f90, 0x1fa0, 0x1fb0, 0x1fb3, 0x1fbe, 0x1fc3, 0x1fd0, 0x1fe0, 0x1fe5, 0x1ff3, 0x2170, 0x24d0, 0xff41 +}; + +constexpr KChar uppercaseValues[] = { + 0x7a, 0xffe0, 0xb5, 0x2e7, 0xf6, 0xffe0, 0xfe, 0xffe0, 0xff, 0x79, 0x812f, 0xffff, 0x131, 0xff18, 0x8137, 0xffff, 0x8148, 0xffff, 0x8177, 0xffff, + 0x817e, 0xffff, 0x17f, 0xfed4, 0x8185, 0xffff, 0x188, 0xffff, 0x18c, 0xffff, 0x192, 0xffff, 0x195, 0x61, 0x199, 0xffff, 0x81a5, 0xffff, 0x1a8, 0xffff, + 0x1ad, 0xffff, 0x1b0, 0xffff, 0x81b6, 0xffff, 0x1b9, 0xffff, 0x1bd, 0xffff, 0x1bf, 0x38, 0x1c5, 0xffff, 0x1c6, 0xfffe, 0x1c8, 0xffff, 0x1c9, 0xfffe, + 0x1cb, 0xffff, 0x1cc, 0xfffe, 0x81dc, 0xffff, 0x1dd, 0xffb1, 0x81ef, 0xffff, 0x1f2, 0xffff, 0x1f3, 0xfffe, 0x1f5, 0xffff, 0x821f, 0xffff, 0x8233, 0xffff, + 0x253, 0xff2e, 0x254, 0xff32, 0x257, 0xff33, 0x259, 0xff36, 0x25b, 0xff35, 0x260, 0xff33, 0x263, 0xff31, 0x268, 0xff2f, 0x269, 0xff2d, 0x26f, 0xff2d, + 0x272, 0xff2b, 0x275, 0xff2a, 0x280, 0xff26, 0x283, 0xff26, 0x288, 0xff26, 0x28b, 0xff27, 0x292, 0xff25, 0x345, 0x54, 0x3ac, 0xffda, 0x3af, 0xffdb, + 0x3c1, 0xffe0, 0x3c2, 0xffe1, 0x3cb, 0xffe0, 0x3cc, 0xffc0, 0x3ce, 0xffc1, 0x3d0, 0xffc2, 0x3d1, 0xffc7, 0x3d5, 0xffd1, 0x3d6, 0xffca, 0x83ef, 0xffff, + 0x3f0, 0xffaa, 0x3f1, 0xffb0, 0x3f2, 0xffb1, 0x44f, 0xffe0, 0x45f, 0xffb0, 0x8481, 0xffff, 0x84bf, 0xffff, 0x84c4, 0xffff, 0x4c8, 0xffff, 0x4cc, 0xffff, + 0x84f5, 0xffff, 0x4f9, 0xffff, 0x586, 0xffd0, 0x9e95, 0xffff, 0x1e9b, 0xffc5, 0x9ef9, 0xffff, 0x1f07, 0x8, 0x1f15, 0x8, 0x1f27, 0x8, 0x1f37, 0x8, + 0x1f45, 0x8, 0x9f57, 0x8, 0x1f67, 0x8, 0x1f71, 0x4a, 0x1f75, 0x56, 0x1f77, 0x64, 0x1f79, 0x80, 0x1f7b, 0x70, 0x1f7d, 0x7e, 0x1f87, 0x8, + 0x1f97, 0x8, 0x1fa7, 0x8, 0x1fb1, 0x8, 0x1fb3, 0x9, 0x1fbe, 0xe3db, 0x1fc3, 0x9, 0x1fd1, 0x8, 0x1fe1, 0x8, 0x1fe5, 0x7, 0x1ff3, 0x9, + 0x217f, 0xfff0, 0x24e9, 0xffe6, 0xff5a, 0xffe0 +}; + +constexpr KChar lowercaseKeys[] = { + 0x41, 0xc0, 0xd8, 0x100, 0x130, 0x132, 0x139, 0x14a, 0x178, 0x179, 0x181, 0x182, 0x186, 0x187, 0x189, 0x18b, 0x18e, 0x18f, 0x190, 0x191, + 0x193, 0x194, 0x196, 0x197, 0x198, 0x19c, 0x19d, 0x19f, 0x1a0, 0x1a6, 0x1a7, 0x1a9, 0x1ac, 0x1ae, 0x1af, 0x1b1, 0x1b3, 0x1b7, 0x1b8, 0x1bc, + 0x1c4, 0x1c5, 0x1c7, 0x1c8, 0x1ca, 0x1cb, 0x1de, 0x1f1, 0x1f2, 0x1f6, 0x1f7, 0x1f8, 0x222, 0x386, 0x388, 0x38c, 0x38e, 0x391, 0x3a3, 0x3da, + 0x400, 0x410, 0x460, 0x48c, 0x4c1, 0x4c7, 0x4cb, 0x4d0, 0x4f8, 0x531, 0x1e00, 0x1ea0, 0x1f08, 0x1f18, 0x1f28, 0x1f38, 0x1f48, 0x1f59, 0x1f68, 0x1f88, + 0x1f98, 0x1fa8, 0x1fb8, 0x1fba, 0x1fbc, 0x1fc8, 0x1fcc, 0x1fd8, 0x1fda, 0x1fe8, 0x1fea, 0x1fec, 0x1ff8, 0x1ffa, 0x1ffc, 0x2126, 0x212a, 0x212b, 0x2160, 0x24b6 +}; + +constexpr KChar lowercaseValues[] = { + 0x5a, 0x20, 0xd6, 0x20, 0xde, 0x20, 0x812e, 0x1, 0x130, 0xff39, 0x8136, 0x1, 0x8147, 0x1, 0x8176, 0x1, 0x178, 0xff87, 0x817d, 0x1, + 0x181, 0xd2, 0x8184, 0x1, 0x186, 0xce, 0x187, 0x1, 0x18a, 0xcd, 0x18b, 0x1, 0x18e, 0x4f, 0x18f, 0xca, 0x190, 0xcb, 0x191, 0x1, + 0x193, 0xcd, 0x194, 0xcf, 0x196, 0xd3, 0x197, 0xd1, 0x198, 0x1, 0x19c, 0xd3, 0x19d, 0xd5, 0x19f, 0xd6, 0x81a4, 0x1, 0x1a6, 0xda, + 0x1a7, 0x1, 0x1a9, 0xda, 0x1ac, 0x1, 0x1ae, 0xda, 0x1af, 0x1, 0x1b2, 0xd9, 0x81b5, 0x1, 0x1b7, 0xdb, 0x1b8, 0x1, 0x1bc, 0x1, + 0x1c4, 0x2, 0x1c5, 0x1, 0x1c7, 0x2, 0x1c8, 0x1, 0x1ca, 0x2, 0x81db, 0x1, 0x81ee, 0x1, 0x1f1, 0x2, 0x81f4, 0x1, 0x1f6, 0xff9f, + 0x1f7, 0xffc8, 0x821e, 0x1, 0x8232, 0x1, 0x386, 0x26, 0x38a, 0x25, 0x38c, 0x40, 0x38f, 0x3f, 0x3a1, 0x20, 0x3ab, 0x20, 0x83ee, 0x1, + 0x40f, 0x50, 0x42f, 0x20, 0x8480, 0x1, 0x84be, 0x1, 0x84c3, 0x1, 0x4c7, 0x1, 0x4cb, 0x1, 0x84f4, 0x1, 0x4f8, 0x1, 0x556, 0x30, + 0x9e94, 0x1, 0x9ef8, 0x1, 0x1f0f, 0xfff8, 0x1f1d, 0xfff8, 0x1f2f, 0xfff8, 0x1f3f, 0xfff8, 0x1f4d, 0xfff8, 0x9f5f, 0xfff8, 0x1f6f, 0xfff8, 0x1f8f, 0xfff8, + 0x1f9f, 0xfff8, 0x1faf, 0xfff8, 0x1fb9, 0xfff8, 0x1fbb, 0xffb6, 0x1fbc, 0xfff7, 0x1fcb, 0xffaa, 0x1fcc, 0xfff7, 0x1fd9, 0xfff8, 0x1fdb, 0xff9c, 0x1fe9, 0xfff8, + 0x1feb, 0xff90, 0x1fec, 0xfff9, 0x1ff9, 0xff80, 0x1ffb, 0xff82, 0x1ffc, 0xfff7, 0x2126, 0xe2a3, 0x212a, 0xdf41, 0x212b, 0xdfba, 0x216f, 0x10, 0x24cf, 0x1a +}; + +constexpr KChar digitKeys[] = { + 0x30, 0x41, 0x61, 0x660, 0x6f0, 0x966, 0x9e6, 0xa66, 0xae6, 0xb66, 0xbe7, 0xc66, 0xce6, 0xd66, 0xe50, 0xed0, 0xf20, 0x1040, 0x1369, 0x17e0, + 0x1810, 0xff10, 0xff21, 0xff41 +}; + +constexpr KChar digitValues[] = { + 0x39, 0x30, 0x5a, 0x37, 0x7a, 0x57, 0x669, 0x660, 0x6f9, 0x6f0, 0x96f, 0x966, 0x9ef, 0x9e6, 0xa6f, 0xa66, 0xaef, 0xae6, 0xb6f, 0xb66, + 0xbef, 0xbe6, 0xc6f, 0xc66, 0xcef, 0xce6, 0xd6f, 0xd66, 0xe59, 0xe50, 0xed9, 0xed0, 0xf29, 0xf20, 0x1049, 0x1040, 0x1371, 0x1368, 0x17e9, 0x17e0, + 0x1819, 0x1810, 0xff19, 0xff10, 0xff3a, 0xff17, 0xff5a, 0xff37 +}; + +constexpr KChar typeKeys[] = { + 0x0, 0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2d, 0x2f, 0x31, 0x3a, 0x3c, 0x3f, 0x41, 0x5b, 0x5d, 0x5f, 0x61, 0x7b, 0x7d, + 0x7f, 0xa0, 0xa2, 0xa6, 0xa8, 0xaa, 0xac, 0xae, 0xb1, 0xb3, 0xb5, 0xb7, 0xb9, 0xbb, 0xbd, 0xbf, 0xc1, 0xd7, 0xd9, 0xdf, + 0xf7, 0xf9, 0x100, 0x138, 0x149, 0x179, 0x17f, 0x181, 0x183, 0x187, 0x18a, 0x18c, 0x18e, 0x192, 0x194, 0x197, 0x199, 0x19c, 0x19e, 0x1a0, + 0x1a7, 0x1ab, 0x1af, 0x1b2, 0x1b4, 0x1b8, 0x1ba, 0x1bc, 0x1be, 0x1c0, 0x1c4, 0x1c6, 0x1c8, 0x1ca, 0x1cc, 0x1dd, 0x1f0, 0x1f2, 0x1f4, 0x1f7, + 0x1f9, 0x222, 0x250, 0x2b0, 0x2b9, 0x2bb, 0x2c2, 0x2d0, 0x2d2, 0x2e0, 0x2e5, 0x2ee, 0x300, 0x360, 0x374, 0x37a, 0x37e, 0x384, 0x386, 0x389, + 0x38c, 0x38e, 0x390, 0x392, 0x3a3, 0x3ac, 0x3d0, 0x3d2, 0x3d5, 0x3da, 0x3f0, 0x400, 0x430, 0x460, 0x482, 0x484, 0x488, 0x48c, 0x4c1, 0x4c7, + 0x4cb, 0x4d0, 0x4f8, 0x531, 0x559, 0x55b, 0x561, 0x589, 0x591, 0x5a3, 0x5bb, 0x5be, 0x5c2, 0x5d0, 0x5f0, 0x5f3, 0x60c, 0x61b, 0x61f, 0x621, + 0x640, 0x642, 0x64b, 0x660, 0x66a, 0x670, 0x672, 0x6d4, 0x6d6, 0x6dd, 0x6df, 0x6e5, 0x6e7, 0x6e9, 0x6eb, 0x6f0, 0x6fa, 0x6fd, 0x700, 0x70f, + 0x711, 0x713, 0x730, 0x780, 0x7a6, 0x901, 0x903, 0x905, 0x93c, 0x93e, 0x941, 0x949, 0x94d, 0x950, 0x952, 0x958, 0x962, 0x964, 0x966, 0x970, + 0x981, 0x983, 0x985, 0x98f, 0x993, 0x9aa, 0x9b2, 0x9b6, 0x9bc, 0x9be, 0x9c1, 0x9c7, 0x9cb, 0x9cd, 0x9d7, 0x9dc, 0x9df, 0x9e2, 0x9e6, 0x9f0, + 0x9f2, 0x9f4, 0x9fa, 0xa02, 0xa05, 0xa0f, 0xa13, 0xa2a, 0xa32, 0xa35, 0xa38, 0xa3c, 0xa3e, 0xa41, 0xa47, 0xa4b, 0xa59, 0xa5e, 0xa66, 0xa70, + 0xa72, 0xa81, 0xa83, 0xa85, 0xa8d, 0xa8f, 0xa93, 0xaaa, 0xab2, 0xab5, 0xabc, 0xabe, 0xac1, 0xac7, 0xac9, 0xacb, 0xacd, 0xad0, 0xae0, 0xae6, + 0xb01, 0xb03, 0xb05, 0xb0f, 0xb13, 0xb2a, 0xb32, 0xb36, 0xb3c, 0xb3e, 0xb42, 0xb47, 0xb4b, 0xb4d, 0xb56, 0xb5c, 0xb5f, 0xb66, 0xb70, 0xb82, + 0xb85, 0xb8e, 0xb92, 0xb99, 0xb9c, 0xb9e, 0xba3, 0xba8, 0xbae, 0xbb7, 0xbbe, 0xbc0, 0xbc2, 0xbc6, 0xbca, 0xbcd, 0xbd7, 0xbe7, 0xbf0, 0xc01, + 0xc05, 0xc0e, 0xc12, 0xc2a, 0xc35, 0xc3e, 0xc41, 0xc46, 0xc4a, 0xc55, 0xc60, 0xc66, 0xc82, 0xc85, 0xc8e, 0xc92, 0xcaa, 0xcb5, 0xcbe, 0xcc1, + 0xcc6, 0xcc8, 0xcca, 0xccc, 0xcd5, 0xcde, 0xce0, 0xce6, 0xd02, 0xd05, 0xd0e, 0xd12, 0xd2a, 0xd3e, 0xd41, 0xd46, 0xd4a, 0xd4d, 0xd57, 0xd60, + 0xd66, 0xd82, 0xd85, 0xd9a, 0xdb3, 0xdbd, 0xdc0, 0xdca, 0xdcf, 0xdd2, 0xdd6, 0xdd8, 0xdf2, 0xdf4, 0xe01, 0xe31, 0xe33, 0xe35, 0xe3f, 0xe41, + 0xe46, 0xe48, 0xe4f, 0xe51, 0xe5a, 0xe81, 0xe84, 0xe87, 0xe8a, 0xe8d, 0xe94, 0xe99, 0xea1, 0xea5, 0xea7, 0xeaa, 0xead, 0xeb1, 0xeb3, 0xeb5, + 0xebb, 0xebd, 0xec0, 0xec6, 0xec8, 0xed0, 0xedc, 0xf00, 0xf02, 0xf04, 0xf13, 0xf18, 0xf1a, 0xf20, 0xf2a, 0xf34, 0xf3a, 0xf3e, 0xf40, 0xf49, + 0xf71, 0xf7f, 0xf81, 0xf85, 0xf87, 0xf89, 0xf90, 0xf99, 0xfbe, 0xfc6, 0xfc8, 0xfcf, 0x1000, 0x1023, 0x1029, 0x102c, 0x102e, 0x1031, 0x1036, 0x1038, + 0x1040, 0x104a, 0x1050, 0x1056, 0x1058, 0x10a0, 0x10d0, 0x10fb, 0x1100, 0x115f, 0x11a8, 0x1200, 0x1208, 0x1248, 0x124a, 0x1250, 0x1258, 0x125a, 0x1260, 0x1288, + 0x128a, 0x1290, 0x12b0, 0x12b2, 0x12b8, 0x12c0, 0x12c2, 0x12c8, 0x12d0, 0x12d8, 0x12f0, 0x1310, 0x1312, 0x1318, 0x1320, 0x1348, 0x1361, 0x1369, 0x1372, 0x13a0, + 0x1401, 0x166d, 0x166f, 0x1680, 0x1682, 0x169b, 0x16a0, 0x16eb, 0x16ee, 0x1780, 0x17b4, 0x17b7, 0x17be, 0x17c6, 0x17c8, 0x17ca, 0x17d4, 0x17db, 0x17e0, 0x1800, + 0x1806, 0x1808, 0x180b, 0x1810, 0x1820, 0x1843, 0x1845, 0x1880, 0x18a9, 0x1e00, 0x1e96, 0x1ea0, 0x1f00, 0x1f08, 0x1f10, 0x1f18, 0x1f20, 0x1f28, 0x1f30, 0x1f38, + 0x1f40, 0x1f48, 0x1f50, 0x1f59, 0x1f5b, 0x1f5d, 0x1f5f, 0x1f61, 0x1f68, 0x1f70, 0x1f80, 0x1f88, 0x1f90, 0x1f98, 0x1fa0, 0x1fa8, 0x1fb0, 0x1fb6, 0x1fb8, 0x1fbc, + 0x1fbe, 0x1fc0, 0x1fc2, 0x1fc6, 0x1fc8, 0x1fcc, 0x1fce, 0x1fd0, 0x1fd6, 0x1fd8, 0x1fdd, 0x1fe0, 0x1fe8, 0x1fed, 0x1ff2, 0x1ff6, 0x1ff8, 0x1ffc, 0x1ffe, 0x2000, + 0x200c, 0x2010, 0x2016, 0x2018, 0x201a, 0x201c, 0x201e, 0x2020, 0x2028, 0x202a, 0x202f, 0x2031, 0x2039, 0x203b, 0x203f, 0x2041, 0x2044, 0x2046, 0x2048, 0x206a, + 0x2070, 0x2074, 0x207a, 0x207d, 0x207f, 0x2081, 0x208a, 0x208d, 0x20a0, 0x20d0, 0x20dd, 0x20e1, 0x20e3, 0x2100, 0x2102, 0x2104, 0x2107, 0x2109, 0x210b, 0x210e, + 0x2110, 0x2113, 0x2115, 0x2117, 0x2119, 0x211e, 0x2124, 0x212b, 0x212e, 0x2130, 0x2132, 0x2134, 0x2136, 0x2139, 0x2153, 0x2160, 0x2190, 0x2195, 0x219a, 0x219c, + 0x21a0, 0x21a2, 0x21a5, 0x21a8, 0x21ae, 0x21b0, 0x21ce, 0x21d0, 0x21d2, 0x21d6, 0x2200, 0x2300, 0x2308, 0x230c, 0x2320, 0x2322, 0x2329, 0x232b, 0x237d, 0x2400, + 0x2440, 0x2460, 0x249c, 0x24ea, 0x2500, 0x25a0, 0x25b7, 0x25b9, 0x25c1, 0x25c3, 0x2600, 0x2619, 0x266f, 0x2671, 0x2701, 0x2706, 0x270c, 0x2729, 0x274d, 0x274f, + 0x2756, 0x2758, 0x2761, 0x2776, 0x2794, 0x2798, 0x27b1, 0x2800, 0x2e80, 0x2e9b, 0x2f00, 0x2ff0, 0x3000, 0x3002, 0x3004, 0x3006, 0x3008, 0x3012, 0x3014, 0x301c, + 0x301e, 0x3020, 0x3022, 0x302a, 0x3030, 0x3032, 0x3036, 0x3038, 0x303e, 0x3041, 0x3099, 0x309b, 0x309d, 0x30a1, 0x30fb, 0x30fd, 0x3105, 0x3131, 0x3190, 0x3192, + 0x3196, 0x31a0, 0x3200, 0x3220, 0x322a, 0x3260, 0x327f, 0x3281, 0x328a, 0x32c0, 0x32d0, 0x3300, 0x337b, 0x33e0, 0x3400, 0x4e00, 0xa000, 0xa490, 0xa4a4, 0xa4b5, + 0xa4c2, 0xa4c6, 0xac00, 0xd800, 0xe000, 0xf900, 0xfb00, 0xfb13, 0xfb1d, 0xfb20, 0xfb29, 0xfb2b, 0xfb38, 0xfb3e, 0xfb40, 0xfb43, 0xfb46, 0xfbd3, 0xfd3e, 0xfd50, + 0xfd92, 0xfdf0, 0xfe20, 0xfe30, 0xfe32, 0xfe34, 0xfe36, 0xfe49, 0xfe4d, 0xfe50, 0xfe54, 0xfe58, 0xfe5a, 0xfe5f, 0xfe62, 0xfe65, 0xfe68, 0xfe6b, 0xfe70, 0xfe74, + 0xfe76, 0xfeff, 0xff01, 0xff04, 0xff06, 0xff08, 0xff0a, 0xff0d, 0xff0f, 0xff11, 0xff1a, 0xff1c, 0xff1f, 0xff21, 0xff3b, 0xff3d, 0xff3f, 0xff41, 0xff5b, 0xff5d, + 0xff61, 0xff63, 0xff65, 0xff67, 0xff70, 0xff72, 0xff9e, 0xffa0, 0xffc2, 0xffca, 0xffd2, 0xffda, 0xffe0, 0xffe2, 0xffe4, 0xffe6, 0xffe8, 0xffea, 0xffed, 0xfff9, + 0xfffc +}; + +constexpr KChar typeValues[] = { + 0x1f, 0xf, 0x21, 0x180c, 0x23, 0x18, 0x25, 0x181a, 0x27, 0x18, 0x29, 0x1615, 0x2c, 0x1918, 0x2e, 0x1418, 0x30, 0x1809, 0x39, 0x9, + 0x3b, 0x18, 0x3e, 0x19, 0x40, 0x18, 0x5a, 0x1, 0x5c, 0x1518, 0x5e, 0x161b, 0x60, 0x171b, 0x7a, 0x2, 0x7c, 0x1519, 0x7e, 0x1619, + 0x9f, 0xf, 0xa1, 0x180c, 0xa5, 0x1a, 0xa7, 0x1c, 0xa9, 0x1c1b, 0xab, 0x1d02, 0xad, 0x1419, 0xb0, 0x1b1c, 0xb2, 0x190b, 0xb4, 0xb1b, + 0xb6, 0x21c, 0xb8, 0x181b, 0xba, 0xb02, 0xbc, 0x1e0b, 0xbe, 0xb, 0xc0, 0x1801, 0xd6, 0x1, 0xd8, 0x1901, 0xde, 0x1, 0xf6, 0x2, + 0xf8, 0x1902, 0xff, 0x2, 0x137, 0x201, 0x148, 0x102, 0x178, 0x201, 0x17e, 0x102, 0x180, 0x2, 0x182, 0x1, 0x186, 0x201, 0x189, 0x102, + 0x18b, 0x1, 0x18d, 0x2, 0x191, 0x1, 0x193, 0x102, 0x196, 0x201, 0x198, 0x1, 0x19b, 0x2, 0x19d, 0x1, 0x19f, 0x102, 0x1a6, 0x201, + 0x1aa, 0x102, 0x1ae, 0x201, 0x1b1, 0x102, 0x1b3, 0x1, 0x1b7, 0x102, 0x1b9, 0x201, 0x1bb, 0x502, 0x1bd, 0x201, 0x1bf, 0x2, 0x1c3, 0x5, + 0x1c5, 0x301, 0x1c7, 0x102, 0x1c9, 0x203, 0x1cb, 0x301, 0x1dc, 0x102, 0x1ef, 0x201, 0x1f1, 0x102, 0x1f3, 0x203, 0x1f6, 0x201, 0x1f8, 0x1, + 0x21f, 0x201, 0x233, 0x201, 0x2ad, 0x2, 0x2b8, 0x4, 0x2ba, 0x1b, 0x2c1, 0x4, 0x2cf, 0x1b, 0x2d1, 0x4, 0x2df, 0x1b, 0x2e4, 0x4, + 0x2ed, 0x1b, 0x2ee, 0x4, 0x34e, 0x6, 0x362, 0x6, 0x375, 0x1b, 0x37a, 0x4, 0x37e, 0x18, 0x385, 0x1b, 0x388, 0x1801, 0x38a, 0x1, + 0x38c, 0x1, 0x38f, 0x1, 0x391, 0x102, 0x3a1, 0x1, 0x3ab, 0x1, 0x3ce, 0x2, 0x3d1, 0x2, 0x3d4, 0x1, 0x3d7, 0x2, 0x3ef, 0x201, + 0x3f3, 0x2, 0x42f, 0x1, 0x45f, 0x2, 0x481, 0x201, 0x483, 0x61c, 0x486, 0x6, 0x489, 0x7, 0x4c0, 0x201, 0x4c4, 0x102, 0x4c8, 0x102, + 0x4cc, 0x102, 0x4f5, 0x201, 0x4f9, 0x201, 0x556, 0x1, 0x55a, 0x418, 0x55f, 0x18, 0x587, 0x2, 0x58a, 0x1814, 0x5a1, 0x6, 0x5b9, 0x6, + 0x5bd, 0x6, 0x5c1, 0x618, 0x5c4, 0x1806, 0x5ea, 0x5, 0x5f2, 0x5, 0x5f4, 0x18, 0x60c, 0x18, 0x61b, 0x1800, 0x61f, 0x1800, 0x63a, 0x5, + 0x641, 0x504, 0x64a, 0x5, 0x655, 0x6, 0x669, 0x9, 0x66d, 0x18, 0x671, 0x506, 0x6d3, 0x5, 0x6d5, 0x518, 0x6dc, 0x6, 0x6de, 0x7, + 0x6e4, 0x6, 0x6e6, 0x4, 0x6e8, 0x6, 0x6ea, 0x1c06, 0x6ed, 0x6, 0x6f9, 0x9, 0x6fc, 0x5, 0x6fe, 0x1c, 0x70d, 0x18, 0x710, 0x1005, + 0x712, 0x605, 0x72c, 0x5, 0x74a, 0x6, 0x7a5, 0x5, 0x7b0, 0x6, 0x902, 0x6, 0x903, 0x800, 0x939, 0x5, 0x93d, 0x506, 0x940, 0x8, + 0x948, 0x6, 0x94c, 0x8, 0x94d, 0x600, 0x951, 0x605, 0x954, 0x6, 0x961, 0x5, 0x963, 0x6, 0x965, 0x18, 0x96f, 0x9, 0x970, 0x18, + 0x982, 0x608, 0x983, 0x800, 0x98c, 0x5, 0x990, 0x5, 0x9a8, 0x5, 0x9b0, 0x5, 0x9b2, 0x5, 0x9b9, 0x5, 0x9bc, 0x6, 0x9c0, 0x8, + 0x9c4, 0x6, 0x9c8, 0x8, 0x9cc, 0x8, 0x9cd, 0x600, 0x9d7, 0x800, 0x9dd, 0x5, 0x9e1, 0x5, 0x9e3, 0x6, 0x9ef, 0x9, 0x9f1, 0x5, + 0x9f3, 0x1a, 0x9f9, 0xb, 0x9fa, 0x1c, 0xa02, 0x6, 0xa0a, 0x5, 0xa10, 0x5, 0xa28, 0x5, 0xa30, 0x5, 0xa33, 0x5, 0xa36, 0x5, + 0xa39, 0x5, 0xa3c, 0x6, 0xa40, 0x8, 0xa42, 0x6, 0xa48, 0x6, 0xa4d, 0x6, 0xa5c, 0x5, 0xa5e, 0x5, 0xa6f, 0x9, 0xa71, 0x6, + 0xa74, 0x5, 0xa82, 0x6, 0xa83, 0x800, 0xa8b, 0x5, 0xa8d, 0x500, 0xa91, 0x5, 0xaa8, 0x5, 0xab0, 0x5, 0xab3, 0x5, 0xab9, 0x5, + 0xabd, 0x506, 0xac0, 0x8, 0xac5, 0x6, 0xac8, 0x6, 0xac9, 0x800, 0xacc, 0x8, 0xacd, 0x600, 0xad0, 0x5, 0xae0, 0x5, 0xaef, 0x9, + 0xb02, 0x608, 0xb03, 0x800, 0xb0c, 0x5, 0xb10, 0x5, 0xb28, 0x5, 0xb30, 0x5, 0xb33, 0x5, 0xb39, 0x5, 0xb3d, 0x506, 0xb41, 0x608, + 0xb43, 0x6, 0xb48, 0x8, 0xb4c, 0x8, 0xb4d, 0x600, 0xb57, 0x806, 0xb5d, 0x5, 0xb61, 0x5, 0xb6f, 0x9, 0xb70, 0x1c, 0xb83, 0x806, + 0xb8a, 0x5, 0xb90, 0x5, 0xb95, 0x5, 0xb9a, 0x5, 0xb9c, 0x5, 0xb9f, 0x5, 0xba4, 0x5, 0xbaa, 0x5, 0xbb5, 0x5, 0xbb9, 0x5, + 0xbbf, 0x8, 0xbc1, 0x806, 0xbc2, 0x8, 0xbc8, 0x8, 0xbcc, 0x8, 0xbcd, 0x600, 0xbd7, 0x800, 0xbef, 0x9, 0xbf2, 0xb, 0xc03, 0x8, + 0xc0c, 0x5, 0xc10, 0x5, 0xc28, 0x5, 0xc33, 0x5, 0xc39, 0x5, 0xc40, 0x6, 0xc44, 0x8, 0xc48, 0x6, 0xc4d, 0x6, 0xc56, 0x6, + 0xc61, 0x5, 0xc6f, 0x9, 0xc83, 0x8, 0xc8c, 0x5, 0xc90, 0x5, 0xca8, 0x5, 0xcb3, 0x5, 0xcb9, 0x5, 0xcc0, 0x608, 0xcc4, 0x8, + 0xcc7, 0x806, 0xcc8, 0x8, 0xccb, 0x8, 0xccd, 0x6, 0xcd6, 0x8, 0xcde, 0x5, 0xce1, 0x5, 0xcef, 0x9, 0xd03, 0x8, 0xd0c, 0x5, + 0xd10, 0x5, 0xd28, 0x5, 0xd39, 0x5, 0xd40, 0x8, 0xd43, 0x6, 0xd48, 0x8, 0xd4c, 0x8, 0xd4d, 0x600, 0xd57, 0x800, 0xd61, 0x5, + 0xd6f, 0x9, 0xd83, 0x8, 0xd96, 0x5, 0xdb1, 0x5, 0xdbb, 0x5, 0xdbd, 0x500, 0xdc6, 0x5, 0xdca, 0x6, 0xdd1, 0x8, 0xdd4, 0x6, + 0xdd6, 0x6, 0xddf, 0x8, 0xdf3, 0x8, 0xdf4, 0x18, 0xe30, 0x5, 0xe32, 0x605, 0xe34, 0x506, 0xe3a, 0x6, 0xe40, 0x1a05, 0xe45, 0x5, + 0xe47, 0x604, 0xe4e, 0x6, 0xe50, 0x1809, 0xe59, 0x9, 0xe5b, 0x18, 0xe82, 0x5, 0xe84, 0x5, 0xe88, 0x5, 0xe8a, 0x5, 0xe8d, 0x500, + 0xe97, 0x5, 0xe9f, 0x5, 0xea3, 0x5, 0xea5, 0x500, 0xea7, 0x500, 0xeab, 0x5, 0xeb0, 0x5, 0xeb2, 0x605, 0xeb4, 0x506, 0xeb9, 0x6, + 0xebc, 0x6, 0xebd, 0x500, 0xec4, 0x5, 0xec6, 0x4, 0xecd, 0x6, 0xed9, 0x9, 0xedd, 0x5, 0xf01, 0x1c05, 0xf03, 0x1c, 0xf12, 0x18, + 0xf17, 0x1c, 0xf19, 0x6, 0xf1f, 0x1c, 0xf29, 0x9, 0xf33, 0xb, 0xf39, 0x61c, 0xf3d, 0x1615, 0xf3f, 0x8, 0xf47, 0x5, 0xf6a, 0x5, + 0xf7e, 0x6, 0xf80, 0x806, 0xf84, 0x6, 0xf86, 0x1806, 0xf88, 0x605, 0xf8b, 0x5, 0xf97, 0x6, 0xfbc, 0x6, 0xfc5, 0x1c, 0xfc7, 0x1c06, + 0xfcc, 0x1c, 0xfcf, 0x1c00, 0x1021, 0x5, 0x1027, 0x5, 0x102a, 0x5, 0x102d, 0x608, 0x1030, 0x6, 0x1032, 0x806, 0x1037, 0x6, 0x1039, 0x608, + 0x1049, 0x9, 0x104f, 0x18, 0x1055, 0x5, 0x1057, 0x8, 0x1059, 0x6, 0x10c5, 0x1, 0x10f6, 0x5, 0x10fb, 0x1800, 0x1159, 0x5, 0x11a2, 0x5, + 0x11f9, 0x5, 0x1206, 0x5, 0x1246, 0x5, 0x1248, 0x5, 0x124d, 0x5, 0x1256, 0x5, 0x1258, 0x5, 0x125d, 0x5, 0x1286, 0x5, 0x1288, 0x5, + 0x128d, 0x5, 0x12ae, 0x5, 0x12b0, 0x5, 0x12b5, 0x5, 0x12be, 0x5, 0x12c0, 0x5, 0x12c5, 0x5, 0x12ce, 0x5, 0x12d6, 0x5, 0x12ee, 0x5, + 0x130e, 0x5, 0x1310, 0x5, 0x1315, 0x5, 0x131e, 0x5, 0x1346, 0x5, 0x135a, 0x5, 0x1368, 0x18, 0x1371, 0x9, 0x137c, 0xb, 0x13f4, 0x5, + 0x166c, 0x5, 0x166e, 0x18, 0x1676, 0x5, 0x1681, 0x50c, 0x169a, 0x5, 0x169c, 0x1516, 0x16ea, 0x5, 0x16ed, 0x18, 0x16f0, 0xb, 0x17b3, 0x5, + 0x17b6, 0x8, 0x17bd, 0x6, 0x17c5, 0x8, 0x17c7, 0x806, 0x17c9, 0x608, 0x17d3, 0x6, 0x17da, 0x18, 0x17dc, 0x1a18, 0x17e9, 0x9, 0x1805, 0x18, + 0x1807, 0x1814, 0x180a, 0x18, 0x180e, 0x10, 0x1819, 0x9, 0x1842, 0x5, 0x1844, 0x405, 0x1877, 0x5, 0x18a8, 0x5, 0x18a9, 0x600, 0x1e95, 0x201, + 0x1e9b, 0x2, 0x1ef9, 0x201, 0x1f07, 0x2, 0x1f0f, 0x1, 0x1f15, 0x2, 0x1f1d, 0x1, 0x1f27, 0x2, 0x1f2f, 0x1, 0x1f37, 0x2, 0x1f3f, 0x1, + 0x1f45, 0x2, 0x1f4d, 0x1, 0x1f57, 0x2, 0x1f59, 0x100, 0x1f5b, 0x100, 0x1f5d, 0x100, 0x1f60, 0x102, 0x1f67, 0x2, 0x1f6f, 0x1, 0x1f7d, 0x2, + 0x1f87, 0x2, 0x1f8f, 0x3, 0x1f97, 0x2, 0x1f9f, 0x3, 0x1fa7, 0x2, 0x1faf, 0x3, 0x1fb4, 0x2, 0x1fb7, 0x2, 0x1fbb, 0x1, 0x1fbd, 0x1b03, + 0x1fbf, 0x1b02, 0x1fc1, 0x1b, 0x1fc4, 0x2, 0x1fc7, 0x2, 0x1fcb, 0x1, 0x1fcd, 0x1b03, 0x1fcf, 0x1b, 0x1fd3, 0x2, 0x1fd7, 0x2, 0x1fdb, 0x1, + 0x1fdf, 0x1b, 0x1fe7, 0x2, 0x1fec, 0x1, 0x1fef, 0x1b, 0x1ff4, 0x2, 0x1ff7, 0x2, 0x1ffb, 0x1, 0x1ffd, 0x1b03, 0x1ffe, 0x1b, 0x200b, 0xc, + 0x200f, 0x10, 0x2015, 0x14, 0x2017, 0x18, 0x2019, 0x1e1d, 0x201b, 0x1d15, 0x201d, 0x1e1d, 0x201f, 0x1d15, 0x2027, 0x18, 0x2029, 0xe0d, 0x202e, 0x10, + 0x2030, 0xc18, 0x2038, 0x18, 0x203a, 0x1d1e, 0x203e, 0x18, 0x2040, 0x17, 0x2043, 0x18, 0x2045, 0x1519, 0x2046, 0x16, 0x204d, 0x18, 0x206f, 0x10, + 0x2070, 0xb, 0x2079, 0xb, 0x207c, 0x19, 0x207e, 0x1516, 0x2080, 0x20b, 0x2089, 0xb, 0x208c, 0x19, 0x208e, 0x1516, 0x20af, 0x1a, 0x20dc, 0x6, + 0x20e0, 0x7, 0x20e2, 0x607, 0x20e3, 0x700, 0x2101, 0x1c, 0x2103, 0x1c01, 0x2106, 0x1c, 0x2108, 0x11c, 0x210a, 0x1c02, 0x210d, 0x1, 0x210f, 0x2, + 0x2112, 0x1, 0x2114, 0x21c, 0x2116, 0x11c, 0x2118, 0x1c, 0x211d, 0x1, 0x2123, 0x1c, 0x212a, 0x1c01, 0x212d, 0x1, 0x212f, 0x21c, 0x2131, 0x1, + 0x2133, 0x11c, 0x2135, 0x502, 0x2138, 0x5, 0x213a, 0x21c, 0x215f, 0xb, 0x2183, 0xa, 0x2194, 0x19, 0x2199, 0x1c, 0x219b, 0x19, 0x219f, 0x1c, + 0x21a1, 0x1c19, 0x21a4, 0x191c, 0x21a7, 0x1c19, 0x21ad, 0x1c, 0x21af, 0x1c19, 0x21cd, 0x1c, 0x21cf, 0x19, 0x21d1, 0x1c, 0x21d5, 0x1c19, 0x21f3, 0x1c, + 0x22f1, 0x19, 0x2307, 0x1c, 0x230b, 0x19, 0x231f, 0x1c, 0x2321, 0x19, 0x2328, 0x1c, 0x232a, 0x1516, 0x237b, 0x1c, 0x239a, 0x1c, 0x2426, 0x1c, + 0x244a, 0x1c, 0x249b, 0xb, 0x24e9, 0x1c, 0x24ea, 0xb, 0x2595, 0x1c, 0x25b6, 0x1c, 0x25b8, 0x191c, 0x25c0, 0x1c, 0x25c2, 0x191c, 0x25f7, 0x1c, + 0x2613, 0x1c, 0x266e, 0x1c, 0x2670, 0x191c, 0x2671, 0x1c00, 0x2704, 0x1c, 0x2709, 0x1c, 0x2727, 0x1c, 0x274b, 0x1c, 0x274d, 0x1c00, 0x2752, 0x1c, + 0x2756, 0x1c, 0x275e, 0x1c, 0x2767, 0x1c, 0x2793, 0xb, 0x2794, 0x1c, 0x27af, 0x1c, 0x27be, 0x1c, 0x28ff, 0x1c, 0x2e99, 0x1c, 0x2ef3, 0x1c, + 0x2fd5, 0x1c, 0x2ffb, 0x1c, 0x3001, 0x180c, 0x3003, 0x18, 0x3005, 0x41c, 0x3007, 0xa05, 0x3011, 0x1615, 0x3013, 0x1c, 0x301b, 0x1615, 0x301d, 0x1514, + 0x301f, 0x16, 0x3021, 0xa1c, 0x3029, 0xa, 0x302f, 0x6, 0x3031, 0x414, 0x3035, 0x4, 0x3037, 0x1c, 0x303a, 0xa, 0x303f, 0x1c, 0x3094, 0x5, + 0x309a, 0x6, 0x309c, 0x1b, 0x309e, 0x4, 0x30fa, 0x5, 0x30fc, 0x1704, 0x30fe, 0x4, 0x312c, 0x5, 0x318e, 0x5, 0x3191, 0x1c, 0x3195, 0xb, + 0x319f, 0x1c, 0x31b7, 0x5, 0x321c, 0x1c, 0x3229, 0xb, 0x3243, 0x1c, 0x327b, 0x1c, 0x3280, 0x1c0b, 0x3289, 0xb, 0x32b0, 0x1c, 0x32cb, 0x1c, + 0x32fe, 0x1c, 0x3376, 0x1c, 0x33dd, 0x1c, 0x33fe, 0x1c, 0x4db5, 0x5, 0x9fa5, 0x5, 0xa48c, 0x5, 0xa4a1, 0x1c, 0xa4b3, 0x1c, 0xa4c0, 0x1c, + 0xa4c4, 0x1c, 0xa4c6, 0x1c, 0xd7a3, 0x5, 0xdfff, 0x13, 0xf8ff, 0x12, 0xfa2d, 0x5, 0xfb06, 0x2, 0xfb17, 0x2, 0xfb1f, 0x506, 0xfb28, 0x5, + 0xfb2a, 0x1905, 0xfb36, 0x5, 0xfb3c, 0x5, 0xfb3e, 0x5, 0xfb41, 0x5, 0xfb44, 0x5, 0xfbb1, 0x5, 0xfd3d, 0x5, 0xfd3f, 0x1615, 0xfd8f, 0x5, + 0xfdc7, 0x5, 0xfdfb, 0x5, 0xfe23, 0x6, 0xfe31, 0x1418, 0xfe33, 0x1714, 0xfe35, 0x1517, 0xfe44, 0x1516, 0xfe4c, 0x18, 0xfe4f, 0x17, 0xfe52, 0x18, + 0xfe57, 0x18, 0xfe59, 0x1514, 0xfe5e, 0x1516, 0xfe61, 0x18, 0xfe64, 0x1419, 0xfe66, 0x19, 0xfe6a, 0x1a18, 0xfe6b, 0x1800, 0xfe72, 0x5, 0xfe74, 0x5, + 0xfefc, 0x5, 0xfeff, 0x1000, 0xff03, 0x18, 0xff05, 0x181a, 0xff07, 0x18, 0xff09, 0x1615, 0xff0c, 0x1918, 0xff0e, 0x1418, 0xff10, 0x1809, 0xff19, 0x9, + 0xff1b, 0x18, 0xff1e, 0x19, 0xff20, 0x18, 0xff3a, 0x1, 0xff3c, 0x1518, 0xff3e, 0x161b, 0xff40, 0x171b, 0xff5a, 0x2, 0xff5c, 0x1519, 0xff5e, 0x1619, + 0xff62, 0x1815, 0xff64, 0x1618, 0xff66, 0x1705, 0xff6f, 0x5, 0xff71, 0x504, 0xff9d, 0x5, 0xff9f, 0x4, 0xffbe, 0x5, 0xffc7, 0x5, 0xffcf, 0x5, + 0xffd7, 0x5, 0xffdc, 0x5, 0xffe1, 0x1a, 0xffe3, 0x1b19, 0xffe5, 0x1a1c, 0xffe6, 0x1a, 0xffe9, 0x191c, 0xffec, 0x19, 0xffee, 0x1c, 0xfffb, 0x10 +}; + +template +int binarySearchRange(const T* array, int arrayLength, T needle) { + int bottom = 0; + int top = arrayLength - 1; + int middle = -1; + T value = 0; + while (bottom <= top) { + middle = (bottom + top) / 2; + value = array[middle]; + if (needle > value) + bottom = middle + 1; + else if (needle == value) + return middle; + else + top = middle - 1; + } + return middle - (needle < value ? 1 : 0); +} + +#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) + +KInt getType(KChar ch) { + if (ch < 1000) { + return typeValuesCache[ch]; + } + int result = binarySearchRange(typeKeys, ARRAY_SIZE(typeKeys), ch); + int high = typeValues[result * 2]; + if (ch <= high) { + int code = typeValues[result * 2 + 1]; + if (code < 0x100) { + return code; + } + return (ch & 1) == 1 ? code >> 8 : code & 0xff; + } + return UNASSIGNED; +} + +KChar towupper_Konan(KChar ch) { + // Optimized case for ASCII. + if ('a' <= ch && ch <= 'z') { + return ch - ('a' - 'A'); + } + if (ch < 181) { + return ch; + } + if (ch < 1000) { + return uppercaseValuesCache[ch - 181]; + } + int result = binarySearchRange(uppercaseKeys, ARRAY_SIZE(uppercaseKeys), ch); + if (result >= 0) { + bool by2 = false; + KChar start = uppercaseKeys[result]; + KChar end = uppercaseValues[result * 2]; + if ((start & 0x8000) != (end & 0x8000)) { + end ^= 0x8000; + by2 = true; + } + if (ch <= end) { + if (by2 && (ch & 1) != (start & 1)) { + return ch; + } + KChar mapping = uppercaseValues[result * 2 + 1]; + return ch + mapping; + } + } + return ch; +} + +KChar towlower_Konan(KChar ch) { + // Optimized case for ASCII. + if ('A' <= ch && ch <= 'Z') { + return ch + ('a' - 'A'); + } + if (ch < 192) { + return ch; + } + if (ch < 1000) { + return lowercaseValuesCache[ch - 192]; + } + + int result = binarySearchRange(lowercaseKeys, ARRAY_SIZE(lowercaseKeys), ch); + if (result >= 0) { + bool by2 = false; + KChar start = lowercaseKeys[result]; + KChar end = lowercaseValues[result * 2]; + if ((start & 0x8000) != (end & 0x8000)) { + end ^= 0x8000; + by2 = true; + } + if (ch <= end) { + if (by2 && (ch & 1) != (start & 1)) { + return ch; + } + KChar mapping = lowercaseValues[result * 2 + 1]; + return ch + mapping; + } + } + return ch; +} + +int iswdigit_Konan(KChar ch) { + // Optimized case for ASCII. + if ('0' <= ch && ch <= '9') { + return true; + } + if (ch < 1632) { + return false; + } + return getType(ch) == DECIMAL_DIGIT_NUMBER; +} + +int iswalpha_Konan(KChar ch) { + if (('A' <= ch && ch <= 'Z') || ('a' <= ch && ch <= 'z')) { + return true; + } + if (ch < 128) { + return false; + } + int type = getType(ch); + return type >= UPPERCASE_LETTER && type <= OTHER_LETTER; +} + +int iswalnum_Konan(KChar ch) { + int type = getType(ch); + return (type >= UPPERCASE_LETTER && type <= OTHER_LETTER) + || type == DECIMAL_DIGIT_NUMBER; +} + +int iswspace_Konan(KChar ch) { + // Optimized case for ASCII. + if ((ch >= 0x1c && ch <= 0x20) || (ch >= 0x9 && ch <= 0xd)) { + return true; + } + if (ch == 0x1680) { + return true; + } + if (ch < 0x2000 || ch == 0x2007) { + return false; + } + return ch <= 0x200b || ch == 0x2028 || ch == 0x2029 || ch == 0x3000; +} + +int iswupper_Konan(KChar ch) { + // Optimized case for ASCII. + if ('A' <= ch && ch <= 'Z') { + return true; + } + if (ch < 128) { + return false; + } + + return getType(ch) == UPPERCASE_LETTER; +} + +int iswlower_Konan(KChar ch) { + // Optimized case for ASCII. + if ('a' <= ch && ch <= 'z') { + return true; + } + if (ch < 128) { + return false; + } + + return getType(ch) == LOWERCASE_LETTER; +} + } // namespace extern "C" { OBJ_GETTER(CreateStringFromCString, const char* cstring) { - RETURN_RESULT_OF(utf8ToUtf16, Raw(cstring, strlen(cstring))); + RETURN_RESULT_OF(utf8ToUtf16, cstring, strlen(cstring)); } OBJ_GETTER(CreateStringFromUtf8, const char* utf8, uint32_t lengthBytes) { - RETURN_RESULT_OF(utf8ToUtf16, Raw(utf8, lengthBytes)); + RETURN_RESULT_OF(utf8ToUtf16, utf8, lengthBytes); } // String.kt @@ -155,10 +779,9 @@ OBJ_GETTER(Kotlin_String_fromUtf8Array, KConstRef thiz, KInt start, KInt size) { if (size == 0) { RETURN_RESULT_OF0(TheEmptyString); } - Raw rawString( - reinterpret_cast( - ByteArrayAddressOfElementAt(array, start)), size); - RETURN_RESULT_OF(utf8ToUtf16, rawString); + const char* rawString = + reinterpret_cast(ByteArrayAddressOfElementAt(array, start)); + RETURN_RESULT_OF(utf8ToUtf16, rawString, array->count_); } OBJ_GETTER(Kotlin_String_fromCharArray, KConstRef thiz, KInt start, KInt size) { @@ -233,7 +856,7 @@ KBoolean Kotlin_String_equalsIgnoreCase(KString thiz, KConstRef other) { const KChar* thizRaw = CharArrayAddressOfElementAt(thiz, 0); const KChar* otherRaw = CharArrayAddressOfElementAt(otherString, 0); for (KInt index = 0; index < count; ++index) { - if (towlower(*thizRaw++) != towlower(*otherRaw++)) return false; + if (towlower_Konan(*thizRaw++) != towlower_Konan(*otherRaw++)) return false; } return true; } @@ -246,10 +869,10 @@ OBJ_GETTER(Kotlin_String_replace, KString thiz, KChar oldChar, KChar newChar, const KChar* thizRaw = CharArrayAddressOfElementAt(thiz, 0); KChar* resultRaw = CharArrayAddressOfElementAt(result, 0); if (ignoreCase) { - KChar oldCharLower = towlower(oldChar); + KChar oldCharLower = towlower_Konan(oldChar); for (KInt index = 0; index < count; ++index) { KChar thizChar = *thizRaw++; - *resultRaw++ = towlower(thizChar) == oldCharLower ? newChar : thizChar; + *resultRaw++ = towlower_Konan(thizChar) == oldCharLower ? newChar : thizChar; } } else { for (KInt index = 0; index < count; ++index) { @@ -267,7 +890,7 @@ OBJ_GETTER(Kotlin_String_toUpperCase, KString thiz) { const KChar* thizRaw = CharArrayAddressOfElementAt(thiz, 0); KChar* resultRaw = CharArrayAddressOfElementAt(result, 0); for (KInt index = 0; index < count; ++index) { - *resultRaw++ = towupper(*thizRaw++); + *resultRaw++ = towupper_Konan(*thizRaw++); } RETURN_OBJ(result->obj()); } @@ -279,7 +902,7 @@ OBJ_GETTER(Kotlin_String_toLowerCase, KString thiz) { const KChar* thizRaw = CharArrayAddressOfElementAt(thiz, 0); KChar* resultRaw = CharArrayAddressOfElementAt(result, 0); for (KInt index = 0; index < count; ++index) { - *resultRaw++ = towlower(*thizRaw++); + *resultRaw++ = towlower_Konan(*thizRaw++); } RETURN_OBJ(result->obj()); } @@ -296,7 +919,7 @@ KBoolean Kotlin_String_regionMatches(KString thiz, KInt thizOffset, const KChar* otherRaw = CharArrayAddressOfElementAt(other, otherOffset); if (ignoreCase) { for (KInt index = 0; index < length; ++index) { - if (towlower(*thizRaw++) != towlower(*otherRaw++)) return false; + if (towlower_Konan(*thizRaw++) != towlower_Konan(*otherRaw++)) return false; } } else { for (KInt index = 0; index < length; ++index) { @@ -309,8 +932,8 @@ KBoolean Kotlin_String_regionMatches(KString thiz, KInt thizOffset, KBoolean Kotlin_CharSequence_regionMatches(KString thiz, KInt thizOffset, KString other, KInt otherOffset, KInt length, KBoolean ignoreCase) { - RuntimeAssert(false, "Kotlin_CharSequence_regionMatches is not implemented"); - return false; + return Kotlin_String_regionMatches(thiz, thizOffset, other, otherOffset, + length, ignoreCase); } KBoolean Kotlin_Char_isDefined(KChar ch) { @@ -320,15 +943,15 @@ KBoolean Kotlin_Char_isDefined(KChar ch) { } KBoolean Kotlin_Char_isLetter(KChar ch) { - return iswalpha(ch) != 0; + return iswalpha_Konan(ch) != 0; } KBoolean Kotlin_Char_isLetterOrDigit(KChar ch) { - return iswalnum(ch) != 0; + return iswalnum_Konan(ch) != 0; } KBoolean Kotlin_Char_isDigit(KChar ch) { - return iswdigit(ch) != 0; + return iswdigit_Konan(ch) != 0; } KBoolean Kotlin_Char_isIdentifierIgnorable(KChar ch) { @@ -337,8 +960,7 @@ KBoolean Kotlin_Char_isIdentifierIgnorable(KChar ch) { } KBoolean Kotlin_Char_isISOControl(KChar ch) { - RuntimeAssert(false, "Kotlin_Char_isISOControl() is not implemented"); - return false; + return (ch <= 0x1F) || (ch >= 0x7F && ch <= 0x9F); } KBoolean Kotlin_Char_isHighSurrogate(KChar ch) { @@ -350,23 +972,23 @@ KBoolean Kotlin_Char_isLowSurrogate(KChar ch) { } KBoolean Kotlin_Char_isWhitespace(KChar ch) { - return iswspace(ch) != 0; + return iswspace_Konan(ch) != 0; } KBoolean Kotlin_Char_isLowerCase(KChar ch) { - return iswlower(ch) != 0; + return iswlower_Konan(ch) != 0; } KBoolean Kotlin_Char_isUpperCase(KChar ch) { - return iswupper(ch) != 0; + return iswupper_Konan(ch) != 0; } KChar Kotlin_Char_toLowerCase(KChar ch) { - return towlower(ch); + return towlower_Konan(ch); } KChar Kotlin_Char_toUpperCase(KChar ch) { - return towupper(ch); + return towupper_Konan(ch); } KInt Kotlin_Char_digitOf(KChar ch, KInt radix) { @@ -490,10 +1112,9 @@ OBJ_GETTER(Kotlin_String_subSequence, KString thiz, KInt startIndex, KInt endInd void Kotlin_io_Console_print(KString message) { RuntimeAssert(message->type_info() == theStringTypeInfo, "Must use a string"); // TODO: system stdout must be aware about UTF-8. - Raw utf16( - CharArrayAddressOfElementAt(message, 0), message->count_); + const KChar* utf16 = CharArrayAddressOfElementAt(message, 0); std::string utf8; - utf8::utf16to8(utf16.begin(), utf16.end(), back_inserter(utf8)); + utf8::utf16to8(utf16, utf16 + message->count_, back_inserter(utf8)); write(STDOUT_FILENO, utf8.c_str(), utf8.size()); } diff --git a/runtime/src/main/cpp/Runtime.cpp b/runtime/src/main/cpp/Runtime.cpp index d54317ac44d..296e763817e 100644 --- a/runtime/src/main/cpp/Runtime.cpp +++ b/runtime/src/main/cpp/Runtime.cpp @@ -14,7 +14,6 @@ * limitations under the License. */ -#include #include #include "Memory.h" @@ -61,10 +60,6 @@ void AppendToInitializersTail(InitNode *next) { // TODO: properly use RuntimeState. RuntimeState* InitRuntime() { - // Set Unicode locale, otherwise towlower() and friends do not work properly. - if (setlocale(LC_CTYPE, "en_US.UTF-8") == nullptr) { - fprintf(stderr, "Cannot set locale, string ops may suffer\n"); - } RuntimeState* result = new RuntimeState(); result->memoryState = InitMemory(); // Keep global variables in state as well.