2022-06-24 17:04:57 +00:00
|
|
|
|
using Ryujinx.Common.Utilities;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.InteropServices;
|
2019-09-19 00:45:11 +00:00
|
|
|
|
|
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.Time.TimeZone
|
|
|
|
|
{
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 4, Size = 0x4000, CharSet = CharSet.Ansi)]
|
2022-06-24 19:11:56 +00:00
|
|
|
|
public struct TimeZoneRule
|
2019-09-19 00:45:11 +00:00
|
|
|
|
{
|
2022-06-24 17:04:57 +00:00
|
|
|
|
public const int TzMaxTypes = 128;
|
|
|
|
|
public const int TzMaxChars = 50;
|
|
|
|
|
public const int TzMaxLeaps = 50;
|
|
|
|
|
public const int TzMaxTimes = 1000;
|
|
|
|
|
public const int TzNameMax = 255;
|
|
|
|
|
public const int TzCharsArraySize = 2 * (TzNameMax + 1);
|
2019-09-19 00:45:11 +00:00
|
|
|
|
|
|
|
|
|
public int TimeCount;
|
|
|
|
|
public int TypeCount;
|
|
|
|
|
public int CharCount;
|
|
|
|
|
|
|
|
|
|
[MarshalAs(UnmanagedType.I1)]
|
|
|
|
|
public bool GoBack;
|
|
|
|
|
|
|
|
|
|
[MarshalAs(UnmanagedType.I1)]
|
|
|
|
|
public bool GoAhead;
|
|
|
|
|
|
2022-06-24 17:04:57 +00:00
|
|
|
|
[StructLayout(LayoutKind.Sequential, Size = sizeof(long) * TzMaxTimes)]
|
2022-06-24 19:11:56 +00:00
|
|
|
|
private struct AtsStorageStruct { }
|
2019-09-19 00:45:11 +00:00
|
|
|
|
|
2022-06-24 17:04:57 +00:00
|
|
|
|
private AtsStorageStruct _ats;
|
2019-09-19 00:45:11 +00:00
|
|
|
|
|
2022-06-24 17:04:57 +00:00
|
|
|
|
public Span<long> Ats => SpanHelpers.AsSpan<AtsStorageStruct, long>(ref _ats);
|
2019-09-19 00:45:11 +00:00
|
|
|
|
|
2022-06-24 17:04:57 +00:00
|
|
|
|
[StructLayout(LayoutKind.Sequential, Size = sizeof(byte) * TzMaxTimes)]
|
2022-06-24 19:11:56 +00:00
|
|
|
|
private struct TypesStorageStruct { }
|
2022-06-24 17:04:57 +00:00
|
|
|
|
|
|
|
|
|
private TypesStorageStruct _types;
|
|
|
|
|
|
2022-06-24 19:11:56 +00:00
|
|
|
|
public Span<byte> Types => SpanHelpers.AsByteSpan(ref _types);
|
2022-06-24 17:04:57 +00:00
|
|
|
|
|
2022-06-24 19:11:56 +00:00
|
|
|
|
[StructLayout(LayoutKind.Sequential, Size = TimeTypeInfo.Size * TzMaxTypes)]
|
2022-06-24 17:04:57 +00:00
|
|
|
|
private struct TimeTypeInfoStorageStruct { }
|
|
|
|
|
|
|
|
|
|
private TimeTypeInfoStorageStruct _ttis;
|
|
|
|
|
|
|
|
|
|
public Span<TimeTypeInfo> Ttis => SpanHelpers.AsSpan<TimeTypeInfoStorageStruct, TimeTypeInfo>(ref _ttis);
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Size = sizeof(byte) * TzCharsArraySize)]
|
2022-06-24 19:11:56 +00:00
|
|
|
|
private struct CharsStorageStruct { }
|
2022-06-24 17:04:57 +00:00
|
|
|
|
|
|
|
|
|
private CharsStorageStruct _chars;
|
|
|
|
|
public Span<byte> Chars => SpanHelpers.AsByteSpan(ref _chars);
|
2019-09-19 00:45:11 +00:00
|
|
|
|
|
|
|
|
|
public int DefaultType;
|
|
|
|
|
}
|
|
|
|
|
}
|