diff options
author | Jiyoung Yun <jy910.yun@samsung.com> | 2017-04-13 14:17:19 +0900 |
---|---|---|
committer | Jiyoung Yun <jy910.yun@samsung.com> | 2017-04-13 14:17:19 +0900 |
commit | a56e30c8d33048216567753d9d3fefc2152af8ac (patch) | |
tree | 7e5d979695fc4a431740982eb1cfecc2898b23a5 /src/mscorlib/corefx | |
parent | 4b11dc566a5bbfa1378d6266525c281b028abcc8 (diff) | |
download | coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.tar.gz coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.tar.bz2 coreclr-a56e30c8d33048216567753d9d3fefc2152af8ac.zip |
Imported Upstream version 2.0.0.11353upstream/2.0.0.11353
Diffstat (limited to 'src/mscorlib/corefx')
166 files changed, 0 insertions, 45798 deletions
diff --git a/src/mscorlib/corefx/Debug.cs b/src/mscorlib/corefx/Debug.cs deleted file mode 100644 index 3398c0e31e..0000000000 --- a/src/mscorlib/corefx/Debug.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Diagnostics; - -namespace System -{ - internal static class Debug - { - [Conditional("_DEBUG")] - static public void Assert(bool condition) - { - BCLDebug.Assert(condition); - } - - [Conditional("_DEBUG")] - static public void Assert(bool condition, string message) - { - BCLDebug.Assert(condition, message); - } - - [Conditional("_DEBUG")] - static public void Fail(string message) - { - BCLDebug.Assert(false, message); - } - } -}
\ No newline at end of file diff --git a/src/mscorlib/corefx/Interop/Unix/Interop.Errors.cs b/src/mscorlib/corefx/Interop/Unix/Interop.Errors.cs deleted file mode 100644 index 4248434db3..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/Interop.Errors.cs +++ /dev/null @@ -1,207 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - /// <summary>Common Unix errno error codes.</summary> - internal enum Error - { - // These values were defined in src/Native/System.Native/fxerrno.h - // - // They compare against values obtained via Interop.Sys.GetLastError() not Marshal.GetLastWin32Error() - // which obtains the raw errno that varies between unixes. The strong typing as an enum is meant to - // prevent confusing the two. Casting to or from int is suspect. Use GetLastErrorInfo() if you need to - // correlate these to the underlying platform values or obtain the corresponding error message. - // - - SUCCESS = 0, - - E2BIG = 0x10001, // Argument list too long. - EACCES = 0x10002, // Permission denied. - EADDRINUSE = 0x10003, // Address in use. - EADDRNOTAVAIL = 0x10004, // Address not available. - EAFNOSUPPORT = 0x10005, // Address family not supported. - EAGAIN = 0x10006, // Resource unavailable, try again (same value as EWOULDBLOCK), - EALREADY = 0x10007, // Connection already in progress. - EBADF = 0x10008, // Bad file descriptor. - EBADMSG = 0x10009, // Bad message. - EBUSY = 0x1000A, // Device or resource busy. - ECANCELED = 0x1000B, // Operation canceled. - ECHILD = 0x1000C, // No child processes. - ECONNABORTED = 0x1000D, // Connection aborted. - ECONNREFUSED = 0x1000E, // Connection refused. - ECONNRESET = 0x1000F, // Connection reset. - EDEADLK = 0x10010, // Resource deadlock would occur. - EDESTADDRREQ = 0x10011, // Destination address required. - EDOM = 0x10012, // Mathematics argument out of domain of function. - EDQUOT = 0x10013, // Reserved. - EEXIST = 0x10014, // File exists. - EFAULT = 0x10015, // Bad address. - EFBIG = 0x10016, // File too large. - EHOSTUNREACH = 0x10017, // Host is unreachable. - EIDRM = 0x10018, // Identifier removed. - EILSEQ = 0x10019, // Illegal byte sequence. - EINPROGRESS = 0x1001A, // Operation in progress. - EINTR = 0x1001B, // Interrupted function. - EINVAL = 0x1001C, // Invalid argument. - EIO = 0x1001D, // I/O error. - EISCONN = 0x1001E, // Socket is connected. - EISDIR = 0x1001F, // Is a directory. - ELOOP = 0x10020, // Too many levels of symbolic links. - EMFILE = 0x10021, // File descriptor value too large. - EMLINK = 0x10022, // Too many links. - EMSGSIZE = 0x10023, // Message too large. - EMULTIHOP = 0x10024, // Reserved. - ENAMETOOLONG = 0x10025, // Filename too long. - ENETDOWN = 0x10026, // Network is down. - ENETRESET = 0x10027, // Connection aborted by network. - ENETUNREACH = 0x10028, // Network unreachable. - ENFILE = 0x10029, // Too many files open in system. - ENOBUFS = 0x1002A, // No buffer space available. - ENODEV = 0x1002C, // No such device. - ENOENT = 0x1002D, // No such file or directory. - ENOEXEC = 0x1002E, // Executable file format error. - ENOLCK = 0x1002F, // No locks available. - ENOLINK = 0x10030, // Reserved. - ENOMEM = 0x10031, // Not enough space. - ENOMSG = 0x10032, // No message of the desired type. - ENOPROTOOPT = 0x10033, // Protocol not available. - ENOSPC = 0x10034, // No space left on device. - ENOSYS = 0x10037, // Function not supported. - ENOTCONN = 0x10038, // The socket is not connected. - ENOTDIR = 0x10039, // Not a directory or a symbolic link to a directory. - ENOTEMPTY = 0x1003A, // Directory not empty. - ENOTSOCK = 0x1003C, // Not a socket. - ENOTSUP = 0x1003D, // Not supported (same value as EOPNOTSUP). - ENOTTY = 0x1003E, // Inappropriate I/O control operation. - ENXIO = 0x1003F, // No such device or address. - EOVERFLOW = 0x10040, // Value too large to be stored in data type. - EPERM = 0x10042, // Operation not permitted. - EPIPE = 0x10043, // Broken pipe. - EPROTO = 0x10044, // Protocol error. - EPROTONOSUPPORT = 0x10045, // Protocol not supported. - EPROTOTYPE = 0x10046, // Protocol wrong type for socket. - ERANGE = 0x10047, // Result too large. - EROFS = 0x10048, // Read-only file system. - ESPIPE = 0x10049, // Invalid seek. - ESRCH = 0x1004A, // No such process. - ESTALE = 0x1004B, // Reserved. - ETIMEDOUT = 0x1004D, // Connection timed out. - ETXTBSY = 0x1004E, // Text file busy. - EXDEV = 0x1004F, // Cross-device link. - ESOCKTNOSUPPORT = 0x1005E, // Socket type not supported. - EPFNOSUPPORT = 0x10060, // Protocol family not supported. - ESHUTDOWN = 0x1006C, // Socket shutdown. - EHOSTDOWN = 0x10070, // Host is down. - ENODATA = 0x10071, // No data available. - - // POSIX permits these to have the same value and we make them always equal so - // that CoreFX cannot introduce a dependency on distinguishing between them that - // would not work on all platforms. - EOPNOTSUPP = ENOTSUP, // Operation not supported on socket. - EWOULDBLOCK = EAGAIN, // Operation would block. - } - - - // Represents a platform-agnostic Error and underlying platform-specific errno - internal struct ErrorInfo - { - private Error _error; - private int _rawErrno; - - internal ErrorInfo(int errno) - { - _error = Interop.Sys.ConvertErrorPlatformToPal(errno); - _rawErrno = errno; - } - - internal ErrorInfo(Error error) - { - _error = error; - _rawErrno = -1; - } - - internal Error Error - { - get { return _error; } - } - - internal int RawErrno - { - get { return _rawErrno == -1 ? (_rawErrno = Interop.Sys.ConvertErrorPalToPlatform(_error)) : _rawErrno; } - } - - internal string GetErrorMessage() - { - return Interop.Sys.StrError(RawErrno); - } - - public override string ToString() - { - return string.Format( - "RawErrno: {0} Error: {1} GetErrorMessage: {2}", // No localization required; text is member names used for debugging purposes - RawErrno, Error, GetErrorMessage()); - } - } - - internal partial class Sys - { - internal static Error GetLastError() - { - return ConvertErrorPlatformToPal(Marshal.GetLastWin32Error()); - } - - internal static ErrorInfo GetLastErrorInfo() - { - return new ErrorInfo(Marshal.GetLastWin32Error()); - } - - internal static unsafe string StrError(int platformErrno) - { - int maxBufferLength = 1024; // should be long enough for most any UNIX error - byte* buffer = stackalloc byte[maxBufferLength]; - byte* message = StrErrorR(platformErrno, buffer, maxBufferLength); - - if (message == null) - { - // This means the buffer was not large enough, but still contains - // as much of the error message as possible and is guaranteed to - // be null-terminated. We're not currently resizing/retrying because - // maxBufferLength is large enough in practice, but we could do - // so here in the future if necessary. - message = buffer; - } - - return Marshal.PtrToStringAnsi((IntPtr)message); - } - - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPlatformToPal")] - internal static extern Error ConvertErrorPlatformToPal(int platformErrno); - - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPalToPlatform")] - internal static extern int ConvertErrorPalToPlatform(Error error); - - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_StrErrorR")] - private static unsafe extern byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize); - } -} - -// NOTE: extension method can't be nested inside Interop class. -internal static class InteropErrorExtensions -{ - // Intended usage is e.g. Interop.Error.EFAIL.Info() for brevity - // vs. new Interop.ErrorInfo(Interop.Error.EFAIL) for synthesizing - // errors. Errors originated from the system should be obtained - // via GetLastErrorInfo(), not GetLastError().Info() as that will - // convert twice, which is not only inefficient but also lossy if - // we ever encounter a raw errno that no equivalent in the Error - // enum. - public static Interop.ErrorInfo Info(this Interop.Error error) - { - return new Interop.ErrorInfo(error); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/Interop.IOErrors.cs b/src/mscorlib/corefx/Interop/Unix/Interop.IOErrors.cs deleted file mode 100644 index e9d6ce61d6..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/Interop.IOErrors.cs +++ /dev/null @@ -1,170 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Diagnostics; -using System.IO; -using System.Runtime.InteropServices; -using Microsoft.Win32.SafeHandles; - -internal static partial class Interop -{ - private static void ThrowExceptionForIoErrno(ErrorInfo errorInfo, string path, bool isDirectory, Func<ErrorInfo, ErrorInfo> errorRewriter) - { - Debug.Assert(errorInfo.Error != Error.SUCCESS); - Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code"); - - if (errorRewriter != null) - { - errorInfo = errorRewriter(errorInfo); - } - - throw Interop.GetExceptionForIoErrno(errorInfo, path, isDirectory); - } - - internal static void CheckIo(Error error, string path = null, bool isDirectory = false, Func<ErrorInfo, ErrorInfo> errorRewriter = null) - { - if (error != Interop.Error.SUCCESS) - { - ThrowExceptionForIoErrno(error.Info(), path, isDirectory, errorRewriter); - } - } - - /// <summary> - /// Validates the result of system call that returns greater than or equal to 0 on success - /// and less than 0 on failure, with errno set to the error code. - /// If the system call failed for any reason, an exception is thrown. Otherwise, the system call succeeded. - /// </summary> - /// <param name="result">The result of the system call.</param> - /// <param name="path">The path with which this error is associated. This may be null.</param> - /// <param name="isDirectory">true if the <paramref name="path"/> is known to be a directory; otherwise, false.</param> - /// <param name="errorRewriter">Optional function to change an error code prior to processing it.</param> - /// <returns> - /// On success, returns the non-negative result long that was validated. - /// </returns> - internal static long CheckIo(long result, string path = null, bool isDirectory = false, Func<ErrorInfo, ErrorInfo> errorRewriter = null) - { - if (result < 0) - { - ThrowExceptionForIoErrno(Sys.GetLastErrorInfo(), path, isDirectory, errorRewriter); - } - - return result; - } - - /// <summary> - /// Validates the result of system call that returns greater than or equal to 0 on success - /// and less than 0 on failure, with errno set to the error code. - /// If the system call failed for any reason, an exception is thrown. Otherwise, the system call succeeded. - /// </summary> - /// <returns> - /// On success, returns the non-negative result int that was validated. - /// </returns> - internal static int CheckIo(int result, string path = null, bool isDirectory = false, Func<ErrorInfo, ErrorInfo> errorRewriter = null) - { - CheckIo((long)result, path, isDirectory, errorRewriter); - - return result; - } - - /// <summary> - /// Validates the result of system call that returns greater than or equal to 0 on success - /// and less than 0 on failure, with errno set to the error code. - /// If the system call failed for any reason, an exception is thrown. Otherwise, the system call succeeded. - /// </summary> - /// <returns> - /// On success, returns the non-negative result IntPtr that was validated. - /// </returns> - internal static IntPtr CheckIo(IntPtr result, string path = null, bool isDirectory = false, Func<ErrorInfo, ErrorInfo> errorRewriter = null) - { - CheckIo((long)result, path, isDirectory, errorRewriter); - - return result; - } - - /// <summary> - /// Validates the result of system call that returns greater than or equal to 0 on success - /// and less than 0 on failure, with errno set to the error code. - /// If the system call failed for any reason, an exception is thrown. Otherwise, the system call succeeded. - /// </summary> - /// <returns> - /// On success, returns the valid SafeFileHandle that was validated. - /// </returns> - internal static TSafeHandle CheckIo<TSafeHandle>(TSafeHandle handle, string path = null, bool isDirectory = false, Func<ErrorInfo, ErrorInfo> errorRewriter = null) - where TSafeHandle : SafeHandle - { - if (handle.IsInvalid) - { - ThrowExceptionForIoErrno(Sys.GetLastErrorInfo(), path, isDirectory, errorRewriter); - } - - return handle; - } - - /// <summary> - /// Gets an Exception to represent the supplied error info. - /// </summary> - /// <param name="error">The error info</param> - /// <param name="path">The path with which this error is associated. This may be null.</param> - /// <param name="isDirectory">true if the <paramref name="path"/> is known to be a directory; otherwise, false.</param> - /// <returns></returns> - internal static Exception GetExceptionForIoErrno(ErrorInfo errorInfo, string path = null, bool isDirectory = false) - { - // Translate the errno into a known set of exception types. For cases where multiple errnos map - // to the same exception type, include an inner exception with the details. - switch (errorInfo.Error) - { - case Error.ENOENT: - if (isDirectory) - { - return !string.IsNullOrEmpty(path) ? - new DirectoryNotFoundException(SR.Format(SR.IO_PathNotFound_Path, path)) : - new DirectoryNotFoundException(SR.IO_PathNotFound_NoPathName); - } - else - { - return !string.IsNullOrEmpty(path) ? - new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, path), path) : - new FileNotFoundException(SR.IO_FileNotFound); - } - - case Error.EACCES: - case Error.EBADF: - case Error.EPERM: - Exception inner = GetIOException(errorInfo); - return !string.IsNullOrEmpty(path) ? - new UnauthorizedAccessException(SR.Format(SR.UnauthorizedAccess_IODenied_Path, path), inner) : - new UnauthorizedAccessException(SR.UnauthorizedAccess_IODenied_NoPathName, inner); - - case Error.ENAMETOOLONG: - return new PathTooLongException(SR.IO_PathTooLong); - - case Error.EWOULDBLOCK: - return !string.IsNullOrEmpty(path) ? - new IOException(SR.Format(SR.IO_SharingViolation_File, path), errorInfo.RawErrno) : - new IOException(SR.IO_SharingViolation_NoFileName, errorInfo.RawErrno); - - case Error.ECANCELED: - return new OperationCanceledException(); - - case Error.EFBIG: - return new ArgumentOutOfRangeException("value", SR.ArgumentOutOfRange_FileLengthTooBig); - - case Error.EEXIST: - if (!string.IsNullOrEmpty(path)) - { - return new IOException(SR.Format(SR.IO_FileExists_Name, path), errorInfo.RawErrno); - } - goto default; - - default: - return GetIOException(errorInfo); - } - } - - internal static Exception GetIOException(Interop.ErrorInfo errorInfo) - { - return new IOException(errorInfo.GetErrorMessage(), errorInfo.RawErrno); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/Interop.Libraries.cs b/src/mscorlib/corefx/Interop/Unix/Interop.Libraries.cs deleted file mode 100644 index 1b6d26e40f..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/Interop.Libraries.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -internal static partial class Interop -{ - private static partial class Libraries - { - internal const string GlobalizationInterop = "System.Globalization.Native"; // CoreFX wrappers for ICU - internal const string SystemNative = "System.Native"; - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Calendar.cs b/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Calendar.cs deleted file mode 100644 index 7b3caeabdd..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Calendar.cs +++ /dev/null @@ -1,33 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Globalization; -using System.Runtime.InteropServices; -using System.Text; - -internal static partial class Interop -{ - internal static partial class GlobalizationInterop - { - internal delegate void EnumCalendarInfoCallback( - [MarshalAs(UnmanagedType.LPWStr)] string calendarString, - IntPtr context); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetCalendars")] - internal static extern int GetCalendars(string localeName, CalendarId[] calendars, int calendarsCapacity); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetCalendarInfo")] - internal static extern ResultCode GetCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType calendarDataType, [Out] StringBuilder result, int resultCapacity); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_EnumCalendarInfo")] - internal static extern bool EnumCalendarInfo(EnumCalendarInfoCallback callback, string localeName, CalendarId calendarId, CalendarDataType calendarDataType, IntPtr context); - - [DllImport(Libraries.GlobalizationInterop, EntryPoint = "GlobalizationNative_GetLatestJapaneseEra")] - internal static extern int GetLatestJapaneseEra(); - - [DllImport(Libraries.GlobalizationInterop, EntryPoint = "GlobalizationNative_GetJapaneseEraStartDate")] - internal static extern bool GetJapaneseEraStartDate(int era, out int startYear, out int startMonth, out int startDay); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Casing.cs b/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Casing.cs deleted file mode 100644 index 769506b8f6..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Casing.cs +++ /dev/null @@ -1,23 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; -using System.Security; -using System.Text; - -internal static partial class Interop -{ - internal static partial class GlobalizationInterop - { - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ChangeCase")] - internal unsafe static extern void ChangeCase(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ChangeCaseInvariant")] - internal unsafe static extern void ChangeCaseInvariant(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ChangeCaseTurkish")] - internal unsafe static extern void ChangeCaseTurkish(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Collation.cs b/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Collation.cs deleted file mode 100644 index 25585c6dfb..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Collation.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Globalization; -using System.Runtime.InteropServices; -using System.Security; - -internal static partial class Interop -{ - internal static partial class GlobalizationInterop - { - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetSortHandle")] - internal unsafe static extern ResultCode GetSortHandle(byte[] localeName, out SafeSortHandle sortHandle); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_CloseSortHandle")] - internal unsafe static extern void CloseSortHandle(IntPtr handle); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_CompareString")] - internal unsafe static extern int CompareString(SafeSortHandle sortHandle, char* lpStr1, int cwStr1Len, char* lpStr2, int cwStr2Len, CompareOptions options); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_IndexOf")] - internal unsafe static extern int IndexOf(SafeSortHandle sortHandle, string target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_LastIndexOf")] - internal unsafe static extern int LastIndexOf(SafeSortHandle sortHandle, string target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_IndexOfOrdinalIgnoreCase")] - internal unsafe static extern int IndexOfOrdinalIgnoreCase(string target, int cwTargetLength, char* pSource, int cwSourceLength, bool findLast); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_StartsWith")] - [return: MarshalAs(UnmanagedType.Bool)] - internal unsafe static extern bool StartsWith(SafeSortHandle sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_EndsWith")] - [return: MarshalAs(UnmanagedType.Bool)] - internal unsafe static extern bool EndsWith(SafeSortHandle sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetSortKey")] - internal unsafe static extern int GetSortKey(SafeSortHandle sortHandle, string str, int strLength, byte* sortKey, int sortKeyLength, CompareOptions options); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_CompareStringOrdinalIgnoreCase")] - internal unsafe static extern int CompareStringOrdinalIgnoreCase(char* lpStr1, int cwStr1Len, char* lpStr2, int cwStr2Len); - - [DllImport(Libraries.GlobalizationInterop, EntryPoint = "GlobalizationNative_GetSortVersion")] - internal static extern int GetSortVersion(); - - internal class SafeSortHandle : SafeHandle - { - private SafeSortHandle() : - base(IntPtr.Zero, true) - { - } - - public override bool IsInvalid - { - get { return handle == IntPtr.Zero; } - } - - protected override bool ReleaseHandle() - { - CloseSortHandle(handle); - SetHandle(IntPtr.Zero); - return true; - } - } - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Idna.cs b/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Idna.cs deleted file mode 100644 index 43c72281ae..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Idna.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class GlobalizationInterop - { - internal const int AllowUnassigned = 0x1; - internal const int UseStd3AsciiRules = 0x2; - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ToAscii")] - internal static unsafe extern int ToAscii(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ToUnicode")] - internal static unsafe extern int ToUnicode(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Locale.cs b/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Locale.cs deleted file mode 100644 index fcea708ee8..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Locale.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; -using System.Text; - -internal static partial class Interop -{ - internal static partial class GlobalizationInterop - { - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetLocaleName")] - [return: MarshalAs(UnmanagedType.Bool)] - internal unsafe static extern bool GetLocaleName(string localeName, [Out] StringBuilder value, int valueLength); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetLocaleInfoString")] - [return: MarshalAs(UnmanagedType.Bool)] - internal unsafe static extern bool GetLocaleInfoString(string localeName, uint localeStringData, [Out] StringBuilder value, int valueLength); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetDefaultLocaleName")] - [return: MarshalAs(UnmanagedType.Bool)] - internal unsafe static extern bool GetDefaultLocaleName([Out] StringBuilder value, int valueLength); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetLocaleTimeFormat")] - [return: MarshalAs(UnmanagedType.Bool)] - internal unsafe static extern bool GetLocaleTimeFormat(string localeName, bool shortFormat, [Out] StringBuilder value, int valueLength); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetLocaleInfoInt")] - [return: MarshalAs(UnmanagedType.Bool)] - internal unsafe static extern bool GetLocaleInfoInt(string localeName, uint localeNumberData, ref int value); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetLocaleInfoGroupingSizes")] - [return: MarshalAs(UnmanagedType.Bool)] - internal unsafe static extern bool GetLocaleInfoGroupingSizes(string localeName, uint localeGroupingData, ref int primaryGroupSize, ref int secondaryGroupSize); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetLocales")] - internal unsafe static extern int GetLocales([Out] Char[] value, int valueLength); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Normalization.cs b/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Normalization.cs deleted file mode 100644 index c4cb9fb851..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Normalization.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; -using System.Text; - -internal static partial class Interop -{ - internal static partial class GlobalizationInterop - { - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_IsNormalized")] - internal static extern int IsNormalized(NormalizationForm normalizationForm, string src, int srcLen); - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_NormalizeString")] - internal static extern int NormalizeString(NormalizationForm normalizationForm, string src, int srcLen, [Out] char[] dstBuffer, int dstBufferCapacity); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.ResultCode.cs b/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.ResultCode.cs deleted file mode 100644 index cca6ae4dcb..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.ResultCode.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -internal static partial class Interop -{ - internal static partial class GlobalizationInterop - { - // needs to be kept in sync with ResultCode in System.Globalization.Native - internal enum ResultCode - { - Success = 0, - UnknownError = 1, - InsufficentBuffer = 2, - OutOfMemory = 3 - } - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.TimeZoneInfo.cs b/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.TimeZoneInfo.cs deleted file mode 100644 index 26a9fe0579..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.TimeZoneInfo.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Runtime.InteropServices; -using System.Text; - -internal static partial class Interop -{ - internal static partial class GlobalizationInterop - { - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Ansi, EntryPoint = "GlobalizationNative_ReadLink")] // readlink requires char* - internal static extern bool ReadLink(string filePath, [Out] StringBuilder result, uint resultCapacity); - - // needs to be kept in sync with TimeZoneDisplayNameType in System.Globalization.Native - internal enum TimeZoneDisplayNameType - { - Generic = 0, - Standard = 1, - DaylightSavings = 2, - } - - [DllImport(Libraries.GlobalizationInterop, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetTimeZoneDisplayName")] - internal static extern ResultCode GetTimeZoneDisplayName( - string localeName, - string timeZoneId, - TimeZoneDisplayNameType type, - [Out] StringBuilder result, - int resultLength); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Utils.cs b/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Utils.cs deleted file mode 100644 index 33b10c0d74..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Globalization.Native/Interop.Utils.cs +++ /dev/null @@ -1,52 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Text; - -internal static partial class Interop -{ - /// <summary> - /// Helper for making interop calls that return a string, but we don't know - /// the correct size of buffer to make. So invoke the interop call with an - /// increasing buffer until the size is big enough. - /// </summary> - internal static bool CallStringMethod<TArg1, TArg2, TArg3>( - Func<TArg1, TArg2, TArg3, StringBuilder, GlobalizationInterop.ResultCode> interopCall, - TArg1 arg1, - TArg2 arg2, - TArg3 arg3, - out string result) - { - const int initialStringSize = 80; - const int maxDoubleAttempts = 5; - - StringBuilder stringBuilder = StringBuilderCache.Acquire(initialStringSize); - - for (int i = 0; i < maxDoubleAttempts; i++) - { - GlobalizationInterop.ResultCode resultCode = interopCall(arg1, arg2, arg3, stringBuilder); - - if (resultCode == GlobalizationInterop.ResultCode.Success) - { - result = StringBuilderCache.GetStringAndRelease(stringBuilder); - return true; - } - else if (resultCode == GlobalizationInterop.ResultCode.InsufficentBuffer) - { - // increase the string size and loop - stringBuilder.EnsureCapacity(stringBuilder.Capacity * 2); - } - else - { - // if there is an unknown error, don't proceed - break; - } - } - - StringBuilderCache.Release(stringBuilder); - result = null; - return false; - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Close.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Close.cs deleted file mode 100644 index 8d192398a0..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Close.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Sys - { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Close", SetLastError = true)] - internal static extern int Close(IntPtr fd); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FLock.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FLock.cs deleted file mode 100644 index 22934a3e77..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FLock.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; -using Microsoft.Win32.SafeHandles; - -internal static partial class Interop -{ - internal static partial class Sys - { - internal enum LockOperations : int - { - LOCK_SH = 1, /* shared lock */ - LOCK_EX = 2, /* exclusive lock */ - LOCK_NB = 4, /* don't block when locking*/ - LOCK_UN = 8, /* unlock */ - } - - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FLock", SetLastError = true)] - internal static extern int FLock(SafeFileHandle fd, LockOperations operation); - - /// <summary> - /// Exposing this for SafeFileHandle.ReleaseHandle() to call. - /// Normal callers should use FLock(SafeFileHandle fd). - /// </summary> - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FLock", SetLastError = true)] - internal static extern int FLock(IntPtr fd, LockOperations operation); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FSync.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FSync.cs deleted file mode 100644 index e3ab970931..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FSync.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Runtime.InteropServices; -using Microsoft.Win32.SafeHandles; - -internal static partial class Interop -{ - internal static partial class Sys - { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FSync", SetLastError = true)] - internal static extern int FSync(SafeFileHandle fd); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FTruncate.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FTruncate.cs deleted file mode 100644 index 5dad650362..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.FTruncate.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Runtime.InteropServices; -using Microsoft.Win32.SafeHandles; - -internal static partial class Interop -{ - internal static partial class Sys - { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FTruncate", SetLastError = true)] - internal static extern int FTruncate(SafeFileHandle fd, long length); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Fcntl.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Fcntl.cs deleted file mode 100644 index 23b48a4f5d..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Fcntl.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Sys - { - internal enum LockType : short - { - F_WRLCK = 1, // exclusive or write lock - F_UNLCK = 2 // unlock - } - - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LockFileRegion", SetLastError=true)] - internal static extern int LockFileRegion(SafeHandle fd, long offset, long length, LockType lockType); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.GetCwd.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.GetCwd.cs deleted file mode 100644 index 724e342342..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.GetCwd.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Sys - { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetCwd", SetLastError = true)] - private static unsafe extern byte* GetCwd(byte* buffer, int bufferLength); - - internal static unsafe string GetCwd() - { - const int StackLimit = 256; - - // First try to get the path into a buffer on the stack - byte* stackBuf = stackalloc byte[StackLimit]; - string result = GetCwdHelper(stackBuf, StackLimit); - if (result != null) - { - return result; - } - - // If that was too small, try increasing large buffer sizes - // until we get one that works or until we hit MaxPath. - int maxPath = Interop.Sys.MaxPath; - if (StackLimit < maxPath) - { - int bufferSize = StackLimit; - do - { - checked { bufferSize *= 2; } - var buf = new byte[Math.Min(bufferSize, maxPath)]; - fixed (byte* ptr = buf) - { - result = GetCwdHelper(ptr, buf.Length); - if (result != null) - { - return result; - } - } - } - while (bufferSize < maxPath); - } - - // If we couldn't get the cwd with a MaxPath-sized buffer, something's wrong. - throw Interop.GetExceptionForIoErrno(new ErrorInfo(Interop.Error.ENAMETOOLONG)); - } - - private static unsafe string GetCwdHelper(byte* ptr, int bufferSize) - { - // Call the real getcwd - byte* result = GetCwd(ptr, bufferSize); - - // If it returned non-null, the null-terminated path is in the buffer - if (result != null) - { - return Marshal.PtrToStringAnsi((IntPtr)ptr); - } - - // Otherwise, if it failed due to the buffer being too small, return null; - // for anything else, throw. - ErrorInfo errorInfo = Interop.Sys.GetLastErrorInfo(); - if (errorInfo.Error == Interop.Error.ERANGE) - { - return null; - } - throw Interop.GetExceptionForIoErrno(errorInfo); - } - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.GetUnixName.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.GetUnixName.cs deleted file mode 100644 index 33664c4d39..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.GetUnixName.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Sys - { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUnixName")] - private static extern IntPtr GetUnixNamePrivate(); - - internal static string GetUnixName() - { - IntPtr ptr = GetUnixNamePrivate(); - return Marshal.PtrToStringAnsi(ptr); - } - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.LSeek.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.LSeek.cs deleted file mode 100644 index 7f8df7c6bf..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.LSeek.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Runtime.InteropServices; -using Microsoft.Win32.SafeHandles; - -internal static partial class Interop -{ - internal static partial class Sys - { - internal enum SeekWhence - { - SEEK_SET = 0, - SEEK_CUR = 1, - SEEK_END = 2 - } - - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LSeek", SetLastError = true)] - internal static extern long LSeek(SafeFileHandle fd, long offset, SeekWhence whence); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.MksTemps.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.MksTemps.cs deleted file mode 100644 index b8694d9007..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.MksTemps.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Sys - { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MksTemps", SetLastError = true)] - internal static extern IntPtr MksTemps( - byte[] template, - int suffixlen); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Open.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Open.cs deleted file mode 100644 index a9a994c78c..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Open.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Runtime.InteropServices; -using Microsoft.Win32.SafeHandles; - -internal static partial class Interop -{ - internal static partial class Sys - { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Open", SetLastError = true)] - internal static extern SafeFileHandle Open(string filename, OpenFlags flags, int mode); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.OpenFlags.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.OpenFlags.cs deleted file mode 100644 index f9e54c3cbc..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.OpenFlags.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; - -internal static partial class Interop -{ - internal static partial class Sys - { - [Flags] - internal enum OpenFlags - { - // Access modes (mutually exclusive) - O_RDONLY = 0x0000, - O_WRONLY = 0x0001, - O_RDWR = 0x0002, - - // Flags (combinable) - O_CLOEXEC = 0x0010, - O_CREAT = 0x0020, - O_EXCL = 0x0040, - O_TRUNC = 0x0080, - O_SYNC = 0x0100, - } - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.PathConf.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.PathConf.cs deleted file mode 100644 index 4a1fcf67d0..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.PathConf.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Sys - { - internal static int DEFAULT_PC_NAME_MAX = 255; - - internal enum PathConfName : int - { - PC_LINK_MAX = 1, - PC_MAX_CANON = 2, - PC_MAX_INPUT = 3, - PC_NAME_MAX = 4, - PC_PATH_MAX = 5, - PC_PIPE_BUF = 6, - PC_CHOWN_RESTRICTED = 7, - PC_NO_TRUNC = 8, - PC_VDISABLE = 9, - } - - /// <summary>The maximum path length for the system. -1 if it hasn't yet been initialized.</summary> - private static int s_maxPath = -1; - - /// <summary>The maximum name length for the system. -1 if it hasn't yet been initialized.</summary> - private static int s_maxName = -1; - - internal static int MaxPath - { - get - { - // Benign race condition on cached value - if (s_maxPath < 0) - { - // GetMaximumPath returns a long from PathConf - // but our callers expect an int so we need to convert. - long temp = GetMaximumPath(); - if (temp > int.MaxValue) - s_maxPath = int.MaxValue; - else - s_maxPath = Convert.ToInt32(temp); - } - return s_maxPath; - } - } - - internal static int MaxName - { - get - { - // Benign race condition on cached value - if (s_maxName < 0) - { - int result = PathConf("/", PathConfName.PC_NAME_MAX); - s_maxName = result >= 0 ? result : DEFAULT_PC_NAME_MAX; - } - - return s_maxName; - } - } - - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PathConf", SetLastError = true)] - private static extern int PathConf(string path, PathConfName name); - - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetMaximumPath")] - private static extern long GetMaximumPath(); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Permissions.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Permissions.cs deleted file mode 100644 index f1d13787d2..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Permissions.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; - -internal static partial class Interop -{ - internal static partial class Sys - { - [Flags] - internal enum Permissions - { - Mask = S_IRWXU | S_IRWXG | S_IRWXO, - - S_IRWXU = S_IRUSR | S_IWUSR | S_IXUSR, - S_IRUSR = 0x100, - S_IWUSR = 0x80, - S_IXUSR = 0x40, - - S_IRWXG = S_IRGRP | S_IWGRP | S_IXGRP, - S_IRGRP = 0x20, - S_IWGRP = 0x10, - S_IXGRP = 0x8, - - S_IRWXO = S_IROTH | S_IWOTH | S_IXOTH, - S_IROTH = 0x4, - S_IWOTH = 0x2, - S_IXOTH = 0x1, - } - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.PosixFAdvise.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.PosixFAdvise.cs deleted file mode 100644 index 69e39b30d2..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.PosixFAdvise.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Runtime.InteropServices; -using Microsoft.Win32.SafeHandles; - -internal static partial class Interop -{ - internal static partial class Sys - { - internal enum FileAdvice : int - { - POSIX_FADV_NORMAL = 0, /* no special advice, the default value */ - POSIX_FADV_RANDOM = 1, /* random I/O access */ - POSIX_FADV_SEQUENTIAL = 2, /* sequential I/O access */ - POSIX_FADV_WILLNEED = 3, /* will need specified pages */ - POSIX_FADV_DONTNEED = 4, /* don't need the specified pages */ - POSIX_FADV_NOREUSE = 5, /* data will only be acessed once */ - } - - /// <summary> - /// Notifies the OS kernel that the specified file will be accessed in a particular way soon; this allows the kernel to - /// potentially optimize the access pattern of the file. - /// </summary> - /// <param name="fd">The file descriptor of the file</param> - /// <param name="offset">The start of the region to advise about</param> - /// <param name="length">The number of bytes of the region (until the end of the file if 0)</param> - /// <param name="advice">The type of advice to give the kernel about the specified region</param> - /// <returns> - /// Returns 0 on success; otherwise, the error code is returned - /// </returns> - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PosixFAdvise", SetLastError = false /* this is explicitly called out in the man page */)] - internal static extern int PosixFAdvise(SafeFileHandle fd, long offset, long length, FileAdvice advice); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Read.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Read.cs deleted file mode 100644 index 812ae348dc..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Read.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Runtime.InteropServices; -using Microsoft.Win32.SafeHandles; - -internal static partial class Interop -{ - internal static partial class Sys - { - /// <summary> - /// Reads a number of bytes from an open file descriptor into a specified buffer. - /// </summary> - /// <param name="fd">The open file descriptor to try to read from</param> - /// <param name="buffer">The buffer to read info into</param> - /// <param name="count">The size of the buffer</param> - /// <returns> - /// Returns the number of bytes read on success; otherwise, -1 is returned - /// Note - on fail. the position of the stream may change depending on the platform; consult man 2 read for more info - /// </returns> - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Read", SetLastError = true)] - internal static unsafe extern int Read(SafeFileHandle fd, byte* buffer, int count); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Stat.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Stat.cs deleted file mode 100644 index a8bc2ec7d1..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Stat.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; -using Microsoft.Win32.SafeHandles; - -internal static partial class Interop -{ - internal static partial class Sys - { - // Even though csc will by default use a sequential layout, a CS0649 warning as error - // is produced for un-assigned fields when no StructLayout is specified. - // - // Explicitly saying Sequential disables that warning/error for consumers which only - // use Stat in debug builds. - [StructLayout(LayoutKind.Sequential)] - internal struct FileStatus - { - internal FileStatusFlags Flags; - internal int Mode; - internal uint Uid; - internal uint Gid; - internal long Size; - internal long ATime; - internal long MTime; - internal long CTime; - internal long BirthTime; - } - - internal static class FileTypes - { - internal const int S_IFMT = 0xF000; - internal const int S_IFIFO = 0x1000; - internal const int S_IFCHR = 0x2000; - internal const int S_IFDIR = 0x4000; - internal const int S_IFREG = 0x8000; - internal const int S_IFLNK = 0xA000; - internal const int S_IFSOCK = 0xC000; - } - - [Flags] - internal enum FileStatusFlags - { - None = 0, - HasBirthTime = 1, - } - - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FStat", SetLastError = true)] - internal static extern int FStat(SafeFileHandle fd, out FileStatus output); - - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Stat", SetLastError = true)] - internal static extern int Stat(string path, out FileStatus output); - - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LStat", SetLastError = true)] - internal static extern int LStat(string path, out FileStatus output); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Unlink.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Unlink.cs deleted file mode 100644 index 829210fa7e..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Unlink.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Sys - { - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Unlink", SetLastError = true)] - internal static extern int Unlink(string pathname); - } -} diff --git a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Write.cs b/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Write.cs deleted file mode 100644 index c14fc26263..0000000000 --- a/src/mscorlib/corefx/Interop/Unix/System.Native/Interop.Write.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Runtime.InteropServices; -using Microsoft.Win32.SafeHandles; - -internal static partial class Interop -{ - internal static partial class Sys - { - /// <summary> - /// Writes the specified buffer to the provided open file descriptor - /// </summary> - /// <param name="fd">The file descriptor to try and write to</param> - /// <param name="buffer">The data to attempt to write</param> - /// <param name="bufferSize">The amount of data to write, in bytes</param> - /// <returns> - /// Returns the number of bytes written on success; otherwise, returns -1 and sets errno - /// </returns> - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)] - internal static unsafe extern int Write(SafeFileHandle fd, byte* buffer, int bufferSize); - - [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)] - internal static unsafe extern int Write(int fd, byte* buffer, int bufferSize); - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs b/src/mscorlib/corefx/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs deleted file mode 100644 index d2ce4131b0..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Diagnostics; -using System.Runtime.InteropServices; - -internal partial class Interop -{ - internal partial class BCrypt - { - internal static unsafe NTSTATUS BCryptGenRandom(byte* pbBuffer, int count) - { - Debug.Assert(pbBuffer != null); - Debug.Assert(count >= 0); - - return BCryptGenRandom(IntPtr.Zero, pbBuffer, count, BCRYPT_USE_SYSTEM_PREFERRED_RNG); - } - - private const int BCRYPT_USE_SYSTEM_PREFERRED_RNG = 0x00000002; - - [DllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)] - private static unsafe extern NTSTATUS BCryptGenRandom(IntPtr hAlgorithm, byte* pbBuffer, int cbBuffer, int dwFlags); - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/BCrypt/Interop.NTSTATUS.cs b/src/mscorlib/corefx/Interop/Windows/BCrypt/Interop.NTSTATUS.cs deleted file mode 100644 index 49d674f399..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/BCrypt/Interop.NTSTATUS.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; - -internal partial class Interop -{ - internal partial class BCrypt - { - internal enum NTSTATUS : uint - { - STATUS_SUCCESS = 0x0, - STATUS_NOT_FOUND = 0xc0000225, - STATUS_INVALID_PARAMETER = 0xc000000d, - STATUS_NO_MEMORY = 0xc0000017, - } - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/Crypt32/Interop.CryptProtectMemory.cs b/src/mscorlib/corefx/Interop/Windows/Crypt32/Interop.CryptProtectMemory.cs deleted file mode 100644 index b10cb6a041..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/Crypt32/Interop.CryptProtectMemory.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; -using System.Security; - -internal partial class Interop -{ - internal partial class Crypt32 - { - internal const uint CRYPTPROTECTMEMORY_BLOCK_SIZE = 16; - internal const uint CRYPTPROTECTMEMORY_SAME_PROCESS = 0; - - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CryptProtectMemory(SafeBSTRHandle pData, uint cbData, uint dwFlags); - - [DllImport(Libraries.Crypt32, CharSet = CharSet.Unicode, SetLastError = true)] - internal static extern bool CryptUnprotectMemory(SafeBSTRHandle pData, uint cbData, uint dwFlags); - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/Interop.BOOL.cs b/src/mscorlib/corefx/Interop/Windows/Interop.BOOL.cs deleted file mode 100644 index 9f4dab8935..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/Interop.BOOL.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -internal partial class Interop -{ - /// <summary> - /// Blittable version of Windows BOOL type. It is convenient in situations where - /// manual marshalling is required, or to avoid overhead of regular bool marshalling. - /// </summary> - /// <remarks> - /// Some Windows APIs return arbitrary integer values although the return type is defined - /// as BOOL. It is best to never compare BOOL to TRUE. Always use bResult != BOOL.FALSE - /// or bResult == BOOL.FALSE . - /// </remarks> - internal enum BOOL : int - { - FALSE = 0, - TRUE = 1, - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/Interop.Errors.cs b/src/mscorlib/corefx/Interop/Windows/Interop.Errors.cs deleted file mode 100644 index 7eeb18de01..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/Interop.Errors.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -internal partial class Interop -{ - internal partial class Errors - { - internal const int ERROR_SUCCESS = 0x0; - internal const int ERROR_INVALID_FUNCTION = 0x1; - internal const int ERROR_FILE_NOT_FOUND = 0x2; - internal const int ERROR_PATH_NOT_FOUND = 0x3; - internal const int ERROR_ACCESS_DENIED = 0x5; - internal const int ERROR_INVALID_HANDLE = 0x6; - internal const int ERROR_NOT_ENOUGH_MEMORY = 0x8; - internal const int ERROR_INVALID_DATA = 0xD; - internal const int ERROR_INVALID_DRIVE = 0xF; - internal const int ERROR_NO_MORE_FILES = 0x12; - internal const int ERROR_NOT_READY = 0x15; - internal const int ERROR_BAD_LENGTH = 0x18; - internal const int ERROR_SHARING_VIOLATION = 0x20; - internal const int ERROR_LOCK_VIOLATION = 0x21; - internal const int ERROR_HANDLE_EOF = 0x26; - internal const int ERROR_FILE_EXISTS = 0x50; - internal const int ERROR_INVALID_PARAMETER = 0x57; - internal const int ERROR_BROKEN_PIPE = 0x6D; - internal const int ERROR_INSUFFICIENT_BUFFER = 0x7A; - internal const int ERROR_INVALID_NAME = 0x7B; - internal const int ERROR_NEGATIVE_SEEK = 0x83; - internal const int ERROR_DIR_NOT_EMPTY = 0x91; - internal const int ERROR_BAD_PATHNAME = 0xA1; - internal const int ERROR_LOCK_FAILED = 0xA7; - internal const int ERROR_BUSY = 0xAA; - internal const int ERROR_ALREADY_EXISTS = 0xB7; - internal const int ERROR_BAD_EXE_FORMAT = 0xC1; - internal const int ERROR_ENVVAR_NOT_FOUND = 0xCB; - internal const int ERROR_FILENAME_EXCED_RANGE = 0xCE; - internal const int ERROR_EXE_MACHINE_TYPE_MISMATCH = 0xD8; - internal const int ERROR_PIPE_BUSY = 0xE7; - internal const int ERROR_NO_DATA = 0xE8; - internal const int ERROR_PIPE_NOT_CONNECTED = 0xE9; - internal const int ERROR_MORE_DATA = 0xEA; - internal const int ERROR_NO_MORE_ITEMS = 0x103; - internal const int ERROR_PARTIAL_COPY = 0x12B; - internal const int ERROR_ARITHMETIC_OVERFLOW = 0x216; - internal const int ERROR_PIPE_CONNECTED = 0x217; - internal const int ERROR_PIPE_LISTENING = 0x218; - internal const int ERROR_OPERATION_ABORTED = 0x3E3; - internal const int ERROR_IO_PENDING = 0x3E5; - internal const int ERROR_NO_TOKEN = 0x3f0; - internal const int ERROR_DLL_INIT_FAILED = 0x45A; - internal const int ERROR_NOT_FOUND = 0x490; - internal const int ERROR_NON_ACCOUNT_SID = 0x4E9; - internal const int ERROR_NOT_ALL_ASSIGNED = 0x514; - internal const int ERROR_UNKNOWN_REVISION = 0x519; - internal const int ERROR_INVALID_OWNER = 0x51B; - internal const int ERROR_INVALID_PRIMARY_GROUP = 0x51C; - internal const int ERROR_NO_SUCH_PRIVILEGE = 0x521; - internal const int ERROR_PRIVILEGE_NOT_HELD = 0x522; - internal const int ERROR_INVALID_ACL = 0x538; - internal const int ERROR_INVALID_SECURITY_DESCR = 0x53A; - internal const int ERROR_INVALID_SID = 0x539; - internal const int ERROR_BAD_IMPERSONATION_LEVEL = 0x542; - internal const int ERROR_CANT_OPEN_ANONYMOUS = 0x543; - internal const int ERROR_NO_SECURITY_ON_OBJECT = 0x546; - internal const int ERROR_TRUSTED_RELATIONSHIP_FAILURE = 0x6FD; - internal const int ERROR_RESOURCE_LANG_NOT_FOUND = 0x717; - internal const int EFail = unchecked((int)0x80004005); - internal const int E_FILENOTFOUND = unchecked((int)0x80070002); - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/Interop.Libraries.cs b/src/mscorlib/corefx/Interop/Windows/Interop.Libraries.cs deleted file mode 100644 index f19f9dcf52..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/Interop.Libraries.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -internal static partial class Interop -{ - internal static class Libraries - { - internal const string BCrypt = "BCrypt.dll"; - internal const string Crypt32 = "crypt32.dll"; - internal const string Kernel32 = "kernel32.dll"; - internal const string NtDll = "ntdll.dll"; - internal const string OleAut32 = "oleaut32.dll"; - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/NtDll/Interop.ZeroMemory.cs b/src/mscorlib/corefx/Interop/Windows/NtDll/Interop.ZeroMemory.cs deleted file mode 100644 index bd2a64cf14..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/NtDll/Interop.ZeroMemory.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; -using System.Security; - -internal partial class Interop -{ - internal partial class NtDll - { - - [DllImport(Libraries.NtDll, CharSet = CharSet.Unicode, EntryPoint = "RtlZeroMemory")] - internal static extern void ZeroMemory(IntPtr address, UIntPtr length); - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.CancelIoEx.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.CancelIoEx.cs deleted file mode 100644 index fc99e3052f..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.CancelIoEx.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.Win32.SafeHandles; -using System.Runtime.InteropServices; -using System.Threading; - -internal partial class Interop -{ - internal partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe bool CancelIoEx(SafeHandle handle, NativeOverlapped* lpOverlapped); - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.CloseHandle.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.CloseHandle.cs deleted file mode 100644 index 96ed922a84..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.CloseHandle.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; - -internal partial class Interop -{ - internal partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool CloseHandle(IntPtr handle); - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.CreateFile.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.CreateFile.cs deleted file mode 100644 index 5f6f6115ab..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.CreateFile.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.Win32.SafeHandles; -using System; -using System.IO; -using System.Runtime.InteropServices; - -internal partial class Interop -{ - internal partial class Kernel32 - { - /// <summary> - /// WARNING: This method does not implicitly handle long paths. Use CreateFile. - /// </summary> - [DllImport(Libraries.Kernel32, EntryPoint = "CreateFileW", SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = false)] - private static extern SafeFileHandle CreateFilePrivate( - string lpFileName, - int dwDesiredAccess, - System.IO.FileShare dwShareMode, - [In] ref SECURITY_ATTRIBUTES securityAttrs, - System.IO.FileMode dwCreationDisposition, - int dwFlagsAndAttributes, - IntPtr hTemplateFile); - - internal static SafeFileHandle CreateFile( - string lpFileName, - int dwDesiredAccess, - System.IO.FileShare dwShareMode, - [In] ref SECURITY_ATTRIBUTES securityAttrs, - System.IO.FileMode dwCreationDisposition, - int dwFlagsAndAttributes, - IntPtr hTemplateFile) - { - lpFileName = PathInternal.EnsureExtendedPrefixOverMaxPath(lpFileName); - return CreateFilePrivate(lpFileName, dwDesiredAccess, dwShareMode, ref securityAttrs, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile); - } - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.FileOperations.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.FileOperations.cs deleted file mode 100644 index 6e3ebb9ae9..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.FileOperations.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -internal partial class Interop -{ - internal partial class Kernel32 - { - - internal const uint SEM_FAILCRITICALERRORS = 1; - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.FileTypes.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.FileTypes.cs deleted file mode 100644 index 1d306665b1..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.FileTypes.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -internal partial class Interop -{ - internal partial class Kernel32 - { - internal partial class FileTypes - { - internal const int FILE_TYPE_DISK = 0x0001; - internal const int FILE_TYPE_CHAR = 0x0002; - internal const int FILE_TYPE_PIPE = 0x0003; - } - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.FlushFileBuffers.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.FlushFileBuffers.cs deleted file mode 100644 index e10a2279cf..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.FlushFileBuffers.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.Win32.SafeHandles; -using System; -using System.Runtime.InteropServices; - -internal partial class Interop -{ - internal partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - internal static extern bool FlushFileBuffers(SafeHandle hHandle); - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.FormatMessage.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.FormatMessage.cs deleted file mode 100644 index 94722b6c8b..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.FormatMessage.cs +++ /dev/null @@ -1,112 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Text; -using System.Runtime.InteropServices; - -internal partial class Interop -{ - internal partial class Kernel32 - { - private const int FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200; - private const int FORMAT_MESSAGE_FROM_HMODULE = 0x00000800; - private const int FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000; - private const int FORMAT_MESSAGE_ARGUMENT_ARRAY = 0x00002000; - - - private const int ERROR_INSUFFICIENT_BUFFER = 0x7A; - - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, EntryPoint = "FormatMessageW", SetLastError = true, BestFitMapping = true)] - private static extern int FormatMessage( - int dwFlags, - IntPtr lpSource, - uint dwMessageId, - int dwLanguageId, - [Out] StringBuilder lpBuffer, - int nSize, - IntPtr[] arguments); - - /// <summary> - /// Returns a string message for the specified Win32 error code. - /// </summary> - internal static string GetMessage(int errorCode) - { - return GetMessage(IntPtr.Zero, errorCode); - } - - internal static string GetMessage(IntPtr moduleHandle, int errorCode) - { - var sb = new StringBuilder(InitialBufferSize); - do - { - string errorMsg; - if (TryGetErrorMessage(moduleHandle, errorCode, sb, out errorMsg)) - { - return errorMsg; - } - else - { - // increase the capacity of the StringBuilder. - sb.Capacity *= BufferSizeIncreaseFactor; - } - } - while (sb.Capacity < MaxAllowedBufferSize); - - // If you come here then a size as large as 65K is also not sufficient and so we give the generic errorMsg. - return string.Format("Unknown error (0x{0:x})", errorCode); - } - - private static bool TryGetErrorMessage(IntPtr moduleHandle, int errorCode, StringBuilder sb, out string errorMsg) - { - errorMsg = ""; - - int flags = FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY; - if (moduleHandle != IntPtr.Zero) - { - flags |= FORMAT_MESSAGE_FROM_HMODULE; - } - - int result = FormatMessage(flags, moduleHandle, (uint)errorCode, 0, sb, sb.Capacity, null); - if (result != 0) - { - int i = sb.Length; - while (i > 0) - { - char ch = sb[i - 1]; - if (ch > 32 && ch != '.') break; - i--; - } - errorMsg = sb.ToString(0, i); - } - else if (Marshal.GetLastWin32Error() == ERROR_INSUFFICIENT_BUFFER) - { - return false; - } - else - { - errorMsg = string.Format("Unknown error (0x{0:x})", errorCode); - } - - return true; - } - - // Windows API FormatMessage lets you format a message string given an errorcode. - // Unlike other APIs this API does not support a way to query it for the total message size. - // - // So the API can only be used in one of these two ways. - // a. You pass a buffer of appropriate size and get the resource. - // b. Windows creates a buffer and passes the address back and the onus of releasing the buffer lies on the caller. - // - // Since the error code is coming from the user, it is not possible to know the size in advance. - // Unfortunately we can't use option b. since the buffer can only be freed using LocalFree and it is a private API on onecore. - // Also, using option b is ugly for the managed code and could cause memory leak in situations where freeing is unsuccessful. - // - // As a result we use the following approach. - // We initially call the API with a buffer size of 256 and then gradually increase the size in case of failure until we reach the maximum allowed limit of 65K. - private const int InitialBufferSize = 256; - private const int BufferSizeIncreaseFactor = 4; - private const int MaxAllowedBufferSize = 65 * 1024; - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.GetFileInformationByHandleEx.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.GetFileInformationByHandleEx.cs deleted file mode 100644 index 146c4638ee..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.GetFileInformationByHandleEx.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.Win32.SafeHandles; -using System; -using System.Runtime.InteropServices; - -internal partial class Interop -{ - internal partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool GetFileInformationByHandleEx(SafeFileHandle hFile, FILE_INFO_BY_HANDLE_CLASS FileInformationClass, out FILE_STANDARD_INFO lpFileInformation, uint dwBufferSize); - - internal partial struct FILE_STANDARD_INFO - { - internal long AllocationSize; - internal long EndOfFile; - internal uint NumberOfLinks; - internal BOOL DeletePending; - internal BOOL Directory; - } - - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.GetFileType_SafeHandle.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.GetFileType_SafeHandle.cs deleted file mode 100644 index c07a1683a5..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.GetFileType_SafeHandle.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.Win32.SafeHandles; -using System.Runtime.InteropServices; - -internal partial class Interop -{ - internal partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal extern static int GetFileType(SafeHandle hFile); - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.GetFullPathNameW.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.GetFullPathNameW.cs deleted file mode 100644 index 15dd581113..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.GetFullPathNameW.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; - -internal partial class Interop -{ - internal partial class Kernel32 - { - /// <summary> - /// WARNING: This method does not implicitly handle long paths. Use GetFullPathName or PathHelper. - /// </summary> - [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = false, ExactSpelling = true)] - unsafe internal static extern uint GetFullPathNameW(char* path, uint numBufferChars, char[] buffer, IntPtr mustBeZero); - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.GetLongPathNameW.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.GetLongPathNameW.cs deleted file mode 100644 index a58d1013ca..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.GetLongPathNameW.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; - -partial class Interop -{ - partial class Kernel32 - { - /// <summary> - /// WARNING: This method does not implicitly handle long paths. Use GetFullPath/PathHelper. - /// </summary> - [DllImport(Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Unicode, BestFitMapping = false, ExactSpelling = true)] - internal static extern uint GetLongPathNameW(char[] lpszShortPath, char[] lpszLongPath, uint cchBuffer); - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.GetTempFileNameW.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.GetTempFileNameW.cs deleted file mode 100644 index d157a29c92..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.GetTempFileNameW.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Text; -using System.Runtime.InteropServices; - -partial class Interop -{ - partial class Kernel32 - { - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true, BestFitMapping = false)] - internal static extern uint GetTempFileNameW(string tmpPath, string prefix, uint uniqueIdOrZero, [Out]StringBuilder tmpFileName); - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.GetTempPathW.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.GetTempPathW.cs deleted file mode 100644 index 25ffcd55b0..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.GetTempPathW.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.IO; -using System.Text; -using System.Runtime.InteropServices; - -partial class Interop -{ - partial class Kernel32 - { - [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, BestFitMapping = false)] - internal static extern uint GetTempPathW(int bufferLen, [Out]StringBuilder buffer); - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.LockFile.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.LockFile.cs deleted file mode 100644 index a21d00f4f6..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.LockFile.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.Win32.SafeHandles; -using System; -using System.IO; -using System.Runtime.InteropServices; - -internal partial class Interop -{ - internal partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool LockFile(SafeFileHandle handle, int offsetLow, int offsetHigh, int countLow, int countHigh); - - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool UnlockFile(SafeFileHandle handle, int offsetLow, int offsetHigh, int countLow, int countHigh); - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.ReadFile_SafeHandle_IntPtr.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.ReadFile_SafeHandle_IntPtr.cs deleted file mode 100644 index 076f7f136f..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.ReadFile_SafeHandle_IntPtr.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.Win32.SafeHandles; -using System; -using System.Runtime.InteropServices; - -internal partial class Interop -{ - internal partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe int ReadFile( - SafeHandle handle, - byte* bytes, - int numBytesToRead, - out int numBytesRead, - IntPtr mustBeZero); - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.ReadFile_SafeHandle_NativeOverlapped.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.ReadFile_SafeHandle_NativeOverlapped.cs deleted file mode 100644 index 3ae65a8806..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.ReadFile_SafeHandle_NativeOverlapped.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.Win32.SafeHandles; -using System; -using System.Runtime.InteropServices; -using System.Threading; - -internal partial class Interop -{ - internal partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe int ReadFile( - SafeHandle handle, - byte* bytes, - int numBytesToRead, - IntPtr numBytesRead_mustBeZero, - NativeOverlapped* overlapped); - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SECURITY_ATTRIBUTES.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SECURITY_ATTRIBUTES.cs deleted file mode 100644 index 8d31f8622f..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SECURITY_ATTRIBUTES.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.Win32.SafeHandles; -using System; -using System.Runtime.InteropServices; - -internal partial class Interop -{ - internal partial class Kernel32 - { - [StructLayout(LayoutKind.Sequential)] - internal struct SECURITY_ATTRIBUTES - { - internal uint nLength; - internal IntPtr lpSecurityDescriptor; - internal BOOL bInheritHandle; - } - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SafeCreateFile.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SafeCreateFile.cs deleted file mode 100644 index 4192f569e0..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SafeCreateFile.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.IO; -using System.Runtime.InteropServices; -using Microsoft.Win32.SafeHandles; - -internal partial class Interop -{ - internal partial class Kernel32 - { - internal static readonly IntPtr INVALID_HANDLE_VALUE = new IntPtr(-1); // WinBase.h - - /// <summary> - /// Does not allow access to non-file devices. This disallows DOS devices like "con:", "com1:", - /// "lpt1:", etc. Use this to avoid security problems, like allowing a web client asking a server - /// for "http://server/com1.aspx" and then causing a worker process to hang. - /// </summary> - internal static SafeFileHandle SafeCreateFile( - String lpFileName, - int dwDesiredAccess, - System.IO.FileShare dwShareMode, - ref Interop.Kernel32.SECURITY_ATTRIBUTES securityAttrs, - FileMode dwCreationDisposition, - int dwFlagsAndAttributes, - IntPtr hTemplateFile) - { - SafeFileHandle handle = UnsafeCreateFile(lpFileName, dwDesiredAccess, dwShareMode, ref securityAttrs, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile); - - if (!handle.IsInvalid) - { - int fileType = Interop.Kernel32.GetFileType(handle); - if (fileType != Interop.Kernel32.FileTypes.FILE_TYPE_DISK) - { - handle.Dispose(); - throw new NotSupportedException(SR.NotSupported_FileStreamOnNonFiles); - } - } - - return handle; - } - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SecurityOptions.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SecurityOptions.cs deleted file mode 100644 index 4a4402484f..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SecurityOptions.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -internal partial class Interop -{ - internal partial class Kernel32 - { - internal partial class SecurityOptions - { - internal const int SECURITY_SQOS_PRESENT = 0x00100000; - internal const int SECURITY_ANONYMOUS = 0 << 16; - internal const int SECURITY_IDENTIFICATION = 1 << 16; - internal const int SECURITY_IMPERSONATION = 2 << 16; - internal const int SECURITY_DELEGATION = 3 << 16; - } - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SetEndOfFile.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SetEndOfFile.cs deleted file mode 100644 index e5d60041a8..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SetEndOfFile.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.Win32.SafeHandles; -using System.Runtime.InteropServices; - -internal partial class Interop -{ - internal partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool SetEndOfFile(SafeFileHandle hFile); - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SetErrorMode.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SetErrorMode.cs deleted file mode 100644 index caa2ce5bfa..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SetErrorMode.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Runtime.InteropServices; - -internal partial class Interop -{ - internal partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = false, EntryPoint = "SetErrorMode", ExactSpelling = true)] - internal static extern uint SetErrorMode(uint newMode); - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SetFileInformationByHandle.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SetFileInformationByHandle.cs deleted file mode 100644 index e31a453ba9..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SetFileInformationByHandle.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.Win32.SafeHandles; -using System; -using System.Runtime.InteropServices; - -internal partial class Interop -{ - internal partial class Kernel32 - { - internal enum FILE_INFO_BY_HANDLE_CLASS : uint - { - FileBasicInfo = 0x0u, - FileStandardInfo = 0x1u, - FileNameInfo = 0x2u, - FileRenameInfo = 0x3u, - FileDispositionInfo = 0x4u, - FileAllocationInfo = 0x5u, - FileEndOfFileInfo = 0x6u, - FileStreamInfo = 0x7u, - FileCompressionInfo = 0x8u, - FileAttributeTagInfo = 0x9u, - FileIdBothDirectoryInfo = 0xAu, - FileIdBothDirectoryRestartInfo = 0xBu, - FileIoPriorityHintInfo = 0xCu, - FileRemoteProtocolInfo = 0xDu, - FileFullDirectoryInfo = 0xEu, - FileFullDirectoryRestartInfo = 0xFu, - FileStorageInfo = 0x10u, - FileAlignmentInfo = 0x11u, - FileIdInfo = 0x12u, - FileIdExtdDirectoryInfo = 0x13u, - FileIdExtdDirectoryRestartInfo = 0x14u, - MaximumFileInfoByHandleClass = 0x15u, - } - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SetFilePointerEx.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SetFilePointerEx.cs deleted file mode 100644 index c0e5247a52..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.SetFilePointerEx.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.Win32.SafeHandles; -using System.Runtime.InteropServices; - -internal partial class Interop -{ - internal partial class Kernel32 - { - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern bool SetFilePointerEx(SafeFileHandle hFile, long liDistanceToMove, out long lpNewFilePointer, uint dwMoveMethod); - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.UnsafeCreateFile.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.UnsafeCreateFile.cs deleted file mode 100644 index 9a5cd2834d..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.UnsafeCreateFile.cs +++ /dev/null @@ -1,25 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.IO; -using Microsoft.Win32.SafeHandles; - -internal partial class Interop -{ - internal partial class Kernel32 - { - internal static SafeFileHandle UnsafeCreateFile( - string lpFileName, - int dwDesiredAccess, - FileShare dwShareMode, - ref Interop.Kernel32.SECURITY_ATTRIBUTES securityAttrs, - FileMode dwCreationDisposition, - int dwFlagsAndAttributes, - IntPtr hTemplateFile) - { - return CreateFile(lpFileName, dwDesiredAccess, dwShareMode, ref securityAttrs, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile); - } - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.WideCharToMultiByte.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.WideCharToMultiByte.cs deleted file mode 100644 index 07271cae33..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.WideCharToMultiByte.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; - -internal partial class Interop -{ - internal partial class Kernel32 - { - [DllImport(Libraries.Kernel32)] - internal static extern unsafe int WideCharToMultiByte( - uint CodePage, uint dwFlags, - char* lpWideCharStr, int cchWideChar, - byte* lpMultiByteStr, int cbMultiByte, - IntPtr lpDefaultChar, IntPtr lpUsedDefaultChar); - - internal const uint CP_ACP = 0; - internal const uint WC_NO_BEST_FIT_CHARS = 0x00000400; - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.WriteFile_SafeHandle_IntPtr.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.WriteFile_SafeHandle_IntPtr.cs deleted file mode 100644 index e7e868e142..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.WriteFile_SafeHandle_IntPtr.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.Win32.SafeHandles; -using System; -using System.Runtime.InteropServices; - -internal partial class Interop -{ - internal partial class Kernel32 - { - // Note there are two different WriteFile prototypes - this is to use - // the type system to force you to not trip across a "feature" in - // Win32's async IO support. You can't do the following three things - // simultaneously: overlapped IO, free the memory for the overlapped - // struct in a callback (or an EndWrite method called by that callback), - // and pass in an address for the numBytesRead parameter. - - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe int WriteFile(SafeHandle handle, byte* bytes, int numBytesToWrite, out int numBytesWritten, IntPtr mustBeZero); - - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.WriteFile_SafeHandle_NativeOverlapped.cs b/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.WriteFile_SafeHandle_NativeOverlapped.cs deleted file mode 100644 index dc1e97555b..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/kernel32/Interop.WriteFile_SafeHandle_NativeOverlapped.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.Win32.SafeHandles; -using System; -using System.Runtime.InteropServices; -using System.Threading; -internal partial class Interop -{ - internal partial class Kernel32 - { - // Note there are two different WriteFile prototypes - this is to use - // the type system to force you to not trip across a "feature" in - // Win32's async IO support. You can't do the following three things - // simultaneously: overlapped IO, free the memory for the overlapped - // struct in a callback (or an EndWrite method called by that callback), - // and pass in an address for the numBytesRead parameter. - [DllImport(Libraries.Kernel32, SetLastError = true)] - internal static extern unsafe int WriteFile(SafeHandle handle, byte* bytes, int numBytesToWrite, IntPtr numBytesWritten_mustBeZero, NativeOverlapped* lpOverlapped); - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/oleaut32/Interop.SysAllocStringLen.cs b/src/mscorlib/corefx/Interop/Windows/oleaut32/Interop.SysAllocStringLen.cs deleted file mode 100644 index 65da4eaaea..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/oleaut32/Interop.SysAllocStringLen.cs +++ /dev/null @@ -1,16 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; -using System.Security; - -internal partial class Interop -{ - internal partial class OleAut32 - { - [DllImport(Libraries.OleAut32, CharSet = CharSet.Unicode)] - internal static extern SafeBSTRHandle SysAllocStringLen(IntPtr src, uint len); // BSTR - } -} diff --git a/src/mscorlib/corefx/Interop/Windows/oleaut32/Interop.SysStringLen.cs b/src/mscorlib/corefx/Interop/Windows/oleaut32/Interop.SysStringLen.cs deleted file mode 100644 index 027d8eece9..0000000000 --- a/src/mscorlib/corefx/Interop/Windows/oleaut32/Interop.SysStringLen.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; -using System.Security; - -internal partial class Interop -{ - internal partial class OleAut32 - { - [DllImport(Libraries.OleAut32)] - internal static extern uint SysStringLen(SafeBSTRHandle bstr); - - [DllImport(Libraries.OleAut32)] - internal static extern uint SysStringLen(IntPtr bstr); - - [DllImport(Libraries.OleAut32)] - internal static extern void SysFreeString(IntPtr bstr); - } -} diff --git a/src/mscorlib/corefx/Microsoft/Win32/SafeHandles/SafeFileHandle.Unix.cs b/src/mscorlib/corefx/Microsoft/Win32/SafeHandles/SafeFileHandle.Unix.cs deleted file mode 100644 index d13b536204..0000000000 --- a/src/mscorlib/corefx/Microsoft/Win32/SafeHandles/SafeFileHandle.Unix.cs +++ /dev/null @@ -1,119 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Diagnostics; -using System.Runtime.InteropServices; - -namespace Microsoft.Win32.SafeHandles -{ - public sealed class SafeFileHandle : SafeHandleZeroOrMinusOneIsInvalid - { - /// <summary>A handle value of -1.</summary> - private static readonly IntPtr s_invalidHandle = new IntPtr(-1); - - private SafeFileHandle() : this(ownsHandle: true) - { - } - - private SafeFileHandle(bool ownsHandle) - : base(ownsHandle) - { - SetHandle(s_invalidHandle); - } - - public SafeFileHandle(IntPtr preexistingHandle, bool ownsHandle) : this(ownsHandle) - { - SetHandle(preexistingHandle); - } - - internal bool? IsAsync { get; set; } - - /// <summary>Opens the specified file with the requested flags and mode.</summary> - /// <param name="path">The path to the file.</param> - /// <param name="flags">The flags with which to open the file.</param> - /// <param name="mode">The mode for opening the file.</param> - /// <returns>A SafeFileHandle for the opened file.</returns> - internal static SafeFileHandle Open(string path, Interop.Sys.OpenFlags flags, int mode) - { - Debug.Assert(path != null); - - // If we fail to open the file due to a path not existing, we need to know whether to blame - // the file itself or its directory. If we're creating the file, then we blame the directory, - // otherwise we blame the file. - bool enoentDueToDirectory = (flags & Interop.Sys.OpenFlags.O_CREAT) != 0; - - // Open the file. - SafeFileHandle handle = Interop.CheckIo( - Interop.Sys.Open(path, flags, mode), - path, - isDirectory: enoentDueToDirectory, - errorRewriter: e => (e.Error == Interop.Error.EISDIR) ? Interop.Error.EACCES.Info() : e); - - // Make sure it's not a directory; we do this after opening it once we have a file descriptor - // to avoid race conditions. - Interop.Sys.FileStatus status; - if (Interop.Sys.FStat(handle, out status) != 0) - { - handle.Dispose(); - throw Interop.GetExceptionForIoErrno(Interop.Sys.GetLastErrorInfo(), path); - } - if ((status.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFDIR) - { - handle.Dispose(); - throw Interop.GetExceptionForIoErrno(Interop.Error.EACCES.Info(), path, isDirectory: true); - } - - return handle; - } - - /// <summary>Opens a SafeFileHandle for a file descriptor created by a provided delegate.</summary> - /// <param name="fdFunc"> - /// The function that creates the file descriptor. Returns the file descriptor on success, or an invalid - /// file descriptor on error with Marshal.GetLastWin32Error() set to the error code. - /// </param> - /// <returns>The created SafeFileHandle.</returns> - internal static SafeFileHandle Open(Func<SafeFileHandle> fdFunc) - { - SafeFileHandle handle = Interop.CheckIo(fdFunc()); - - Debug.Assert(!handle.IsInvalid, "File descriptor is invalid"); - return handle; - } - - protected override bool ReleaseHandle() - { - // When the SafeFileHandle was opened, we likely issued an flock on the created descriptor in order to add - // an advisory lock. This lock should be removed via closing the file descriptor, but close can be - // interrupted, and we don't retry closes. As such, we could end up leaving the file locked, - // which could prevent subsequent usage of the file until this process dies. To avoid that, we proactively - // try to release the lock before we close the handle. (If it's not locked, there's no behavioral - // problem trying to unlock it.) - Interop.Sys.FLock(handle, Interop.Sys.LockOperations.LOCK_UN); // ignore any errors - - // Close the descriptor. Although close is documented to potentially fail with EINTR, we never want - // to retry, as the descriptor could actually have been closed, been subsequently reassigned, and - // be in use elsewhere in the process. Instead, we simply check whether the call was successful. - int result = Interop.Sys.Close(handle); -#if DEBUG - if (result != 0) - { - Debug.Fail(string.Format( - "Close failed with result {0} and error {1}", - result, Interop.Sys.GetLastErrorInfo())); - } -#endif - return result == 0; - } - - public override bool IsInvalid - { - get - { - long h = (long)handle; - return h < 0 || h > int.MaxValue; - } - } - } -} diff --git a/src/mscorlib/corefx/Microsoft/Win32/SafeHandles/SafeFileHandle.Windows.cs b/src/mscorlib/corefx/Microsoft/Win32/SafeHandles/SafeFileHandle.Windows.cs deleted file mode 100644 index 4eabe8f08c..0000000000 --- a/src/mscorlib/corefx/Microsoft/Win32/SafeHandles/SafeFileHandle.Windows.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Security; -using System.Runtime.InteropServices; -using System.Threading; -using Microsoft.Win32; - -namespace Microsoft.Win32.SafeHandles -{ - public sealed class SafeFileHandle : SafeHandleZeroOrMinusOneIsInvalid - { - private bool? _isAsync; - - private SafeFileHandle() : base(true) - { - _isAsync = null; - } - - public SafeFileHandle(IntPtr preexistingHandle, bool ownsHandle) : base(ownsHandle) - { - SetHandle(preexistingHandle); - - _isAsync = null; - } - - internal bool? IsAsync - { - get - { - return _isAsync; - } - - set - { - _isAsync = value; - } - } - - internal ThreadPoolBoundHandle ThreadPoolBinding { get; set; } - - override protected bool ReleaseHandle() - { - return Interop.Kernel32.CloseHandle(handle); - } - } -} - diff --git a/src/mscorlib/corefx/Microsoft/Win32/SafeHandles/SafeThreadPoolIOHandle.cs b/src/mscorlib/corefx/Microsoft/Win32/SafeHandles/SafeThreadPoolIOHandle.cs deleted file mode 100644 index 3dbc2bb620..0000000000 --- a/src/mscorlib/corefx/Microsoft/Win32/SafeHandles/SafeThreadPoolIOHandle.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; - -namespace Microsoft.Win32.SafeHandles -{ - internal class SafeThreadPoolIOHandle : SafeHandle - { - private SafeThreadPoolIOHandle() - : base(IntPtr.Zero, true) - { - } - - public override bool IsInvalid - { - get { return handle == IntPtr.Zero; } - } - - protected override bool ReleaseHandle() - { - Interop.mincore.CloseThreadpoolIo(handle); - return true; - } - } -} diff --git a/src/mscorlib/corefx/SR.cs b/src/mscorlib/corefx/SR.cs deleted file mode 100644 index 012bb86a66..0000000000 --- a/src/mscorlib/corefx/SR.cs +++ /dev/null @@ -1,818 +0,0 @@ -using System; -using System.Globalization; - -// CoreFX creates SR in the System namespace. While putting the CoreCLR SR adapter in the root -// may be unconventional, it allows us to keep the shared code identical. - -internal static class SR -{ - public static string Arg_ArrayZeroError - { - get { return Environment.GetResourceString("Arg_ArrayZeroError"); } - } - - public static string Arg_ExternalException - { - get { return Environment.GetResourceString("Arg_ExternalException"); } - } - - public static string Arg_HexStyleNotSupported - { - get { return Environment.GetResourceString("Arg_HexStyleNotSupported"); } - } - - public static string Arg_InvalidHexStyle - { - get { return Environment.GetResourceString("Arg_InvalidHexStyle"); } - } - - public static string ArgumentNull_Array - { - get { return Environment.GetResourceString("ArgumentNull_Array"); } - } - - public static string ArgumentNull_ArrayValue - { - get { return Environment.GetResourceString("ArgumentNull_ArrayValue"); } - } - - public static string ArgumentNull_Obj - { - get { return Environment.GetResourceString("ArgumentNull_Obj"); } - } - - public static string ArgumentNull_String - { - get { return Environment.GetResourceString("ArgumentNull_String"); } - } - - public static string ArgumentOutOfRange_AddValue - { - get { return Environment.GetResourceString("ArgumentOutOfRange_AddValue"); } - } - - public static string ArgumentOutOfRange_BadHourMinuteSecond - { - get { return Environment.GetResourceString("ArgumentOutOfRange_BadHourMinuteSecond"); } - } - - public static string ArgumentOutOfRange_BadYearMonthDay - { - get { return Environment.GetResourceString("ArgumentOutOfRange_BadYearMonthDay"); } - } - - public static string ArgumentOutOfRange_Bounds_Lower_Upper - { - get { return Environment.GetResourceString("ArgumentOutOfRange_Bounds_Lower_Upper"); } - } - - public static string ArgumentOutOfRange_CalendarRange - { - get { return Environment.GetResourceString("ArgumentOutOfRange_CalendarRange"); } - } - - public static string ArgumentOutOfRange_Count - { - get { return Environment.GetResourceString("ArgumentOutOfRange_Count"); } - } - - public static string ArgumentOutOfRange_Day - { - get { return Environment.GetResourceString("ArgumentOutOfRange_Day"); } - } - - public static string ArgumentOutOfRange_Enum - { - get { return Environment.GetResourceString("ArgumentOutOfRange_Enum"); } - } - - public static string ArgumentOutOfRange_Era - { - get { return Environment.GetResourceString("ArgumentOutOfRange_Era"); } - } - - public static string ArgumentOutOfRange_Index - { - get { return Environment.GetResourceString("ArgumentOutOfRange_Index"); } - } - - public static string ArgumentOutOfRange_IndexCountBuffer - { - get { return Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"); } - } - - public static string ArgumentOutOfRange_InvalidEraValue - { - get { return Environment.GetResourceString("ArgumentOutOfRange_InvalidEraValue"); } - } - - public static string ArgumentOutOfRange_Month - { - get { return Environment.GetResourceString("ArgumentOutOfRange_Month"); } - } - - public static string ArgumentOutOfRange_NeedNonNegNum - { - get { return Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"); } - } - - public static string ArgumentOutOfRange_NeedPosNum - { - get { return Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum"); } - } - - public static string Arg_ArgumentOutOfRangeException - { - get { return Environment.GetResourceString("Arg_ArgumentOutOfRangeException"); } - } - - public static string ArgumentOutOfRange_OffsetLength - { - get { return Environment.GetResourceString("ArgumentOutOfRange_OffsetLength"); } - } - - public static string ArgumentOutOfRange_Range - { - get { return Environment.GetResourceString("ArgumentOutOfRange_Range"); } - } - - public static string Argument_CompareOptionOrdinal - { - get { return Environment.GetResourceString("Argument_CompareOptionOrdinal"); } - } - - public static string Argument_ConflictingDateTimeRoundtripStyles - { - get { return Environment.GetResourceString("Argument_ConflictingDateTimeRoundtripStyles"); } - } - - public static string Argument_ConflictingDateTimeStyles - { - get { return Environment.GetResourceString("Argument_ConflictingDateTimeStyles"); } - } - - public static string Argument_CultureIetfNotSupported - { - get { return Environment.GetResourceString("Argument_CultureIetfNotSupported"); } - } - - public static string Argument_CultureInvalidIdentifier - { - get { return Environment.GetResourceString("Argument_CultureInvalidIdentifier"); } - } - - public static string Argument_CultureNotSupported - { - get { return Environment.GetResourceString("Argument_CultureNotSupported"); } - } - - public static string Argument_CultureIsNeutral - { - get { return Environment.GetResourceString("Argument_CultureIsNeutral"); } - } - - public static string Argument_CustomCultureCannotBePassedByNumber - { - get { return Environment.GetResourceString("Argument_CustomCultureCannotBePassedByNumber"); } - } - - public static string Argument_EmptyDecString - { - get { return Environment.GetResourceString("Argument_EmptyDecString"); } - } - - public static string Argument_IdnBadLabelSize - { - get { return Environment.GetResourceString("Argument_IdnBadLabelSize"); } - } - - public static string Argument_IdnBadPunycode - { - get { return Environment.GetResourceString("Argument_IdnBadPunycode"); } - } - - public static string Argument_IdnIllegalName - { - get { return Environment.GetResourceString("Argument_IdnIllegalName"); } - } - - public static string Argument_InvalidArrayLength - { - get { return Environment.GetResourceString("Argument_InvalidArrayLength"); } - } - - public static string Argument_InvalidCalendar - { - get { return Environment.GetResourceString("Argument_InvalidCalendar"); } - } - - public static string Argument_InvalidCharSequence - { - get { return Environment.GetResourceString("Argument_InvalidCharSequence"); } - } - - public static string Argument_InvalidCultureName - { - get { return Environment.GetResourceString("Argument_InvalidCultureName"); } - } - - public static string Argument_InvalidDateTimeStyles - { - get { return Environment.GetResourceString("Argument_InvalidDateTimeStyles"); } - } - - public static string Argument_InvalidDigitSubstitution - { - get { return Environment.GetResourceString("Argument_InvalidDigitSubstitution"); } - } - - public static string Argument_InvalidFlag - { - get { return Environment.GetResourceString("Argument_InvalidFlag"); } - } - - public static string Argument_InvalidGroupSize - { - get { return Environment.GetResourceString("Argument_InvalidGroupSize"); } - } - - public static string Argument_InvalidNativeDigitCount - { - get { return Environment.GetResourceString("Argument_InvalidNativeDigitCount"); } - } - - public static string Argument_InvalidNativeDigitValue - { - get { return Environment.GetResourceString("Argument_InvalidNativeDigitValue"); } - } - - public static string Argument_InvalidNeutralRegionName - { - get { return Environment.GetResourceString("Argument_InvalidNeutralRegionName"); } - } - - public static string Argument_InvalidNumberStyles - { - get { return Environment.GetResourceString("Argument_InvalidNumberStyles"); } - } - - public static string Argument_InvalidResourceCultureName - { - get { return Environment.GetResourceString("Argument_InvalidResourceCultureName"); } - } - - public static string Argument_NoEra - { - get { return Environment.GetResourceString("Argument_NoEra"); } - } - - public static string Argument_NoRegionInvariantCulture - { - get { return Environment.GetResourceString("Argument_NoRegionInvariantCulture"); } - } - - public static string Argument_OneOfCulturesNotSupported - { - get { return Environment.GetResourceString("Argument_OneOfCulturesNotSupported"); } - } - - public static string Argument_OnlyMscorlib - { - get { return Environment.GetResourceString("Argument_OnlyMscorlib"); } - } - - public static string Argument_ResultCalendarRange - { - get { return Environment.GetResourceString("Argument_ResultCalendarRange"); } - } - - public static string Format_BadFormatSpecifier - { - get { return Environment.GetResourceString("Format_BadFormatSpecifier"); } - } - - public static string InvalidOperation_DateTimeParsing - { - get { return Environment.GetResourceString("InvalidOperation_DateTimeParsing"); } - } - - public static string InvalidOperation_EnumEnded - { - get { return Environment.GetResourceString("InvalidOperation_EnumEnded"); } - } - - public static string InvalidOperation_EnumNotStarted - { - get { return Environment.GetResourceString("InvalidOperation_EnumNotStarted"); } - } - - public static string InvalidOperation_ReadOnly - { - get { return Environment.GetResourceString("InvalidOperation_ReadOnly"); } - } - - public static string Overflow_TimeSpanTooLong - { - get { return Environment.GetResourceString("Overflow_TimeSpanTooLong"); } - } - - public static string Serialization_MemberOutOfRange - { - get { return Environment.GetResourceString("Serialization_MemberOutOfRange"); } - } - - public static string Arg_InvalidHandle - { - get { return Environment.GetResourceString("Arg_InvalidHandle"); } - } - - public static string ObjectDisposed_FileClosed - { - get { return Environment.GetResourceString("ObjectDisposed_FileClosed"); } - } - - public static string Arg_HandleNotAsync - { - get { return Environment.GetResourceString("Arg_HandleNotAsync"); } - } - - public static string ArgumentNull_Path - { - get { return Environment.GetResourceString("ArgumentNull_Path"); } - } - - public static string Argument_EmptyPath - { - get { return Environment.GetResourceString("Argument_EmptyPath"); } - } - - public static string Argument_InvalidFileModeAndAccessCombo - { - get { return Environment.GetResourceString("Argument_InvalidFileMode&AccessCombo"); } - } - - public static string Argument_InvalidAppendMode - { - get { return Environment.GetResourceString("Argument_InvalidAppendMode"); } - } - - public static string ArgumentNull_Buffer - { - get { return Environment.GetResourceString("ArgumentNull_Buffer"); } - } - - public static string Argument_InvalidOffLen - { - get { return Environment.GetResourceString("Argument_InvalidOffLen"); } - } - - public static string IO_UnknownFileName - { - get { return Environment.GetResourceString("IO_UnknownFileName"); } - } - - public static string IO_FileStreamHandlePosition - { - get { return Environment.GetResourceString("IO.IO_FileStreamHandlePosition"); } - } - - public static string NotSupported_FileStreamOnNonFiles - { - get { return Environment.GetResourceString("NotSupported_FileStreamOnNonFiles"); } - } - - public static string IO_BindHandleFailed - { - get { return Environment.GetResourceString("IO.IO_BindHandleFailed"); } - } - - public static string Arg_HandleNotSync - { - get { return Environment.GetResourceString("Arg_HandleNotSync"); } - } - - public static string IO_SetLengthAppendTruncate - { - get { return Environment.GetResourceString("IO.IO_SetLengthAppendTruncate"); } - } - - public static string ArgumentOutOfRange_FileLengthTooBig - { - get { return Environment.GetResourceString("ArgumentOutOfRange_FileLengthTooBig"); } - } - - public static string Argument_InvalidSeekOrigin - { - get { return Environment.GetResourceString("Argument_InvalidSeekOrigin"); } - } - - public static string IO_SeekAppendOverwrite - { - get { return Environment.GetResourceString("IO.IO_SeekAppendOverwrite"); } - } - - public static string IO_FileTooLongOrHandleNotSync - { - get { return Environment.GetResourceString("IO_FileTooLongOrHandleNotSync"); } - } - - public static string IndexOutOfRange_IORaceCondition - { - get { return Environment.GetResourceString("IndexOutOfRange_IORaceCondition"); } - } - - public static string IO_FileNotFound - { - get { return Environment.GetResourceString("IO.FileNotFound"); } - } - - public static string IO_FileNotFound_FileName - { - get { return Environment.GetResourceString("IO.FileNotFound_FileName"); } - } - - public static string IO_PathNotFound_NoPathName - { - get { return Environment.GetResourceString("IO.PathNotFound_NoPathName"); } - } - - public static string IO_PathNotFound_Path - { - get { return Environment.GetResourceString("IO.PathNotFound_Path"); } - } - - public static string UnauthorizedAccess_IODenied_NoPathName - { - get { return Environment.GetResourceString("UnauthorizedAccess_IODenied_NoPathName"); } - } - - public static string UnauthorizedAccess_IODenied_Path - { - get { return Environment.GetResourceString("UnauthorizedAccess_IODenied_Path"); } - } - - public static string IO_AlreadyExists_Name - { - get { return Environment.GetResourceString("IO.IO_AlreadyExists_Name"); } - } - - public static string IO_PathTooLong - { - get { return Environment.GetResourceString("IO.PathTooLong"); } - } - - public static string IO_SharingViolation_NoFileName - { - get { return Environment.GetResourceString("IO.IO_SharingViolation_NoFileName"); } - } - - public static string IO_SharingViolation_File - { - get { return Environment.GetResourceString("IO.IO_SharingViolation_File"); } - } - - public static string IO_FileExists_Name - { - get { return Environment.GetResourceString("IO.IO_FileExists_Name"); } - } - - public static string NotSupported_UnwritableStream - { - get { return Environment.GetResourceString("NotSupported_UnwritableStream"); } - } - - public static string NotSupported_UnreadableStream - { - get { return Environment.GetResourceString("NotSupported_UnreadableStream"); } - } - - public static string NotSupported_UnseekableStream - { - get { return Environment.GetResourceString("NotSupported_UnseekableStream"); } - } - - public static string IO_EOF_ReadBeyondEOF - { - get { return Environment.GetResourceString("IO.EOF_ReadBeyondEOF"); } - } - - public static string Argument_InvalidHandle - { - get { return Environment.GetResourceString("Argument_InvalidHandle"); } - } - - public static string Argument_AlreadyBoundOrSyncHandle - { - get { return Environment.GetResourceString("Argument_AlreadyBoundOrSyncHandle"); } - } - - public static string Argument_PreAllocatedAlreadyAllocated - { - get { return Environment.GetResourceString("Argument_PreAllocatedAlreadyAllocated"); } - } - - public static string Argument_NativeOverlappedAlreadyFree - { - get { return Environment.GetResourceString("Argument_NativeOverlappedAlreadyFree"); } - } - - public static string Argument_NativeOverlappedWrongBoundHandle - { - get { return Environment.GetResourceString("Argument_NativeOverlappedWrongBoundHandle"); } - } - - public static string InvalidOperation_NativeOverlappedReused - { - get { return Environment.GetResourceString("InvalidOperation_NativeOverlappedReused"); } - } - - public static string ArgumentOutOfRange_Length - { - get { return Environment.GetResourceString("ArgumentOutOfRange_Length"); } - } - - public static string ArgumentOutOfRange_IndexString - { - get { return Environment.GetResourceString("ArgumentOutOfRange_IndexString"); } - } - - public static string ArgumentOutOfRange_Capacity - { - get { return Environment.GetResourceString("ArgumentOutOfRange_Capacity"); } - } - - public static string Arg_CryptographyException - { - get { return Environment.GetResourceString("Arg_CryptographyException"); } - } - - public static string ArgumentException_BufferNotFromPool - { - get { return Environment.GetResourceString("ArgumentException_BufferNotFromPool"); } - } - - public static string Argument_InvalidPathChars - { - get { return Environment.GetResourceString("Argument_InvalidPathChars"); } - } - - public static string Argument_PathFormatNotSupported - { - get { return Environment.GetResourceString("Argument_PathFormatNotSupported"); } - } - - public static string Arg_PathIllegal - { - get { return Environment.GetResourceString("Arg_PathIllegal"); } - } - - public static string Arg_PathIllegalUNC - { - get { return Environment.GetResourceString("Arg_PathIllegalUNC"); } - } - - public static string Arg_InvalidSearchPattern - { - get { return Environment.GetResourceString("Arg_InvalidSearchPattern"); } - } - - public static string InvalidOperation_Cryptography - { - get { return Environment.GetResourceString("InvalidOperation_Cryptography"); } - } - - public static string Format(string formatString, params object[] args) - { - return string.Format(CultureInfo.CurrentCulture, formatString, args); - } - - internal static string ArgumentException_ValueTupleIncorrectType - { - get { return Environment.GetResourceString("ArgumentException_ValueTupleIncorrectType"); } - } - - internal static string ArgumentException_ValueTupleLastArgumentNotATuple - { - get { return Environment.GetResourceString("ArgumentException_ValueTupleLastArgumentNotATuple"); } - } - - internal static string SpinLock_TryEnter_ArgumentOutOfRange - { - get { return Environment.GetResourceString("SpinLock_TryEnter_ArgumentOutOfRange"); } - } - - internal static string SpinLock_TryReliableEnter_ArgumentException - { - get { return Environment.GetResourceString("SpinLock_TryReliableEnter_ArgumentException"); } - } - - internal static string SpinLock_TryEnter_LockRecursionException - { - get { return Environment.GetResourceString("SpinLock_TryEnter_LockRecursionException"); } - } - - internal static string SpinLock_Exit_SynchronizationLockException - { - get { return Environment.GetResourceString("SpinLock_Exit_SynchronizationLockException"); } - } - - internal static string SpinLock_IsHeldByCurrentThread - { - get { return Environment.GetResourceString("SpinLock_IsHeldByCurrentThread"); } - } - - internal static string ObjectDisposed_StreamIsClosed - { - get { return Environment.GetResourceString("ObjectDisposed_StreamIsClosed"); } - } - - internal static string Arg_SystemException - { - get { return Environment.GetResourceString("Arg_SystemException"); } - } - - internal static string Arg_StackOverflowException - { - get { return Environment.GetResourceString("Arg_StackOverflowException"); } - } - - internal static string Arg_DataMisalignedException - { - get { return Environment.GetResourceString("Arg_DataMisalignedException"); } - } - - internal static string Arg_ExecutionEngineException - { - get { return Environment.GetResourceString("Arg_ExecutionEngineException"); } - } - - internal static string Arg_AccessException - { - get { return Environment.GetResourceString("Arg_AccessException"); } - } - - internal static string Arg_AccessViolationException - { - get { return Environment.GetResourceString("Arg_AccessViolationException"); } - } - - internal static string Arg_ApplicationException - { - get { return Environment.GetResourceString("Arg_ApplicationException"); } - } - - internal static string Arg_ArgumentException - { - get { return Environment.GetResourceString("Arg_ArgumentException"); } - } - - internal static string Arg_ParamName_Name - { - get { return Environment.GetResourceString("Arg_ParamName_Name"); } - } - - internal static string ArgumentNull_Generic - { - get { return Environment.GetResourceString("ArgumentNull_Generic"); } - } - - internal static string Arg_ArithmeticException - { - get { return Environment.GetResourceString("Arg_ArithmeticException"); } - } - - internal static string Arg_ArrayTypeMismatchException - { - get { return Environment.GetResourceString("Arg_ArrayTypeMismatchException"); } - } - - internal static string Arg_DivideByZero - { - get { return Environment.GetResourceString("Arg_DivideByZero"); } - } - - internal static string Arg_DuplicateWaitObjectException - { - get { return Environment.GetResourceString("Arg_DuplicateWaitObjectException"); } - } - - internal static string Arg_EntryPointNotFoundException - { - get { return Environment.GetResourceString("Arg_EntryPointNotFoundException"); } - } - - internal static string Arg_FieldAccessException - { - get { return Environment.GetResourceString("Arg_FieldAccessException"); } - } - - internal static string Arg_FormatException - { - get { return Environment.GetResourceString("Arg_FormatException"); } - } - - internal static string Arg_IndexOutOfRangeException - { - get { return Environment.GetResourceString("Arg_IndexOutOfRangeException"); } - } - - internal static string Arg_InsufficientExecutionStackException - { - get { return Environment.GetResourceString("Arg_InsufficientExecutionStackException"); } - } - - internal static string Arg_InvalidCastException - { - get { return Environment.GetResourceString("Arg_InvalidCastException"); } - } - - internal static string Arg_InvalidOperationException - { - get { return Environment.GetResourceString("Arg_InvalidOperationException"); } - } - - internal static string InvalidProgram_Default - { - get { return Environment.GetResourceString("InvalidProgram_Default"); } - } - - internal static string Arg_MethodAccessException - { - get { return Environment.GetResourceString("Arg_MethodAccessException"); } - } - - internal static string Arg_MulticastNotSupportedException - { - get { return Environment.GetResourceString("Arg_MulticastNotSupportedException"); } - } - - internal static string Arg_NotFiniteNumberException - { - get { return Environment.GetResourceString("Arg_NotFiniteNumberException"); } - } - - internal static string Arg_NotImplementedException - { - get { return Environment.GetResourceString("Arg_NotImplementedException"); } - } - - internal static string Arg_NotSupportedException - { - get { return Environment.GetResourceString("Arg_NotSupportedException"); } - } - - internal static string Arg_NullReferenceException - { - get { return Environment.GetResourceString("Arg_NullReferenceException"); } - } - - internal static string ObjectDisposed_Generic - { - get { return Environment.GetResourceString("ObjectDisposed_Generic"); } - } - - internal static string ObjectDisposed_ObjectName_Name - { - get { return Environment.GetResourceString("ObjectDisposed_ObjectName_Name"); } - } - - internal static string Arg_OverflowException - { - get { return Environment.GetResourceString("Arg_OverflowException"); } - } - - internal static string Arg_PlatformNotSupported - { - get { return Environment.GetResourceString("Arg_PlatformNotSupported"); } - } - - internal static string Arg_RankException - { - get { return Environment.GetResourceString("Arg_RankException"); } - } - - internal static string Arg_TimeoutException - { - get { return Environment.GetResourceString("Arg_TimeoutException"); } - } - - internal static string Arg_TypeAccessException - { - get { return Environment.GetResourceString("Arg_TypeAccessException"); } - } - - internal static string TypeInitialization_Default - { - get { return Environment.GetResourceString("TypeInitialization_Default"); } - } - - internal static string TypeInitialization_Type - { - get { return Environment.GetResourceString("TypeInitialization_Type"); } - } - - internal static string Arg_UnauthorizedAccessException - { - get { return Environment.GetResourceString("Arg_UnauthorizedAccessException"); } - } -} diff --git a/src/mscorlib/corefx/System/Buffers/ArrayPool.cs b/src/mscorlib/corefx/System/Buffers/ArrayPool.cs deleted file mode 100644 index 77a07f7fa5..0000000000 --- a/src/mscorlib/corefx/System/Buffers/ArrayPool.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -namespace System.Buffers -{ - /// <summary> - /// Provides a resource pool that enables reusing instances of type <see cref="T:T[]"/>. - /// </summary> - /// <remarks> - /// <para> - /// Renting and returning buffers with an <see cref="ArrayPool{T}"/> can increase performance - /// in situations where arrays are created and destroyed frequently, resulting in significant - /// memory pressure on the garbage collector. - /// </para> - /// <para> - /// This class is thread-safe. All members may be used by multiple threads concurrently. - /// </para> - /// </remarks> - public abstract class ArrayPool<T> - { - /// <summary> - /// Retrieves a shared <see cref="ArrayPool{T}"/> instance. - /// </summary> - /// <remarks> - /// The shared pool provides a default implementation of <see cref="ArrayPool{T}"/> - /// that's intended for general applicability. It maintains arrays of multiple sizes, and - /// may hand back a larger array than was actually requested, but will never hand back a smaller - /// array than was requested. Renting a buffer from it with <see cref="Rent"/> will result in an - /// existing buffer being taken from the pool if an appropriate buffer is available or in a new - /// buffer being allocated if one is not available. - /// byte[] and char[] are the most commonly pooled array types. For these we use a special pool type - /// optimized for very fast access speeds, at the expense of more memory consumption. - /// The shared pool instance is created lazily on first access. - /// </remarks> - public static ArrayPool<T> Shared { get; } = - typeof(T) == typeof(byte) || typeof(T) == typeof(char) ? new TlsOverPerCoreLockedStacksArrayPool<T>() : - Create(); - - /// <summary> - /// Creates a new <see cref="ArrayPool{T}"/> instance using default configuration options. - /// </summary> - /// <returns>A new <see cref="ArrayPool{T}"/> instance.</returns> - public static ArrayPool<T> Create() => new ConfigurableArrayPool<T>(); - - /// <summary> - /// Creates a new <see cref="ArrayPool{T}"/> instance using custom configuration options. - /// </summary> - /// <param name="maxArrayLength">The maximum length of array instances that may be stored in the pool.</param> - /// <param name="maxArraysPerBucket"> - /// The maximum number of array instances that may be stored in each bucket in the pool. The pool - /// groups arrays of similar lengths into buckets for faster access. - /// </param> - /// <returns>A new <see cref="ArrayPool{T}"/> instance with the specified configuration options.</returns> - /// <remarks> - /// The created pool will group arrays into buckets, with no more than <paramref name="maxArraysPerBucket"/> - /// in each bucket and with those arrays not exceeding <paramref name="maxArrayLength"/> in length. - /// </remarks> - public static ArrayPool<T> Create(int maxArrayLength, int maxArraysPerBucket) => - new ConfigurableArrayPool<T>(maxArrayLength, maxArraysPerBucket); - - /// <summary> - /// Retrieves a buffer that is at least the requested length. - /// </summary> - /// <param name="minimumLength">The minimum length of the array needed.</param> - /// <returns> - /// An <see cref="T:T[]"/> that is at least <paramref name="minimumLength"/> in length. - /// </returns> - /// <remarks> - /// This buffer is loaned to the caller and should be returned to the same pool via - /// <see cref="Return"/> so that it may be reused in subsequent usage of <see cref="Rent"/>. - /// It is not a fatal error to not return a rented buffer, but failure to do so may lead to - /// decreased application performance, as the pool may need to create a new buffer to replace - /// the one lost. - /// </remarks> - public abstract T[] Rent(int minimumLength); - - /// <summary> - /// Returns to the pool an array that was previously obtained via <see cref="Rent"/> on the same - /// <see cref="ArrayPool{T}"/> instance. - /// </summary> - /// <param name="array"> - /// The buffer previously obtained from <see cref="Rent"/> to return to the pool. - /// </param> - /// <param name="clearArray"> - /// If <c>true</c> and if the pool will store the buffer to enable subsequent reuse, <see cref="Return"/> - /// will clear <paramref name="array"/> of its contents so that a subsequent consumer via <see cref="Rent"/> - /// will not see the previous consumer's content. If <c>false</c> or if the pool will release the buffer, - /// the array's contents are left unchanged. - /// </param> - /// <remarks> - /// Once a buffer has been returned to the pool, the caller gives up all ownership of the buffer - /// and must not use it. The reference returned from a given call to <see cref="Rent"/> must only be - /// returned via <see cref="Return"/> once. The default <see cref="ArrayPool{T}"/> - /// may hold onto the returned buffer in order to rent it again, or it may release the returned buffer - /// if it's determined that the pool already has enough buffers stored. - /// </remarks> - public abstract void Return(T[] array, bool clearArray = false); - } -} diff --git a/src/mscorlib/corefx/System/Buffers/ArrayPoolEventSource.cs b/src/mscorlib/corefx/System/Buffers/ArrayPoolEventSource.cs deleted file mode 100644 index 9482744144..0000000000 --- a/src/mscorlib/corefx/System/Buffers/ArrayPoolEventSource.cs +++ /dev/null @@ -1,78 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Diagnostics.Tracing; - -namespace System.Buffers -{ - [EventSource(Name = "System.Buffers.ArrayPoolEventSource")] - internal sealed class ArrayPoolEventSource : EventSource - { - internal readonly static ArrayPoolEventSource Log = new ArrayPoolEventSource(); - - /// <summary>The reason for a BufferAllocated event.</summary> - internal enum BufferAllocatedReason : int - { - /// <summary>The pool is allocating a buffer to be pooled in a bucket.</summary> - Pooled, - /// <summary>The requested buffer size was too large to be pooled.</summary> - OverMaximumSize, - /// <summary>The pool has already allocated for pooling as many buffers of a particular size as it's allowed.</summary> - PoolExhausted - } - - /// <summary> - /// Event for when a buffer is rented. This is invoked once for every successful call to Rent, - /// regardless of whether a buffer is allocated or a buffer is taken from the pool. In a - /// perfect situation where all rented buffers are returned, we expect to see the number - /// of BufferRented events exactly match the number of BuferReturned events, with the number - /// of BufferAllocated events being less than or equal to those numbers (ideally significantly - /// less than). - /// </summary> - [Event(1, Level = EventLevel.Verbose)] - internal unsafe void BufferRented(int bufferId, int bufferSize, int poolId, int bucketId) - { - EventData* payload = stackalloc EventData[4]; - payload[0].Size = sizeof(int); - payload[0].DataPointer = ((IntPtr)(&bufferId)); - payload[1].Size = sizeof(int); - payload[1].DataPointer = ((IntPtr)(&bufferSize)); - payload[2].Size = sizeof(int); - payload[2].DataPointer = ((IntPtr)(&poolId)); - payload[3].Size = sizeof(int); - payload[3].DataPointer = ((IntPtr)(&bucketId)); - WriteEventCore(1, 4, payload); - } - - /// <summary> - /// Event for when a buffer is allocated by the pool. In an ideal situation, the number - /// of BufferAllocated events is significantly smaller than the number of BufferRented and - /// BufferReturned events. - /// </summary> - [Event(2, Level = EventLevel.Informational)] - internal unsafe void BufferAllocated(int bufferId, int bufferSize, int poolId, int bucketId, BufferAllocatedReason reason) - { - EventData* payload = stackalloc EventData[5]; - payload[0].Size = sizeof(int); - payload[0].DataPointer = ((IntPtr)(&bufferId)); - payload[1].Size = sizeof(int); - payload[1].DataPointer = ((IntPtr)(&bufferSize)); - payload[2].Size = sizeof(int); - payload[2].DataPointer = ((IntPtr)(&poolId)); - payload[3].Size = sizeof(int); - payload[3].DataPointer = ((IntPtr)(&bucketId)); - payload[4].Size = sizeof(BufferAllocatedReason); - payload[4].DataPointer = ((IntPtr)(&reason)); - WriteEventCore(2, 5, payload); - } - - /// <summary> - /// Event raised when a buffer is returned to the pool. This event is raised regardless of whether - /// the returned buffer is stored or dropped. In an ideal situation, the number of BufferReturned - /// events exactly matches the number of BufferRented events. - /// </summary> - [Event(3, Level = EventLevel.Verbose)] - internal void BufferReturned(int bufferId, int bufferSize, int poolId) => WriteEvent(3, bufferId, bufferSize, poolId); - } -} diff --git a/src/mscorlib/corefx/System/Buffers/ConfigurableArrayPool.cs b/src/mscorlib/corefx/System/Buffers/ConfigurableArrayPool.cs deleted file mode 100644 index f7b6034d20..0000000000 --- a/src/mscorlib/corefx/System/Buffers/ConfigurableArrayPool.cs +++ /dev/null @@ -1,265 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Diagnostics; -using System.Threading; - -namespace System.Buffers -{ - internal sealed partial class ConfigurableArrayPool<T> : ArrayPool<T> - { - /// <summary>The default maximum length of each array in the pool (2^20).</summary> - private const int DefaultMaxArrayLength = 1024 * 1024; - /// <summary>The default maximum number of arrays per bucket that are available for rent.</summary> - private const int DefaultMaxNumberOfArraysPerBucket = 50; - - private readonly Bucket[] _buckets; - - internal ConfigurableArrayPool() : this(DefaultMaxArrayLength, DefaultMaxNumberOfArraysPerBucket) - { - } - - internal ConfigurableArrayPool(int maxArrayLength, int maxArraysPerBucket) - { - if (maxArrayLength <= 0) - { - throw new ArgumentOutOfRangeException(nameof(maxArrayLength)); - } - if (maxArraysPerBucket <= 0) - { - throw new ArgumentOutOfRangeException(nameof(maxArraysPerBucket)); - } - - // Our bucketing algorithm has a min length of 2^4 and a max length of 2^30. - // Constrain the actual max used to those values. - const int MinimumArrayLength = 0x10, MaximumArrayLength = 0x40000000; - if (maxArrayLength > MaximumArrayLength) - { - maxArrayLength = MaximumArrayLength; - } - else if (maxArrayLength < MinimumArrayLength) - { - maxArrayLength = MinimumArrayLength; - } - - // Create the buckets. - int poolId = Id; - int maxBuckets = Utilities.SelectBucketIndex(maxArrayLength); - var buckets = new Bucket[maxBuckets + 1]; - for (int i = 0; i < buckets.Length; i++) - { - buckets[i] = new Bucket(Utilities.GetMaxSizeForBucket(i), maxArraysPerBucket, poolId); - } - _buckets = buckets; - } - - /// <summary>Gets an ID for the pool to use with events.</summary> - private int Id => GetHashCode(); - - public override T[] Rent(int minimumLength) - { - // Arrays can't be smaller than zero. We allow requesting zero-length arrays (even though - // pooling such an array isn't valuable) as it's a valid length array, and we want the pool - // to be usable in general instead of using `new`, even for computed lengths. - if (minimumLength < 0) - { - throw new ArgumentOutOfRangeException(nameof(minimumLength)); - } - else if (minimumLength == 0) - { - // No need for events with the empty array. Our pool is effectively infinite - // and we'll never allocate for rents and never store for returns. - return Array.Empty<T>(); - } - - var log = ArrayPoolEventSource.Log; - T[] buffer = null; - - int index = Utilities.SelectBucketIndex(minimumLength); - if (index < _buckets.Length) - { - // Search for an array starting at the 'index' bucket. If the bucket is empty, bump up to the - // next higher bucket and try that one, but only try at most a few buckets. - const int MaxBucketsToTry = 2; - int i = index; - do - { - // Attempt to rent from the bucket. If we get a buffer from it, return it. - buffer = _buckets[i].Rent(); - if (buffer != null) - { - if (log.IsEnabled()) - { - log.BufferRented(buffer.GetHashCode(), buffer.Length, Id, _buckets[i].Id); - } - return buffer; - } - } - while (++i < _buckets.Length && i != index + MaxBucketsToTry); - - // The pool was exhausted for this buffer size. Allocate a new buffer with a size corresponding - // to the appropriate bucket. - buffer = new T[_buckets[index]._bufferLength]; - } - else - { - // The request was for a size too large for the pool. Allocate an array of exactly the requested length. - // When it's returned to the pool, we'll simply throw it away. - buffer = new T[minimumLength]; - } - - if (log.IsEnabled()) - { - int bufferId = buffer.GetHashCode(), bucketId = -1; // no bucket for an on-demand allocated buffer - log.BufferRented(bufferId, buffer.Length, Id, bucketId); - log.BufferAllocated(bufferId, buffer.Length, Id, bucketId, index >= _buckets.Length ? - ArrayPoolEventSource.BufferAllocatedReason.OverMaximumSize : ArrayPoolEventSource.BufferAllocatedReason.PoolExhausted); - } - - return buffer; - } - - public override void Return(T[] array, bool clearArray = false) - { - if (array == null) - { - throw new ArgumentNullException(nameof(array)); - } - else if (array.Length == 0) - { - // Ignore empty arrays. When a zero-length array is rented, we return a singleton - // rather than actually taking a buffer out of the lowest bucket. - return; - } - - // Determine with what bucket this array length is associated - int bucket = Utilities.SelectBucketIndex(array.Length); - - // If we can tell that the buffer was allocated, drop it. Otherwise, check if we have space in the pool - if (bucket < _buckets.Length) - { - // Clear the array if the user requests - if (clearArray) - { - Array.Clear(array, 0, array.Length); - } - - // Return the buffer to its bucket. In the future, we might consider having Return return false - // instead of dropping a bucket, in which case we could try to return to a lower-sized bucket, - // just as how in Rent we allow renting from a higher-sized bucket. - _buckets[bucket].Return(array); - } - - // Log that the buffer was returned - var log = ArrayPoolEventSource.Log; - if (log.IsEnabled()) - { - log.BufferReturned(array.GetHashCode(), array.Length, Id); - } - } - - /// <summary>Provides a thread-safe bucket containing buffers that can be Rent'd and Return'd.</summary> - private sealed class Bucket - { - internal readonly int _bufferLength; - private readonly T[][] _buffers; - private readonly int _poolId; - - private SpinLock _lock; // do not make this readonly; it's a mutable struct - private int _index; - - /// <summary> - /// Creates the pool with numberOfBuffers arrays where each buffer is of bufferLength length. - /// </summary> - internal Bucket(int bufferLength, int numberOfBuffers, int poolId) - { - _lock = new SpinLock(Debugger.IsAttached); // only enable thread tracking if debugger is attached; it adds non-trivial overheads to Enter/Exit - _buffers = new T[numberOfBuffers][]; - _bufferLength = bufferLength; - _poolId = poolId; - } - - /// <summary>Gets an ID for the bucket to use with events.</summary> - internal int Id => GetHashCode(); - - /// <summary>Takes an array from the bucket. If the bucket is empty, returns null.</summary> - internal T[] Rent() - { - T[][] buffers = _buffers; - T[] buffer = null; - - // While holding the lock, grab whatever is at the next available index and - // update the index. We do as little work as possible while holding the spin - // lock to minimize contention with other threads. The try/finally is - // necessary to properly handle thread aborts on platforms which have them. - bool lockTaken = false, allocateBuffer = false; - try - { - _lock.Enter(ref lockTaken); - - if (_index < buffers.Length) - { - buffer = buffers[_index]; - buffers[_index++] = null; - allocateBuffer = buffer == null; - } - } - finally - { - if (lockTaken) _lock.Exit(false); - } - - // While we were holding the lock, we grabbed whatever was at the next available index, if - // there was one. If we tried and if we got back null, that means we hadn't yet allocated - // for that slot, in which case we should do so now. - if (allocateBuffer) - { - buffer = new T[_bufferLength]; - - var log = ArrayPoolEventSource.Log; - if (log.IsEnabled()) - { - log.BufferAllocated(buffer.GetHashCode(), _bufferLength, _poolId, Id, - ArrayPoolEventSource.BufferAllocatedReason.Pooled); - } - } - - return buffer; - } - - /// <summary> - /// Attempts to return the buffer to the bucket. If successful, the buffer will be stored - /// in the bucket and true will be returned; otherwise, the buffer won't be stored, and false - /// will be returned. - /// </summary> - internal void Return(T[] array) - { - // Check to see if the buffer is the correct size for this bucket - if (array.Length != _bufferLength) - { - throw new ArgumentException(SR.ArgumentException_BufferNotFromPool, nameof(array)); - } - - // While holding the spin lock, if there's room available in the bucket, - // put the buffer into the next available slot. Otherwise, we just drop it. - // The try/finally is necessary to properly handle thread aborts on platforms - // which have them. - bool lockTaken = false; - try - { - _lock.Enter(ref lockTaken); - - if (_index != 0) - { - _buffers[--_index] = array; - } - } - finally - { - if (lockTaken) _lock.Exit(false); - } - } - } - } -} diff --git a/src/mscorlib/corefx/System/Buffers/TlsOverPerCoreLockedStacksArrayPool.cs b/src/mscorlib/corefx/System/Buffers/TlsOverPerCoreLockedStacksArrayPool.cs deleted file mode 100644 index 64c5cebe85..0000000000 --- a/src/mscorlib/corefx/System/Buffers/TlsOverPerCoreLockedStacksArrayPool.cs +++ /dev/null @@ -1,292 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using Microsoft.Win32; -using System.Runtime.CompilerServices; -using System.Threading; - -namespace System.Buffers -{ - /// <summary> - /// Provides an ArrayPool implementation meant to be used as the singleton returned from ArrayPool.Shared. - /// </summary> - /// <remarks> - /// The implementation uses a tiered caching scheme, with a small per-thread cache for each array size, followed - /// by a cache per array size shared by all threads, split into per-core stacks meant to be used by threads - /// running on that core. Locks are used to protect each per-core stack, because a thread can migrate after - /// checking its processor number, because multiple threads could interleave on the same core, and because - /// a thread is allowed to check other core's buckets if its core's bucket is empty/full. - /// </remarks> - internal sealed partial class TlsOverPerCoreLockedStacksArrayPool<T> : ArrayPool<T> - { - // TODO: #7747: "Investigate optimizing ArrayPool heuristics" - // - Explore caching in TLS more than one array per size per thread, and moving stale buffers to the global queue. - // - Explore dumping stale buffers from the global queue, similar to PinnableBufferCache (maybe merging them). - // - Explore changing the size of each per-core bucket, potentially dynamically or based on other factors like array size. - // - Explore changing number of buckets and what sizes of arrays are cached. - // - Investigate whether false sharing is causing any issues, in particular on LockedStack's count and the contents of its array. - // ... - - /// <summary>The number of buckets (array sizes) in the pool, one for each array length, starting from length 16.</summary> - private const int NumBuckets = 17; // Utilities.SelectBucketIndex(2*1024*1024) - /// <summary>Maximum number of per-core stacks to use per array size.</summary> - private const int MaxPerCorePerArraySizeStacks = 64; // selected to avoid needing to worry about processor groups - /// <summary>The maximum number of buffers to store in a bucket's global queue.</summary> - private const int MaxBuffersPerArraySizePerCore = 8; - - /// <summary>The length of arrays stored in the corresponding indices in <see cref="_buckets"/> and <see cref="t_tlsBuckets"/>.</summary> - private readonly int[] _bucketArraySizes; - /// <summary> - /// An array of per-core array stacks. The slots are lazily initialized to avoid creating - /// lots of overhead for unused array sizes. - /// </summary> - private readonly PerCoreLockedStacks[] _buckets = new PerCoreLockedStacks[NumBuckets]; - /// <summary>A per-thread array of arrays, to cache one array per array size per thread.</summary> - [ThreadStatic] - private static T[][] t_tlsBuckets; - - /// <summary>Initialize the pool.</summary> - public TlsOverPerCoreLockedStacksArrayPool() - { - var sizes = new int[NumBuckets]; - for (int i = 0; i < sizes.Length; i++) - { - sizes[i] = Utilities.GetMaxSizeForBucket(i); - } - _bucketArraySizes = sizes; - } - - /// <summary>Allocate a new PerCoreLockedStacks and try to store it into the <see cref="_buckets"/> array.</summary> - private PerCoreLockedStacks CreatePerCoreLockedStacks(int bucketIndex) - { - var inst = new PerCoreLockedStacks(); - return Interlocked.CompareExchange(ref _buckets[bucketIndex], inst, null) ?? inst; - } - - /// <summary>Gets an ID for the pool to use with events.</summary> - private int Id => GetHashCode(); - - public override T[] Rent(int minimumLength) - { - // Arrays can't be smaller than zero. We allow requesting zero-length arrays (even though - // pooling such an array isn't valuable) as it's a valid length array, and we want the pool - // to be usable in general instead of using `new`, even for computed lengths. - if (minimumLength < 0) - { - throw new ArgumentOutOfRangeException(nameof(minimumLength)); - } - else if (minimumLength == 0) - { - // No need to log the empty array. Our pool is effectively infinite - // and we'll never allocate for rents and never store for returns. - return Array.Empty<T>(); - } - - ArrayPoolEventSource log = ArrayPoolEventSource.Log; - T[] buffer; - - // Get the bucket number for the array length - int bucketIndex = Utilities.SelectBucketIndex(minimumLength); - - // If the array could come from a bucket... - if (bucketIndex < _buckets.Length) - { - // First try to get it from TLS if possible. - T[][] tlsBuckets = t_tlsBuckets; - if (tlsBuckets != null) - { - buffer = tlsBuckets[bucketIndex]; - if (buffer != null) - { - tlsBuckets[bucketIndex] = null; - if (log.IsEnabled()) - { - log.BufferRented(buffer.GetHashCode(), buffer.Length, Id, bucketIndex); - } - return buffer; - } - } - - // We couldn't get a buffer from TLS, so try the global stack. - PerCoreLockedStacks b = _buckets[bucketIndex]; - if (b != null) - { - buffer = b.TryPop(); - if (buffer != null) - { - if (log.IsEnabled()) - { - log.BufferRented(buffer.GetHashCode(), buffer.Length, Id, bucketIndex); - } - return buffer; - } - } - - // No buffer available. Allocate a new buffer with a size corresponding to the appropriate bucket. - buffer = new T[_bucketArraySizes[bucketIndex]]; - } - else - { - // The request was for a size too large for the pool. Allocate an array of exactly the requested length. - // When it's returned to the pool, we'll simply throw it away. - buffer = new T[minimumLength]; - } - - if (log.IsEnabled()) - { - int bufferId = buffer.GetHashCode(), bucketId = -1; // no bucket for an on-demand allocated buffer - log.BufferRented(bufferId, buffer.Length, Id, bucketId); - log.BufferAllocated(bufferId, buffer.Length, Id, bucketId, bucketIndex >= _buckets.Length ? - ArrayPoolEventSource.BufferAllocatedReason.OverMaximumSize : - ArrayPoolEventSource.BufferAllocatedReason.PoolExhausted); - } - - return buffer; - } - - public override void Return(T[] array, bool clearArray = false) - { - if (array == null) - { - throw new ArgumentNullException(nameof(array)); - } - - // Determine with what bucket this array length is associated - int bucketIndex = Utilities.SelectBucketIndex(array.Length); - - // If we can tell that the buffer was allocated (or empty), drop it. Otherwise, check if we have space in the pool. - if (bucketIndex < _buckets.Length) - { - // Clear the array if the user requests. - if (clearArray) - { - Array.Clear(array, 0, array.Length); - } - - // Check to see if the buffer is the correct size for this bucket - if (array.Length != _bucketArraySizes[bucketIndex]) - { - throw new ArgumentException(SR.ArgumentException_BufferNotFromPool, nameof(array)); - } - - // Write through the TLS bucket. If there weren't any buckets, create them - // and store this array into it. If there were, store this into it, and - // if there was a previous one there, push that to the global stack. This - // helps to keep LIFO access such that the most recently pushed stack will - // be in TLS and the first to be popped next. - T[][] tlsBuckets = t_tlsBuckets; - if (tlsBuckets == null) - { - t_tlsBuckets = tlsBuckets = new T[NumBuckets][]; - tlsBuckets[bucketIndex] = array; - } - else - { - T[] prev = tlsBuckets[bucketIndex]; - tlsBuckets[bucketIndex] = array; - if (prev != null) - { - PerCoreLockedStacks bucket = _buckets[bucketIndex] ?? CreatePerCoreLockedStacks(bucketIndex); - bucket.TryPush(prev); - } - } - } - - // Log that the buffer was returned - ArrayPoolEventSource log = ArrayPoolEventSource.Log; - if (log.IsEnabled()) - { - log.BufferReturned(array.GetHashCode(), array.Length, Id); - } - } - - /// <summary> - /// Stores a set of stacks of arrays, with one stack per core. - /// </summary> - private sealed class PerCoreLockedStacks - { - /// <summary>The stacks.</summary> - private readonly LockedStack[] _perCoreStacks; - - /// <summary>Initializes the stacks.</summary> - public PerCoreLockedStacks() - { - // Create the stacks. We create as many as there are processors, limited by our max. - var stacks = new LockedStack[Math.Min(Environment.ProcessorCount, MaxPerCorePerArraySizeStacks)]; - for (int i = 0; i < stacks.Length; i++) - { - stacks[i] = new LockedStack(); - } - _perCoreStacks = stacks; - } - - /// <summary>Try to push the array into the stacks. If each is full when it's tested, the array will be dropped.</summary> - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void TryPush(T[] array) - { - // Try to push on to the associated stack first. If that fails, - // round-robin through the other stacks. - LockedStack[] stacks = _perCoreStacks; - int index = Environment.CurrentExecutionId % stacks.Length; - for (int i = 0; i < stacks.Length; i++) - { - if (stacks[index].TryPush(array)) return; - if (++index == stacks.Length) index = 0; - } - } - - /// <summary>Try to get an array from the stacks. If each is empty when it's tested, null will be returned.</summary> - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public T[] TryPop() - { - // Try to pop from the associated stack first. If that fails, - // round-robin through the other stacks. - T[] arr; - LockedStack[] stacks = _perCoreStacks; - int index = Environment.CurrentExecutionId % stacks.Length; - for (int i = 0; i < stacks.Length; i++) - { - if ((arr = stacks[index].TryPop()) != null) return arr; - if (++index == stacks.Length) index = 0; - } - return null; - } - } - - /// <summary>Provides a simple stack of arrays, protected by a lock.</summary> - private sealed class LockedStack - { - private readonly T[][] _arrays = new T[MaxBuffersPerArraySizePerCore][]; - private int _count; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool TryPush(T[] array) - { - bool enqueued = false; - Monitor.Enter(this); - if (_count < MaxBuffersPerArraySizePerCore) - { - _arrays[_count++] = array; - enqueued = true; - } - Monitor.Exit(this); - return enqueued; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public T[] TryPop() - { - T[] arr = null; - Monitor.Enter(this); - if (_count > 0) - { - arr = _arrays[--_count]; - _arrays[_count] = null; - } - Monitor.Exit(this); - return arr; - } - } - } -} diff --git a/src/mscorlib/corefx/System/Buffers/Utilities.cs b/src/mscorlib/corefx/System/Buffers/Utilities.cs deleted file mode 100644 index 823299f5fc..0000000000 --- a/src/mscorlib/corefx/System/Buffers/Utilities.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Diagnostics; -using System.Runtime.CompilerServices; - -namespace System.Buffers -{ - internal static class Utilities - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static int SelectBucketIndex(int bufferSize) - { - uint bitsRemaining = ((uint)bufferSize - 1) >> 4; - - int poolIndex = 0; - if (bitsRemaining > 0xFFFF) { bitsRemaining >>= 16; poolIndex = 16; } - if (bitsRemaining > 0xFF) { bitsRemaining >>= 8; poolIndex += 8; } - if (bitsRemaining > 0xF) { bitsRemaining >>= 4; poolIndex += 4; } - if (bitsRemaining > 0x3) { bitsRemaining >>= 2; poolIndex += 2; } - if (bitsRemaining > 0x1) { bitsRemaining >>= 1; poolIndex += 1; } - - return poolIndex + (int)bitsRemaining; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static int GetMaxSizeForBucket(int binIndex) - { - int maxSize = 16 << binIndex; - Debug.Assert(maxSize >= 0); - return maxSize; - } - } -} diff --git a/src/mscorlib/corefx/System/Globalization/Calendar.cs b/src/mscorlib/corefx/System/Globalization/Calendar.cs deleted file mode 100644 index 0ff5040c74..0000000000 --- a/src/mscorlib/corefx/System/Globalization/Calendar.cs +++ /dev/null @@ -1,859 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Diagnostics; -using System.Diagnostics.Contracts; -using System.Runtime.Serialization; - -namespace System.Globalization -{ - // This abstract class represents a calendar. A calendar reckons time in - // divisions such as weeks, months and years. The number, length and start of - // the divisions vary in each calendar. - // - // Any instant in time can be represented as an n-tuple of numeric values using - // a particular calendar. For example, the next vernal equinox occurs at (0.0, 0 - // , 46, 8, 20, 3, 1999) in the Gregorian calendar. An implementation of - // Calendar can map any DateTime value to such an n-tuple and vice versa. The - // DateTimeFormat class can map between such n-tuples and a textual - // representation such as "8:46 AM March 20th 1999 AD". - // - // Most calendars identify a year which begins the current era. There may be any - // number of previous eras. The Calendar class identifies the eras as enumerated - // integers where the current era (CurrentEra) has the value zero. - // - // For consistency, the first unit in each interval, e.g. the first month, is - // assigned the value one. - // The calculation of hour/minute/second is moved to Calendar from GregorianCalendar, - // since most of the calendars (or all?) have the same way of calcuating hour/minute/second. - - [Serializable] - public abstract partial class Calendar : ICloneable - { - // Number of 100ns (10E-7 second) ticks per time unit - internal const long TicksPerMillisecond = 10000; - internal const long TicksPerSecond = TicksPerMillisecond * 1000; - internal const long TicksPerMinute = TicksPerSecond * 60; - internal const long TicksPerHour = TicksPerMinute * 60; - internal const long TicksPerDay = TicksPerHour * 24; - - // Number of milliseconds per time unit - internal const int MillisPerSecond = 1000; - internal const int MillisPerMinute = MillisPerSecond * 60; - internal const int MillisPerHour = MillisPerMinute * 60; - internal const int MillisPerDay = MillisPerHour * 24; - - // Number of days in a non-leap year - internal const int DaysPerYear = 365; - // Number of days in 4 years - internal const int DaysPer4Years = DaysPerYear * 4 + 1; - // Number of days in 100 years - internal const int DaysPer100Years = DaysPer4Years * 25 - 1; - // Number of days in 400 years - internal const int DaysPer400Years = DaysPer100Years * 4 + 1; - - // Number of days from 1/1/0001 to 1/1/10000 - internal const int DaysTo10000 = DaysPer400Years * 25 - 366; - - internal const long MaxMillis = (long)DaysTo10000 * MillisPerDay; - - - private int _currentEraValue = -1; - - [OptionalField(VersionAdded = 2)] - private bool _isReadOnly = false; - -#if INSIDE_CLR - internal const CalendarId CAL_HEBREW = CalendarId.HEBREW; - internal const CalendarId CAL_HIJRI = CalendarId.HIJRI; - internal const CalendarId CAL_JAPAN = CalendarId.JAPAN; - internal const CalendarId CAL_JULIAN = CalendarId.JULIAN; - internal const CalendarId CAL_TAIWAN = CalendarId.TAIWAN; - internal const CalendarId CAL_UMALQURA = CalendarId.UMALQURA; - internal const CalendarId CAL_PERSIAN = CalendarId.PERSIAN; -#endif - - // The minimum supported DateTime range for the calendar. - - public virtual DateTime MinSupportedDateTime - { - get - { - return (DateTime.MinValue); - } - } - - // The maximum supported DateTime range for the calendar. - - public virtual DateTime MaxSupportedDateTime - { - get - { - return (DateTime.MaxValue); - } - } - - public virtual CalendarAlgorithmType AlgorithmType - { - get - { - return CalendarAlgorithmType.Unknown; - } - } - - protected Calendar() - { - //Do-nothing constructor. - } - - /// - // This can not be abstract, otherwise no one can create a subclass of Calendar. - // - internal virtual CalendarId ID - { - get - { - return CalendarId.UNINITIALIZED_VALUE; - } - } - - /// - // Return the Base calendar ID for calendars that didn't have defined data in calendarData - // - - internal virtual CalendarId BaseCalendarID - { - get { return ID; } - } - - //////////////////////////////////////////////////////////////////////// - // - // IsReadOnly - // - // Detect if the object is readonly. - // - //////////////////////////////////////////////////////////////////////// - public bool IsReadOnly - { - get { return (_isReadOnly); } - } - - //////////////////////////////////////////////////////////////////////// - // - // Clone - // - // Is the implementation of ICloneable. - // - //////////////////////////////////////////////////////////////////////// - public virtual object Clone() - { - object o = MemberwiseClone(); - ((Calendar)o).SetReadOnlyState(false); - return (o); - } - - //////////////////////////////////////////////////////////////////////// - // - // ReadOnly - // - // Create a cloned readonly instance or return the input one if it is - // readonly. - // - //////////////////////////////////////////////////////////////////////// - public static Calendar ReadOnly(Calendar calendar) - { - if (calendar == null) { throw new ArgumentNullException(nameof(calendar)); } - Contract.EndContractBlock(); - if (calendar.IsReadOnly) { return (calendar); } - - Calendar clonedCalendar = (Calendar)(calendar.MemberwiseClone()); - clonedCalendar.SetReadOnlyState(true); - - return (clonedCalendar); - } - - internal void VerifyWritable() - { - if (_isReadOnly) - { - throw new InvalidOperationException(SR.InvalidOperation_ReadOnly); - } - } - - internal void SetReadOnlyState(bool readOnly) - { - _isReadOnly = readOnly; - } - - - /*=================================CurrentEraValue========================== - **Action: This is used to convert CurretEra(0) to an appropriate era value. - **Returns: - **Arguments: - **Exceptions: - **Notes: - ** The value is from calendar.nlp. - ============================================================================*/ - - internal virtual int CurrentEraValue - { - get - { - // The following code assumes that the current era value can not be -1. - if (_currentEraValue == -1) - { - Debug.Assert(BaseCalendarID != CalendarId.UNINITIALIZED_VALUE, "[Calendar.CurrentEraValue] Expected a real calendar ID"); - _currentEraValue = CalendarData.GetCalendarData(BaseCalendarID).iCurrentEra; - } - return (_currentEraValue); - } - } - - // The current era for a calendar. - - public const int CurrentEra = 0; - - internal int twoDigitYearMax = -1; - - internal static void CheckAddResult(long ticks, DateTime minValue, DateTime maxValue) - { - if (ticks < minValue.Ticks || ticks > maxValue.Ticks) - { - throw new ArgumentException( - String.Format(CultureInfo.InvariantCulture, SR.Format(SR.Argument_ResultCalendarRange, - minValue, maxValue))); - } - Contract.EndContractBlock(); - } - - internal DateTime Add(DateTime time, double value, int scale) - { - // From ECMA CLI spec, Partition III, section 3.27: - // - // If overflow occurs converting a floating-point type to an integer, or if the floating-point value - // being converted to an integer is a NaN, the value returned is unspecified. - // - // Based upon this, this method should be performing the comparison against the double - // before attempting a cast. Otherwise, the result is undefined. - double tempMillis = (value * scale + (value >= 0 ? 0.5 : -0.5)); - if (!((tempMillis > -(double)MaxMillis) && (tempMillis < (double)MaxMillis))) - { - throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_AddValue); - } - - long millis = (long)tempMillis; - long ticks = time.Ticks + millis * TicksPerMillisecond; - CheckAddResult(ticks, MinSupportedDateTime, MaxSupportedDateTime); - return (new DateTime(ticks)); - } - - // Returns the DateTime resulting from adding the given number of - // milliseconds to the specified DateTime. The result is computed by rounding - // the number of milliseconds given by value to the nearest integer, - // and adding that interval to the specified DateTime. The value - // argument is permitted to be negative. - // - - public virtual DateTime AddMilliseconds(DateTime time, double milliseconds) - { - return (Add(time, milliseconds, 1)); - } - - - // Returns the DateTime resulting from adding a fractional number of - // days to the specified DateTime. The result is computed by rounding the - // fractional number of days given by value to the nearest - // millisecond, and adding that interval to the specified DateTime. The - // value argument is permitted to be negative. - // - - public virtual DateTime AddDays(DateTime time, int days) - { - return (Add(time, days, MillisPerDay)); - } - - // Returns the DateTime resulting from adding a fractional number of - // hours to the specified DateTime. The result is computed by rounding the - // fractional number of hours given by value to the nearest - // millisecond, and adding that interval to the specified DateTime. The - // value argument is permitted to be negative. - // - - public virtual DateTime AddHours(DateTime time, int hours) - { - return (Add(time, hours, MillisPerHour)); - } - - - // Returns the DateTime resulting from adding a fractional number of - // minutes to the specified DateTime. The result is computed by rounding the - // fractional number of minutes given by value to the nearest - // millisecond, and adding that interval to the specified DateTime. The - // value argument is permitted to be negative. - // - - public virtual DateTime AddMinutes(DateTime time, int minutes) - { - return (Add(time, minutes, MillisPerMinute)); - } - - - // Returns the DateTime resulting from adding the given number of - // months to the specified DateTime. The result is computed by incrementing - // (or decrementing) the year and month parts of the specified DateTime by - // value months, and, if required, adjusting the day part of the - // resulting date downwards to the last day of the resulting month in the - // resulting year. The time-of-day part of the result is the same as the - // time-of-day part of the specified DateTime. - // - // In more precise terms, considering the specified DateTime to be of the - // form y / m / d + t, where y is the - // year, m is the month, d is the day, and t is the - // time-of-day, the result is y1 / m1 / d1 + t, - // where y1 and m1 are computed by adding value months - // to y and m, and d1 is the largest value less than - // or equal to d that denotes a valid day in month m1 of year - // y1. - // - - public abstract DateTime AddMonths(DateTime time, int months); - - // Returns the DateTime resulting from adding a number of - // seconds to the specified DateTime. The result is computed by rounding the - // fractional number of seconds given by value to the nearest - // millisecond, and adding that interval to the specified DateTime. The - // value argument is permitted to be negative. - // - - public virtual DateTime AddSeconds(DateTime time, int seconds) - { - return Add(time, seconds, MillisPerSecond); - } - - // Returns the DateTime resulting from adding a number of - // weeks to the specified DateTime. The - // value argument is permitted to be negative. - // - - public virtual DateTime AddWeeks(DateTime time, int weeks) - { - return (AddDays(time, weeks * 7)); - } - - - // Returns the DateTime resulting from adding the given number of - // years to the specified DateTime. The result is computed by incrementing - // (or decrementing) the year part of the specified DateTime by value - // years. If the month and day of the specified DateTime is 2/29, and if the - // resulting year is not a leap year, the month and day of the resulting - // DateTime becomes 2/28. Otherwise, the month, day, and time-of-day - // parts of the result are the same as those of the specified DateTime. - // - - public abstract DateTime AddYears(DateTime time, int years); - - // Returns the day-of-month part of the specified DateTime. The returned - // value is an integer between 1 and 31. - // - - public abstract int GetDayOfMonth(DateTime time); - - // Returns the day-of-week part of the specified DateTime. The returned value - // is an integer between 0 and 6, where 0 indicates Sunday, 1 indicates - // Monday, 2 indicates Tuesday, 3 indicates Wednesday, 4 indicates - // Thursday, 5 indicates Friday, and 6 indicates Saturday. - // - - public abstract DayOfWeek GetDayOfWeek(DateTime time); - - // Returns the day-of-year part of the specified DateTime. The returned value - // is an integer between 1 and 366. - // - - public abstract int GetDayOfYear(DateTime time); - - // Returns the number of days in the month given by the year and - // month arguments. - // - - public virtual int GetDaysInMonth(int year, int month) - { - return (GetDaysInMonth(year, month, CurrentEra)); - } - - // Returns the number of days in the month given by the year and - // month arguments for the specified era. - // - - public abstract int GetDaysInMonth(int year, int month, int era); - - // Returns the number of days in the year given by the year argument for the current era. - // - - public virtual int GetDaysInYear(int year) - { - return (GetDaysInYear(year, CurrentEra)); - } - - // Returns the number of days in the year given by the year argument for the current era. - // - - public abstract int GetDaysInYear(int year, int era); - - // Returns the era for the specified DateTime value. - - public abstract int GetEra(DateTime time); - - /*=================================Eras========================== - **Action: Get the list of era values. - **Returns: The int array of the era names supported in this calendar. - ** null if era is not used. - **Arguments: None. - **Exceptions: None. - ============================================================================*/ - - - public abstract int[] Eras - { - get; - } - - - // Returns the hour part of the specified DateTime. The returned value is an - // integer between 0 and 23. - // - - public virtual int GetHour(DateTime time) - { - return ((int)((time.Ticks / TicksPerHour) % 24)); - } - - // Returns the millisecond part of the specified DateTime. The returned value - // is an integer between 0 and 999. - // - - public virtual double GetMilliseconds(DateTime time) - { - return (double)((time.Ticks / TicksPerMillisecond) % 1000); - } - - // Returns the minute part of the specified DateTime. The returned value is - // an integer between 0 and 59. - // - - public virtual int GetMinute(DateTime time) - { - return ((int)((time.Ticks / TicksPerMinute) % 60)); - } - - // Returns the month part of the specified DateTime. The returned value is an - // integer between 1 and 12. - // - - public abstract int GetMonth(DateTime time); - - // Returns the number of months in the specified year in the current era. - - public virtual int GetMonthsInYear(int year) - { - return (GetMonthsInYear(year, CurrentEra)); - } - - // Returns the number of months in the specified year and era. - - public abstract int GetMonthsInYear(int year, int era); - - // Returns the second part of the specified DateTime. The returned value is - // an integer between 0 and 59. - // - - public virtual int GetSecond(DateTime time) - { - return ((int)((time.Ticks / TicksPerSecond) % 60)); - } - - /*=================================GetFirstDayWeekOfYear========================== - **Action: Get the week of year using the FirstDay rule. - **Returns: the week of year. - **Arguments: - ** time - ** firstDayOfWeek the first day of week (0=Sunday, 1=Monday, ... 6=Saturday) - **Notes: - ** The CalendarWeekRule.FirstDay rule: Week 1 begins on the first day of the year. - ** Assume f is the specifed firstDayOfWeek, - ** and n is the day of week for January 1 of the specified year. - ** Assign offset = n - f; - ** Case 1: offset = 0 - ** E.g. - ** f=1 - ** weekday 0 1 2 3 4 5 6 0 1 - ** date 1/1 - ** week# 1 2 - ** then week of year = (GetDayOfYear(time) - 1) / 7 + 1 - ** - ** Case 2: offset < 0 - ** e.g. - ** n=1 f=3 - ** weekday 0 1 2 3 4 5 6 0 - ** date 1/1 - ** week# 1 2 - ** This means that the first week actually starts 5 days before 1/1. - ** So week of year = (GetDayOfYear(time) + (7 + offset) - 1) / 7 + 1 - ** Case 3: offset > 0 - ** e.g. - ** f=0 n=2 - ** weekday 0 1 2 3 4 5 6 0 1 2 - ** date 1/1 - ** week# 1 2 - ** This means that the first week actually starts 2 days before 1/1. - ** So Week of year = (GetDayOfYear(time) + offset - 1) / 7 + 1 - ============================================================================*/ - - internal int GetFirstDayWeekOfYear(DateTime time, int firstDayOfWeek) - { - int dayOfYear = GetDayOfYear(time) - 1; // Make the day of year to be 0-based, so that 1/1 is day 0. - // Calculate the day of week for the first day of the year. - // dayOfWeek - (dayOfYear % 7) is the day of week for the first day of this year. Note that - // this value can be less than 0. It's fine since we are making it positive again in calculating offset. - int dayForJan1 = (int)GetDayOfWeek(time) - (dayOfYear % 7); - int offset = (dayForJan1 - firstDayOfWeek + 14) % 7; - Debug.Assert(offset >= 0, "Calendar.GetFirstDayWeekOfYear(): offset >= 0"); - return ((dayOfYear + offset) / 7 + 1); - } - - private int GetWeekOfYearFullDays(DateTime time, int firstDayOfWeek, int fullDays) - { - int dayForJan1; - int offset; - int day; - - int dayOfYear = GetDayOfYear(time) - 1; // Make the day of year to be 0-based, so that 1/1 is day 0. - // - // Calculate the number of days between the first day of year (1/1) and the first day of the week. - // This value will be a positive value from 0 ~ 6. We call this value as "offset". - // - // If offset is 0, it means that the 1/1 is the start of the first week. - // Assume the first day of the week is Monday, it will look like this: - // Sun Mon Tue Wed Thu Fri Sat - // 12/31 1/1 1/2 1/3 1/4 1/5 1/6 - // +--> First week starts here. - // - // If offset is 1, it means that the first day of the week is 1 day ahead of 1/1. - // Assume the first day of the week is Monday, it will look like this: - // Sun Mon Tue Wed Thu Fri Sat - // 1/1 1/2 1/3 1/4 1/5 1/6 1/7 - // +--> First week starts here. - // - // If offset is 2, it means that the first day of the week is 2 days ahead of 1/1. - // Assume the first day of the week is Monday, it will look like this: - // Sat Sun Mon Tue Wed Thu Fri Sat - // 1/1 1/2 1/3 1/4 1/5 1/6 1/7 1/8 - // +--> First week starts here. - - - - // Day of week is 0-based. - // Get the day of week for 1/1. This can be derived from the day of week of the target day. - // Note that we can get a negative value. It's ok since we are going to make it a positive value when calculating the offset. - dayForJan1 = (int)GetDayOfWeek(time) - (dayOfYear % 7); - - // Now, calculate the offset. Subtract the first day of week from the dayForJan1. And make it a positive value. - offset = (firstDayOfWeek - dayForJan1 + 14) % 7; - if (offset != 0 && offset >= fullDays) - { - // - // If the offset is greater than the value of fullDays, it means that - // the first week of the year starts on the week where Jan/1 falls on. - // - offset -= 7; - } - // - // Calculate the day of year for specified time by taking offset into account. - // - day = dayOfYear - offset; - if (day >= 0) - { - // - // If the day of year value is greater than zero, get the week of year. - // - return (day / 7 + 1); - } - // - // Otherwise, the specified time falls on the week of previous year. - // Call this method again by passing the last day of previous year. - // - // the last day of the previous year may "underflow" to no longer be a valid date time for - // this calendar if we just subtract so we need the subclass to provide us with - // that information - if (time <= MinSupportedDateTime.AddDays(dayOfYear)) - { - return GetWeekOfYearOfMinSupportedDateTime(firstDayOfWeek, fullDays); - } - return (GetWeekOfYearFullDays(time.AddDays(-(dayOfYear + 1)), firstDayOfWeek, fullDays)); - } - - private int GetWeekOfYearOfMinSupportedDateTime(int firstDayOfWeek, int minimumDaysInFirstWeek) - { - int dayOfYear = GetDayOfYear(MinSupportedDateTime) - 1; // Make the day of year to be 0-based, so that 1/1 is day 0. - int dayOfWeekOfFirstOfYear = (int)GetDayOfWeek(MinSupportedDateTime) - dayOfYear % 7; - - // Calculate the offset (how many days from the start of the year to the start of the week) - int offset = (firstDayOfWeek + 7 - dayOfWeekOfFirstOfYear) % 7; - if (offset == 0 || offset >= minimumDaysInFirstWeek) - { - // First of year falls in the first week of the year - return 1; - } - - int daysInYearBeforeMinSupportedYear = DaysInYearBeforeMinSupportedYear - 1; // Make the day of year to be 0-based, so that 1/1 is day 0. - int dayOfWeekOfFirstOfPreviousYear = dayOfWeekOfFirstOfYear - 1 - (daysInYearBeforeMinSupportedYear % 7); - - // starting from first day of the year, how many days do you have to go forward - // before getting to the first day of the week? - int daysInInitialPartialWeek = (firstDayOfWeek - dayOfWeekOfFirstOfPreviousYear + 14) % 7; - int day = daysInYearBeforeMinSupportedYear - daysInInitialPartialWeek; - if (daysInInitialPartialWeek >= minimumDaysInFirstWeek) - { - // If the offset is greater than the minimum Days in the first week, it means that - // First of year is part of the first week of the year even though it is only a partial week - // add another week - day += 7; - } - - return (day / 7 + 1); - } - - // it would be nice to make this abstract but we can't since that would break previous implementations - protected virtual int DaysInYearBeforeMinSupportedYear - { - get - { - return 365; - } - } - - - // Returns the week of year for the specified DateTime. The returned value is an - // integer between 1 and 53. - // - - public virtual int GetWeekOfYear(DateTime time, CalendarWeekRule rule, DayOfWeek firstDayOfWeek) - { - if ((int)firstDayOfWeek < 0 || (int)firstDayOfWeek > 6) - { - throw new ArgumentOutOfRangeException( - nameof(firstDayOfWeek), SR.Format(SR.ArgumentOutOfRange_Range, - DayOfWeek.Sunday, DayOfWeek.Saturday)); - } - Contract.EndContractBlock(); - switch (rule) - { - case CalendarWeekRule.FirstDay: - return (GetFirstDayWeekOfYear(time, (int)firstDayOfWeek)); - case CalendarWeekRule.FirstFullWeek: - return (GetWeekOfYearFullDays(time, (int)firstDayOfWeek, 7)); - case CalendarWeekRule.FirstFourDayWeek: - return (GetWeekOfYearFullDays(time, (int)firstDayOfWeek, 4)); - } - throw new ArgumentOutOfRangeException( - nameof(rule), SR.Format(SR.ArgumentOutOfRange_Range, - CalendarWeekRule.FirstDay, CalendarWeekRule.FirstFourDayWeek)); - } - - // Returns the year part of the specified DateTime. The returned value is an - // integer between 1 and 9999. - // - - public abstract int GetYear(DateTime time); - - // Checks whether a given day in the current era is a leap day. This method returns true if - // the date is a leap day, or false if not. - // - - public virtual bool IsLeapDay(int year, int month, int day) - { - return (IsLeapDay(year, month, day, CurrentEra)); - } - - // Checks whether a given day in the specified era is a leap day. This method returns true if - // the date is a leap day, or false if not. - // - - public abstract bool IsLeapDay(int year, int month, int day, int era); - - // Checks whether a given month in the current era is a leap month. This method returns true if - // month is a leap month, or false if not. - // - - public virtual bool IsLeapMonth(int year, int month) - { - return (IsLeapMonth(year, month, CurrentEra)); - } - - // Checks whether a given month in the specified era is a leap month. This method returns true if - // month is a leap month, or false if not. - // - - public abstract bool IsLeapMonth(int year, int month, int era); - - // Returns the leap month in a calendar year of the current era. This method returns 0 - // if this calendar does not have leap month, or this year is not a leap year. - // - - public virtual int GetLeapMonth(int year) - { - return (GetLeapMonth(year, CurrentEra)); - } - - // Returns the leap month in a calendar year of the specified era. This method returns 0 - // if this calendar does not have leap month, or this year is not a leap year. - // - - public virtual int GetLeapMonth(int year, int era) - { - if (!IsLeapYear(year, era)) - return 0; - - int monthsCount = GetMonthsInYear(year, era); - for (int month = 1; month <= monthsCount; month++) - { - if (IsLeapMonth(year, month, era)) - return month; - } - - return 0; - } - - // Checks whether a given year in the current era is a leap year. This method returns true if - // year is a leap year, or false if not. - // - - public virtual bool IsLeapYear(int year) - { - return (IsLeapYear(year, CurrentEra)); - } - - // Checks whether a given year in the specified era is a leap year. This method returns true if - // year is a leap year, or false if not. - // - - public abstract bool IsLeapYear(int year, int era); - - // Returns the date and time converted to a DateTime value. Throws an exception if the n-tuple is invalid. - // - - public virtual DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond) - { - return (ToDateTime(year, month, day, hour, minute, second, millisecond, CurrentEra)); - } - - // Returns the date and time converted to a DateTime value. Throws an exception if the n-tuple is invalid. - // - - public abstract DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era); - - internal virtual Boolean TryToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era, out DateTime result) - { - result = DateTime.MinValue; - try - { - result = ToDateTime(year, month, day, hour, minute, second, millisecond, era); - return true; - } - catch (ArgumentException) - { - return false; - } - } - - internal virtual bool IsValidYear(int year, int era) - { - return (year >= GetYear(MinSupportedDateTime) && year <= GetYear(MaxSupportedDateTime)); - } - - internal virtual bool IsValidMonth(int year, int month, int era) - { - return (IsValidYear(year, era) && month >= 1 && month <= GetMonthsInYear(year, era)); - } - - internal virtual bool IsValidDay(int year, int month, int day, int era) - { - return (IsValidMonth(year, month, era) && day >= 1 && day <= GetDaysInMonth(year, month, era)); - } - - - // Returns and assigns the maximum value to represent a two digit year. This - // value is the upper boundary of a 100 year range that allows a two digit year - // to be properly translated to a four digit year. For example, if 2029 is the - // upper boundary, then a two digit value of 30 should be interpreted as 1930 - // while a two digit value of 29 should be interpreted as 2029. In this example - // , the 100 year range would be from 1930-2029. See ToFourDigitYear(). - - public virtual int TwoDigitYearMax - { - get - { - return (twoDigitYearMax); - } - - set - { - VerifyWritable(); - twoDigitYearMax = value; - } - } - - // Converts the year value to the appropriate century by using the - // TwoDigitYearMax property. For example, if the TwoDigitYearMax value is 2029, - // then a two digit value of 30 will get converted to 1930 while a two digit - // value of 29 will get converted to 2029. - - public virtual int ToFourDigitYear(int year) - { - if (year < 0) - { - throw new ArgumentOutOfRangeException(nameof(year), - SR.ArgumentOutOfRange_NeedNonNegNum); - } - Contract.EndContractBlock(); - if (year < 100) - { - return ((TwoDigitYearMax / 100 - (year > TwoDigitYearMax % 100 ? 1 : 0)) * 100 + year); - } - // If the year value is above 100, just return the year value. Don't have to do - // the TwoDigitYearMax comparison. - return (year); - } - - // Return the tick count corresponding to the given hour, minute, second. - // Will check the if the parameters are valid. - internal static long TimeToTicks(int hour, int minute, int second, int millisecond) - { - if (hour >= 0 && hour < 24 && minute >= 0 && minute < 60 && second >= 0 && second < 60) - { - if (millisecond < 0 || millisecond >= MillisPerSecond) - { - throw new ArgumentOutOfRangeException( - nameof(millisecond), - String.Format( - CultureInfo.InvariantCulture, - SR.Format(SR.ArgumentOutOfRange_Range, 0, MillisPerSecond - 1))); - } - return InternalGloablizationHelper.TimeToTicks(hour, minute, second) + millisecond * TicksPerMillisecond; - } - throw new ArgumentOutOfRangeException(null, SR.ArgumentOutOfRange_BadHourMinuteSecond); - } - - internal static int GetSystemTwoDigitYearSetting(CalendarId CalID, int defaultYearValue) - { - // Call nativeGetTwoDigitYearMax - int twoDigitYearMax = CalendarData.GetTwoDigitYearMax(CalID); - if (twoDigitYearMax < 0) - { - twoDigitYearMax = defaultYearValue; - } - return (twoDigitYearMax); - } - } -} diff --git a/src/mscorlib/corefx/System/Globalization/CalendarAlgorithmType.cs b/src/mscorlib/corefx/System/Globalization/CalendarAlgorithmType.cs deleted file mode 100644 index 159b0e6f77..0000000000 --- a/src/mscorlib/corefx/System/Globalization/CalendarAlgorithmType.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; - -namespace System.Globalization -{ - public enum CalendarAlgorithmType - { - Unknown = 0, // This is the default value to return in the Calendar base class. - SolarCalendar = 1, // Solar-base calendar, such as GregorianCalendar, jaoaneseCalendar, JulianCalendar, etc. - // Solar calendars are based on the solar year and seasons. - LunarCalendar = 2, // Lunar-based calendar, such as Hijri and UmAlQuraCalendar. - // Lunar calendars are based on the path of the moon. The seasons are not accurately represented. - LunisolarCalendar = 3 // Lunisolar-based calendar which use leap month rule, such as HebrewCalendar and Asian Lunisolar calendars. - // Lunisolar calendars are based on the cycle of the moon, but consider the seasons as a secondary consideration, - // so they align with the seasons as well as lunar events. - } -} diff --git a/src/mscorlib/corefx/System/Globalization/CalendarData.Unix.cs b/src/mscorlib/corefx/System/Globalization/CalendarData.Unix.cs deleted file mode 100644 index 19c81f17b0..0000000000 --- a/src/mscorlib/corefx/System/Globalization/CalendarData.Unix.cs +++ /dev/null @@ -1,335 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Collections.Generic; -using System.Diagnostics; -using System.Diagnostics.Contracts; -using System.Runtime.InteropServices; -using System.Security; -using System.Text; - -namespace System.Globalization -{ - // needs to be kept in sync with CalendarDataType in System.Globalization.Native - internal enum CalendarDataType - { - Uninitialized = 0, - NativeName = 1, - MonthDay = 2, - ShortDates = 3, - LongDates = 4, - YearMonths = 5, - DayNames = 6, - AbbrevDayNames = 7, - MonthNames = 8, - AbbrevMonthNames = 9, - SuperShortDayNames = 10, - MonthGenitiveNames = 11, - AbbrevMonthGenitiveNames = 12, - EraNames = 13, - AbbrevEraNames = 14, - } - - internal partial class CalendarData - { - private bool LoadCalendarDataFromSystem(String localeName, CalendarId calendarId) - { - bool result = true; - result &= GetCalendarInfo(localeName, calendarId, CalendarDataType.NativeName, out this.sNativeName); - result &= GetCalendarInfo(localeName, calendarId, CalendarDataType.MonthDay, out this.sMonthDay); - this.sMonthDay = NormalizeDatePattern(this.sMonthDay); - - result &= EnumDatePatterns(localeName, calendarId, CalendarDataType.ShortDates, out this.saShortDates); - result &= EnumDatePatterns(localeName, calendarId, CalendarDataType.LongDates, out this.saLongDates); - result &= EnumDatePatterns(localeName, calendarId, CalendarDataType.YearMonths, out this.saYearMonths); - result &= EnumCalendarInfo(localeName, calendarId, CalendarDataType.DayNames, out this.saDayNames); - result &= EnumCalendarInfo(localeName, calendarId, CalendarDataType.AbbrevDayNames, out this.saAbbrevDayNames); - result &= EnumCalendarInfo(localeName, calendarId, CalendarDataType.SuperShortDayNames, out this.saSuperShortDayNames); - result &= EnumMonthNames(localeName, calendarId, CalendarDataType.MonthNames, out this.saMonthNames); - result &= EnumMonthNames(localeName, calendarId, CalendarDataType.AbbrevMonthNames, out this.saAbbrevMonthNames); - result &= EnumMonthNames(localeName, calendarId, CalendarDataType.MonthGenitiveNames, out this.saMonthGenitiveNames); - result &= EnumMonthNames(localeName, calendarId, CalendarDataType.AbbrevMonthGenitiveNames, out this.saAbbrevMonthGenitiveNames); - result &= EnumEraNames(localeName, calendarId, CalendarDataType.EraNames, out this.saEraNames); - result &= EnumEraNames(localeName, calendarId, CalendarDataType.AbbrevEraNames, out this.saAbbrevEraNames); - - return result; - } - - internal static int GetTwoDigitYearMax(CalendarId calendarId) - { - // There is no user override for this value on Linux or in ICU. - // So just return -1 to use the hard-coded defaults. - return -1; - } - - // Call native side to figure out which calendars are allowed - internal static int GetCalendars(string localeName, bool useUserOverride, CalendarId[] calendars) - { - // NOTE: there are no 'user overrides' on Linux - int count = Interop.GlobalizationInterop.GetCalendars(localeName, calendars, calendars.Length); - - // ensure there is at least 1 calendar returned - if (count == 0 && calendars.Length > 0) - { - calendars[0] = CalendarId.GREGORIAN; - count = 1; - } - - return count; - } - - private static bool SystemSupportsTaiwaneseCalendar() - { - return true; - } - - // PAL Layer ends here - - private static bool GetCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType dataType, out string calendarString) - { - return Interop.CallStringMethod( - (locale, calId, type, stringBuilder) => - Interop.GlobalizationInterop.GetCalendarInfo( - locale, - calId, - type, - stringBuilder, - stringBuilder.Capacity), - localeName, - calendarId, - dataType, - out calendarString); - } - - private static bool EnumDatePatterns(string localeName, CalendarId calendarId, CalendarDataType dataType, out string[] datePatterns) - { - datePatterns = null; - - CallbackContext callbackContext = new CallbackContext(); - callbackContext.DisallowDuplicates = true; - bool result = EnumCalendarInfo(localeName, calendarId, dataType, callbackContext); - if (result) - { - List<string> datePatternsList = callbackContext.Results; - - datePatterns = new string[datePatternsList.Count]; - for (int i = 0; i < datePatternsList.Count; i++) - { - datePatterns[i] = NormalizeDatePattern(datePatternsList[i]); - } - } - - return result; - } - - /// <summary> - /// The ICU date format characters are not exactly the same as the .NET date format characters. - /// NormalizeDatePattern will take in an ICU date pattern and return the equivalent .NET date pattern. - /// </summary> - /// <remarks> - /// see Date Field Symbol Table in http://userguide.icu-project.org/formatparse/datetime - /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx - /// </remarks> - private static string NormalizeDatePattern(string input) - { - StringBuilder destination = StringBuilderCache.Acquire(input.Length); - - int index = 0; - while (index < input.Length) - { - switch (input[index]) - { - case '\'': - // single quotes escape characters, like 'de' in es-SP - // so read verbatim until the next single quote - destination.Append(input[index++]); - while (index < input.Length) - { - char current = input[index++]; - destination.Append(current); - if (current == '\'') - { - break; - } - } - break; - case 'E': - case 'e': - case 'c': - // 'E' in ICU is the day of the week, which maps to 3 or 4 'd's in .NET - // 'e' in ICU is the local day of the week, which has no representation in .NET, but - // maps closest to 3 or 4 'd's in .NET - // 'c' in ICU is the stand-alone day of the week, which has no representation in .NET, but - // maps closest to 3 or 4 'd's in .NET - NormalizeDayOfWeek(input, destination, ref index); - break; - case 'L': - case 'M': - // 'L' in ICU is the stand-alone name of the month, - // which maps closest to 'M' in .NET since it doesn't support stand-alone month names in patterns - // 'M' in both ICU and .NET is the month, - // but ICU supports 5 'M's, which is the super short month name - int occurrences = CountOccurrences(input, input[index], ref index); - if (occurrences > 4) - { - // 5 'L's or 'M's in ICU is the super short name, which maps closest to MMM in .NET - occurrences = 3; - } - destination.Append('M', occurrences); - break; - case 'G': - // 'G' in ICU is the era, which maps to 'g' in .NET - occurrences = CountOccurrences(input, 'G', ref index); - - // it doesn't matter how many 'G's, since .NET only supports 'g' or 'gg', and they - // have the same meaning - destination.Append('g'); - break; - case 'y': - // a single 'y' in ICU is the year with no padding or trimming. - // a single 'y' in .NET is the year with 1 or 2 digits - // so convert any single 'y' to 'yyyy' - occurrences = CountOccurrences(input, 'y', ref index); - if (occurrences == 1) - { - occurrences = 4; - } - destination.Append('y', occurrences); - break; - default: - const string unsupportedDateFieldSymbols = "YuUrQqwWDFg"; - Debug.Assert(unsupportedDateFieldSymbols.IndexOf(input[index]) == -1, - string.Format(CultureInfo.InvariantCulture, - "Encountered an unexpected date field symbol '{0}' from ICU which has no known corresponding .NET equivalent.", - input[index])); - - destination.Append(input[index++]); - break; - } - } - - return StringBuilderCache.GetStringAndRelease(destination); - } - - private static void NormalizeDayOfWeek(string input, StringBuilder destination, ref int index) - { - char dayChar = input[index]; - int occurrences = CountOccurrences(input, dayChar, ref index); - occurrences = Math.Max(occurrences, 3); - if (occurrences > 4) - { - // 5 and 6 E/e/c characters in ICU is the super short names, which maps closest to ddd in .NET - occurrences = 3; - } - - destination.Append('d', occurrences); - } - - private static int CountOccurrences(string input, char value, ref int index) - { - int startIndex = index; - while (index < input.Length && input[index] == value) - { - index++; - } - - return index - startIndex; - } - - private static bool EnumMonthNames(string localeName, CalendarId calendarId, CalendarDataType dataType, out string[] monthNames) - { - monthNames = null; - - CallbackContext callbackContext = new CallbackContext(); - bool result = EnumCalendarInfo(localeName, calendarId, dataType, callbackContext); - if (result) - { - // the month-name arrays are expected to have 13 elements. If ICU only returns 12, add an - // extra empty string to fill the array. - if (callbackContext.Results.Count == 12) - { - callbackContext.Results.Add(string.Empty); - } - - monthNames = callbackContext.Results.ToArray(); - } - - return result; - } - - private static bool EnumEraNames(string localeName, CalendarId calendarId, CalendarDataType dataType, out string[] eraNames) - { - bool result = EnumCalendarInfo(localeName, calendarId, dataType, out eraNames); - - // .NET expects that only the Japanese calendars have more than 1 era. - // So for other calendars, only return the latest era. - if (calendarId != CalendarId.JAPAN && calendarId != CalendarId.JAPANESELUNISOLAR && eraNames.Length > 0) - { - string[] latestEraName = new string[] { eraNames[eraNames.Length - 1] }; - eraNames = latestEraName; - } - - return result; - } - - internal static bool EnumCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType dataType, out string[] calendarData) - { - calendarData = null; - - CallbackContext callbackContext = new CallbackContext(); - bool result = EnumCalendarInfo(localeName, calendarId, dataType, callbackContext); - if (result) - { - calendarData = callbackContext.Results.ToArray(); - } - - return result; - } - - private static bool EnumCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType dataType, CallbackContext callbackContext) - { - GCHandle context = GCHandle.Alloc(callbackContext); - try - { - return Interop.GlobalizationInterop.EnumCalendarInfo(EnumCalendarInfoCallback, localeName, calendarId, dataType, (IntPtr)context); - } - finally - { - context.Free(); - } - } - - private static void EnumCalendarInfoCallback(string calendarString, IntPtr context) - { - CallbackContext callbackContext = (CallbackContext)((GCHandle)context).Target; - - if (callbackContext.DisallowDuplicates) - { - foreach (string existingResult in callbackContext.Results) - { - if (string.Equals(calendarString, existingResult, StringComparison.Ordinal)) - { - // the value is already in the results, so don't add it again - return; - } - } - } - - callbackContext.Results.Add(calendarString); - } - - private class CallbackContext - { - private List<string> _results = new List<string>(); - - public CallbackContext() - { - } - - public List<string> Results { get { return _results; } } - - public bool DisallowDuplicates { get; set; } - } - } -} diff --git a/src/mscorlib/corefx/System/Globalization/CalendarData.Windows.cs b/src/mscorlib/corefx/System/Globalization/CalendarData.Windows.cs deleted file mode 100644 index bdf3ff1881..0000000000 --- a/src/mscorlib/corefx/System/Globalization/CalendarData.Windows.cs +++ /dev/null @@ -1,469 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Runtime.InteropServices; -using System.Runtime.CompilerServices; -using System.Diagnostics.Contracts; -using System.Collections.Generic; - -namespace System.Globalization -{ - internal partial class CalendarData - { - private bool LoadCalendarDataFromSystem(String localeName, CalendarId calendarId) - { - bool ret = true; - - uint useOverrides = this.bUseUserOverrides ? 0 : CAL_NOUSEROVERRIDE; - - // - // Windows doesn't support some calendars right now, so remap those. - // - switch (calendarId) - { - case CalendarId.JAPANESELUNISOLAR: // Data looks like Japanese - calendarId = CalendarId.JAPAN; - break; - case CalendarId.JULIAN: // Data looks like gregorian US - case CalendarId.CHINESELUNISOLAR: // Algorithmic, so actual data is irrelevent - case CalendarId.SAKA: // reserved to match Office but not implemented in our code, so data is irrelevent - case CalendarId.LUNAR_ETO_CHN: // reserved to match Office but not implemented in our code, so data is irrelevent - case CalendarId.LUNAR_ETO_KOR: // reserved to match Office but not implemented in our code, so data is irrelevent - case CalendarId.LUNAR_ETO_ROKUYOU: // reserved to match Office but not implemented in our code, so data is irrelevent - case CalendarId.KOREANLUNISOLAR: // Algorithmic, so actual data is irrelevent - case CalendarId.TAIWANLUNISOLAR: // Algorithmic, so actual data is irrelevent - calendarId = CalendarId.GREGORIAN_US; - break; - } - - // - // Special handling for some special calendar due to OS limitation. - // This includes calendar like Taiwan calendar, UmAlQura calendar, etc. - // - CheckSpecialCalendar(ref calendarId, ref localeName); - - // Numbers - ret &= CallGetCalendarInfoEx(localeName, calendarId, CAL_ITWODIGITYEARMAX | useOverrides, out this.iTwoDigitYearMax); - - // Strings - ret &= CallGetCalendarInfoEx(localeName, calendarId, CAL_SCALNAME, out this.sNativeName); - ret &= CallGetCalendarInfoEx(localeName, calendarId, CAL_SMONTHDAY | useOverrides, out this.sMonthDay); - - // String Arrays - // Formats - ret &= CallEnumCalendarInfo(localeName, calendarId, CAL_SSHORTDATE, LOCALE_SSHORTDATE | useOverrides, out this.saShortDates); - ret &= CallEnumCalendarInfo(localeName, calendarId, CAL_SLONGDATE, LOCALE_SLONGDATE | useOverrides, out this.saLongDates); - - // Get the YearMonth pattern. - ret &= CallEnumCalendarInfo(localeName, calendarId, CAL_SYEARMONTH, LOCALE_SYEARMONTH, out this.saYearMonths); - - // Day & Month Names - // These are all single calType entries, 1 per day, so we have to make 7 or 13 calls to collect all the names - - // Day - // Note that we're off-by-one since managed starts on sunday and windows starts on monday - ret &= GetCalendarDayInfo(localeName, calendarId, CAL_SDAYNAME7, out this.saDayNames); - ret &= GetCalendarDayInfo(localeName, calendarId, CAL_SABBREVDAYNAME7, out this.saAbbrevDayNames); - - // Month names - ret &= GetCalendarMonthInfo(localeName, calendarId, CAL_SMONTHNAME1, out this.saMonthNames); - ret &= GetCalendarMonthInfo(localeName, calendarId, CAL_SABBREVMONTHNAME1, out this.saAbbrevMonthNames); - - // - // The following LCTYPE are not supported in some platforms. If the call fails, - // don't return a failure. - // - GetCalendarDayInfo(localeName, calendarId, CAL_SSHORTESTDAYNAME7, out this.saSuperShortDayNames); - - // Gregorian may have genitive month names - if (calendarId == CalendarId.GREGORIAN) - { - GetCalendarMonthInfo(localeName, calendarId, CAL_SMONTHNAME1 | CAL_RETURN_GENITIVE_NAMES, out this.saMonthGenitiveNames); - GetCalendarMonthInfo(localeName, calendarId, CAL_SABBREVMONTHNAME1 | CAL_RETURN_GENITIVE_NAMES, out this.saAbbrevMonthGenitiveNames); - } - - // Calendar Parts Names - // This doesn't get always get localized names for gregorian (not available in windows < 7) - // so: eg: coreclr on win < 7 won't get these - CallEnumCalendarInfo(localeName, calendarId, CAL_SERASTRING, 0, out this.saEraNames); - CallEnumCalendarInfo(localeName, calendarId, CAL_SABBREVERASTRING, 0, out this.saAbbrevEraNames); - - // - // Calendar Era Info - // Note that calendar era data (offsets, etc) is hard coded for each calendar since this - // data is implementation specific and not dynamic (except perhaps Japanese) - // - - // Clean up the escaping of the formats - this.saShortDates = CultureData.ReescapeWin32Strings(this.saShortDates); - this.saLongDates = CultureData.ReescapeWin32Strings(this.saLongDates); - this.saYearMonths = CultureData.ReescapeWin32Strings(this.saYearMonths); - this.sMonthDay = CultureData.ReescapeWin32String(this.sMonthDay); - - return ret; - } - - // Get native two digit year max - internal static int GetTwoDigitYearMax(CalendarId calendarId) - { - int twoDigitYearMax = -1; - - if (!CallGetCalendarInfoEx(null, calendarId, (uint)CAL_ITWODIGITYEARMAX, out twoDigitYearMax)) - { - twoDigitYearMax = -1; - } - - return twoDigitYearMax; - } - - // Call native side to figure out which calendars are allowed - internal static int GetCalendars(String localeName, bool useUserOverride, CalendarId[] calendars) - { - EnumCalendarsData data = new EnumCalendarsData(); - data.userOverride = 0; - data.calendars = new LowLevelList<int>(); - - // First call GetLocaleInfo if necessary - if (useUserOverride) - { - // They want user overrides, see if the user calendar matches the input calendar - int userCalendar = Interop.mincore.GetLocaleInfoExInt(localeName, LOCALE_ICALENDARTYPE); - - // If we got a default, then use it as the first calendar - if (userCalendar != 0) - { - data.userOverride = userCalendar; - data.calendars.Add(userCalendar); - } - } - - GCHandle contextHandle = GCHandle.Alloc(data); - try - { - // Now call the enumeration API. Work is done by our callback function - IntPtr callback = AddrofIntrinsics.AddrOf<Func<IntPtr, uint, IntPtr, IntPtr, Interop.BOOL>>(EnumCalendarsCallback); - Interop.mincore.EnumCalendarInfoExEx(callback, localeName, ENUM_ALL_CALENDARS, null, CAL_ICALINTVALUE, (IntPtr)contextHandle); - } - finally - { - contextHandle.Free(); - } - - // Copy to the output array - for (int i = 0; i < Math.Min(calendars.Length, data.calendars.Count); i++) - calendars[i] = (CalendarId)data.calendars[i]; - - // Now we have a list of data, return the count - return data.calendars.Count; - } - - private static bool SystemSupportsTaiwaneseCalendar() - { - string data; - // Taiwanese calendar get listed as one of the optional zh-TW calendars only when having zh-TW UI - return CallGetCalendarInfoEx("zh-TW", CalendarId.TAIWAN, CAL_SCALNAME, out data); - } - - // PAL Layer ends here - - private const uint CAL_RETURN_NUMBER = 0x20000000; - private const uint CAL_RETURN_GENITIVE_NAMES = 0x10000000; - private const uint CAL_NOUSEROVERRIDE = 0x80000000; - private const uint CAL_SCALNAME = 0x00000002; - private const uint CAL_SMONTHDAY = 0x00000038; - private const uint CAL_SSHORTDATE = 0x00000005; - private const uint CAL_SLONGDATE = 0x00000006; - private const uint CAL_SYEARMONTH = 0x0000002f; - private const uint CAL_SDAYNAME7 = 0x0000000d; - private const uint CAL_SABBREVDAYNAME7 = 0x00000014; - private const uint CAL_SMONTHNAME1 = 0x00000015; - private const uint CAL_SABBREVMONTHNAME1 = 0x00000022; - private const uint CAL_SSHORTESTDAYNAME7 = 0x00000037; - private const uint CAL_SERASTRING = 0x00000004; - private const uint CAL_SABBREVERASTRING = 0x00000039; - private const uint CAL_ICALINTVALUE = 0x00000001; - private const uint CAL_ITWODIGITYEARMAX = 0x00000030; - - private const uint ENUM_ALL_CALENDARS = 0xffffffff; - - private const uint LOCALE_SSHORTDATE = 0x0000001F; - private const uint LOCALE_SLONGDATE = 0x00000020; - private const uint LOCALE_SYEARMONTH = 0x00001006; - private const uint LOCALE_ICALENDARTYPE = 0x00001009; - - //////////////////////////////////////////////////////////////////////// - // - // For calendars like Gregorain US/Taiwan/UmAlQura, they are not available - // in all OS or all localized versions of OS. - // If OS does not support these calendars, we will fallback by using the - // appropriate fallback calendar and locale combination to retrieve data from OS. - // - // Parameters: - // __deref_inout pCalendarInt: - // Pointer to the calendar ID. This will be updated to new fallback calendar ID if needed. - // __in_out pLocaleNameStackBuffer - // Pointer to the StackSString object which holds the locale name to be checked. - // This will be updated to new fallback locale name if needed. - // - //////////////////////////////////////////////////////////////////////// - private static void CheckSpecialCalendar(ref CalendarId calendar, ref string localeName) - { - string data; - - // Gregorian-US isn't always available in the OS, however it is the same for all locales - switch (calendar) - { - case CalendarId.GREGORIAN_US: - // See if this works - if (!CallGetCalendarInfoEx(localeName, calendar, CAL_SCALNAME, out data)) - { - // Failed, set it to a locale (fa-IR) that's alway has Gregorian US available in the OS - localeName = "fa-IR"; - } - // See if that works - if (!CallGetCalendarInfoEx(localeName, calendar, CAL_SCALNAME, out data)) - { - // Failed again, just use en-US with the gregorian calendar - localeName = "en-US"; - calendar = CalendarId.GREGORIAN; - } - break; - case CalendarId.TAIWAN: - // Taiwan calendar data is not always in all language version of OS due to Geopolical reasons. - // It is only available in zh-TW localized versions of Windows. - // Let's check if OS supports it. If not, fallback to Greogrian localized for Taiwan calendar. - if (!SystemSupportsTaiwaneseCalendar()) - { - calendar = CalendarId.GREGORIAN; - } - break; - } - } - - private static bool CallGetCalendarInfoEx(string localeName, CalendarId calendar, uint calType, out int data) - { - return (Interop.mincore.GetCalendarInfoEx(localeName, (uint)calendar, IntPtr.Zero, calType | CAL_RETURN_NUMBER, IntPtr.Zero, 0, out data) != 0); - } - - private static unsafe bool CallGetCalendarInfoEx(string localeName, CalendarId calendar, uint calType, out string data) - { - const int BUFFER_LENGTH = 80; - - // The maximum size for values returned from GetCalendarInfoEx is 80 characters. - char* buffer = stackalloc char[BUFFER_LENGTH]; - - int ret = Interop.mincore.GetCalendarInfoEx(localeName, (uint)calendar, IntPtr.Zero, calType, (IntPtr)buffer, BUFFER_LENGTH, IntPtr.Zero); - if (ret > 0) - { - if (buffer[ret - 1] == '\0') - { - ret--; // don't include the null termination in the string - } - data = new string(buffer, 0, ret); - return true; - } - data = ""; - return false; - } - - // Context for EnumCalendarInfoExEx callback. - private class EnumData - { - public string userOverride; - public LowLevelList<string> strings; - } - - // EnumCalendarInfoExEx callback itself. - [NativeCallable(CallingConvention = CallingConvention.StdCall)] - private static unsafe Interop.BOOL EnumCalendarInfoCallback(IntPtr lpCalendarInfoString, uint calendar, IntPtr pReserved, IntPtr lParam) - { - EnumData context = (EnumData)((GCHandle)lParam).Target; - try - { - string calendarInfo = new string((char*)lpCalendarInfoString); - - // If we had a user override, check to make sure this differs - if (context.userOverride != calendarInfo) - context.strings.Add(calendarInfo); - - return Interop.BOOL.TRUE; - } - catch (Exception) - { - return Interop.BOOL.FALSE; - } - } - - private static unsafe bool CallEnumCalendarInfo(string localeName, CalendarId calendar, uint calType, uint lcType, out string[] data) - { - EnumData context = new EnumData(); - context.userOverride = null; - context.strings = new LowLevelList<string>(); - - // First call GetLocaleInfo if necessary - if (((lcType != 0) && ((lcType & CAL_NOUSEROVERRIDE) == 0)) && - // Get user locale, see if it matches localeName. - // Note that they should match exactly, including letter case - GetUserDefaultLocaleName() == localeName) - { - // They want user overrides, see if the user calendar matches the input calendar - CalendarId userCalendar = (CalendarId)Interop.mincore.GetLocaleInfoExInt(localeName, LOCALE_ICALENDARTYPE); - - // If the calendars were the same, see if the locales were the same - if (userCalendar == calendar) - { - // They matched, get the user override since locale & calendar match - string res = Interop.mincore.GetLocaleInfoEx(localeName, lcType); - - // if it succeeded remember the override for the later callers - if (res != "") - { - // Remember this was the override (so we can look for duplicates later in the enum function) - context.userOverride = res; - - // Add to the result strings. - context.strings.Add(res); - } - } - } - - GCHandle contextHandle = GCHandle.Alloc(context); - try - { - // Now call the enumeration API. Work is done by our callback function - IntPtr callback = AddrofIntrinsics.AddrOf<Func<IntPtr, uint, IntPtr, IntPtr, Interop.BOOL>>(EnumCalendarInfoCallback); - Interop.mincore.EnumCalendarInfoExEx(callback, localeName, (uint)calendar, null, calType, (IntPtr)contextHandle); - } - finally - { - contextHandle.Free(); - } - - // Now we have a list of data, fail if we didn't find anything. - if (context.strings.Count == 0) - { - data = null; - return false; - } - - string[] output = context.strings.ToArray(); - - if (calType == CAL_SABBREVERASTRING || calType == CAL_SERASTRING) - { - // Eras are enumerated backwards. (oldest era name first, but - // Japanese calendar has newest era first in array, and is only - // calendar with multiple eras) - Array.Reverse(output, 0, output.Length); - } - - data = output; - - return true; - } - - //////////////////////////////////////////////////////////////////////// - // - // Get the native day names - // - // NOTE: There's a disparity between .Net & windows day orders, the input day should - // start with Sunday - // - // Parameters: - // OUT pOutputStrings The output string[] value. - // - //////////////////////////////////////////////////////////////////////// - private static bool GetCalendarDayInfo(string localeName, CalendarId calendar, uint calType, out string[] outputStrings) - { - bool result = true; - - // - // We'll need a new array of 7 items - // - string[] results = new string[7]; - - // Get each one of them - for (int i = 0; i < 7; i++, calType++) - { - result &= CallGetCalendarInfoEx(localeName, calendar, calType, out results[i]); - - // On the first iteration we need to go from CAL_SDAYNAME7 to CAL_SDAYNAME1, so subtract 7 before the ++ happens - // This is because the framework starts on sunday and windows starts on monday when counting days - if (i == 0) - calType -= 7; - } - - outputStrings = results; - - return result; - } - - //////////////////////////////////////////////////////////////////////// - // - // Get the native month names - // - // Parameters: - // OUT pOutputStrings The output string[] value. - // - //////////////////////////////////////////////////////////////////////// - private static bool GetCalendarMonthInfo(string localeName, CalendarId calendar, uint calType, out string[] outputStrings) - { - // - // We'll need a new array of 13 items - // - string[] results = new string[13]; - - // Get each one of them - for (int i = 0; i < 13; i++, calType++) - { - if (!CallGetCalendarInfoEx(localeName, calendar, calType, out results[i])) - results[i] = ""; - } - - outputStrings = results; - - return true; - } - - // - // struct to help our calendar data enumaration callback - // - private class EnumCalendarsData - { - public int userOverride; // user override value (if found) - public LowLevelList<int> calendars; // list of calendars found so far - } - - [NativeCallable(CallingConvention = CallingConvention.StdCall)] - private static Interop.BOOL EnumCalendarsCallback(IntPtr lpCalendarInfoString, uint calendar, IntPtr reserved, IntPtr lParam) - { - EnumCalendarsData context = (EnumCalendarsData)((GCHandle)lParam).Target; - try - { - // If we had a user override, check to make sure this differs - if (context.userOverride != calendar) - context.calendars.Add((int)calendar); - - return Interop.BOOL.TRUE; - } - catch (Exception) - { - return Interop.BOOL.FALSE; - } - } - - private static unsafe String GetUserDefaultLocaleName() - { - const int LOCALE_NAME_MAX_LENGTH = 85; - const uint LOCALE_SNAME = 0x0000005c; - const string LOCALE_NAME_USER_DEFAULT = null; - - int result; - char* localeName = stackalloc char[LOCALE_NAME_MAX_LENGTH]; - result = Interop.mincore.GetLocaleInfoEx(LOCALE_NAME_USER_DEFAULT, LOCALE_SNAME, localeName, LOCALE_NAME_MAX_LENGTH); - - return result <= 0 ? "" : new String(localeName, 0, result - 1); // exclude the null termination - } - } -} diff --git a/src/mscorlib/corefx/System/Globalization/CalendarData.cs b/src/mscorlib/corefx/System/Globalization/CalendarData.cs deleted file mode 100644 index d22bd67ac1..0000000000 --- a/src/mscorlib/corefx/System/Globalization/CalendarData.cs +++ /dev/null @@ -1,377 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Diagnostics; - -namespace System.Globalization -{ - // List of calendar data - // Note the we cache overrides. - // Note that localized names (resource names) aren't available from here. - // - // NOTE: Calendars depend on the locale name that creates it. Only a few - // properties are available without locales using CalendarData.GetCalendar(CalendarData) - - internal partial class CalendarData - { - // Max calendars - internal const int MAX_CALENDARS = 23; - - // Identity - internal String sNativeName; // Calendar Name for the locale - - // Formats - internal String[] saShortDates; // Short Data format, default first - internal String[] saYearMonths; // Year/Month Data format, default first - internal String[] saLongDates; // Long Data format, default first - internal String sMonthDay; // Month/Day format - - // Calendar Parts Names - internal String[] saEraNames; // Names of Eras - internal String[] saAbbrevEraNames; // Abbreviated Era Names - internal String[] saAbbrevEnglishEraNames; // Abbreviated Era Names in English - internal String[] saDayNames; // Day Names, null to use locale data, starts on Sunday - internal String[] saAbbrevDayNames; // Abbrev Day Names, null to use locale data, starts on Sunday - internal String[] saSuperShortDayNames; // Super short Day of week names - internal String[] saMonthNames; // Month Names (13) - internal String[] saAbbrevMonthNames; // Abbrev Month Names (13) - internal String[] saMonthGenitiveNames; // Genitive Month Names (13) - internal String[] saAbbrevMonthGenitiveNames; // Genitive Abbrev Month Names (13) - internal String[] saLeapYearMonthNames; // Multiple strings for the month names in a leap year. - - // Integers at end to make marshaller happier - internal int iTwoDigitYearMax = 2029; // Max 2 digit year (for Y2K bug data entry) - internal int iCurrentEra = 0; // current era # (usually 1) - - // Use overrides? - internal bool bUseUserOverrides; // True if we want user overrides. - - // Static invariant for the invariant locale - internal static CalendarData Invariant; - - // Private constructor - private CalendarData() { } - - // Invariant constructor - static CalendarData() - { - // Set our default/gregorian US calendar data - // Calendar IDs are 1-based, arrays are 0 based. - CalendarData invariant = new CalendarData(); - - // Set default data for calendar - // Note that we don't load resources since this IS NOT supposed to change (by definition) - invariant.sNativeName = "Gregorian Calendar"; // Calendar Name - - // Year - invariant.iTwoDigitYearMax = 2029; // Max 2 digit year (for Y2K bug data entry) - invariant.iCurrentEra = 1; // Current era # - - // Formats - invariant.saShortDates = new String[] { "MM/dd/yyyy", "yyyy-MM-dd" }; // short date format - invariant.saLongDates = new String[] { "dddd, dd MMMM yyyy" }; // long date format - invariant.saYearMonths = new String[] { "yyyy MMMM" }; // year month format - invariant.sMonthDay = "MMMM dd"; // Month day pattern - - // Calendar Parts Names - invariant.saEraNames = new String[] { "A.D." }; // Era names - invariant.saAbbrevEraNames = new String[] { "AD" }; // Abbreviated Era names - invariant.saAbbrevEnglishEraNames = new String[] { "AD" }; // Abbreviated era names in English - invariant.saDayNames = new String[] { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };// day names - invariant.saAbbrevDayNames = new String[] { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; // abbreviated day names - invariant.saSuperShortDayNames = new String[] { "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" }; // The super short day names - invariant.saMonthNames = new String[] { "January", "February", "March", "April", "May", "June", - "July", "August", "September", "October", "November", "December", String.Empty}; // month names - invariant.saAbbrevMonthNames = new String[] { "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", String.Empty}; // abbreviated month names - invariant.saMonthGenitiveNames = invariant.saMonthNames; // Genitive month names (same as month names for invariant) - invariant.saAbbrevMonthGenitiveNames = invariant.saAbbrevMonthNames; // Abbreviated genitive month names (same as abbrev month names for invariant) - invariant.saLeapYearMonthNames = invariant.saMonthNames; // leap year month names are unused in Gregorian English (invariant) - - invariant.bUseUserOverrides = false; - - // Calendar was built, go ahead and assign it... - Invariant = invariant; - } - - // - // Get a bunch of data for a calendar - // - internal CalendarData(String localeName, CalendarId calendarId, bool bUseUserOverrides) - { - this.bUseUserOverrides = bUseUserOverrides; - - if (!LoadCalendarDataFromSystem(localeName, calendarId)) - { - Debug.Assert(false, "[CalendarData] LoadCalendarDataFromSystem call isn't expected to fail for calendar " + calendarId + " locale " + localeName); - - // Something failed, try invariant for missing parts - // This is really not good, but we don't want the callers to crash. - if (this.sNativeName == null) this.sNativeName = String.Empty; // Calendar Name for the locale. - - // Formats - if (this.saShortDates == null) this.saShortDates = Invariant.saShortDates; // Short Data format, default first - if (this.saYearMonths == null) this.saYearMonths = Invariant.saYearMonths; // Year/Month Data format, default first - if (this.saLongDates == null) this.saLongDates = Invariant.saLongDates; // Long Data format, default first - if (this.sMonthDay == null) this.sMonthDay = Invariant.sMonthDay; // Month/Day format - - // Calendar Parts Names - if (this.saEraNames == null) this.saEraNames = Invariant.saEraNames; // Names of Eras - if (this.saAbbrevEraNames == null) this.saAbbrevEraNames = Invariant.saAbbrevEraNames; // Abbreviated Era Names - if (this.saAbbrevEnglishEraNames == null) this.saAbbrevEnglishEraNames = Invariant.saAbbrevEnglishEraNames; // Abbreviated Era Names in English - if (this.saDayNames == null) this.saDayNames = Invariant.saDayNames; // Day Names, null to use locale data, starts on Sunday - if (this.saAbbrevDayNames == null) this.saAbbrevDayNames = Invariant.saAbbrevDayNames; // Abbrev Day Names, null to use locale data, starts on Sunday - if (this.saSuperShortDayNames == null) this.saSuperShortDayNames = Invariant.saSuperShortDayNames; // Super short Day of week names - if (this.saMonthNames == null) this.saMonthNames = Invariant.saMonthNames; // Month Names (13) - if (this.saAbbrevMonthNames == null) this.saAbbrevMonthNames = Invariant.saAbbrevMonthNames; // Abbrev Month Names (13) - // Genitive and Leap names can follow the fallback below - } - - if (calendarId == CalendarId.TAIWAN) - { - if (SystemSupportsTaiwaneseCalendar()) - { - // We got the month/day names from the OS (same as gregorian), but the native name is wrong - this.sNativeName = "\x4e2d\x83ef\x6c11\x570b\x66c6"; - } - else - { - this.sNativeName = String.Empty; - } - } - - // Check for null genitive names (in case unmanaged side skips it for non-gregorian calendars, etc) - if (this.saMonthGenitiveNames == null || this.saMonthGenitiveNames.Length == 0 || String.IsNullOrEmpty(this.saMonthGenitiveNames[0])) - this.saMonthGenitiveNames = this.saMonthNames; // Genitive month names (same as month names for invariant) - if (this.saAbbrevMonthGenitiveNames == null || this.saAbbrevMonthGenitiveNames.Length == 0 || String.IsNullOrEmpty(this.saAbbrevMonthGenitiveNames[0])) - this.saAbbrevMonthGenitiveNames = this.saAbbrevMonthNames; // Abbreviated genitive month names (same as abbrev month names for invariant) - if (this.saLeapYearMonthNames == null || this.saLeapYearMonthNames.Length == 0 || String.IsNullOrEmpty(this.saLeapYearMonthNames[0])) - this.saLeapYearMonthNames = this.saMonthNames; - - InitializeEraNames(localeName, calendarId); - - InitializeAbbreviatedEraNames(localeName, calendarId); - - // Abbreviated English Era Names are only used for the Japanese calendar. - if (calendarId == CalendarId.JAPAN) - { - this.saAbbrevEnglishEraNames = JapaneseCalendar.EnglishEraNames(); - } - else - { - // For all others just use the an empty string (doesn't matter we'll never ask for it for other calendars) - this.saAbbrevEnglishEraNames = new String[] { "" }; - } - - // Japanese is the only thing with > 1 era. Its current era # is how many ever - // eras are in the array. (And the others all have 1 string in the array) - this.iCurrentEra = this.saEraNames.Length; - } - - private void InitializeEraNames(string localeName, CalendarId calendarId) - { - // Note that the saEraNames only include "A.D." We don't have localized names for other calendars available from windows - switch (calendarId) - { - // For Localized Gregorian we really expect the data from the OS. - case CalendarId.GREGORIAN: - // Fallback for CoreCLR < Win7 or culture.dll missing - if (this.saEraNames == null || this.saEraNames.Length == 0 || String.IsNullOrEmpty(this.saEraNames[0])) - { - this.saEraNames = new String[] { "A.D." }; - } - break; - - // The rest of the calendars have constant data, so we'll just use that - case CalendarId.GREGORIAN_US: - case CalendarId.JULIAN: - this.saEraNames = new String[] { "A.D." }; - break; - case CalendarId.HEBREW: - this.saEraNames = new String[] { "C.E." }; - break; - case CalendarId.HIJRI: - case CalendarId.UMALQURA: - if (localeName == "dv-MV") - { - // Special case for Divehi - this.saEraNames = new String[] { "\x0780\x07a8\x0796\x07b0\x0783\x07a9" }; - } - else - { - this.saEraNames = new String[] { "\x0628\x0639\x062F \x0627\x0644\x0647\x062C\x0631\x0629" }; - } - break; - case CalendarId.GREGORIAN_ARABIC: - case CalendarId.GREGORIAN_XLIT_ENGLISH: - case CalendarId.GREGORIAN_XLIT_FRENCH: - // These are all the same: - this.saEraNames = new String[] { "\x0645" }; - break; - - case CalendarId.GREGORIAN_ME_FRENCH: - this.saEraNames = new String[] { "ap. J.-C." }; - break; - - case CalendarId.TAIWAN: - if (SystemSupportsTaiwaneseCalendar()) - { - this.saEraNames = new String[] { "\x4e2d\x83ef\x6c11\x570b" }; - } - else - { - this.saEraNames = new String[] { String.Empty }; - } - break; - - case CalendarId.KOREA: - this.saEraNames = new String[] { "\xb2e8\xae30" }; - break; - - case CalendarId.THAI: - this.saEraNames = new String[] { "\x0e1e\x002e\x0e28\x002e" }; - break; - - case CalendarId.JAPAN: - case CalendarId.JAPANESELUNISOLAR: - this.saEraNames = JapaneseCalendar.EraNames(); - break; - - case CalendarId.PERSIAN: - if (this.saEraNames == null || this.saEraNames.Length == 0 || String.IsNullOrEmpty(this.saEraNames[0])) - { - this.saEraNames = new String[] { "\x0647\x002e\x0634" }; - } - break; - - default: - // Most calendars are just "A.D." - this.saEraNames = Invariant.saEraNames; - break; - } - } - - private void InitializeAbbreviatedEraNames(string localeName, CalendarId calendarId) - { - // Note that the saAbbrevEraNames only include "AD" We don't have localized names for other calendars available from windows - switch (calendarId) - { - // For Localized Gregorian we really expect the data from the OS. - case CalendarId.GREGORIAN: - // Fallback for CoreCLR < Win7 or culture.dll missing - if (this.saAbbrevEraNames == null || this.saAbbrevEraNames.Length == 0 || String.IsNullOrEmpty(this.saAbbrevEraNames[0])) - { - this.saAbbrevEraNames = new String[] { "AD" }; - } - break; - - // The rest of the calendars have constant data, so we'll just use that - case CalendarId.GREGORIAN_US: - case CalendarId.JULIAN: - this.saAbbrevEraNames = new String[] { "AD" }; - break; - case CalendarId.JAPAN: - case CalendarId.JAPANESELUNISOLAR: - this.saAbbrevEraNames = JapaneseCalendar.AbbrevEraNames(); - break; - case CalendarId.HIJRI: - case CalendarId.UMALQURA: - if (localeName == "dv-MV") - { - // Special case for Divehi - this.saAbbrevEraNames = new String[] { "\x0780\x002e" }; - } - else - { - this.saAbbrevEraNames = new String[] { "\x0647\x0640" }; - } - break; - case CalendarId.TAIWAN: - // Get era name and abbreviate it - this.saAbbrevEraNames = new String[1]; - if (this.saEraNames[0].Length == 4) - { - this.saAbbrevEraNames[0] = this.saEraNames[0].Substring(2, 2); - } - else - { - this.saAbbrevEraNames[0] = this.saEraNames[0]; - } - break; - - case CalendarId.PERSIAN: - if (this.saAbbrevEraNames == null || this.saAbbrevEraNames.Length == 0 || String.IsNullOrEmpty(this.saAbbrevEraNames[0])) - { - this.saAbbrevEraNames = this.saEraNames; - } - break; - - default: - // Most calendars just use the full name - this.saAbbrevEraNames = this.saEraNames; - break; - } - } - - internal static CalendarData GetCalendarData(CalendarId calendarId) - { - // - // Get a calendar. - // Unfortunately we depend on the locale in the OS, so we need a locale - // no matter what. So just get the appropriate calendar from the - // appropriate locale here - // - - // Get a culture name - // TODO: Note that this doesn't handle the new calendars (lunisolar, etc) - String culture = CalendarIdToCultureName(calendarId); - - // Return our calendar - return CultureInfo.GetCultureInfo(culture).m_cultureData.GetCalendar(calendarId); - } - - private static String CalendarIdToCultureName(CalendarId calendarId) - { - switch (calendarId) - { - case CalendarId.GREGORIAN_US: - return "fa-IR"; // "fa-IR" Iran - - case CalendarId.JAPAN: - return "ja-JP"; // "ja-JP" Japan - - case CalendarId.TAIWAN: - return "zh-TW"; // zh-TW Taiwan - - case CalendarId.KOREA: - return "ko-KR"; // "ko-KR" Korea - - case CalendarId.HIJRI: - case CalendarId.GREGORIAN_ARABIC: - case CalendarId.UMALQURA: - return "ar-SA"; // "ar-SA" Saudi Arabia - - case CalendarId.THAI: - return "th-TH"; // "th-TH" Thailand - - case CalendarId.HEBREW: - return "he-IL"; // "he-IL" Israel - - case CalendarId.GREGORIAN_ME_FRENCH: - return "ar-DZ"; // "ar-DZ" Algeria - - case CalendarId.GREGORIAN_XLIT_ENGLISH: - case CalendarId.GREGORIAN_XLIT_FRENCH: - return "ar-IQ"; // "ar-IQ"; Iraq - - default: - // Default to gregorian en-US - break; - } - - return "en-US"; - } - } -} - diff --git a/src/mscorlib/corefx/System/Globalization/CalendarWeekRule.cs b/src/mscorlib/corefx/System/Globalization/CalendarWeekRule.cs deleted file mode 100644 index 4013ce7237..0000000000 --- a/src/mscorlib/corefx/System/Globalization/CalendarWeekRule.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; - -namespace System.Globalization -{ - [Serializable] - public enum CalendarWeekRule - { - FirstDay = 0, // Week 1 begins on the first day of the year - - FirstFullWeek = 1, // Week 1 begins on first FirstDayOfWeek not before the first day of the year - - FirstFourDayWeek = 2 // Week 1 begins on first FirstDayOfWeek such that FirstDayOfWeek+3 is not before the first day of the year - }; -} diff --git a/src/mscorlib/corefx/System/Globalization/CalendricalCalculationsHelper.cs b/src/mscorlib/corefx/System/Globalization/CalendricalCalculationsHelper.cs deleted file mode 100644 index 7de75d6aee..0000000000 --- a/src/mscorlib/corefx/System/Globalization/CalendricalCalculationsHelper.cs +++ /dev/null @@ -1,412 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Diagnostics; - -namespace System.Globalization -{ - internal class CalendricalCalculationsHelper - { - private const double FullCircleOfArc = 360.0; // 360.0; - private const int HalfCircleOfArc = 180; - private const double TwelveHours = 0.5; // half a day - private const double Noon2000Jan01 = 730120.5; - internal const double MeanTropicalYearInDays = 365.242189; - private const double MeanSpeedOfSun = MeanTropicalYearInDays / FullCircleOfArc; - private const double LongitudeSpring = 0.0; - private const double TwoDegreesAfterSpring = 2.0; - private const int SecondsPerDay = 24 * 60 * 60; // 24 hours * 60 minutes * 60 seconds - - private const int DaysInUniformLengthCentury = 36525; - private const int SecondsPerMinute = 60; - private const int MinutesPerDegree = 60; - - private static readonly long s_startOf1810 = GetNumberOfDays(new DateTime(1810, 1, 1)); - private static readonly long s_startOf1900Century = GetNumberOfDays(new DateTime(1900, 1, 1)); - - private static readonly double[] s_coefficients1900to1987 = new double[] { -0.00002, 0.000297, 0.025184, -0.181133, 0.553040, -0.861938, 0.677066, -0.212591 }; - private static readonly double[] s_coefficients1800to1899 = new double[] { -0.000009, 0.003844, 0.083563, 0.865736, 4.867575, 15.845535, 31.332267, 38.291999, 28.316289, 11.636204, 2.043794 }; - private static readonly double[] s_coefficients1700to1799 = new double[] { 8.118780842, -0.005092142, 0.003336121, -0.0000266484 }; - private static readonly double[] s_coefficients1620to1699 = new double[] { 196.58333, -4.0675, 0.0219167 }; - private static readonly double[] s_lambdaCoefficients = new double[] { 280.46645, 36000.76983, 0.0003032 }; - private static readonly double[] s_anomalyCoefficients = new double[] { 357.52910, 35999.05030, -0.0001559, -0.00000048 }; - private static readonly double[] s_eccentricityCoefficients = new double[] { 0.016708617, -0.000042037, -0.0000001236 }; - private static readonly double[] s_coefficients = new double[] { Angle(23, 26, 21.448), Angle(0, 0, -46.8150), Angle(0, 0, -0.00059), Angle(0, 0, 0.001813) }; - private static readonly double[] s_coefficientsA = new double[] { 124.90, -1934.134, 0.002063 }; - private static readonly double[] s_coefficientsB = new double[] { 201.11, 72001.5377, 0.00057 }; - - private static double RadiansFromDegrees(double degree) - { - return degree * Math.PI / 180; - } - - private static double SinOfDegree(double degree) - { - return Math.Sin(RadiansFromDegrees(degree)); - } - - private static double CosOfDegree(double degree) - { - return Math.Cos(RadiansFromDegrees(degree)); - } - private static double TanOfDegree(double degree) - { - return Math.Tan(RadiansFromDegrees(degree)); - } - - public static double Angle(int degrees, int minutes, double seconds) - { - return ((seconds / SecondsPerMinute + minutes) / MinutesPerDegree) + degrees; - } - - private static double Obliquity(double julianCenturies) - { - return PolynomialSum(s_coefficients, julianCenturies); - } - - internal static long GetNumberOfDays(DateTime date) - { - return date.Ticks / GregorianCalendar.TicksPerDay; - } - - private static int GetGregorianYear(double numberOfDays) - { - return new DateTime(Math.Min((long)(Math.Floor(numberOfDays) * GregorianCalendar.TicksPerDay), DateTime.MaxValue.Ticks)).Year; - } - - private enum CorrectionAlgorithm - { - Default, - Year1988to2019, - Year1900to1987, - Year1800to1899, - Year1700to1799, - Year1620to1699 - } - - private struct EphemerisCorrectionAlgorithmMap - { - public EphemerisCorrectionAlgorithmMap(int year, CorrectionAlgorithm algorithm) - { - _lowestYear = year; - _algorithm = algorithm; - } - - internal int _lowestYear; - internal CorrectionAlgorithm _algorithm; - }; - - private static readonly EphemerisCorrectionAlgorithmMap[] s_ephemerisCorrectionTable = new EphemerisCorrectionAlgorithmMap[] - { - // lowest year that starts algorithm, algorithm to use - new EphemerisCorrectionAlgorithmMap(2020, CorrectionAlgorithm.Default), - new EphemerisCorrectionAlgorithmMap(1988, CorrectionAlgorithm.Year1988to2019), - new EphemerisCorrectionAlgorithmMap(1900, CorrectionAlgorithm.Year1900to1987), - new EphemerisCorrectionAlgorithmMap(1800, CorrectionAlgorithm.Year1800to1899), - new EphemerisCorrectionAlgorithmMap(1700, CorrectionAlgorithm.Year1700to1799), - new EphemerisCorrectionAlgorithmMap(1620, CorrectionAlgorithm.Year1620to1699), - new EphemerisCorrectionAlgorithmMap(int.MinValue, CorrectionAlgorithm.Default) // default must be last - }; - - private static double Reminder(double divisor, double dividend) - { - double whole = Math.Floor(divisor / dividend); - return divisor - (dividend * whole); - } - - private static double NormalizeLongitude(double longitude) - { - longitude = Reminder(longitude, FullCircleOfArc); - if (longitude < 0) - { - longitude += FullCircleOfArc; - } - return longitude; - } - - public static double AsDayFraction(double longitude) - { - return longitude / FullCircleOfArc; - } - - private static double PolynomialSum(double[] coefficients, double indeterminate) - { - double sum = coefficients[0]; - double indeterminateRaised = 1; - for (int i = 1; i < coefficients.Length; i++) - { - indeterminateRaised *= indeterminate; - sum += (coefficients[i] * indeterminateRaised); - } - - return sum; - } - - private static double CenturiesFrom1900(int gregorianYear) - { - long july1stOfYear = GetNumberOfDays(new DateTime(gregorianYear, 7, 1)); - return (double)(july1stOfYear - s_startOf1900Century) / DaysInUniformLengthCentury; - } - - // the following formulas defines a polynomial function which gives us the amount that the earth is slowing down for specific year ranges - private static double DefaultEphemerisCorrection(int gregorianYear) - { - Debug.Assert(gregorianYear < 1620 || 2020 <= gregorianYear); - long january1stOfYear = GetNumberOfDays(new DateTime(gregorianYear, 1, 1)); - double daysSinceStartOf1810 = january1stOfYear - s_startOf1810; - double x = TwelveHours + daysSinceStartOf1810; - return ((Math.Pow(x, 2) / 41048480) - 15) / SecondsPerDay; - } - - private static double EphemerisCorrection1988to2019(int gregorianYear) - { - Debug.Assert(1988 <= gregorianYear && gregorianYear <= 2019); - return (double)(gregorianYear - 1933) / SecondsPerDay; - } - - private static double EphemerisCorrection1900to1987(int gregorianYear) - { - Debug.Assert(1900 <= gregorianYear && gregorianYear <= 1987); - double centuriesFrom1900 = CenturiesFrom1900(gregorianYear); - return PolynomialSum(s_coefficients1900to1987, centuriesFrom1900); - } - - private static double EphemerisCorrection1800to1899(int gregorianYear) - { - Debug.Assert(1800 <= gregorianYear && gregorianYear <= 1899); - double centuriesFrom1900 = CenturiesFrom1900(gregorianYear); - return PolynomialSum(s_coefficients1800to1899, centuriesFrom1900); - } - - private static double EphemerisCorrection1700to1799(int gregorianYear) - { - Debug.Assert(1700 <= gregorianYear && gregorianYear <= 1799); - double yearsSince1700 = gregorianYear - 1700; - return PolynomialSum(s_coefficients1700to1799, yearsSince1700) / SecondsPerDay; - } - - private static double EphemerisCorrection1620to1699(int gregorianYear) - { - Debug.Assert(1620 <= gregorianYear && gregorianYear <= 1699); - double yearsSince1600 = gregorianYear - 1600; - return PolynomialSum(s_coefficients1620to1699, yearsSince1600) / SecondsPerDay; - } - - // ephemeris-correction: correction to account for the slowing down of the rotation of the earth - private static double EphemerisCorrection(double time) - { - int year = GetGregorianYear(time); - foreach (EphemerisCorrectionAlgorithmMap map in s_ephemerisCorrectionTable) - { - if (map._lowestYear <= year) - { - switch (map._algorithm) - { - case CorrectionAlgorithm.Default: return DefaultEphemerisCorrection(year); - case CorrectionAlgorithm.Year1988to2019: return EphemerisCorrection1988to2019(year); - case CorrectionAlgorithm.Year1900to1987: return EphemerisCorrection1900to1987(year); - case CorrectionAlgorithm.Year1800to1899: return EphemerisCorrection1800to1899(year); - case CorrectionAlgorithm.Year1700to1799: return EphemerisCorrection1700to1799(year); - case CorrectionAlgorithm.Year1620to1699: return EphemerisCorrection1620to1699(year); - } - - break; // break the loop and assert eventually - } - } - - Debug.Assert(false, "Not expected to come here"); - return DefaultEphemerisCorrection(year); - } - - public static double JulianCenturies(double moment) - { - double dynamicalMoment = moment + EphemerisCorrection(moment); - return (dynamicalMoment - Noon2000Jan01) / DaysInUniformLengthCentury; - } - - private static bool IsNegative(double value) - { - return Math.Sign(value) == -1; - } - - private static double CopySign(double value, double sign) - { - return (IsNegative(value) == IsNegative(sign)) ? value : -value; - } - - // equation-of-time; approximate the difference between apparent solar time and mean solar time - // formal definition is EOT = GHA - GMHA - // GHA is the Greenwich Hour Angle of the apparent (actual) Sun - // GMHA is the Greenwich Mean Hour Angle of the mean (fictitious) Sun - // http://www.esrl.noaa.gov/gmd/grad/solcalc/ - // http://en.wikipedia.org/wiki/Equation_of_time - private static double EquationOfTime(double time) - { - double julianCenturies = JulianCenturies(time); - double lambda = PolynomialSum(s_lambdaCoefficients, julianCenturies); - double anomaly = PolynomialSum(s_anomalyCoefficients, julianCenturies); - double eccentricity = PolynomialSum(s_eccentricityCoefficients, julianCenturies); - - double epsilon = Obliquity(julianCenturies); - double tanHalfEpsilon = TanOfDegree(epsilon / 2); - double y = tanHalfEpsilon * tanHalfEpsilon; - - double dividend = ((y * SinOfDegree(2 * lambda)) - - (2 * eccentricity * SinOfDegree(anomaly)) - + (4 * eccentricity * y * SinOfDegree(anomaly) * CosOfDegree(2 * lambda)) - - (0.5 * Math.Pow(y, 2) * SinOfDegree(4 * lambda)) - - (1.25 * Math.Pow(eccentricity, 2) * SinOfDegree(2 * anomaly))); - double divisor = 2 * Math.PI; - double equation = dividend / divisor; - - // approximation of equation of time is not valid for dates that are many millennia in the past or future - // thus limited to a half day - return CopySign(Math.Min(Math.Abs(equation), TwelveHours), equation); - } - - private static double AsLocalTime(double apparentMidday, double longitude) - { - // slightly inaccurate since equation of time takes mean time not apparent time as its argument, but the difference is negligible - double universalTime = apparentMidday - AsDayFraction(longitude); - return apparentMidday - EquationOfTime(universalTime); - } - - // midday - public static double Midday(double date, double longitude) - { - return AsLocalTime(date + TwelveHours, longitude) - AsDayFraction(longitude); - } - - private static double InitLongitude(double longitude) - { - return NormalizeLongitude(longitude + HalfCircleOfArc) - HalfCircleOfArc; - } - - // midday-in-tehran - public static double MiddayAtPersianObservationSite(double date) - { - return Midday(date, InitLongitude(52.5)); // 52.5 degrees east - longitude of UTC+3:30 which defines Iranian Standard Time - } - - private static double PeriodicTerm(double julianCenturies, int x, double y, double z) - { - return x * SinOfDegree(y + z * julianCenturies); - } - - private static double SumLongSequenceOfPeriodicTerms(double julianCenturies) - { - double sum = 0.0; - sum += PeriodicTerm(julianCenturies, 403406, 270.54861, 0.9287892); - sum += PeriodicTerm(julianCenturies, 195207, 340.19128, 35999.1376958); - sum += PeriodicTerm(julianCenturies, 119433, 63.91854, 35999.4089666); - sum += PeriodicTerm(julianCenturies, 112392, 331.2622, 35998.7287385); - sum += PeriodicTerm(julianCenturies, 3891, 317.843, 71998.20261); - sum += PeriodicTerm(julianCenturies, 2819, 86.631, 71998.4403); - sum += PeriodicTerm(julianCenturies, 1721, 240.052, 36000.35726); - sum += PeriodicTerm(julianCenturies, 660, 310.26, 71997.4812); - sum += PeriodicTerm(julianCenturies, 350, 247.23, 32964.4678); - sum += PeriodicTerm(julianCenturies, 334, 260.87, -19.441); - sum += PeriodicTerm(julianCenturies, 314, 297.82, 445267.1117); - sum += PeriodicTerm(julianCenturies, 268, 343.14, 45036.884); - sum += PeriodicTerm(julianCenturies, 242, 166.79, 3.1008); - sum += PeriodicTerm(julianCenturies, 234, 81.53, 22518.4434); - sum += PeriodicTerm(julianCenturies, 158, 3.5, -19.9739); - sum += PeriodicTerm(julianCenturies, 132, 132.75, 65928.9345); - sum += PeriodicTerm(julianCenturies, 129, 182.95, 9038.0293); - sum += PeriodicTerm(julianCenturies, 114, 162.03, 3034.7684); - sum += PeriodicTerm(julianCenturies, 99, 29.8, 33718.148); - sum += PeriodicTerm(julianCenturies, 93, 266.4, 3034.448); - sum += PeriodicTerm(julianCenturies, 86, 249.2, -2280.773); - sum += PeriodicTerm(julianCenturies, 78, 157.6, 29929.992); - sum += PeriodicTerm(julianCenturies, 72, 257.8, 31556.493); - sum += PeriodicTerm(julianCenturies, 68, 185.1, 149.588); - sum += PeriodicTerm(julianCenturies, 64, 69.9, 9037.75); - sum += PeriodicTerm(julianCenturies, 46, 8.0, 107997.405); - sum += PeriodicTerm(julianCenturies, 38, 197.1, -4444.176); - sum += PeriodicTerm(julianCenturies, 37, 250.4, 151.771); - sum += PeriodicTerm(julianCenturies, 32, 65.3, 67555.316); - sum += PeriodicTerm(julianCenturies, 29, 162.7, 31556.08); - sum += PeriodicTerm(julianCenturies, 28, 341.5, -4561.54); - sum += PeriodicTerm(julianCenturies, 27, 291.6, 107996.706); - sum += PeriodicTerm(julianCenturies, 27, 98.5, 1221.655); - sum += PeriodicTerm(julianCenturies, 25, 146.7, 62894.167); - sum += PeriodicTerm(julianCenturies, 24, 110.0, 31437.369); - sum += PeriodicTerm(julianCenturies, 21, 5.2, 14578.298); - sum += PeriodicTerm(julianCenturies, 21, 342.6, -31931.757); - sum += PeriodicTerm(julianCenturies, 20, 230.9, 34777.243); - sum += PeriodicTerm(julianCenturies, 18, 256.1, 1221.999); - sum += PeriodicTerm(julianCenturies, 17, 45.3, 62894.511); - sum += PeriodicTerm(julianCenturies, 14, 242.9, -4442.039); - sum += PeriodicTerm(julianCenturies, 13, 115.2, 107997.909); - sum += PeriodicTerm(julianCenturies, 13, 151.8, 119.066); - sum += PeriodicTerm(julianCenturies, 13, 285.3, 16859.071); - sum += PeriodicTerm(julianCenturies, 12, 53.3, -4.578); - sum += PeriodicTerm(julianCenturies, 10, 126.6, 26895.292); - sum += PeriodicTerm(julianCenturies, 10, 205.7, -39.127); - sum += PeriodicTerm(julianCenturies, 10, 85.9, 12297.536); - sum += PeriodicTerm(julianCenturies, 10, 146.1, 90073.778); - return sum; - } - - private static double Aberration(double julianCenturies) - { - return (0.0000974 * CosOfDegree(177.63 + (35999.01848 * julianCenturies))) - 0.005575; - } - - private static double Nutation(double julianCenturies) - { - double a = PolynomialSum(s_coefficientsA, julianCenturies); - double b = PolynomialSum(s_coefficientsB, julianCenturies); - return (-0.004778 * SinOfDegree(a)) - (0.0003667 * SinOfDegree(b)); - } - - public static double Compute(double time) - { - double julianCenturies = JulianCenturies(time); - double lambda = 282.7771834 - + (36000.76953744 * julianCenturies) - + (0.000005729577951308232 * SumLongSequenceOfPeriodicTerms(julianCenturies)); - - double longitude = lambda + Aberration(julianCenturies) + Nutation(julianCenturies); - return InitLongitude(longitude); - } - - public static double AsSeason(double longitude) - { - return (longitude < 0) ? (longitude + FullCircleOfArc) : longitude; - } - - private static double EstimatePrior(double longitude, double time) - { - double timeSunLastAtLongitude = time - (MeanSpeedOfSun * AsSeason(InitLongitude(Compute(time) - longitude))); - double longitudeErrorDelta = InitLongitude(Compute(timeSunLastAtLongitude) - longitude); - return Math.Min(time, timeSunLastAtLongitude - (MeanSpeedOfSun * longitudeErrorDelta)); - } - - // persian-new-year-on-or-before - // number of days is the absolute date. The absolute date is the number of days from January 1st, 1 A.D. - // 1/1/0001 is absolute date 1. - internal static long PersianNewYearOnOrBefore(long numberOfDays) - { - double date = (double)numberOfDays; - - double approx = EstimatePrior(LongitudeSpring, MiddayAtPersianObservationSite(date)); - long lowerBoundNewYearDay = (long)Math.Floor(approx) - 1; - long upperBoundNewYearDay = lowerBoundNewYearDay + 3; // estimate is generally within a day of the actual occurrance (at the limits, the error expands, since the calculations rely on the mean tropical year which changes...) - long day = lowerBoundNewYearDay; - for (; day != upperBoundNewYearDay; ++day) - { - double midday = MiddayAtPersianObservationSite((double)day); - double l = Compute(midday); - if ((LongitudeSpring <= l) && (l <= TwoDegreesAfterSpring)) - { - break; - } - } - Debug.Assert(day != upperBoundNewYearDay); - - return day - 1; - } - } -} diff --git a/src/mscorlib/corefx/System/Globalization/CharUnicodeInfo.cs b/src/mscorlib/corefx/System/Globalization/CharUnicodeInfo.cs deleted file mode 100644 index 38ce441a78..0000000000 --- a/src/mscorlib/corefx/System/Globalization/CharUnicodeInfo.cs +++ /dev/null @@ -1,391 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -//////////////////////////////////////////////////////////////////////////// -// -// -// Purpose: This class implements a set of methods for retrieving -// character type information. Character type information is -// independent of culture and region. -// -// -//////////////////////////////////////////////////////////////////////////// - -using System.Diagnostics; -using System.Diagnostics.Contracts; - -namespace System.Globalization -{ - public static partial class CharUnicodeInfo - { - //--------------------------------------------------------------------// - // Internal Information // - //--------------------------------------------------------------------// - - // - // Native methods to access the Unicode category data tables in charinfo.nlp. - // - internal const char HIGH_SURROGATE_START = '\ud800'; - internal const char HIGH_SURROGATE_END = '\udbff'; - internal const char LOW_SURROGATE_START = '\udc00'; - internal const char LOW_SURROGATE_END = '\udfff'; - - internal const int UNICODE_CATEGORY_OFFSET = 0; - internal const int BIDI_CATEGORY_OFFSET = 1; - - - - // The starting codepoint for Unicode plane 1. Plane 1 contains 0x010000 ~ 0x01ffff. - internal const int UNICODE_PLANE01_START = 0x10000; - - - //////////////////////////////////////////////////////////////////////// - // - // Actions: - // Convert the BMP character or surrogate pointed by index to a UTF32 value. - // This is similar to Char.ConvertToUTF32, but the difference is that - // it does not throw exceptions when invalid surrogate characters are passed in. - // - // WARNING: since it doesn't throw an exception it CAN return a value - // in the surrogate range D800-DFFF, which are not legal unicode values. - // - //////////////////////////////////////////////////////////////////////// - - internal static int InternalConvertToUtf32(String s, int index) - { - Debug.Assert(s != null, "s != null"); - Debug.Assert(index >= 0 && index < s.Length, "index < s.Length"); - if (index < s.Length - 1) - { - int temp1 = (int)s[index] - HIGH_SURROGATE_START; - if (temp1 >= 0 && temp1 <= 0x3ff) - { - int temp2 = (int)s[index + 1] - LOW_SURROGATE_START; - if (temp2 >= 0 && temp2 <= 0x3ff) - { - // Convert the surrogate to UTF32 and get the result. - return ((temp1 * 0x400) + temp2 + UNICODE_PLANE01_START); - } - } - } - return ((int)s[index]); - } - //////////////////////////////////////////////////////////////////////// - // - // Convert a character or a surrogate pair starting at index of string s - // to UTF32 value. - // - // Parameters: - // s The string - // index The starting index. It can point to a BMP character or - // a surrogate pair. - // len The length of the string. - // charLength [out] If the index points to a BMP char, charLength - // will be 1. If the index points to a surrogate pair, - // charLength will be 2. - // - // WARNING: since it doesn't throw an exception it CAN return a value - // in the surrogate range D800-DFFF, which are not legal unicode values. - // - // Returns: - // The UTF32 value - // - //////////////////////////////////////////////////////////////////////// - - internal static int InternalConvertToUtf32(String s, int index, out int charLength) - { - Debug.Assert(s != null, "s != null"); - Debug.Assert(s.Length > 0, "s.Length > 0"); - Debug.Assert(index >= 0 && index < s.Length, "index >= 0 && index < s.Length"); - charLength = 1; - if (index < s.Length - 1) - { - int temp1 = (int)s[index] - HIGH_SURROGATE_START; - if (temp1 >= 0 && temp1 <= 0x3ff) - { - int temp2 = (int)s[index + 1] - LOW_SURROGATE_START; - if (temp2 >= 0 && temp2 <= 0x3ff) - { - // Convert the surrogate to UTF32 and get the result. - charLength++; - return ((temp1 * 0x400) + temp2 + UNICODE_PLANE01_START); - } - } - } - return ((int)s[index]); - } - - //////////////////////////////////////////////////////////////////////// - // - // IsWhiteSpace - // - // Determines if the given character is a white space character. - // - //////////////////////////////////////////////////////////////////////// - - internal static bool IsWhiteSpace(String s, int index) - { - Debug.Assert(s != null, "s!=null"); - Debug.Assert(index >= 0 && index < s.Length, "index >= 0 && index < s.Length"); - - UnicodeCategory uc = GetUnicodeCategory(s, index); - // In Unicode 3.0, U+2028 is the only character which is under the category "LineSeparator". - // And U+2029 is th eonly character which is under the category "ParagraphSeparator". - switch (uc) - { - case (UnicodeCategory.SpaceSeparator): - case (UnicodeCategory.LineSeparator): - case (UnicodeCategory.ParagraphSeparator): - return (true); - } - return (false); - } - - - internal static bool IsWhiteSpace(char c) - { - UnicodeCategory uc = GetUnicodeCategory(c); - // In Unicode 3.0, U+2028 is the only character which is under the category "LineSeparator". - // And U+2029 is th eonly character which is under the category "ParagraphSeparator". - switch (uc) - { - case (UnicodeCategory.SpaceSeparator): - case (UnicodeCategory.LineSeparator): - case (UnicodeCategory.ParagraphSeparator): - return (true); - } - - return (false); - } - - - // - // This is called by the public char and string, index versions - // - // Note that for ch in the range D800-DFFF we just treat it as any other non-numeric character - // - internal static unsafe double InternalGetNumericValue(int ch) - { - Debug.Assert(ch >= 0 && ch <= 0x10ffff, "ch is not in valid Unicode range."); - // Get the level 2 item from the highest 12 bit (8 - 19) of ch. - ushort index = s_pNumericLevel1Index[ch >> 8]; - // Get the level 2 WORD offset from the 4 - 7 bit of ch. This provides the base offset of the level 3 table. - // The offset is referred to an float item in m_pNumericFloatData. - // Note that & has the lower precedence than addition, so don't forget the parathesis. - index = s_pNumericLevel1Index[index + ((ch >> 4) & 0x000f)]; - - fixed (ushort* pUshortPtr = &(s_pNumericLevel1Index[index])) - { - byte* pBytePtr = (byte*)pUshortPtr; - fixed (byte* pByteNum = s_pNumericValues) - { - double* pDouble = (double*)pByteNum; - return pDouble[pBytePtr[(ch & 0x000f)]]; - } - } - } - - internal static unsafe ushort InternalGetDigitValues(int ch) - { - Debug.Assert(ch >= 0 && ch <= 0x10ffff, "ch is not in valid Unicode range."); - // Get the level 2 item from the highest 12 bit (8 - 19) of ch. - ushort index = s_pNumericLevel1Index[ch >> 8]; - // Get the level 2 WORD offset from the 4 - 7 bit of ch. This provides the base offset of the level 3 table. - // Note that & has the lower precedence than addition, so don't forget the parathesis. - index = s_pNumericLevel1Index[index + ((ch >> 4) & 0x000f)]; - - fixed (ushort* pUshortPtr = &(s_pNumericLevel1Index[index])) - { - byte* pBytePtr = (byte*)pUshortPtr; - return s_pDigitValues[pBytePtr[(ch & 0x000f)]]; - } - } - - //////////////////////////////////////////////////////////////////////// - // - //Returns the numeric value associated with the character c. If the character is a fraction, - // the return value will not be an integer. If the character does not have a numeric value, the return value is -1. - // - //Returns: - // the numeric value for the specified Unicode character. If the character does not have a numeric value, the return value is -1. - //Arguments: - // ch a Unicode character - //Exceptions: - // ArgumentNullException - // ArgumentOutOfRangeException - // - //////////////////////////////////////////////////////////////////////// - - - public static double GetNumericValue(char ch) - { - return (InternalGetNumericValue(ch)); - } - - - public static double GetNumericValue(String s, int index) - { - if (s == null) - { - throw new ArgumentNullException(nameof(s)); - } - if (index < 0 || index >= s.Length) - { - throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index); - } - Contract.EndContractBlock(); - return (InternalGetNumericValue(InternalConvertToUtf32(s, index))); - } - - public static int GetDecimalDigitValue(char ch) - { - return (sbyte)(InternalGetDigitValues(ch) >> 8); - } - - public static int GetDecimalDigitValue(String s, int index) - { - if (s == null) - { - throw new ArgumentNullException(nameof(s)); - } - - if (index < 0 || index >= s.Length) - { - throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index); - } - Contract.EndContractBlock(); - - return (sbyte)(InternalGetDigitValues(InternalConvertToUtf32(s, index)) >> 8); - } - - public static int GetDigitValue(char ch) - { - return (sbyte)(InternalGetDigitValues(ch) & 0x00FF); - } - - public static int GetDigitValue(String s, int index) - { - if (s == null) - { - throw new ArgumentNullException(nameof(s)); - } - - if (index < 0 || index >= s.Length) - { - throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index); - } - - Contract.EndContractBlock(); - return (sbyte)(InternalGetDigitValues(InternalConvertToUtf32(s, index)) & 0x00FF); - } - - public static UnicodeCategory GetUnicodeCategory(char ch) - { - return (InternalGetUnicodeCategory(ch)); - } - - public static UnicodeCategory GetUnicodeCategory(String s, int index) - { - if (s == null) - throw new ArgumentNullException(nameof(s)); - if (((uint)index) >= ((uint)s.Length)) - { - throw new ArgumentOutOfRangeException(nameof(index)); - } - Contract.EndContractBlock(); - return InternalGetUnicodeCategory(s, index); - } - - internal static unsafe UnicodeCategory InternalGetUnicodeCategory(int ch) - { - return ((UnicodeCategory)InternalGetCategoryValue(ch, UNICODE_CATEGORY_OFFSET)); - } - - - //////////////////////////////////////////////////////////////////////// - // - //Action: Returns the Unicode Category property for the character c. - //Returns: - // an value in UnicodeCategory enum - //Arguments: - // ch a Unicode character - //Exceptions: - // None - // - //Note that this API will return values for D800-DF00 surrogate halves. - // - //////////////////////////////////////////////////////////////////////// - - internal static unsafe byte InternalGetCategoryValue(int ch, int offset) - { - Debug.Assert(ch >= 0 && ch <= 0x10ffff, "ch is not in valid Unicode range."); - // Get the level 2 item from the highest 12 bit (8 - 19) of ch. - ushort index = s_pCategoryLevel1Index[ch >> 8]; - // Get the level 2 WORD offset from the 4 - 7 bit of ch. This provides the base offset of the level 3 table. - // Note that & has the lower precedence than addition, so don't forget the parathesis. - index = s_pCategoryLevel1Index[index + ((ch >> 4) & 0x000f)]; - - fixed (ushort* pUshortPtr = &(s_pCategoryLevel1Index[index])) - { - byte* pBytePtr = (byte*)pUshortPtr; - // Get the result from the 0 -3 bit of ch. - byte valueIndex = pBytePtr[(ch & 0x000f)]; - byte uc = s_pCategoriesValue[valueIndex * 2 + offset]; - // - // Make sure that OtherNotAssigned is the last category in UnicodeCategory. - // If that changes, change the following assertion as well. - // - //Debug.Assert(uc >= 0 && uc <= UnicodeCategory.OtherNotAssigned, "Table returns incorrect Unicode category"); - return (uc); - } - } - - //////////////////////////////////////////////////////////////////////// - // - //Action: Returns the Unicode Category property for the character c. - //Returns: - // an value in UnicodeCategory enum - //Arguments: - // value a Unicode String - // index Index for the specified string. - //Exceptions: - // None - // - //////////////////////////////////////////////////////////////////////// - - internal static UnicodeCategory InternalGetUnicodeCategory(String value, int index) - { - Debug.Assert(value != null, "value can not be null"); - Debug.Assert(index < value.Length, "index < value.Length"); - - return (InternalGetUnicodeCategory(InternalConvertToUtf32(value, index))); - } - - //////////////////////////////////////////////////////////////////////// - // - // Get the Unicode category of the character starting at index. If the character is in BMP, charLength will return 1. - // If the character is a valid surrogate pair, charLength will return 2. - // - //////////////////////////////////////////////////////////////////////// - - internal static UnicodeCategory InternalGetUnicodeCategory(String str, int index, out int charLength) - { - Debug.Assert(str != null, "str can not be null"); - Debug.Assert(str.Length > 0, "str.Length > 0"); ; - Debug.Assert(index >= 0 && index < str.Length, "index >= 0 && index < str.Length"); - - return (InternalGetUnicodeCategory(InternalConvertToUtf32(str, index, out charLength))); - } - - internal static bool IsCombiningCategory(UnicodeCategory uc) - { - Debug.Assert(uc >= 0, "uc >= 0"); - return ( - uc == UnicodeCategory.NonSpacingMark || - uc == UnicodeCategory.SpacingCombiningMark || - uc == UnicodeCategory.EnclosingMark - ); - } - } -} diff --git a/src/mscorlib/corefx/System/Globalization/CharUnicodeInfoData.cs b/src/mscorlib/corefx/System/Globalization/CharUnicodeInfoData.cs deleted file mode 100644 index b1bef8146e..0000000000 --- a/src/mscorlib/corefx/System/Globalization/CharUnicodeInfoData.cs +++ /dev/null @@ -1,1247 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; - -namespace System.Globalization -{ - public static partial class CharUnicodeInfo - { - // THE FOLLOWING DATA IS AUTO GENERATED BY GenUnicodeProp.pl SCRIPT UNDER THE TOOLS FOLDER - // PLEASE DON'T MODIFY BY HAND - - - // 12:4:4 index table of the Unicode cateogry data. - private static ushort[] s_pCategoryLevel1Index = new ushort[] - { - 0x1100, 0x1110, 0x1120, 0x1130, 0x1140, 0x1150, 0x1160, 0x1170, 0x1180, 0x1190, 0x11a0, 0x11b0, 0x11c0, 0x11d0, 0x11e0, 0x11f0, - 0x1200, 0x1210, 0x1220, 0x1230, 0x1240, 0x1210, 0x1250, 0x1260, 0x1270, 0x1280, 0x1290, 0x12a0, 0x12b0, 0x12c0, 0x12d0, 0x12e0, - 0x12f0, 0x1300, 0x1310, 0x1320, 0x1330, 0x1340, 0x1350, 0x1360, 0x1370, 0x1380, 0x1390, 0x13a0, 0x13b0, 0x13c0, 0x13d0, 0x13e0, - 0x13f0, 0x1400, 0x1410, 0x1420, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1430, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1440, - 0x1450, 0x1210, 0x1210, 0x1210, 0x1460, 0x1210, 0x1470, 0x1480, 0x1490, 0x14a0, 0x14b0, 0x14c0, 0x1210, 0x1210, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x14d0, 0x14e0, 0x14e0, 0x14e0, 0x14e0, 0x14e0, 0x14e0, 0x14e0, 0x14e0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x1210, 0x1500, 0x1510, 0x1520, 0x1530, 0x1540, 0x1550, - 0x1560, 0x1570, 0x1580, 0x1590, 0x15a0, 0x15b0, 0x1210, 0x15c0, 0x15d0, 0x15e0, 0x15f0, 0x1600, 0x1610, 0x1620, 0x1630, 0x1620, - 0x1640, 0x1650, 0x1660, 0x1670, 0x1680, 0x1690, 0x16a0, 0x16b0, 0x16c0, 0x1620, 0x16d0, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1210, 0x1210, 0x1210, 0x16e0, 0x16f0, 0x1700, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1710, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1210, 0x1210, 0x1720, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1210, 0x1210, 0x1730, 0x1740, 0x1620, 0x1620, 0x1620, 0x1750, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1760, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1770, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1780, 0x1790, 0x17a0, 0x17b0, 0x17c0, 0x17d0, 0x17e0, 0x17f0, 0x1370, 0x1370, 0x1800, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1810, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1820, 0x1620, - 0x1830, 0x1840, 0x1850, 0x1860, 0x1870, 0x1880, 0x1890, 0x18a0, 0x18b0, 0x18c0, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x18d0, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x18e0, 0x18f0, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, - 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1210, 0x1900, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1210, 0x1210, 0x1910, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1920, 0x1930, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, 0x1620, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x1940, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, - 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x14f0, 0x1940, - 0x1950, 0x1958, 0x1960, 0x1968, 0x1970, 0x1978, 0x1980, 0x1988, 0x1990, 0x1998, 0x19a0, 0x19a8, 0x19b0, 0x19b8, 0x19c0, 0x19c8, - 0x19d0, 0x19d0, 0x19d0, 0x19d8, 0x19e0, 0x19d0, 0x19d0, 0x19e8, 0x19f0, 0x19f8, 0x1a00, 0x1a08, 0x1a10, 0x1a18, 0x19d0, 0x1a20, - 0x19d0, 0x19d0, 0x19d0, 0x1a28, 0x1a30, 0x19c0, 0x19c0, 0x19c0, 0x19c0, 0x1a38, 0x19c0, 0x1a40, 0x1a48, 0x1a50, 0x1a58, 0x1a60, - 0x1a68, 0x1a68, 0x1a68, 0x1a68, 0x1a68, 0x1a68, 0x1a68, 0x1a70, 0x1a78, 0x1a80, 0x1a88, 0x19c0, 0x1a90, 0x1a98, 0x19d0, 0x1aa0, - 0x19b0, 0x19b0, 0x19b0, 0x19c0, 0x19c0, 0x19c0, 0x19d0, 0x19d0, 0x1aa8, 0x19d0, 0x19d0, 0x19d0, 0x1ab0, 0x19d0, 0x19d0, 0x19d0, - 0x19d0, 0x19d0, 0x19d0, 0x1ab8, 0x19b0, 0x1ac0, 0x1ac8, 0x19c0, 0x1ad0, 0x1ad8, 0x1a68, 0x1ae0, 0x1ae8, 0x1af0, 0x1af8, 0x1b00, - 0x1b08, 0x1b10, 0x1b18, 0x1b18, 0x1b20, 0x1a68, 0x1b28, 0x1b30, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b38, 0x1b40, 0x1b48, - 0x1b50, 0x1b58, 0x1b18, 0x1a68, 0x1b60, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b68, 0x1b70, 0x1b78, 0x1af0, 0x1b80, 0x1b88, - 0x1af0, 0x1b90, 0x1b98, 0x1ba0, 0x1af0, 0x1ba8, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1b18, 0x1bb8, 0x1bb0, 0x1bb0, 0x1bc0, 0x1a68, - 0x1bc8, 0x1bd0, 0x1bd0, 0x1bd8, 0x1be0, 0x1be8, 0x1bf0, 0x1bf8, 0x1c00, 0x1c08, 0x1c10, 0x1c18, 0x1c20, 0x1c28, 0x1c30, 0x1c38, - 0x1c40, 0x1c08, 0x1c10, 0x1c48, 0x1c50, 0x1c58, 0x1c60, 0x1c68, 0x1c70, 0x1c78, 0x1c10, 0x1c80, 0x1c88, 0x1c90, 0x1c30, 0x1c98, - 0x1ca0, 0x1c08, 0x1c10, 0x1ca8, 0x1cb0, 0x1cb8, 0x1c30, 0x1cc0, 0x1cc8, 0x1cd0, 0x1cd8, 0x1ce0, 0x1ce8, 0x1cf0, 0x1c60, 0x1cf8, - 0x1d00, 0x1d08, 0x1c10, 0x1d10, 0x1d18, 0x1d20, 0x1c30, 0x1d28, 0x1d30, 0x1d08, 0x1c10, 0x1d38, 0x1d40, 0x1d48, 0x1c30, 0x1d50, - 0x1d30, 0x1d08, 0x1bd0, 0x1d58, 0x1d60, 0x1d68, 0x1c30, 0x1d70, 0x1d78, 0x1d80, 0x1bd0, 0x1d88, 0x1d90, 0x1d98, 0x1c60, 0x1da0, - 0x1da8, 0x1bd0, 0x1bd0, 0x1db0, 0x1db8, 0x1dc0, 0x1bb0, 0x1bb0, 0x1dc8, 0x1dd0, 0x1dd8, 0x1de0, 0x1de8, 0x1df0, 0x1bb0, 0x1bb0, - 0x1df8, 0x1e00, 0x1e08, 0x1e10, 0x1e18, 0x1bd0, 0x1e20, 0x1e28, 0x1e30, 0x1e38, 0x1a68, 0x1e40, 0x1e48, 0x1e50, 0x1bb0, 0x1bb0, - 0x1bd0, 0x1bd0, 0x1e58, 0x1e60, 0x1e68, 0x1e70, 0x1e78, 0x1e80, 0x1e88, 0x1e90, 0x19b0, 0x19b0, 0x1e98, 0x1bd0, 0x1bd0, 0x1ea0, - 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, - 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1ea8, 0x1eb0, 0x1bd0, 0x1bd0, 0x1ea8, 0x1bd0, 0x1bd0, 0x1eb8, 0x1ec0, 0x1ec8, 0x1bd0, 0x1bd0, - 0x1bd0, 0x1ec0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1ed0, 0x1ed8, 0x1ee0, 0x1bd0, 0x1ee8, 0x19b0, 0x19b0, 0x19b0, 0x19b0, 0x19b0, 0x1ef0, - 0x1ef8, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, - 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1f00, 0x1bd0, 0x1f08, 0x1f10, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1f18, 0x1f20, - 0x1f28, 0x1f30, 0x1bd0, 0x1f38, 0x1bd0, 0x1f40, 0x1f28, 0x1f48, 0x1bd0, 0x1bd0, 0x1bd0, 0x1f50, 0x1f58, 0x1f60, 0x1f68, 0x1f70, - 0x1f78, 0x1f68, 0x1bd0, 0x1bd0, 0x1f80, 0x1bd0, 0x1bd0, 0x1f88, 0x1bd0, 0x1bd0, 0x1f90, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1f98, - 0x1bd0, 0x1fa0, 0x1fa8, 0x1fb0, 0x1fb8, 0x1bd0, 0x1fc0, 0x1fc8, 0x1bd0, 0x1bd0, 0x1fd0, 0x1bd0, 0x1fd8, 0x1fe0, 0x1fe8, 0x1fe8, - 0x1bd0, 0x1ff0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1ff8, 0x2000, 0x2008, 0x1f68, 0x1f68, 0x2010, 0x2018, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x2020, 0x1bd0, 0x1bd0, 0x2028, 0x2030, 0x1e68, 0x2038, 0x2040, 0x2048, 0x1bd0, 0x2050, 0x2058, 0x1bd0, 0x1bd0, 0x2060, 0x2068, - 0x1bd0, 0x1bd0, 0x2070, 0x2078, 0x2080, 0x2058, 0x1bd0, 0x2088, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x2090, 0x2098, 0x20a0, 0x20a8, - 0x19c0, 0x19c0, 0x20b0, 0x20b8, 0x20b8, 0x20b8, 0x20c0, 0x20c8, 0x19c0, 0x20d0, 0x20b8, 0x20b8, 0x1a68, 0x1a68, 0x1a68, 0x20d8, - 0x19d0, 0x19d0, 0x19d0, 0x19d0, 0x19d0, 0x19d0, 0x19d0, 0x19d0, 0x19d0, 0x20e0, 0x19d0, 0x19d0, 0x19d0, 0x19d0, 0x19d0, 0x19d0, - 0x20e8, 0x20f0, 0x20e8, 0x20e8, 0x20f0, 0x20f8, 0x20e8, 0x2100, 0x2108, 0x2108, 0x2108, 0x2110, 0x2118, 0x2120, 0x2128, 0x2130, - 0x2138, 0x2140, 0x2148, 0x2150, 0x2158, 0x2160, 0x2168, 0x2170, 0x2178, 0x2180, 0x2188, 0x2190, 0x1bb0, 0x2198, 0x21a0, 0x21a8, - 0x21b0, 0x21b8, 0x21c0, 0x21c8, 0x21d0, 0x21d8, 0x21e0, 0x21e0, 0x21e8, 0x21f0, 0x21f8, 0x1fe8, 0x2200, 0x2208, 0x1fe8, 0x2210, - 0x2218, 0x2220, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, - 0x2228, 0x1fe8, 0x2230, 0x2238, 0x2240, 0x2240, 0x2240, 0x2248, 0x1fe8, 0x2250, 0x2218, 0x2258, 0x1fe8, 0x2260, 0x2268, 0x2270, - 0x1fe8, 0x1fe8, 0x2278, 0x1bb0, 0x2270, 0x1bb0, 0x21d8, 0x21d8, 0x2280, 0x2288, 0x2240, 0x2240, 0x2240, 0x2240, 0x2290, 0x21d8, - 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x2298, 0x22a0, 0x1fe8, 0x1fe8, 0x22a8, - 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x22b0, 0x1fe8, 0x1fe8, 0x1fe8, 0x22b8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, - 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x22c0, 0x22c8, 0x21d8, 0x22d0, 0x1fe8, 0x1fe8, 0x22d8, 0x2218, 0x22e0, 0x2218, - 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, - 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x22e8, 0x22f0, 0x2218, 0x2218, 0x2218, 0x22f8, 0x2218, 0x2300, - 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, 0x2218, - 0x1fe8, 0x1fe8, 0x1fe8, 0x2218, 0x2308, 0x1fe8, 0x1fe8, 0x2310, 0x1fe8, 0x2318, 0x1fe8, 0x2320, 0x2328, 0x2330, 0x2338, 0x1bb0, - 0x19b0, 0x19b0, 0x2340, 0x19c0, 0x19c0, 0x2348, 0x2350, 0x2358, 0x19d0, 0x19d0, 0x19d0, 0x19d0, 0x19d0, 0x19d0, 0x2360, 0x2368, - 0x19c0, 0x19c0, 0x2370, 0x1bd0, 0x1bd0, 0x1bd0, 0x2378, 0x2380, 0x1bd0, 0x2388, 0x2390, 0x2390, 0x2390, 0x2390, 0x1a68, 0x1a68, - 0x2398, 0x23a0, 0x23a8, 0x23b0, 0x23b8, 0x1bb0, 0x1bb0, 0x1bb0, 0x1fe8, 0x23c0, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x23c8, - 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x23d0, 0x1bb0, 0x23d8, - 0x23e0, 0x23e8, 0x23f0, 0x23f8, 0x1da8, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x2400, 0x1ef8, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x2408, - 0x2410, 0x1bd0, 0x1fc0, 0x1da8, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1fa0, 0x2418, 0x1bd0, 0x2420, 0x1fe8, 0x1fe8, 0x23c8, 0x1bd0, - 0x2240, 0x2428, 0x2430, 0x2240, 0x2438, 0x2440, 0x2240, 0x2448, 0x2430, 0x2240, 0x2240, 0x2450, 0x2458, 0x2240, 0x2240, 0x2460, - 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2468, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2470, 0x2240, 0x2478, - 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1f98, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, - 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1f98, 0x1bb0, 0x1bb0, - 0x1bd0, 0x2480, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, - 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1e20, 0x1fe8, 0x1fe8, 0x1fe8, 0x2278, 0x1bd0, 0x1bd0, 0x2088, - 0x2488, 0x1bd0, 0x2490, 0x1bb0, 0x19d0, 0x19d0, 0x2498, 0x24a0, 0x19d0, 0x24a8, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x24b0, 0x24b8, - 0x1a60, 0x24c0, 0x24c8, 0x24d0, 0x19d0, 0x19d0, 0x19d0, 0x24d8, 0x24e0, 0x24e8, 0x24f0, 0x24f8, 0x1bb0, 0x1bb0, 0x1bb0, 0x2500, - 0x2508, 0x1bd0, 0x2510, 0x2518, 0x1bd0, 0x1bd0, 0x1bd0, 0x2520, 0x2528, 0x1bd0, 0x1bd0, 0x2530, 0x2538, 0x1f68, 0x1a68, 0x2540, - 0x2058, 0x1bd0, 0x2548, 0x1bd0, 0x2550, 0x2558, 0x1bd0, 0x1e20, 0x1bc8, 0x1bd0, 0x1bd0, 0x2560, 0x2568, 0x2570, 0x2578, 0x2580, - 0x1bd0, 0x1bd0, 0x2588, 0x2590, 0x2598, 0x25a0, 0x1bd0, 0x25a8, 0x1bd0, 0x1bd0, 0x1bd0, 0x25b0, 0x25b8, 0x25c0, 0x25c8, 0x25d0, - 0x25d8, 0x25e0, 0x2390, 0x19c0, 0x19c0, 0x25e8, 0x25f0, 0x19c0, 0x19c0, 0x19c0, 0x19c0, 0x19c0, 0x1bd0, 0x1bd0, 0x25f8, 0x1f68, - 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x2600, 0x1bd0, 0x2608, 0x1bd0, 0x1bd0, 0x1fd0, - 0x2610, 0x2610, 0x2610, 0x2610, 0x2610, 0x2610, 0x2610, 0x2610, 0x2610, 0x2610, 0x2610, 0x2610, 0x2610, 0x2610, 0x2610, 0x2610, - 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, - 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1fc0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1fd8, 0x1bb0, 0x1bb0, - 0x2620, 0x2628, 0x2630, 0x2638, 0x2640, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x2648, 0x2650, 0x2658, 0x1b18, 0x1b18, - 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b18, - 0x1b18, 0x1b18, 0x1b18, 0x2660, 0x1bb0, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x2668, 0x1b18, 0x1b18, 0x2670, 0x1bb0, 0x1bb0, 0x2678, - 0x1a68, 0x2680, 0x1a68, 0x2688, 0x2690, 0x2698, 0x26a0, 0x26a8, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x1b18, 0x26b0, - 0x26b8, 0x1968, 0x1970, 0x1978, 0x1980, 0x26c0, 0x26c8, 0x26d0, 0x1bd0, 0x26d8, 0x1bd0, 0x1fa0, 0x26e0, 0x26e8, 0x26f0, 0x26f8, - 0x2700, 0x1bd0, 0x1ec8, 0x2708, 0x1fc0, 0x1fc0, 0x1bb0, 0x1bb0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x2420, - 0x2710, 0x2718, 0x2718, 0x2720, 0x2728, 0x2728, 0x2728, 0x2730, 0x2738, 0x23d8, 0x2740, 0x1bb0, 0x1bb0, 0x2240, 0x2240, 0x2748, - 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bd0, 0x1e20, 0x1bd0, 0x1bd0, 0x1bd0, 0x1c90, 0x2750, 0x2758, - 0x1bd0, 0x1bd0, 0x2760, 0x1bd0, 0x2768, 0x1bd0, 0x1bd0, 0x2770, 0x1bd0, 0x2778, 0x1bd0, 0x1bd0, 0x2780, 0x2788, 0x1bb0, 0x1bb0, - 0x19b0, 0x19b0, 0x2790, 0x19c0, 0x19c0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1fc0, 0x1f68, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x1bd0, 0x1bd0, 0x1f88, 0x1bd0, 0x1bd0, 0x1bd0, 0x2798, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x1bd0, 0x1bd0, 0x1bd0, 0x2388, 0x1bd0, 0x1f98, 0x1f88, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x27a0, 0x1af0, 0x1af0, 0x27a8, 0x1af0, 0x27b0, 0x1af0, 0x27b8, 0x1af0, 0x27c0, 0x27c8, 0x1bb0, 0x1bb0, 0x1bb0, 0x1af0, 0x27d0, - 0x1af0, 0x27d8, 0x1af0, 0x27e0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1af0, 0x1af0, 0x1af0, 0x27e8, 0x27f0, 0x27f8, 0x27f0, 0x27f0, - 0x2800, 0x2808, 0x1af0, 0x2810, 0x2818, 0x2820, 0x1af0, 0x2828, 0x1af0, 0x2830, 0x1bb0, 0x1bb0, 0x2838, 0x1af0, 0x2840, 0x2848, - 0x1af0, 0x1af0, 0x1af0, 0x2850, 0x1af0, 0x2858, 0x1af0, 0x2860, 0x1af0, 0x2868, 0x2870, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x1af0, 0x1af0, 0x1af0, 0x1af0, 0x2878, 0x1bb0, 0x1bb0, 0x1bb0, 0x2880, 0x2880, 0x2880, 0x2888, 0x2890, 0x2890, 0x2890, 0x2898, - 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x28a0, 0x28a8, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x28b0, 0x1bd0, 0x1bd0, 0x28b8, 0x28c0, 0x28c8, 0x28d0, 0x28d8, 0x2048, 0x1bd0, 0x1bd0, 0x28e0, 0x28e8, 0x1bd0, 0x28f0, 0x1f68, - 0x28f8, 0x1bd0, 0x2900, 0x2908, 0x2910, 0x1bd0, 0x1bd0, 0x2918, 0x2048, 0x1bd0, 0x1bd0, 0x2920, 0x2928, 0x2930, 0x2938, 0x2940, - 0x1bd0, 0x1c78, 0x2948, 0x2950, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x2958, 0x2960, 0x2968, 0x1bd0, 0x1bd0, 0x2970, 0x2978, 0x1f68, - 0x2980, 0x1c08, 0x1c10, 0x1c80, 0x2988, 0x2990, 0x2998, 0x29a0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bd0, 0x1bd0, 0x1bd0, 0x29a8, 0x29b0, 0x1f68, 0x1bb0, 0x1bb0, - 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bd0, 0x1bd0, 0x29b8, 0x29c0, 0x29c8, 0x29d0, 0x1bb0, 0x1bb0, - 0x1bd0, 0x1bd0, 0x1bd0, 0x29d8, 0x29e0, 0x1f68, 0x1bb0, 0x1bb0, 0x1bd0, 0x1bd0, 0x29e8, 0x29f0, 0x1f68, 0x1bb0, 0x1bb0, 0x1bb0, - 0x1bd0, 0x29f8, 0x2a00, 0x2a08, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x19b0, 0x19b0, 0x19c0, 0x19c0, 0x1e08, 0x2a10, - 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bd0, 0x1bd0, 0x1bd0, 0x28f0, - 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1fd8, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x21e0, 0x21e0, 0x21e0, 0x21e0, 0x21e0, 0x21e0, 0x2a18, 0x2a20, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, - 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x2600, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x1bd0, 0x1bd0, 0x1fa0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x2388, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x1bd0, 0x1bd0, 0x1bd0, 0x28f0, 0x1bd0, 0x1fa0, 0x2570, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bd0, 0x1fc0, 0x2a28, - 0x1bd0, 0x1bd0, 0x1bd0, 0x2a30, 0x2a38, 0x2a40, 0x2a48, 0x2a50, 0x1bd0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1fc8, 0x2a58, 0x2a60, 0x2a68, 0x28d8, 0x2a70, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x2a78, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x2420, 0x1e20, 0x28f0, 0x2a80, 0x2a88, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2240, 0x2a90, - 0x2240, 0x2240, 0x2a98, 0x2240, 0x2240, 0x2240, 0x2aa0, 0x2aa8, 0x2ab0, 0x2240, 0x2ab8, 0x2240, 0x2240, 0x2240, 0x2ac0, 0x1bb0, - 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x2ac8, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x2278, 0x2718, 0x2ad0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x19b0, 0x2ad8, 0x19c0, 0x2ae0, 0x2ae8, 0x2af0, 0x20e8, 0x19b0, 0x2af8, 0x2b00, 0x2b08, 0x2b10, 0x2b18, 0x19b0, 0x2ad8, 0x19c0, - 0x2b20, 0x2b28, 0x19c0, 0x2b30, 0x2b38, 0x2b40, 0x2b48, 0x19b0, 0x2b50, 0x19c0, 0x19b0, 0x2ad8, 0x19c0, 0x2ae0, 0x2ae8, 0x19c0, - 0x20e8, 0x19b0, 0x2af8, 0x2b48, 0x19b0, 0x2b50, 0x19c0, 0x19b0, 0x2ad8, 0x19c0, 0x2b58, 0x19b0, 0x2b60, 0x2b68, 0x2b70, 0x2b78, - 0x19c0, 0x2b80, 0x19b0, 0x2b88, 0x2b90, 0x2b98, 0x2ba0, 0x19c0, 0x2ba8, 0x19b0, 0x2bb0, 0x19c0, 0x2bb8, 0x2bc0, 0x2bc0, 0x2bc0, - 0x1a68, 0x1a68, 0x1a68, 0x2bc8, 0x1a68, 0x1a68, 0x2bd0, 0x2bd8, 0x2be0, 0x2be8, 0x1ad8, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x1af0, 0x1af0, 0x1af0, 0x1af0, 0x1af0, 0x1af0, 0x1af0, 0x1af0, 0x1af0, 0x1af0, 0x1af0, 0x1af0, 0x2bf0, 0x2bf8, 0x1bb0, 0x1bb0, - 0x2c00, 0x1b18, 0x2c08, 0x2c10, 0x2c18, 0x2c20, 0x2c28, 0x2c30, 0x2c38, 0x2c40, 0x2c48, 0x2c40, 0x1bb0, 0x1bb0, 0x1bb0, 0x2c50, - 0x1fe8, 0x1fe8, 0x23d8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x23c8, 0x2c58, 0x2c60, 0x2c60, 0x2c60, 0x1fe8, 0x23d0, - 0x2c68, 0x2240, 0x2460, 0x2240, 0x2240, 0x2240, 0x2c70, 0x2240, 0x2240, 0x2c78, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x2c80, 0x2240, - 0x2c88, 0x2240, 0x2240, 0x2c78, 0x2ac0, 0x2c90, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x2c98, - 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, - 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x23c0, 0x1fe8, 0x1fe8, 0x2ca0, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, - 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x2740, 0x2ca8, 0x23c8, - 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x23c8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x1fe8, 0x2cb0, 0x1bb0, 0x1bb0, - 0x23d8, 0x1fe8, 0x1fe8, 0x1fe8, 0x2cb8, 0x1ee8, 0x1fe8, 0x1fe8, 0x2cb8, 0x1fe8, 0x2cc0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x1bb0, 0x2cc8, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x2cb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x2740, 0x1bb0, 0x1bb0, 0x1bb0, - 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x2388, 0x1bb0, 0x1bb0, - 0x1bd0, 0x1bd0, 0x1bd0, 0x1fc8, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, - 0x1bd0, 0x1fc0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, - 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x1bd0, 0x2a78, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x1bd0, 0x1fc0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x2cd0, 0x1bb0, 0x2cd8, 0x2cd8, 0x2cd8, 0x2cd8, 0x2cd8, 0x2cd8, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, 0x1bb0, - 0x1a68, 0x1a68, 0x1a68, 0x1a68, 0x1a68, 0x1a68, 0x1a68, 0x1a68, 0x1a68, 0x1a68, 0x1a68, 0x1a68, 0x1a68, 0x1a68, 0x1a68, 0x1bb0, - 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2618, 0x2ce0, - 0x0101, 0x0101, 0x0101, 0x0101, 0x0201, 0x0203, 0x0304, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0303, 0x0203, - 0x0605, 0x0706, 0x0708, 0x0606, 0x0a09, 0x0b06, 0x0d0c, 0x0c0c, 0x0e0e, 0x0e0e, 0x0e0e, 0x0e0e, 0x0e0e, 0x060c, 0x0f0f, 0x060f, - 0x1006, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x0910, 0x0a06, 0x1211, - 0x1311, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x0913, 0x0a0f, 0x010f, - 0x0101, 0x0101, 0x0301, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, - 0x0614, 0x0808, 0x0808, 0x0615, 0x1511, 0x1716, 0x180f, 0x1115, 0x1a19, 0x1b1b, 0x1311, 0x0606, 0x1b11, 0x1c16, 0x1d1d, 0x061d, - 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x0f10, 0x1010, 0x1010, 0x1010, 0x1310, - 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x0f13, 0x1313, 0x1313, 0x1313, 0x1313, - 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1013, 0x1013, 0x1013, 0x1013, - 0x1013, 0x1013, 0x1013, 0x1013, 0x1313, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1010, 0x1013, 0x1013, 0x1313, - 0x1013, 0x1310, 0x1310, 0x1010, 0x1013, 0x1010, 0x1313, 0x1010, 0x1010, 0x1013, 0x1310, 0x1010, 0x1310, 0x1313, 0x1010, 0x1013, - 0x1310, 0x1310, 0x1310, 0x1010, 0x1013, 0x1313, 0x1310, 0x1010, 0x1013, 0x1010, 0x1013, 0x1013, 0x1310, 0x1613, 0x1310, 0x1313, - 0x1616, 0x1616, 0x1e10, 0x1013, 0x131e, 0x1e10, 0x1013, 0x1013, 0x1013, 0x1013, 0x1013, 0x1013, 0x1013, 0x1013, 0x1313, 0x1310, - 0x1013, 0x131e, 0x1310, 0x1010, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1313, 0x1313, 0x1313, 0x1010, 0x1013, 0x1310, - 0x1013, 0x1013, 0x1010, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1313, 0x1313, 0x1316, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, - 0x1f1f, 0x1f1f, 0x1f1f, 0x1f1f, 0x201f, 0x1f20, 0x1f1f, 0x1f1f, 0x1f1f, 0x1111, 0x1111, 0x2020, 0x2020, 0x2020, 0x2020, 0x2020, - 0x1f1f, 0x1111, 0x1111, 0x1111, 0x1111, 0x1111, 0x1111, 0x1111, 0x1f1f, 0x1f1f, 0x111f, 0x1111, 0x1111, 0x1111, 0x1120, 0x111f, - 0x1111, 0x1111, 0x1111, 0x1111, 0x1111, 0x1111, 0x1111, 0x1111, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, - 0x1310, 0x1310, 0x1120, 0x1310, 0x0000, 0x131f, 0x1313, 0x1006, 0x0000, 0x0000, 0x1111, 0x0610, 0x1010, 0x0010, 0x0010, 0x1010, - 0x1013, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1000, 0x1010, 0x1010, 0x1010, 0x1010, 0x1313, 0x1313, - 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1013, 0x1313, 0x1010, 0x1310, 0x1313, 0x1310, 0x1310, 0x1310, 0x1310, - 0x1313, 0x1313, 0x1310, 0x100f, 0x1013, 0x1310, 0x1013, 0x1010, 0x1310, 0x2122, 0x2121, 0x2121, 0x2323, 0x1310, 0x1310, 0x1310, - 0x1010, 0x1013, 0x1013, 0x1013, 0x1013, 0x1013, 0x1013, 0x1313, 0x1000, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, - 0x1010, 0x1010, 0x1010, 0x0010, 0x1f00, 0x2424, 0x2424, 0x2424, 0x1300, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, - 0x1313, 0x1313, 0x1313, 0x1313, 0x2400, 0x0025, 0x1500, 0x0815, 0x2100, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, - 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2126, 0x2127, 0x2721, 0x2121, 0x2127, 0x0000, 0x0000, 0x0000, 0x0000, - 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x0028, 0x0000, 0x0000, - 0x2828, 0x2728, 0x0027, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2929, 0x2929, 0x2929, 0x0f0f, 0x072a, 0x2b07, 0x2c0c, 0x1515, - 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2c21, 0x002d, 0x2c2c, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, - 0x2e2f, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x212e, 0x2121, 0x2121, 0x3030, 0x3030, 0x3030, 0x3030, 0x3030, 0x3107, 0x2c31, 0x2e2e, - 0x2e21, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2c, 0x2121, 0x2121, 0x2121, 0x2921, 0x2115, - 0x2121, 0x2121, 0x2f21, 0x212f, 0x1521, 0x2121, 0x2121, 0x2e2e, 0x0e0e, 0x0e0e, 0x0e0e, 0x0e0e, 0x0e0e, 0x2e2e, 0x322e, 0x2e32, - 0x2c2c, 0x2c2c, 0x2c2c, 0x2c2c, 0x2c2c, 0x2c2c, 0x2c2c, 0x2d00, 0x212e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, - 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x0021, 0x2e00, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, - 0x2e21, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3333, 0x3333, 0x3333, 0x3333, 0x3333, 0x2828, 0x2828, 0x2828, - 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2128, 0x2121, 0x2121, 0x2121, 0x2121, 0x3434, 0x0615, 0x0606, 0x0034, 0x0000, 0x0000, - 0x2828, 0x2828, 0x2828, 0x2121, 0x2121, 0x2134, 0x2121, 0x2121, 0x2121, 0x2121, 0x2134, 0x2121, 0x2134, 0x2121, 0x2121, 0x0000, - 0x2727, 0x2727, 0x2727, 0x2727, 0x2727, 0x2727, 0x2727, 0x0027, 0x2828, 0x2828, 0x2828, 0x2828, 0x2128, 0x2121, 0x0000, 0x0027, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2e2e, 0x2e2e, 0x002e, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x2100, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x3521, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, - 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x3521, 0x1621, 0x3535, - 0x2135, 0x2121, 0x2121, 0x2121, 0x3521, 0x3535, 0x2135, 0x3535, 0x2116, 0x2121, 0x2121, 0x2121, 0x1616, 0x1616, 0x1616, 0x1616, - 0x1616, 0x2121, 0x2424, 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, 0x1f24, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, - 0x2116, 0x3535, 0x1600, 0x1616, 0x1616, 0x1616, 0x0016, 0x1600, 0x0016, 0x1600, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, - 0x1616, 0x1616, 0x1616, 0x1616, 0x0016, 0x1616, 0x1616, 0x1616, 0x0016, 0x0016, 0x0000, 0x1616, 0x1616, 0x0000, 0x1621, 0x3535, - 0x2135, 0x2121, 0x0021, 0x3500, 0x0035, 0x3500, 0x2135, 0x0016, 0x0000, 0x0000, 0x0000, 0x3500, 0x0000, 0x0000, 0x1616, 0x1600, - 0x1616, 0x2121, 0x0000, 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, 0x1616, 0x0808, 0x3737, 0x3737, 0x3737, 0x0822, 0x0000, 0x0000, - 0x2100, 0x3521, 0x1600, 0x1616, 0x1616, 0x0016, 0x0000, 0x1600, 0x0016, 0x1616, 0x1600, 0x0016, 0x1616, 0x0000, 0x0021, 0x3535, - 0x2135, 0x0021, 0x0000, 0x2100, 0x0021, 0x2100, 0x2121, 0x0000, 0x2100, 0x0000, 0x0000, 0x0000, 0x1600, 0x1616, 0x0016, 0x0016, - 0x0000, 0x0000, 0x0000, 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, 0x2121, 0x1616, 0x2116, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x2100, 0x3521, 0x1600, 0x1616, 0x1616, 0x1616, 0x1616, 0x1600, 0x1616, 0x1600, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, - 0x0016, 0x1616, 0x1600, 0x1616, 0x1616, 0x0000, 0x1621, 0x3535, 0x2135, 0x2121, 0x2121, 0x2100, 0x3521, 0x3500, 0x2135, 0x0000, - 0x0016, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0824, 0x0000, 0x0000, 0x0000, 0x1600, 0x0000, 0x0000, 0x0000, - 0x2100, 0x3535, 0x1600, 0x1616, 0x1616, 0x1616, 0x0016, 0x1600, 0x0016, 0x1616, 0x1600, 0x1616, 0x1616, 0x0000, 0x1621, 0x2135, - 0x2135, 0x2121, 0x0021, 0x3500, 0x0035, 0x3500, 0x2135, 0x0000, 0x0000, 0x0000, 0x0000, 0x3521, 0x0000, 0x0000, 0x1616, 0x1600, - 0x1622, 0x3737, 0x3737, 0x3737, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1621, 0x1600, 0x1616, 0x1616, 0x0016, 0x0000, 0x1616, - 0x0016, 0x1616, 0x1616, 0x0000, 0x1600, 0x0016, 0x0016, 0x1616, 0x0000, 0x1600, 0x0016, 0x0000, 0x1616, 0x0016, 0x0000, 0x1616, - 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x0000, 0x0000, 0x3535, 0x3521, 0x0035, 0x0000, 0x3535, 0x0035, 0x3535, 0x2135, 0x0000, - 0x0016, 0x0000, 0x0000, 0x3500, 0x0000, 0x0000, 0x0000, 0x0000, 0x3737, 0x1537, 0x1515, 0x1515, 0x0815, 0x0015, 0x0000, 0x0000, - 0x3521, 0x3535, 0x1600, 0x1616, 0x1616, 0x1616, 0x0016, 0x1616, 0x0016, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, - 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x0000, 0x1600, 0x2121, 0x3521, 0x3535, 0x0035, 0x2121, 0x0021, 0x2121, 0x2121, 0x0000, - 0x0000, 0x0000, 0x2100, 0x0021, 0x1616, 0x0016, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1d1d, 0x1d1d, 0x1d1d, 0x221d, - 0x2100, 0x3535, 0x1600, 0x1616, 0x1616, 0x1616, 0x0016, 0x1616, 0x1616, 0x1616, 0x1600, 0x1616, 0x1616, 0x0000, 0x1621, 0x3835, - 0x3535, 0x3535, 0x0035, 0x3538, 0x0035, 0x3535, 0x2121, 0x0000, 0x0000, 0x0000, 0x3500, 0x0035, 0x0000, 0x0000, 0x0000, 0x0016, - 0x1600, 0x0016, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x0016, 0x1600, 0x3535, - 0x2135, 0x2121, 0x0021, 0x3535, 0x0035, 0x3535, 0x2135, 0x0016, 0x0000, 0x0000, 0x0000, 0x3500, 0x0000, 0x0000, 0x0000, 0x1600, - 0x3737, 0x3737, 0x3737, 0x0000, 0x2200, 0x1616, 0x1616, 0x1616, 0x0000, 0x3535, 0x1600, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, - 0x1616, 0x1616, 0x1616, 0x0016, 0x0000, 0x1616, 0x1616, 0x1616, 0x1616, 0x1600, 0x1616, 0x1616, 0x1616, 0x1616, 0x1600, 0x0000, - 0x1616, 0x1616, 0x1616, 0x0016, 0x0000, 0x0021, 0x0000, 0x3500, 0x3535, 0x2121, 0x0021, 0x0021, 0x3535, 0x3535, 0x3535, 0x3535, - 0x0000, 0x3535, 0x0024, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1600, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, - 0x2116, 0x1616, 0x2121, 0x2121, 0x2121, 0x0021, 0x0000, 0x0800, 0x1616, 0x1616, 0x1616, 0x211f, 0x2121, 0x2121, 0x2121, 0x2421, - 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, 0x2424, 0x0000, 0x0000, 0x1600, 0x0016, 0x0016, 0x1600, 0x0016, 0x0016, 0x1600, 0x0000, - 0x0000, 0x0000, 0x1616, 0x1616, 0x1600, 0x1616, 0x1616, 0x1616, 0x1600, 0x1616, 0x1600, 0x1600, 0x0000, 0x1616, 0x1600, 0x1616, - 0x2116, 0x1616, 0x2121, 0x2121, 0x2121, 0x2100, 0x1621, 0x0000, 0x1616, 0x1616, 0x0016, 0x001f, 0x2121, 0x2121, 0x2121, 0x0000, - 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, 0x0000, 0x1616, 0x1616, 0x2216, 0x2222, 0x2424, 0x2424, 0x2424, 0x2424, 0x2424, 0x2424, - 0x2424, 0x2224, 0x2224, 0x2222, 0x2121, 0x2222, 0x2222, 0x2222, 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, 0x3737, 0x3737, 0x3737, - 0x3737, 0x3737, 0x2122, 0x2122, 0x2122, 0x0a09, 0x0a09, 0x3535, 0x1616, 0x1616, 0x1616, 0x1616, 0x1600, 0x1616, 0x1616, 0x1616, - 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x0016, 0x0000, 0x2100, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x3521, - 0x2121, 0x2121, 0x2421, 0x2121, 0x1616, 0x1616, 0x2116, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2100, 0x2121, 0x2121, 0x2121, - 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x0021, 0x2222, 0x2222, 0x2222, 0x2222, 0x2221, 0x2222, 0x2222, 0x0022, 0x2222, - 0x2424, 0x2424, 0x2224, 0x2222, 0x2422, 0x0024, 0x0000, 0x0000, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x3516, 0x2135, 0x2121, - 0x3521, 0x2121, 0x2121, 0x2121, 0x2135, 0x3521, 0x2135, 0x1621, 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, 0x2424, 0x2424, 0x2424, - 0x1616, 0x1616, 0x1616, 0x3535, 0x2121, 0x1616, 0x1616, 0x2121, 0x1621, 0x3535, 0x1635, 0x3516, 0x3535, 0x3535, 0x3535, 0x1616, - 0x2116, 0x2121, 0x1621, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x3521, 0x2135, 0x3521, 0x3535, 0x3535, 0x2135, 0x3516, - 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, 0x3535, 0x2135, 0x2222, 0x1010, 0x1010, 0x1010, 0x1000, 0x0000, 0x0000, 0x1000, 0x0000, - 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x2416, 0x161f, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x0016, 0x1616, 0x1616, 0x0000, - 0x1616, 0x1616, 0x1616, 0x0016, 0x0016, 0x1616, 0x1616, 0x0000, 0x0016, 0x1616, 0x1616, 0x0000, 0x1616, 0x1616, 0x1616, 0x0016, - 0x0016, 0x1616, 0x1616, 0x0000, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x0016, 0x1616, 0x1616, 0x1616, 0x1616, - 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x0016, 0x2100, 0x2121, 0x2424, 0x2424, 0x2424, 0x2424, 0x3724, 0x3737, 0x3737, 0x3737, - 0x3737, 0x3737, 0x3737, 0x3737, 0x3737, 0x3737, 0x0037, 0x0000, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x0000, 0x0000, 0x0000, - 0x1010, 0x1010, 0x1010, 0x0000, 0x1313, 0x1313, 0x1313, 0x0000, 0x1625, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, - 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x2416, 0x1624, 0x1605, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, - 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x0916, 0x000a, 0x0000, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x2416, 0x2424, 0x3939, - 0x1639, 0x1616, 0x1616, 0x1616, 0x0016, 0x0000, 0x0000, 0x0000, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x0016, 0x1616, - 0x1616, 0x2121, 0x0021, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1616, 0x2121, 0x2421, 0x0024, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1616, 0x2121, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0016, 0x2121, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1616, 0x1616, 0x2121, 0x2135, 0x2121, 0x2121, 0x2121, 0x3535, 0x3535, 0x3535, 0x3535, 0x3521, 0x2135, 0x2121, 0x2121, 0x2121, - 0x2121, 0x2121, 0x2424, 0x1f24, 0x2424, 0x0824, 0x2116, 0x0000, 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, 0x0000, 0x0000, 0x0000, - 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, 0x0000, 0x0000, 0x0000, 0x0606, 0x0606, 0x0606, 0x0625, 0x0606, 0x2106, 0x2121, 0x0018, - 0x1616, 0x1f16, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1616, 0x1616, 0x1616, 0x1616, 0x2116, 0x0016, 0x0000, 0x0000, 0x1616, 0x1616, 0x1616, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x0016, 0x2121, 0x3521, 0x3535, 0x2135, 0x3521, 0x3535, 0x0000, 0x0000, - 0x3535, 0x3521, 0x3535, 0x3535, 0x2135, 0x2121, 0x0000, 0x0000, 0x0015, 0x0000, 0x0606, 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, - 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x0000, 0x1616, 0x1616, 0x0016, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x0000, 0x0000, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x0000, 0x0000, 0x0000, - 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, 0x0037, 0x0000, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, - 0x1616, 0x1616, 0x1616, 0x2116, 0x3521, 0x2135, 0x0000, 0x2424, 0x1616, 0x1616, 0x3516, 0x3521, 0x2121, 0x2121, 0x2121, 0x0021, - 0x3521, 0x3521, 0x2135, 0x2121, 0x2121, 0x2121, 0x3521, 0x3535, 0x3535, 0x2135, 0x2121, 0x2121, 0x2121, 0x2121, 0x0021, 0x2100, - 0x2424, 0x2424, 0x2424, 0x1f24, 0x2424, 0x2424, 0x2424, 0x0000, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x0023, - 0x2121, 0x2121, 0x1635, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x3521, 0x2121, 0x2121, 0x3521, 0x3521, 0x3535, - 0x3535, 0x3521, 0x1635, 0x1616, 0x1616, 0x1616, 0x0000, 0x0000, 0x2224, 0x2222, 0x2222, 0x2222, 0x2222, 0x2122, 0x2121, 0x2121, - 0x2121, 0x2121, 0x2222, 0x2222, 0x2222, 0x2222, 0x0022, 0x0000, 0x2121, 0x1635, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, - 0x3516, 0x2121, 0x2121, 0x3535, 0x2121, 0x2135, 0x2121, 0x1616, 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, 0x1616, 0x1616, 0x1616, - 0x1616, 0x1616, 0x1616, 0x3521, 0x2121, 0x3535, 0x2135, 0x2135, 0x2121, 0x3535, 0x0000, 0x0000, 0x0000, 0x0000, 0x2424, 0x2424, - 0x1616, 0x1616, 0x3535, 0x3535, 0x3535, 0x3535, 0x2121, 0x2121, 0x2121, 0x2121, 0x3535, 0x2121, 0x0000, 0x2400, 0x2424, 0x2424, - 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, 0x0000, 0x1600, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1f1f, 0x1f1f, 0x1f1f, 0x2424, - 0x2424, 0x2424, 0x2424, 0x2424, 0x0000, 0x0000, 0x0000, 0x0000, 0x2121, 0x2421, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, - 0x3521, 0x2121, 0x2121, 0x2121, 0x1621, 0x1616, 0x2116, 0x1616, 0x1616, 0x3535, 0x1621, 0x0016, 0x2121, 0x0000, 0x0000, 0x0000, - 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1f1f, 0x1f1f, 0x1f1f, 0x1f1f, 0x1f1f, 0x1f1f, 0x1f1f, 0x1f1f, 0x1f1f, 0x1f1f, - 0x1f1f, 0x1f1f, 0x1f1f, 0x1f1f, 0x1f1f, 0x131f, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x131f, 0x1313, 0x1313, 0x1313, - 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1f13, 0x1f1f, 0x1f1f, 0x2121, 0x2121, 0x2121, 0x0000, 0x0000, 0x0000, 0x2121, 0x2121, - 0x1310, 0x1310, 0x1310, 0x1313, 0x1313, 0x1313, 0x1313, 0x1310, 0x1313, 0x1313, 0x1313, 0x1313, 0x1010, 0x1010, 0x1010, 0x1010, - 0x1313, 0x1313, 0x1313, 0x0000, 0x1010, 0x1010, 0x1010, 0x0000, 0x1313, 0x1313, 0x1313, 0x1313, 0x1000, 0x1000, 0x1000, 0x1000, - 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x0000, 0x1313, 0x1313, 0x1313, 0x1313, 0x1e1e, 0x1e1e, 0x1e1e, 0x1e1e, - 0x1313, 0x1313, 0x0013, 0x1313, 0x1010, 0x1010, 0x111e, 0x1113, 0x1111, 0x1313, 0x0013, 0x1313, 0x1010, 0x1010, 0x111e, 0x1111, - 0x1313, 0x1313, 0x0000, 0x1313, 0x1010, 0x1010, 0x1100, 0x1111, 0x1313, 0x1313, 0x1313, 0x1313, 0x1010, 0x1010, 0x1110, 0x1111, - 0x0000, 0x1313, 0x0013, 0x1313, 0x1010, 0x1010, 0x111e, 0x0011, 0x0505, 0x0505, 0x0505, 0x0505, 0x0505, 0x1805, 0x1818, 0x3b3a, - 0x2525, 0x2525, 0x2525, 0x0606, 0x1c17, 0x1709, 0x1c17, 0x1709, 0x0606, 0x0606, 0x0606, 0x0606, 0x3d3c, 0x3f3e, 0x4140, 0x1442, - 0x0707, 0x0707, 0x0607, 0x0606, 0x1706, 0x061c, 0x0606, 0x1206, 0x0612, 0x0606, 0x0943, 0x060a, 0x0606, 0x0606, 0x0606, 0x0606, - 0x0606, 0x060f, 0x0612, 0x0606, 0x0606, 0x0606, 0x0606, 0x0506, 0x1818, 0x1818, 0x0018, 0x4544, 0x4746, 0x1818, 0x1818, 0x1818, - 0x1f1b, 0x0000, 0x1b1b, 0x1b1b, 0x1b1b, 0x0b0b, 0x090f, 0x1f0a, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x0b0b, 0x090f, 0x000a, - 0x1f1f, 0x1f1f, 0x1f1f, 0x1f1f, 0x1f1f, 0x1f1f, 0x001f, 0x0000, 0x0808, 0x0808, 0x0808, 0x0808, 0x0808, 0x0808, 0x0808, 0x0808, - 0x0808, 0x0808, 0x0808, 0x0808, 0x0808, 0x0808, 0x0808, 0x0008, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2321, 0x2323, - 0x2123, 0x2323, 0x2123, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x0021, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1515, 0x1510, 0x1515, 0x1015, 0x1515, 0x1013, 0x1010, 0x1313, 0x1010, 0x1310, 0x1015, 0x1515, 0x100f, 0x1010, 0x1010, 0x1515, - 0x1515, 0x1515, 0x1510, 0x1510, 0x1510, 0x1010, 0x1010, 0x1319, 0x1010, 0x1010, 0x1613, 0x1616, 0x1316, 0x1515, 0x1313, 0x1010, - 0x0f0f, 0x0f0f, 0x100f, 0x1313, 0x1313, 0x0f15, 0x1515, 0x2213, 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, - 0x3939, 0x3939, 0x3939, 0x3939, 0x3939, 0x3939, 0x3939, 0x3939, 0x3939, 0x1039, 0x3913, 0x3939, 0x1d39, 0x1515, 0x0000, 0x0000, - 0x0f0f, 0x0f0f, 0x150f, 0x1515, 0x1515, 0x0f0f, 0x1515, 0x1515, 0x150f, 0x0f15, 0x1515, 0x150f, 0x1515, 0x1515, 0x1515, 0x150f, - 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x0f0f, 0x1515, 0x150f, 0x150f, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, - 0x1515, 0x1515, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, - 0x0f0f, 0x1a0b, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x1515, 0x1515, 0x1515, 0x1515, 0x0a09, 0x0a09, 0x1515, 0x1515, - 0x0f0f, 0x1515, 0x1515, 0x1515, 0x0915, 0x150a, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, - 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x1522, 0x150f, 0x1515, - 0x1515, 0x1515, 0x2215, 0x1515, 0x1515, 0x0f15, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, - 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x0f0f, 0x0f0f, 0x0f0f, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, - 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x0015, 0x0000, 0x0000, 0x1515, 0x1515, 0x1515, 0x0015, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x2222, 0x2222, - 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x1d1d, 0x1d1d, 0x1d1d, 0x1515, 0x1515, 0x1515, 0x0f15, 0x1515, 0x1515, 0x1515, 0x1515, - 0x0f15, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, - 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x0f15, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1522, 0x1515, - 0x1515, 0x1515, 0x1515, 0x1515, 0x0a09, 0x0a09, 0x0a09, 0x0a09, 0x0a09, 0x0a09, 0x0a09, 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, - 0x1d1d, 0x1d1d, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x0f0f, 0x0f0f, 0x090f, 0x0f0a, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, - 0x0f0f, 0x0f0f, 0x0f0f, 0x0a09, 0x0a09, 0x0a09, 0x0a09, 0x0a09, 0x0f0f, 0x090f, 0x090a, 0x090a, 0x090a, 0x090a, 0x090a, 0x090a, - 0x090a, 0x090a, 0x090a, 0x090a, 0x0f0a, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x0a09, 0x0a09, 0x0f0f, 0x0f0f, - 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x0f0f, 0x0a09, 0x0f0f, 0x0f0f, 0x0f0f, 0x150f, 0x0f15, 0x0f0f, 0x0f0f, 0x150f, 0x1515, - 0x1515, 0x1515, 0x0000, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x0000, 0x1515, 0x1515, 0x1515, 0x1515, - 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x0000, 0x1500, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x0015, 0x1515, 0x1515, 0x1515, - 0x1515, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1515, 0x1515, - 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x0010, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x0013, - 0x1310, 0x1010, 0x1310, 0x1013, 0x1013, 0x1013, 0x1013, 0x1010, 0x1310, 0x1310, 0x1013, 0x1313, 0x1313, 0x1313, 0x1f1f, 0x1010, - 0x1310, 0x1310, 0x1513, 0x1515, 0x1515, 0x1015, 0x1013, 0x2113, 0x2121, 0x1310, 0x0000, 0x0000, 0x0600, 0x0606, 0x1d06, 0x0606, - 0x1313, 0x1313, 0x1313, 0x1300, 0x0000, 0x0000, 0x1300, 0x0000, 0x1616, 0x1616, 0x1616, 0x1616, 0x0000, 0x0000, 0x0000, 0x1f00, - 0x0024, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2100, 0x1616, 0x1616, 0x1616, 0x0016, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1616, 0x1616, 0x1616, 0x0016, 0x1616, 0x1616, 0x1616, 0x0016, 0x0606, 0x1c17, 0x1c17, 0x0606, 0x1706, 0x061c, 0x1c17, 0x0606, - 0x0606, 0x0606, 0x0606, 0x2506, 0x0606, 0x0625, 0x1c17, 0x0606, 0x1c17, 0x0a09, 0x0a09, 0x0a09, 0x0a09, 0x0606, 0x0606, 0x2006, - 0x0606, 0x0606, 0x0606, 0x0606, 0x0606, 0x2525, 0x0606, 0x0606, 0x0625, 0x0009, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1500, 0x1515, 0x1515, 0x1515, 0x1515, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1515, 0x1515, 0x1515, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x0000, 0x0000, - 0x0605, 0x0606, 0x1f15, 0x3916, 0x0a09, 0x0a09, 0x0a09, 0x0a09, 0x0a09, 0x1515, 0x0a09, 0x0a09, 0x0a09, 0x0a09, 0x0925, 0x0a0a, - 0x3915, 0x3939, 0x3939, 0x3939, 0x3939, 0x2121, 0x2121, 0x3535, 0x1f25, 0x1f1f, 0x1f1f, 0x1515, 0x3939, 0x1f39, 0x0616, 0x1515, - 0x1616, 0x1616, 0x1616, 0x0016, 0x2100, 0x1121, 0x1f11, 0x161f, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x0616, 0x1f1f, 0x161f, - 0x0000, 0x0000, 0x1600, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x2222, 0x3737, 0x3737, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, - 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x0016, 0x0000, 0x0000, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x1522, 0x0015, - 0x3737, 0x3737, 0x3737, 0x3737, 0x3737, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x3737, 0x3737, 0x3737, 0x3737, - 0x1d15, 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x1515, 0x2215, - 0x1d22, 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x1515, 0x1515, - 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x0022, 0x2222, 0x2222, 0x2222, 0x1522, 0x1515, 0x2215, 0x2222, 0x2222, - 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x1515, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x1522, - 0x1616, 0x1616, 0x1f16, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x061f, 0x0606, - 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, 0x1616, 0x0000, 0x0000, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x2116, - 0x2323, 0x0623, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2006, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1f1f, 0x2121, - 0x1616, 0x1616, 0x1616, 0x3939, 0x3939, 0x3939, 0x3939, 0x3939, 0x2121, 0x2424, 0x2424, 0x2424, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1111, 0x1111, 0x1111, 0x2011, 0x2020, 0x2020, 0x2020, 0x2020, 0x1111, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, - 0x1313, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x131f, 0x1313, 0x1313, 0x1313, 0x1013, 0x1013, 0x1013, 0x1310, - 0x1310, 0x1310, 0x1310, 0x1310, 0x4820, 0x1048, 0x1013, 0x1613, 0x1310, 0x1310, 0x1313, 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, - 0x1310, 0x1310, 0x1310, 0x1310, 0x1310, 0x1010, 0x1010, 0x0000, 0x1010, 0x1010, 0x1310, 0x1310, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x1600, 0x1f1f, 0x1613, 0x1616, 0x1616, 0x1616, 0x1621, 0x1616, 0x1621, 0x1616, 0x2116, 0x1616, 0x1616, - 0x1616, 0x3516, 0x2135, 0x3521, 0x1515, 0x1515, 0x0000, 0x0000, 0x3737, 0x3737, 0x3737, 0x2222, 0x1908, 0x0000, 0x0000, 0x0000, - 0x1616, 0x1616, 0x0606, 0x0606, 0x0000, 0x0000, 0x0000, 0x0000, 0x3535, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, - 0x1616, 0x1616, 0x3535, 0x3535, 0x3535, 0x3535, 0x3535, 0x3535, 0x3535, 0x3535, 0x0021, 0x0000, 0x0000, 0x0000, 0x0000, 0x2424, - 0x2121, 0x1616, 0x1616, 0x1616, 0x2424, 0x1624, 0x1624, 0x0000, 0x1616, 0x1616, 0x1616, 0x2121, 0x2121, 0x2121, 0x2121, 0x2424, - 0x1616, 0x1616, 0x1616, 0x2116, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x3535, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2400, - 0x1616, 0x2116, 0x3535, 0x2121, 0x2121, 0x3535, 0x3521, 0x3535, 0x2435, 0x2424, 0x2424, 0x2424, 0x2424, 0x2424, 0x2424, 0x1f00, - 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, 0x0000, 0x0000, 0x2424, 0x1616, 0x1616, 0x2116, 0x161f, 0x1616, 0x1616, 0x1616, 0x1616, - 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, 0x1616, 0x1616, 0x0016, 0x1616, 0x1616, 0x1616, 0x1616, 0x2116, 0x2121, 0x2121, 0x3521, - 0x2135, 0x3521, 0x2135, 0x0021, 0x0000, 0x0000, 0x0000, 0x0000, 0x1616, 0x2116, 0x1616, 0x1616, 0x1616, 0x1616, 0x3521, 0x0000, - 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, 0x0000, 0x2424, 0x2424, 0x161f, 0x1616, 0x1616, 0x2216, 0x2222, 0x3516, 0x3521, 0x1616, - 0x1621, 0x2121, 0x1621, 0x2116, 0x1621, 0x1616, 0x1616, 0x2121, 0x2116, 0x0016, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1600, 0x1f16, 0x2424, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x3516, 0x2121, 0x3535, - 0x2424, 0x1f16, 0x351f, 0x0021, 0x0000, 0x0000, 0x0000, 0x0000, 0x1600, 0x1616, 0x1616, 0x0016, 0x1600, 0x1616, 0x1616, 0x0016, - 0x1600, 0x1616, 0x1616, 0x0016, 0x0000, 0x0000, 0x0000, 0x0000, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x4813, 0x1f1f, 0x1f1f, - 0x1313, 0x1313, 0x1313, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1616, 0x3516, 0x2135, 0x3535, 0x3521, 0x2435, 0x2135, 0x0000, - 0x1616, 0x1616, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1616, 0x1616, 0x1616, 0x0016, 0x0000, 0x1600, 0x1616, 0x1616, - 0x4949, 0x4949, 0x4949, 0x4949, 0x4949, 0x4949, 0x4949, 0x4949, 0x4a4a, 0x4a4a, 0x4a4a, 0x4a4a, 0x4a4a, 0x4a4a, 0x4a4a, 0x4a4a, - 0x1313, 0x1313, 0x1313, 0x0013, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1300, 0x1313, 0x1313, 0x0000, 0x0000, 0x2800, 0x2821, - 0x2828, 0x2828, 0x2828, 0x2828, 0x0b28, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x0028, 0x2828, 0x2828, 0x0028, 0x0028, - 0x2828, 0x2800, 0x0028, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2e2e, 0x4b4b, 0x4b4b, 0x4b4b, 0x4b4b, 0x4b4b, 0x4b4b, 0x4b4b, - 0x4b4b, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2e00, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, - 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x090a, 0x0000, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, - 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x0000, 0x0000, 0x0000, 0x0000, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x152b, 0x0000, - 0x0606, 0x0606, 0x0606, 0x0906, 0x060a, 0x0000, 0x0000, 0x0000, 0x2506, 0x1225, 0x0912, 0x090a, 0x090a, 0x090a, 0x090a, 0x090a, - 0x090a, 0x090a, 0x060a, 0x0906, 0x060a, 0x0606, 0x1206, 0x1212, 0x060c, 0x000c, 0x0c06, 0x0606, 0x0925, 0x090a, 0x090a, 0x070a, - 0x0606, 0x0d0b, 0x0f0f, 0x000f, 0x0806, 0x0607, 0x0000, 0x0000, 0x2e2e, 0x2e2e, 0x002e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, - 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x002e, 0x1800, 0x0600, 0x0706, 0x0708, 0x0606, 0x0a09, 0x0b06, 0x0d0c, 0x0c0c, - 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x0913, 0x0a0f, 0x090f, 0x060a, 0x0a09, 0x0606, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, - 0x161f, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1f1f, - 0x0000, 0x1616, 0x1616, 0x1616, 0x0000, 0x1616, 0x1616, 0x1616, 0x0000, 0x1616, 0x1616, 0x1616, 0x0000, 0x1616, 0x0016, 0x0000, - 0x0808, 0x110f, 0x0815, 0x0008, 0x0f15, 0x0f0f, 0x150f, 0x0015, 0x0000, 0x0000, 0x0000, 0x0000, 0x4c00, 0x4c4c, 0x1515, 0x0000, - 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1600, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x0016, 0x1616, 0x1600, - 0x0624, 0x0024, 0x0000, 0x3700, 0x3737, 0x3737, 0x3737, 0x3737, 0x3737, 0x3737, 0x3737, 0x3737, 0x3737, 0x3737, 0x3737, 0x3737, - 0x3737, 0x3737, 0x0000, 0x2200, 0x2222, 0x2222, 0x2222, 0x2222, 0x4d4d, 0x4d4d, 0x4d4d, 0x4d4d, 0x4d4d, 0x4d4d, 0x4d4d, 0x4d4d, - 0x4d4d, 0x4d4d, 0x1d4d, 0x1d1d, 0x151d, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1d1d, 0x0015, 0x0000, - 0x0015, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2122, 0x0000, - 0x1b21, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x0000, 0x0000, - 0x3737, 0x3737, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3916, 0x1616, 0x1616, 0x1616, 0x1616, 0x0039, 0x0000, 0x0000, - 0x1616, 0x1616, 0x1616, 0x2121, 0x2121, 0x0021, 0x0000, 0x0000, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x2400, - 0x1616, 0x1616, 0x0000, 0x0000, 0x1616, 0x1616, 0x1616, 0x1616, 0x3924, 0x3939, 0x3939, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1010, 0x1010, 0x1010, 0x1010, 0x1313, 0x1313, 0x1313, 0x1313, 0x1616, 0x1616, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2400, - 0x2828, 0x2828, 0x2828, 0x0000, 0x0028, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2800, 0x0028, 0x0000, 0x0028, 0x2800, - 0x2828, 0x2828, 0x2828, 0x2700, 0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, 0x2828, 0x2828, 0x2828, 0x4f28, 0x4e4f, 0x4e4e, 0x4e4e, 0x4e4e, - 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x0028, 0x0000, 0x0000, 0x0000, 0x4e00, 0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, - 0x2828, 0x0028, 0x2828, 0x0000, 0x0000, 0x4e00, 0x4e4e, 0x4e4e, 0x2828, 0x2828, 0x2828, 0x4e4e, 0x4e4e, 0x4e4e, 0x0000, 0x0600, - 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x0000, 0x0000, 0x2700, 0x2828, 0x2828, 0x2828, 0x2828, 0x0000, 0x0000, 0x4e4e, 0x2828, - 0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, 0x0000, 0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, - 0x2128, 0x2121, 0x2100, 0x0021, 0x0000, 0x0000, 0x2121, 0x2121, 0x2828, 0x2828, 0x2800, 0x2828, 0x2800, 0x2828, 0x2828, 0x2828, - 0x2828, 0x2828, 0x0000, 0x0000, 0x2121, 0x0021, 0x0000, 0x2100, 0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, 0x0000, 0x0000, 0x0000, 0x0000, - 0x2727, 0x2727, 0x2727, 0x2727, 0x0027, 0x0000, 0x0000, 0x0000, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x4e28, 0x274e, - 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x2828, 0x4e28, 0x4e4e, 0x2828, 0x2828, 0x2828, 0x2828, 0x284f, 0x2828, 0x2828, 0x2828, - 0x2828, 0x2828, 0x2128, 0x0021, 0x0000, 0x4e00, 0x4e4e, 0x4e4e, 0x2727, 0x2727, 0x2727, 0x0027, 0x0000, 0x0000, 0x0000, 0x0000, - 0x2828, 0x2828, 0x2828, 0x0000, 0x0600, 0x0606, 0x0606, 0x0606, 0x2828, 0x2828, 0x2828, 0x0000, 0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, - 0x2828, 0x0028, 0x0000, 0x0000, 0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, 0x2828, 0x0000, 0x0000, 0x0000, 0x2700, 0x2727, 0x0027, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x4e00, 0x4e4e, 0x4e4e, 0x4e4e, 0x2828, 0x2828, 0x2828, 0x2828, 0x0028, 0x0000, 0x0000, 0x0000, - 0x5050, 0x5050, 0x5050, 0x5050, 0x5050, 0x5050, 0x5050, 0x5050, 0x5050, 0x0050, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x5151, 0x5151, 0x5151, 0x5151, 0x5151, 0x5151, 0x5151, 0x5151, 0x5151, 0x0051, 0x0000, 0x0000, 0x0000, 0x4e4e, 0x4e4e, 0x4e4e, - 0x5252, 0x5252, 0x5252, 0x5252, 0x5252, 0x5252, 0x5252, 0x5252, 0x5252, 0x5252, 0x5252, 0x5252, 0x5252, 0x5252, 0x5252, 0x0052, - 0x2135, 0x1635, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x2121, 0x2121, 0x2121, 0x2121, - 0x2121, 0x2121, 0x2121, 0x2421, 0x2424, 0x2424, 0x2424, 0x0000, 0x0000, 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, 0x1d1d, - 0x1d1d, 0x1d1d, 0x1d1d, 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2100, - 0x3535, 0x2135, 0x2121, 0x3521, 0x2135, 0x2421, 0x3a24, 0x2424, 0x2424, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1616, 0x1616, 0x1616, 0x1616, 0x0016, 0x0000, 0x0000, 0x0000, 0x2121, 0x1621, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, - 0x1616, 0x1616, 0x1616, 0x2116, 0x2121, 0x2121, 0x2135, 0x2121, 0x2121, 0x2121, 0x0021, 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, - 0x2424, 0x2424, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1616, 0x2116, 0x2424, 0x0016, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1616, 0x3516, 0x3535, 0x2121, 0x2121, 0x2121, 0x2121, 0x3521, 0x1635, 0x1616, 0x2416, 0x2424, 0x2424, 0x2121, 0x2421, 0x0000, - 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, 0x2416, 0x2416, 0x2424, 0x3700, 0x3737, 0x3737, 0x3737, 0x3737, 0x3737, 0x3737, 0x3737, - 0x3737, 0x3737, 0x0037, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x3535, 0x2135, - 0x2121, 0x3535, 0x3521, 0x2121, 0x2424, 0x2424, 0x2424, 0x0000, 0x1616, 0x1616, 0x1616, 0x0016, 0x0016, 0x1616, 0x1616, 0x1600, - 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1600, 0x1616, 0x1616, 0x1616, 0x1616, 0x2416, 0x0000, 0x0000, 0x0000, - 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x2116, 0x3535, 0x2135, 0x2121, 0x2121, 0x2121, 0x0021, 0x0000, 0x0000, - 0x2121, 0x3535, 0x1600, 0x1616, 0x1616, 0x1616, 0x0016, 0x1600, 0x3521, 0x3535, 0x0035, 0x3500, 0x0035, 0x3500, 0x3535, 0x0000, - 0x0016, 0x0000, 0x0000, 0x3500, 0x0000, 0x0000, 0x1600, 0x1616, 0x1616, 0x3535, 0x0000, 0x2121, 0x2121, 0x2121, 0x0021, 0x0000, - 0x2121, 0x2121, 0x0021, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3535, 0x2135, 0x2121, 0x2121, 0x3521, 0x3521, 0x3535, 0x2135, - 0x3521, 0x2121, 0x1616, 0x1624, 0x0000, 0x0000, 0x0000, 0x0000, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x3516, - 0x3535, 0x2121, 0x2121, 0x0000, 0x3535, 0x3535, 0x2121, 0x2135, 0x2421, 0x2424, 0x2424, 0x2424, 0x2424, 0x2424, 0x2424, 0x2424, - 0x2424, 0x2424, 0x2424, 0x2424, 0x1616, 0x1616, 0x2121, 0x0000, 0x3535, 0x2135, 0x2121, 0x2121, 0x2121, 0x3521, 0x2135, 0x2135, - 0x2421, 0x2424, 0x0016, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x2116, 0x2135, 0x3535, - 0x2121, 0x2121, 0x2121, 0x2135, 0x0000, 0x0000, 0x0000, 0x0000, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x0000, 0x2100, 0x2121, - 0x3535, 0x2121, 0x2121, 0x2135, 0x2121, 0x2121, 0x0000, 0x0000, 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, 0x3737, 0x2424, 0x2224, - 0x3737, 0x0037, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1600, 0x3939, 0x3939, 0x3939, 0x3939, 0x3939, 0x3939, 0x3939, 0x0039, - 0x2424, 0x2424, 0x0024, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2121, 0x2121, 0x2421, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x2121, 0x2121, 0x2121, 0x2421, 0x2424, 0x2424, 0x2222, 0x2222, 0x1f1f, 0x1f1f, 0x2224, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x3636, 0x3636, 0x3636, 0x3636, 0x3636, 0x3700, 0x3737, 0x3737, 0x3737, 0x1600, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, - 0x1616, 0x1616, 0x1616, 0x1616, 0x0000, 0x0000, 0x1600, 0x1616, 0x3516, 0x3535, 0x3535, 0x3535, 0x3535, 0x3535, 0x3535, 0x3535, - 0x3535, 0x3535, 0x3535, 0x3535, 0x3535, 0x3535, 0x3535, 0x3535, 0x3535, 0x3535, 0x3535, 0x3535, 0x3535, 0x3535, 0x3535, 0x0035, - 0x2121, 0x1f21, 0x1f1f, 0x1f1f, 0x1f1f, 0x1f1f, 0x1f1f, 0x1f1f, 0x1616, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1616, 0x1616, 0x1616, 0x1616, 0x1616, 0x0000, 0x2122, 0x2421, 0x1818, 0x1818, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x2222, 0x2222, 0x2222, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2222, 0x2222, 0x2222, 0x0022, 0x2200, 0x2222, 0x2222, 0x2222, - 0x2222, 0x2222, 0x3522, 0x2135, 0x2121, 0x2222, 0x3522, 0x3535, 0x3535, 0x1835, 0x1818, 0x1818, 0x1818, 0x2118, 0x2121, 0x2121, - 0x2121, 0x2221, 0x2122, 0x2121, 0x2121, 0x2121, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2121, 0x2121, 0x2222, - 0x2222, 0x2222, 0x2222, 0x2222, 0x0022, 0x0000, 0x0000, 0x0000, 0x1515, 0x2121, 0x1521, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x3737, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1313, 0x1313, 0x1313, - 0x1313, 0x1313, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1313, - 0x1313, 0x1313, 0x0013, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1010, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, - 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x0010, 0x1010, 0x0000, 0x0010, 0x1000, 0x0010, 0x1000, 0x1010, 0x0010, 0x1010, - 0x1010, 0x1010, 0x1010, 0x1313, 0x1313, 0x1300, 0x1300, 0x1313, 0x1313, 0x1313, 0x1300, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, - 0x1313, 0x1313, 0x1010, 0x1000, 0x1010, 0x0010, 0x1000, 0x1010, 0x1010, 0x1010, 0x0010, 0x1010, 0x1010, 0x1010, 0x0010, 0x1313, - 0x1313, 0x1313, 0x1313, 0x1313, 0x1010, 0x1000, 0x1010, 0x0010, 0x1010, 0x1010, 0x0010, 0x0010, 0x0000, 0x1010, 0x1010, 0x1010, - 0x0010, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1010, 0x1010, - 0x1010, 0x1010, 0x1010, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x0000, 0x1010, 0x1010, 0x1010, 0x1010, - 0x5310, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x0f13, 0x1313, 0x1313, - 0x1313, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x5310, 0x1313, 0x1313, - 0x1313, 0x1313, 0x0f13, 0x1313, 0x1313, 0x1313, 0x1010, 0x1010, 0x1010, 0x1010, 0x5310, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, - 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x1313, 0x0f13, 0x1313, 0x1313, 0x1313, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, - 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x1010, 0x5310, 0x1313, 0x1313, 0x1313, 0x1313, 0x0f13, 0x1313, 0x1313, 0x1313, - 0x1010, 0x1010, 0x1010, 0x1010, 0x5310, 0x1313, 0x1313, 0x1313, 0x1313, 0x0f13, 0x1313, 0x1313, 0x1313, 0x1310, 0x0000, 0x0e0e, - 0x0e0e, 0x0e0e, 0x0e0e, 0x0e0e, 0x0e0e, 0x0e0e, 0x0e0e, 0x0e0e, 0x2121, 0x2121, 0x2121, 0x2221, 0x2222, 0x2122, 0x2121, 0x2121, - 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2121, 0x2221, 0x2222, 0x2222, 0x2222, 0x2122, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, - 0x2222, 0x2222, 0x2221, 0x2422, 0x2424, 0x2424, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2100, 0x2121, 0x2121, - 0x2828, 0x2828, 0x0028, 0x4e00, 0x4e4e, 0x4e4e, 0x4e4e, 0x4e4e, 0x2121, 0x2121, 0x2121, 0x0021, 0x0000, 0x0000, 0x0000, 0x0000, - 0x2e2e, 0x2e2e, 0x2e00, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e00, 0x002e, 0x002e, 0x2e00, 0x2e00, 0x2e2e, 0x2e2e, 0x2e2e, - 0x2e2e, 0x002e, 0x2e2e, 0x2e2e, 0x2e00, 0x2e00, 0x0000, 0x0000, 0x0000, 0x002e, 0x0000, 0x2e00, 0x2e00, 0x2e00, 0x2e00, 0x2e2e, - 0x2e00, 0x002e, 0x002e, 0x2e00, 0x2e00, 0x2e00, 0x2e00, 0x2e00, 0x2e00, 0x002e, 0x002e, 0x2e00, 0x2e2e, 0x002e, 0x2e2e, 0x2e2e, - 0x2e2e, 0x002e, 0x2e2e, 0x2e2e, 0x2e00, 0x2e2e, 0x002e, 0x002e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e00, 0x2e2e, 0x2e2e, - 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x2e2e, 0x0000, 0x0000, 0x2e00, 0x2e2e, 0x2e00, 0x2e2e, 0x2e2e, 0x2e00, 0x2e2e, 0x2e2e, - 0x0f0f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x0015, - 0x1500, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x1b1b, 0x1d1b, 0x001d, 0x0000, - 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x1515, 0x0000, 0x0000, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x0022, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x2222, 0x0022, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x2222, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1115, 0x1111, 0x1111, - 0x1515, 0x1515, 0x1500, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x0015, 0x0000, - 0x1515, 0x1515, 0x0015, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1515, 0x1515, 0x1515, 0x1515, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x1515, 0x0000, 0x1515, 0x1515, 0x1515, 0x1515, 0x0015, 0x0000, 0x0000, 0x0000, - 0x1800, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, 0x1818, - 0x4a4a, 0x4a4a, 0x4a4a, 0x4a4a, 0x4a4a, 0x4a4a, 0x4a4a, 0x0000, 0xeeee, 0xeeee - }; - - private static byte[] s_pCategoriesValue = new byte[] - { - 0x1d, 0x00, 0x0e, 0x0e, 0x0e, 0x10, 0x0e, 0x0f, 0x0e, 0x11, 0x0b, 0x11, 0x18, 0x12, 0x18, 0x0a, - 0x1a, 0x0a, 0x14, 0x12, 0x15, 0x12, 0x19, 0x09, 0x18, 0x0c, 0x13, 0x09, 0x08, 0x08, 0x19, 0x12, - 0x00, 0x00, 0x1b, 0x12, 0x12, 0x12, 0x01, 0x00, 0x0b, 0x0c, 0x1c, 0x12, 0x04, 0x00, 0x16, 0x12, - 0x0f, 0x0e, 0x1c, 0x0a, 0x19, 0x0a, 0x0a, 0x08, 0x17, 0x12, 0x0a, 0x12, 0x02, 0x00, 0x03, 0x00, - 0x03, 0x12, 0x05, 0x0d, 0x1c, 0x00, 0x07, 0x0d, 0x18, 0x00, 0x13, 0x12, 0x13, 0x03, 0x18, 0x03, - 0x04, 0x03, 0x0f, 0x0b, 0x19, 0x04, 0x1a, 0x04, 0x18, 0x04, 0x0f, 0x04, 0x04, 0x04, 0x03, 0x04, - 0x08, 0x0b, 0x18, 0x0b, 0x1c, 0x04, 0x08, 0x03, 0x03, 0x03, 0x06, 0x00, 0x08, 0x00, 0x0a, 0x00, - 0x05, 0x00, 0x09, 0x00, 0x0f, 0x00, 0x0f, 0x03, 0x0c, 0x11, 0x0d, 0x0f, 0x0f, 0x01, 0x0f, 0x05, - 0x0f, 0x07, 0x0f, 0x02, 0x0f, 0x06, 0x19, 0x0c, 0x0f, 0x13, 0x0f, 0x14, 0x0f, 0x15, 0x0f, 0x16, - 0x1b, 0x00, 0x10, 0x00, 0x11, 0x00, 0x1b, 0x04, 0x0f, 0x12, 0x09, 0x12, 0x0a, 0x03, 0x1c, 0x03, - 0x00, 0x03, 0x01, 0x03, 0x0a, 0x0b, 0x19, 0x00 - }; - // 12:4:4 index table of the Unicode numeric data. - private static ushort[] s_pNumericLevel1Index = new ushort[] - { - 0x1100, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1120, 0x1130, 0x1110, 0x1140, 0x1150, 0x1160, 0x1170, 0x1180, 0x1190, 0x11a0, - 0x11b0, 0x1110, 0x1110, 0x11c0, 0x1110, 0x1110, 0x11d0, 0x11e0, 0x11f0, 0x1200, 0x1210, 0x1220, 0x1230, 0x1110, 0x1110, 0x1110, - 0x1240, 0x1250, 0x1110, 0x1110, 0x1260, 0x1110, 0x1110, 0x1270, 0x1110, 0x1110, 0x1110, 0x1110, 0x1280, 0x1110, 0x1110, 0x1110, - 0x1290, 0x12a0, 0x12b0, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x12c0, 0x1110, 0x12d0, 0x12e0, 0x12f0, 0x1300, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1310, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x11f0, - 0x1110, 0x1320, 0x1330, 0x1340, 0x1350, 0x1110, 0x1110, 0x1110, 0x1360, 0x1370, 0x1380, 0x1390, 0x13a0, 0x1110, 0x13b0, 0x1110, - 0x13c0, 0x13d0, 0x1300, 0x1110, 0x13e0, 0x1110, 0x13f0, 0x1400, 0x1410, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1420, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1430, 0x1440, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1450, 0x1110, 0x1110, 0x1110, 0x1460, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1470, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1480, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1490, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, 0x1110, - 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14b0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14b8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14b8, 0x14c0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14b8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14b8, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14b8, 0x14c8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14b8, 0x14d0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14b8, 0x14d8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14b8, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14b8, 0x14e0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14b8, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14e8, 0x14f0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14f8, 0x1500, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x1508, 0x1510, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x1518, - 0x14a0, 0x14a8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14b8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x1520, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x14a8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x14a8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x1528, 0x1530, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x1538, 0x1540, 0x1540, 0x1548, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x1550, 0x1558, 0x1560, 0x1568, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x1570, 0x1578, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x1580, 0x1588, 0x1590, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x1598, - 0x15a0, 0x14a0, 0x15a8, 0x15b0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x15b8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x15c0, 0x14a0, 0x15c8, 0x15d0, 0x14a0, 0x14a0, 0x15c0, 0x14a0, 0x14a0, 0x15d8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x15e0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x15e8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x14a0, 0x14a0, - 0x14a8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x14a0, 0x14a8, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x15f0, 0x15f8, 0x14a0, 0x14a0, 0x14a0, 0x1600, 0x14a0, 0x1608, 0x14a0, 0x1610, - 0x1618, 0x1620, 0x1628, 0x1630, 0x1638, 0x1640, 0x1648, 0x1650, 0x1658, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x1660, 0x1668, - 0x14a0, 0x14a0, 0x1670, 0x14a0, 0x1678, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x1680, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x1688, 0x14a0, 0x1690, 0x14a0, 0x14a0, 0x1698, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x16a0, - 0x14a0, 0x16a8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x16b0, 0x16b8, 0x16c0, 0x16c8, 0x16d0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x16d8, 0x14a0, 0x14a0, 0x16e0, 0x14a0, 0x16e8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x16a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x16f0, 0x14a0, 0x16f0, 0x14a0, 0x14a0, 0x16f8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x1700, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x1708, 0x1710, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x1718, 0x1720, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, - 0x14a0, 0x14a0, 0x14a0, 0x14b8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x1660, 0x1728, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x1730, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x1738, 0x1740, - 0x1748, 0x1750, 0x1758, 0x1760, 0x1768, 0x1770, 0x1778, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x1780, 0x1788, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x16b8, 0x1790, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x1798, 0x17a0, 0x17a8, 0x17b0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x1618, 0x14a0, 0x14a0, 0x14a0, - 0x17b8, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x17c0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, 0x14a0, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0201, 0x0403, 0x0605, 0x0807, 0x0a09, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0c0b, 0x0000, 0x0000, 0x0d00, 0x0000, 0x0f0e, 0x0010, 0x0000, 0x0000, 0x0000, 0x0201, 0x0403, 0x0605, 0x0807, 0x0a09, - 0x0000, 0x0000, 0x1211, 0x0e13, 0x1410, 0x0000, 0x0000, 0x0000, 0x0000, 0x0f0e, 0x1110, 0x1312, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1615, 0x0017, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1918, 0x1b1a, 0x1a19, 0x001b, - 0x1615, 0x0e17, 0x100f, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0201, 0x0403, 0x0605, 0x0807, 0x0a09, 0x1c0f, 0x1e1d, 0x201f, - 0x2221, 0x2423, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0d00, 0x0c0b, 0x2625, 0x2827, - 0x2a29, 0x2b15, 0x2d2c, 0x2f2e, 0x3130, 0x1632, 0x0033, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3534, - 0x0036, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1918, 0x1b1a, 0x3837, 0x3a39, 0x3c3b, 0x0000, 0x0000, 0x0000, - 0x0201, 0x0403, 0x0605, 0x0807, 0x0a09, 0x000d, 0x0000, 0x0000, 0x003d, 0x0000, 0x2625, 0x2827, 0x2a29, 0x0000, 0x0000, 0x0000, - 0x0d3d, 0x0c0b, 0x2625, 0x2827, 0x2a29, 0x0000, 0x0000, 0x0000, 0x3f3e, 0x4140, 0x4342, 0x4544, 0x4746, 0x1248, 0x4a49, 0x194b, - 0x1a19, 0x371b, 0x3938, 0x3b3a, 0x153c, 0x4d4c, 0x162e, 0x174e, 0x4f17, 0x0033, 0x3900, 0x502e, 0x1851, 0x0000, 0x0000, 0x0000, - 0x0b0d, 0x250c, 0x2726, 0x2928, 0x152a, 0x4d4c, 0x5352, 0x1454, 0x3534, 0x2b36, 0x0b0d, 0x250c, 0x2726, 0x2928, 0x152a, 0x4d4c, - 0x5352, 0x1454, 0x3534, 0x2b36, 0x0b0d, 0x250c, 0x2726, 0x2928, 0x152a, 0x4d4c, 0x5352, 0x1454, 0x3534, 0x2b36, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x4c3d, 0x524d, 0x5453, 0x3414, 0x3635, 0x0d2b, 0x0c0b, 0x2625, 0x2827, 0x2a29, 0x3d15, - 0x0000, 0x0000, 0x0000, 0x0b0d, 0x250c, 0x2726, 0x2928, 0x152a, 0x0b0d, 0x250c, 0x2726, 0x2928, 0x152a, 0x0b0d, 0x250c, 0x2726, - 0x2928, 0x152a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0f00, 0x0000, - 0x0000, 0x0000, 0x0000, 0x1800, 0x0000, 0x0000, 0x0000, 0x0000, 0x1900, 0x1b1a, 0x3837, 0x3a39, 0x3c3b, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x2b15, 0x002c, 0x0000, 0x0000, 0x0000, 0x1a19, 0x371b, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x1a19, 0x371b, 0x3938, 0x3b3a, 0x153c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2b15, 0x2d2c, 0x2f2e, 0x3130, - 0x5500, 0x5756, 0x5958, 0x5b5a, 0x5d5c, 0x5e2c, 0x605f, 0x6261, 0x6300, 0x6564, 0x2d66, 0x6867, 0x6a69, 0x6c6b, 0x6e6d, 0x2e6f, - 0x0000, 0x0000, 0x0000, 0x1a19, 0x371b, 0x3938, 0x3b3a, 0x183c, 0x0f0e, 0x1110, 0x1312, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1b00, 0x0000, 0x0000, 0x0000, 0x1500, 0x0000, 0x0000, 0x001a, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0018, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3900, 0x3900, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1500, 0x0000, 0x0000, 0x0000, 0x0000, 0x1900, 0x1b1a, 0x3837, 0x3a39, 0x3c3b, - 0x2b15, 0x2d2c, 0x2f2e, 0x3130, 0x1632, 0x7170, 0x4e72, 0x7473, 0x7675, 0x7717, 0x7978, 0x7a4f, 0x7c7b, 0x337d, 0x7f7e, 0x5080, - 0x8281, 0x8483, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0f0e, 0x3819, 0x4e2e, 0x504f, 0x1538, 0x162e, 0x174e, 0x384f, - 0x2e15, 0x4e16, 0x3317, 0x1550, 0x1919, 0x1a19, 0x1a1a, 0x381a, 0x1515, 0x1515, 0x2c15, 0x2e2e, 0x2e2e, 0x7116, 0x4e4e, 0x4e4e, - 0x174e, 0x384f, 0x0f2e, 0x420f, 0x0010, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0e18, 0x0000, 0x0000, - 0x1900, 0x1b1a, 0x3837, 0x3a39, 0x3c3b, 0x2b15, 0x2d2c, 0x2f2e, 0x3130, 0x1632, 0x7170, 0x4e72, 0x7473, 0x7675, 0x0000, 0x0000, - 0x3819, 0x2e15, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3200, 0x0000, 0x0000, 0x0000, 0x0000, 0x0076, 0x0000, 0x0000, - 0x1900, 0x151a, 0x162b, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1a19, 0x151b, 0x162b, 0x3317, - 0x0000, 0x0000, 0x0000, 0x0000, 0x1900, 0x1b1a, 0x3837, 0x2b15, 0x0000, 0x0000, 0x0000, 0x1900, 0x1b1a, 0x3737, 0x1538, 0x162b, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1900, 0x1538, 0x162b, 0x0000, 0x0000, 0x0000, 0x1519, 0x162b, 0x1b1a, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0f85, 0x0000, 0x1a19, 0x371b, 0x3938, 0x3b3a, 0x153c, 0x2c2b, 0x2e2d, 0x302f, - 0x0000, 0x7016, 0x7271, 0x734e, 0x7574, 0x1776, 0x7877, 0x4f79, 0x7b7a, 0x7d7c, 0x7e33, 0x807f, 0x8150, 0x8382, 0x5184, 0x8786, - 0x8988, 0x8b8a, 0x8d8c, 0x8f8e, 0x9190, 0x9392, 0x9594, 0x9796, 0x0b0d, 0x250c, 0x2b15, 0x1716, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1900, 0x002e, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1900, 0x2b15, - 0x0000, 0x0000, 0x0000, 0x0000, 0x1a19, 0x371b, 0x2b15, 0x1716, 0x0000, 0x0000, 0x0000, 0x0000, 0x1900, 0x1b1a, 0x1537, 0x162b, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x3819, 0x2e15, 0x1716, 0x0b0d, 0x250c, 0x2726, 0x2928, 0x152a, 0x2c2b, 0x2e2d, 0x302f, - 0x3231, 0x7016, 0x7271, 0x734e, 0x7574, 0x0f76, 0x410e, 0x0042, 0x0000, 0x0b0d, 0x250c, 0x2726, 0x2928, 0x152a, 0x2c2b, 0x2e2d, - 0x302f, 0x3231, 0x1716, 0x0201, 0x0403, 0x0605, 0x0807, 0x0a09, 0x3130, 0x1632, 0x0017, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0201, 0x0403, 0x0605, 0x0807, 0x0a09, 0x2b15, 0x0000, 0x0000, 0x0201, 0x0403, 0x0605, 0x0807, 0x0a09, 0x2b15, 0x2d2c, 0x2f2e, - 0x3130, 0x0032, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x1b1a, 0x3837, 0x3a39, 0x3c3b, 0x371b, 0x3938, 0x3b3a, 0x373c, - 0x3938, 0x3b3a, 0x193c, 0x1b1a, 0x3837, 0x3a39, 0x3c3b, 0x1a19, 0x371b, 0x1a38, 0x1b1b, 0x3837, 0x3a39, 0x3c3b, 0x1a19, 0x1b1b, - 0x3837, 0x9998, 0x1a19, 0x1b1b, 0x3837, 0x1b1b, 0x3737, 0x3737, 0x3a39, 0x3a3a, 0x3b3b, 0x3c3c, 0x3c3c, 0x1b1a, 0x3837, 0x1939, - 0x1b1a, 0x3737, 0x3838, 0x1b1a, 0x1a19, 0x4241, 0x4148, 0x1242, 0x470e, 0x0e0e, 0x410f, 0x2d42, 0x372e, 0x3938, 0x3b3a, 0x003c, - 0x0201, 0x0403, 0x0605, 0x0807, 0x0a09, 0x1500, 0x3316, 0x9b9a, 0x9d9c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x3231, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0201, - 0x0403, 0x0605, 0x0807, 0x0a09, 0x0201, 0x0403, 0x0605, 0x0807, 0x0a09, 0x0201, 0x0403, 0x0605, 0x0807, 0x0a09, 0x0201, 0x0403, - 0x0605, 0x0807, 0x0a09, 0x0201, 0x0403, 0x0605, 0x0807, 0x0a09, 0x3d3d, 0x0b0d, 0x250c, 0x2726, 0x2928, 0x182a, 0x0018, 0x0000, - 0x003c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xeeee, 0xeeee, 0xeeee, 0xeeee - }; - // Every item contains the value for numeric value. - private static byte[] s_pNumericValues = new byte[] - { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x3f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x3f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x8f, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4e, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x51, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x56, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0xc3, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x92, 0x24, 0x49, 0x92, 0x24, 0x49, 0xc2, 0x3f, 0x1c, 0xc7, 0x71, 0x1c, 0xc7, 0x71, 0xbc, 0x3f, - 0x9a, 0x99, 0x99, 0x99, 0x99, 0x99, 0xb9, 0x3f, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5, 0x3f, - 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xe5, 0x3f, 0x9a, 0x99, 0x99, 0x99, 0x99, 0x99, 0xc9, 0x3f, - 0x9a, 0x99, 0x99, 0x99, 0x99, 0x99, 0xd9, 0x3f, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0xe3, 0x3f, - 0x9a, 0x99, 0x99, 0x99, 0x99, 0x99, 0xe9, 0x3f, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xc5, 0x3f, - 0xab, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xea, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x3f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x3f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x7f, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0xb3, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x6a, 0xe8, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6a, 0xf8, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x35, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x39, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3d, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x41, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x42, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x43, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x44, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x45, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x46, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x47, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x48, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x69, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x72, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x79, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x82, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x85, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x89, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x8c, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x9f, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xa7, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xaf, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xb7, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0xbb, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xbf, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x94, 0xc1, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0xd3, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0xdd, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0xe3, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0xed, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0xf1, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0xf3, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xf9, 0xf5, 0x40, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xed, 0x3f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x6a, 0x08, 0x41, 0x00, 0x00, 0x00, 0x00, 0x80, 0x4f, 0x12, 0x41, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x6a, 0x18, 0x41, 0x00, 0x00, 0x00, 0x00, 0x80, 0x84, 0x1e, 0x41, - 0x00, 0x00, 0x00, 0x00, 0x80, 0x4f, 0x22, 0x41, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x5c, 0x25, 0x41, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x6a, 0x28, 0x41, 0x00, 0x00, 0x00, 0x00, 0x40, 0x77, 0x2b, 0x41, - 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xb5, 0x3f, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xc5, 0x3f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x3f, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xd5, 0x3f, - 0xab, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xda, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f, - 0xab, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xe2, 0x3f, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0xe5, 0x3f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x3f, 0xab, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xea, 0x3f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x5e, 0x0a, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5e, 0x1a, 0x41, - 0x00, 0x00, 0x00, 0x00, 0x80, 0x84, 0x2e, 0x41, 0x00, 0x00, 0x00, 0x00, 0x84, 0xd7, 0x97, 0x41, - 0x00, 0x00, 0x00, 0x20, 0x5f, 0xa0, 0x02, 0x42, 0x00, 0x00, 0x00, 0xa2, 0x94, 0x1a, 0x6d, 0x42 - }; - - private static ushort[] s_pDigitValues = new ushort [] - { - 0xffff, 0x0000, 0x0101, 0x0202, 0x0303, 0x0404, 0x0505, 0x0606, - 0x0707, 0x0808, 0x0909, 0xff02, 0xff03, 0xff01, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff04, 0xff05, 0xff06, - 0xff07, 0xff08, 0xff09, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xff00, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, - 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x0000, 0x0000 - }; - - } -} diff --git a/src/mscorlib/corefx/System/Globalization/ChineseLunisolarCalendar.cs b/src/mscorlib/corefx/System/Globalization/ChineseLunisolarCalendar.cs deleted file mode 100644 index 5002555384..0000000000 --- a/src/mscorlib/corefx/System/Globalization/ChineseLunisolarCalendar.cs +++ /dev/null @@ -1,395 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Diagnostics.Contracts; - -namespace System.Globalization -{ - //////////////////////////////////////////////////////////////////////////// - // - // Notes about ChineseLunisolarCalendar - // - //////////////////////////////////////////////////////////////////////////// - /* - ** Calendar support range: - ** Calendar Minimum Maximum - ** ========== ========== ========== - ** Gregorian 1901/02/19 2101/01/28 - ** ChineseLunisolar 1901/01/01 2100/12/29 - */ - [Serializable] - public class ChineseLunisolarCalendar : EastAsianLunisolarCalendar - { - // - // The era value for the current era. - // - - public const int ChineseEra = 1; - - internal const int MIN_LUNISOLAR_YEAR = 1901; - internal const int MAX_LUNISOLAR_YEAR = 2100; - - internal const int MIN_GREGORIAN_YEAR = 1901; - internal const int MIN_GREGORIAN_MONTH = 2; - internal const int MIN_GREGORIAN_DAY = 19; - - internal const int MAX_GREGORIAN_YEAR = 2101; - internal const int MAX_GREGORIAN_MONTH = 1; - internal const int MAX_GREGORIAN_DAY = 28; - - internal static DateTime minDate = new DateTime(MIN_GREGORIAN_YEAR, MIN_GREGORIAN_MONTH, MIN_GREGORIAN_DAY); - internal static DateTime maxDate = new DateTime((new DateTime(MAX_GREGORIAN_YEAR, MAX_GREGORIAN_MONTH, MAX_GREGORIAN_DAY, 23, 59, 59, 999)).Ticks + 9999); - - public override DateTime MinSupportedDateTime - { - get - { - return (minDate); - } - } - - - public override DateTime MaxSupportedDateTime - { - get - { - return (maxDate); - } - } - - protected override int DaysInYearBeforeMinSupportedYear - { - get - { - // 1900: 1-29 2-30 3-29 4-29 5-30 6-29 7-30 8-30 Leap8-29 9-30 10-30 11-29 12-30 from Calendrical Tabulations - return 384; - } - } - - - private static readonly int[,] s_yinfo = - { - /*Y LM Lmon Lday DaysPerMonth D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 #Days - 1901 */ - { 0 , 2 , 19 , 19168 },/* 29 30 29 29 30 29 30 29 30 30 30 29 0 354 -1902 */{ 0 , 2 , 8 , 42352 },/* 30 29 30 29 29 30 29 30 29 30 30 30 0 355 -1903 */{ 5 , 1 , 29 , 21096 },/* 29 30 29 30 29 29 30 29 29 30 30 29 30 383 -1904 */{ 0 , 2 , 16 , 53856 },/* 30 30 29 30 29 29 30 29 29 30 30 29 0 354 -1905 */{ 0 , 2 , 4 , 55632 },/* 30 30 29 30 30 29 29 30 29 30 29 30 0 355 -1906 */{ 4 , 1 , 25 , 27304 },/* 29 30 30 29 30 29 30 29 30 29 30 29 30 384 -1907 */{ 0 , 2 , 13 , 22176 },/* 29 30 29 30 29 30 30 29 30 29 30 29 0 354 -1908 */{ 0 , 2 , 2 , 39632 },/* 30 29 29 30 30 29 30 29 30 30 29 30 0 355 -1909 */{ 2 , 1 , 22 , 19176 },/* 29 30 29 29 30 29 30 29 30 30 30 29 30 384 -1910 */{ 0 , 2 , 10 , 19168 },/* 29 30 29 29 30 29 30 29 30 30 30 29 0 354 -1911 */{ 6 , 1 , 30 , 42200 },/* 30 29 30 29 29 30 29 29 30 30 29 30 30 384 -1912 */{ 0 , 2 , 18 , 42192 },/* 30 29 30 29 29 30 29 29 30 30 29 30 0 354 -1913 */{ 0 , 2 , 6 , 53840 },/* 30 30 29 30 29 29 30 29 29 30 29 30 0 354 -1914 */{ 5 , 1 , 26 , 54568 },/* 30 30 29 30 29 30 29 30 29 29 30 29 30 384 -1915 */{ 0 , 2 , 14 , 46400 },/* 30 29 30 30 29 30 29 30 29 30 29 29 0 354 -1916 */{ 0 , 2 , 3 , 54944 },/* 30 30 29 30 29 30 30 29 30 29 30 29 0 355 -1917 */{ 2 , 1 , 23 , 38608 },/* 30 29 29 30 29 30 30 29 30 30 29 30 29 384 -1918 */{ 0 , 2 , 11 , 38320 },/* 30 29 29 30 29 30 29 30 30 29 30 30 0 355 -1919 */{ 7 , 2 , 1 , 18872 },/* 29 30 29 29 30 29 29 30 30 29 30 30 30 384 -1920 */{ 0 , 2 , 20 , 18800 },/* 29 30 29 29 30 29 29 30 29 30 30 30 0 354 -1921 */{ 0 , 2 , 8 , 42160 },/* 30 29 30 29 29 30 29 29 30 29 30 30 0 354 -1922 */{ 5 , 1 , 28 , 45656 },/* 30 29 30 30 29 29 30 29 29 30 29 30 30 384 -1923 */{ 0 , 2 , 16 , 27216 },/* 29 30 30 29 30 29 30 29 29 30 29 30 0 354 -1924 */{ 0 , 2 , 5 , 27968 },/* 29 30 30 29 30 30 29 30 29 30 29 29 0 354 -1925 */{ 4 , 1 , 24 , 44456 },/* 30 29 30 29 30 30 29 30 30 29 30 29 30 385 -1926 */{ 0 , 2 , 13 , 11104 },/* 29 29 30 29 30 29 30 30 29 30 30 29 0 354 -1927 */{ 0 , 2 , 2 , 38256 },/* 30 29 29 30 29 30 29 30 29 30 30 30 0 355 -1928 */{ 2 , 1 , 23 , 18808 },/* 29 30 29 29 30 29 29 30 29 30 30 30 30 384 -1929 */{ 0 , 2 , 10 , 18800 },/* 29 30 29 29 30 29 29 30 29 30 30 30 0 354 -1930 */{ 6 , 1 , 30 , 25776 },/* 29 30 30 29 29 30 29 29 30 29 30 30 29 383 -1931 */{ 0 , 2 , 17 , 54432 },/* 30 30 29 30 29 30 29 29 30 29 30 29 0 354 -1932 */{ 0 , 2 , 6 , 59984 },/* 30 30 30 29 30 29 30 29 29 30 29 30 0 355 -1933 */{ 5 , 1 , 26 , 27976 },/* 29 30 30 29 30 30 29 30 29 30 29 29 30 384 -1934 */{ 0 , 2 , 14 , 23248 },/* 29 30 29 30 30 29 30 29 30 30 29 30 0 355 -1935 */{ 0 , 2 , 4 , 11104 },/* 29 29 30 29 30 29 30 30 29 30 30 29 0 354 -1936 */{ 3 , 1 , 24 , 37744 },/* 30 29 29 30 29 29 30 30 29 30 30 30 29 384 -1937 */{ 0 , 2 , 11 , 37600 },/* 30 29 29 30 29 29 30 29 30 30 30 29 0 354 -1938 */{ 7 , 1 , 31 , 51560 },/* 30 30 29 29 30 29 29 30 29 30 30 29 30 384 -1939 */{ 0 , 2 , 19 , 51536 },/* 30 30 29 29 30 29 29 30 29 30 29 30 0 354 -1940 */{ 0 , 2 , 8 , 54432 },/* 30 30 29 30 29 30 29 29 30 29 30 29 0 354 -1941 */{ 6 , 1 , 27 , 55888 },/* 30 30 29 30 30 29 30 29 29 30 29 30 29 384 -1942 */{ 0 , 2 , 15 , 46416 },/* 30 29 30 30 29 30 29 30 29 30 29 30 0 355 -1943 */{ 0 , 2 , 5 , 22176 },/* 29 30 29 30 29 30 30 29 30 29 30 29 0 354 -1944 */{ 4 , 1 , 25 , 43736 },/* 30 29 30 29 30 29 30 29 30 30 29 30 30 385 -1945 */{ 0 , 2 , 13 , 9680 },/* 29 29 30 29 29 30 29 30 30 30 29 30 0 354 -1946 */{ 0 , 2 , 2 , 37584 },/* 30 29 29 30 29 29 30 29 30 30 29 30 0 354 -1947 */{ 2 , 1 , 22 , 51544 },/* 30 30 29 29 30 29 29 30 29 30 29 30 30 384 -1948 */{ 0 , 2 , 10 , 43344 },/* 30 29 30 29 30 29 29 30 29 30 29 30 0 354 -1949 */{ 7 , 1 , 29 , 46248 },/* 30 29 30 30 29 30 29 29 30 29 30 29 30 384 -1950 */{ 0 , 2 , 17 , 27808 },/* 29 30 30 29 30 30 29 29 30 29 30 29 0 354 -1951 */{ 0 , 2 , 6 , 46416 },/* 30 29 30 30 29 30 29 30 29 30 29 30 0 355 -1952 */{ 5 , 1 , 27 , 21928 },/* 29 30 29 30 29 30 29 30 30 29 30 29 30 384 -1953 */{ 0 , 2 , 14 , 19872 },/* 29 30 29 29 30 30 29 30 30 29 30 29 0 354 -1954 */{ 0 , 2 , 3 , 42416 },/* 30 29 30 29 29 30 29 30 30 29 30 30 0 355 -1955 */{ 3 , 1 , 24 , 21176 },/* 29 30 29 30 29 29 30 29 30 29 30 30 30 384 -1956 */{ 0 , 2 , 12 , 21168 },/* 29 30 29 30 29 29 30 29 30 29 30 30 0 354 -1957 */{ 8 , 1 , 31 , 43344 },/* 30 29 30 29 30 29 29 30 29 30 29 30 29 383 -1958 */{ 0 , 2 , 18 , 59728 },/* 30 30 30 29 30 29 29 30 29 30 29 30 0 355 -1959 */{ 0 , 2 , 8 , 27296 },/* 29 30 30 29 30 29 30 29 30 29 30 29 0 354 -1960 */{ 6 , 1 , 28 , 44368 },/* 30 29 30 29 30 30 29 30 29 30 29 30 29 384 -1961 */{ 0 , 2 , 15 , 43856 },/* 30 29 30 29 30 29 30 30 29 30 29 30 0 355 -1962 */{ 0 , 2 , 5 , 19296 },/* 29 30 29 29 30 29 30 30 29 30 30 29 0 354 -1963 */{ 4 , 1 , 25 , 42352 },/* 30 29 30 29 29 30 29 30 29 30 30 30 29 384 -1964 */{ 0 , 2 , 13 , 42352 },/* 30 29 30 29 29 30 29 30 29 30 30 30 0 355 -1965 */{ 0 , 2 , 2 , 21088 },/* 29 30 29 30 29 29 30 29 29 30 30 29 0 353 -1966 */{ 3 , 1 , 21 , 59696 },/* 30 30 30 29 30 29 29 30 29 29 30 30 29 384 -1967 */{ 0 , 2 , 9 , 55632 },/* 30 30 29 30 30 29 29 30 29 30 29 30 0 355 -1968 */{ 7 , 1 , 30 , 23208 },/* 29 30 29 30 30 29 30 29 30 29 30 29 30 384 -1969 */{ 0 , 2 , 17 , 22176 },/* 29 30 29 30 29 30 30 29 30 29 30 29 0 354 -1970 */{ 0 , 2 , 6 , 38608 },/* 30 29 29 30 29 30 30 29 30 30 29 30 0 355 -1971 */{ 5 , 1 , 27 , 19176 },/* 29 30 29 29 30 29 30 29 30 30 30 29 30 384 -1972 */{ 0 , 2 , 15 , 19152 },/* 29 30 29 29 30 29 30 29 30 30 29 30 0 354 -1973 */{ 0 , 2 , 3 , 42192 },/* 30 29 30 29 29 30 29 29 30 30 29 30 0 354 -1974 */{ 4 , 1 , 23 , 53864 },/* 30 30 29 30 29 29 30 29 29 30 30 29 30 384 -1975 */{ 0 , 2 , 11 , 53840 },/* 30 30 29 30 29 29 30 29 29 30 29 30 0 354 -1976 */{ 8 , 1 , 31 , 54568 },/* 30 30 29 30 29 30 29 30 29 29 30 29 30 384 -1977 */{ 0 , 2 , 18 , 46400 },/* 30 29 30 30 29 30 29 30 29 30 29 29 0 354 -1978 */{ 0 , 2 , 7 , 46752 },/* 30 29 30 30 29 30 30 29 30 29 30 29 0 355 -1979 */{ 6 , 1 , 28 , 38608 },/* 30 29 29 30 29 30 30 29 30 30 29 30 29 384 -1980 */{ 0 , 2 , 16 , 38320 },/* 30 29 29 30 29 30 29 30 30 29 30 30 0 355 -1981 */{ 0 , 2 , 5 , 18864 },/* 29 30 29 29 30 29 29 30 30 29 30 30 0 354 -1982 */{ 4 , 1 , 25 , 42168 },/* 30 29 30 29 29 30 29 29 30 29 30 30 30 384 -1983 */{ 0 , 2 , 13 , 42160 },/* 30 29 30 29 29 30 29 29 30 29 30 30 0 354 -1984 */{ 10 , 2 , 2 , 45656 },/* 30 29 30 30 29 29 30 29 29 30 29 30 30 384 -1985 */{ 0 , 2 , 20 , 27216 },/* 29 30 30 29 30 29 30 29 29 30 29 30 0 354 -1986 */{ 0 , 2 , 9 , 27968 },/* 29 30 30 29 30 30 29 30 29 30 29 29 0 354 -1987 */{ 6 , 1 , 29 , 44448 },/* 30 29 30 29 30 30 29 30 30 29 30 29 29 384 -1988 */{ 0 , 2 , 17 , 43872 },/* 30 29 30 29 30 29 30 30 29 30 30 29 0 355 -1989 */{ 0 , 2 , 6 , 38256 },/* 30 29 29 30 29 30 29 30 29 30 30 30 0 355 -1990 */{ 5 , 1 , 27 , 18808 },/* 29 30 29 29 30 29 29 30 29 30 30 30 30 384 -1991 */{ 0 , 2 , 15 , 18800 },/* 29 30 29 29 30 29 29 30 29 30 30 30 0 354 -1992 */{ 0 , 2 , 4 , 25776 },/* 29 30 30 29 29 30 29 29 30 29 30 30 0 354 -1993 */{ 3 , 1 , 23 , 27216 },/* 29 30 30 29 30 29 30 29 29 30 29 30 29 383 -1994 */{ 0 , 2 , 10 , 59984 },/* 30 30 30 29 30 29 30 29 29 30 29 30 0 355 -1995 */{ 8 , 1 , 31 , 27432 },/* 29 30 30 29 30 29 30 30 29 29 30 29 30 384 -1996 */{ 0 , 2 , 19 , 23232 },/* 29 30 29 30 30 29 30 29 30 30 29 29 0 354 -1997 */{ 0 , 2 , 7 , 43872 },/* 30 29 30 29 30 29 30 30 29 30 30 29 0 355 -1998 */{ 5 , 1 , 28 , 37736 },/* 30 29 29 30 29 29 30 30 29 30 30 29 30 384 -1999 */{ 0 , 2 , 16 , 37600 },/* 30 29 29 30 29 29 30 29 30 30 30 29 0 354 -2000 */{ 0 , 2 , 5 , 51552 },/* 30 30 29 29 30 29 29 30 29 30 30 29 0 354 -2001 */{ 4 , 1 , 24 , 54440 },/* 30 30 29 30 29 30 29 29 30 29 30 29 30 384 -2002 */{ 0 , 2 , 12 , 54432 },/* 30 30 29 30 29 30 29 29 30 29 30 29 0 354 -2003 */{ 0 , 2 , 1 , 55888 },/* 30 30 29 30 30 29 30 29 29 30 29 30 0 355 -2004 */{ 2 , 1 , 22 , 23208 },/* 29 30 29 30 30 29 30 29 30 29 30 29 30 384 -2005 */{ 0 , 2 , 9 , 22176 },/* 29 30 29 30 29 30 30 29 30 29 30 29 0 354 -2006 */{ 7 , 1 , 29 , 43736 },/* 30 29 30 29 30 29 30 29 30 30 29 30 30 385 -2007 */{ 0 , 2 , 18 , 9680 },/* 29 29 30 29 29 30 29 30 30 30 29 30 0 354 -2008 */{ 0 , 2 , 7 , 37584 },/* 30 29 29 30 29 29 30 29 30 30 29 30 0 354 -2009 */{ 5 , 1 , 26 , 51544 },/* 30 30 29 29 30 29 29 30 29 30 29 30 30 384 -2010 */{ 0 , 2 , 14 , 43344 },/* 30 29 30 29 30 29 29 30 29 30 29 30 0 354 -2011 */{ 0 , 2 , 3 , 46240 },/* 30 29 30 30 29 30 29 29 30 29 30 29 0 354 -2012 */{ 4 , 1 , 23 , 46416 },/* 30 29 30 30 29 30 29 30 29 30 29 30 29 384 -2013 */{ 0 , 2 , 10 , 44368 },/* 30 29 30 29 30 30 29 30 29 30 29 30 0 355 -2014 */{ 9 , 1 , 31 , 21928 },/* 29 30 29 30 29 30 29 30 30 29 30 29 30 384 -2015 */{ 0 , 2 , 19 , 19360 },/* 29 30 29 29 30 29 30 30 30 29 30 29 0 354 -2016 */{ 0 , 2 , 8 , 42416 },/* 30 29 30 29 29 30 29 30 30 29 30 30 0 355 -2017 */{ 6 , 1 , 28 , 21176 },/* 29 30 29 30 29 29 30 29 30 29 30 30 30 384 -2018 */{ 0 , 2 , 16 , 21168 },/* 29 30 29 30 29 29 30 29 30 29 30 30 0 354 -2019 */{ 0 , 2 , 5 , 43312 },/* 30 29 30 29 30 29 29 30 29 29 30 30 0 354 -2020 */{ 4 , 1 , 25 , 29864 },/* 29 30 30 30 29 30 29 29 30 29 30 29 30 384 -2021 */{ 0 , 2 , 12 , 27296 },/* 29 30 30 29 30 29 30 29 30 29 30 29 0 354 -2022 */{ 0 , 2 , 1 , 44368 },/* 30 29 30 29 30 30 29 30 29 30 29 30 0 355 -2023 */{ 2 , 1 , 22 , 19880 },/* 29 30 29 29 30 30 29 30 30 29 30 29 30 384 -2024 */{ 0 , 2 , 10 , 19296 },/* 29 30 29 29 30 29 30 30 29 30 30 29 0 354 -2025 */{ 6 , 1 , 29 , 42352 },/* 30 29 30 29 29 30 29 30 29 30 30 30 29 384 -2026 */{ 0 , 2 , 17 , 42208 },/* 30 29 30 29 29 30 29 29 30 30 30 29 0 354 -2027 */{ 0 , 2 , 6 , 53856 },/* 30 30 29 30 29 29 30 29 29 30 30 29 0 354 -2028 */{ 5 , 1 , 26 , 59696 },/* 30 30 30 29 30 29 29 30 29 29 30 30 29 384 -2029 */{ 0 , 2 , 13 , 54576 },/* 30 30 29 30 29 30 29 30 29 29 30 30 0 355 -2030 */{ 0 , 2 , 3 , 23200 },/* 29 30 29 30 30 29 30 29 30 29 30 29 0 354 -2031 */{ 3 , 1 , 23 , 27472 },/* 29 30 30 29 30 29 30 30 29 30 29 30 29 384 -2032 */{ 0 , 2 , 11 , 38608 },/* 30 29 29 30 29 30 30 29 30 30 29 30 0 355 -2033 */{ 11 , 1 , 31 , 19176 },/* 29 30 29 29 30 29 30 29 30 30 30 29 30 384 -2034 */{ 0 , 2 , 19 , 19152 },/* 29 30 29 29 30 29 30 29 30 30 29 30 0 354 -2035 */{ 0 , 2 , 8 , 42192 },/* 30 29 30 29 29 30 29 29 30 30 29 30 0 354 -2036 */{ 6 , 1 , 28 , 53848 },/* 30 30 29 30 29 29 30 29 29 30 29 30 30 384 -2037 */{ 0 , 2 , 15 , 53840 },/* 30 30 29 30 29 29 30 29 29 30 29 30 0 354 -2038 */{ 0 , 2 , 4 , 54560 },/* 30 30 29 30 29 30 29 30 29 29 30 29 0 354 -2039 */{ 5 , 1 , 24 , 55968 },/* 30 30 29 30 30 29 30 29 30 29 30 29 29 384 -2040 */{ 0 , 2 , 12 , 46496 },/* 30 29 30 30 29 30 29 30 30 29 30 29 0 355 -2041 */{ 0 , 2 , 1 , 22224 },/* 29 30 29 30 29 30 30 29 30 30 29 30 0 355 -2042 */{ 2 , 1 , 22 , 19160 },/* 29 30 29 29 30 29 30 29 30 30 29 30 30 384 -2043 */{ 0 , 2 , 10 , 18864 },/* 29 30 29 29 30 29 29 30 30 29 30 30 0 354 -2044 */{ 7 , 1 , 30 , 42168 },/* 30 29 30 29 29 30 29 29 30 29 30 30 30 384 -2045 */{ 0 , 2 , 17 , 42160 },/* 30 29 30 29 29 30 29 29 30 29 30 30 0 354 -2046 */{ 0 , 2 , 6 , 43600 },/* 30 29 30 29 30 29 30 29 29 30 29 30 0 354 -2047 */{ 5 , 1 , 26 , 46376 },/* 30 29 30 30 29 30 29 30 29 29 30 29 30 384 -2048 */{ 0 , 2 , 14 , 27936 },/* 29 30 30 29 30 30 29 30 29 29 30 29 0 354 -2049 */{ 0 , 2 , 2 , 44448 },/* 30 29 30 29 30 30 29 30 30 29 30 29 0 355 -2050 */{ 3 , 1 , 23 , 21936 },/* 29 30 29 30 29 30 29 30 30 29 30 30 29 384 -2051 */{ 0 , 2 , 11 , 37744 },/* 30 29 29 30 29 29 30 30 29 30 30 30 0 355 -2052 */{ 8 , 2 , 1 , 18808 },/* 29 30 29 29 30 29 29 30 29 30 30 30 30 384 -2053 */{ 0 , 2 , 19 , 18800 },/* 29 30 29 29 30 29 29 30 29 30 30 30 0 354 -2054 */{ 0 , 2 , 8 , 25776 },/* 29 30 30 29 29 30 29 29 30 29 30 30 0 354 -2055 */{ 6 , 1 , 28 , 27216 },/* 29 30 30 29 30 29 30 29 29 30 29 30 29 383 -2056 */{ 0 , 2 , 15 , 59984 },/* 30 30 30 29 30 29 30 29 29 30 29 30 0 355 -2057 */{ 0 , 2 , 4 , 27424 },/* 29 30 30 29 30 29 30 30 29 29 30 29 0 354 -2058 */{ 4 , 1 , 24 , 43872 },/* 30 29 30 29 30 29 30 30 29 30 30 29 29 384 -2059 */{ 0 , 2 , 12 , 43744 },/* 30 29 30 29 30 29 30 29 30 30 30 29 0 355 -2060 */{ 0 , 2 , 2 , 37600 },/* 30 29 29 30 29 29 30 29 30 30 30 29 0 354 -2061 */{ 3 , 1 , 21 , 51568 },/* 30 30 29 29 30 29 29 30 29 30 30 30 29 384 -2062 */{ 0 , 2 , 9 , 51552 },/* 30 30 29 29 30 29 29 30 29 30 30 29 0 354 -2063 */{ 7 , 1 , 29 , 54440 },/* 30 30 29 30 29 30 29 29 30 29 30 29 30 384 -2064 */{ 0 , 2 , 17 , 54432 },/* 30 30 29 30 29 30 29 29 30 29 30 29 0 354 -2065 */{ 0 , 2 , 5 , 55888 },/* 30 30 29 30 30 29 30 29 29 30 29 30 0 355 -2066 */{ 5 , 1 , 26 , 23208 },/* 29 30 29 30 30 29 30 29 30 29 30 29 30 384 -2067 */{ 0 , 2 , 14 , 22176 },/* 29 30 29 30 29 30 30 29 30 29 30 29 0 354 -2068 */{ 0 , 2 , 3 , 42704 },/* 30 29 30 29 29 30 30 29 30 30 29 30 0 355 -2069 */{ 4 , 1 , 23 , 21224 },/* 29 30 29 30 29 29 30 29 30 30 30 29 30 384 -2070 */{ 0 , 2 , 11 , 21200 },/* 29 30 29 30 29 29 30 29 30 30 29 30 0 354 -2071 */{ 8 , 1 , 31 , 43352 },/* 30 29 30 29 30 29 29 30 29 30 29 30 30 384 -2072 */{ 0 , 2 , 19 , 43344 },/* 30 29 30 29 30 29 29 30 29 30 29 30 0 354 -2073 */{ 0 , 2 , 7 , 46240 },/* 30 29 30 30 29 30 29 29 30 29 30 29 0 354 -2074 */{ 6 , 1 , 27 , 46416 },/* 30 29 30 30 29 30 29 30 29 30 29 30 29 384 -2075 */{ 0 , 2 , 15 , 44368 },/* 30 29 30 29 30 30 29 30 29 30 29 30 0 355 -2076 */{ 0 , 2 , 5 , 21920 },/* 29 30 29 30 29 30 29 30 30 29 30 29 0 354 -2077 */{ 4 , 1 , 24 , 42448 },/* 30 29 30 29 29 30 29 30 30 30 29 30 29 384 -2078 */{ 0 , 2 , 12 , 42416 },/* 30 29 30 29 29 30 29 30 30 29 30 30 0 355 -2079 */{ 0 , 2 , 2 , 21168 },/* 29 30 29 30 29 29 30 29 30 29 30 30 0 354 -2080 */{ 3 , 1 , 22 , 43320 },/* 30 29 30 29 30 29 29 30 29 29 30 30 30 384 -2081 */{ 0 , 2 , 9 , 26928 },/* 29 30 30 29 30 29 29 30 29 29 30 30 0 354 -2082 */{ 7 , 1 , 29 , 29336 },/* 29 30 30 30 29 29 30 29 30 29 29 30 30 384 -2083 */{ 0 , 2 , 17 , 27296 },/* 29 30 30 29 30 29 30 29 30 29 30 29 0 354 -2084 */{ 0 , 2 , 6 , 44368 },/* 30 29 30 29 30 30 29 30 29 30 29 30 0 355 -2085 */{ 5 , 1 , 26 , 19880 },/* 29 30 29 29 30 30 29 30 30 29 30 29 30 384 -2086 */{ 0 , 2 , 14 , 19296 },/* 29 30 29 29 30 29 30 30 29 30 30 29 0 354 -2087 */{ 0 , 2 , 3 , 42352 },/* 30 29 30 29 29 30 29 30 29 30 30 30 0 355 -2088 */{ 4 , 1 , 24 , 21104 },/* 29 30 29 30 29 29 30 29 29 30 30 30 29 383 -2089 */{ 0 , 2 , 10 , 53856 },/* 30 30 29 30 29 29 30 29 29 30 30 29 0 354 -2090 */{ 8 , 1 , 30 , 59696 },/* 30 30 30 29 30 29 29 30 29 29 30 30 29 384 -2091 */{ 0 , 2 , 18 , 54560 },/* 30 30 29 30 29 30 29 30 29 29 30 29 0 354 -2092 */{ 0 , 2 , 7 , 55968 },/* 30 30 29 30 30 29 30 29 30 29 30 29 0 355 -2093 */{ 6 , 1 , 27 , 27472 },/* 29 30 30 29 30 29 30 30 29 30 29 30 29 384 -2094 */{ 0 , 2 , 15 , 22224 },/* 29 30 29 30 29 30 30 29 30 30 29 30 0 355 -2095 */{ 0 , 2 , 5 , 19168 },/* 29 30 29 29 30 29 30 29 30 30 30 29 0 354 -2096 */{ 4 , 1 , 25 , 42216 },/* 30 29 30 29 29 30 29 29 30 30 30 29 30 384 -2097 */{ 0 , 2 , 12 , 42192 },/* 30 29 30 29 29 30 29 29 30 30 29 30 0 354 -2098 */{ 0 , 2 , 1 , 53584 },/* 30 30 29 30 29 29 29 30 29 30 29 30 0 354 -2099 */{ 2 , 1 , 21 , 55592 },/* 30 30 29 30 30 29 29 30 29 29 30 29 30 384 -2100 */{ 0 , 2 , 9 , 54560 },/* 30 30 29 30 29 30 29 30 29 29 30 29 0 354 - */}; - - - internal override int MinCalendarYear - { - get - { - return (MIN_LUNISOLAR_YEAR); - } - } - - internal override int MaxCalendarYear - { - get - { - return (MAX_LUNISOLAR_YEAR); - } - } - - internal override DateTime MinDate - { - get - { - return (minDate); - } - } - - internal override DateTime MaxDate - { - get - { - return (maxDate); - } - } - - internal override EraInfo[] CalEraInfo - { - get - { - return (null); - } - } - - internal override int GetYearInfo(int lunarYear, int index) - { - if ((lunarYear < MIN_LUNISOLAR_YEAR) || (lunarYear > MAX_LUNISOLAR_YEAR)) - { - throw new ArgumentOutOfRangeException( - "year", - String.Format( - CultureInfo.CurrentCulture, - SR.ArgumentOutOfRange_Range, MIN_LUNISOLAR_YEAR, MAX_LUNISOLAR_YEAR)); - } - Contract.EndContractBlock(); - - return s_yinfo[lunarYear - MIN_LUNISOLAR_YEAR, index]; - } - - internal override int GetYear(int year, DateTime time) - { - return year; - } - - internal override int GetGregorianYear(int year, int era) - { - if (era != CurrentEra && era != ChineseEra) - { - throw new ArgumentOutOfRangeException(nameof(era), SR.ArgumentOutOfRange_InvalidEraValue); - } - - if (year < MIN_LUNISOLAR_YEAR || year > MAX_LUNISOLAR_YEAR) - { - throw new ArgumentOutOfRangeException( - nameof(year), - String.Format( - CultureInfo.CurrentCulture, - SR.ArgumentOutOfRange_Range, MIN_LUNISOLAR_YEAR, MAX_LUNISOLAR_YEAR)); - } - Contract.EndContractBlock(); - - return year; - } - - public ChineseLunisolarCalendar() - { - } - - public override int GetEra(DateTime time) - { - CheckTicksRange(time.Ticks); - return (ChineseEra); - } - - internal override CalendarId ID - { - get - { - return (CalendarId.CHINESELUNISOLAR); - } - } - - internal override CalendarId BaseCalendarID - { - get - { - //Use CAL_GREGORIAN just to get CurrentEraValue as 1 since we do not have data under the ID CAL_ChineseLunisolar yet - return (CalendarId.GREGORIAN); - } - } - - - public override int[] Eras - { - get - { - return (new int[] { ChineseEra }); - } - } - } -} diff --git a/src/mscorlib/corefx/System/Globalization/CompareInfo.Unix.cs b/src/mscorlib/corefx/System/Globalization/CompareInfo.Unix.cs deleted file mode 100644 index 21c3c9f7e4..0000000000 --- a/src/mscorlib/corefx/System/Globalization/CompareInfo.Unix.cs +++ /dev/null @@ -1,397 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Diagnostics; -using System.Diagnostics.Contracts; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Security; - -namespace System.Globalization -{ - public partial class CompareInfo - { - [NonSerialized] - private Interop.GlobalizationInterop.SafeSortHandle _sortHandle; - - [NonSerialized] - private bool _isAsciiEqualityOrdinal; - - internal CompareInfo(CultureInfo culture) - { - _name = culture.m_name; - InitSort(culture); - } - - private void InitSort(CultureInfo culture) - { - _sortName = culture.SortName; - Interop.GlobalizationInterop.ResultCode resultCode = Interop.GlobalizationInterop.GetSortHandle(GetNullTerminatedUtf8String(_sortName), out _sortHandle); - if (resultCode != Interop.GlobalizationInterop.ResultCode.Success) - { - _sortHandle.Dispose(); - - if (resultCode == Interop.GlobalizationInterop.ResultCode.OutOfMemory) - throw new OutOfMemoryException(); - - throw new ExternalException(SR.Arg_ExternalException); - } - _isAsciiEqualityOrdinal = (_sortName == "en-US" || _sortName == ""); - } - - internal static unsafe int IndexOfOrdinal(string source, string value, int startIndex, int count, bool ignoreCase) - { - Debug.Assert(source != null); - Debug.Assert(value != null); - - if (value.Length == 0) - { - return startIndex; - } - - if (count < value.Length) - { - return -1; - } - - if (ignoreCase) - { - fixed (char* pSource = source) - { - int index = Interop.GlobalizationInterop.IndexOfOrdinalIgnoreCase(value, value.Length, pSource + startIndex, count, findLast: false); - return index != -1 ? - startIndex + index : - -1; - } - } - - int endIndex = startIndex + (count - value.Length); - for (int i = startIndex; i <= endIndex; i++) - { - int valueIndex, sourceIndex; - - for (valueIndex = 0, sourceIndex = i; - valueIndex < value.Length && source[sourceIndex] == value[valueIndex]; - valueIndex++, sourceIndex++) ; - - if (valueIndex == value.Length) - { - return i; - } - } - - return -1; - } - - internal static unsafe int LastIndexOfOrdinal(string source, string value, int startIndex, int count, bool ignoreCase) - { - Debug.Assert(source != null); - Debug.Assert(value != null); - - if (value.Length == 0) - { - return startIndex; - } - - if (count < value.Length) - { - return -1; - } - - // startIndex is the index into source where we start search backwards from. - // leftStartIndex is the index into source of the start of the string that is - // count characters away from startIndex. - int leftStartIndex = startIndex - count + 1; - - if (ignoreCase) - { - fixed (char* pSource = source) - { - int lastIndex = Interop.GlobalizationInterop.IndexOfOrdinalIgnoreCase(value, value.Length, pSource + leftStartIndex, count, findLast: true); - return lastIndex != -1 ? - leftStartIndex + lastIndex : - -1; - } - } - - for (int i = startIndex - value.Length + 1; i >= leftStartIndex; i--) - { - int valueIndex, sourceIndex; - - for (valueIndex = 0, sourceIndex = i; - valueIndex < value.Length && source[sourceIndex] == value[valueIndex]; - valueIndex++, sourceIndex++) ; - - if (valueIndex == value.Length) { - return i; - } - } - - return -1; - } - - private int GetHashCodeOfStringCore(string source, CompareOptions options) - { - Debug.Assert(source != null); - Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); - - return GetHashCodeOfStringCore(source, options, forceRandomizedHashing: false, additionalEntropy: 0); - } - - private static unsafe int CompareStringOrdinalIgnoreCase(char* string1, int count1, char* string2, int count2) - { - return Interop.GlobalizationInterop.CompareStringOrdinalIgnoreCase(string1, count1, string2, count2); - } - - private unsafe int CompareString(string string1, int offset1, int length1, string string2, int offset2, int length2, CompareOptions options) - { - Debug.Assert(string1 != null); - Debug.Assert(string2 != null); - Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); - - fixed (char* pString1 = string1) - { - fixed (char* pString2 = string2) - { - return Interop.GlobalizationInterop.CompareString(_sortHandle, pString1 + offset1, length1, pString2 + offset2, length2, options); - } - } - } - - private unsafe int IndexOfCore(string source, string target, int startIndex, int count, CompareOptions options) - { - Debug.Assert(!string.IsNullOrEmpty(source)); - Debug.Assert(target != null); - Debug.Assert((options & CompareOptions.OrdinalIgnoreCase) == 0); - - if (target.Length == 0) - { - return startIndex; - } - - if (options == CompareOptions.Ordinal) - { - return IndexOfOrdinal(source, target, startIndex, count, ignoreCase: false); - } - - if (_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options) && source.IsFastSort() && target.IsFastSort()) - { - return IndexOf(source, target, startIndex, count, GetOrdinalCompareOptions(options)); - } - - fixed (char* pSource = source) - { - int index = Interop.GlobalizationInterop.IndexOf(_sortHandle, target, target.Length, pSource + startIndex, count, options); - - return index != -1 ? index + startIndex : -1; - } - } - - private unsafe int LastIndexOfCore(string source, string target, int startIndex, int count, CompareOptions options) - { - Debug.Assert(!string.IsNullOrEmpty(source)); - Debug.Assert(target != null); - Debug.Assert((options & CompareOptions.OrdinalIgnoreCase) == 0); - - if (target.Length == 0) - { - return startIndex; - } - - if (options == CompareOptions.Ordinal) - { - return LastIndexOfOrdinal(source, target, startIndex, count, ignoreCase: false); - } - - if (_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options) && source.IsFastSort() && target.IsFastSort()) - { - return LastIndexOf(source, target, startIndex, count, GetOrdinalCompareOptions(options)); - } - - // startIndex is the index into source where we start search backwards from. leftStartIndex is the index into source - // of the start of the string that is count characters away from startIndex. - int leftStartIndex = (startIndex - count + 1); - - fixed (char* pSource = source) - { - int lastIndex = Interop.GlobalizationInterop.LastIndexOf(_sortHandle, target, target.Length, pSource + (startIndex - count + 1), count, options); - - return lastIndex != -1 ? lastIndex + leftStartIndex : -1; - } - } - - private bool StartsWith(string source, string prefix, CompareOptions options) - { - Debug.Assert(!string.IsNullOrEmpty(source)); - Debug.Assert(!string.IsNullOrEmpty(prefix)); - Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); - - if (_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options) && source.IsFastSort() && prefix.IsFastSort()) - { - return IsPrefix(source, prefix, GetOrdinalCompareOptions(options)); - } - - return Interop.GlobalizationInterop.StartsWith(_sortHandle, prefix, prefix.Length, source, source.Length, options); - } - - private bool EndsWith(string source, string suffix, CompareOptions options) - { - Debug.Assert(!string.IsNullOrEmpty(source)); - Debug.Assert(!string.IsNullOrEmpty(suffix)); - Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); - - if (_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options) && source.IsFastSort() && suffix.IsFastSort()) - { - return IsSuffix(source, suffix, GetOrdinalCompareOptions(options)); - } - - return Interop.GlobalizationInterop.EndsWith(_sortHandle, suffix, suffix.Length, source, source.Length, options); - } - - private unsafe SortKey CreateSortKey(String source, CompareOptions options) - { - if (source==null) { throw new ArgumentNullException(nameof(source)); } - Contract.EndContractBlock(); - - if ((options & ValidSortkeyCtorMaskOffFlags) != 0) - { - throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag"), nameof(options)); - } - - byte [] keyData; - if (source.Length == 0) - { - keyData = EmptyArray<Byte>.Value; - } - else - { - int sortKeyLength = Interop.GlobalizationInterop.GetSortKey(_sortHandle, source, source.Length, null, 0, options); - keyData = new byte[sortKeyLength]; - - fixed (byte* pSortKey = keyData) - { - Interop.GlobalizationInterop.GetSortKey(_sortHandle, source, source.Length, pSortKey, sortKeyLength, options); - } - } - - return new SortKey(Name, source, options, keyData); - } - - private unsafe static bool IsSortable(char *text, int length) - { - int index = 0; - UnicodeCategory uc; - - while (index < length) - { - if (Char.IsHighSurrogate(text[index])) - { - if (index == length - 1 || !Char.IsLowSurrogate(text[index+1])) - return false; // unpaired surrogate - - uc = CharUnicodeInfo.InternalGetUnicodeCategory(Char.ConvertToUtf32(text[index], text[index+1])); - if (uc == UnicodeCategory.PrivateUse || uc == UnicodeCategory.OtherNotAssigned) - return false; - - index += 2; - continue; - } - - if (Char.IsLowSurrogate(text[index])) - { - return false; // unpaired surrogate - } - - uc = CharUnicodeInfo.GetUnicodeCategory(text[index]); - if (uc == UnicodeCategory.PrivateUse || uc == UnicodeCategory.OtherNotAssigned) - { - return false; - } - - index++; - } - - return true; - } - - // ----------------------------- - // ---- PAL layer ends here ---- - // ----------------------------- - - internal unsafe int GetHashCodeOfStringCore(string source, CompareOptions options, bool forceRandomizedHashing, long additionalEntropy) - { - Debug.Assert(source != null); - Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); - - if (source.Length == 0) - { - return 0; - } - - int sortKeyLength = Interop.GlobalizationInterop.GetSortKey(_sortHandle, source, source.Length, null, 0, options); - - // As an optimization, for small sort keys we allocate the buffer on the stack. - if (sortKeyLength <= 256) - { - byte* pSortKey = stackalloc byte[sortKeyLength]; - Interop.GlobalizationInterop.GetSortKey(_sortHandle, source, source.Length, pSortKey, sortKeyLength, options); - return InternalHashSortKey(pSortKey, sortKeyLength, false, additionalEntropy); - } - - byte[] sortKey = new byte[sortKeyLength]; - - fixed(byte* pSortKey = sortKey) - { - Interop.GlobalizationInterop.GetSortKey(_sortHandle, source, source.Length, pSortKey, sortKeyLength, options); - return InternalHashSortKey(pSortKey, sortKeyLength, false, additionalEntropy); - } - } - - [DllImport(JitHelpers.QCall)] - [SuppressUnmanagedCodeSecurity] - private static unsafe extern int InternalHashSortKey(byte* sortKey, int sortKeyLength, [MarshalAs(UnmanagedType.Bool)] bool forceRandomizedHashing, long additionalEntropy); - - private static CompareOptions GetOrdinalCompareOptions(CompareOptions options) - { - if ((options & CompareOptions.IgnoreCase) == CompareOptions.IgnoreCase) - { - return CompareOptions.OrdinalIgnoreCase; - } - else - { - return CompareOptions.Ordinal; - } - } - - private static bool CanUseAsciiOrdinalForOptions(CompareOptions options) - { - // Unlike the other Ignore options, IgnoreSymbols impacts ASCII characters (e.g. '). - return (options & CompareOptions.IgnoreSymbols) == 0; - } - - private static byte[] GetNullTerminatedUtf8String(string s) - { - int byteLen = System.Text.Encoding.UTF8.GetByteCount(s); - - // Allocate an extra byte (which defaults to 0) as the null terminator. - byte[] buffer = new byte[byteLen + 1]; - - int bytesWritten = System.Text.Encoding.UTF8.GetBytes(s, 0, s.Length, buffer, 0); - - Debug.Assert(bytesWritten == byteLen); - - return buffer; - } - - private SortVersion GetSortVersion() - { - int sortVersion = Interop.GlobalizationInterop.GetSortVersion(); - return new SortVersion(sortVersion, LCID, new Guid(sortVersion, 0, 0, 0, 0, 0, 0, - (byte) (LCID >> 24), - (byte) ((LCID & 0x00FF0000) >> 16), - (byte) ((LCID & 0x0000FF00) >> 8), - (byte) (LCID & 0xFF))); - } - } -} diff --git a/src/mscorlib/corefx/System/Globalization/CompareInfo.Windows.cs b/src/mscorlib/corefx/System/Globalization/CompareInfo.Windows.cs deleted file mode 100644 index d4936522dd..0000000000 --- a/src/mscorlib/corefx/System/Globalization/CompareInfo.Windows.cs +++ /dev/null @@ -1,415 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Diagnostics; -using System.Diagnostics.Contracts; - -namespace System.Globalization -{ - public partial class CompareInfo - { - internal unsafe CompareInfo(CultureInfo culture) - { - _name = culture._name; - InitSort(culture); - } - - private void InitSort(CultureInfo culture) - { - _sortName = culture.SortName; - - const uint LCMAP_SORTHANDLE = 0x20000000; - - _name = culture._name; - _sortName = culture.SortName; - - IntPtr handle; - int ret = Interop.mincore.LCMapStringEx(_sortName, LCMAP_SORTHANDLE, null, 0, &handle, IntPtr.Size, null, null, IntPtr.Zero); - _sortHandle = ret > 0 ? handle : IntPtr.Zero; - } - - private static unsafe int FindStringOrdinal( - uint dwFindStringOrdinalFlags, - string stringSource, - int offset, - int cchSource, - string value, - int cchValue, - bool bIgnoreCase) - { - fixed (char* pSource = stringSource) - fixed (char* pValue = value) - { - int ret = Interop.mincore.FindStringOrdinal( - dwFindStringOrdinalFlags, - pSource + offset, - cchSource, - pValue, - cchValue, - bIgnoreCase ? 1 : 0); - return ret < 0 ? ret : ret + offset; - } - } - - internal static int IndexOfOrdinal(string source, string value, int startIndex, int count, bool ignoreCase) - { - Debug.Assert(source != null); - Debug.Assert(value != null); - - return FindStringOrdinal(FIND_FROMSTART, source, startIndex, count, value, value.Length, ignoreCase); - } - - internal static int LastIndexOfOrdinal(string source, string value, int startIndex, int count, bool ignoreCase) - { - Debug.Assert(source != null); - Debug.Assert(value != null); - - return FindStringOrdinal(FIND_FROMEND, source, startIndex - count + 1, count, value, value.Length, ignoreCase); - } - - private unsafe int GetHashCodeOfStringCore(string source, CompareOptions options) - { - Debug.Assert(source != null); - Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); - - if (source.Length == 0) - { - return 0; - } - - int tmpHash = 0; - - fixed (char* pSource = source) - { - if (Interop.mincore.LCMapStringEx(_sortHandle != IntPtr.Zero ? null : _sortName, - LCMAP_HASH | (uint)GetNativeCompareFlags(options), - pSource, source.Length, - &tmpHash, sizeof(int), - null, null, _sortHandle) == 0) - { - Environment.FailFast("LCMapStringEx failed!"); - } - } - - return tmpHash; - } - - private static unsafe int CompareStringOrdinalIgnoreCase(char* string1, int count1, char* string2, int count2) - { - // Use the OS to compare and then convert the result to expected value by subtracting 2 - return Interop.mincore.CompareStringOrdinal(string1, count1, string2, count2, true) - 2; - } - - private unsafe int CompareString(string string1, int offset1, int length1, string string2, int offset2, int length2, CompareOptions options) - { - Debug.Assert(string1 != null); - Debug.Assert(string2 != null); - Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); - - string localeName = _sortHandle != IntPtr.Zero ? null : _sortName; - - fixed (char* pLocaleName = localeName) - fixed (char* pString1 = string1) - fixed (char* pString2 = string2) - { - int result = Interop.mincore.CompareStringEx( - pLocaleName, - (uint)GetNativeCompareFlags(options), - pString1 + offset1, - length1, - pString2 + offset2, - length2, - null, - null, - _sortHandle); - - if (result == 0) - { - Environment.FailFast("CompareStringEx failed"); - } - - // Map CompareStringEx return value to -1, 0, 1. - return result - 2; - } - } - - private unsafe int FindString( - uint dwFindNLSStringFlags, - string lpStringSource, - int startSource, - int cchSource, - string lpStringValue, - int startValue, - int cchValue) - { - string localeName = _sortHandle != IntPtr.Zero ? null : _sortName; - - fixed (char* pLocaleName = localeName) - fixed (char* pSource = lpStringSource) - fixed (char* pValue = lpStringValue) - { - char* pS = pSource + startSource; - char* pV = pValue + startValue; - - return Interop.mincore.FindNLSStringEx( - pLocaleName, - dwFindNLSStringFlags, - pS, - cchSource, - pV, - cchValue, - null, - null, - null, - _sortHandle); - } - } - - private int IndexOfCore(string source, string target, int startIndex, int count, CompareOptions options) - { - Debug.Assert(!string.IsNullOrEmpty(source)); - Debug.Assert(target != null); - Debug.Assert((options & CompareOptions.OrdinalIgnoreCase) == 0); - - // TODO: Consider moving this up to the relevent APIs we need to ensure this behavior for - // and add a precondition that target is not empty. - if (target.Length == 0) - return startIndex; // keep Whidbey compatibility - - if ((options & CompareOptions.Ordinal) != 0) - { - return FastIndexOfString(source, target, startIndex, count, target.Length, findLastIndex: false); - } - else - { - int retValue = FindString(FIND_FROMSTART | (uint)GetNativeCompareFlags(options), - source, - startIndex, - count, - target, - 0, - target.Length); - if (retValue >= 0) - { - return retValue + startIndex; - } - } - - return -1; - } - - private int LastIndexOfCore(string source, string target, int startIndex, int count, CompareOptions options) - { - Debug.Assert(!string.IsNullOrEmpty(source)); - Debug.Assert(target != null); - Debug.Assert((options & CompareOptions.OrdinalIgnoreCase) == 0); - - // TODO: Consider moving this up to the relevent APIs we need to ensure this behavior for - // and add a precondition that target is not empty. - if (target.Length == 0) - return startIndex; // keep Whidbey compatibility - - if ((options & CompareOptions.Ordinal) != 0) - { - return FastIndexOfString(source, target, startIndex, count, target.Length, findLastIndex: true); - } - else - { - int retValue = FindString(FIND_FROMEND | (uint)GetNativeCompareFlags(options), - source, - startIndex - count + 1, - count, - target, - 0, - target.Length); - - if (retValue >= 0) - { - return retValue + startIndex - (count - 1); - } - } - - return -1; - } - - private bool StartsWith(string source, string prefix, CompareOptions options) - { - Debug.Assert(!string.IsNullOrEmpty(source)); - Debug.Assert(!string.IsNullOrEmpty(prefix)); - Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); - - return FindString(FIND_STARTSWITH | (uint)GetNativeCompareFlags(options), - source, - 0, - source.Length, - prefix, - 0, - prefix.Length) >= 0; - } - - private bool EndsWith(string source, string suffix, CompareOptions options) - { - Debug.Assert(!string.IsNullOrEmpty(source)); - Debug.Assert(!string.IsNullOrEmpty(suffix)); - Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); - - return FindString(FIND_ENDSWITH | (uint)GetNativeCompareFlags(options), - source, - 0, - source.Length, - suffix, - 0, - suffix.Length) >= 0; - } - - // PAL ends here - [NonSerialized] - private readonly IntPtr _sortHandle; - - private const uint LCMAP_HASH = 0x00040000; - - private const int FIND_STARTSWITH = 0x00100000; - private const int FIND_ENDSWITH = 0x00200000; - private const int FIND_FROMSTART = 0x00400000; - private const int FIND_FROMEND = 0x00800000; - - // TODO: Instead of this method could we just have upstack code call IndexOfOrdinal with ignoreCase = false? - private static unsafe int FastIndexOfString(string source, string target, int startIndex, int sourceCount, int targetCount, bool findLastIndex) - { - int retValue = -1; - - int sourceStartIndex = findLastIndex ? startIndex - sourceCount + 1 : startIndex; - - fixed (char* pSource = source, spTarget = target) - { - char* spSubSource = pSource + sourceStartIndex; - - if (findLastIndex) - { - int startPattern = (sourceCount - 1) - targetCount + 1; - if (startPattern < 0) - return -1; - - char patternChar0 = spTarget[0]; - for (int ctrSrc = startPattern; ctrSrc >= 0; ctrSrc--) - { - if (spSubSource[ctrSrc] != patternChar0) - continue; - - int ctrPat; - for (ctrPat = 1; ctrPat < targetCount; ctrPat++) - { - if (spSubSource[ctrSrc + ctrPat] != spTarget[ctrPat]) - break; - } - if (ctrPat == targetCount) - { - retValue = ctrSrc; - break; - } - } - - if (retValue >= 0) - { - retValue += startIndex - sourceCount + 1; - } - } - else - { - int endPattern = (sourceCount - 1) - targetCount + 1; - if (endPattern < 0) - return -1; - - char patternChar0 = spTarget[0]; - for (int ctrSrc = 0; ctrSrc <= endPattern; ctrSrc++) - { - if (spSubSource[ctrSrc] != patternChar0) - continue; - int ctrPat; - for (ctrPat = 1; ctrPat < targetCount; ctrPat++) - { - if (spSubSource[ctrSrc + ctrPat] != spTarget[ctrPat]) - break; - } - if (ctrPat == targetCount) - { - retValue = ctrSrc; - break; - } - } - - if (retValue >= 0) - { - retValue += startIndex; - } - } - } - - return retValue; - } - - private unsafe SortKey CreateSortKey(String source, CompareOptions options) - { - if (source == null) { throw new ArgumentNullException(nameof(source)); } - Contract.EndContractBlock(); - - if ((options & ValidSortkeyCtorMaskOffFlags) != 0) - { - throw new ArgumentException(SR.Argument_InvalidFlag, nameof(options)); - } - - throw new NotImplementedException(); - } - - private static unsafe bool IsSortable(char* text, int length) - { - // CompareInfo c = CultureInfo.InvariantCulture.CompareInfo; - // return (InternalIsSortable(c.m_dataHandle, c.m_handleOrigin, c.m_sortName, text, text.Length)); - throw new NotImplementedException(); - } - - private const int COMPARE_OPTIONS_ORDINAL = 0x40000000; // Ordinal - private const int NORM_IGNORECASE = 0x00000001; // Ignores case. (use LINGUISTIC_IGNORECASE instead) - private const int NORM_IGNOREKANATYPE = 0x00010000; // Does not differentiate between Hiragana and Katakana characters. Corresponding Hiragana and Katakana will compare as equal. - private const int NORM_IGNORENONSPACE = 0x00000002; // Ignores nonspacing. This flag also removes Japanese accent characters. (use LINGUISTIC_IGNOREDIACRITIC instead) - private const int NORM_IGNORESYMBOLS = 0x00000004; // Ignores symbols. - private const int NORM_IGNOREWIDTH = 0x00020000; // Does not differentiate between a single-byte character and the same character as a double-byte character. - private const int NORM_LINGUISTIC_CASING = 0x08000000; // use linguistic rules for casing - private const int SORT_STRINGSORT = 0x00001000; // Treats punctuation the same as symbols. - - private static int GetNativeCompareFlags(CompareOptions options) - { - // Use "linguistic casing" by default (load the culture's casing exception tables) - int nativeCompareFlags = NORM_LINGUISTIC_CASING; - - if ((options & CompareOptions.IgnoreCase) != 0) { nativeCompareFlags |= NORM_IGNORECASE; } - if ((options & CompareOptions.IgnoreKanaType) != 0) { nativeCompareFlags |= NORM_IGNOREKANATYPE; } - if ((options & CompareOptions.IgnoreNonSpace) != 0) { nativeCompareFlags |= NORM_IGNORENONSPACE; } - if ((options & CompareOptions.IgnoreSymbols) != 0) { nativeCompareFlags |= NORM_IGNORESYMBOLS; } - if ((options & CompareOptions.IgnoreWidth) != 0) { nativeCompareFlags |= NORM_IGNOREWIDTH; } - if ((options & CompareOptions.StringSort) != 0) { nativeCompareFlags |= SORT_STRINGSORT; } - - // TODO: Can we try for GetNativeCompareFlags to never - // take Ordinal or OrdinalIgnoreCase. This value is not part of Win32, we just handle it special - // in some places. - // Suffix & Prefix shouldn't use this, make sure to turn off the NORM_LINGUISTIC_CASING flag - if (options == CompareOptions.Ordinal) { nativeCompareFlags = COMPARE_OPTIONS_ORDINAL; } - - Debug.Assert(((options & ~(CompareOptions.IgnoreCase | - CompareOptions.IgnoreKanaType | - CompareOptions.IgnoreNonSpace | - CompareOptions.IgnoreSymbols | - CompareOptions.IgnoreWidth | - CompareOptions.StringSort)) == 0) || - (options == CompareOptions.Ordinal), "[CompareInfo.GetNativeCompareFlags]Expected all flags to be handled"); - - return nativeCompareFlags; - } - - private SortVersion GetSortVersion() - { - throw new NotImplementedException(); - } - } -} diff --git a/src/mscorlib/corefx/System/Globalization/CompareInfo.cs b/src/mscorlib/corefx/System/Globalization/CompareInfo.cs deleted file mode 100644 index 64dbfe84f7..0000000000 --- a/src/mscorlib/corefx/System/Globalization/CompareInfo.cs +++ /dev/null @@ -1,1094 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -//////////////////////////////////////////////////////////////////////////// -// -// -// -// Purpose: This class implements a set of methods for comparing -// strings. -// -// -//////////////////////////////////////////////////////////////////////////// - -using System.Reflection; -using System.Diagnostics; -using System.Diagnostics.Contracts; -using System.Runtime.Serialization; - -namespace System.Globalization -{ - [Flags] - [Serializable] - public enum CompareOptions - { - None = 0x00000000, - IgnoreCase = 0x00000001, - IgnoreNonSpace = 0x00000002, - IgnoreSymbols = 0x00000004, - IgnoreKanaType = 0x00000008, // ignore kanatype - IgnoreWidth = 0x00000010, // ignore width - OrdinalIgnoreCase = 0x10000000, // This flag can not be used with other flags. - StringSort = 0x20000000, // use string sort method - Ordinal = 0x40000000, // This flag can not be used with other flags. - } - - [Serializable] - public partial class CompareInfo : IDeserializationCallback - { - // Mask used to check if IndexOf()/LastIndexOf()/IsPrefix()/IsPostfix() has the right flags. - private const CompareOptions ValidIndexMaskOffFlags = - ~(CompareOptions.IgnoreCase | CompareOptions.IgnoreSymbols | CompareOptions.IgnoreNonSpace | - CompareOptions.IgnoreWidth | CompareOptions.IgnoreKanaType); - - // Mask used to check if Compare() has the right flags. - private const CompareOptions ValidCompareMaskOffFlags = - ~(CompareOptions.IgnoreCase | CompareOptions.IgnoreSymbols | CompareOptions.IgnoreNonSpace | - CompareOptions.IgnoreWidth | CompareOptions.IgnoreKanaType | CompareOptions.StringSort); - - // Mask used to check if GetHashCodeOfString() has the right flags. - private const CompareOptions ValidHashCodeOfStringMaskOffFlags = - ~(CompareOptions.IgnoreCase | CompareOptions.IgnoreSymbols | CompareOptions.IgnoreNonSpace | - CompareOptions.IgnoreWidth | CompareOptions.IgnoreKanaType); - - // Mask used to check if we have the right flags. - private const CompareOptions ValidSortkeyCtorMaskOffFlags = - ~(CompareOptions.IgnoreCase | CompareOptions.IgnoreSymbols | CompareOptions.IgnoreNonSpace | - CompareOptions.IgnoreWidth | CompareOptions.IgnoreKanaType | CompareOptions.StringSort); - - // - // CompareInfos have an interesting identity. They are attached to the locale that created them, - // ie: en-US would have an en-US sort. For haw-US (custom), then we serialize it as haw-US. - // The interesting part is that since haw-US doesn't have its own sort, it has to point at another - // locale, which is what SCOMPAREINFO does. - - [OptionalField(VersionAdded = 2)] - private String _name; // The name used to construct this CompareInfo - [NonSerialized] - private String _sortName; // The name that defines our behavior - - [OptionalField(VersionAdded = 3)] - private SortVersion _sortVersion; - - /*=================================GetCompareInfo========================== - **Action: Get the CompareInfo constructed from the data table in the specified assembly for the specified culture. - ** Warning: The assembly versioning mechanism is dead! - **Returns: The CompareInfo for the specified culture. - **Arguments: - ** culture the ID of the culture - ** assembly the assembly which contains the sorting table. - **Exceptions: - ** ArugmentNullException when the assembly is null - ** ArgumentException if culture is invalid. - ============================================================================*/ - // Assembly constructor should be deprecated, we don't act on the assembly information any more - public static CompareInfo GetCompareInfo(int culture, Assembly assembly) - { - // Parameter checking. - if (assembly == null) - { - throw new ArgumentNullException(nameof(assembly)); - } - if (assembly != typeof(Object).Module.Assembly) - { - throw new ArgumentException(SR.Argument_OnlyMscorlib); - } - Contract.EndContractBlock(); - - return GetCompareInfo(culture); - } - - /*=================================GetCompareInfo========================== - **Action: Get the CompareInfo constructed from the data table in the specified assembly for the specified culture. - ** The purpose of this method is to provide version for CompareInfo tables. - **Returns: The CompareInfo for the specified culture. - **Arguments: - ** name the name of the culture - ** assembly the assembly which contains the sorting table. - **Exceptions: - ** ArugmentNullException when the assembly is null - ** ArgumentException if name is invalid. - ============================================================================*/ - // Assembly constructor should be deprecated, we don't act on the assembly information any more - public static CompareInfo GetCompareInfo(String name, Assembly assembly) - { - if (name == null || assembly == null) - { - throw new ArgumentNullException(name == null ? nameof(name) : nameof(assembly)); - } - Contract.EndContractBlock(); - - if (assembly != typeof(Object).Module.Assembly) - { - throw new ArgumentException(SR.Argument_OnlyMscorlib); - } - - return GetCompareInfo(name); - } - - /*=================================GetCompareInfo========================== - **Action: Get the CompareInfo for the specified culture. - ** This method is provided for ease of integration with NLS-based software. - **Returns: The CompareInfo for the specified culture. - **Arguments: - ** culture the ID of the culture. - **Exceptions: - ** ArgumentException if culture is invalid. - ============================================================================*/ - // People really shouldn't be calling LCID versions, no custom support - public static CompareInfo GetCompareInfo(int culture) - { - if (CultureData.IsCustomCultureId(culture)) - { - // Customized culture cannot be created by the LCID. - throw new ArgumentException(SR.Argument_CustomCultureCannotBePassedByNumber, nameof(culture)); - } - - return CultureInfo.GetCultureInfo(culture).CompareInfo; - } - - /*=================================GetCompareInfo========================== - **Action: Get the CompareInfo for the specified culture. - **Returns: The CompareInfo for the specified culture. - **Arguments: - ** name the name of the culture. - **Exceptions: - ** ArgumentException if name is invalid. - ============================================================================*/ - - public static CompareInfo GetCompareInfo(String name) - { - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - Contract.EndContractBlock(); - - return CultureInfo.GetCultureInfo(name).CompareInfo; - } - - public static unsafe bool IsSortable(char ch) - { - char *pChar = &ch; - return IsSortable(pChar, 1); - } - - public static unsafe bool IsSortable(string text) - { - if (text == null) - { - // A null param is invalid here. - throw new ArgumentNullException(nameof(text)); - } - - if (0 == text.Length) - { - // A zero length string is not invalid, but it is also not sortable. - return (false); - } - - fixed (char *pChar = text) - { - return IsSortable(pChar, text.Length); - } - } - - - [OnDeserializing] - private void OnDeserializing(StreamingContext ctx) - { - _name = null; - } - - void IDeserializationCallback.OnDeserialization(Object sender) - { - OnDeserialized(); - } - - [OnDeserialized] - private void OnDeserialized(StreamingContext ctx) - { - OnDeserialized(); - } - - private void OnDeserialized() - { - if (_name != null) - { - InitSort(CultureInfo.GetCultureInfo(_name)); - } - } - - [OnSerializing] - private void OnSerializing(StreamingContext ctx) { } - - ///////////////////////////----- Name -----///////////////////////////////// - // - // Returns the name of the culture (well actually, of the sort). - // Very important for providing a non-LCID way of identifying - // what the sort is. - // - // Note that this name isn't dereferenced in case the CompareInfo is a different locale - // which is consistent with the behaviors of earlier versions. (so if you ask for a sort - // and the locale's changed behavior, then you'll get changed behavior, which is like - // what happens for a version update) - // - //////////////////////////////////////////////////////////////////////// - - public virtual String Name - { - get - { - Debug.Assert(_name != null, "CompareInfo.Name Expected _name to be set"); - if (_name == "zh-CHT" || _name == "zh-CHS") - { - return _name; - } - - return _sortName; - } - } - - //////////////////////////////////////////////////////////////////////// - // - // Compare - // - // Compares the two strings with the given options. Returns 0 if the - // two strings are equal, a number less than 0 if string1 is less - // than string2, and a number greater than 0 if string1 is greater - // than string2. - // - //////////////////////////////////////////////////////////////////////// - - public virtual int Compare(String string1, String string2) - { - return (Compare(string1, string2, CompareOptions.None)); - } - - public unsafe virtual int Compare(String string1, String string2, CompareOptions options) - { - if (options == CompareOptions.OrdinalIgnoreCase) - { - return String.Compare(string1, string2, StringComparison.OrdinalIgnoreCase); - } - - // Verify the options before we do any real comparison. - if ((options & CompareOptions.Ordinal) != 0) - { - if (options != CompareOptions.Ordinal) - { - throw new ArgumentException(SR.Argument_CompareOptionOrdinal, nameof(options)); - } - return String.CompareOrdinal(string1, string2); - } - - if ((options & ValidCompareMaskOffFlags) != 0) - { - throw new ArgumentException(SR.Argument_InvalidFlag, nameof(options)); - } - - //Our paradigm is that null sorts less than any other string and - //that two nulls sort as equal. - if (string1 == null) - { - if (string2 == null) - { - return (0); // Equal - } - return (-1); // null < non-null - } - if (string2 == null) - { - return (1); // non-null > null - } - - return CompareString(string1, 0, string1.Length, string2, 0, string2.Length, options); - } - - - //////////////////////////////////////////////////////////////////////// - // - // Compare - // - // Compares the specified regions of the two strings with the given - // options. - // Returns 0 if the two strings are equal, a number less than 0 if - // string1 is less than string2, and a number greater than 0 if - // string1 is greater than string2. - // - //////////////////////////////////////////////////////////////////////// - - - public unsafe virtual int Compare(String string1, int offset1, int length1, String string2, int offset2, int length2) - { - return Compare(string1, offset1, length1, string2, offset2, length2, 0); - } - - - public unsafe virtual int Compare(String string1, int offset1, String string2, int offset2, CompareOptions options) - { - return Compare(string1, offset1, string1 == null ? 0 : string1.Length - offset1, - string2, offset2, string2 == null ? 0 : string2.Length - offset2, options); - } - - - public unsafe virtual int Compare(String string1, int offset1, String string2, int offset2) - { - return Compare(string1, offset1, string2, offset2, 0); - } - - - public unsafe virtual int Compare(String string1, int offset1, int length1, String string2, int offset2, int length2, CompareOptions options) - { - if (options == CompareOptions.OrdinalIgnoreCase) - { - int result = String.Compare(string1, offset1, string2, offset2, length1 < length2 ? length1 : length2, StringComparison.OrdinalIgnoreCase); - if ((length1 != length2) && result == 0) - return (length1 > length2 ? 1 : -1); - return (result); - } - - // Verify inputs - if (length1 < 0 || length2 < 0) - { - throw new ArgumentOutOfRangeException((length1 < 0) ? nameof(length1) : nameof(length2), SR.ArgumentOutOfRange_NeedPosNum); - } - if (offset1 < 0 || offset2 < 0) - { - throw new ArgumentOutOfRangeException((offset1 < 0) ? nameof(offset1) : nameof(offset2), SR.ArgumentOutOfRange_NeedPosNum); - } - if (offset1 > (string1 == null ? 0 : string1.Length) - length1) - { - throw new ArgumentOutOfRangeException(nameof(string1), SR.ArgumentOutOfRange_OffsetLength); - } - if (offset2 > (string2 == null ? 0 : string2.Length) - length2) - { - throw new ArgumentOutOfRangeException(nameof(string2), SR.ArgumentOutOfRange_OffsetLength); - } - if ((options & CompareOptions.Ordinal) != 0) - { - if (options != CompareOptions.Ordinal) - { - throw new ArgumentException(SR.Argument_CompareOptionOrdinal, - nameof(options)); - } - } - else if ((options & ValidCompareMaskOffFlags) != 0) - { - throw new ArgumentException(SR.Argument_InvalidFlag, nameof(options)); - } - - // - // Check for the null case. - // - if (string1 == null) - { - if (string2 == null) - { - return (0); - } - return (-1); - } - if (string2 == null) - { - return (1); - } - - if (options == CompareOptions.Ordinal) - { - return CompareOrdinal(string1, offset1, length1, - string2, offset2, length2); - } - return CompareString(string1, offset1, length1, - string2, offset2, length2, - options); - } - - private static int CompareOrdinal(string string1, int offset1, int length1, string string2, int offset2, int length2) - { - int result = String.CompareOrdinal(string1, offset1, string2, offset2, - (length1 < length2 ? length1 : length2)); - if ((length1 != length2) && result == 0) - { - return (length1 > length2 ? 1 : -1); - } - return (result); - } - - // - // CompareOrdinalIgnoreCase compare two string oridnally with ignoring the case. - // it assumes the strings are Ascii string till we hit non Ascii character in strA or strB and then we continue the comparison by - // calling the OS. - // - internal static unsafe int CompareOrdinalIgnoreCase(string strA, int indexA, int lengthA, string strB, int indexB, int lengthB) - { - Debug.Assert(indexA + lengthA <= strA.Length); - Debug.Assert(indexB + lengthB <= strB.Length); - - int length = Math.Min(lengthA, lengthB); - int range = length; - - fixed (char* ap = strA) fixed (char* bp = strB) - { - char* a = ap + indexA; - char* b = bp + indexB; - - while (length != 0 && (*a <= 0x80) && (*b <= 0x80)) - { - int charA = *a; - int charB = *b; - - if (charA == charB) - { - a++; b++; - length--; - continue; - } - - // uppercase both chars - notice that we need just one compare per char - if ((uint)(charA - 'a') <= (uint)('z' - 'a')) charA -= 0x20; - if ((uint)(charB - 'a') <= (uint)('z' - 'a')) charB -= 0x20; - - //Return the (case-insensitive) difference between them. - if (charA != charB) - return charA - charB; - - // Next char - a++; b++; - length--; - } - - if (length == 0) - return lengthA - lengthB; - - range -= length; - - return CompareStringOrdinalIgnoreCase(a, lengthA - range, b, lengthB - range); - } - } - - //////////////////////////////////////////////////////////////////////// - // - // IsPrefix - // - // Determines whether prefix is a prefix of string. If prefix equals - // String.Empty, true is returned. - // - //////////////////////////////////////////////////////////////////////// - public unsafe virtual bool IsPrefix(String source, String prefix, CompareOptions options) - { - if (source == null || prefix == null) - { - throw new ArgumentNullException((source == null ? nameof(source) : nameof(prefix)), - SR.ArgumentNull_String); - } - Contract.EndContractBlock(); - - if (prefix.Length == 0) - { - return (true); - } - - if (source.Length == 0) - { - return false; - } - - if (options == CompareOptions.OrdinalIgnoreCase) - { - return source.StartsWith(prefix, StringComparison.OrdinalIgnoreCase); - } - - if (options == CompareOptions.Ordinal) - { - return source.StartsWith(prefix, StringComparison.Ordinal); - } - - if ((options & ValidIndexMaskOffFlags) != 0) - { - throw new ArgumentException(SR.Argument_InvalidFlag, nameof(options)); - } - - return StartsWith(source, prefix, options); - } - - public virtual bool IsPrefix(String source, String prefix) - { - return (IsPrefix(source, prefix, 0)); - } - - //////////////////////////////////////////////////////////////////////// - // - // IsSuffix - // - // Determines whether suffix is a suffix of string. If suffix equals - // String.Empty, true is returned. - // - //////////////////////////////////////////////////////////////////////// - public unsafe virtual bool IsSuffix(String source, String suffix, CompareOptions options) - { - if (source == null || suffix == null) - { - throw new ArgumentNullException((source == null ? nameof(source) : nameof(suffix)), - SR.ArgumentNull_String); - } - Contract.EndContractBlock(); - - if (suffix.Length == 0) - { - return (true); - } - - if (source.Length == 0) - { - return false; - } - - if (options == CompareOptions.OrdinalIgnoreCase) - { - return source.EndsWith(suffix, StringComparison.OrdinalIgnoreCase); - } - - if (options == CompareOptions.Ordinal) - { - return source.EndsWith(suffix, StringComparison.Ordinal); - } - - if ((options & ValidIndexMaskOffFlags) != 0) - { - throw new ArgumentException(SR.Argument_InvalidFlag, nameof(options)); - } - - return EndsWith(source, suffix, options); - } - - - public virtual bool IsSuffix(String source, String suffix) - { - return (IsSuffix(source, suffix, 0)); - } - - //////////////////////////////////////////////////////////////////////// - // - // IndexOf - // - // Returns the first index where value is found in string. The - // search starts from startIndex and ends at endIndex. Returns -1 if - // the specified value is not found. If value equals String.Empty, - // startIndex is returned. Throws IndexOutOfRange if startIndex or - // endIndex is less than zero or greater than the length of string. - // Throws ArgumentException if value is null. - // - //////////////////////////////////////////////////////////////////////// - - - public unsafe virtual int IndexOf(String source, char value) - { - if (source == null) - throw new ArgumentNullException(nameof(source)); - Contract.EndContractBlock(); - - return IndexOf(source, value, 0, source.Length, CompareOptions.None); - } - - - public unsafe virtual int IndexOf(String source, String value) - { - if (source == null) - throw new ArgumentNullException(nameof(source)); - Contract.EndContractBlock(); - - return IndexOf(source, value, 0, source.Length, CompareOptions.None); - } - - - public unsafe virtual int IndexOf(String source, char value, CompareOptions options) - { - if (source == null) - throw new ArgumentNullException(nameof(source)); - Contract.EndContractBlock(); - - return IndexOf(source, value, 0, source.Length, options); - } - - - public unsafe virtual int IndexOf(String source, String value, CompareOptions options) - { - if (source == null) - throw new ArgumentNullException(nameof(source)); - Contract.EndContractBlock(); - - return IndexOf(source, value, 0, source.Length, options); - } - - public unsafe virtual int IndexOf(String source, char value, int startIndex) - { - if (source == null) - throw new ArgumentNullException(nameof(source)); - Contract.EndContractBlock(); - - return IndexOf(source, value, startIndex, source.Length - startIndex, CompareOptions.None); - } - - public unsafe virtual int IndexOf(String source, String value, int startIndex) - { - if (source == null) - throw new ArgumentNullException(nameof(source)); - Contract.EndContractBlock(); - - return IndexOf(source, value, startIndex, source.Length - startIndex, CompareOptions.None); - } - - public unsafe virtual int IndexOf(String source, char value, int startIndex, CompareOptions options) - { - if (source == null) - throw new ArgumentNullException(nameof(source)); - Contract.EndContractBlock(); - - return IndexOf(source, value, startIndex, source.Length - startIndex, options); - } - - - public unsafe virtual int IndexOf(String source, String value, int startIndex, CompareOptions options) - { - if (source == null) - throw new ArgumentNullException(nameof(source)); - Contract.EndContractBlock(); - - return IndexOf(source, value, startIndex, source.Length - startIndex, options); - } - - - public unsafe virtual int IndexOf(String source, char value, int startIndex, int count) - { - return IndexOf(source, value, startIndex, count, CompareOptions.None); - } - - - public unsafe virtual int IndexOf(String source, String value, int startIndex, int count) - { - return IndexOf(source, value, startIndex, count, CompareOptions.None); - } - - public unsafe virtual int IndexOf(String source, char value, int startIndex, int count, CompareOptions options) - { - // Validate inputs - if (source == null) - throw new ArgumentNullException(nameof(source)); - - if (startIndex < 0 || startIndex > source.Length) - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index); - - if (count < 0 || startIndex > source.Length - count) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count); - Contract.EndContractBlock(); - - if (options == CompareOptions.OrdinalIgnoreCase) - { - return source.IndexOf(value.ToString(), startIndex, count, StringComparison.OrdinalIgnoreCase); - } - - // Validate CompareOptions - // Ordinal can't be selected with other flags - if ((options & ValidIndexMaskOffFlags) != 0 && (options != CompareOptions.Ordinal)) - throw new ArgumentException(SR.Argument_InvalidFlag, nameof(options)); - - return IndexOfCore(source, new string(value, 1), startIndex, count, options); - } - - - public unsafe virtual int IndexOf(String source, String value, int startIndex, int count, CompareOptions options) - { - // Validate inputs - if (source == null) - throw new ArgumentNullException(nameof(source)); - if (value == null) - throw new ArgumentNullException(nameof(value)); - - if (startIndex > source.Length) - { - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index); - } - Contract.EndContractBlock(); - - // In Everett we used to return -1 for empty string even if startIndex is negative number so we keeping same behavior here. - // We return 0 if both source and value are empty strings for Everett compatibility too. - if (source.Length == 0) - { - if (value.Length == 0) - { - return 0; - } - return -1; - } - - if (startIndex < 0) - { - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index); - } - - if (count < 0 || startIndex > source.Length - count) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count); - - if (options == CompareOptions.OrdinalIgnoreCase) - { - return IndexOfOrdinal(source, value, startIndex, count, ignoreCase: true); - } - - // Validate CompareOptions - // Ordinal can't be selected with other flags - if ((options & ValidIndexMaskOffFlags) != 0 && (options != CompareOptions.Ordinal)) - throw new ArgumentException(SR.Argument_InvalidFlag, nameof(options)); - - return IndexOfCore(source, value, startIndex, count, options); - } - - //////////////////////////////////////////////////////////////////////// - // - // LastIndexOf - // - // Returns the last index where value is found in string. The - // search starts from startIndex and ends at endIndex. Returns -1 if - // the specified value is not found. If value equals String.Empty, - // endIndex is returned. Throws IndexOutOfRange if startIndex or - // endIndex is less than zero or greater than the length of string. - // Throws ArgumentException if value is null. - // - //////////////////////////////////////////////////////////////////////// - - - public unsafe virtual int LastIndexOf(String source, char value) - { - if (source == null) - throw new ArgumentNullException(nameof(source)); - Contract.EndContractBlock(); - - // Can't start at negative index, so make sure we check for the length == 0 case. - return LastIndexOf(source, value, source.Length - 1, - source.Length, CompareOptions.None); - } - - - public virtual int LastIndexOf(String source, String value) - { - if (source == null) - throw new ArgumentNullException(nameof(source)); - Contract.EndContractBlock(); - - // Can't start at negative index, so make sure we check for the length == 0 case. - return LastIndexOf(source, value, source.Length - 1, - source.Length, CompareOptions.None); - } - - - public virtual int LastIndexOf(String source, char value, CompareOptions options) - { - if (source == null) - throw new ArgumentNullException(nameof(source)); - Contract.EndContractBlock(); - - // Can't start at negative index, so make sure we check for the length == 0 case. - return LastIndexOf(source, value, source.Length - 1, - source.Length, options); - } - - public unsafe virtual int LastIndexOf(String source, String value, CompareOptions options) - { - if (source == null) - throw new ArgumentNullException(nameof(source)); - Contract.EndContractBlock(); - - // Can't start at negative index, so make sure we check for the length == 0 case. - return LastIndexOf(source, value, source.Length - 1, - source.Length, options); - } - - public unsafe virtual int LastIndexOf(String source, char value, int startIndex) - { - return LastIndexOf(source, value, startIndex, startIndex + 1, CompareOptions.None); - } - - - public unsafe virtual int LastIndexOf(String source, String value, int startIndex) - { - return LastIndexOf(source, value, startIndex, startIndex + 1, CompareOptions.None); - } - - public unsafe virtual int LastIndexOf(String source, char value, int startIndex, CompareOptions options) - { - return LastIndexOf(source, value, startIndex, startIndex + 1, options); - } - - - public unsafe virtual int LastIndexOf(String source, String value, int startIndex, CompareOptions options) - { - return LastIndexOf(source, value, startIndex, startIndex + 1, options); - } - - - public unsafe virtual int LastIndexOf(String source, char value, int startIndex, int count) - { - return LastIndexOf(source, value, startIndex, count, CompareOptions.None); - } - - - public unsafe virtual int LastIndexOf(String source, String value, int startIndex, int count) - { - return LastIndexOf(source, value, startIndex, count, CompareOptions.None); - } - - - public unsafe virtual int LastIndexOf(String source, char value, int startIndex, int count, CompareOptions options) - { - // Verify Arguments - if (source == null) - throw new ArgumentNullException(nameof(source)); - Contract.EndContractBlock(); - - // Validate CompareOptions - // Ordinal can't be selected with other flags - if ((options & ValidIndexMaskOffFlags) != 0 && - (options != CompareOptions.Ordinal) && - (options != CompareOptions.OrdinalIgnoreCase)) - throw new ArgumentException(SR.Argument_InvalidFlag, nameof(options)); - - // Special case for 0 length input strings - if (source.Length == 0 && (startIndex == -1 || startIndex == 0)) - return -1; - - // Make sure we're not out of range - if (startIndex < 0 || startIndex > source.Length) - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index); - - // Make sure that we allow startIndex == source.Length - if (startIndex == source.Length) - { - startIndex--; - if (count > 0) - count--; - } - - // 2nd have of this also catches when startIndex == MAXINT, so MAXINT - 0 + 1 == -1, which is < 0. - if (count < 0 || startIndex - count + 1 < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count); - - if (options == CompareOptions.OrdinalIgnoreCase) - { - return source.LastIndexOf(value.ToString(), startIndex, count, StringComparison.OrdinalIgnoreCase); - } - - return LastIndexOfCore(source, value.ToString(), startIndex, count, options); - } - - - public unsafe virtual int LastIndexOf(String source, String value, int startIndex, int count, CompareOptions options) - { - // Verify Arguments - if (source == null) - throw new ArgumentNullException(nameof(source)); - if (value == null) - throw new ArgumentNullException(nameof(value)); - Contract.EndContractBlock(); - - // Validate CompareOptions - // Ordinal can't be selected with other flags - if ((options & ValidIndexMaskOffFlags) != 0 && - (options != CompareOptions.Ordinal) && - (options != CompareOptions.OrdinalIgnoreCase)) - throw new ArgumentException(SR.Argument_InvalidFlag, nameof(options)); - - // Special case for 0 length input strings - if (source.Length == 0 && (startIndex == -1 || startIndex == 0)) - return (value.Length == 0) ? 0 : -1; - - // Make sure we're not out of range - if (startIndex < 0 || startIndex > source.Length) - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index); - - // Make sure that we allow startIndex == source.Length - if (startIndex == source.Length) - { - startIndex--; - if (count > 0) - count--; - - // If we are looking for nothing, just return 0 - if (value.Length == 0 && count >= 0 && startIndex - count + 1 >= 0) - return startIndex; - } - - // 2nd half of this also catches when startIndex == MAXINT, so MAXINT - 0 + 1 == -1, which is < 0. - if (count < 0 || startIndex - count + 1 < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count); - - if (options == CompareOptions.OrdinalIgnoreCase) - { - return LastIndexOfOrdinal(source, value, startIndex, count, ignoreCase: true); - } - - return LastIndexOfCore(source, value, startIndex, count, options); - } - - //////////////////////////////////////////////////////////////////////// - // - // GetSortKey - // - // Gets the SortKey for the given string with the given options. - // - //////////////////////////////////////////////////////////////////////// - public unsafe virtual SortKey GetSortKey(String source, CompareOptions options) - { - return CreateSortKey(source, options); - } - - - public unsafe virtual SortKey GetSortKey(String source) - { - return CreateSortKey(source, CompareOptions.None); - } - - //////////////////////////////////////////////////////////////////////// - // - // Equals - // - // Implements Object.Equals(). Returns a boolean indicating whether - // or not object refers to the same CompareInfo as the current - // instance. - // - //////////////////////////////////////////////////////////////////////// - - - public override bool Equals(Object value) - { - CompareInfo that = value as CompareInfo; - - if (that != null) - { - return this.Name == that.Name; - } - - return (false); - } - - - //////////////////////////////////////////////////////////////////////// - // - // GetHashCode - // - // Implements Object.GetHashCode(). Returns the hash code for the - // CompareInfo. The hash code is guaranteed to be the same for - // CompareInfo A and B where A.Equals(B) is true. - // - //////////////////////////////////////////////////////////////////////// - - - public override int GetHashCode() - { - return (this.Name.GetHashCode()); - } - - - //////////////////////////////////////////////////////////////////////// - // - // GetHashCodeOfString - // - // This internal method allows a method that allows the equivalent of creating a Sortkey for a - // string from CompareInfo, and generate a hashcode value from it. It is not very convenient - // to use this method as is and it creates an unnecessary Sortkey object that will be GC'ed. - // - // The hash code is guaranteed to be the same for string A and B where A.Equals(B) is true and both - // the CompareInfo and the CompareOptions are the same. If two different CompareInfo objects - // treat the string the same way, this implementation will treat them differently (the same way that - // Sortkey does at the moment). - // - // This method will never be made public itself, but public consumers of it could be created, e.g.: - // - // string.GetHashCode(CultureInfo) - // string.GetHashCode(CompareInfo) - // string.GetHashCode(CultureInfo, CompareOptions) - // string.GetHashCode(CompareInfo, CompareOptions) - // etc. - // - // (the methods above that take a CultureInfo would use CultureInfo.CompareInfo) - // - //////////////////////////////////////////////////////////////////////// - internal int GetHashCodeOfString(string source, CompareOptions options) - { - // - // Parameter validation - // - if (null == source) - { - throw new ArgumentNullException(nameof(source)); - } - - if ((options & ValidHashCodeOfStringMaskOffFlags) != 0) - { - throw new ArgumentException(SR.Argument_InvalidFlag, nameof(options)); - } - Contract.EndContractBlock(); - - return GetHashCodeOfStringCore(source, options); - } - - public virtual int GetHashCode(string source, CompareOptions options) - { - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - - if (options == CompareOptions.Ordinal) - { - return source.GetHashCode(); - } - - if (options == CompareOptions.OrdinalIgnoreCase) - { - return TextInfo.GetHashCodeOrdinalIgnoreCase(source); - } - - // - // GetHashCodeOfString does more parameters validation. basically will throw when - // having Ordinal, OrdinalIgnoreCase and StringSort - // - - return GetHashCodeOfString(source, options); - } - - //////////////////////////////////////////////////////////////////////// - // - // ToString - // - // Implements Object.ToString(). Returns a string describing the - // CompareInfo. - // - //////////////////////////////////////////////////////////////////////// - public override String ToString() - { - return ("CompareInfo - " + this.Name); - } - - public SortVersion Version - { - get - { - if (_sortVersion == null) - { - _sortVersion = GetSortVersion(); - } - - return _sortVersion; - } - } - - public int LCID - { - get - { - return CultureInfo.GetCultureInfo(Name).LCID; - } - } - } -} diff --git a/src/mscorlib/corefx/System/Globalization/CultureData.Unix.cs b/src/mscorlib/corefx/System/Globalization/CultureData.Unix.cs deleted file mode 100644 index ba96189458..0000000000 --- a/src/mscorlib/corefx/System/Globalization/CultureData.Unix.cs +++ /dev/null @@ -1,419 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Diagnostics.Contracts; -using System.Runtime.InteropServices; -using System.Security; -using System.Text; - -namespace System.Globalization -{ - internal partial class CultureData - { - // ICU constants - const int ICU_ULOC_KEYWORD_AND_VALUES_CAPACITY = 100; // max size of keyword or value - const int ICU_ULOC_FULLNAME_CAPACITY = 157; // max size of locale name - const string ICU_COLLATION_KEYWORD = "@collation="; - - - /// <summary> - /// This method uses the sRealName field (which is initialized by the constructor before this is called) to - /// initialize the rest of the state of CultureData based on the underlying OS globalization library. - /// </summary> - private unsafe bool InitCultureData() - { - Debug.Assert(_sRealName != null); - - string alternateSortName = string.Empty; - string realNameBuffer = _sRealName; - - // Basic validation - if (realNameBuffer.Contains("@")) - { - return false; // don't allow ICU variants to come in directly - } - - // Replace _ (alternate sort) with @collation= for ICU - int index = realNameBuffer.IndexOf('_'); - if (index > 0) - { - if (index >= (realNameBuffer.Length - 1) // must have characters after _ - || realNameBuffer.Substring(index + 1).Contains("_")) // only one _ allowed - { - return false; // fail - } - alternateSortName = realNameBuffer.Substring(index + 1); - realNameBuffer = realNameBuffer.Substring(0, index) + ICU_COLLATION_KEYWORD + alternateSortName; - } - - // Get the locale name from ICU - if (!GetLocaleName(realNameBuffer, out _sWindowsName)) - { - return false; // fail - } - - // Replace the ICU collation keyword with an _ - index = _sWindowsName.IndexOf(ICU_COLLATION_KEYWORD, StringComparison.Ordinal); - if (index >= 0) - { - _sName = _sWindowsName.Substring(0, index) + "_" + alternateSortName; - } - else - { - _sName = _sWindowsName; - } - _sRealName = _sName; - - _iLanguage = this.ILANGUAGE; - if (_iLanguage == 0) - { - _iLanguage = CultureInfo.LOCALE_CUSTOM_UNSPECIFIED; - } - - _bNeutral = (this.SISO3166CTRYNAME.Length == 0); - - _sSpecificCulture = _bNeutral ? LocaleData.GetSpecificCultureName(_sRealName) : _sRealName; - - // Remove the sort from sName unless custom culture - if (index>0 && !_bNeutral && !IsCustomCultureId(_iLanguage)) - { - _sName = _sWindowsName.Substring(0, index); - } - return true; - } - - internal static bool GetLocaleName(string localeName, out string windowsName) - { - // Get the locale name from ICU - StringBuilder sb = StringBuilderCache.Acquire(ICU_ULOC_FULLNAME_CAPACITY); - if (!Interop.GlobalizationInterop.GetLocaleName(localeName, sb, sb.Capacity)) - { - StringBuilderCache.Release(sb); - windowsName = null; - return false; // fail - } - - // Success - use the locale name returned which may be different than realNameBuffer (casing) - windowsName = StringBuilderCache.GetStringAndRelease(sb); // the name passed to subsequent ICU calls - return true; - } - - internal static bool GetDefaultLocaleName(out string windowsName) - { - // Get the default (system) locale name from ICU - StringBuilder sb = StringBuilderCache.Acquire(ICU_ULOC_FULLNAME_CAPACITY); - if (!Interop.GlobalizationInterop.GetDefaultLocaleName(sb, sb.Capacity)) - { - StringBuilderCache.Release(sb); - windowsName = null; - return false; // fail - } - - // Success - use the locale name returned which may be different than realNameBuffer (casing) - windowsName = StringBuilderCache.GetStringAndRelease(sb); // the name passed to subsequent ICU calls - return true; - } - - private string GetLocaleInfo(LocaleStringData type) - { - Debug.Assert(_sWindowsName != null, "[CultureData.GetLocaleInfo] Expected _sWindowsName to be populated already"); - return GetLocaleInfo(_sWindowsName, type); - } - - // For LOCALE_SPARENT we need the option of using the "real" name (forcing neutral names) instead of the - // "windows" name, which can be specific for downlevel (< windows 7) os's. - private string GetLocaleInfo(string localeName, LocaleStringData type) - { - Debug.Assert(localeName != null, "[CultureData.GetLocaleInfo] Expected localeName to be not be null"); - - switch (type) - { - case LocaleStringData.NegativeInfinitySymbol: - // not an equivalent in ICU; prefix the PositiveInfinitySymbol with NegativeSign - return GetLocaleInfo(localeName, LocaleStringData.NegativeSign) + - GetLocaleInfo(localeName, LocaleStringData.PositiveInfinitySymbol); - } - - StringBuilder sb = StringBuilderCache.Acquire(ICU_ULOC_KEYWORD_AND_VALUES_CAPACITY); - - bool result = Interop.GlobalizationInterop.GetLocaleInfoString(localeName, (uint)type, sb, sb.Capacity); - if (!result) - { - // Failed, just use empty string - StringBuilderCache.Release(sb); - Debug.Assert(false, "[CultureData.GetLocaleInfo(LocaleStringData)] Failed"); - return String.Empty; - } - return StringBuilderCache.GetStringAndRelease(sb); - } - - private int GetLocaleInfo(LocaleNumberData type) - { - Debug.Assert(_sWindowsName != null, "[CultureData.GetLocaleInfo(LocaleNumberData)] Expected _sWindowsName to be populated already"); - - switch (type) - { - case LocaleNumberData.CalendarType: - // returning 0 will cause the first supported calendar to be returned, which is the preferred calendar - return 0; - } - - - int value = 0; - bool result = Interop.GlobalizationInterop.GetLocaleInfoInt(_sWindowsName, (uint)type, ref value); - if (!result) - { - // Failed, just use 0 - Debug.Assert(false, "[CultureData.GetLocaleInfo(LocaleNumberData)] failed"); - } - - return value; - } - - private int[] GetLocaleInfo(LocaleGroupingData type) - { - Debug.Assert(_sWindowsName != null, "[CultureData.GetLocaleInfo(LocaleGroupingData)] Expected _sWindowsName to be populated already"); - - int primaryGroupingSize = 0; - int secondaryGroupingSize = 0; - bool result = Interop.GlobalizationInterop.GetLocaleInfoGroupingSizes(_sWindowsName, (uint)type, ref primaryGroupingSize, ref secondaryGroupingSize); - if (!result) - { - Debug.Assert(false, "[CultureData.GetLocaleInfo(LocaleGroupingData type)] failed"); - } - - if (secondaryGroupingSize == 0) - { - return new int[] { primaryGroupingSize }; - } - - return new int[] { primaryGroupingSize, secondaryGroupingSize }; - } - - private string GetTimeFormatString() - { - return GetTimeFormatString(false); - } - - private string GetTimeFormatString(bool shortFormat) - { - Debug.Assert(_sWindowsName != null, "[CultureData.GetTimeFormatString(bool shortFormat)] Expected _sWindowsName to be populated already"); - - StringBuilder sb = StringBuilderCache.Acquire(ICU_ULOC_KEYWORD_AND_VALUES_CAPACITY); - - bool result = Interop.GlobalizationInterop.GetLocaleTimeFormat(_sWindowsName, shortFormat, sb, sb.Capacity); - if (!result) - { - // Failed, just use empty string - StringBuilderCache.Release(sb); - Debug.Assert(false, "[CultureData.GetTimeFormatString(bool shortFormat)] Failed"); - return String.Empty; - } - - return ConvertIcuTimeFormatString(StringBuilderCache.GetStringAndRelease(sb)); - } - - private int GetFirstDayOfWeek() - { - return this.GetLocaleInfo(LocaleNumberData.FirstDayOfWeek); - } - - private String[] GetTimeFormats() - { - string format = GetTimeFormatString(false); - return new string[] { format }; - } - - private String[] GetShortTimeFormats() - { - string format = GetTimeFormatString(true); - return new string[] { format }; - } - - private static CultureData GetCultureDataFromRegionName(String regionName) - { - // no support to lookup by region name, other than the hard-coded list in CultureData - return null; - } - - private static string GetLanguageDisplayName(string cultureName) - { - return new CultureInfo(cultureName).m_cultureData.GetLocaleInfo(cultureName, LocaleStringData.LocalizedDisplayName); - } - - private static string GetRegionDisplayName(string isoCountryCode) - { - // use the fallback which is to return NativeName - return null; - } - - private static CultureInfo GetUserDefaultCulture() - { - return CultureInfo.GetUserDefaultCulture(); - } - - private static string ConvertIcuTimeFormatString(string icuFormatString) - { - StringBuilder sb = StringBuilderCache.Acquire(ICU_ULOC_FULLNAME_CAPACITY); - bool amPmAdded = false; - - for (int i = 0; i < icuFormatString.Length; i++) - { - switch(icuFormatString[i]) - { - case ':': - case '.': - case 'H': - case 'h': - case 'm': - case 's': - sb.Append(icuFormatString[i]); - break; - - case ' ': - case '\u00A0': - // Convert nonbreaking spaces into regular spaces - sb.Append(' '); - break; - - case 'a': // AM/PM - if (!amPmAdded) - { - amPmAdded = true; - sb.Append("tt"); - } - break; - - } - } - - return StringBuilderCache.GetStringAndRelease(sb); - } - - private static string LCIDToLocaleName(int culture) - { - return LocaleData.LCIDToLocaleName(culture); - } - - private static int LocaleNameToLCID(string cultureName) - { - int lcid = LocaleData.GetLocaleDataNumericPart(cultureName, LocaleDataParts.Lcid); - return lcid == -1 ? CultureInfo.LOCALE_CUSTOM_UNSPECIFIED : lcid; - } - - private static int GetAnsiCodePage(string cultureName) - { - int ansiCodePage = LocaleData.GetLocaleDataNumericPart(cultureName, LocaleDataParts.AnsiCodePage); - return ansiCodePage == -1 ? CultureData.Invariant.IDEFAULTANSICODEPAGE : ansiCodePage; - } - - private static int GetOemCodePage(string cultureName) - { - int oemCodePage = LocaleData.GetLocaleDataNumericPart(cultureName, LocaleDataParts.OemCodePage); - return oemCodePage == -1 ? CultureData.Invariant.IDEFAULTOEMCODEPAGE : oemCodePage; - } - - private static int GetMacCodePage(string cultureName) - { - int macCodePage = LocaleData.GetLocaleDataNumericPart(cultureName, LocaleDataParts.MacCodePage); - return macCodePage == -1 ? CultureData.Invariant.IDEFAULTMACCODEPAGE : macCodePage; - } - - private static int GetEbcdicCodePage(string cultureName) - { - int ebcdicCodePage = LocaleData.GetLocaleDataNumericPart(cultureName, LocaleDataParts.EbcdicCodePage); - return ebcdicCodePage == -1 ? CultureData.Invariant.IDEFAULTEBCDICCODEPAGE : ebcdicCodePage; - } - - private static int GetGeoId(string cultureName) - { - int geoId = LocaleData.GetLocaleDataNumericPart(cultureName, LocaleDataParts.GeoId); - return geoId == -1 ? CultureData.Invariant.IGEOID : geoId; - } - - private static int GetDigitSubstitution(string cultureName) - { - int digitSubstitution = LocaleData.GetLocaleDataNumericPart(cultureName, LocaleDataParts.DigitSubstitution); - return digitSubstitution == -1 ? (int) DigitShapes.None : digitSubstitution; - } - - private static string GetThreeLetterWindowsLanguageName(string cultureName) - { - string langName = LocaleData.GetThreeLetterWindowsLangageName(cultureName); - return langName == null ? "ZZZ" /* default lang name */ : langName; - } - - private static CultureInfo[] EnumCultures(CultureTypes types) - { - if ((types & (CultureTypes.NeutralCultures | CultureTypes.SpecificCultures)) == 0) - { - return Array.Empty<CultureInfo>(); - } - - int bufferLength = Interop.GlobalizationInterop.GetLocales(null, 0); - if (bufferLength <= 0) - { - return Array.Empty<CultureInfo>(); - } - - Char [] chars = new Char[bufferLength]; - - bufferLength = Interop.GlobalizationInterop.GetLocales(chars, bufferLength); - if (bufferLength <= 0) - { - return Array.Empty<CultureInfo>(); - } - - bool enumNeutrals = (types & CultureTypes.NeutralCultures) != 0; - bool enumSpecificss = (types & CultureTypes.SpecificCultures) != 0; - - List<CultureInfo> list = new List<CultureInfo>(); - if (enumNeutrals) - { - list.Add(CultureInfo.InvariantCulture); - } - - int index = 0; - while (index < bufferLength) - { - int length = (int) chars[index++]; - if (index + length <= bufferLength) - { - CultureInfo ci = CultureInfo.GetCultureInfo(new String(chars, index, length)); - if ((enumNeutrals && ci.IsNeutralCulture) || (enumSpecificss && !ci.IsNeutralCulture)) - { - list.Add(ci); - } - } - - index += length; - } - - return list.ToArray(); - } - - private static string GetConsoleFallbackName(string cultureName) - { - return LocaleData.GetConsoleUICulture(cultureName); - } - - internal bool IsFramework // not applicable on Linux based systems - { - get { return false; } - } - - internal bool IsWin32Installed // not applicable on Linux based systems - { - get { return false; } - } - - internal bool IsReplacementCulture // not applicable on Linux based systems - { - get { return false; } - } - } -} diff --git a/src/mscorlib/corefx/System/Globalization/CultureData.Windows.cs b/src/mscorlib/corefx/System/Globalization/CultureData.Windows.cs deleted file mode 100644 index 0c264e5f8b..0000000000 --- a/src/mscorlib/corefx/System/Globalization/CultureData.Windows.cs +++ /dev/null @@ -1,672 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Collections.Generic; -using System.Diagnostics; -using System.Runtime.InteropServices; -using System.Text; - -#if ENABLE_WINRT -using Internal.Runtime.Augments; -#endif - -namespace System.Globalization -{ - internal partial class CultureData - { - private const uint LOCALE_NOUSEROVERRIDE = 0x80000000; - private const uint LOCALE_RETURN_NUMBER = 0x20000000; - private const uint LOCALE_SISO3166CTRYNAME = 0x0000005A; - - private const uint TIME_NOSECONDS = 0x00000002; - - /// <summary> - /// Check with the OS to see if this is a valid culture. - /// If so we populate a limited number of fields. If its not valid we return false. - /// - /// The fields we populate: - /// - /// sWindowsName -- The name that windows thinks this culture is, ie: - /// en-US if you pass in en-US - /// de-DE_phoneb if you pass in de-DE_phoneb - /// fj-FJ if you pass in fj (neutral, on a pre-Windows 7 machine) - /// fj if you pass in fj (neutral, post-Windows 7 machine) - /// - /// sRealName -- The name you used to construct the culture, in pretty form - /// en-US if you pass in EN-us - /// en if you pass in en - /// de-DE_phoneb if you pass in de-DE_phoneb - /// - /// sSpecificCulture -- The specific culture for this culture - /// en-US for en-US - /// en-US for en - /// de-DE_phoneb for alt sort - /// fj-FJ for fj (neutral) - /// - /// sName -- The IETF name of this culture (ie: no sort info, could be neutral) - /// en-US if you pass in en-US - /// en if you pass in en - /// de-DE if you pass in de-DE_phoneb - /// - /// bNeutral -- TRUE if it is a neutral locale - /// - /// For a neutral we just populate the neutral name, but we leave the windows name pointing to the - /// windows locale that's going to provide data for us. - /// </summary> - private unsafe bool InitCultureData() - { - const int LOCALE_NAME_MAX_LENGTH = 85; - - const uint LOCALE_ILANGUAGE = 0x00000001; - const uint LOCALE_INEUTRAL = 0x00000071; - const uint LOCALE_SNAME = 0x0000005c; - - int result; - string realNameBuffer = _sRealName; - char* pBuffer = stackalloc char[LOCALE_NAME_MAX_LENGTH]; - - result = Interop.mincore.GetLocaleInfoEx(realNameBuffer, LOCALE_SNAME, pBuffer, LOCALE_NAME_MAX_LENGTH); - - // Did it fail? - if (result == 0) - { - return false; - } - - // It worked, note that the name is the locale name, so use that (even for neutrals) - // We need to clean up our "real" name, which should look like the windows name right now - // so overwrite the input with the cleaned up name - _sRealName = new String(pBuffer, 0, result - 1); - realNameBuffer = _sRealName; - - // Check for neutrality, don't expect to fail - // (buffer has our name in it, so we don't have to do the gc. stuff) - - result = Interop.mincore.GetLocaleInfoEx(realNameBuffer, LOCALE_INEUTRAL | LOCALE_RETURN_NUMBER, pBuffer, sizeof(int) / sizeof(char)); - if (result == 0) - { - return false; - } - - // Remember our neutrality - _bNeutral = *((uint*)pBuffer) != 0; - - // Note: Parents will be set dynamically - - // Start by assuming the windows name'll be the same as the specific name since windows knows - // about specifics on all versions. Only for downlevel Neutral locales does this have to change. - _sWindowsName = realNameBuffer; - - // Neutrals and non-neutrals are slightly different - if (_bNeutral) - { - // Neutral Locale - - // IETF name looks like neutral name - _sName = realNameBuffer; - - // Specific locale name is whatever ResolveLocaleName (win7+) returns. - // (Buffer has our name in it, and we can recycle that because windows resolves it before writing to the buffer) - result = Interop.mincore.ResolveLocaleName(realNameBuffer, pBuffer, LOCALE_NAME_MAX_LENGTH); - - // 0 is failure, 1 is invariant (""), which we expect - if (result < 1) - { - return false; - } - // We found a locale name, so use it. - // In vista this should look like a sort name (de-DE_phoneb) or a specific culture (en-US) and be in the "pretty" form - _sSpecificCulture = new String(pBuffer, 0, result - 1); - } - else - { - // Specific Locale - - // Specific culture's the same as the locale name since we know its not neutral - // On mac we'll use this as well, even for neutrals. There's no obvious specific - // culture to use and this isn't exposed, but behaviorally this is correct on mac. - // Note that specifics include the sort name (de-DE_phoneb) - _sSpecificCulture = realNameBuffer; - - _sName = realNameBuffer; - - // We need the IETF name (sname) - // If we aren't an alt sort locale then this is the same as the windows name. - // If we are an alt sort locale then this is the same as the part before the _ in the windows name - // This is for like de-DE_phoneb and es-ES_tradnl that hsouldn't have the _ part - - result = Interop.mincore.GetLocaleInfoEx(realNameBuffer, LOCALE_ILANGUAGE | LOCALE_RETURN_NUMBER, pBuffer, sizeof(int) / sizeof(char)); - if (result == 0) - { - return false; - } - - _iLanguage = *((int*)pBuffer); - - if (!IsCustomCultureId(_iLanguage)) - { - // not custom locale - int index = realNameBuffer.IndexOf('_'); - if (index > 0 && index < realNameBuffer.Length) - { - _sName = realNameBuffer.Substring(0, index); - } - } - } - - // It succeeded. - return true; - } - - private string GetLocaleInfo(LocaleStringData type) - { - Debug.Assert(_sWindowsName != null, "[CultureData.DoGetLocaleInfo] Expected _sWindowsName to be populated by already"); - return GetLocaleInfo(_sWindowsName, type); - } - - // For LOCALE_SPARENT we need the option of using the "real" name (forcing neutral names) instead of the - // "windows" name, which can be specific for downlevel (< windows 7) os's. - private string GetLocaleInfo(string localeName, LocaleStringData type) - { - uint lctype = (uint)type; - - return GetLocaleInfoFromLCType(localeName, lctype, UseUserOverride); - } - - private int GetLocaleInfo(LocaleNumberData type) - { - uint lctype = (uint)type; - - // Fix lctype if we don't want overrides - if (!UseUserOverride) - { - lctype |= LOCALE_NOUSEROVERRIDE; - } - - // Ask OS for data, note that we presume it returns success, so we have to know that - // sWindowsName is valid before calling. - Debug.Assert(_sWindowsName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sWindowsName to be populated by already"); - int result = Interop.mincore.GetLocaleInfoExInt(_sWindowsName, lctype); - - return result; - } - - private int[] GetLocaleInfo(LocaleGroupingData type) - { - return ConvertWin32GroupString(GetLocaleInfoFromLCType(_sWindowsName, (uint)type, UseUserOverride)); - } - - private string GetTimeFormatString() - { - const uint LOCALE_STIMEFORMAT = 0x00001003; - - return ReescapeWin32String(GetLocaleInfoFromLCType(_sWindowsName, LOCALE_STIMEFORMAT, UseUserOverride)); - } - - private int GetFirstDayOfWeek() - { - Debug.Assert(_sWindowsName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sWindowsName to be populated by already"); - - const uint LOCALE_IFIRSTDAYOFWEEK = 0x0000100C; - - int result = Interop.mincore.GetLocaleInfoExInt(_sWindowsName, LOCALE_IFIRSTDAYOFWEEK | (!UseUserOverride ? LOCALE_NOUSEROVERRIDE : 0)); - - // Win32 and .NET disagree on the numbering for days of the week, so we have to convert. - return ConvertFirstDayOfWeekMonToSun(result); - } - - private String[] GetTimeFormats() - { - // Note that this gets overrides for us all the time - Debug.Assert(_sWindowsName != null, "[CultureData.DoEnumTimeFormats] Expected _sWindowsName to be populated by already"); - String[] result = ReescapeWin32Strings(nativeEnumTimeFormats(_sWindowsName, 0, UseUserOverride)); - - return result; - } - - private String[] GetShortTimeFormats() - { - // Note that this gets overrides for us all the time - Debug.Assert(_sWindowsName != null, "[CultureData.DoEnumShortTimeFormats] Expected _sWindowsName to be populated by already"); - String[] result = ReescapeWin32Strings(nativeEnumTimeFormats(_sWindowsName, TIME_NOSECONDS, UseUserOverride)); - - return result; - } - - // Enumerate all system cultures and then try to find out which culture has - // region name match the requested region name - private static CultureData GetCultureDataFromRegionName(String regionName) - { - Debug.Assert(regionName != null); - - const uint LOCALE_SUPPLEMENTAL = 0x00000002; - const uint LOCALE_SPECIFICDATA = 0x00000020; - - EnumLocaleData context = new EnumLocaleData(); - context.cultureName = null; - context.regionName = regionName; - - GCHandle contextHandle = GCHandle.Alloc(context); - try - { - IntPtr callback = AddrofIntrinsics.AddrOf<Func<IntPtr, uint, IntPtr, Interop.BOOL>>(EnumSystemLocalesProc); - Interop.mincore.EnumSystemLocalesEx(callback, LOCALE_SPECIFICDATA | LOCALE_SUPPLEMENTAL, (IntPtr)contextHandle, IntPtr.Zero); - } - finally - { - contextHandle.Free(); - } - - if (context.cultureName != null) - { - // we got a matched culture - return GetCultureData(context.cultureName, true); - } - - return null; - } - - private string GetLanguageDisplayName(string cultureName) - { -#if ENABLE_WINRT - return WinRTInterop.Callbacks.GetLanguageDisplayName(cultureName); -#else - // Usually the UI culture shouldn't be different than what we got from WinRT except - // if DefaultThreadCurrentUICulture was set - CultureInfo ci; - - if (CultureInfo.DefaultThreadCurrentUICulture != null && - ((ci = GetUserDefaultCulture()) != null) && - !CultureInfo.DefaultThreadCurrentUICulture.Name.Equals(ci.Name)) - { - return SNATIVEDISPLAYNAME; - } - else - { - return GetLocaleInfo(cultureName, LocaleStringData.LocalizedDisplayName); - } -#endif // ENABLE_WINRT - } - - private string GetRegionDisplayName(string isoCountryCode) - { -#if ENABLE_WINRT - return WinRTInterop.Callbacks.GetRegionDisplayName(isoCountryCode); -#else - // Usually the UI culture shouldn't be different than what we got from WinRT except - // if DefaultThreadCurrentUICulture was set - CultureInfo ci; - - if (CultureInfo.DefaultThreadCurrentUICulture != null && - ((ci = GetUserDefaultCulture()) != null) && - !CultureInfo.DefaultThreadCurrentUICulture.Name.Equals(ci.Name)) - { - return SNATIVECOUNTRY; - } - else - { - return GetLocaleInfo(LocaleStringData.LocalizedCountryName); - } -#endif // ENABLE_WINRT - } - - private static CultureInfo GetUserDefaultCulture() - { -#if ENABLE_WINRT - return (CultureInfo)WinRTInterop.Callbacks.GetUserDefaultCulture(); -#else - return CultureInfo.GetUserDefaultCulture(); -#endif // ENABLE_WINRT - } - - // PAL methods end here. - - private static string GetLocaleInfoFromLCType(string localeName, uint lctype, bool useUserOveride) - { - Debug.Assert(localeName != null, "[CultureData.GetLocaleInfoFromLCType] Expected localeName to be not be null"); - - // Fix lctype if we don't want overrides - if (!useUserOveride) - { - lctype |= LOCALE_NOUSEROVERRIDE; - } - - // Ask OS for data - string result = Interop.mincore.GetLocaleInfoEx(localeName, lctype); - if (result == null) - { - // Failed, just use empty string - result = String.Empty; - } - - return result; - } - - //////////////////////////////////////////////////////////////////////////// - // - // Reescape a Win32 style quote string as a NLS+ style quoted string - // - // This is also the escaping style used by custom culture data files - // - // NLS+ uses \ to escape the next character, whether in a quoted string or - // not, so we always have to change \ to \\. - // - // NLS+ uses \' to escape a quote inside a quoted string so we have to change - // '' to \' (if inside a quoted string) - // - // We don't build the stringbuilder unless we find something to change - //////////////////////////////////////////////////////////////////////////// - internal static String ReescapeWin32String(String str) - { - // If we don't have data, then don't try anything - if (str == null) - return null; - - StringBuilder result = null; - - bool inQuote = false; - for (int i = 0; i < str.Length; i++) - { - // Look for quote - if (str[i] == '\'') - { - // Already in quote? - if (inQuote) - { - // See another single quote. Is this '' of 'fred''s' or '''', or is it an ending quote? - if (i + 1 < str.Length && str[i + 1] == '\'') - { - // Found another ', so we have ''. Need to add \' instead. - // 1st make sure we have our stringbuilder - if (result == null) - result = new StringBuilder(str, 0, i, str.Length * 2); - - // Append a \' and keep going (so we don't turn off quote mode) - result.Append("\\'"); - i++; - continue; - } - - // Turning off quote mode, fall through to add it - inQuote = false; - } - else - { - // Found beginning quote, fall through to add it - inQuote = true; - } - } - // Is there a single \ character? - else if (str[i] == '\\') - { - // Found a \, need to change it to \\ - // 1st make sure we have our stringbuilder - if (result == null) - result = new StringBuilder(str, 0, i, str.Length * 2); - - // Append our \\ to the string & continue - result.Append("\\\\"); - continue; - } - - // If we have a builder we need to add our character - if (result != null) - result.Append(str[i]); - } - - // Unchanged string? , just return input string - if (result == null) - return str; - - // String changed, need to use the builder - return result.ToString(); - } - - internal static String[] ReescapeWin32Strings(String[] array) - { - if (array != null) - { - for (int i = 0; i < array.Length; i++) - { - array[i] = ReescapeWin32String(array[i]); - } - } - - return array; - } - - // If we get a group from windows, then its in 3;0 format with the 0 backwards - // of how NLS+ uses it (ie: if the string has a 0, then the int[] shouldn't and vice versa) - // EXCEPT in the case where the list only contains 0 in which NLS and NLS+ have the same meaning. - private static int[] ConvertWin32GroupString(String win32Str) - { - // None of these cases make any sense - if (win32Str == null || win32Str.Length == 0) - { - return (new int[] { 3 }); - } - - if (win32Str[0] == '0') - { - return (new int[] { 0 }); - } - - // Since its in n;n;n;n;n format, we can always get the length quickly - int[] values; - if (win32Str[win32Str.Length - 1] == '0') - { - // Trailing 0 gets dropped. 1;0 -> 1 - values = new int[(win32Str.Length / 2)]; - } - else - { - // Need extra space for trailing zero 1 -> 1;0 - values = new int[(win32Str.Length / 2) + 2]; - values[values.Length - 1] = 0; - } - - int i; - int j; - for (i = 0, j = 0; i < win32Str.Length && j < values.Length; i += 2, j++) - { - // Note that this # shouldn't ever be zero, 'cause 0 is only at end - // But we'll test because its registry that could be anything - if (win32Str[i] < '1' || win32Str[i] > '9') - return new int[] { 3 }; - - values[j] = (int)(win32Str[i] - '0'); - } - - return (values); - } - - private static int ConvertFirstDayOfWeekMonToSun(int iTemp) - { - // Convert Mon-Sun to Sun-Sat format - iTemp++; - if (iTemp > 6) - { - // Wrap Sunday and convert invalid data to Sunday - iTemp = 0; - } - return iTemp; - } - - - // Context for EnumCalendarInfoExEx callback. - private class EnumLocaleData - { - public string regionName; - public string cultureName; - } - - // EnumSystemLocaleEx callback. - [NativeCallable(CallingConvention = CallingConvention.StdCall)] - private static unsafe Interop.BOOL EnumSystemLocalesProc(IntPtr lpLocaleString, uint flags, IntPtr contextHandle) - { - EnumLocaleData context = (EnumLocaleData)((GCHandle)contextHandle).Target; - try - { - string cultureName = new string((char*)lpLocaleString); - string regionName = Interop.mincore.GetLocaleInfoEx(cultureName, LOCALE_SISO3166CTRYNAME); - if (regionName != null && regionName.Equals(context.regionName, StringComparison.OrdinalIgnoreCase)) - { - context.cultureName = cultureName; - return Interop.BOOL.FALSE; // we found a match, then stop the enumeration - } - - return Interop.BOOL.TRUE; - } - catch (Exception) - { - return Interop.BOOL.FALSE; - } - } - - // Context for EnumTimeFormatsEx callback. - private class EnumData - { - public LowLevelList<string> strings; - } - - // EnumTimeFormatsEx callback itself. - [NativeCallable(CallingConvention = CallingConvention.StdCall)] - private static unsafe Interop.BOOL EnumTimeCallback(IntPtr lpTimeFormatString, IntPtr lParam) - { - EnumData context = (EnumData)((GCHandle)lParam).Target; - - try - { - context.strings.Add(new string((char*)lpTimeFormatString)); - return Interop.BOOL.TRUE; - } - catch (Exception) - { - return Interop.BOOL.FALSE; - } - } - - private static unsafe String[] nativeEnumTimeFormats(String localeName, uint dwFlags, bool useUserOverride) - { - const uint LOCALE_SSHORTTIME = 0x00000079; - const uint LOCALE_STIMEFORMAT = 0x00001003; - - EnumData data = new EnumData(); - data.strings = new LowLevelList<string>(); - - GCHandle dataHandle = GCHandle.Alloc(data); - try - { - // Now call the enumeration API. Work is done by our callback function - IntPtr callback = AddrofIntrinsics.AddrOf<Func<IntPtr, IntPtr, Interop.BOOL>>(EnumTimeCallback); - Interop.mincore.EnumTimeFormatsEx(callback, localeName, (uint)dwFlags, (IntPtr)dataHandle); - } - finally - { - dataHandle.Free(); - } - - if (data.strings.Count > 0) - { - // Now we need to allocate our stringarray and populate it - string[] results = data.strings.ToArray(); - - if (!useUserOverride && data.strings.Count > 1) - { - // Since there is no "NoUserOverride" aware EnumTimeFormatsEx, we always get an override - // The override is the first entry if it is overriden. - // We can check if we have overrides by checking the GetLocaleInfo with no override - // If we do have an override, we don't know if it is a user defined override or if the - // user has just selected one of the predefined formats so we can't just remove it - // but we can move it down. - uint lcType = (dwFlags == TIME_NOSECONDS) ? LOCALE_SSHORTTIME : LOCALE_STIMEFORMAT; - string timeFormatNoUserOverride = GetLocaleInfoFromLCType(localeName, lcType, useUserOverride); - if (timeFormatNoUserOverride != "") - { - string firstTimeFormat = results[0]; - if (timeFormatNoUserOverride != firstTimeFormat) - { - results[0] = results[1]; - results[1] = firstTimeFormat; - } - } - } - - return results; - } - - return null; - } - - private int LocaleNameToLCID(string cultureName) - { - return GetLocaleInfo(LocaleNumberData.LanguageId); - } - - private static string LCIDToLocaleName(int culture) - { - throw new NotImplementedException(); - } - - private int GetAnsiCodePage(string cultureName) - { - return GetLocaleInfo(LocaleNumberData.AnsiCodePage); - } - - private int GetOemCodePage(string cultureName) - { - return GetLocaleInfo(LocaleNumberData.OemCodePage); - } - - private int GetMacCodePage(string cultureName) - { - return GetLocaleInfo(LocaleNumberData.MacCodePage); - } - - private int GetEbcdicCodePage(string cultureName) - { - return GetLocaleInfo(LocaleNumberData.EbcdicCodePage); - } - - private int GetGeoId(string cultureName) - { - return GetLocaleInfo(LocaleNumberData.GeoId); - } - - private int GetDigitSubstitution(string cultureName) - { - return GetLocaleInfo(LocaleNumberData.DigitSubstitution); - } - - private string GetThreeLetterWindowsLanguageName(string cultureName) - { - return GetLocaleInfo(cultureName, LocaleStringData.AbbreviatedWindowsLanguageName); - } - - private static CultureInfo[] EnumCultures(CultureTypes types) - { - throw new NotImplementedException(); - } - - private string GetConsoleFallbackName(string cultureName) - { - return GetLocaleInfo(cultureName, LocaleStringData.ConsoleFallbackName); - } - - internal bool IsFramework - { - get { throw new NotImplementedException(); } - } - - internal bool IsWin32Installed - { - get { throw new NotImplementedException(); } - } - - internal bool IsReplacementCulture - { - get { throw new NotImplementedException(); } - } - } -} diff --git a/src/mscorlib/corefx/System/Globalization/CultureData.cs b/src/mscorlib/corefx/System/Globalization/CultureData.cs deleted file mode 100644 index c15a77cf45..0000000000 --- a/src/mscorlib/corefx/System/Globalization/CultureData.cs +++ /dev/null @@ -1,2470 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Collections.Generic; -using System.Diagnostics; -using System.Text; -using System.Threading; - -namespace System.Globalization -{ - -#if INSIDE_CLR - using StringStringDictionary = Dictionary<string, string>; - using StringCultureDataDictionary = Dictionary<string, CultureData>; - using LcidToCultureNameDictionary = Dictionary<int, string>; - using Lock = Object; -#else - using StringStringDictionary = LowLevelDictionary<string, string>; - using StringCultureDataDictionary = LowLevelDictionary<string, CultureData>; - using LcidToCultureNameDictionary = LowLevelDictionary<int, string>; -#endif - - // - // List of culture data - // Note the we cache overrides. - // Note that localized names (resource names) aren't available from here. - // - - // - // Our names are a tad confusing. - // - // sWindowsName -- The name that windows thinks this culture is, ie: - // en-US if you pass in en-US - // de-DE_phoneb if you pass in de-DE_phoneb - // fj-FJ if you pass in fj (neutral, on a pre-Windows 7 machine) - // fj if you pass in fj (neutral, post-Windows 7 machine) - // - // sRealName -- The name you used to construct the culture, in pretty form - // en-US if you pass in EN-us - // en if you pass in en - // de-DE_phoneb if you pass in de-DE_phoneb - // - // sSpecificCulture -- The specific culture for this culture - // en-US for en-US - // en-US for en - // de-DE_phoneb for alt sort - // fj-FJ for fj (neutral) - // - // sName -- The IETF name of this culture (ie: no sort info, could be neutral) - // en-US if you pass in en-US - // en if you pass in en - // de-DE if you pass in de-DE_phoneb - // - internal partial class CultureData - { - private const int undef = -1; - - // Override flag - private String _sRealName; // Name you passed in (ie: en-US, en, or de-DE_phoneb) - private String _sWindowsName; // Name OS thinks the object is (ie: de-DE_phoneb, or en-US (even if en was passed in)) - - // Identity - private String _sName; // locale name (ie: en-us, NO sort info, but could be neutral) - private String _sParent; // Parent name (which may be a custom locale/culture) - private String _sLocalizedDisplayName; // Localized pretty name for this locale - private String _sEnglishDisplayName; // English pretty name for this locale - private String _sNativeDisplayName; // Native pretty name for this locale - private String _sSpecificCulture; // The culture name to be used in CultureInfo.CreateSpecificCulture(), en-US form if neutral, sort name if sort - - // Language - private String _sISO639Language; // ISO 639 Language Name - private String _sISO639Language2; // ISO 639 Language Name - private String _sLocalizedLanguage; // Localized name for this language - private String _sEnglishLanguage; // English name for this language - private String _sNativeLanguage; // Native name of this language - private String _sAbbrevLang; // abbreviated language name (Windows Language Name) ex: ENU - private string _sConsoleFallbackName; // The culture name for the console fallback UI culture - private int _iInputLanguageHandle=undef;// input language handle - - // Region - private String _sRegionName; // (RegionInfo) - private String _sLocalizedCountry; // localized country name - private String _sEnglishCountry; // english country name (RegionInfo) - private String _sNativeCountry; // native country name - private String _sISO3166CountryName; // ISO 3166 (RegionInfo), ie: US - private String _sISO3166CountryName2; // 3 char ISO 3166 country name 2 2(RegionInfo) ex: USA (ISO) - private int _iGeoId = undef; // GeoId - - // Numbers - private String _sPositiveSign; // (user can override) positive sign - private String _sNegativeSign; // (user can override) negative sign - // (nfi populates these 5, don't have to be = undef) - private int _iDigits; // (user can override) number of fractional digits - private int _iNegativeNumber; // (user can override) negative number format - private int[] _waGrouping; // (user can override) grouping of digits - private String _sDecimalSeparator; // (user can override) decimal separator - private String _sThousandSeparator; // (user can override) thousands separator - private String _sNaN; // Not a Number - private String _sPositiveInfinity; // + Infinity - private String _sNegativeInfinity; // - Infinity - - // Percent - private int _iNegativePercent = undef; // Negative Percent (0-3) - private int _iPositivePercent = undef; // Positive Percent (0-11) - private String _sPercent; // Percent (%) symbol - private String _sPerMille; // PerMille symbol - - // Currency - private String _sCurrency; // (user can override) local monetary symbol - private String _sIntlMonetarySymbol; // international monetary symbol (RegionInfo) - private String _sEnglishCurrency; // English name for this currency - private String _sNativeCurrency; // Native name for this currency - // (nfi populates these 4, don't have to be = undef) - private int _iCurrencyDigits; // (user can override) # local monetary fractional digits - private int _iCurrency; // (user can override) positive currency format - private int _iNegativeCurrency; // (user can override) negative currency format - private int[] _waMonetaryGrouping; // (user can override) monetary grouping of digits - private String _sMonetaryDecimal; // (user can override) monetary decimal separator - private String _sMonetaryThousand; // (user can override) monetary thousands separator - - // Misc - private int _iMeasure = undef; // (user can override) system of measurement 0=metric, 1=US (RegionInfo) - private String _sListSeparator; // (user can override) list separator - - // Time - private String _sAM1159; // (user can override) AM designator - private String _sPM2359; // (user can override) PM designator - private String _sTimeSeparator; - private volatile String[] _saLongTimes; // (user can override) time format - private volatile String[] _saShortTimes; // short time format - private volatile String[] _saDurationFormats; // time duration format - - // Calendar specific data - private int _iFirstDayOfWeek = undef; // (user can override) first day of week (gregorian really) - private int _iFirstWeekOfYear = undef; // (user can override) first week of year (gregorian really) - private volatile CalendarId[] _waCalendars; // all available calendar type(s). The first one is the default calendar - - // Store for specific data about each calendar - private CalendarData[] _calendars; // Store for specific calendar data - - // Text information - private int _iReadingLayout = undef; // Reading layout data - // 0 - Left to right (eg en-US) - // 1 - Right to left (eg arabic locales) - // 2 - Vertical top to bottom with columns to the left and also left to right (ja-JP locales) - // 3 - Vertical top to bottom with columns proceeding to the right - - // CoreCLR depends on this even though its not exposed publicly. - - private int _iDefaultAnsiCodePage = undef; // default ansi code page ID (ACP) - private int _iDefaultOemCodePage = undef; // default oem code page ID (OCP or OEM) - private int _iDefaultMacCodePage = undef; // default macintosh code page - private int _iDefaultEbcdicCodePage = undef; // default EBCDIC code page - - private int _iLanguage; // locale ID (0409) - NO sort information - private bool _bUseOverrides; // use user overrides? - private bool _bNeutral; // Flags for the culture (ie: neutral or not right now) - - - // Region Name to Culture Name mapping table - // (In future would be nice to be in registry or something) - - //Using a property so we avoid creating the dictionary untill we need it - private static StringStringDictionary RegionNames - { - get - { - if (s_RegionNames == null) - { - StringStringDictionary regionNames = new StringStringDictionary(211 /* prime */); - - regionNames.Add("029", "en-029"); - regionNames.Add("AE", "ar-AE"); - regionNames.Add("AF", "prs-AF"); - regionNames.Add("AL", "sq-AL"); - regionNames.Add("AM", "hy-AM"); - regionNames.Add("AR", "es-AR"); - regionNames.Add("AT", "de-AT"); - regionNames.Add("AU", "en-AU"); - regionNames.Add("AZ", "az-Cyrl-AZ"); - regionNames.Add("BA", "bs-Latn-BA"); - regionNames.Add("BD", "bn-BD"); - regionNames.Add("BE", "nl-BE"); - regionNames.Add("BG", "bg-BG"); - regionNames.Add("BH", "ar-BH"); - regionNames.Add("BN", "ms-BN"); - regionNames.Add("BO", "es-BO"); - regionNames.Add("BR", "pt-BR"); - regionNames.Add("BY", "be-BY"); - regionNames.Add("BZ", "en-BZ"); - regionNames.Add("CA", "en-CA"); - regionNames.Add("CH", "it-CH"); - regionNames.Add("CL", "es-CL"); - regionNames.Add("CN", "zh-CN"); - regionNames.Add("CO", "es-CO"); - regionNames.Add("CR", "es-CR"); - regionNames.Add("CS", "sr-Cyrl-CS"); - regionNames.Add("CZ", "cs-CZ"); - regionNames.Add("DE", "de-DE"); - regionNames.Add("DK", "da-DK"); - regionNames.Add("DO", "es-DO"); - regionNames.Add("DZ", "ar-DZ"); - regionNames.Add("EC", "es-EC"); - regionNames.Add("EE", "et-EE"); - regionNames.Add("EG", "ar-EG"); - regionNames.Add("ES", "es-ES"); - regionNames.Add("ET", "am-ET"); - regionNames.Add("FI", "fi-FI"); - regionNames.Add("FO", "fo-FO"); - regionNames.Add("FR", "fr-FR"); - regionNames.Add("GB", "en-GB"); - regionNames.Add("GE", "ka-GE"); - regionNames.Add("GL", "kl-GL"); - regionNames.Add("GR", "el-GR"); - regionNames.Add("GT", "es-GT"); - regionNames.Add("HK", "zh-HK"); - regionNames.Add("HN", "es-HN"); - regionNames.Add("HR", "hr-HR"); - regionNames.Add("HU", "hu-HU"); - regionNames.Add("ID", "id-ID"); - regionNames.Add("IE", "en-IE"); - regionNames.Add("IL", "he-IL"); - regionNames.Add("IN", "hi-IN"); - regionNames.Add("IQ", "ar-IQ"); - regionNames.Add("IR", "fa-IR"); - regionNames.Add("IS", "is-IS"); - regionNames.Add("IT", "it-IT"); - regionNames.Add("IV", ""); - regionNames.Add("JM", "en-JM"); - regionNames.Add("JO", "ar-JO"); - regionNames.Add("JP", "ja-JP"); - regionNames.Add("KE", "sw-KE"); - regionNames.Add("KG", "ky-KG"); - regionNames.Add("KH", "km-KH"); - regionNames.Add("KR", "ko-KR"); - regionNames.Add("KW", "ar-KW"); - regionNames.Add("KZ", "kk-KZ"); - regionNames.Add("LA", "lo-LA"); - regionNames.Add("LB", "ar-LB"); - regionNames.Add("LI", "de-LI"); - regionNames.Add("LK", "si-LK"); - regionNames.Add("LT", "lt-LT"); - regionNames.Add("LU", "lb-LU"); - regionNames.Add("LV", "lv-LV"); - regionNames.Add("LY", "ar-LY"); - regionNames.Add("MA", "ar-MA"); - regionNames.Add("MC", "fr-MC"); - regionNames.Add("ME", "sr-Latn-ME"); - regionNames.Add("MK", "mk-MK"); - regionNames.Add("MN", "mn-MN"); - regionNames.Add("MO", "zh-MO"); - regionNames.Add("MT", "mt-MT"); - regionNames.Add("MV", "dv-MV"); - regionNames.Add("MX", "es-MX"); - regionNames.Add("MY", "ms-MY"); - regionNames.Add("NG", "ig-NG"); - regionNames.Add("NI", "es-NI"); - regionNames.Add("NL", "nl-NL"); - regionNames.Add("NO", "nn-NO"); - regionNames.Add("NP", "ne-NP"); - regionNames.Add("NZ", "en-NZ"); - regionNames.Add("OM", "ar-OM"); - regionNames.Add("PA", "es-PA"); - regionNames.Add("PE", "es-PE"); - regionNames.Add("PH", "en-PH"); - regionNames.Add("PK", "ur-PK"); - regionNames.Add("PL", "pl-PL"); - regionNames.Add("PR", "es-PR"); - regionNames.Add("PT", "pt-PT"); - regionNames.Add("PY", "es-PY"); - regionNames.Add("QA", "ar-QA"); - regionNames.Add("RO", "ro-RO"); - regionNames.Add("RS", "sr-Latn-RS"); - regionNames.Add("RU", "ru-RU"); - regionNames.Add("RW", "rw-RW"); - regionNames.Add("SA", "ar-SA"); - regionNames.Add("SE", "sv-SE"); - regionNames.Add("SG", "zh-SG"); - regionNames.Add("SI", "sl-SI"); - regionNames.Add("SK", "sk-SK"); - regionNames.Add("SN", "wo-SN"); - regionNames.Add("SV", "es-SV"); - regionNames.Add("SY", "ar-SY"); - regionNames.Add("TH", "th-TH"); - regionNames.Add("TJ", "tg-Cyrl-TJ"); - regionNames.Add("TM", "tk-TM"); - regionNames.Add("TN", "ar-TN"); - regionNames.Add("TR", "tr-TR"); - regionNames.Add("TT", "en-TT"); - regionNames.Add("TW", "zh-TW"); - regionNames.Add("UA", "uk-UA"); - regionNames.Add("US", "en-US"); - regionNames.Add("UY", "es-UY"); - regionNames.Add("UZ", "uz-Cyrl-UZ"); - regionNames.Add("VE", "es-VE"); - regionNames.Add("VN", "vi-VN"); - regionNames.Add("YE", "ar-YE"); - regionNames.Add("ZA", "af-ZA"); - regionNames.Add("ZW", "en-ZW"); - - s_RegionNames = regionNames; - } - - return s_RegionNames; - } - } - - // Cache of regions we've already looked up - private static volatile StringCultureDataDictionary s_cachedRegions; - private static volatile StringStringDictionary s_RegionNames; - - internal static CultureData GetCultureDataForRegion(String cultureName, bool useUserOverride) - { - // First do a shortcut for Invariant - if (String.IsNullOrEmpty(cultureName)) - { - return CultureData.Invariant; - } - - // - // First check if GetCultureData() can find it (ie: its a real culture) - // - CultureData retVal = GetCultureData(cultureName, useUserOverride); - if (retVal != null && (retVal.IsNeutralCulture == false)) return retVal; - - // - // Not a specific culture, perhaps it's region-only name - // (Remember this isn't a core clr path where that's not supported) - // - - // If it was neutral remember that so that RegionInfo() can throw the right exception - CultureData neutral = retVal; - - // Try the hash table next - String hashName = AnsiToLower(useUserOverride ? cultureName : cultureName + '*'); - StringCultureDataDictionary tempHashTable = s_cachedRegions; - if (tempHashTable == null) - { - // No table yet, make a new one - tempHashTable = new StringCultureDataDictionary(); - } - else - { - // Check the hash table - lock (s_lock) - { - tempHashTable.TryGetValue(hashName, out retVal); - } - if (retVal != null) - { - return retVal; - } - } - - // - // Not found in the hash table, look it up the hard way - // - - // If not a valid mapping from the registry we'll have to try the hard coded table - if (retVal == null || (retVal.IsNeutralCulture == true)) - { - // Not a valid mapping, try the hard coded table - string name; - if (RegionNames.TryGetValue(cultureName, out name)) - { - // Make sure we can get culture data for it - retVal = GetCultureData(name, useUserOverride); - } - } - - // If not found in the hard coded table we'll have to find a culture that works for us - if (retVal == null || (retVal.IsNeutralCulture == true)) - { - retVal = GetCultureDataFromRegionName(cultureName); - } - - // If we found one we can use, then cache it for next time - if (retVal != null && (retVal.IsNeutralCulture == false)) - { - // first add it to the cache - lock (s_lock) - { - tempHashTable[hashName] = retVal; - } - - // Copy the hashtable to the corresponding member variables. This will potentially overwrite - // new tables simultaneously created by a new thread, but maximizes thread safety. - s_cachedRegions = tempHashTable; - } - else - { - // Unable to find a matching culture/region, return null or neutral - // (regionInfo throws a more specific exception on neutrals) - retVal = neutral; - } - - // Return the found culture to use, null, or the neutral culture. - return retVal; - } - - // Clear our internal caches - internal static void ClearCachedData() - { - s_cachedCultures = null; - s_cachedRegions = null; - } - - internal static CultureInfo[] GetCultures(CultureTypes types) - { - // Disable warning 618: System.Globalization.CultureTypes.FrameworkCultures' is obsolete -#pragma warning disable 618 - // Validate flags - if ((int)types <= 0 || ((int)types & (int)~(CultureTypes.NeutralCultures | CultureTypes.SpecificCultures | - CultureTypes.InstalledWin32Cultures | CultureTypes.UserCustomCulture | - CultureTypes.ReplacementCultures | CultureTypes.WindowsOnlyCultures | - CultureTypes.FrameworkCultures)) != 0) - { - throw new ArgumentOutOfRangeException(nameof(types), - SR.Format(SR.ArgumentOutOfRange_Range, CultureTypes.NeutralCultures, CultureTypes.FrameworkCultures)); - } - - // We have deprecated CultureTypes.FrameworkCultures. - // When this enum is used, we will enumerate Whidbey framework cultures (for compatibility). - // - - // We have deprecated CultureTypes.WindowsOnlyCultures. - // When this enum is used, we will return an empty array for this enum. - if ((types & CultureTypes.WindowsOnlyCultures) != 0) - { |